node-ctypes - v2.17.1
    Preparing search index...

    Interface FFIFunction

    A callable FFI function returned by CDLL.func.

    This interface only describes the shape of those callables, which are plain JS functions: they are not instances of the runtime value FFIFunction (the native class, see NativeFFIFunction), so lib.func(...) instanceof FFIFunction is false.

    Its restype and argtypes are fixed when it is created (bindings are shared by signature): assigning them throws a TypeError. Use the library attribute (lib.name) or a CFUNCTYPE prototype to change them.

    interface FFIFunction {
        callAsync(...args: any[]): Promise<any>;
        callOn(target: ExecutorTarget, ...args: any[]): Promise<any>;
        restype: FFIType | ((value: any) => any);
        argtypes: readonly FFIType[];
        funcName: string;
        address: bigint;
        _as_parameter_: bigint;
        errcheck: ErrcheckCallback;
        (...args: any[]): any;
    }
    • Call the native function synchronously.

      Parameters

      • ...args: any[]

      Returns any

    Index
    restype: FFIType | ((value: any) => any)

    Return type, fixed at creation: assigning it throws a TypeError.

    argtypes: readonly FFIType[]

    Argument types, fixed at creation: assigning them throws a TypeError.

    funcName: string

    The function name in the native library.

    address: bigint

    The function address as BigInt.

    _as_parameter_: bigint

    Error checking callback, called after every invocation (null when not set).

    • Call the native function asynchronously on a worker thread.

      Memory arguments (Buffer, TypedArray, DataView, ArrayBuffer) are passed in place, as in synchronous calls: do not detach, resize or modify them until the promise settles, and C must not keep their pointers after the call. transfer() of such a view during the call rejects the promise, but native code may already have accessed released memory.

      Parameters

      • ...args: any[]

      Returns Promise<any>