From 8113fac939c06b0d71a22d008c060bed3cb47d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Sj=C3=B6green?= Date: Wed, 8 Jun 2022 13:13:10 +0200 Subject: feat(ext/ffi): support passing and returning bigints (#14523) --- cli/dts/lib.deno.unstable.d.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'cli/dts') 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; + 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 "void" ? void + : T extends StaticNativeBigIntType ? bigint : T extends StaticNativeNumberType ? number : T extends "pointer" ? UnsafePointer : never; type StaticForeignFunctionParameter = T extends "void" ? void - : T extends StaticNativeNumberType ? number + : T extends StaticNativeNumberType | StaticNativeBigIntType + ? number | bigint : T extends "pointer" ? Deno.UnsafePointer | Deno.TypedArray | null : unknown; -- cgit v1.2.3