import { Brick } from '@upstart.gg/sdk/shared/bricks';
import { Resolution } from '@upstart.gg/sdk/shared/responsive';
import { Site } from '@upstart.gg/sdk/shared/site';
import { Theme } from '@upstart.gg/sdk/shared/theme';
import { Page } from '@upstart.gg/sdk/shared/page';
import { UpstartUIMessage } from '@upstart.gg/sdk/shared/ai/types';
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<Page>;
};
export type SiteSavePayload = {
    siteId: string;
    data: Partial<Site>;
};
export interface EditorStateProps {
    chatSession: {
        id: string;
        messages: UpstartUIMessage[];
    };
    /**
     * 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;
    previewMode: Resolution;
    gridConfig?: {
        colWidth: number;
        rowHeight: number;
    };
    settingsVisible?: boolean;
    selectedBrickId?: Brick["id"];
    selectedGroup?: Brick["id"][];
    selectedSectionId?: string;
    attributesTab?: "site" | "page";
    attributesGroup?: string;
    resizing?: boolean;
    isEditingTextForBrickId?: string;
    panel?: "library" | "inspector" | "theme" | "settings";
    modal?: "image-search" | "datasources" | "queries";
    panelPosition: "left" | "right";
    chatVisible: boolean;
    logoLink: string;
    themesLibrary: Theme[];
    contextMenuVisible: boolean;
    draggingBrickType?: Brick["type"];
    isMouseOverPanel?: boolean;
    onShowPopup: (id: string | false) => void;
    onPublish: (data: PagePublishPayload) => void;
    onPageCreated: (page: Page) => Promise<{
        pageVersionId: string;
    }>;
    /**
     * Returns the updated version id
     */
    onSavePage: (page: PageSavePayload) => Promise<{
        pageVersionId: string;
    }>;
    onSaveSite: (site: SiteSavePayload) => 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;
    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;
    setAttributesTab: (tab: "site" | "page") => void;
    setAttributesGroup: (group: string | undefined) => void;
}
export declare const createEditorStore: (initProps: Partial<EditorStateProps> & Pick<EditorStateProps, "chatSession" | "onPageCreated" | "onPublish" | "onSavePage" | "onSaveSite" | "onShowPopup">) => 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;
    };
}, "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<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;
    };
}, "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<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;
    };
}, "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 const useAttributesTab: () => "site" | "page";
export declare const useAttributesGroup: () => string | undefined;
export declare function useSelectedSectionId(): string | undefined;
export declare function useSelectedSection(): {
    mobileProps?: {
        backgroundImage?: {
            repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y" | "round" | "space" | undefined;
            size?: "contain" | "auto" | "cover" | undefined;
            image: string;
        } | undefined;
        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: "none" | "primary-50" | "primary-100" | "primary-200" | "primary-300" | "primary-400" | "primary-500" | "primary-600" | "primary-700" | "primary-800" | "primary-900" | "secondary-50" | "secondary-100" | "secondary-200" | "secondary-300" | "secondary-400" | "secondary-500" | "secondary-600" | "secondary-700" | "secondary-800" | "secondary-900" | "accent-50" | "accent-100" | "accent-200" | "accent-300" | "accent-400" | "accent-500" | "accent-600" | "accent-700" | "accent-800" | "accent-900" | "neutral-50" | "neutral-100" | "neutral-200" | "neutral-300" | "neutral-400" | "neutral-500" | "neutral-600" | "neutral-700" | "neutral-800" | "neutral-900" | "base-100" | "base-200" | "base-300" | "primary-gradient-100" | "primary-gradient-200" | "primary-gradient-300" | "primary-gradient-400" | "primary-gradient-500" | "primary-gradient-600" | "primary-gradient-700" | "primary-gradient-800" | "secondary-gradient-100" | "secondary-gradient-200" | "secondary-gradient-300" | "secondary-gradient-400" | "secondary-gradient-500" | "secondary-gradient-600" | "secondary-gradient-700" | "secondary-gradient-800" | "accent-gradient-100" | "accent-gradient-200" | "accent-gradient-300" | "accent-gradient-400" | "accent-gradient-500" | "accent-gradient-600" | "accent-gradient-700" | "accent-gradient-800" | "neutral-gradient-100" | "neutral-gradient-200" | "neutral-gradient-300" | "neutral-gradient-400" | "neutral-gradient-500" | "neutral-gradient-600" | "neutral-gradient-700" | "neutral-gradient-800" | "base-gradient-100" | "base-gradient-200";
        } | undefined;
        direction?: "flex-row" | "flex-col" | undefined;
        minHeight?: string | undefined;
        variant?: "navbar" | "footer" | "sidebar" | undefined;
        maxWidth?: "max-w-screen-lg" | "max-w-screen-xl" | "max-w-screen-2xl" | "max-w-full" | undefined;
        verticalMargin?: 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?: string | undefined;
        gap?: string | undefined;
        wrap?: boolean | undefined;
        lastTouched?: number | undefined;
    } | undefined;
    id: string;
    label: string;
    props: {
        backgroundImage?: {
            repeat?: "repeat" | "no-repeat" | "repeat-x" | "repeat-y" | "round" | "space" | undefined;
            size?: "contain" | "auto" | "cover" | undefined;
            image: string;
        } | undefined;
        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: "none" | "primary-50" | "primary-100" | "primary-200" | "primary-300" | "primary-400" | "primary-500" | "primary-600" | "primary-700" | "primary-800" | "primary-900" | "secondary-50" | "secondary-100" | "secondary-200" | "secondary-300" | "secondary-400" | "secondary-500" | "secondary-600" | "secondary-700" | "secondary-800" | "secondary-900" | "accent-50" | "accent-100" | "accent-200" | "accent-300" | "accent-400" | "accent-500" | "accent-600" | "accent-700" | "accent-800" | "accent-900" | "neutral-50" | "neutral-100" | "neutral-200" | "neutral-300" | "neutral-400" | "neutral-500" | "neutral-600" | "neutral-700" | "neutral-800" | "neutral-900" | "base-100" | "base-200" | "base-300" | "primary-gradient-100" | "primary-gradient-200" | "primary-gradient-300" | "primary-gradient-400" | "primary-gradient-500" | "primary-gradient-600" | "primary-gradient-700" | "primary-gradient-800" | "secondary-gradient-100" | "secondary-gradient-200" | "secondary-gradient-300" | "secondary-gradient-400" | "secondary-gradient-500" | "secondary-gradient-600" | "secondary-gradient-700" | "secondary-gradient-800" | "accent-gradient-100" | "accent-gradient-200" | "accent-gradient-300" | "accent-gradient-400" | "accent-gradient-500" | "accent-gradient-600" | "accent-gradient-700" | "accent-gradient-800" | "neutral-gradient-100" | "neutral-gradient-200" | "neutral-gradient-300" | "neutral-gradient-400" | "neutral-gradient-500" | "neutral-gradient-600" | "neutral-gradient-700" | "neutral-gradient-800" | "base-gradient-100" | "base-gradient-200";
        } | undefined;
        direction?: "flex-row" | "flex-col" | undefined;
        minHeight?: string | undefined;
        variant?: "navbar" | "footer" | "sidebar" | undefined;
        maxWidth?: "max-w-screen-lg" | "max-w-screen-xl" | "max-w-screen-2xl" | "max-w-full" | undefined;
        verticalMargin?: 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?: string | undefined;
        gap?: string | undefined;
        wrap?: boolean | undefined;
        lastTouched?: number | undefined;
    };
    order: number;
    bricks: {
        label?: string | undefined;
        mobileProps?: any;
        id: string;
        type: string;
        props: any;
    }[];
} | 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: "light" | "dark";
    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 useZoom: () => {
    zoom: number;
    zoomIn: () => void;
    zoomOut: () => void;
    canZoomIn: boolean;
    canZoomOut: boolean;
    resetZoom: () => void;
};
export declare const useChatSession: () => {
    id: string;
    messages: UpstartUIMessage[];
};
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 useEditorHelpers: () => {
    setAttributesGroup: (group: string | undefined) => void;
    setAttributesTab: (tab: "site" | "page") => void;
    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;
    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;
    }>;
    onSaveSite: (site: SiteSavePayload) => Promise<void>;
    onPageCreated: (page: Page) => Promise<{
        pageVersionId: string;
    }>;
    toggleChat: () => void;
    onShowPopup: (id: string | false) => void;
};
export declare function useGridConfig(): {
    colWidth: number;
    rowHeight: number;
};
