/** * Build a {@link Catalog} from normalized, per-component inputs. * * The heavy lifting — turning raw `compose-preview` data products into * {@link Finding}s, a {@link SemanticTree}, and {@link DesignTokens} — is the job * of `@design-parity/candidate` (`nativeFindings`, `semanticsToSemanticTree`, * `composeThemeToTokens`). This module takes those already-normalized pieces and * assembles the catalog: it attaches each component's greenline layer and, when * the catalog's system token set isn't supplied, lifts it from the richest * component semantics' `themeTokens`. Pure — no I/O, no renderer. */ import type { DesignTokens, Finding, SemanticTree } from "@design-parity/core"; import type { Catalog, CatalogComponent, CatalogTheme, CatalogImage, CatalogMeta, CatalogMotion, ComponentReference } from "./types.js"; /** Normalized input for one component (the output of candidate's mappers). */ export interface ComponentSource { componentId: string; /** Top-level section (tab) this component belongs to; see {@link CatalogComponent.section}. */ section?: string; group?: string; caption?: string; reference?: ComponentReference; /** Family handle for {@link reference}; see {@link CatalogComponent.referenceSet}. */ referenceSet?: string; /** Stated reason there is no {@link reference}; see {@link CatalogComponent.noReference}. */ noReference?: string; /** Ideal capture image(s) — one per state/theme/size. */ ideal: CatalogImage[]; /** Layout/wireframe image(s) from `compose/semantics-wireframe`. */ layout?: CatalogImage[]; /** Animated capture(s) published beside the stills; see {@link CatalogMotion}. */ motion?: CatalogMotion[]; /** Per-component resolved tokens (padding / radius / type used). */ tokens?: DesignTokens; /** Component semantic tree (carries bounds + per-node tokens + themeTokens). */ semantics?: SemanticTree; /** Renderer-native a11y / contrast / i18n findings → issue greenlines. */ findings?: Finding[]; } /** Assemble one {@link CatalogComponent}, computing its greenline layer. */ export declare function buildComponent(source: ComponentSource): CatalogComponent; /** * Assemble a whole {@link Catalog}. When `themeTokens` is omitted, it is lifted * from the first component whose semantics carry `themeTokens` (the resolved * `compose/theme` of the system) — so the system token set comes from the code, * not a hand-maintained list. * * `themes` are the system's ALTERNATE named themes, each with its own token set * ({@link CatalogTheme}). They are never lifted: a component's semantics record * the one theme it was rendered under, so the caller — which knows which render * belongs to which declared theme — supplies them. An entry with a blank id or an * empty token set is dropped rather than published as a theme a consumer can * select and find nothing behind, and a repeated id keeps its first entry so one * theme can never be published twice. */ export declare function buildCatalog(meta: CatalogMeta, sources: readonly ComponentSource[], themeTokens?: DesignTokens, themes?: readonly CatalogTheme[]): Catalog; //# sourceMappingURL=ingest.d.ts.map