import { Brick } from '@upstart.gg/sdk/shared/bricks';
import { ImageSearchResultsType } from '@upstart.gg/sdk/shared/images';
import { GenericPageConfig } from '@upstart.gg/sdk/shared/page';
import { SitePrompt } from '@upstart.gg/sdk/shared/prompt';
import { Resolution } from '@upstart.gg/sdk/shared/responsive';
import { Site, SiteAndPagesConfig } from '@upstart.gg/sdk/shared/site';
import { Theme } from '@upstart.gg/sdk/shared/theme';
import { DraftState } from './use-page-data';
export type { Immer } from 'immer';
export type PagePublishPayload = {
    siteId: string;
    mode: "publish-page";
    pageId: string;
    pageVersionId: string;
    schedulePublishedAt?: string | null;
} | {
    siteId: string;
    mode: "publish-site";
};
export type PageSavePayload = {
    siteId: string;
    pageId: string;
    pageVersionId: string;
    data: Partial<GenericPageConfig>;
};
export type SiteSavePayload = {
    siteId: string;
    data: Partial<Site>;
};
export interface EditorStateProps {
    /**
     * When debugMode is enabled, context menu are disabled so that inspecting using devtools is easier
     */
    debugMode?: boolean;
    /**
     * When true, disable the editor and renders the page as it would be rendered in production using non-editable components
     */
    disabled?: boolean;
    zoom: number;
    /**
     * 0 = free
     * 1 = essentials
     * 2 = pro
     * ...
     */
    planIndex: number;
    sitePrompt: SitePrompt;
    previewMode: Resolution;
    gridConfig?: {
        colWidth: number;
        rowHeight: number;
    };
    settingsVisible?: boolean;
    genFlowDone?: boolean;
    selectedBrickId?: Brick["id"];
    selectedGroup?: Brick["id"][];
    selectedSectionId?: string;
    resizing?: boolean;
    isEditingTextForBrickId?: string;
    panel?: "library" | "inspector" | "theme" | "settings";
    modal?: "image-search" | "datasources" | "queries";
    panelPosition: "left" | "right";
    chatVisible: boolean;
    logoLink: string;
    themesLibrary: Theme[];
    imagesSearchResults?: ImageSearchResultsType;
    contextMenuVisible: boolean;
    draggingBrickType?: Brick["type"];
    isMouseOverPanel?: boolean;
    onShowPopup?: (id: string | false) => void;
    onPublish: (data: PagePublishPayload) => void;
    /**
     * Returns the updated version id
     */
    onSavePage?: (page: PageSavePayload) => Promise<{
        pageVersionId: string;
    }>;
    onSaveSite?: (site: SiteSavePayload) => Promise<void>;
    onDraftChange?: (draft: DraftState, siteAndPages: SiteAndPagesConfig) => Promise<void>;
}
export interface EditorState extends EditorStateProps {
    setPreviewMode: (mode: Resolution) => void;
    setSettingsVisible: (visible: boolean) => void;
    toggleSettings: () => void;
    setContextMenuVisible: (open: boolean) => void;
    toggleEditorEnabled: () => void;
    setGridConfig: (config: EditorStateProps["gridConfig"]) => void;
    setIsEditingText: (forBrickId: string | false) => void;
    setIsResizing: (resizing: boolean) => void;
    setPanel: (panel?: EditorStateProps["panel"]) => void;
    togglePanel: (panel?: EditorStateProps["panel"]) => void;
    hidePanel: (panel?: EditorStateProps["panel"]) => void;
    setSelectedGroup: (group?: Brick["id"][]) => void;
    setSelectedBrickId: (brickId?: Brick["id"]) => void;
    setSelectedSectionId: (sectionId?: string) => void;
    deselectBrick: (brickId?: Brick["id"]) => void;
    setImagesSearchResults: (images: EditorStateProps["imagesSearchResults"]) => void;
    togglePanelPosition: () => void;
    toggleDebugMode: () => void;
    showModal: (modal: EditorStateProps["modal"]) => void;
    toggleModal: (modal: EditorStateProps["modal"]) => void;
    hideModal: () => void;
    toggleChat: () => void;
    zoomIn: () => void;
    zoomOut: () => void;
    resetZoom: () => void;
    setDraggingBrickType: (type: Brick["type"] | null) => void;
    setMouseOverPanel: (over: boolean) => void;
    updateHistory(): void;
}
export declare const createEditorStore: (initProps: Partial<EditorStateProps>) => Omit<Omit<Omit<Omit<import('zustand').StoreApi<EditorState>, "subscribe"> & {
    subscribe: {
        (listener: (selectedState: EditorState, previousSelectedState: EditorState) => void): () => void;
        <U>(selector: (state: EditorState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
            equalityFn?: ((a: U, b: U) => boolean) | undefined;
            fireImmediately?: boolean;
        } | undefined): () => void;
    };
}, "persist"> & {
    persist: {
        setOptions: (options: Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>) => void;
        clearStorage: () => void;
        rehydrate: () => Promise<void> | void;
        hasHydrated: () => boolean;
        onHydrate: (fn: (state: EditorState) => void) => () => void;
        onFinishHydration: (fn: (state: EditorState) => void) => () => void;
        getOptions: () => Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>;
    };
}, "temporal"> & {
    temporal: import('zustand').StoreApi<import('zundo').TemporalState<EditorState>>;
}, "setState"> & {
    setState(nextStateOrUpdater: EditorState | Partial<EditorState> | ((state: import('immer').WritableDraft<EditorState>) => void), shouldReplace?: boolean | undefined): void;
};
export declare const EditorStoreContext: import('react').Context<(Omit<Omit<Omit<Omit<import('zustand').StoreApi<EditorState>, "subscribe"> & {
    subscribe: {
        (listener: (selectedState: EditorState, previousSelectedState: EditorState) => void): () => void;
        <U>(selector: (state: EditorState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
            equalityFn?: ((a: U, b: U) => boolean) | undefined;
            fireImmediately?: boolean;
        } | undefined): () => void;
    };
}, "persist"> & {
    persist: {
        setOptions: (options: Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>) => void;
        clearStorage: () => void;
        rehydrate: () => Promise<void> | void;
        hasHydrated: () => boolean;
        onHydrate: (fn: (state: EditorState) => void) => () => void;
        onFinishHydration: (fn: (state: EditorState) => void) => () => void;
        getOptions: () => Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>;
    };
}, "temporal"> & {
    temporal: import('zustand').StoreApi<import('zundo').TemporalState<EditorState>>;
}, "setState"> & {
    setState(nextStateOrUpdater: EditorState | Partial<EditorState> | ((state: import('immer').WritableDraft<EditorState>) => void), shouldReplace?: boolean | undefined): void;
}) | null>;
export declare const useEditorStoreContext: () => Omit<Omit<Omit<Omit<import('zustand').StoreApi<EditorState>, "subscribe"> & {
    subscribe: {
        (listener: (selectedState: EditorState, previousSelectedState: EditorState) => void): () => void;
        <U>(selector: (state: EditorState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
            equalityFn?: ((a: U, b: U) => boolean) | undefined;
            fireImmediately?: boolean;
        } | undefined): () => void;
    };
}, "persist"> & {
    persist: {
        setOptions: (options: Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>) => void;
        clearStorage: () => void;
        rehydrate: () => Promise<void> | void;
        hasHydrated: () => boolean;
        onHydrate: (fn: (state: EditorState) => void) => () => void;
        onFinishHydration: (fn: (state: EditorState) => void) => () => void;
        getOptions: () => Partial<import('zustand/middleware').PersistOptions<EditorState, {
            [k: string]: any;
        }>>;
    };
}, "temporal"> & {
    temporal: import('zustand').StoreApi<import('zundo').TemporalState<EditorState>>;
}, "setState"> & {
    setState(nextStateOrUpdater: EditorState | Partial<EditorState> | ((state: import('immer').WritableDraft<EditorState>) => void), shouldReplace?: boolean | undefined): void;
};
export declare const useEditor: () => EditorState;
export declare const usePreviewMode: () => "desktop" | "mobile";
export declare const useEditorEnabled: () => boolean;
export declare const useLogoLink: () => string;
export declare const useSelectedGroup: () => string[] | undefined;
export declare const useSelectedBrickId: () => string | undefined;
export declare function useSelectedSectionId(): string | undefined;
export declare function useSelectedSection(): {
    label?: string | undefined;
    mobileProps?: {
        colorPreset?: {
            gradientDirection?: "bg-gradient-to-t" | "bg-gradient-to-r" | "bg-gradient-to-b" | "bg-gradient-to-l" | "bg-gradient-to-tl" | "bg-gradient-to-tr" | "bg-gradient-to-br" | "bg-gradient-to-bl" | undefined;
            color: string;
        } | undefined;
        direction?: "flex-row" | "flex-col" | undefined;
        minHeight?: string | undefined;
        variant?: "footer" | "navbar" | "sidebar" | undefined;
        maxWidth?: string | undefined;
        justifyContent?: "justify-start" | "justify-center" | "justify-end" | "justify-between" | "justify-around" | "justify-evenly" | undefined;
        alignItems?: "items-start" | "items-center" | "items-end" | "items-stretch" | undefined;
        padding?: "p-0" | "p-px" | "p-1" | "p-2" | "p-3" | "p-4" | "p-6" | "p-8" | "p-10" | "p-12" | "p-16" | "p-24" | undefined;
        gap?: string | undefined;
        lastTouched?: number | undefined;
    } | undefined;
    id: string;
    order: number;
    props: {
        colorPreset?: {
            gradientDirection?: "bg-gradient-to-t" | "bg-gradient-to-r" | "bg-gradient-to-b" | "bg-gradient-to-l" | "bg-gradient-to-tl" | "bg-gradient-to-tr" | "bg-gradient-to-br" | "bg-gradient-to-bl" | undefined;
            color: string;
        } | undefined;
        direction?: "flex-row" | "flex-col" | undefined;
        minHeight?: string | undefined;
        variant?: "footer" | "navbar" | "sidebar" | undefined;
        maxWidth?: string | undefined;
        justifyContent?: "justify-start" | "justify-center" | "justify-end" | "justify-between" | "justify-around" | "justify-evenly" | undefined;
        alignItems?: "items-start" | "items-center" | "items-end" | "items-stretch" | undefined;
        padding?: "p-0" | "p-px" | "p-1" | "p-2" | "p-3" | "p-4" | "p-6" | "p-8" | "p-10" | "p-12" | "p-16" | "p-24" | undefined;
        gap?: string | undefined;
        lastTouched?: number | undefined;
    };
    bricks: {
        mobileProps?: any;
        propsMapping?: {} | undefined;
        id: string;
        props: any;
        type: string;
    }[];
} | null;
export declare const useDebugMode: () => boolean;
export declare const usePanel: () => {
    panel: "theme" | "library" | "inspector" | "settings" | undefined;
    panelPosition: "left" | "right";
};
export declare const useModal: () => "datasources" | "queries" | "image-search" | undefined;
export declare const useIsPremiumPlan: () => boolean;
export declare function useHasPlanOrHigher(plan: number): boolean;
export declare const useThemesLibrary: () => {
    id: string;
    name: string;
    description: string;
    tags: string[];
    browserColorScheme: string;
    colors: {
        primary: string;
        secondary: string;
        accent: string;
        neutral: string;
        base100: string;
        base200: string;
        base300: string;
    };
    typography: {
        base: number;
        heading: {
            type: "theme" | "stack" | "google";
            family: string;
        };
        body: {
            type: "theme" | "stack" | "google";
            family: string;
        };
        alternatives: {
            heading: {
                type: "theme" | "stack" | "google";
                family: string;
            };
            body: {
                type: "theme" | "stack" | "google";
                family: string;
            };
        }[];
    };
}[];
export declare const useImagesSearchResults: () => {
    provider: string;
    url: string;
    description: string;
    blurHash: string;
    user: {
        name: string;
        profile_url: string;
    };
}[] | undefined;
export declare const useZoom: () => {
    zoom: number;
    zoomIn: () => void;
    zoomOut: () => void;
    canZoomIn: boolean;
    canZoomOut: boolean;
    resetZoom: () => void;
};
export declare const useChatVisible: () => boolean;
export declare const useIsResizing: () => boolean | undefined;
export declare function useEditingTextForBrickId(): string | undefined;
export declare const useDraggingBrickType: () => string | undefined;
export declare const useContextMenuVisible: () => boolean;
export declare const useIsMouseOverPanel: () => boolean | undefined;
export declare const useEditorHelpers: () => {
    setIsResizing: (resizing: boolean) => void;
    setMouseOverPanel: (over: boolean) => void;
    toggleDebugMode: () => void;
    setContextMenuVisible: (open: boolean) => void;
    setDraggingBrickType: (type: Brick["type"] | null) => void;
    setPreviewMode: (mode: Resolution) => void;
    setSettingsVisible: (visible: boolean) => void;
    setGridConfig: (config: EditorStateProps["gridConfig"]) => void;
    toggleSettings: () => void;
    setIsEditingText: (forBrickId: string | false) => void;
    setImagesSearchResults: (images: EditorStateProps["imagesSearchResults"]) => void;
    setPanel: (panel?: EditorStateProps["panel"]) => void;
    togglePanel: (panel?: EditorStateProps["panel"]) => void;
    toggleModal: (modal: EditorStateProps["modal"]) => void;
    hidePanel: (panel?: EditorStateProps["panel"]) => void;
    setSelectedGroup: (group?: Brick["id"][]) => void;
    setSelectedBrickId: (brickId?: Brick["id"]) => void;
    setSelectedSectionId: (sectionId?: string) => void;
    deselectBrick: (brickId?: Brick["id"]) => void;
    togglePanelPosition: () => void;
    showModal: (modal: EditorStateProps["modal"]) => void;
    hideModal: () => void;
    toggleEditorEnabled: () => void;
    onPublish: (data: PagePublishPayload) => void;
    onSavePage: ((page: PageSavePayload) => Promise<{
        pageVersionId: string;
    }>) | undefined;
    onSaveSite: ((site: SiteSavePayload) => Promise<void>) | undefined;
    onDraftChange: ((draft: DraftState, siteAndPages: SiteAndPagesConfig) => Promise<void>) | undefined;
    toggleChat: () => void;
    onShowPopup: ((id: string | false) => void) | undefined;
};
export declare function useGridConfig(): {
    colWidth: number;
    rowHeight: number;
};
