import { defaultAttributeFields } from "../components/ConfigurationPanel/components/AttributeField";
import type { ContentWidgetElement, Element, ElementMap, ExtendedType, PageElement, PickObjectValueByKey, SectionWidgetElement, StandardSectionElement, StandardWrapperElement } from "easy-email-pro-core";
import type { BasicEditorProps, BasicEmailTemplate, CustomSlateEditor, EmailEditorProps, EmailTemplate } from "easy-email-pro-editor";
import React from "react";
import { Path } from "slate";
export type ThemeConfigProps = Omit<EmailEditorProps, "children">;
export interface CustomThemeTypes {
    [key: string]: unknown;
}
export type BasicConfigPanelsMap = {
    [K in PickObjectValueByKey<Element, "type">]: React.FC<{
        nodePath: Path;
    }>;
};
export type BasicAttributeFieldsMap = typeof defaultAttributeFields;
export type AttributeFieldsMap = ExtendedType<"AttributeFieldsMap", BasicAttributeFieldsMap, CustomThemeTypes>;
export interface EditorContextProps {
    values: EmailTemplate;
    pageDataVariables: Record<string, any>;
    inited: boolean;
    mergetagsData: Record<string, any>;
    setMergetagsData: React.Dispatch<React.SetStateAction<Record<string, any>>>;
    submit: () => void;
    dirty: boolean;
    initialValues: EmailTemplate;
    initialValuesRef: React.MutableRefObject<EmailTemplate>;
    getFieldValue: (path: Path | null, name: string) => any;
    setFieldValue: (path: Path | null, name: string, value: any) => void;
    getFieldDirty: (path: Path | null, name: string) => boolean;
    reset: (values: EmailTemplate) => void;
    valid: boolean;
}
export interface CategoryGridItem<T extends keyof ElementMap = any> {
    label: string;
    active?: boolean;
    blocks: Array<{
        type: Element["type"];
        payload?: Partial<ElementMap[T]>;
        title?: string | undefined | null;
        icon?: React.ReactNode;
    }>;
    displayType?: "grid";
}
export interface CategoryMenuItem<T extends keyof ElementMap = any> {
    label: string;
    active?: boolean;
    blocks: Array<{
        type: Element["type"];
        payload?: Partial<ElementMap[T]>;
        title?: string | undefined | null;
        icon?: React.ReactNode;
        blocks?: Array<{
            payload?: Partial<ElementMap[T]>;
            title?: string | undefined | null;
            image?: string;
        }>;
    }>;
    displayType?: "menu";
}
export type CategoryLayoutSectionItemPayload = Array<string>;
export type CategoryLayoutWrapperItemPayload = {
    title: string;
    variants: Array<{
        sections: Array<{
            columns: string[];
        }>;
    }>;
};
export type Categories = Array<CategoryGridItem | CategoryMenuItem | {
    label: string;
    active?: boolean;
    blocks: Array<{
        payload: Array<CategoryLayoutSectionItemPayload>;
        title: string | undefined;
    }>;
    displayType: "column";
} | {
    label: string;
    active?: boolean;
    blocks: Array<CategoryLayoutWrapperItemPayload>;
    displayType: "section";
} | {
    label: string;
    active?: boolean;
    blocks: Array<{
        payload?: Partial<Element>;
    }>;
    displayType: "widget";
} | {
    label: string;
    active?: boolean;
    blocks: Array<React.ReactNode>;
    displayType: "custom";
}>;
export interface PrebuiltBlock {
    thumbnail: string;
    title: string;
    payload: StandardWrapperElement | StandardSectionElement;
    category: string;
}
export interface PrebuiltBlockCategory {
    get label(): string;
    active?: boolean;
    blocks: PrebuiltBlock[];
}
export interface PluginsCustomEditorTypes {
    AttributeFieldsMap?: AttributeFieldsMap;
    EmailEditorProps: BasicEditorProps & {
        instanceRef?: React.MutableRefObject<EditorContextProps | null>;
        categories?: Categories;
        prebuiltBlocks?: PrebuiltBlockCategory[];
        attributeFields?: AttributeFieldsMap;
        showSourceCode?: boolean;
        sourceCodeEditable?: boolean;
        universalElementSetting?: {
            elements: Record<string, Element>;
            list: Array<{
                label: string;
                elements: Array<{
                    element: Element;
                    thumbnail: string;
                }>;
            }>;
            onAddElement: (params: {
                name: string;
                element: Element;
                thumbnail: Blob;
            }) => Promise<Element>;
            onUpdateElement: (params: {
                uid: string;
                element: Element;
                thumbnail: Blob;
            }) => Promise<any>;
        };
        onChange?: (values: EmailTemplate, editor: CustomSlateEditor) => void;
        quantityLimitCheck?: (params: {
            element: Element;
            pageData: PageElement;
        }) => boolean;
        AIAssistant?: {
            onGenerate: (messages: Array<{
                role: string;
                content: string;
            }>) => Promise<{
                role: string;
                content: string;
            }>;
            options?: Array<{
                label: string;
                value: string;
                getMessages(text: string): {
                    role: string;
                    content: string;
                }[];
            }>;
        };
        controller?: boolean;
        showPreview?: boolean;
        showClearCanvas?: boolean;
        showSidebar?: boolean;
        showLogic?: boolean;
        showLayer?: boolean;
        showGenerateBlockImage?: boolean;
        showTextHTMLMode?: boolean;
        showTextDirectionMode?: boolean;
        showDragMoveIcon?: boolean;
        showInsertTips?: boolean;
        useNewColorPicker?: boolean;
        enabledHtmlBlockNodeAlign?: boolean;
        enabledPreviewEmailSubjectEdit?: boolean;
        enabledGradientImage?: boolean;
        enabledButtonIcon?: boolean;
        layerDefaultCollapsed?: boolean;
        hideSectionBackgroundImage?: boolean;
        layerConfig?: {
            scrollWhenSelect?: boolean;
            scrollWhenHover?: boolean;
        };
        compact?: boolean;
        height: string;
        unsplash?: {
            clientId: string;
            presetList?: Array<{
                query: string;
                label: string;
                image: string;
            }>;
        };
        widgetMode?: boolean;
        widgetElement?: SectionWidgetElement | ContentWidgetElement;
        emptyPageElement?: PageElement;
        ElementToolsInner?: React.FC<{
            element: Element;
            nodeElement: HTMLElement;
            path: Path;
        }>;
        ElementTools?: React.FC<{
            element: Element;
            nodeElement: HTMLElement;
            path: Path;
        }>;
        dragoverType?: "line" | "placeholder";
        autoScroll?: {
            scrollSpeed?: number;
            bottomTriggerArea?: number;
            topTriggerArea?: number;
            scrollDelay?: number;
        } | true;
    };
    EmailTemplate: BasicEmailTemplate;
}
declare module "easy-email-pro-editor" {
    interface CustomEditorTypes extends PluginsCustomEditorTypes {
    }
}
