Skip to main content
FFI - Deno documentation

Classes

c
Deno.UnsafeCallback
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. All `UnsafeCallback` are always thread safe in that they can be called from foreign threads without crashing. However, they do not wake up the Deno event loop by default. If a callback is to be called from foreign threads, use the `threadSafe()` static constructor or explicitly call `ref()` to have the callback wake up the Deno event loop when called from foreign threads. This also stops Deno's process from exiting while the callback still exists and is not unref'ed. Use `deref()` to then allow Deno's process to exit. Calling `deref()` on a ref'ed callback does not stop it from waking up the Deno event loop when called from foreign threads.
c
Deno.UnsafeFnPointer
An unsafe pointer to a function, for calling functions that are not present as symbols.
c
Deno.UnsafePointer
A collection of static functions for interacting with pointer objects.
c
Deno.UnsafePointerView
An unsafe pointer view to a memory location as specified by the `pointer` value. The `UnsafePointerView` API follows the standard built in interface `DataView` for accessing the underlying types at an memory location (numbers, strings and raw bytes).

Functions

f
Deno.dlopen
Opens an external dynamic library and registers symbols, making foreign functions available to be called. Requires `allow-ffi` permission. Loading foreign dynamic libraries can in theory bypass all of the sandbox permissions. While it is a separate permission users should acknowledge in practice that is effectively the same as running with the `allow-all` permission.

Interfaces

I
Deno.DynamicLibrary
A dynamic library resource. Use [`Deno.dlopen`](./././~/Deno.dlopen) to load a dynamic library and return this interface.
I
Deno.ForeignFunction
The interface for a foreign function as defined by its parameter and result types.
I
Deno.ForeignLibraryInterface
A foreign library interface descriptor.
I
Deno.ForeignStatic
No documentation available
I
Deno.NativeStructType
The native struct type for interfacing with foreign functions.
I
Deno.PointerObject
A non-null pointer, represented as an object at runtime. The object's prototype is `null` and cannot be changed. The object cannot be assigned to either and is thus entirely read-only. To interact with memory through a pointer use the `UnsafePointerView` class. To create a pointer from an address or the get the address of a pointer use the static methods of the `UnsafePointer` class.
I
Deno.UnsafeCallbackDefinition
Definition of a unsafe callback function.

Type Aliases

T
Deno.ConditionalAsync
No documentation available
T
Deno.FromForeignFunction
No documentation available
T
Deno.FromNativeParameterTypes
No documentation available
T
Deno.FromNativeResultType
Type conversion for foreign symbol return types.
T
Deno.FromNativeType
Type conversion for foreign symbol return types and unsafe callback parameters.
T
Deno.NativeBigIntType
All BigInt number types for interfacing with foreign functions.
T
Deno.NativeBooleanType
The native boolean type for interfacing to foreign functions.
T
Deno.NativeBufferType
The native buffer type for interfacing to foreign functions.
T
Deno.NativeFunctionType
The native function type for interfacing with foreign functions.
T
Deno.NativeI16Enum
No documentation available
T
Deno.NativeI32Enum
No documentation available
T
Deno.NativeI8Enum
No documentation available
T
Deno.NativeNumberType
All plain number types for interfacing with foreign functions.
T
Deno.NativePointerType
The native pointer type for interfacing to foreign functions.
T
Deno.NativeResultType
No documentation available
T
Deno.NativeType
All supported types for interfacing with foreign functions.
T
Deno.NativeTypedFunction
No documentation available
T
Deno.NativeTypedPointer
No documentation available
T
Deno.NativeU16Enum
No documentation available
T
Deno.NativeU32Enum
No documentation available
T
Deno.NativeU8Enum
No documentation available
T
Deno.NativeVoidType
The native void type for interfacing with foreign functions.
T
Deno.PointerValue
Pointers are represented either with a `PointerObject` object or a `null` if the pointer is null.
T
Deno.StaticForeignLibraryInterface
A utility type that infers a foreign library interface.
T
Deno.StaticForeignSymbol
A utility type that infers a foreign symbol.
T
Deno.StaticForeignSymbolReturnType
No documentation available
T
Deno.ToNativeParameterTypes
A utility type for conversion of parameter types of foreign functions.
T
Deno.ToNativeResultType
Type conversion for unsafe callback return types.
T
Deno.ToNativeType
Type conversion for foreign symbol parameters and unsafe callback return types.
T
Deno.UnsafeCallbackFunction
An unsafe callback function.

Variables

v
Deno.brand
No documentation available