/** * Memoire Registry Protocol — v1 compatibility schema * * A registry is a versioned, distributable design system package. It bundles * design tokens, component specs, and optional generated code into a shape * any project can consume via `memi add --from `. * * Distribution channels: npm packages, GitHub repos, raw HTTPS URLs. * * New code should import this through `src/registry/legacy.ts` so V1 remains * clearly separated from shadcn-native V2 registry output. */ import { z } from "zod"; export declare const REGISTRY_SCHEMA_VERSION = "v1"; export declare const REGISTRY_FILENAME = "registry.json"; export declare const RegistryTokenRefSchema: z.ZodObject<{ href: z.ZodString; format: z.ZodDefault>; }, "strip", z.ZodTypeAny, { format: "style-dictionary" | "w3c-dtcg" | "css-vars"; href: string; }, { href: string; format?: "style-dictionary" | "w3c-dtcg" | "css-vars" | undefined; }>; export declare const RegistryComponentRefSchema: z.ZodObject<{ name: z.ZodString; href: z.ZodString; level: z.ZodOptional>; framework: z.ZodDefault>; /** Optional pre-generated code for this component */ code: z.ZodOptional; }, "strip", z.ZodTypeAny, { framework: "react" | "vue" | "svelte"; href: string; }, { framework: "react" | "vue" | "svelte"; href: string; }>>; }, "strip", z.ZodTypeAny, { framework: "react" | "vue" | "svelte" | "agnostic"; name: string; href: string; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }, { name: string; href: string; framework?: "react" | "vue" | "svelte" | "agnostic" | undefined; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }>; export declare const RegistryMetaSchema: z.ZodObject<{ sourceFigmaUrl: z.ZodOptional; sourcePenpotFileId: z.ZodOptional; sourceDesignDocUrl: z.ZodOptional; extractedAt: z.ZodString; memoireVersion: z.ZodString; }, "strip", z.ZodTypeAny, { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }, { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }>; export declare const RegistrySchema: z.ZodObject<{ $schema: z.ZodDefault; /** npm-style package name — scoped or unscoped */ name: z.ZodString; version: z.ZodString; description: z.ZodOptional; homepage: z.ZodOptional; license: z.ZodDefault; tokens: z.ZodOptional>; }, "strip", z.ZodTypeAny, { format: "style-dictionary" | "w3c-dtcg" | "css-vars"; href: string; }, { href: string; format?: "style-dictionary" | "w3c-dtcg" | "css-vars" | undefined; }>>; components: z.ZodDefault>; framework: z.ZodDefault>; /** Optional pre-generated code for this component */ code: z.ZodOptional; }, "strip", z.ZodTypeAny, { framework: "react" | "vue" | "svelte"; href: string; }, { framework: "react" | "vue" | "svelte"; href: string; }>>; }, "strip", z.ZodTypeAny, { framework: "react" | "vue" | "svelte" | "agnostic"; name: string; href: string; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }, { name: string; href: string; framework?: "react" | "vue" | "svelte" | "agnostic" | undefined; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }>, "many">>; meta: z.ZodObject<{ sourceFigmaUrl: z.ZodOptional; sourcePenpotFileId: z.ZodOptional; sourceDesignDocUrl: z.ZodOptional; extractedAt: z.ZodString; memoireVersion: z.ZodString; }, "strip", z.ZodTypeAny, { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }, { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }>; }, "strip", z.ZodTypeAny, { components: { framework: "react" | "vue" | "svelte" | "agnostic"; name: string; href: string; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }[]; name: string; version: string; meta: { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }; $schema: string; license: string; description?: string | undefined; tokens?: { format: "style-dictionary" | "w3c-dtcg" | "css-vars"; href: string; } | undefined; homepage?: string | undefined; }, { name: string; version: string; meta: { memoireVersion: string; extractedAt: string; sourceFigmaUrl?: string | undefined; sourcePenpotFileId?: string | undefined; sourceDesignDocUrl?: string | undefined; }; components?: { name: string; href: string; framework?: "react" | "vue" | "svelte" | "agnostic" | undefined; code?: { framework: "react" | "vue" | "svelte"; href: string; } | undefined; level?: "atom" | "molecule" | "organism" | "template" | undefined; }[] | undefined; description?: string | undefined; tokens?: { href: string; format?: "style-dictionary" | "w3c-dtcg" | "css-vars" | undefined; } | undefined; $schema?: string | undefined; homepage?: string | undefined; license?: string | undefined; }>; export type Registry = z.infer; export type RegistryTokenRef = z.infer; export type RegistryComponentRef = z.infer; export type RegistryMeta = z.infer; /** Parse and validate a registry.json. Returns typed Registry or throws. */ export declare function parseRegistry(raw: unknown): Registry; /** Safe-parse version that returns errors instead of throwing. */ export declare function safeParseRegistry(raw: unknown): { success: true; data: Registry; } | { success: false; error: string; }; /** Find a component ref by name in a registry. */ export declare function findComponent(registry: Registry, name: string): RegistryComponentRef | undefined;