/** * useBranches Hook * * Provides branch management functionality. */ import type { Branch } from '@pantheon-systems/css-client'; import type { P1Client } from '@pantheon-systems/css-client'; interface UseBranchesParams { client: P1Client; siteId: string; initialBranchId: string; } interface UseBranchesReturn { /** * List of all branches for the site. */ branches: Branch[]; /** * Currently selected branch. */ currentBranch: Branch | null; /** * Current branch ID. */ branchId: string; /** * Loading state. */ loading: boolean; /** * Error state. */ error: Error | null; /** * Switch to a different branch. */ switchBranch: (branchId: string) => Promise; /** * Refresh the branches list. */ refresh: () => Promise; /** * Get main branch. */ mainBranch: Branch | null; } /** * Hook for managing branches. * * @param params - Configuration for branch management * @returns Branch state and operations * * @example * ```tsx * const { branches, currentBranch, switchBranch } = useBranches({ * client, * siteId, * initialBranchId, * }); * * // Switch to a different branch * await switchBranch(otherBranchId); * ``` */ export declare function useBranches({ client, siteId, initialBranchId, }: UseBranchesParams): UseBranchesReturn; export {};