/** * Pure status computation for the page-builder guideline drawer — dependency * free so the node jest environment can test it. * * `declared` is the theme's projection descriptor carried in the * `metafield-select` bridge message (built server-side from the active * theme's manifest); `existing` is the definition row from * GET /api/metafield-definitions. Only type/isList can conflict here — * ownerType/namespace/key matched by lookup, and those two are the * remaining immutables (`updateMetafieldDefinition` rejects changing them). */ export interface DeclaredDescriptorLike { type: string; isList?: boolean; } export interface ExistingDefinitionLike { type: string; isList?: boolean; } export type DefinitionStatus = { kind: 'exists'; } | { kind: 'exists-undeclared'; } | { kind: 'missing-declared'; } | { kind: 'missing-undeclared'; } | { kind: 'conflict'; details: Array<{ field: 'type' | 'isList'; declared: unknown; existing: unknown; }>; }; export declare function computeDefinitionStatus(declared: DeclaredDescriptorLike | null | undefined, existing: ExistingDefinitionLike | null | undefined): DefinitionStatus;