import { Deno } from "https://deno.land/x/deno@v1.28.3/cli/tsc/dts/lib.deno.unstable.d.ts";
const { UnsafeCallback } = Deno;
UNSTABLE: New API, yet to be vetted.
An unsafe function pointer for passing JavaScript functions as C function pointers to foreign function calls.
The function pointer remains valid until the close()
method is called.
The callback can be explicitly referenced via ref()
and dereferenced via
deref()
to stop Deno's process from exiting.
Constructors
Type Parameters
Properties
The callback function.
The definition of the unsafe callback.
The pointer to the unsafe callback.
Methods
Removes the C function pointer associated with this instance.
Continuing to use the instance after calling this object will lead to errors and crashes.
Calling this method will also immediately set the callback's reference counting to zero and it will no longer keep Deno's process from exiting.
Adds one to this callback's reference counting and returns the new reference count.
If the callback's reference count is non-zero, it will keep Deno's process from exiting.
Removes one from this callback's reference counting and returns the new reference count.
If the callback's reference counter is zero, it will no longer keep Deno's process from exiting.