/** * useComponentRegistry Hook * * Runs at editor startup to serialise the Puck config into ComponentDescriptor * objects, hash-checks them for changes, and writes updated descriptors to the backend * documents under the /_registry/ path prefix. * * Uses the same P1PuckContext pattern as useVersions, useAutoSave, and useDocuments. */ import { type RegistrationResult } from './utils/syncComponentRegistry.js'; export type { RegistrationResult } from './utils/syncComponentRegistry.js'; export interface UseComponentRegistryOptions { /** Puck config to register. Pass the same object as */ puckConfig: unknown; /** Optional upstream Puck config for provenance classification */ upstreamPuckConfig?: unknown; /** Called when registration completes (or is a full no-op) */ onRegistered?: (result: RegistrationResult) => void; /** Called if registration fails */ onError?: (error: Error) => void; } export interface UseComponentRegistryReturn { status: 'idle' | 'registering' | 'registered' | 'error'; result: RegistrationResult | null; error: Error | null; } export declare function useComponentRegistry(options: UseComponentRegistryOptions): UseComponentRegistryReturn;