API Reference / @gtkx/react / @gtkx/react/config
@gtkx/react/config
Element registration and renderer behaviors, such as defineElements and defineBehavior.
Type Aliases
| Type Alias | Description |
|---|---|
| DetachInfo | Per-child values a slot hook receives while removing one child. |
| ElementBehavior | - |
| ElementConfig | How one GLib type is rendered. |
| ElementPropsExport | - |
| ModuleExport | A named export in a module, referenced as plain data (the module is never imported at runtime). |
| PlaceInfo | Per-child values a slot hook receives while placing or moving one child. |
| Props | The props of a host element or node, as React passes them through the reconciler. |
Variables
| Variable | Description |
|---|---|
| BUILTIN_ELEMENTS | - |
| ELEMENTS | Every registered element config, keyed by GLib type name. |
Functions
| Function | Description |
|---|---|
| defineBehavior | Types one behavior against the GObject class it applies to, so every hook's object parameter is inferred rather than annotated by hand. Pass the class as the type argument. |
| defineElements | Identity helper that types the module named by elements.behaviors in gtkx.config.ts, enabling editor autocompletion and type checking. Key each entry by GLib type name and write each behavior with defineBehavior so its hooks receive the concrete GObject class. |
| mergeElementConfigs | Merges maps of ElementConfig keyed by GLib type name into one, concatenating each type's behaviors and omitted props in the order the maps are given (an earlier map's behaviors come first), taking the last component and props seen, and marking a type lazy if any map does. Use it to combine an app's element config with its behaviors. |