summaryrefslogtreecommitdiff
path: root/cli/tsc/dts/lib.deno.unstable.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tsc/dts/lib.deno.unstable.d.ts')
-rw-r--r--cli/tsc/dts/lib.deno.unstable.d.ts31
1 files changed, 9 insertions, 22 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts
index 7847e4874..21d006fad 100644
--- a/cli/tsc/dts/lib.deno.unstable.d.ts
+++ b/cli/tsc/dts/lib.deno.unstable.d.ts
@@ -539,15 +539,15 @@ declare namespace Deno {
*
* @category FFI
*/
- export class UnsafeFnPointer<Fn extends ForeignFunction> {
+ export class UnsafeFnPointer<const Fn extends ForeignFunction> {
/** The pointer to the function. */
pointer: PointerObject<Fn>;
/** The definition of the function. */
definition: Fn;
- constructor(pointer: PointerObject<Fn>, definition: Const<Fn>);
+ constructor(pointer: PointerObject<NoInfer<Fn>>, definition: Fn);
/** @deprecated Properly type {@linkcode pointer} using {@linkcode NativeTypedFunction} or {@linkcode UnsafeCallbackDefinition} types. */
- constructor(pointer: PointerObject, definition: Const<Fn>);
+ constructor(pointer: PointerObject, definition: Fn);
/** Call the foreign function. */
call: FromForeignFunction<Fn>;
@@ -606,10 +606,11 @@ declare namespace Deno {
* @category FFI
*/
export class UnsafeCallback<
- Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition,
+ const Definition extends UnsafeCallbackDefinition =
+ UnsafeCallbackDefinition,
> {
constructor(
- definition: Const<Definition>,
+ definition: Definition,
callback: UnsafeCallbackFunction<
Definition["parameters"],
Definition["result"]
@@ -636,7 +637,7 @@ declare namespace Deno {
static threadSafe<
Definition extends UnsafeCallbackDefinition = UnsafeCallbackDefinition,
>(
- definition: Const<Definition>,
+ definition: Definition,
callback: UnsafeCallbackFunction<
Definition["parameters"],
Definition["result"]
@@ -701,20 +702,6 @@ declare namespace Deno {
close(): void;
}
- /**
- * This magic code used to implement better type hints for {@linkcode Deno.dlopen}
- *
- * @category FFI
- */
- type Cast<A, B> = A extends B ? A : B;
- /** @category FFI */
- type Const<T> = Cast<
- T,
- | (T extends string | number | bigint | boolean ? T : never)
- | { [K in keyof T]: Const<T[K]> }
- | []
- >;
-
/** **UNSTABLE**: New API, yet to be vetted.
*
* Opens an external dynamic library and registers symbols, making foreign
@@ -761,9 +748,9 @@ declare namespace Deno {
* @tags allow-ffi
* @category FFI
*/
- export function dlopen<S extends ForeignLibraryInterface>(
+ export function dlopen<const S extends ForeignLibraryInterface>(
filename: string | URL,
- symbols: Const<S>,
+ symbols: S,
): DynamicLibrary<S>;
/** **UNSTABLE**: New API, yet to be vetted.