UNPKG

tinymce

Version:

Web based JavaScript HTML WYSIWYG editor control.

1,267 lines 111 kB
interface StringPathBookmark { start: string; end?: string; } interface RangeBookmark { rng: Range; } interface IdBookmark { id: string; keep?: boolean; } interface IndexBookmark { name: string; index: number; } interface PathBookmark { start: number[]; end?: number[]; isFakeCaret?: boolean; } declare type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark; declare type NormalizedEvent<E, T = any> = E & { readonly type: string; readonly target: T; readonly isDefaultPrevented: () => boolean; readonly preventDefault: () => void; readonly isPropagationStopped: () => boolean; readonly stopPropagation: () => void; readonly isImmediatePropagationStopped: () => boolean; readonly stopImmediatePropagation: () => void; }; declare type MappedEvent<T, K extends string> = K extends keyof T ? T[K] : any; interface NativeEventMap { 'beforepaste': Event; 'blur': FocusEvent; 'beforeinput': InputEvent; 'click': MouseEvent; 'compositionend': Event; 'compositionstart': Event; 'compositionupdate': Event; 'contextmenu': PointerEvent; 'copy': ClipboardEvent; 'cut': ClipboardEvent; 'dblclick': MouseEvent; 'drag': DragEvent; 'dragdrop': DragEvent; 'dragend': DragEvent; 'draggesture': DragEvent; 'dragover': DragEvent; 'dragstart': DragEvent; 'drop': DragEvent; 'focus': FocusEvent; 'focusin': FocusEvent; 'focusout': FocusEvent; 'input': InputEvent; 'keydown': KeyboardEvent; 'keypress': KeyboardEvent; 'keyup': KeyboardEvent; 'mousedown': MouseEvent; 'mouseenter': MouseEvent; 'mouseleave': MouseEvent; 'mousemove': MouseEvent; 'mouseout': MouseEvent; 'mouseover': MouseEvent; 'mouseup': MouseEvent; 'paste': ClipboardEvent; 'selectionchange': Event; 'submit': Event; 'touchend': TouchEvent; 'touchmove': TouchEvent; 'touchstart': TouchEvent; 'touchcancel': TouchEvent; 'wheel': WheelEvent; } declare type EditorEvent<T> = NormalizedEvent<T>; interface EventDispatcherSettings { scope?: any; toggleEvent?: (name: string, state: boolean) => void | boolean; beforeFire?: <T>(args: EditorEvent<T>) => void; } interface EventDispatcherConstructor<T extends NativeEventMap> { readonly prototype: EventDispatcher<T>; new (settings?: EventDispatcherSettings): EventDispatcher<T>; isNative: (name: string) => boolean; } declare class EventDispatcher<T> { static isNative(name: string): boolean; private readonly settings; private readonly scope; private readonly toggleEvent; private bindings; constructor(settings?: Record<string, any>); fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this; off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this; once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this; has(name: string): boolean; } declare const enum UndoLevelType { Fragmented = "fragmented", Complete = "complete" } interface UndoLevel { type: UndoLevelType; fragments: string[]; content: string; bookmark: Bookmark; beforeBookmark: Bookmark; } interface UndoManager { data: UndoLevel[]; typing: boolean; add: (level?: UndoLevel, event?: EditorEvent<any>) => UndoLevel; beforeChange: () => void; undo: () => UndoLevel; redo: () => UndoLevel; clear: () => void; reset: () => void; hasUndo: () => boolean; hasRedo: () => boolean; transact: (callback: () => void) => UndoLevel; ignore: (callback: () => void) => void; extra: (callback1: () => void, callback2: () => void) => void; } declare type SchemaType = 'html4' | 'html5' | 'html5-strict'; interface SchemaSettings { custom_elements?: string; extended_valid_elements?: string; invalid_elements?: string; invalid_styles?: string | Record<string, string>; schema?: SchemaType; valid_children?: string; valid_classes?: string | Record<string, string>; valid_elements?: string; valid_styles?: string | Record<string, string>; verify_html?: boolean; } interface Attribute { required?: boolean; defaultValue?: string; forcedValue?: string; validValues?: Record<string, {}>; } interface DefaultAttribute { name: string; value: string; } interface AttributePattern { defaultValue?: string; forcedValue?: string; pattern: RegExp; required?: boolean; validValues?: Record<string, {}>; } interface ElementRule { attributes: Record<string, Attribute>; attributesDefault?: DefaultAttribute[]; attributesForced?: DefaultAttribute[]; attributesOrder: string[]; attributePatterns?: AttributePattern[]; attributesRequired?: string[]; paddEmpty?: boolean; removeEmpty?: boolean; removeEmptyAttrs?: boolean; } interface SchemaElement extends ElementRule { outputName?: string; parentsRequired?: string[]; pattern?: RegExp; } interface SchemaMap { [name: string]: {}; } interface SchemaRegExpMap { [name: string]: RegExp; } interface Schema { type: SchemaType; children: Record<string, SchemaMap>; elements: Record<string, SchemaElement>; getValidStyles: () => Record<string, string[]> | undefined; getValidClasses: () => Record<string, SchemaMap> | undefined; getBlockElements: () => SchemaMap; getInvalidStyles: () => Record<string, SchemaMap> | undefined; getVoidElements: () => SchemaMap; getTextBlockElements: () => SchemaMap; getTextInlineElements: () => SchemaMap; getBoolAttrs: () => SchemaMap; getElementRule: (name: string) => SchemaElement | undefined; getSelfClosingElements: () => SchemaMap; getNonEmptyElements: () => SchemaMap; getMoveCaretBeforeOnEnterElements: () => SchemaMap; getWhitespaceElements: () => SchemaMap; getSpecialElements: () => SchemaRegExpMap; isValidChild: (name: string, child: string) => boolean; isValid: (name: string, attr?: string) => boolean; getCustomElements: () => SchemaMap; addValidElements: (validElements: string) => void; setValidElements: (validElements: string) => void; addCustomElements: (customElements: string) => void; addValidChildren: (validChildren: any) => void; } declare type Attributes$1 = Array<{ name: string; value: string; }> & { map: Record<string, string>; }; interface AstNodeConstructor { readonly prototype: AstNode; new (name: string, type: number): AstNode; create(name: string, attrs?: Record<string, string>): AstNode; } declare class AstNode { static create(name: string, attrs?: Record<string, string>): AstNode; name: string; type: number; attributes?: Attributes$1; value?: string; parent?: AstNode; firstChild?: AstNode; lastChild?: AstNode; next?: AstNode; prev?: AstNode; raw?: boolean; constructor(name: string, type: number); replace(node: AstNode): AstNode; attr(name: string, value: string | null): AstNode | undefined; attr(name: Record<string, string | null>): AstNode | undefined; attr(name: string): string | undefined; clone(): AstNode; wrap(wrapper: AstNode): AstNode; unwrap(): void; remove(): AstNode; append(node: AstNode): AstNode; insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode; getAll(name: string): AstNode[]; children(): AstNode[]; empty(): AstNode; isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean; walk(prev?: boolean): AstNode; } declare type Content = string | AstNode; declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree'; interface GetContentArgs { format: ContentFormat; get: boolean; getInner: boolean; no_events?: boolean; save?: boolean; source_view?: boolean; [key: string]: any; } interface SetContentArgs { format: string; set: boolean; content: Content; no_events?: boolean; no_selection?: boolean; paste?: boolean; } interface GetSelectionContentArgs extends GetContentArgs { selection?: boolean; contextual?: boolean; } interface SetSelectionContentArgs extends SetContentArgs { content: string; selection?: boolean; } interface BlobInfoData { id?: string; name?: string; filename?: string; blob: Blob; base64: string; blobUri?: string; uri?: string; } interface BlobInfo { id: () => string; name: () => string; filename: () => string; blob: () => Blob; base64: () => string; blobUri: () => string; uri: () => string | undefined; } interface BlobCache { create: (o: string | BlobInfoData, blob?: Blob, base64?: string, name?: string, filename?: string) => BlobInfo; add: (blobInfo: BlobInfo) => void; get: (id: string) => BlobInfo | undefined; getByUri: (blobUri: string) => BlobInfo | undefined; getByData: (base64: string, type: string) => BlobInfo | undefined; findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined; removeByUri: (blobUri: string) => void; destroy: () => void; } interface BlobInfoImagePair { image: HTMLImageElement; blobInfo: BlobInfo; } declare class NodeChange { private readonly editor; private lastPath; constructor(editor: Editor); nodeChanged(args?: any): void; private isSameElementPath; } interface SelectionOverrides { showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null; showBlockCaretContainer: (blockCaretContainer: Element) => void; hideFakeCaret: () => void; destroy: () => void; } interface Quirks { refreshContentEditable(): void; isHidden(): boolean; } declare type DecoratorData = Record<string, any>; declare type Decorator = (uid: string, data: DecoratorData) => { attributes?: {}; classes?: string[]; }; declare type AnnotationListener = (state: boolean, name: string, data?: { uid: string; nodes: any[]; }) => void; declare type AnnotationListenerApi = AnnotationListener; interface AnnotatorSettings { decorate: Decorator; persistent?: boolean; } interface Annotator { register: (name: string, settings: AnnotatorSettings) => void; annotate: (name: string, data: DecoratorData) => void; annotationChanged: (name: string, f: AnnotationListenerApi) => void; remove: (name: string) => void; removeAll: (name: string) => void; getAll: (name: string) => Record<string, Element[]>; } interface GeomRect { readonly x: number; readonly y: number; readonly w: number; readonly h: number; } interface Rect { inflate: (rect: GeomRect, w: number, h: number) => GeomRect; relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect; findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null; intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null; clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect; create: (x: number, y: number, w: number, h: number) => GeomRect; fromClientRect: (clientRect: DOMRect) => GeomRect; } interface NotificationManagerImpl { open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi; close: <T extends NotificationApi>(notification: T) => void; getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec; } interface NotificationSpec { type?: 'info' | 'warning' | 'error' | 'success'; text: string; icon?: string; progressBar?: boolean; timeout?: number; closeButton?: boolean; } interface NotificationApi { close: () => void; progressBar: { value: (percent: number) => void; }; text: (text: string) => void; reposition: () => void; getEl: () => HTMLElement; settings: NotificationSpec; } interface NotificationManager { open: (spec: NotificationSpec) => NotificationApi; close: () => void; getNotifications: () => NotificationApi[]; } interface UploadFailure { message: string; remove?: boolean; } declare type ProgressFn = (percent: number) => void; declare type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>; interface UploadResult$2 { url: string; blobInfo: BlobInfo; status: boolean; error?: UploadFailure; } interface RawPattern { start?: any; end?: any; format?: any; cmd?: any; value?: any; replacement?: any; } interface InlineBasePattern { readonly start: string; readonly end: string; } interface InlineFormatPattern extends InlineBasePattern { readonly type: 'inline-format'; readonly format: string[]; } interface InlineCmdPattern extends InlineBasePattern { readonly type: 'inline-command'; readonly cmd: string; readonly value?: any; } declare type InlinePattern = InlineFormatPattern | InlineCmdPattern; interface BlockBasePattern { readonly start: string; } interface BlockFormatPattern extends BlockBasePattern { readonly type: 'block-format'; readonly format: string; } interface BlockCmdPattern extends BlockBasePattern { readonly type: 'block-command'; readonly cmd: string; readonly value?: any; } declare type BlockPattern = BlockFormatPattern | BlockCmdPattern; declare type Pattern = InlinePattern | BlockPattern; interface AlertBannerSpec { type: 'alertbanner'; level: 'info' | 'warn' | 'error' | 'success'; text: string; icon: string; url?: string; } interface ButtonSpec { type: 'button'; text: string; enabled?: boolean; primary?: boolean; name?: string; icon?: string; borderless?: boolean; buttonType?: 'primary' | 'secondary' | 'toolbar'; } interface FormComponentSpec { type: string; name: string; } interface FormComponentWithLabelSpec extends FormComponentSpec { label?: string; } interface CheckboxSpec extends FormComponentSpec { type: 'checkbox'; label: string; enabled?: boolean; } interface CollectionSpec extends FormComponentWithLabelSpec { type: 'collection'; } interface CollectionItem { value: string; text: string; icon: string; } interface ColorInputSpec extends FormComponentWithLabelSpec { type: 'colorinput'; } interface ColorPickerSpec extends FormComponentWithLabelSpec { type: 'colorpicker'; } interface CustomEditorInit { setValue: (value: string) => void; getValue: () => string; destroy: () => void; } declare type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>; interface CustomEditorOldSpec extends FormComponentSpec { type: 'customeditor'; tag?: string; init: (e: HTMLElement) => Promise<CustomEditorInit>; } interface CustomEditorNewSpec extends FormComponentSpec { type: 'customeditor'; tag?: string; scriptId: string; scriptUrl: string; settings?: any; } declare type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec; interface DropZoneSpec extends FormComponentWithLabelSpec { type: 'dropzone'; } interface GridSpec { type: 'grid'; columns: number; items: BodyComponentSpec[]; } interface HtmlPanelSpec { type: 'htmlpanel'; html: string; presets?: 'presentation' | 'document'; } interface IframeSpec extends FormComponentWithLabelSpec { type: 'iframe'; sandboxed?: boolean; } interface ImagePreviewSpec extends FormComponentSpec { type: 'imagepreview'; height?: string; } interface InputSpec extends FormComponentWithLabelSpec { type: 'input'; inputMode?: string; placeholder?: string; maximized?: boolean; enabled?: boolean; } interface LabelSpec { type: 'label'; label: string; items: BodyComponentSpec[]; } interface ListBoxSingleItemSpec { text: string; value: string; } interface ListBoxNestedItemSpec { text: string; items: ListBoxItemSpec[]; } declare type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec; interface ListBoxSpec extends FormComponentWithLabelSpec { type: 'listbox'; items: ListBoxItemSpec[]; disabled?: boolean; } interface PanelSpec { type: 'panel'; classes?: string[]; items: BodyComponentSpec[]; } interface SelectBoxItemSpec { text: string; value: string; } interface SelectBoxSpec extends FormComponentWithLabelSpec { type: 'selectbox'; items: SelectBoxItemSpec[]; size?: number; enabled?: boolean; } interface SizeInputSpec extends FormComponentWithLabelSpec { type: 'sizeinput'; constrain?: boolean; enabled?: boolean; } interface SliderSpec extends FormComponentSpec { type: 'slider'; label: string; min?: number; max?: number; } interface TableSpec { type: 'table'; header: string[]; cells: string[][]; } interface TextAreaSpec extends FormComponentWithLabelSpec { type: 'textarea'; placeholder?: string; maximized?: boolean; enabled?: boolean; } interface UrlInputSpec extends FormComponentWithLabelSpec { type: 'urlinput'; filetype?: 'image' | 'media' | 'file'; enabled?: boolean; } interface UrlInputData { value: string; meta: { text?: string; }; } declare type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | PanelSpec | CustomEditorSpec; interface BarSpec { type: 'bar'; items: BodyComponentSpec[]; } interface CommonMenuItemSpec { enabled?: boolean; text?: string; value?: string; meta?: Record<string, any>; shortcut?: string; } interface CommonMenuItemInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; } interface DialogToggleMenuItemSpec extends CommonMenuItemSpec { type?: 'togglemenuitem'; name: string; } declare type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec; interface BaseDialogFooterButtonSpec { name?: string; align?: 'start' | 'end'; primary?: boolean; enabled?: boolean; icon?: string; buttonType?: 'primary' | 'secondary'; } interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec { type: 'submit' | 'cancel' | 'custom'; text: string; } interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec { type: 'menu'; text?: string; tooltip?: string; icon?: string; items: DialogFooterMenuButtonItemSpec[]; } declare type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec; interface TabSpec { name?: string; title: string; items: BodyComponentSpec[]; } interface TabPanelSpec { type: 'tabpanel'; tabs: TabSpec[]; } declare type DialogDataItem = any; declare type DialogData = Record<string, DialogDataItem>; interface DialogInstanceApi<T extends DialogData> { getData: () => T; setData: (data: Partial<T>) => void; setEnabled: (name: string, state: boolean) => void; focus: (name: string) => void; showTab: (name: string) => void; redial: (nu: DialogSpec<T>) => void; block: (msg: string) => void; unblock: () => void; close: () => void; } interface DialogActionDetails { name: string; value?: any; } interface DialogChangeDetails<T> { name: keyof T; } interface DialogTabChangeDetails { newTabName: string; oldTabName: string; } declare type DialogActionHandler<T> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void; declare type DialogChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void; declare type DialogSubmitHandler<T> = (api: DialogInstanceApi<T>) => void; declare type DialogCloseHandler = () => void; declare type DialogCancelHandler<T> = (api: DialogInstanceApi<T>) => void; declare type DialogTabChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void; declare type DialogSize = 'normal' | 'medium' | 'large'; interface DialogSpec<T extends DialogData> { title: string; size?: DialogSize; body: TabPanelSpec | PanelSpec; buttons: DialogFooterButtonSpec[]; initialData?: Partial<T>; onAction?: DialogActionHandler<T>; onChange?: DialogChangeHandler<T>; onSubmit?: DialogSubmitHandler<T>; onClose?: DialogCloseHandler; onCancel?: DialogCancelHandler<T>; onTabChange?: DialogTabChangeHandler<T>; } interface UrlDialogInstanceApi { block: (msg: string) => void; unblock: () => void; close: () => void; sendMessage: (msg: any) => void; } interface UrlDialogActionDetails { name: string; value?: any; } interface UrlDialogMessage { mceAction: string; [key: string]: any; } declare type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void; declare type UrlDialogCloseHandler = () => void; declare type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void; declare type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void; interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec { type: 'cancel' | 'custom'; } interface UrlDialogSpec { title: string; url: string; height?: number; width?: number; buttons?: UrlDialogFooterButtonSpec[]; onAction?: UrlDialogActionHandler; onClose?: UrlDialogCloseHandler; onCancel?: UrlDialogCancelHandler; onMessage?: UrlDialogMessageHandler; } declare type CardContainerDirection = 'vertical' | 'horizontal'; declare type CardContainerAlign = 'left' | 'right'; declare type CardContainerValign = 'top' | 'middle' | 'bottom'; interface CardContainerSpec { type: 'cardcontainer'; items: CardItemSpec[]; direction?: CardContainerDirection; align?: CardContainerAlign; valign?: CardContainerValign; } interface CardImageSpec { type: 'cardimage'; src: string; alt?: string; classes?: string[]; } interface CardTextSpec { type: 'cardtext'; text: string; name?: string; classes?: string[]; } declare type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec; interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi { } interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> { type: 'cardmenuitem'; label?: string; items: CardItemSpec[]; onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void; onAction?: (api: CardMenuItemInstanceApi) => void; } interface SeparatorMenuItemSpec { type?: 'separator'; text?: string; } declare type ColumnTypes$1 = number | 'auto'; declare type SeparatorItemSpec = SeparatorMenuItemSpec; interface AutocompleterItemSpec { type?: 'autocompleteitem'; value: string; text?: string; icon?: string; meta?: Record<string, any>; } declare type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec; interface AutocompleterSpec { type?: 'autocompleter'; ch: string; minChars?: number; columns?: ColumnTypes$1; matches?: (rng: Range, text: string, pattern: string) => boolean; fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>; onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void; maxResults?: number; highlightOn?: string[]; } interface AutocompleterInstanceApi { hide: () => void; reload: (fetchOptions: Record<string, any>) => void; } declare type ContextPosition = 'node' | 'selection' | 'line'; declare type ContextScope = 'node' | 'editor'; interface ContextBarSpec { predicate?: (elem: Element) => boolean; position?: ContextPosition; scope?: ContextScope; } interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> { enabled?: boolean; tooltip?: string; icon?: string; text?: string; onSetup?: (api: I) => (api: I) => void; } interface BaseToolbarButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; } interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> { type?: 'button'; onAction: (api: ToolbarButtonInstanceApi) => void; } interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi { } interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> { active?: boolean; } interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi { isActive: () => boolean; setActive: (state: boolean) => void; } interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> { type?: 'togglebutton'; onAction: (api: ToolbarToggleButtonInstanceApi) => void; } interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi { } interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> { type: 'contextformbutton'; } interface ContextFormLaunchToggleButtonSpec extends BaseToolbarToggleButtonSpec<BaseToolbarToggleButtonInstanceApi> { type: 'contextformtogglebutton'; } interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi { } interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi { } interface ContextFormButtonSpec extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> { type?: 'contextformbutton'; primary?: boolean; onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void; } interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> { type?: 'contextformtogglebutton'; onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void; primary?: boolean; } interface ContextFormInstanceApi { hide: () => void; getValue: () => string; } interface ContextFormSpec extends ContextBarSpec { type?: 'contextform'; initValue?: () => string; label?: string; launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec; commands: Array<ContextFormToggleButtonSpec | ContextFormButtonSpec>; } interface ContextToolbarSpec extends ContextBarSpec { type?: 'contexttoolbar'; items: string; } interface ChoiceMenuItemSpec extends CommonMenuItemSpec { type?: 'choiceitem'; icon?: string; } interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi { isActive: () => boolean; setActive: (state: boolean) => void; } interface ContextMenuItem extends CommonMenuItemSpec { text: string; icon?: string; type?: 'item'; onAction: () => void; } interface ContextSubMenu extends CommonMenuItemSpec { type: 'submenu'; text: string; icon?: string; getSubmenuItems: () => string | Array<ContextMenuContents>; } declare type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu; interface ContextMenuApi { update: (element: Element) => string | Array<ContextMenuContents>; } interface FancyActionArgsMap { 'inserttable': { numRows: number; numColumns: number; }; 'colorswatch': { value: string; }; } interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> { type: 'fancymenuitem'; fancytype: T; initData?: Record<string, unknown>; onAction?: (data: FancyActionArgsMap[T]) => void; } interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> { fancytype: 'inserttable'; initData?: {}; } interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> { fancytype: 'colorswatch'; initData?: { allowCustomColors?: boolean; colors: ChoiceMenuItemSpec[]; }; } declare type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec; interface MenuItemSpec extends CommonMenuItemSpec { type?: 'menuitem'; icon?: string; onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void; onAction?: (api: MenuItemInstanceApi) => void; } interface MenuItemInstanceApi extends CommonMenuItemInstanceApi { } declare type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec; interface NestedMenuItemSpec extends CommonMenuItemSpec { type?: 'nestedmenuitem'; icon?: string; getSubmenuItems: () => string | Array<NestedMenuItemContents>; onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void; } interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi { } interface ToggleMenuItemSpec extends CommonMenuItemSpec { type?: 'togglemenuitem'; icon?: string; active?: boolean; onSetup?: (api: ToggleMenuItemInstanceApi) => void; onAction: (api: ToggleMenuItemInstanceApi) => void; } interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi { isActive: () => boolean; setActive: (state: boolean) => void; } type PublicDialog_d_AlertBannerSpec = AlertBannerSpec; type PublicDialog_d_BarSpec = BarSpec; type PublicDialog_d_BodyComponentSpec = BodyComponentSpec; type PublicDialog_d_ButtonSpec = ButtonSpec; type PublicDialog_d_CheckboxSpec = CheckboxSpec; type PublicDialog_d_CollectionItem = CollectionItem; type PublicDialog_d_CollectionSpec = CollectionSpec; type PublicDialog_d_ColorInputSpec = ColorInputSpec; type PublicDialog_d_ColorPickerSpec = ColorPickerSpec; type PublicDialog_d_CustomEditorSpec = CustomEditorSpec; type PublicDialog_d_CustomEditorInit = CustomEditorInit; type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn; type PublicDialog_d_DialogData = DialogData; type PublicDialog_d_DialogSize = DialogSize; type PublicDialog_d_DialogSpec<_0> = DialogSpec<_0>; type PublicDialog_d_DialogInstanceApi<_0> = DialogInstanceApi<_0>; type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec; type PublicDialog_d_DialogActionDetails = DialogActionDetails; type PublicDialog_d_DialogChangeDetails<_0> = DialogChangeDetails<_0>; type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails; type PublicDialog_d_DropZoneSpec = DropZoneSpec; type PublicDialog_d_GridSpec = GridSpec; type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec; type PublicDialog_d_IframeSpec = IframeSpec; type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec; type PublicDialog_d_InputSpec = InputSpec; type PublicDialog_d_LabelSpec = LabelSpec; type PublicDialog_d_ListBoxSpec = ListBoxSpec; type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec; type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec; type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec; type PublicDialog_d_PanelSpec = PanelSpec; type PublicDialog_d_SelectBoxSpec = SelectBoxSpec; type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec; type PublicDialog_d_SizeInputSpec = SizeInputSpec; type PublicDialog_d_SliderSpec = SliderSpec; type PublicDialog_d_TableSpec = TableSpec; type PublicDialog_d_TabSpec = TabSpec; type PublicDialog_d_TabPanelSpec = TabPanelSpec; type PublicDialog_d_TextAreaSpec = TextAreaSpec; type PublicDialog_d_UrlInputData = UrlInputData; type PublicDialog_d_UrlInputSpec = UrlInputSpec; type PublicDialog_d_UrlDialogSpec = UrlDialogSpec; type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec; type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi; type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails; type PublicDialog_d_UrlDialogMessage = UrlDialogMessage; declare namespace PublicDialog_d { export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_UrlInputData as UrlInputData, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, }; } type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec; type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec; type PublicInlineContent_d_AutocompleterContents = AutocompleterContents; type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi; type PublicInlineContent_d_ContextPosition = ContextPosition; type PublicInlineContent_d_ContextScope = ContextScope; type PublicInlineContent_d_ContextFormSpec = ContextFormSpec; type PublicInlineContent_d_ContextFormInstanceApi = ContextFormInstanceApi; type PublicInlineContent_d_ContextFormButtonSpec = ContextFormButtonSpec; type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi; type PublicInlineContent_d_ContextFormToggleButtonSpec = ContextFormToggleButtonSpec; type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi; type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec; type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec; declare namespace PublicInlineContent_d { export { PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, }; } type PublicMenu_d_MenuItemSpec = MenuItemSpec; type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi; type PublicMenu_d_NestedMenuItemContents = NestedMenuItemContents; type PublicMenu_d_NestedMenuItemSpec = NestedMenuItemSpec; type PublicMenu_d_NestedMenuItemInstanceApi = NestedMenuItemInstanceApi; type PublicMenu_d_FancyMenuItemSpec = FancyMenuItemSpec; type PublicMenu_d_ColorSwatchMenuItemSpec = ColorSwatchMenuItemSpec; type PublicMenu_d_InsertTableMenuItemSpec = InsertTableMenuItemSpec; type PublicMenu_d_ToggleMenuItemSpec = ToggleMenuItemSpec; type PublicMenu_d_ToggleMenuItemInstanceApi = ToggleMenuItemInstanceApi; type PublicMenu_d_ChoiceMenuItemSpec = ChoiceMenuItemSpec; type PublicMenu_d_ChoiceMenuItemInstanceApi = ChoiceMenuItemInstanceApi; type PublicMenu_d_SeparatorMenuItemSpec = SeparatorMenuItemSpec; type PublicMenu_d_ContextMenuApi = ContextMenuApi; type PublicMenu_d_ContextMenuContents = ContextMenuContents; type PublicMenu_d_ContextMenuItem = ContextMenuItem; type PublicMenu_d_ContextSubMenu = ContextSubMenu; type PublicMenu_d_CardMenuItemSpec = CardMenuItemSpec; type PublicMenu_d_CardMenuItemInstanceApi = CardMenuItemInstanceApi; type PublicMenu_d_CardItemSpec = CardItemSpec; type PublicMenu_d_CardContainerSpec = CardContainerSpec; type PublicMenu_d_CardImageSpec = CardImageSpec; type PublicMenu_d_CardTextSpec = CardTextSpec; declare namespace PublicMenu_d { export { PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardTextSpec as CardTextSpec, }; } interface SidebarInstanceApi { element: () => HTMLElement; } interface SidebarSpec { icon?: string; tooltip?: string; onShow?: (api: SidebarInstanceApi) => void; onSetup?: (api: SidebarInstanceApi) => (api: SidebarInstanceApi) => void; onHide?: (api: SidebarInstanceApi) => void; } type PublicSidebar_d_SidebarSpec = SidebarSpec; type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi; declare namespace PublicSidebar_d { export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, }; } interface ToolbarGroupSetting { name: string; items: string[]; } declare type ToolbarConfig = string | ToolbarGroupSetting[]; interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi { } interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> { type?: 'grouptoolbarbutton'; items?: ToolbarConfig; } declare type MenuButtonItemTypes = NestedMenuItemContents; declare type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void; interface BaseMenuButtonSpec { text?: string; tooltip?: string; icon?: string; fetch: (success: SuccessCallback$1) => void; onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void; } interface BaseMenuButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; isActive: () => boolean; setActive: (state: boolean) => void; } interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec { type?: 'menubutton'; onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void; } interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi { } declare type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec; declare type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void; declare type SelectPredicate = (value: string) => boolean; declare type PresetTypes = 'color' | 'normal' | 'listpreview'; declare type ColumnTypes = number | 'auto'; interface ToolbarSplitButtonSpec { type?: 'splitbutton'; tooltip?: string; icon?: string; text?: string; select?: SelectPredicate; presets?: PresetTypes; columns?: ColumnTypes; fetch: (success: SuccessCallback) => void; onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void; onAction: (api: ToolbarSplitButtonInstanceApi) => void; onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void; } interface ToolbarSplitButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; setIconFill: (id: string, value: string) => void; isActive: () => boolean; setActive: (state: boolean) => void; } type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec; type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi; type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec; type PublicToolbar_d_ToolbarSplitButtonInstanceApi = ToolbarSplitButtonInstanceApi; type PublicToolbar_d_ToolbarMenuButtonSpec = ToolbarMenuButtonSpec; type PublicToolbar_d_ToolbarMenuButtonInstanceApi = ToolbarMenuButtonInstanceApi; type PublicToolbar_d_ToolbarToggleButtonSpec = ToolbarToggleButtonSpec; type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanceApi; type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec; type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi; declare namespace PublicToolbar_d { export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, }; } interface Registry$1 { addButton: (name: string, spec: ToolbarButtonSpec) => void; addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void; addToggleButton: (name: string, spec: ToolbarToggleButtonSpec) => void; addMenuButton: (name: string, spec: ToolbarMenuButtonSpec) => void; addSplitButton: (name: string, spec: ToolbarSplitButtonSpec) => void; addMenuItem: (name: string, spec: MenuItemSpec) => void; addNestedMenuItem: (name: string, spec: NestedMenuItemSpec) => void; addToggleMenuItem: (name: string, spec: ToggleMenuItemSpec) => void; addContextMenu: (name: string, spec: ContextMenuApi) => void; addContextToolbar: (name: string, spec: ContextToolbarSpec) => void; addContextForm: (name: string, spec: ContextFormSpec) => void; addIcon: (name: string, svgData: string) => void; addAutocompleter: (name: string, spec: AutocompleterSpec) => void; addSidebar: (name: string, spec: SidebarSpec) => void; getAll: () => { buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>; menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>; popups: Record<string, AutocompleterSpec>; contextMenus: Record<string, ContextMenuApi>; contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>; icons: Record<string, string>; sidebars: Record<string, SidebarSpec>; }; } interface AutocompleteLookupData { readonly matchText: string; readonly items: AutocompleterContents[]; readonly columns: ColumnTypes$1; readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void; readonly highlightOn: string[]; } interface AutocompleterEventArgs { readonly lookupData: AutocompleteLookupData[]; } interface RangeLikeObject { startContainer: Node; startOffset: number; endContainer: Node; endOffset: number; } declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat; declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat; declare type Format = ApplyFormat | RemoveFormat; declare type Formats = Record<string, Format | Format[]>; declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string); declare type FormatVars = Record<string, string | null>; interface BaseFormat<T> { ceFalseOverride?: boolean; classes?: string | string[]; collapsed?: boolean; exact?: boolean; expand?: boolean; links?: boolean; mixed?: boolean; block_expand?: boolean; onmatch?: (node: Node, fmt: T, itemName: string) => boolean; remove?: 'none' | 'empty' | 'all'; remove_similar?: boolean; split?: boolean; deep?: boolean; preserve_attributes?: string[]; } interface Block { block: string; list_block?: string; wrapper?: boolean; } interface Inline { inline: string; } interface Selector { selector: string; inherit?: boolean; } interface CommonFormat<T> extends BaseFormat<T> { attributes?: Record<string, FormatAttrOrStyleValue>; styles?: Record<string, FormatAttrOrStyleValue>; toggle?: boolean; preview?: string | false; onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void; clear_child_styles?: boolean; merge_siblings?: boolean; merge_with_parents?: boolean; } interface BlockFormat extends Block, CommonFormat<BlockFormat> { } interface InlineFormat extends Inline, CommonFormat<InlineFormat> { } interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> { } interface CommonRemoveFormat<T> extends BaseFormat<T> { attributes?: string[] | Record<string, FormatAttrOrStyleValue>; styles?: string[] | Record<string, FormatAttrOrStyleValue>; } interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> { } interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> { } interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> { } interface ParserArgs { getInner?: boolean | number; forced_root_block?: boolean | string; context?: string; isRootContent?: boolean; format?: string; invalid?: boolean; no_events?: boolean; [key: string]: any; } declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void; interface ParserFilter { name: string; callbacks: ParserFilterCallback[]; } interface DomParserSettings { allow_html_data_urls?: boolean; allow_svg_data_urls?: boolean; allow_conditional_comments?: boolean; allow_html_in_named_anchor?: boolean; allow_script_urls?: boolean; allow_unsafe_link_target?: boolean; convert_fonts_to_spans?: boolean; fix_list_elements?: boolean; font_size_legacy_values?: string; forced_root_block?: boolean | string; forced_root_block_attrs?: Record<string, string>; preserve_cdata?: boolean; remove_trailing_brs?: boolean; root_name?: string; validate?: boolean; inline_styles?: boolean; blob_cache?: BlobCache; document?: Document; } interface DomParser { schema: Schema; addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void; getAttributeFilters: () => ParserFilter[]; addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void; getNodeFilters: () => ParserFilter[]; parse: (html: string, args?: ParserArgs) => AstNode; } interface StyleSheetLoaderSettings { maxLoadTime?: number; contentCssCors?: boolean; referrerPolicy?: ReferrerPolicy; } interface StyleSheetLoader { load: (url: string) => Promise<void>; loadAll: (urls: string[]) => Promise<string[]>; unload: (url: string) => void; unloadAll: (urls: string[]) => void; _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void; } declare type Registry = Registry$1; interface EditorUiApi { show: () => void; hide: () => void; setEnabled: (state: boolean) => void; isEnabled: ()