Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enum types
- Describes the type of a
- This generally corresponds to the types
- described in
- Section 6.1 of the ECMAScript Language Specification.
- In addition to types in that section, can also represent
- and with external data.
- A JavaScript value of type appears in JavaScript as a plain
- object such that no properties can be set on it, and no prototype.
- This represents the underlying binary scalar datatype of the
- Elements of this enum correspond to
- Section 22.2 of the ECMAScript Language Specification.
- Object Creation Functions
- The environment that the N-API call is invoked under.
- A representing a JavaScript.
- Returns if the API succeeded.
- This API returns an N-API value corresponding to a JavaScript type.
- JavaScript arrays are described in Section 22.1 of the ECMAScript Language Specification.
- The environment that the API is invoked under.
- The initial length of the
- The length property is set to the passed-in length parameter.
- However, the underlying buffer is not guaranteed to be pre-allocated by the VM
- when the array is created - that behavior is left to the underlying VM
- implementation.
- If the buffer must be a contiguous block of memory that can be
- directly read and/or written via C, consider using
- The length in bytes of the array buffer to create.
- Pointer to the underlying byte buffer of the
- are used to represent fixed-length binary data buffers.
- They are
- normally used as a backing-buffer for objects.
- The allocated will have an underlying byte buffer whose size is
- determined by the parameter that's passed in.
- The underlying buffer is optionally returned back to the caller in case the
- caller wants to directly manipulate the buffer.
- This buffer can only be
- written to directly from native code.
- To write to this buffer from JavaScript,
- a typed array or object would need to be created.
- JavaScript objects are described in
- Section 24.1 of the ECMAScript Language Specification.
- Size in bytes of the underlying buffer.
- Raw pointer to the underlying buffer.
- This API allocates a object.
- While this is still a
- fully-supported data structure, in most cases using a will suffice.
- Size in bytes of the input buffer (should be the same as the
- size of the new buffer).
- Raw pointer to the underlying buffer to copy from.
- Pointer to the new underlying data buffer.
- This API allocates a object and initializes it with data copied
- from the passed-in buffer.
- Raw pointer to the external data
- Optional callback to call when the external value
- is being collected.
- Optional hint to pass to the finalize callback
- during collection.
- representing an external value.
- This API allocates a JavaScript value with external data attached to it.
- This
- is used to pass external data through JavaScript code, so it can be retrieved
- later by native code.
- The API allows the caller to pass in a finalize callback,
- in case the underlying native resource needs to be cleaned up when the external
- JavaScript value gets collected.
- The created value is not an object, and therefore does not support additional
- properties.
- It is considered a distinct value type: calling with
- an external value yields
- The length in bytes of the underlying buffer.
- The underlying byte buffer of the is externally allocated and
- managed.
- The caller must ensure that the byte buffer remains valid until the
- finalize callback is called.
- This API allocates a object and initializes it with data
- backed by the passed in buffer.
- For Node.js >=4 are
- A string representing the name of the function encoded as
- UTF8.
- The length of the in bytes, or if it is null-terminated.
- A function pointer to the native function to be invoked when the created function is invoked from JavaScript.
- Optional arbitrary context data to be passed into the native
- function when it is invoked.
- It's used to wrap native functions so that they can be invoked from JavaScript.
- JavaScript are described in
- Section 19.2
- of the ECMAScript Language Specification.
- This API allocates a default JavaScript
- It is the equivalent of doing in JavaScript.
- The JavaScript type is described in
- Section 6.1.7 of the
- ECMAScript Language Specification.
- Optional which refers to a JavaScript to be set as the description for the symbol.
- This API creates a JavaScript object from a UTF8-encoded C string.
- The JavaScript type is described in
- Section 19.4
- of the ECMAScript Language Specification.
- Scalar datatype of the elements within the
- Number of elements in the
- underlying the typed array.
- The byte offset within the from which to
- start projecting the
- This API creates a JavaScript object over an existing
- objects provide an array-like view over an
- underlying data buffer where each element has the same underlying binary scalar
- datatype.
- It's required that should
- be <= the size in bytes of the array passed in.
- If not, a exception
- is raised.
- JavaScript objects are described in
- Section 22.2 of the ECMAScript Language Specification.
- underlying the
- objects provide an array-like view over an underlying data buffer,
- but one which allows items of different size and type in the
- It is required that is less than or equal to the
- size in bytes of the array passed in.
- JavaScript objects are described in
- Section 24.3 of the ECMAScript Language Specification.
- Functions to convert from C types to N-API
- Integer value to be represented in JavaScript.
- This API is used to convert from the C type to the JavaScript type.
- Unsigned integer value to be represented in JavaScript.
- Note the complete range of
- cannot be represented with full precision in JavaScript.
- Integer values
- outside the range of
- will lose precision.
- Double-precision value to be represented in JavaScript.
- Character buffer representing an ISO-8859-1-encoded string.
- The length of the string in bytes, or
- if it is null-terminated.
- This API creates a JavaScript object from an ISO-8859-1-encoded C
- string.
- The native string is copied.
- Character buffer representing a UTF16-LE-encoded string.
- The length of the string in two-byte code units, or
- if it is null-terminated.
- This API creates a JavaScript object from a UTF16-LE-encoded C string.
- Functions to convert from N-API to C types
- representing the JavaScript whose length is
- being queried.
- representing length of the array.
- This API returns the length of an array.
- length is described in
- Section 22.1.4.1
- of the ECMAScript Language Specification.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement