import { type PreviewRuntimeSession, type PreviewSessionAuthMode } from "../auth-contract";
export type PreviewAuthState = "ok" | "expired";
export type PreviewAuthFailureSource = "keep-alive" | "inline-save" | "publish" | "block-editor" | "metadata" | "draft-action" | "query" | "unknown";
type BaseFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
export type PreviewAuthFetch = (input: RequestInfo | URL, init: RequestInit | undefined, source: PreviewAuthFailureSource) => Promise<Response>;
type InternalState = {
    state: PreviewAuthState;
    session: PreviewRuntimeSession | null;
    siteSlug: string | null;
    siteId: string | null;
    pageId: string | null;
    token: string | null;
};
export type PreviewAuthSnapshot = InternalState & {
    canEdit: boolean;
    authMode: PreviewSessionAuthMode;
    expiresAt: string | null;
};
export declare function usePreviewAuth(): PreviewAuthSnapshot;
/**
 * Hook to access the preview token for direct API calls.
 * Returns null if no token is available (falls back to proxy).
 */
export declare function usePreviewToken(): string | null;
type PreviewAuthInitInput = {
    siteId: string;
    siteSlug: string;
    pageId: string | null;
    token: string | null;
} & ({
    session: PreviewRuntimeSession | null;
} | {
    canEdit: boolean;
    authMode: PreviewSessionAuthMode;
    expiresAt: string | null;
});
export declare function initPreviewAuth(input: PreviewAuthInitInput): void;
export declare function __getPreviewAuthStateForTests(): Readonly<PreviewAuthSnapshot>;
export declare function __resetPreviewAuthStateForTests(): void;
export declare function markPreviewAuthExpired(source: PreviewAuthFailureSource): void;
export declare function usePreviewAuthFetch(baseFetch: BaseFetch): PreviewAuthFetch;
export {};
