Deno.ForeignFunction

UNSTABLE: New API, yet to be vetted.

The interface for a foreign function as defined by its parameter and result types.

interface ForeignFunction <Parameters extends readonly NativeType[] = readonly NativeType[], Result extends NativeResultType = NativeResultType, NonBlocking extends boolean = boolean> {
callback?: boolean;
name?: string;
nonblocking?: NonBlocking;
optional?: boolean;
parameters: Parameters;
result: Result;
}

§Type Parameters

§
Parameters extends readonly NativeType[] = readonly NativeType[]
[src]
§
NonBlocking extends boolean = boolean
[src]

§Properties

§
callback?: boolean
[src]

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

§
name?: string
[src]

Name of the symbol.

Defaults to the key name in symbols object.

§
nonblocking?: NonBlocking
[src]

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

§
optional?: boolean
[src]

When true, dlopen will not fail if the symbol is not found. Instead, the symbol will be set to null.

§
parameters: Parameters
[src]

The parameters of the foreign function.

§
result: Result
[src]

The result (return value) of the foreign function.