From 62291e9b0e99406ac7f5a95dc329400f9f966825 Mon Sep 17 00:00:00 2001 From: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:08:26 +0530 Subject: feat(ext/ffi): UnsafeFnPointer API (#13340) --- cli/dts/lib.deno.unstable.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cli') diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index b9e9b4d2e..82cb2cc8f 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -250,6 +250,26 @@ declare namespace Deno { copyInto(destination: TypedArray, offset?: number): void; } + /** + * **UNSTABLE**: Unsafe and new API, beware! + * + * An unsafe pointer to a function, for calling functions that are not + * present as symbols. + */ + export class UnsafeFnPointer { + pointer: UnsafePointer; + definition: Fn; + + constructor(pointer: UnsafePointer, definition: Fn); + + call( + ...args: StaticForeignFunctionParameters + ): ConditionalAsync< + Fn["nonblocking"], + StaticForeignFunctionResult + >; + } + /** A dynamic library resource */ export interface DynamicLibrary { /** All of the registered symbols along with functions for calling them */ -- cgit v1.2.3