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

    Interface FunctionWrapper

    Wrapper returned by Python-like property access on CDLL.

    Supports the argtypes/restype pattern from Python ctypes.

    const abs_func = libc.abs;
    abs_func.argtypes = [c_int];
    abs_func.restype = c_int;
    console.log(abs_func(-42)); // 42
    interface FunctionWrapper {
        address: bigint;
        _as_parameter_: bigint;
        callAsync(...args: any[]): Promise<any>;
        argtypes: FFIType[];
        restype: FFIType;
        errcheck: ErrcheckCallback;
        (...args: any[]): any;
    }
    • Call the function.

      Parameters

      • ...args: any[]

      Returns any

    Index
    address: bigint

    Resolve the native function address.

    _as_parameter_: bigint
    argtypes: FFIType[]

    Argument types. Set before calling.

    restype: FFIType

    Return type (null for void, as Python's None). Set before calling.

    Optional error checking callback (null when not set).

    • Call the function asynchronously on a worker thread.

      Parameters

      • ...args: any[]

      Returns Promise<any>