import { ComponentType } from 'react'; import type { DME, DMEData } from '../types'; export type BrowseLinkCallbackParams = { link: string; openNew?: boolean; }; export type BrowseImageCallbackParams = DME.ImageInfo[]; export interface SavedBlockData { name: string; image?: string; savedData: { id?: string; type?: string; style?: { [style: string]: string; }; data: DMEData.DefaultDataType; children?: Array; }; } export interface CallbackConfig { browseImage?: ComponentType<{ value: BrowseImageCallbackParams; onChange: (value: BrowseImageCallbackParams) => void; multiple?: boolean; }>; browseLink?: ComponentType<{ value: BrowseLinkCallbackParams; onChange: (value: BrowseLinkCallbackParams) => void; }>; canEditControl?: (block: DMEData.Block) => boolean; getSavedBlocks?: (widget: string) => Array; } export interface widgetConfig { allowedTypes?: Array; [prop: string]: any; } export interface DataSourceConfigType { edit: React.FC<{ widget: string; data?: Record; isList?: boolean; view?: string; onChange: (v: Record) => void; }>; fetchInServer?: (widget: string, data: DMEData.DataSourceData, vars: Record) => Promise; fetchInClient?: (widget: string, data: DMEData.DataSourceData, values: { dependencyValue?: any; }) => Promise; } export interface StyleSettingConfigType { default: { list: StyleSettingsType; underList: StyleSettingsType; }; block: Array<{ path?: string; level?: number; blockType?: string | string[]; rootType?: string; rootStyle?: string; config: StyleSettingsType; }>; } export type AddingSettingsType = { allowedTypes?: Array; defaultStyle?: { [widget: string]: { [styleKey: string]: string; }; }; }; export type StyleSettingsType = { styles?: Record>; settings: Array; builtInSettings?: Array; }; export type ContextPathType = Array<{ pathKey: string | number; block?: { type: string; styles: Array; }; }>; export type ContextWithStyleType = { root?: { type: string; styles: Array; }; path: ContextPathType; }; export interface DMEConfigType { general?: { projectStyles?: { default: string; [prop: string]: string; }; imagePath?: (path: string, size?: 'thumbnail' | string) => string; deviceWidth?: { mobile: number; tablet: number; pc: number; }; }; editor: { defaultTheme?: string; favouriteWidgets?: Array; zIndex?: number; colors?: { text?: Array; border?: Array; background?: Array; [colorGroup: string]: Array | undefined; }; enableEditControl?: boolean; disabledStyleSettings?: { [widget: string]: Array; }; defaultStyle?: { [widget: string]: { [styleKey: string]: string; }; }; categories?: Array; ui: { [variable: string]: string; }; fontFamily?: Array<{ value: string; label: string; }>; fontSize?: Array<{ value: string; label: string; }>; heading?: Array<{ value: string; label: string; }>; characters?: Array; settingPanelWidth?: number; clipboardKey?: string; getAddingSettings?: (context: ContextWithStyleType) => AddingSettingsType; configStyleSettings?: ((current: { pathKey: string | number; block?: { type: string; styles: Array; }; }, context: ContextWithStyleType, parentIsList: boolean) => StyleSettingsType) | StyleSettingConfigType; }; widgets?: { [widget: string]: widgetConfig; }; dataSource?: DataSourceConfigType; plugins?: { imageHandlers?: Array void; }>>; blockSettingActions?: Array>; [plugin: string]: any; }; } declare const dmeConfig: { general: { projectStyles: { default: string; [prop: string]: string; }; imagePath: (path: string, size?: 'thumbnail' | string) => string; deviceWidth: { mobile: number; tablet: number; pc: number; }; themes: Array; [prop: string]: string | number | boolean | Record; }; editor: { defaultTheme: string; favouriteWidgets: Array; colors: { [colorGroup: string]: Array; }; defaultStyle: { [widget: string]: { [styleKey: string]: string; }; }; enableEditControl: boolean; disabledStyleSettings: { [widget: string]: Array | string; }; categories: Array; settingGroups: { [key: string]: string; }; fontFamily: Array<{ value: string; label: string; }>; heading: Array<{ value: string; label: string; }>; fontSize: Array<{ value: string; label: string; }>; characters: Array; zIndex: number; settingPanelWidth: number; ui: { [variable: string]: string; }; getAddingSettings?: (context: ContextWithStyleType) => AddingSettingsType; clipboardKey: string; configStyleSettings?: ((current: { pathKey: string | number; block?: { type: string; styles: Array; }; }, context: ContextWithStyleType, parentIsList: boolean) => StyleSettingsType) | StyleSettingConfigType; }; widgets: { [widget: string]: widgetConfig; }; plugins: { imageHandlers: Array void; }>>; blockSettingActions?: Array>; [plugin: string]: any; }; dataSource: DataSourceConfigType; callbacks: CallbackConfig; }; declare const setDMEditorConfig: (config: DMEConfigType) => void; declare const setDMEditorCallback: (config: CallbackConfig) => void; declare const getStyleConfig: (current: { pathKey: string | number; block?: { type: string; styles: Array; }; }, context: ContextWithStyleType, parentIsList: boolean) => StyleSettingsType; export * from './style'; export { dmeConfig, setDMEditorConfig, getStyleConfig, setDMEditorCallback };