import { Component, Editor as GrapesjsEditor, TraitProperties } from 'grapesjs';
import { TemplateResult } from 'lit';
import { StyleInfo } from 'lit/directives/style-map';
import { FolderSelectApi } from './folder-select';

export declare enum DeviceType {
    Desktop = "desktop",
    Mobile = "mobile",
    Tablet = "tablet"
}
export type Device = {
    canvasWidth: string;
    height: string;
    id: string;
    maxWidth: string;
    name: string;
};
export declare const Desktop: Device;
export declare const Tablet: Device;
export declare const Mobile: Device;
export declare const AllDevices: Device[];
export type Option = {
    children?: TemplateResult;
    dataId?: string;
    disabled?: boolean;
    helpText?: string;
    icon?: string;
    id?: string;
    key?: string;
    label?: string;
    maskBlocks?: Record<string, unknown>;
    name?: string;
    style?: StyleInfo;
    value: string;
};
export type PropertyConfig<T = Record<string, any>> = Omit<TraitProperties, 'options' | 'type'> & {
    accept?: string;
    /**
     * The callback is used to modify the record based on the value.
     * It is called right before the record is saved.
     */
    api?: () => Promise<Option[]> | FolderSelectApi;
    assetTransformationConfigs?: {
        assetIdKey?: string;
        defaultFormat?: string;
        dialogLabel?: string;
        formatKey?: string;
        multiple?: boolean;
        noCrop?: boolean;
        noResize?: boolean;
        noRotate?: boolean;
        /** The block-attribute key that stores the gallery records array to bulk-resolve src URLs after a format change. */
        recordsKey?: string;
        /** The block-attribute key that stores the resolved image source URL. */
        srcKey?: string;
    };
    callback?: (params: {
        extraValue?: Record<string, unknown>;
        record: T;
        value: unknown;
    }) => T;
    checkedValue?: string | boolean;
    children?: PropertyConfig[];
    clearable?: boolean;
    controlType: 'asset-transformation' | 'bicolor-picker' | 'border-input-group' | 'button-group' | 'checkbox' | 'checkbox-group' | 'color-swatch-picker' | 'corner-position-input-group' | 'download-format-picker' | 'file' | 'folder-picker' | 'gallery-picker' | 'group' | 'group-heading' | 'icon-picker' | 'image-picker' | 'input' | 'list-editor' | 'all-picker' | 'other-picker' | 'padding-input-group' | 'page-picker' | 'placeholder' | 'position-picker' | 'radio-card-group' | 'radio-group' | 'select' | 'shadow-input-group' | 'size-input-group' | 'switch' | 'table' | 'text' | 'video-format-picker' | 'video-picker';
    cornerStyleKey?: {
        offsetX: string;
        offsetY: string;
    };
    direction?: 'horizontal' | 'vertical';
    disabled?: boolean | ((record: Record<string, unknown>) => boolean);
    disabledTooltip?: string;
    downloadFormatPickerConfigs?: {
        assetIdsKey?: string;
        isObjectFormat?: boolean;
        objectIdKey?: string;
    };
    folderPickerConfigs?: {
        useFullPath: boolean;
    };
    galleryPickerConfigs?: {
        dialog: DialogType;
        /** The block-attribute key for the format used to resolve records' src URLs after picking. */
        formatKey?: string;
        transformationRecordIdKey?: string;
        transformationsKey?: string;
    };
    groupConfigs?: {
        columnGap?: string;
        direction?: 'horizontal' | 'vertical';
        gap?: string;
        rowGap?: string;
        wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
    };
    helpText?: string | ((record: Record<string, unknown>) => string);
    id: string;
    inputConfigs?: {
        label?: string;
        suffix?: {
            options: Option[];
            type: 'unit';
        };
        /**
         * Return validation message if invalid, otherwise return empty string.
         */
        validation?: (record: Record<string, unknown>) => string;
    };
    itemsPerRow?: number;
    listEditorConfigs?: {
        addDialogLabel: string;
        addItemText?: string;
        columns: Array<Record<string, unknown>>;
        displayField?: string;
        editDialogLabel: string;
        noHeader?: boolean;
        sampleItem: Record<string, string>;
    };
    mask?: string;
    maskBlocks?: Record<string, unknown>;
    multiple?: boolean;
    options?: Option[];
    pickerConfigs?: {
        accepts?: string[];
        multiple?: boolean;
        name?: string;
    };
    placeholder?: string;
    radioGroupConfigs?: {
        gap?: string;
        horizontal?: boolean;
    };
    required?: boolean;
    selectConfigs?: {
        fullWidthPopup?: boolean;
        placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end' | 'center';
    };
    show?: boolean | ((record: Record<string, unknown>) => boolean);
    sizeInputGroupConfigs?: {
        useMask?: boolean;
    };
    /**
     * Use for non-content tabs but still need to skip checking show condition
     */
    skipShowCheck?: boolean;
    tab?: 'content' | 'styling' | 'effects';
    translatable?: boolean;
    translateGroup?: string;
    type: 'attribute' | 'property' | 'style' | 'decorative';
    uncheckedValue?: string | boolean;
    useSearchTerm?: boolean;
    videoFormatPickerConfigs?: {
        /** The block-attribute key that holds the asset ID for this video. */
        assetIdKey?: string;
        /** The block-attribute key that stores the selected asset version. Defaults to 'asset-version'. */
        assetVersionKey?: string;
        /** The block-attribute key that stores the human-readable format label. Defaults to 'format-label'. */
        formatLabelKey?: string;
        /** The block-attribute key that stores the resolved video source URL. Defaults to 'format-src'. */
        formatSrcKey?: string;
        /** The block-attribute key that stores the human-readable version label. Defaults to 'version-label'. */
        versionLabelKey?: string;
    };
    width?: ((record: Record<string, unknown>) => string | number) | string | number;
};
export declare enum Permission {
    All = "ALL",// Template
    CanDelete = "CanDelete",
    CanDownload = "CanDownload",
    CanFind = "CanFind",
    CanManageRights = "CanManageRights",
    CanMove = "CanMove",
    CanRead = "CanRead",
    CanReadAll = "CanReadAll",
    CanReadAndWrite = "CanReadAndWrite",// Template
    CanReadLarge = "CanReadLarge",
    CanReadMedium = "CanReadMedium",
    CanReadOriginal = "CanReadOriginal",
    CanShare = "CanShare",
    CanUpload = "CanUpload",
    CanWrite = "CanWrite",// Template
    None = "NONE"
}
export declare enum AssetType {
    All = "all",
    Audio = "audio",
    Image = "image",
    Other = "other",
    Video = "video"
}
export type AssetTypeString = AssetType | `${AssetType} ${AssetTypeString}`;
export type Asset = {
    id: string;
    name: string;
    src: string;
    type: AssetType;
    url?: string;
};
export declare enum EditorMode {
    Content = "content",
    Template = "template"
}
export type ToolbarItem = {
    active?: boolean;
    attributes?: Record<string, any>;
    className?: string;
    command: string | ((editor: GrapesjsEditor, component: Component, opts?: Record<string, any>) => void);
    disabled?: boolean;
    icon?: string;
    iconClass?: string;
    iconSize?: 'small' | 'medium' | 'large';
    id: string;
    label: string;
};
export type TeamSpace = {
    absoluteURL: string;
    description: string;
    module: string;
    name: string;
};
export declare enum TeamSpaceRole {
    Administrator = "Administrator",
    Designer = "Designer",
    Editor = "Editor"
}
export type TeamSpaceFontFamily = {
    fontFamily: string;
    fontFilesURLs: string[];
};
export type RTE_CONFIG = {
    basicFormat?: boolean;
    blockFormatting?: boolean;
    enableAll?: boolean;
    fontColor?: boolean;
    fontSize?: boolean;
    getElement?: (el: HTMLElement) => HTMLElement | null | undefined | Promise<HTMLElement | null | undefined>;
    highlight?: boolean;
    lineHeight?: boolean;
    link?: boolean;
    styles?: {
        singleRow?: boolean;
    };
    textAlignment?: boolean;
    textBackground?: boolean;
    textIndentation?: boolean;
    textListing?: boolean;
    textScript?: boolean;
};
export type RTE_IMAGE = {
    alt: string;
    borderColor: string;
    borderStyle: string;
    borderWidth: string;
    borderWidthUnit: string;
    height: string;
    imgStyle: string;
    keepRatio: boolean;
    src: string;
    title: string;
    type: AssetType;
    width: string;
};
export declare enum BlockType {
    Accordion = "BlockAccordion",
    Analytics = "BlockAnalytics",
    Button = "BlockButton",
    Carousel = "BlockCarousel",
    ColorSwatches = "BlockColorSwatches",
    Column = "BlockCell",
    ColumnGroup = "BlockColumns",
    Divider = "BlockDivider",
    FontKit = "BlockFontKit",
    Gallery = "BlockGallery",
    Header = "BlockHeader",
    Image = "BlockImage",
    RichText = "BlockRichText",
    SearchBox = "BlockSearchBox",
    TabGroup = "BlockTabs",
    Text = "BlockText",
    Timeline = "BlockTimeline",
    Video = "BlockVideo"
}
export declare const BLOCK_DROPPABLE_BLOCKS: (BlockType.Accordion | BlockType.Analytics | BlockType.Button | BlockType.Carousel | BlockType.ColorSwatches | BlockType.ColumnGroup | BlockType.Divider | BlockType.FontKit | BlockType.Gallery | BlockType.Header | BlockType.Image | BlockType.RichText | BlockType.SearchBox | BlockType.TabGroup | BlockType.Text | BlockType.Timeline | BlockType.Video)[];
export declare enum DialogType {
    Carousel = "carousel",
    Gallery = "gallery"
}
export type Page = {
    hasChildren: boolean;
    id: string;
    title: string;
    type: 'Page';
    url: string | null;
};
export type Link = {
    hasChildren: boolean;
    id: string;
    title: string;
    type: 'Link';
    url: string | null;
};
export type ToolbarConfiguration = {
    allowDuplicateBlocks?: boolean;
};
export declare enum DataSourceId {
    Templates = "TEMPLATES",
    TranslatableAttributes = "TRANSLATABLE_ATTRIBUTES",
    TranslatableTexts = "TRANSLATABLE_TEXTS"
}
export type ConfigsOptions = {
    enableAssetFormatControls?: boolean;
};
