Function: defineRegistry()
API / @xmachines/play-svelte / defineRegistry
function defineRegistry<C>(catalog, options): DefineRegistryResult;Defined in: packages/play-svelte/src/define-registry.ts:156
Creates a component registry, and gives each action handler its catalog-typed params.
This function is the drop-in replacement for defineRegistry from
@xmachines/json-render-svelte. Import it from @xmachines/play-svelte, and each
action then gets its param type from the catalog.
Type Parameters
| Type Parameter |
|---|
C extends Catalog<SchemaDefinition<SchemaType<string, unknown>, SchemaType<string, unknown>>, unknown> |
Parameters
| Parameter | Type | Description |
|---|---|---|
catalog | C | The json-render catalog. It defines the prop shape of each component and the schema of each action. |
options | DefineRegistryOptions<C> | The registry options. Each actions entry receives its params with the type from the catalog. |
Returns
DefineRegistryResult