@@ -4029,35 +4029,36 @@ napi_status napi_define_class(napi_env env,
4029
4029
napi_value* result);
4030
4030
```
4031
4031
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.
4049
4049
4050
4050
Returns `napi_ok` if the API succeeded.
4051
4051
4052
4052
Defines 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).
4061
4062
4062
4063
The C++ constructor callback should be a static method on the class that calls
4063
4064
the actual class constructor, then wraps the new C++ instance in a JavaScript
@@ -4091,16 +4092,16 @@ napi_status napi_wrap(napi_env env,
4091
4092
napi_ref* result);
4092
4093
```
4093
4094
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.
4104
4105
4105
4106
Returns `napi_ok` if the API succeeded.
4106
4107
@@ -4145,9 +4146,9 @@ napi_status napi_unwrap(napi_env env,
4145
4146
void** result);
4146
4147
```
4147
4148
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.
4151
4152
4152
4153
Returns `napi_ok` if the API succeeded.
4153
4154
@@ -4172,9 +4173,9 @@ napi_status napi_remove_wrap(napi_env env,
4172
4173
void** result);
4173
4174
```
4174
4175
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.
4178
4179
4179
4180
Returns `napi_ok` if the API succeeded.
4180
4181
@@ -4200,16 +4201,16 @@ napi_status napi_add_finalizer(napi_env env,
4200
4201
napi_ref* result);
4201
4202
```
4202
4203
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.
4213
4214
4214
4215
Returns `napi_ok` if the API succeeded.
4215
4216
0 commit comments