Skip to main content
interface Deno.ForeignFunction
Unstable

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 = NativeResultType
optional
NonBlocking extends boolean = boolean

Properties

optional
name: string

Name of the symbol.

Defaults to the key name in symbols object.

parameters: Parameters

The parameters of the foreign function.

result: Result

The result (return value) of the foreign function.

optional
nonblocking: NonBlocking

When true, function calls will run on a dedicated blocking thread and will return a Promise resolving to the result.

optional
callback: boolean

When true, function calls can safely callback into JavaScript or trigger a garbage collection event.

Default is false.