/** * Registry Installer — install a component (or tokens) from a resolved * registry into the current project. * * Flow: * 1. Resolve registry (via resolver.ts) * 2. Fetch the component spec JSON * 3. Save the spec into the user's registry (.memoire/specs/components/.json) * 4. Optionally run codegen immediately * 5. Install tokens file into src/styles/ if not present */ import type { MemoireEngine } from "../engine/core.js"; import type { ComponentSpec } from "../specs/types.js"; import { type ResolvedRegistry } from "./resolver.js"; export interface InstallComponentOptions { /** Registry ref (npm package, github:user/repo, https://..., or local path) */ from: string; /** Component name to install */ name: string; /** Also install tokens.css into project */ withTokens?: boolean; /** Run local codegen instead of using bundled code. Default: false (prefer bundled code). */ regenerate?: boolean; /** Target directory for bundled code install. Default: src/components/memoire */ targetDir?: string; /** Bypass cached npm registry packages and fetch the tarball again. */ refresh?: boolean; } export interface InstallResult { spec: ComponentSpec; specPath: string; tokensPath?: string; /** Path to the installed code file (when registry bundled code, or after regenerate) */ codePath?: string; generatedFiles: string[]; source: string; } /** * Install a component from a registry into the current project. */ export declare function installComponent(engine: MemoireEngine, opts: InstallComponentOptions): Promise; /** * List all components available in a registry without installing. */ export declare function listRegistryComponents(ref: string, cwd?: string, options?: { refresh?: boolean; }): Promise<{ registry: ResolvedRegistry["registry"]; components: { name: string; level?: string; }[]; }>;