@@ -4029,35 +4029,36 @@ napi_status napi_define_class(napi_env env,
40294029 napi_value* result);
40304030```
40314031
4032- - `[in] env`: The environment that the API is invoked under.
4033- - `[in] utf8name`: Name of the JavaScript constructor function; this is
4034- not required to be the same as the C++ class name, though it is recommended
4035- for clarity.
4036- - `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH`
4037- if it is null-terminated.
4038- - `[in] constructor`: Callback function that handles constructing instances
4039- of the class. (This should be a static method on the class, not an actual
4040- C++ constructor function.)
4041- - `[in] data`: Optional data to be passed to the constructor callback as
4042- the `data` property of the callback info.
4043- - `[in] property_count`: Number of items in the `properties` array argument.
4044- - `[in] properties`: Array of property descriptors describing static and
4045- instance data properties, accessors, and methods on the class
4046- See `napi_property_descriptor`.
4047- - `[out] result`: A `napi_value` representing the constructor function for
4048- the class.
4032+ - `[in] env`: The environment that the API is invoked under.
4033+ - `[in] utf8name`: Name of the JavaScript constructor function; this is
4034+ not required to be the same as the C++ class name, though it is recommended
4035+ for clarity.
4036+ - `[in] length`: The length of the `utf8name` in bytes, or `NAPI_AUTO_LENGTH`
4037+ if it is null-terminated.
4038+ - `[in] constructor`: Callback function that handles constructing instances
4039+ of the class. (This should be a static method on the class, not an actual
4040+ C++ constructor function.)
4041+ - `[in] data`: Optional data to be passed to the constructor callback as
4042+ the `data` property of the callback info.
4043+ - `[in] property_count`: Number of items in the `properties` array argument.
4044+ - `[in] properties`: Array of property descriptors describing static and
4045+ instance data properties, accessors, and methods on the class
4046+ See `napi_property_descriptor`.
4047+ - `[out] result`: A `napi_value` representing the constructor function for
4048+ the class.
40494049
40504050Returns `napi_ok` if the API succeeded.
40514051
40524052Defines a JavaScript class that corresponds to a C++ class, including:
4053- - A JavaScript constructor function that has the class name and invokes the
4054- provided C++ constructor callback.
4055- - Properties on the constructor function corresponding to _static_ data
4056- properties, accessors, and methods of the C++ class (defined by
4057- property descriptors with the `napi_static` attribute).
4058- - Properties on the constructor function's `prototype` object corresponding to
4059- _non-static_ data properties, accessors, and methods of the C++ class
4060- (defined by property descriptors without the `napi_static` attribute).
4053+
4054+ - A JavaScript constructor function that has the class name and invokes the
4055+ provided C++ constructor callback.
4056+ - Properties on the constructor function corresponding to _static_ data
4057+ properties, accessors, and methods of the C++ class (defined by
4058+ property descriptors with the `napi_static` attribute).
4059+ - Properties on the constructor function's `prototype` object corresponding to
4060+ _non-static_ data properties, accessors, and methods of the C++ class
4061+ (defined by property descriptors without the `napi_static` attribute).
40614062
40624063The C++ constructor callback should be a static method on the class that calls
40634064the actual class constructor, then wraps the new C++ instance in a JavaScript
@@ -4091,16 +4092,16 @@ napi_status napi_wrap(napi_env env,
40914092 napi_ref* result);
40924093```
40934094
4094- - `[in] env`: The environment that the API is invoked under.
4095- - `[in] js_object`: The JavaScript object that will be the wrapper for the
4096- native object.
4097- - `[in] native_object`: The native instance that will be wrapped in the
4098- JavaScript object.
4099- - `[in] finalize_cb`: Optional native callback that can be used to free the
4100- native instance when the JavaScript object is ready for garbage-collection.
4101- - `[in] finalize_hint`: Optional contextual hint that is passed to the
4102- finalize callback.
4103- - `[out] result`: Optional reference to the wrapped object.
4095+ - `[in] env`: The environment that the API is invoked under.
4096+ - `[in] js_object`: The JavaScript object that will be the wrapper for the
4097+ native object.
4098+ - `[in] native_object`: The native instance that will be wrapped in the
4099+ JavaScript object.
4100+ - `[in] finalize_cb`: Optional native callback that can be used to free the
4101+ native instance when the JavaScript object is ready for garbage-collection.
4102+ - `[in] finalize_hint`: Optional contextual hint that is passed to the
4103+ finalize callback.
4104+ - `[out] result`: Optional reference to the wrapped object.
41044105
41054106Returns `napi_ok` if the API succeeded.
41064107
@@ -4145,9 +4146,9 @@ napi_status napi_unwrap(napi_env env,
41454146 void** result);
41464147```
41474148
4148- - `[in] env`: The environment that the API is invoked under.
4149- - `[in] js_object`: The object associated with the native instance.
4150- - `[out] result`: Pointer to the wrapped native instance.
4149+ - `[in] env`: The environment that the API is invoked under.
4150+ - `[in] js_object`: The object associated with the native instance.
4151+ - `[out] result`: Pointer to the wrapped native instance.
41514152
41524153Returns `napi_ok` if the API succeeded.
41534154
@@ -4172,9 +4173,9 @@ napi_status napi_remove_wrap(napi_env env,
41724173 void** result);
41734174```
41744175
4175- - `[in] env`: The environment that the API is invoked under.
4176- - `[in] js_object`: The object associated with the native instance.
4177- - `[out] result`: Pointer to the wrapped native instance.
4176+ - `[in] env`: The environment that the API is invoked under.
4177+ - `[in] js_object`: The object associated with the native instance.
4178+ - `[out] result`: Pointer to the wrapped native instance.
41784179
41794180Returns `napi_ok` if the API succeeded.
41804181
@@ -4200,16 +4201,16 @@ napi_status napi_add_finalizer(napi_env env,
42004201 napi_ref* result);
42014202```
42024203
4203- - `[in] env`: The environment that the API is invoked under.
4204- - `[in] js_object`: The JavaScript object to which the native data will be
4205- attached.
4206- - `[in] native_object`: The native data that will be attached to the JavaScript
4207- object.
4208- - `[in] finalize_cb`: Native callback that will be used to free the
4209- native data when the JavaScript object is ready for garbage-collection.
4210- - `[in] finalize_hint`: Optional contextual hint that is passed to the
4211- finalize callback.
4212- - `[out] result`: Optional reference to the JavaScript object.
4204+ - `[in] env`: The environment that the API is invoked under.
4205+ - `[in] js_object`: The JavaScript object to which the native data will be
4206+ attached.
4207+ - `[in] native_object`: The native data that will be attached to the JavaScript
4208+ object.
4209+ - `[in] finalize_cb`: Native callback that will be used to free the
4210+ native data when the JavaScript object is ready for garbage-collection.
4211+ - `[in] finalize_hint`: Optional contextual hint that is passed to the
4212+ finalize callback.
4213+ - `[out] result`: Optional reference to the JavaScript object.
42134214
42144215Returns `napi_ok` if the API succeeded.
42154216
0 commit comments