Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinEady committed Aug 2, 2024
1 parent ec9f521 commit a8f6380
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions doc/array_buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ method will not provide the caller with an opportunity to free the data when the
retained by the `Napi::ArrayBuffer` object please use other variants of the
`Napi::ArrayBuffer::New` factory method that accept `Napi::Finalizer`, which is
a function that will be invoked when the `Napi::ArrayBuffer` object has been
destroyed. See [Finalization]() for more details.
destroyed. See [Finalization][] for more details.
```cpp
static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env, void* externalData, size_t byteLength);
Expand Down Expand Up @@ -74,7 +74,7 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env,
- `[in] byteLength`: The length of the `externalData`, in bytes.
- `[in] finalizeCallback`: A function called when the engine destroys the
`Napi::ArrayBuffer` object, implementing `operator()(Napi::BasicEnv, void*)`.
See [Finalization]() for more details.
See [Finalization][] for more details.
Returns a new `Napi::ArrayBuffer` instance.
Expand Down Expand Up @@ -104,7 +104,7 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env,
- `[in] byteLength`: The length of the `externalData`, in bytes.
- `[in] finalizeCallback`: A function called when the engine destroys the
`Napi::ArrayBuffer` object, implementing `operator()(Napi::BasicEnv, void*,
Hint*)`. See [Finalization]() for more details.
Hint*)`. See [Finalization][] for more details.
- `[in] finalizeHint`: The hint value passed to the `finalizeCallback` function.

Returns a new `Napi::ArrayBuffer` instance.
Expand Down
8 changes: 4 additions & 4 deletions doc/basic_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ or node-addon-api infrastructure.

The `Napi::BasicEnv` object represents an environment that has a limited subset
of APIs when compared to `Napi::Env` and can be used in basic finalizers. See
[Finalization]() for more details.
[Finalization][] for more details.

## Methods

