Skip to content

API Reference / @gtkx/runtime / peekTypeClass

Function: peekTypeClass() ​

peekTypeClass(type, base?): object

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

Returns a GObject class struct, composing the wrappers registered for its ancestry. Backs generated statics such as GObject.ObjectClass.peek and Gtk.WidgetClass.peek.

Parameters ​

type ​

bigint | AnyClass

GType or registered wrapper class.

base? ​

AnyClass

Optional wrapper class the requested type must derive from.

Returns ​

object

The wrapped class struct.

Remarks ​

The class is referenced even before its first instance exists. That reference is never released: class structs live for the rest of the process.

Throws ​

If the type is not a GObject type or does not derive from base.