diff --git a/doc/array_buffer.md b/doc/array_buffer.md index e7217d73a..998a2f2de 100644 --- a/doc/array_buffer.md +++ b/doc/array_buffer.md @@ -59,8 +59,8 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env, - `[in] externalData`: The pointer to the external data to wrap. - `[in] byteLength`: The length of the `externalData`, in bytes. - `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is - destroyed. It must implement `operator()`, accept a `void*` (which is the - `externalData` pointer), and return `void`. + destroyed. It must implement `operator()` with parameters `(Napi::Env, void*)`, + and return `void`. Returns a new `Napi::ArrayBuffer` instance. @@ -85,9 +85,9 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env, - `[in] env`: The environment in which to create the `Napi::ArrayBuffer` instance. - `[in] externalData`: The pointer to the external data to wrap. - `[in] byteLength`: The length of the `externalData`, in bytes. -- `[in] finalizeCallback`: The function to be called when the `Napi::ArrayBuffer` is - destroyed. It must implement `operator()`, accept a `void*` (which is the - `externalData` pointer) and `Hint*`, and return `void`. +- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is + destroyed. It must implement `operator()` with parameters `(Napi::Env, void*, Hint*)`, + and return `void`. - `[in] finalizeHint`: The hint to be passed as the second parameter of the finalize callback. diff --git a/doc/buffer.md b/doc/buffer.md index 8f76b200d..bbe1fb6d0 100644 --- a/doc/buffer.md +++ b/doc/buffer.md @@ -56,9 +56,9 @@ static Napi::Buffer Napi::Buffer::New(napi_env env, - `[in] env`: The environment in which to create the `Napi::Buffer` object. - `[in] data`: The pointer to the external data to expose. - `[in] length`: The number of `T` elements in the external data. -- `[in] finalizeCallback`: The function to be called when the `Napi::Buffer` is - destroyed. It must implement `operator()`, accept a `T*` (which is the - external data pointer), and return `void`. +- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is + destroyed. It must implement `operator()` with parameters `(Napi::Env, T*)`, + and return `void`. Returns a new `Napi::Buffer` object. @@ -82,9 +82,9 @@ static Napi::Buffer Napi::Buffer::New(napi_env env, - `[in] env`: The environment in which to create the `Napi::Buffer` object. - `[in] data`: The pointer to the external data to expose. - `[in] length`: The number of `T` elements in the external data. -- `[in] finalizeCallback`: The function to be called when the `Napi::Buffer` is - destroyed. It must implement `operator()`, accept a `T*` (which is the - external data pointer) and `Hint*`, and return `void`. +- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is + destroyed. It must implement `operator()` with parameters `(Napi::Env, T*, Hint*)`, + and return `void`. - `[in] finalizeHint`: The hint to be passed as the second parameter of the finalize callback. diff --git a/doc/external.md b/doc/external.md index 4022b61dd..4a086b421 100644 --- a/doc/external.md +++ b/doc/external.md @@ -29,7 +29,9 @@ static Napi::External Napi::External::New(napi_env env, - `[in] env`: The `napi_env` environment in which to construct the `Napi::External` object. - `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object. -- `[in] finalizeCallback`: A function called when the `Napi::External` object is released by the garbage collector accepting a T* and returning void. +- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is + destroyed. It must implement `operator()` with parameters `(Napi::Env, T*)`, + and return `void`. Returns the created `Napi::External` object. @@ -45,7 +47,9 @@ static Napi::External Napi::External::New(napi_env env, - `[in] env`: The `napi_env` environment in which to construct the `Napi::External` object. - `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object. -- `[in] finalizeCallback`: A function called when the `Napi::External` object is released by the garbage collector accepting T* and Hint* parameters and returning void. +- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is + destroyed. It must implement `operator()` with parameters `(Napi::Env, T*, Hint*)`, + and return `void`. - `[in] finalizeHint`: A hint value passed to the `finalizeCallback` function. Returns the created `Napi::External` object.