Type Alias: Catalog<TCatalog>
Documentation / @xmachines/play-catalog / Catalog
type Catalog<TCatalog> = TCatalog;Defined in: types.ts:35
Component catalog mapping component names to Zod prop schemas
Generic type that maps component name strings to their Zod schema validators.
The catalog enables type-safe UI projection by defining the vocabulary of
components that the Actor can reference in meta.view without coupling to
framework implementations.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TCatalog extends Record<string, z.ZodType> | Record<string, z.ZodType> | Record mapping component names to Zod schema types |
Example
Basic catalog type
import { z } from "zod";import { defineCatalog } from "@xmachines/play-catalog";import type { Catalog } from "@xmachines/play-catalog";
const catalog = defineCatalog({ Dashboard: z.object({ userId: z.string() }), LoginForm: z.object({ error: z.string().optional() }),});
type MyCatalog = typeof catalog;// Inferred as: Catalog<{// Dashboard: z.ZodObject<...>,// LoginForm: z.ZodObject<...>// }>See
- defineCatalog for creating catalog instances
- InferComponentProps for extracting prop types