Skip to content

API Reference / @gtkx/runtime / registerWrapperClassResolver

Function: registerWrapperClassResolver() ​

registerWrapperClassResolver(cls, resolver): void

Defined in: packages/runtime/src/registry.ts:229

Registers a resolver for native subtypes sharing one GType, such as Cairo surface types.

The resolver runs when wrapping a handle with cls explicitly. It does not run when the wrapper is selected from the handle's runtime GType or when a subclass is passed directly to wrapHandle.

Parameters ​

cls ​

AnyClass

Registered wrapper class whose handles need classification.

resolver ​

WrapperClassResolver

Selects the wrapper class for a handle, including cls itself.

Returns ​

void

Throws ​

If cls is not registered.