import { type Deno } from "https://deno.land/x/deno@v1.36.0/cli/tsc/dts/lib.deno.unstable.d.ts";
const { ForeignFunction } = Deno;
UNSTABLE: New API, yet to be vetted.
The interface for a foreign function as defined by its parameter and result types.
Type Parameters
optional
Parameters extends readonly NativeType[] = readonly NativeType[]optional
Result extends NativeResultType = NativeResultTypeProperties
parameters: Parameters
The parameters of the foreign function.
result: Result
The result (return value) of the foreign function.
optional
nonblocking: NonBlockingWhen true
, function calls will run on a dedicated blocking thread and
will return a Promise
resolving to the result
.
When true
, function calls can safely callback into JavaScript or
trigger a garbage collection event.