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

    Interface CallbackWrapper

    Wrapper around a native callback.

    Important: Always call release() when the callback is no longer needed to prevent memory leaks.

    interface CallbackWrapper {
        _callback: Callback;
        pointer: bigint;
        _as_parameter_: bigint;
        release(): void;
        "[dispose]"(): void;
        getLastError(): string;
        setErrorHandler(handler: (message: string) => void): void;
    }

    Hierarchy (View Summary)

    Index
    _callback: Callback
    pointer: bigint

    The callback function pointer, passable to native functions. Throws after release().

    _as_parameter_: bigint

    Same as pointer: lets the callback be passed directly as an argument.

    • Release the callback and free native resources. Must be called when done. Can be called from inside the callback (it does not throw): later invocations return zero.

      Returns void

    • Release the callback at the end of a using block.

      Returns void

    • Message of the last error thrown by the function or by its result conversion, or null.

      Returns string

    • Receive the message of each error thrown by the function (or by the conversion of its result). null restores the default process.emitWarning report.

      Parameters

      • handler: (message: string) => void

      Returns void