From d67ee9a08be200dc1ce9a416c9cda82730e24b68 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Thu, 30 May 2024 05:30:11 +0300 Subject: BREAKING(ffi/unstable): use BigInt representation in turbocall (#23983) Built ontop of #23981, this sets FFI turbocalls (Fast Call API) to use the BigInt representation. --- cli/tsc/dts/lib.deno.unstable.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cli/tsc') diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index a3e0d2eb0..4a92f6872 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -220,7 +220,7 @@ declare namespace Deno { : T extends NativeU32Enum ? U : T extends NativeI32Enum ? U : number - : T extends NativeBigIntType ? number | bigint + : T extends NativeBigIntType ? bigint : T extends NativeBooleanType ? boolean : T extends NativePointerType ? T extends NativeTypedPointer ? U | null : PointerValue @@ -501,7 +501,7 @@ declare namespace Deno { */ export class UnsafePointer { /** Create a pointer from a numeric value. This one is really dangerous! */ - static create(value: number | bigint): PointerValue; + static create(value: bigint): PointerValue; /** Returns `true` if the two pointers point to the same address. */ static equals(a: PointerValue, b: PointerValue): boolean; /** Return the direct memory pointer to the typed array in memory. */ @@ -514,7 +514,7 @@ declare namespace Deno { offset: number, ): PointerValue; /** Get the numeric value of a pointer */ - static value(value: PointerValue): number | bigint; + static value(value: PointerValue): bigint; } /** **UNSTABLE**: New API, yet to be vetted. @@ -554,10 +554,10 @@ declare namespace Deno { getInt32(offset?: number): number; /** Gets an unsigned 64-bit integer at the specified byte offset from the * pointer. */ - getBigUint64(offset?: number): number | bigint; + getBigUint64(offset?: number): bigint; /** Gets a signed 64-bit integer at the specified byte offset from the * pointer. */ - getBigInt64(offset?: number): number | bigint; + getBigInt64(offset?: number): bigint; /** Gets a signed 32-bit float at the specified byte offset from the * pointer. */ getFloat32(offset?: number): number; @@ -816,7 +816,7 @@ declare namespace Deno { * ); * * // Call the symbol `add` - * const result = dylib.symbols.add(35, 34); // 69 + * const result = dylib.symbols.add(35n, 34n); // 69n * * console.log(`Result from external addition of 35 and 34: ${result}`); * ``` -- cgit v1.2.3