diff options
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 3482d1c80..389d08f9f 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -390,17 +390,14 @@ declare namespace Deno { ? void : T extends StaticNativeBigIntType ? bigint : T extends StaticNativeNumberType ? number - : T extends "pointer" ? UnsafePointer + : T extends "pointer" ? bigint : never; type StaticForeignFunctionParameter<T> = T extends "void" ? void : T extends StaticNativeNumberType | StaticNativeBigIntType ? number | bigint - : T extends "pointer" ? UnsafePointer | TypedArray | null - : T extends NativeCallbackType< - infer U extends readonly NativeType[], - infer V extends NativeParameterType - > ? UnsafeCallback<U, V> | UnsafePointer | null + : T extends "pointer" ? bigint | TypedArray | null + : T extends NativeCallbackType ? bigint | null : unknown; /** Infers a foreign function parameter list. */ @@ -449,19 +446,10 @@ declare namespace Deno { * An unsafe pointer to a memory location for passing and returning pointers to and from the ffi */ export class UnsafePointer { - constructor(value: bigint); - - value: bigint; - /** * Return the direct memory pointer to the typed array in memory */ - static of(typedArray: TypedArray): UnsafePointer; - - /** - * Returns the value of the pointer which is useful in certain scenarios. - */ - valueOf(): bigint; + static of(value: Deno.UnsafeCallback | TypedArray): bigint; } /** **UNSTABLE**: Unsafe and new API, beware! @@ -472,9 +460,9 @@ declare namespace Deno { * (numbers, strings and raw bytes). */ export class UnsafePointerView { - constructor(pointer: UnsafePointer); + constructor(pointer: bigint); - pointer: UnsafePointer; + pointer: bigint; /** Gets an unsigned 8-bit integer at the specified byte offset from the pointer. */ getUint8(offset?: number): number; @@ -511,10 +499,10 @@ declare namespace Deno { * present as symbols. */ export class UnsafeFnPointer<Fn extends ForeignFunction> { - pointer: UnsafePointer; + pointer: bigint; definition: Fn; - constructor(pointer: UnsafePointer, definition: Fn); + constructor(pointer: bigint, definition: Fn); call( ...args: StaticForeignFunctionParameters<Fn["parameters"]> @@ -552,18 +540,15 @@ declare namespace Deno { type UnsafeCallbackParameter<T extends NativeType> = T extends StaticNativeBigIntType ? bigint : T extends StaticNativeNumberType ? number - : T extends "pointer" ? UnsafePointer + : T extends "pointer" ? bigint : never; type UnsafeCallbackResult<T extends NativeParameterType> = T extends "void" ? void : T extends StaticNativeBigIntType ? number | bigint : T extends StaticNativeNumberType ? number - : T extends "pointer" ? UnsafePointer | TypedArray | null - : T extends NativeCallbackType< - infer U extends readonly NativeType[], - infer V extends NativeParameterType - > ? UnsafeCallback<U, V> | UnsafePointer | null + : T extends "pointer" ? bigint | TypedArray | null + : T extends NativeCallbackType ? bigint | null : never; type UnsafeCallbackFunction< @@ -594,7 +579,7 @@ declare namespace Deno { callback: UnsafeCallbackFunction<Parameters, Result>, ); - pointer: UnsafePointer; + pointer: bigint; definition: UnsafeCallbackDefinition<Parameters, Result>; callback: UnsafeCallbackFunction<Parameters, Result>; |