Skip to content

API Reference / @gtkx/runtime / toNative

Function: toNative() ​

toNative(descriptor, value): unknown

Defined in: packages/runtime/src/native-value.ts:278

Converts a JavaScript value into the raw form native code expects, unwrapping object, struct, boxed, and fundamental wrappers back to their handles, resolving a class passed for a GType to the GType it was registered under, and recursively converting arrays and maps according to the descriptor.

Parameters ​

descriptor ​

Descriptor

Describes the native type to convert to.

value ​

unknown

The JavaScript value to convert.

Returns ​

unknown