diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 3a090344fc92c8..8689f6bf90f5c1 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -898,6 +898,24 @@ typedef void (*napi_threadsafe_function_call_js)(napi_env env, Unless for reasons discussed in [Object Lifetime Management][], creating a handle and/or callback scope inside the function body is not necessary. +#### `napi_cleanup_hook` + + + +Function pointer used with [`napi_add_env_cleanup_hook`][]. It will be called +when the environment is being torn down. + +Callback functions must satisfy the following signature: + +```c +typedef void (*napi_cleanup_hook)(void* data); +``` + +* `[in] data`: The data that was passed to [`napi_add_env_cleanup_hook`][]. + #### `napi_async_cleanup_hook`