/** * useP1Overrides Hook * * Creates referentially stable Puck overrides for P1 integration. * Internally reads getters and callbacks from P1PuckProvider context * and wires them to createP1Overrides with correct options. */ import type { Checkpoint, ActorPresence } from '@pantheon-systems/css-client'; import type { PuckOverrides } from './plugin/createP1Overrides.js'; /** * Options consumers can pass to customize override behavior. */ export interface UseP1OverridesOptions { /** Whether to show the default Puck publish button */ showDefaultPublish?: boolean; /** Callback when publish succeeds */ onPublishSuccess?: (checkpoint: Checkpoint) => void; /** Callback when publish fails */ onPublishError?: (error: Error) => void; /** Callback when stop agent button is clicked */ onStopAgent?: (agent: ActorPresence) => void; /** Whether to show collaborator avatars in header */ showCollaboratorAvatars?: boolean; /** Whether to show agent activity banner in header */ showAgentActivityBanner?: boolean; /** Published status for the header badge */ publishedStatus?: 'published' | 'unpublished-changes' | 'draft'; /** * Whether threads are available to this reader. Resolved from the rollout flag * by the host application; off by default, and while off none of it is reachable. */ threadsEnabled?: boolean; } /** * Creates referentially stable Puck overrides for P1 integration. * * Reads stable getters and callbacks from P1PuckProvider context and * wires them to createP1Overrides. Uses a Proxy pattern to keep the * overrides object referentially stable across re-renders. * * Must be used inside a P1PuckProvider. * * @param options - Optional customization * @returns Stable PuckOverrides instance * * @example * ```tsx * function Editor() { * const overrides = useP1Overrides({ * onPublishSuccess: (cp) => console.log('Published:', cp.name), * }); * return ; * } * ``` */ export declare function useP1Overrides(options?: UseP1OverridesOptions): PuckOverrides;