/** * useDocuments Hook * * Provides document management functionality. */ import type { Document, PuckData } from '@pantheon-systems/css-client'; import type { P1Client } from '@pantheon-systems/css-client'; interface UseDocumentsParams { client: P1Client; siteId: string; branchId: string; } interface UseDocumentsReturn { /** * List of documents on the current branch. */ documents: Document[]; /** * Loading state. */ loading: boolean; /** * Error state. */ error: Error | null; /** * Create a new document. */ create: (path: string, initialData?: PuckData, options?: { templateId?: string; templateVersion?: number; title?: string; /** Market the page is authored in. Omitted leaves the page untagged. */ locale?: string; }) => Promise; /** * Delete a document. */ remove: (documentId: string) => Promise; /** * Refresh the documents list. */ refresh: () => Promise; /** * Get a document by path. */ getByPath: (path: string) => Document | undefined; } /** * Hook for managing documents on a branch. * * @param params - Configuration for document management * @returns Document state and operations * * @example * ```tsx * const { documents, create, remove, loading } = useDocuments({ * client, * siteId, * branchId, * }); * * // Create a new page * await create('/new-page'); * * // Delete a page * await remove(documentId); * ``` */ export declare function useDocuments({ client, siteId, branchId, }: UseDocumentsParams): UseDocumentsReturn; export {};