import { StructureSchema } from '@ephox/boulder'; import type { Optional, Result } from '@ephox/katamari'; import type { ChoiceMenuItemSpec } from './ChoiceMenuItem'; import type { ImageMenuItemSpec, ResetImageItemSpec } from './ImageMenuItem'; export interface FancyActionArgsMap { inserttable: { numRows: number; numColumns: number; }; colorswatch: { value: string; }; imageselect: { value: string; }; } interface BaseFancyMenuItemSpec { type: 'fancymenuitem'; fancytype: T; initData?: Record; onAction?: (data: FancyActionArgsMap[T]) => void; } export interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> { fancytype: 'inserttable'; initData?: {}; } export interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> { fancytype: 'colorswatch'; select?: (value: string) => boolean; initData?: { allowCustomColors?: boolean; colors?: ChoiceMenuItemSpec[]; storageKey?: string; }; } export interface ImageSelectMenuItemSpec extends BaseFancyMenuItemSpec<'imageselect'> { fancytype: 'imageselect'; select?: (value: string) => boolean; initData: { columns: number; items: (ImageMenuItemSpec | ResetImageItemSpec)[]; }; } export type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec | ImageSelectMenuItemSpec; interface BaseFancyMenuItem { type: 'fancymenuitem'; fancytype: T; initData: Record; onAction: (data: FancyActionArgsMap[T]) => void; } export interface InsertTableMenuItem extends BaseFancyMenuItem<'inserttable'> { fancytype: 'inserttable'; initData: {}; } export interface ColorSwatchMenuItem extends BaseFancyMenuItem<'colorswatch'> { fancytype: 'colorswatch'; select: Optional<(value: string) => boolean>; initData: { allowCustomColors: boolean; colors: Optional; storageKey: string; }; } export interface ImageSelectMenuItem extends BaseFancyMenuItem<'imageselect'> { fancytype: 'imageselect'; select: Optional<(value: string) => boolean>; initData: { columns: number; items: (ImageMenuItemSpec | ResetImageItemSpec)[]; }; } export type FancyMenuItem = InsertTableMenuItem | ColorSwatchMenuItem | ImageSelectMenuItem; export declare const fancyMenuItemSchema: import("@ephox/boulder").StructureProcessor; export declare const createFancyMenuItem: (spec: FancyMenuItemSpec) => Result>; export {}; //# sourceMappingURL=FancyMenuItem.d.ts.map