Expand Down Expand Up @@ -122,7 +122,7 @@ inline void PostFinalizer(FinalizerType finalizeCallback) const;
```

- `[in] finalizeCallback`: The function to queue for execution outside of the GC
finalization, implementing `operator()(Napi::Env)`. See [Finalization]() for
finalization, implementing `operator()(Napi::Env)`. See [Finalization][] for
more details.

### PostFinalizer
Expand All @@ -133,7 +133,7 @@ inline void PostFinalizer(FinalizerType finalizeCallback, T* data) const;
```
- `[in] finalizeCallback`: The function to queue for execution outside of the GC
finalization, implementing `operator()(Napi::Env, T*)`. See [Finalization]()
finalization, implementing `operator()(Napi::Env, T*)`. See [Finalization][]
for more details.
- `[in] data`: The data to associate with the object.
Expand All @@ -148,7 +148,7 @@ inline void PostFinalizer(FinalizerType finalizeCallback,

- `[in] finalizeCallback`: The function to queue for execution outside of the GC
finalization, implementing `operator()(Napi::Env, T*, Hint*)`. See
[Finalization]() for more details.
[Finalization][] for more details.
- `[in] data`: The data to associate with the object.
- `[in] finalizeHint`: The hint value passed to the `finalizeCallback` function.

Expand Down
10 changes: 5 additions & 5 deletions doc/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ with an opportunity to free the data when the `Napi::Buffer` gets
garbage-collected. If you need to free the data retained by the `Napi::Buffer`
object please use other variants of the `Napi::Buffer::New` factory method that
accept `Finalizer`, which is a function that will be invoked when the
`Napi::Buffer` object has been destroyed. See [Finalization]() for more details.
`Napi::Buffer` object has been destroyed. See [Finalization][] for more details.
```cpp
static Napi::Buffer<T> Napi::Buffer::New(napi_env env, T* data, size_t length);
Expand Down Expand Up @@ -71,7 +71,7 @@ static Napi::Buffer<T> Napi::Buffer::New(napi_env env,
- `[in] length`: The number of `T` elements in the external data.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::Buffer` object, implementing `operator()(Napi::BasicEnv, T*)`. See
[Finalization]() for more details.
[Finalization][] for more details.
Returns a new `Napi::Buffer` object.
Expand Down Expand Up @@ -100,7 +100,7 @@ static Napi::Buffer<T> Napi::Buffer::New(napi_env env,
- `[in] length`: The number of `T` elements in the external data.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::Buffer` object, implementing `operator()(Napi::BasicEnv, T*, Hint*)`.
See [Finalization]() for more details.
See [Finalization][] for more details.
- `[in] finalizeHint`: The hint value passed to the `finalizeCallback` function.

Returns a new `Napi::Buffer` object.
Expand Down Expand Up @@ -157,7 +157,7 @@ static Napi::Buffer<T> Napi::Buffer::NewOrCopy(napi_env env,
- `[in] length`: The number of `T` elements in the external data.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::Buffer` object, implementing `operator()(Napi::BasicEnv, T*)`. See
[Finalization]() for more details.
[Finalization][] for more details.

Returns a new `Napi::Buffer` object.

Expand Down Expand Up @@ -186,7 +186,7 @@ static Napi::Buffer<T> Napi::Buffer::NewOrCopy(napi_env env,
- `[in] length`: The number of `T` elements in the external data.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::Buffer` object, implementing `operator()(Napi::BasicEnv, T*, Hint*)`.
See [Finalization]() for more details.
See [Finalization][] for more details.
- `[in] finalizeHint`: The hint value passed to the `finalizeCallback` function.
Returns a new `Napi::Buffer` object.
Expand Down
4 changes: 3 additions & 1 deletion doc/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ The `Napi::Env` object is usually created and passed by the Node.js runtime or
node-addon-api infrastructure.

The `Napi::Env` object represents an environment that has a superset of APIs
when compared to `Napi::BasicEnv` and therefore _cannot_ be used in basic finalizers.
when compared to `Napi::BasicEnv` and therefore _cannot_ be used in basic
finalizers. See [Finalization][] for more details.

## Methods

Expand Down Expand Up @@ -81,3 +82,4 @@ The `script` can be any of the following types:
- `const char *`
- `const std::string &`
[Finalization]: ./finalization.md
6 changes: 3 additions & 3 deletions doc/external.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `Napi::External` template class implements the ability to create a `Napi::Va
optional Hint value. The `Finalizer` function, if specified, is called when your
`Napi::External` object is released by Node's garbage collector. It gives your
code the opportunity to free any dynamically created data. If you specify a Hint
value, it is passed to your `Finalizer` function. See [Finalization]() for more details.
value, it is passed to your `Finalizer` function. See [Finalization][] for more details.

Note that `Napi::Value::IsExternal()` will return `true` for any external value.
It does not differentiate between the templated parameter `T` in
Expand Down Expand Up @@ -44,7 +44,7 @@ static Napi::External Napi::External::New(napi_env env,
- `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::External` object, implementing `operator()(Napi::BasicEnv, T*)`. See
[Finalization]() for more details.
[Finalization][] for more details.

Returns the created `Napi::External<T>` object.

Expand All @@ -62,7 +62,7 @@ static Napi::External Napi::External::New(napi_env env,
- `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object.
- `[in] finalizeCallback`: The function called when the engine destroys the
`Napi::External` object, implementing `operator()(Napi::BasicEnv, T*, Hint*)`.
See [Finalization]() for more details.
See [Finalization][] for more details.
- `[in] finalizeHint`: The hint value passed to the `finalizeCallback` function.
Returns the created `Napi::External<T>` object.
Expand Down
2 changes: 1 addition & 1 deletion doc/object_wrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ request being made.
### Finalize
Provides an opportunity to run cleanup code that only utilizes basic Node APIs, if any.
Override to implement. See [Finalization]() for more details.
Override to implement. See [Finalization][] for more details.
```cpp
virtual void Finalize(Napi::BasicEnv env);
Expand Down

0 comments on commit a8f6380

Please sign in to comment.