How to use the ffi-napi.Callback function in ffi-napi

To help you get started, we’ve selected a few ffi-napi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Bannerets / tdl / src / tdlib-ffi.js View on Github external
setLogFatalErrorCallback (fn: null | (errorMessage: string) => void): void {
    if (fn == null) {
      this._tdlib.td_set_log_fatal_error_callback(null)
    } else {
      this._tdlib.td_set_log_fatal_error_callback(
        ffi.Callback('void', ['string'], fn))
    }
  }
}

ffi-napi

A foreign function interface (FFI) for Node.js, N-API style

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis