/** * syncComponentRegistry * * Serialises ComponentDescriptor objects to backend documents under the * /_registry/ path prefix, hash-checking to skip unchanged components. * * Extracted from useComponentRegistry.ts (verbatim, renamed) so it can run * outside React — the browser hook and a headless CI sync script both call * this same function. No React import here by design. */ import type { P1Client } from '@pantheon-systems/css-client'; import { type ComponentDescriptor } from './componentRegistry.js'; export interface RegistrationResult { registered: number; skipped: number; total: number; } export interface SyncComponentRegistryOptions { /** Stops the sync before its next request once aborted; the returned promise rejects. */ signal?: AbortSignal; } export declare const COMPONENT_PREFIX = "_registry/components/"; export declare const INDEX_PATH = "_registry/index"; /** * Maximum age of the registry index's last full per-component verification * before the fast path is forced to re-verify every component's * actual document content instead of trusting the index's hashes map alone. * Bounds how long an index/document desync can persist undetected. */ export declare const REGISTRY_VERIFICATION_INTERVAL_MS: number; export declare function componentPath(name: string): string; export declare function syncComponentRegistry(client: P1Client, siteId: string, branchId: string, descriptors: ComponentDescriptor[], options?: SyncComponentRegistryOptions): Promise;