/** * useCheckpoints Hook * * Provides checkpoint (publish) functionality. */ import type { Checkpoint } from '@pantheon-systems/css-client'; import type { P1Client } from '@pantheon-systems/css-client'; export interface UseCheckpointsParams { client: P1Client; siteId: string; branchId: string; } export interface UseCheckpointsReturn { /** * List of checkpoints on the current branch. */ checkpoints: Checkpoint[]; /** * Loading state. */ loading: boolean; /** * Error state. */ error: Error | null; /** * Create publishing state. */ isPublishing: boolean; /** * Create a checkpoint (publish). */ create: (name?: string) => Promise; /** * Revert to a checkpoint. */ revert: (checkpointId: string, name?: string) => Promise; /** * Refresh the checkpoints list. */ refresh: () => Promise; /** * Get the latest checkpoint. */ latestCheckpoint: Checkpoint | null; } /** * Hook for managing checkpoints. * * @param params - Configuration for checkpoint management * @returns Checkpoint state and operations * * @example * ```tsx * const { checkpoints, create, isPublishing } = useCheckpoints({ * client, * siteId, * branchId, * }); * * // Publish (create checkpoint) * await create('Release v1.0'); * ``` */ export declare function useCheckpoints({ client, siteId, branchId, }: UseCheckpointsParams): UseCheckpointsReturn;