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.ts24
1 files changed, 19 insertions, 5 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts
index d34a5bd62..e3ae8f46f 100644
--- a/cli/tsc/dts/lib.deno.unstable.d.ts
+++ b/cli/tsc/dts/lib.deno.unstable.d.ts
@@ -95,6 +95,13 @@ declare namespace Deno {
type NativeVoidType = "void";
/** **UNSTABLE**: New API, yet to be vetted.
+ *
+ * The native struct type for interfacing with foreign functions.
+ *
+ */
+ type NativeStructType = { readonly struct: readonly NativeType[] };
+
+ /** **UNSTABLE**: New API, yet to be vetted.
*
* All supported types for interfacing with foreign functions.
*
@@ -106,7 +113,8 @@ declare namespace Deno {
| NativeBooleanType
| NativePointerType
| NativeBufferType
- | NativeFunctionType;
+ | NativeFunctionType
+ | NativeStructType;
/** **UNSTABLE**: New API, yet to be vetted.
*
@@ -136,7 +144,9 @@ declare namespace Deno {
*
* @category FFI
*/
- type ToNativeType<T extends NativeType = NativeType> = ToNativeTypeMap[T];
+ type ToNativeType<T extends NativeType = NativeType> = T extends
+ NativeStructType ? BufferSource
+ : ToNativeTypeMap[Exclude<T, NativeStructType>];
/** **UNSTABLE**: New API, yet to be vetted.
*
@@ -153,7 +163,8 @@ declare namespace Deno {
* @category FFI
*/
type ToNativeResultType<T extends NativeResultType = NativeResultType> =
- ToNativeResultTypeMap[T];
+ T extends NativeStructType ? BufferSource
+ : ToNativeResultTypeMap[Exclude<T, NativeStructType>];
/** **UNSTABLE**: New API, yet to be vetted.
*
@@ -193,7 +204,9 @@ declare namespace Deno {
*
* @category FFI
*/
- type FromNativeType<T extends NativeType = NativeType> = FromNativeTypeMap[T];
+ type FromNativeType<T extends NativeType = NativeType> = T extends
+ NativeStructType ? Uint8Array
+ : FromNativeTypeMap[Exclude<T, NativeStructType>];
/** **UNSTABLE**: New API, yet to be vetted.
*
@@ -212,7 +225,8 @@ declare namespace Deno {
* @category FFI
*/
type FromNativeResultType<T extends NativeResultType = NativeResultType> =
- FromNativeResultTypeMap[T];
+ T extends NativeStructType ? Uint8Array
+ : FromNativeResultTypeMap[Exclude<T, NativeStructType>];
/** **UNSTABLE**: New API, yet to be vetted.
*