Skip to content

Function: defineRegistry()

API / @xmachines/play-svelte / defineRegistry

function defineRegistry<C>(catalog, options): DefineRegistryResult;

Defined in: packages/play-svelte/src/define-registry.ts:153

Create a component registry, restoring catalog-typed params on action handlers.

Drop-in replacement for defineRegistry from @json-render/svelte. Import from @xmachines/play-svelte to get per-action param type inference for free.

Type Parameters

Type Parameter
C extends Catalog<SchemaDefinition<SchemaType<string, unknown>, SchemaType<string, unknown>>, unknown>

Parameters

ParameterTypeDescription
catalogCThe json-render catalog defining component prop shapes and action schemas.
optionsDefineRegistryOptions<C>Registry options. actions entries receive params typed from the catalog.

Returns

DefineRegistryResult