Skip to content

Commit dd6481a

Browse files
mhdawsonTrott
authored andcommitted
doc: add version info for types
Add version info for types in N-API doc. PR-URL: #27754 Fixes: #27486 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 956e08e commit dd6481a

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

doc/api/n-api.md

+56
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ consumed by the various APIs. These APIs should be treated as opaque,
222222
introspectable only with other N-API calls.
223223

224224
### napi_status
225+
<!-- YAML
226+
added: v8.0.0
227+
napiVersion: 1
228+
-->
225229
Integral status code indicating the success or failure of a N-API call.
226230
Currently, the following status codes are supported.
227231
```C
@@ -251,6 +255,10 @@ If additional information is required upon an API returning a failed status,
251255
it can be obtained by calling `napi_get_last_error_info`.
252256

253257
### napi_extended_error_info
258+
<!-- YAML
259+
added: v8.0.0
260+
napiVersion: 1
261+
-->
254262
```C
255263
typedef struct {
256264
const char* error_message;
@@ -283,12 +291,20 @@ not allowed.
283291
This is an opaque pointer that is used to represent a JavaScript value.
284292

285293
### napi_threadsafe_function
294+
<!-- YAML
295+
added: v10.6.0
296+
napiVersion: 4
297+
-->
286298

287299
This is an opaque pointer that represents a JavaScript function which can be
288300
called asynchronously from multiple threads via
289301
`napi_call_threadsafe_function()`.
290302

291303
### napi_threadsafe_function_release_mode
304+
<!-- YAML
305+
added: v10.6.0
306+
napiVersion: 4
307+
-->
292308

293309
A value to be given to `napi_release_threadsafe_function()` to indicate whether
294310
the thread-safe function is to be closed immediately (`napi_tsfn_abort`) or
@@ -302,6 +318,10 @@ typedef enum {
302318
```
303319

304320
### napi_threadsafe_function_call_mode
321+
<!-- YAML
322+
added: v10.6.0
323+
napiVersion: 4
324+
-->
305325

306326
A value to be given to `napi_call_threadsafe_function()` to indicate whether
307327
the call should block whenever the queue associated with the thread-safe
@@ -333,10 +353,18 @@ longer referenced from the current stack frame.
333353
For more details, review the [Object Lifetime Management][].
334354

335355
#### napi_escapable_handle_scope
356+
<!-- YAML
357+
added: v8.0.0
358+
napiVersion: 1
359+
-->
336360
Escapable handle scopes are a special type of handle scope to return values
337361
created within a particular handle scope to a parent scope.
338362

339363
#### napi_ref
364+
<!-- YAML
365+
added: v8.0.0
366+
napiVersion: 1
367+
-->
340368
This is the abstraction to use to reference a `napi_value`. This allows for
341369
users to manage the lifetimes of JavaScript values, including defining their
342370
minimum lifetimes explicitly.
@@ -345,11 +373,19 @@ For more details, review the [Object Lifetime Management][].
345373

346374
### N-API Callback types
347375
#### napi_callback_info
376+
<!-- YAML
377+
added: v8.0.0
378+
napiVersion: 1
379+
-->
348380
Opaque datatype that is passed to a callback function. It can be used for
349381
getting additional information about the context in which the callback was
350382
invoked.
351383

352384
#### napi_callback
385+
<!-- YAML
386+
added: v8.0.0
387+
napiVersion: 1
388+
-->
353389
Function pointer type for user-provided native functions which are to be
354390
exposed to JavaScript via N-API. Callback functions should satisfy the
355391
following signature:
@@ -358,6 +394,10 @@ typedef napi_value (*napi_callback)(napi_env, napi_callback_info);
358394
```
359395

360396
#### napi_finalize
397+
<!-- YAML
398+
added: v8.0.0
399+
napiVersion: 1
400+
-->
361401
Function pointer type for add-on provided functions that allow the user to be
362402
notified when externally-owned data is ready to be cleaned up because the
363403
object with which it was associated with, has been garbage-collected. The user
@@ -372,6 +412,10 @@ typedef void (*napi_finalize)(napi_env env,
372412
```
373413

374414
#### napi_async_execute_callback
415+
<!-- YAML
416+
added: v8.0.0
417+
napiVersion: 1
418+
-->
375419
Function pointer used with functions that support asynchronous
376420
operations. Callback functions must satisfy the following signature:
377421

@@ -385,6 +429,10 @@ JavaScript objects. Most often, any code that needs to make N-API
385429
calls should be made in `napi_async_complete_callback` instead.
386430

387431
#### napi_async_complete_callback
432+
<!-- YAML
433+
added: v8.0.0
434+
napiVersion: 1
435+
-->
388436
Function pointer used with functions that support asynchronous
389437
operations. Callback functions must satisfy the following signature:
390438

@@ -395,6 +443,10 @@ typedef void (*napi_async_complete_callback)(napi_env env,
395443
```
396444

397445
#### napi_threadsafe_function_call_js
446+
<!-- YAML
447+
added: v10.6.0
448+
napiVersion: 4
449+
-->
398450

399451
Function pointer used with asynchronous thread-safe function calls. The callback
400452
will be called on the main thread. Its purpose is to use a data item arriving
@@ -460,6 +512,10 @@ In order to retrieve this information [`napi_get_last_error_info`][]
460512
is provided which returns a `napi_extended_error_info` structure.
461513
The format of the `napi_extended_error_info` structure is as follows:
462514

515+
<!-- YAML
516+
added: v10.6.0
517+
napiVersion: 4
518+
-->
463519
```C
464520
typedef struct napi_extended_error_info {
465521
const char* error_message;

0 commit comments

Comments
 (0)