diff options
author | Elias Sjögreen <eliassjogreen1@gmail.com> | 2022-06-08 13:13:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 16:43:10 +0530 |
commit | 8113fac939c06b0d71a22d008c060bed3cb47d72 (patch) | |
tree | cd9734046f414b344d4b8000c125f8b682768177 /cli/dts/lib.deno.unstable.d.ts | |
parent | 2769d602506af1953312b28580506fca3fcbe030 (diff) |
feat(ext/ffi): support passing and returning bigints (#14523)
Diffstat (limited to 'cli/dts/lib.deno.unstable.d.ts')
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index b8eb886e4..12f53b784 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -372,17 +372,25 @@ declare namespace Deno { } /** All possible number types interfacing with foreign functions */ - type StaticNativeNumberType = Exclude<NativeType, "void" | "pointer">; + type StaticNativeNumberType = Exclude< + NativeType, + "void" | "pointer" | StaticNativeBigIntType + >; + + /** All possible bigint types interfacing with foreign functions */ + type StaticNativeBigIntType = "u64" | "i64" | "usize" | "isize"; /** Infers a foreign function return type */ type StaticForeignFunctionResult<T extends NativeType> = T extends "void" ? void + : T extends StaticNativeBigIntType ? bigint : T extends StaticNativeNumberType ? number : T extends "pointer" ? UnsafePointer : never; type StaticForeignFunctionParameter<T> = T extends "void" ? void - : T extends StaticNativeNumberType ? number + : T extends StaticNativeNumberType | StaticNativeBigIntType + ? number | bigint : T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray | null : unknown; |