import type { ComponentType } from 'react'; /** Literal prop values that can be previewed, serialized, and written back safely. */ export type RegistryPropValue = string | number | boolean; export interface RegistryEntry { /** Local rendering is unavailable when the selected revision is newer than the host bundle. Source metadata remains usable by revision-owned previews and code generation. */ component?: ComponentType; /** Previewable props. Boolean vocabularies become On/Off controls; other values become selects. */ props?: Record; /** Optional human-readable labels for preview controls. */ propLabels?: Readonly>; /** Default props on insert. */ defaultProps?: Record; /** Default string children to use when inserting into the component palette. */ defaultChildren?: string; /** 'text' = Edit children as a string (button label) · 'nodes' = Place canvas nodes as children (container components such as Card). */ children?: 'text' | 'none' | 'nodes'; /** * Whether a captured screen subtree may be REPLACED by this entry when a * screen is imported. Only declare it for entries that render the real * component from literal props: a catalog demo or a fixture-seeded adapter * draws its own sample content, so collapsing into it swaps the captured * screen for that sample (five distinct records became five copies of one * fixture record). Default false — the captured DOM is kept, and a * designer can still adopt a node into an instance on demand. */ collapsible?: boolean; /** Path for generating codegen import statements. */ importPath?: string; /** Explicit source export and JSX name; omitted metadata retains the named-import convention. */ sourceImport?: { kind: 'named' | 'default' | 'namespace'; name: string; importedName?: string; }; /** In inspection mode, only actually valid dynamic cases are exposed. */ casePreview?: { /** Whether the text varies in length at runtime, such as user input/API response. */ text?: boolean; /** A preview of what states the component actually supports. */ states?: readonly ('selected' | 'disabled' | 'loading')[]; }; } /** Validated import identity shared by inspection and generated code. */ export declare function registrySourceImport(entry: RegistryEntry | undefined, componentName: string): { importedName?: string | undefined; name: string; kind: "named" | "default" | "namespace"; } | null; export type ComponentRegistry = Record; /** One editor's component registry: the components the host declared. */ export declare function createRegistry(): { setComponentRegistry: (r: ComponentRegistry) => void; getRegistry: () => ComponentRegistry; }; export type Registry = ReturnType;