import { type ReactNode } from 'react';
import type { APIEndpoints } from '@riverbankcms/api';
import { type ApiClient } from '@riverbankcms/api/request';
import type { PreviewCustomizeAction } from '../blocks/previewCustomizeActions';
type LoadedPageDesignEditorState = NonNullable<APIEndpoints['getPageDesignEditorState']['response']>;
type ApplyPageDesignEditorActionResponse = NonNullable<APIEndpoints['applyPageDesignEditorAction']['response']>;
export type PreviewPageDesignEditorApplyOutcome = Readonly<{
    kind: 'saved';
    response: ApplyPageDesignEditorActionResponse;
}> | Readonly<{
    kind: 'skipped';
}> | Readonly<{
    kind: 'stale';
    message: string;
}> | Readonly<{
    kind: 'invalid';
    message: string;
}> | Readonly<{
    kind: 'failed';
    message: string;
}>;
export type PreviewPageDesignEditorState = Readonly<{
    kind: 'unsupported';
}> | Readonly<{
    kind: 'loading';
}> | Readonly<{
    kind: 'failed';
    message: string;
}> | LoadedPageDesignEditorState;
type PageDesignEditorStateContextValue = Readonly<{
    state: PreviewPageDesignEditorState;
    reload: () => void;
    applyAction: (action: PreviewCustomizeAction) => Promise<PreviewPageDesignEditorApplyOutcome>;
}>;
export declare function PreviewPageDesignEditorStateProvider({ apiClient, siteId, pageId, enabled, children, }: Readonly<{
    apiClient: ApiClient;
    siteId: string;
    pageId: string | null;
    enabled: boolean;
    children: ReactNode;
}>): import("react/jsx-runtime").JSX.Element;
export declare function usePreviewPageDesignEditorState(): PageDesignEditorStateContextValue;
export {};
