Function: wrapPtr()
wrapPtr<
T>(ptr,cls):T
Defined in: packages/ffi/src/native.ts:30
Wraps a native pointer in a class instance without calling the constructor. Used when receiving pointers from FFI calls that need to be wrapped as TypeScript objects.
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type | Description |
|---|---|---|
ptr | unknown | The native pointer to wrap |
cls | { prototype: T; } | The class whose prototype should be used |
cls.prototype | T | - |
Returns
T
A new instance with the pointer attached