UNPKG

128 kBTypeScriptView Raw
1interface StringPathBookmark {
2 start: string;
3 end?: string;
4 forward?: boolean;
5}
6interface RangeBookmark {
7 rng: Range;
8 forward?: boolean;
9}
10interface IdBookmark {
11 id: string;
12 keep?: boolean;
13 forward?: boolean;
14}
15interface IndexBookmark {
16 name: string;
17 index: number;
18}
19interface PathBookmark {
20 start: number[];
21 end?: number[];
22 isFakeCaret?: boolean;
23 forward?: boolean;
24}
25type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark;
26type NormalizedEvent<E, T = any> = E & {
27 readonly type: string;
28 readonly target: T;
29 readonly isDefaultPrevented: () => boolean;
30 readonly preventDefault: () => void;
31 readonly isPropagationStopped: () => boolean;
32 readonly stopPropagation: () => void;
33 readonly isImmediatePropagationStopped: () => boolean;
34 readonly stopImmediatePropagation: () => void;
35};
36type MappedEvent<T extends {}, K extends string> = K extends keyof T ? T[K] : any;
37interface NativeEventMap {
38 'beforepaste': Event;
39 'blur': FocusEvent;
40 'beforeinput': InputEvent;
41 'click': MouseEvent;
42 'compositionend': Event;
43 'compositionstart': Event;
44 'compositionupdate': Event;
45 'contextmenu': PointerEvent;
46 'copy': ClipboardEvent;
47 'cut': ClipboardEvent;
48 'dblclick': MouseEvent;
49 'drag': DragEvent;
50 'dragdrop': DragEvent;
51 'dragend': DragEvent;
52 'draggesture': DragEvent;
53 'dragover': DragEvent;
54 'dragstart': DragEvent;
55 'drop': DragEvent;
56 'focus': FocusEvent;
57 'focusin': FocusEvent;
58 'focusout': FocusEvent;
59 'input': InputEvent;
60 'keydown': KeyboardEvent;
61 'keypress': KeyboardEvent;
62 'keyup': KeyboardEvent;
63 'mousedown': MouseEvent;
64 'mouseenter': MouseEvent;
65 'mouseleave': MouseEvent;
66 'mousemove': MouseEvent;
67 'mouseout': MouseEvent;
68 'mouseover': MouseEvent;
69 'mouseup': MouseEvent;
70 'paste': ClipboardEvent;
71 'selectionchange': Event;
72 'submit': Event;
73 'touchend': TouchEvent;
74 'touchmove': TouchEvent;
75 'touchstart': TouchEvent;
76 'touchcancel': TouchEvent;
77 'wheel': WheelEvent;
78}
79type EditorEvent<T> = NormalizedEvent<T>;
80interface EventDispatcherSettings {
81 scope?: any;
82 toggleEvent?: (name: string, state: boolean) => void | boolean;
83 beforeFire?: <T>(args: EditorEvent<T>) => void;
84}
85interface EventDispatcherConstructor<T extends {}> {
86 readonly prototype: EventDispatcher<T>;
87 new (settings?: EventDispatcherSettings): EventDispatcher<T>;
88 isNative: (name: string) => boolean;
89}
90declare class EventDispatcher<T extends {}> {
91 static isNative(name: string): boolean;
92 private readonly settings;
93 private readonly scope;
94 private readonly toggleEvent;
95 private bindings;
96 constructor(settings?: EventDispatcherSettings);
97 fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
98 dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
99 on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void | boolean), prepend?: boolean, extra?: {}): this;
100 off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
101 once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
102 has(name: string): boolean;
103}
104type UndoLevelType = 'fragmented' | 'complete';
105interface BaseUndoLevel {
106 type: UndoLevelType;
107 bookmark: Bookmark | null;
108 beforeBookmark: Bookmark | null;
109}
110interface FragmentedUndoLevel extends BaseUndoLevel {
111 type: 'fragmented';
112 fragments: string[];
113 content: '';
114}
115interface CompleteUndoLevel extends BaseUndoLevel {
116 type: 'complete';
117 fragments: null;
118 content: string;
119}
120type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel;
121type UndoLevel = NewUndoLevel & {
122 bookmark: Bookmark;
123};
124interface UndoManager {
125 data: UndoLevel[];
126 typing: boolean;
127 add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null;
128 dispatchChange: () => void;
129 beforeChange: () => void;
130 undo: () => UndoLevel | undefined;
131 redo: () => UndoLevel | undefined;
132 clear: () => void;
133 reset: () => void;
134 hasUndo: () => boolean;
135 hasRedo: () => boolean;
136 transact: (callback: () => void) => UndoLevel | null;
137 ignore: (callback: () => void) => void;
138 extra: (callback1: () => void, callback2: () => void) => void;
139}
140type SchemaType = 'html4' | 'html5' | 'html5-strict';
141interface ElementSettings {
142 block_elements?: string;
143 boolean_attributes?: string;
144 move_caret_before_on_enter_elements?: string;
145 non_empty_elements?: string;
146 self_closing_elements?: string;
147 text_block_elements?: string;
148 text_inline_elements?: string;
149 void_elements?: string;
150 whitespace_elements?: string;
151 transparent_elements?: string;
152 wrap_block_elements?: string;
153}
154interface SchemaSettings extends ElementSettings {
155 custom_elements?: string | Record<string, CustomElementSpec>;
156 extended_valid_elements?: string;
157 invalid_elements?: string;
158 invalid_styles?: string | Record<string, string>;
159 schema?: SchemaType;
160 valid_children?: string;
161 valid_classes?: string | Record<string, string>;
162 valid_elements?: string;
163 valid_styles?: string | Record<string, string>;
164 verify_html?: boolean;
165 padd_empty_block_inline_children?: boolean;
166}
167interface Attribute {
168 required?: boolean;
169 defaultValue?: string;
170 forcedValue?: string;
171 validValues?: Record<string, {}>;
172}
173interface DefaultAttribute {
174 name: string;
175 value: string;
176}
177interface AttributePattern extends Attribute {
178 pattern: RegExp;
179}
180interface ElementRule {
181 attributes: Record<string, Attribute>;
182 attributesDefault?: DefaultAttribute[];
183 attributesForced?: DefaultAttribute[];
184 attributesOrder: string[];
185 attributePatterns?: AttributePattern[];
186 attributesRequired?: string[];
187 paddEmpty?: boolean;
188 removeEmpty?: boolean;
189 removeEmptyAttrs?: boolean;
190 paddInEmptyBlock?: boolean;
191}
192interface SchemaElement extends ElementRule {
193 outputName?: string;
194 parentsRequired?: string[];
195 pattern?: RegExp;
196}
197interface SchemaMap {
198 [name: string]: {};
199}
200interface SchemaRegExpMap {
201 [name: string]: RegExp;
202}
203interface CustomElementSpec {
204 extends?: string;
205 attributes?: string[];
206 children?: string[];
207 padEmpty?: boolean;
208}
209interface Schema {
210 type: SchemaType;
211 children: Record<string, SchemaMap>;
212 elements: Record<string, SchemaElement>;
213 getValidStyles: () => Record<string, string[]> | undefined;
214 getValidClasses: () => Record<string, SchemaMap> | undefined;
215 getBlockElements: () => SchemaMap;
216 getInvalidStyles: () => Record<string, SchemaMap> | undefined;
217 getVoidElements: () => SchemaMap;
218 getTextBlockElements: () => SchemaMap;
219 getTextInlineElements: () => SchemaMap;
220 getBoolAttrs: () => SchemaMap;
221 getElementRule: (name: string) => SchemaElement | undefined;
222 getSelfClosingElements: () => SchemaMap;
223 getNonEmptyElements: () => SchemaMap;
224 getMoveCaretBeforeOnEnterElements: () => SchemaMap;
225 getWhitespaceElements: () => SchemaMap;
226 getTransparentElements: () => SchemaMap;
227 getSpecialElements: () => SchemaRegExpMap;
228 isValidChild: (name: string, child: string) => boolean;
229 isValid: (name: string, attr?: string) => boolean;
230 isBlock: (name: string) => boolean;
231 isInline: (name: string) => boolean;
232 isWrapper: (name: string) => boolean;
233 getCustomElements: () => SchemaMap;
234 addValidElements: (validElements: string) => void;
235 setValidElements: (validElements: string) => void;
236 addCustomElements: (customElements: string | Record<string, CustomElementSpec>) => void;
237 addValidChildren: (validChildren: any) => void;
238}
239type Attributes$1 = Array<{
240 name: string;
241 value: string;
242}> & {
243 map: Record<string, string>;
244};
245interface AstNodeConstructor {
246 readonly prototype: AstNode;
247 new (name: string, type: number): AstNode;
248 create(name: string, attrs?: Record<string, string>): AstNode;
249}
250declare class AstNode {
251 static create(name: string, attrs?: Record<string, string>): AstNode;
252 name: string;
253 type: number;
254 attributes?: Attributes$1;
255 value?: string;
256 parent?: AstNode | null;
257 firstChild?: AstNode | null;
258 lastChild?: AstNode | null;
259 next?: AstNode | null;
260 prev?: AstNode | null;
261 raw?: boolean;
262 constructor(name: string, type: number);
263 replace(node: AstNode): AstNode;
264 attr(name: string, value: string | null | undefined): AstNode | undefined;
265 attr(name: Record<string, string | null | undefined> | undefined): AstNode | undefined;
266 attr(name: string): string | undefined;
267 clone(): AstNode;
268 wrap(wrapper: AstNode): AstNode;
269 unwrap(): void;
270 remove(): AstNode;
271 append(node: AstNode): AstNode;
272 insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode;
273 getAll(name: string): AstNode[];
274 children(): AstNode[];
275 empty(): AstNode;
276 isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
277 walk(prev?: boolean): AstNode | null | undefined;
278}
279type Content = string | AstNode;
280type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
281interface GetContentArgs {
282 format: ContentFormat;
283 get: boolean;
284 getInner: boolean;
285 no_events?: boolean;
286 save?: boolean;
287 source_view?: boolean;
288 [key: string]: any;
289}
290interface SetContentArgs {
291 format: string;
292 set: boolean;
293 content: Content;
294 no_events?: boolean;
295 no_selection?: boolean;
296 paste?: boolean;
297 load?: boolean;
298 initial?: boolean;
299 [key: string]: any;
300}
301interface GetSelectionContentArgs extends GetContentArgs {
302 selection?: boolean;
303 contextual?: boolean;
304}
305interface SetSelectionContentArgs extends SetContentArgs {
306 content: string;
307 selection?: boolean;
308}
309interface BlobInfoData {
310 id?: string;
311 name?: string;
312 filename?: string;
313 blob: Blob;
314 base64: string;
315 blobUri?: string;
316 uri?: string;
317}
318interface BlobInfo {
319 id: () => string;
320 name: () => string;
321 filename: () => string;
322 blob: () => Blob;
323 base64: () => string;
324 blobUri: () => string;
325 uri: () => string | undefined;
326}
327interface BlobCache {
328 create: {
329 (o: BlobInfoData): BlobInfo;
330 (id: string, blob: Blob, base64: string, name?: string, filename?: string): BlobInfo;
331 };
332 add: (blobInfo: BlobInfo) => void;
333 get: (id: string) => BlobInfo | undefined;
334 getByUri: (blobUri: string) => BlobInfo | undefined;
335 getByData: (base64: string, type: string) => BlobInfo | undefined;
336 findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined;
337 removeByUri: (blobUri: string) => void;
338 destroy: () => void;
339}
340interface BlobInfoImagePair {
341 image: HTMLImageElement;
342 blobInfo: BlobInfo;
343}
344declare class NodeChange {
345 private readonly editor;
346 private lastPath;
347 constructor(editor: Editor);
348 nodeChanged(args?: Record<string, any>): void;
349 private isSameElementPath;
350}
351interface SelectionOverrides {
352 showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null;
353 showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void;
354 hideFakeCaret: () => void;
355 destroy: () => void;
356}
357interface Quirks {
358 refreshContentEditable(): void;
359 isHidden(): boolean;
360}
361type DecoratorData = Record<string, any>;
362type Decorator = (uid: string, data: DecoratorData) => {
363 attributes?: {};
364 classes?: string[];
365};
366type AnnotationListener = (state: boolean, name: string, data?: {
367 uid: string;
368 nodes: any[];
369}) => void;
370type AnnotationListenerApi = AnnotationListener;
371interface AnnotatorSettings {
372 decorate: Decorator;
373 persistent?: boolean;
374}
375interface Annotator {
376 register: (name: string, settings: AnnotatorSettings) => void;
377 annotate: (name: string, data: DecoratorData) => void;
378 annotationChanged: (name: string, f: AnnotationListenerApi) => void;
379 remove: (name: string) => void;
380 removeAll: (name: string) => void;
381 getAll: (name: string) => Record<string, Element[]>;
382}
383interface IsEmptyOptions {
384 readonly skipBogus?: boolean;
385 readonly includeZwsp?: boolean;
386 readonly checkRootAsContent?: boolean;
387 readonly isContent?: (node: Node) => boolean;
388}
389interface GeomRect {
390 readonly x: number;
391 readonly y: number;
392 readonly w: number;
393 readonly h: number;
394}
395interface Rect {
396 inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
397 relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
398 findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
399 intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
400 clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
401 create: (x: number, y: number, w: number, h: number) => GeomRect;
402 fromClientRect: (clientRect: DOMRect) => GeomRect;
403}
404interface NotificationManagerImpl {
405 open: (spec: NotificationSpec, closeCallback: () => void, hasEditorFocus: () => boolean) => NotificationApi;
406 close: <T extends NotificationApi>(notification: T) => void;
407 getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
408}
409interface NotificationSpec {
410 type?: 'info' | 'warning' | 'error' | 'success';
411 text: string;
412 icon?: string;
413 progressBar?: boolean;
414 timeout?: number;
415}
416interface NotificationApi {
417 close: () => void;
418 progressBar: {
419 value: (percent: number) => void;
420 };
421 text: (text: string) => void;
422 reposition: () => void;
423 getEl: () => HTMLElement;
424 settings: NotificationSpec;
425}
426interface NotificationManager {
427 open: (spec: NotificationSpec) => NotificationApi;
428 close: () => void;
429 getNotifications: () => NotificationApi[];
430}
431interface UploadFailure {
432 message: string;
433 remove?: boolean;
434}
435type ProgressFn = (percent: number) => void;
436type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
437interface UploadResult$2 {
438 url: string;
439 blobInfo: BlobInfo;
440 status: boolean;
441 error?: UploadFailure;
442}
443type BlockPatternTrigger = 'enter' | 'space';
444interface RawPattern {
445 start?: any;
446 end?: any;
447 format?: any;
448 cmd?: any;
449 value?: any;
450 replacement?: any;
451 trigger?: BlockPatternTrigger;
452}
453interface InlineBasePattern {
454 readonly start: string;
455 readonly end: string;
456}
457interface InlineFormatPattern extends InlineBasePattern {
458 readonly type: 'inline-format';
459 readonly format: string[];
460}
461interface InlineCmdPattern extends InlineBasePattern {
462 readonly type: 'inline-command';
463 readonly cmd: string;
464 readonly value?: any;
465}
466type InlinePattern = InlineFormatPattern | InlineCmdPattern;
467interface BlockBasePattern {
468 readonly start: string;
469 readonly trigger: BlockPatternTrigger;
470}
471interface BlockFormatPattern extends BlockBasePattern {
472 readonly type: 'block-format';
473 readonly format: string;
474}
475interface BlockCmdPattern extends BlockBasePattern {
476 readonly type: 'block-command';
477 readonly cmd: string;
478 readonly value?: any;
479}
480type BlockPattern = BlockFormatPattern | BlockCmdPattern;
481type Pattern = InlinePattern | BlockPattern;
482interface DynamicPatternContext {
483 readonly text: string;
484 readonly block: Element;
485}
486type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[];
487type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[];
488interface AlertBannerSpec {
489 type: 'alertbanner';
490 level: 'info' | 'warn' | 'error' | 'success';
491 text: string;
492 icon: string;
493 url?: string;
494}
495interface ButtonSpec {
496 type: 'button';
497 text: string;
498 enabled?: boolean;
499 primary?: boolean;
500 name?: string;
501 icon?: string;
502 borderless?: boolean;
503 buttonType?: 'primary' | 'secondary' | 'toolbar';
504 context?: string;
505}
506interface FormComponentSpec {
507 type: string;
508 name: string;
509}
510interface FormComponentWithLabelSpec extends FormComponentSpec {
511 label?: string;
512}
513interface CheckboxSpec extends FormComponentSpec {
514 type: 'checkbox';
515 label: string;
516 enabled?: boolean;
517 context?: string;
518}
519interface CollectionSpec extends FormComponentWithLabelSpec {
520 type: 'collection';
521 context?: string;
522}
523interface CollectionItem {
524 value: string;
525 text: string;
526 icon: string;
527}
528interface ColorInputSpec extends FormComponentWithLabelSpec {
529 type: 'colorinput';
530 storageKey?: string;
531 context?: string;
532}
533interface ColorPickerSpec extends FormComponentWithLabelSpec {
534 type: 'colorpicker';
535}
536interface CustomEditorInit {
537 setValue: (value: string) => void;
538 getValue: () => string;
539 destroy: () => void;
540}
541type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>;
542interface CustomEditorOldSpec extends FormComponentSpec {
543 type: 'customeditor';
544 tag?: string;
545 init: (e: HTMLElement) => Promise<CustomEditorInit>;
546}
547interface CustomEditorNewSpec extends FormComponentSpec {
548 type: 'customeditor';
549 tag?: string;
550 scriptId: string;
551 scriptUrl: string;
552 onFocus?: (e: HTMLElement) => void;
553 settings?: any;
554}
555type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec;
556interface DropZoneSpec extends FormComponentWithLabelSpec {
557 type: 'dropzone';
558 context?: string;
559}
560interface GridSpec {
561 type: 'grid';
562 columns: number;
563 items: BodyComponentSpec[];
564}
565interface HtmlPanelSpec {
566 type: 'htmlpanel';
567 html: string;
568 onInit?: (el: HTMLElement) => void;
569 presets?: 'presentation' | 'document';
570 stretched?: boolean;
571}
572interface IframeSpec extends FormComponentWithLabelSpec {
573 type: 'iframe';
574 border?: boolean;
575 sandboxed?: boolean;
576 streamContent?: boolean;
577 transparent?: boolean;
578}
579interface ImagePreviewSpec extends FormComponentSpec {
580 type: 'imagepreview';
581 height?: string;
582}
583interface InputSpec extends FormComponentWithLabelSpec {
584 type: 'input';
585 inputMode?: string;
586 placeholder?: string;
587 maximized?: boolean;
588 enabled?: boolean;
589 context?: string;
590}
591type Alignment = 'start' | 'center' | 'end';
592interface LabelSpec {
593 type: 'label';
594 label: string;
595 items: BodyComponentSpec[];
596 align?: Alignment;
597 for?: string;
598}
599interface ListBoxSingleItemSpec {
600 text: string;
601 value: string;
602}
603interface ListBoxNestedItemSpec {
604 text: string;
605 items: ListBoxItemSpec[];
606}
607type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec;
608interface ListBoxSpec extends FormComponentWithLabelSpec {
609 type: 'listbox';
610 items: ListBoxItemSpec[];
611 disabled?: boolean;
612 context?: string;
613}
614interface PanelSpec {
615 type: 'panel';
616 classes?: string[];
617 items: BodyComponentSpec[];
618}
619interface SelectBoxItemSpec {
620 text: string;
621 value: string;
622}
623interface SelectBoxSpec extends FormComponentWithLabelSpec {
624 type: 'selectbox';
625 items: SelectBoxItemSpec[];
626 size?: number;
627 enabled?: boolean;
628 context?: string;
629}
630interface SizeInputSpec extends FormComponentWithLabelSpec {
631 type: 'sizeinput';
632 constrain?: boolean;
633 enabled?: boolean;
634 context?: string;
635}
636interface SliderSpec extends FormComponentSpec {
637 type: 'slider';
638 label: string;
639 min?: number;
640 max?: number;
641}
642interface TableSpec {
643 type: 'table';
644 header: string[];
645 cells: string[][];
646}
647interface TextAreaSpec extends FormComponentWithLabelSpec {
648 type: 'textarea';
649 placeholder?: string;
650 maximized?: boolean;
651 enabled?: boolean;
652 context?: string;
653}
654interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
655 enabled?: boolean;
656 tooltip?: string;
657 icon?: string;
658 text?: string;
659 onSetup?: (api: I) => (api: I) => void;
660 context?: string;
661}
662interface BaseToolbarButtonInstanceApi {
663 isEnabled: () => boolean;
664 setEnabled: (state: boolean) => void;
665 setText: (text: string) => void;
666 setIcon: (icon: string) => void;
667}
668interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
669 type?: 'button';
670 onAction: (api: ToolbarButtonInstanceApi) => void;
671 shortcut?: string;
672}
673interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
674}
675interface ToolbarGroupSetting {
676 name: string;
677 items: string[];
678}
679type ToolbarConfig = string | ToolbarGroupSetting[];
680interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
681}
682interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> {
683 type?: 'grouptoolbarbutton';
684 items?: ToolbarConfig;
685}
686interface CardImageSpec {
687 type: 'cardimage';
688 src: string;
689 alt?: string;
690 classes?: string[];
691}
692interface CardTextSpec {
693 type: 'cardtext';
694 text: string;
695 name?: string;
696 classes?: string[];
697}
698type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec;
699type CardContainerDirection = 'vertical' | 'horizontal';
700type CardContainerAlign = 'left' | 'right';
701type CardContainerValign = 'top' | 'middle' | 'bottom';
702interface CardContainerSpec {
703 type: 'cardcontainer';
704 items: CardItemSpec[];
705 direction?: CardContainerDirection;
706 align?: CardContainerAlign;
707 valign?: CardContainerValign;
708}
709interface CommonMenuItemSpec {
710 enabled?: boolean;
711 text?: string;
712 value?: string;
713 meta?: Record<string, any>;
714 shortcut?: string;
715 context?: string;
716}
717interface CommonMenuItemInstanceApi {
718 isEnabled: () => boolean;
719 setEnabled: (state: boolean) => void;
720}
721interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi {
722}
723interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> {
724 type: 'cardmenuitem';
725 label?: string;
726 items: CardItemSpec[];
727 onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void;
728 onAction?: (api: CardMenuItemInstanceApi) => void;
729}
730interface ChoiceMenuItemSpec extends CommonMenuItemSpec {
731 type?: 'choiceitem';
732 icon?: string;
733}
734interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi {
735 isActive: () => boolean;
736 setActive: (state: boolean) => void;
737}
738interface ContextMenuItem extends CommonMenuItemSpec {
739 text: string;
740 icon?: string;
741 type?: 'item';
742 onAction: () => void;
743}
744interface ContextSubMenu extends CommonMenuItemSpec {
745 type: 'submenu';
746 text: string;
747 icon?: string;
748 getSubmenuItems: () => string | Array<ContextMenuContents>;
749}
750type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu;
751interface ContextMenuApi {
752 update: (element: Element) => string | Array<ContextMenuContents>;
753}
754interface FancyActionArgsMap {
755 'inserttable': {
756 numRows: number;
757 numColumns: number;
758 };
759 'colorswatch': {
760 value: string;
761 };
762}
763interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> {
764 type: 'fancymenuitem';
765 fancytype: T;
766 initData?: Record<string, unknown>;
767 onAction?: (data: FancyActionArgsMap[T]) => void;
768}
769interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> {
770 fancytype: 'inserttable';
771 initData?: {};
772}
773interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
774 fancytype: 'colorswatch';
775 select?: (value: string) => boolean;
776 initData?: {
777 allowCustomColors?: boolean;
778 colors?: ChoiceMenuItemSpec[];
779 storageKey?: string;
780 };
781}
782type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
783interface MenuItemSpec extends CommonMenuItemSpec {
784 type?: 'menuitem';
785 icon?: string;
786 onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void;
787 onAction?: (api: MenuItemInstanceApi) => void;
788}
789interface MenuItemInstanceApi extends CommonMenuItemInstanceApi {
790}
791interface SeparatorMenuItemSpec {
792 type?: 'separator';
793 text?: string;
794}
795interface ToggleMenuItemSpec extends CommonMenuItemSpec {
796 type?: 'togglemenuitem';
797 icon?: string;
798 active?: boolean;
799 onSetup?: (api: ToggleMenuItemInstanceApi) => void;
800 onAction: (api: ToggleMenuItemInstanceApi) => void;
801}
802interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi {
803 isActive: () => boolean;
804 setActive: (state: boolean) => void;
805}
806type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec;
807interface NestedMenuItemSpec extends CommonMenuItemSpec {
808 type?: 'nestedmenuitem';
809 icon?: string;
810 getSubmenuItems: () => string | Array<NestedMenuItemContents>;
811 onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void;
812}
813interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi {
814 setTooltip: (tooltip: string) => void;
815 setIconFill: (id: string, value: string) => void;
816}
817type MenuButtonItemTypes = NestedMenuItemContents;
818type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
819interface MenuButtonFetchContext {
820 pattern: string;
821}
822interface BaseMenuButtonSpec {
823 text?: string;
824 tooltip?: string;
825 icon?: string;
826 search?: boolean | {
827 placeholder?: string;
828 };
829 fetch: (success: SuccessCallback$1, fetchContext: MenuButtonFetchContext, api: BaseMenuButtonInstanceApi) => void;
830 onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
831 context?: string;
832}
833interface BaseMenuButtonInstanceApi {
834 isEnabled: () => boolean;
835 setEnabled: (state: boolean) => void;
836 isActive: () => boolean;
837 setActive: (state: boolean) => void;
838 setText: (text: string) => void;
839 setIcon: (icon: string) => void;
840}
841interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec {
842 type?: 'menubutton';
843 onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void;
844}
845interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi {
846}
847type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec;
848type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void;
849type SelectPredicate = (value: string) => boolean;
850type PresetTypes = 'color' | 'normal' | 'listpreview';
851type ColumnTypes$1 = number | 'auto';
852interface ToolbarSplitButtonSpec {
853 type?: 'splitbutton';
854 tooltip?: string;
855 icon?: string;
856 text?: string;
857 select?: SelectPredicate;
858 presets?: PresetTypes;
859 columns?: ColumnTypes$1;
860 fetch: (success: SuccessCallback) => void;
861 onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void;
862 onAction: (api: ToolbarSplitButtonInstanceApi) => void;
863 onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
864 context?: string;
865}
866interface ToolbarSplitButtonInstanceApi {
867 isEnabled: () => boolean;
868 setEnabled: (state: boolean) => void;
869 setIconFill: (id: string, value: string) => void;
870 isActive: () => boolean;
871 setActive: (state: boolean) => void;
872 setTooltip: (tooltip: string) => void;
873 setText: (text: string) => void;
874 setIcon: (icon: string) => void;
875}
876interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> {
877 active?: boolean;
878}
879interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi {
880 isActive: () => boolean;
881 setActive: (state: boolean) => void;
882}
883interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> {
884 type?: 'togglebutton';
885 onAction: (api: ToolbarToggleButtonInstanceApi) => void;
886 shortcut?: string;
887}
888interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
889}
890type Id = string;
891interface TreeSpec {
892 type: 'tree';
893 items: TreeItemSpec[];
894 onLeafAction?: (id: Id) => void;
895 defaultExpandedIds?: Id[];
896 onToggleExpand?: (expandedIds: Id[], { expanded, node }: {
897 expanded: boolean;
898 node: Id;
899 }) => void;
900 defaultSelectedId?: Id;
901}
902interface BaseTreeItemSpec {
903 title: string;
904 id: Id;
905 menu?: ToolbarMenuButtonSpec;
906 customStateIcon?: string;
907 customStateIconTooltip?: string;
908}
909interface DirectorySpec extends BaseTreeItemSpec {
910 type: 'directory';
911 children: TreeItemSpec[];
912}
913interface LeafSpec extends BaseTreeItemSpec {
914 type: 'leaf';
915}
916type TreeItemSpec = DirectorySpec | LeafSpec;
917interface UrlInputSpec extends FormComponentWithLabelSpec {
918 type: 'urlinput';
919 filetype?: 'image' | 'media' | 'file';
920 enabled?: boolean;
921 picker_text?: string;
922 context?: string;
923}
924interface UrlInputData {
925 value: string;
926 meta: {
927 text?: string;
928 };
929}
930type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | TreeSpec | PanelSpec | CustomEditorSpec;
931interface BarSpec {
932 type: 'bar';
933 items: BodyComponentSpec[];
934}
935interface DialogToggleMenuItemSpec extends CommonMenuItemSpec {
936 type?: 'togglemenuitem';
937 name: string;
938}
939type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec;
940interface BaseDialogFooterButtonSpec {
941 name?: string;
942 align?: 'start' | 'end';
943 primary?: boolean;
944 enabled?: boolean;
945 icon?: string;
946 buttonType?: 'primary' | 'secondary';
947 context?: string;
948}
949interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec {
950 type: 'submit' | 'cancel' | 'custom';
951 text: string;
952}
953interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec {
954 type: 'menu';
955 text?: string;
956 tooltip?: string;
957 icon?: string;
958 items: DialogFooterMenuButtonItemSpec[];
959}
960interface DialogFooterToggleButtonSpec extends BaseDialogFooterButtonSpec {
961 type: 'togglebutton';
962 tooltip?: string;
963 icon?: string;
964 text?: string;
965 active?: boolean;
966}
967type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec | DialogFooterToggleButtonSpec;
968interface TabSpec {
969 name?: string;
970 title: string;
971 items: BodyComponentSpec[];
972}
973interface TabPanelSpec {
974 type: 'tabpanel';
975 tabs: TabSpec[];
976}
977type DialogDataItem = any;
978type DialogData = Record<string, DialogDataItem>;
979interface DialogInstanceApi<T extends DialogData> {
980 getData: () => T;
981 setData: (data: Partial<T>) => void;
982 setEnabled: (name: string, state: boolean) => void;
983 focus: (name: string) => void;
984 showTab: (name: string) => void;
985 redial: (nu: DialogSpec<T>) => void;
986 block: (msg: string) => void;
987 unblock: () => void;
988 toggleFullscreen: () => void;
989 close: () => void;
990}
991interface DialogActionDetails {
992 name: string;
993 value?: any;
994}
995interface DialogChangeDetails<T> {
996 name: keyof T;
997}
998interface DialogTabChangeDetails {
999 newTabName: string;
1000 oldTabName: string;
1001}
1002type DialogActionHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
1003type DialogChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
1004type DialogSubmitHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
1005type DialogCloseHandler = () => void;
1006type DialogCancelHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
1007type DialogTabChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
1008type DialogSize = 'normal' | 'medium' | 'large';
1009interface DialogSpec<T extends DialogData> {
1010 title: string;
1011 size?: DialogSize;
1012 body: TabPanelSpec | PanelSpec;
1013 buttons?: DialogFooterButtonSpec[];
1014 initialData?: Partial<T>;
1015 onAction?: DialogActionHandler<T>;
1016 onChange?: DialogChangeHandler<T>;
1017 onSubmit?: DialogSubmitHandler<T>;
1018 onClose?: DialogCloseHandler;
1019 onCancel?: DialogCancelHandler<T>;
1020 onTabChange?: DialogTabChangeHandler<T>;
1021}
1022interface UrlDialogInstanceApi {
1023 block: (msg: string) => void;
1024 unblock: () => void;
1025 close: () => void;
1026 sendMessage: (msg: any) => void;
1027}
1028interface UrlDialogActionDetails {
1029 name: string;
1030 value?: any;
1031}
1032interface UrlDialogMessage {
1033 mceAction: string;
1034 [key: string]: any;
1035}
1036type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void;
1037type UrlDialogCloseHandler = () => void;
1038type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void;
1039type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void;
1040interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec {
1041 type: 'cancel' | 'custom';
1042}
1043interface UrlDialogSpec {
1044 title: string;
1045 url: string;
1046 height?: number;
1047 width?: number;
1048 buttons?: UrlDialogFooterButtonSpec[];
1049 onAction?: UrlDialogActionHandler;
1050 onClose?: UrlDialogCloseHandler;
1051 onCancel?: UrlDialogCancelHandler;
1052 onMessage?: UrlDialogMessageHandler;
1053}
1054type ColumnTypes = number | 'auto';
1055type SeparatorItemSpec = SeparatorMenuItemSpec;
1056interface AutocompleterItemSpec {
1057 type?: 'autocompleteitem';
1058 value: string;
1059 text?: string;
1060 icon?: string;
1061 meta?: Record<string, any>;
1062}
1063type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
1064interface AutocompleterSpec {
1065 type?: 'autocompleter';
1066 trigger: string;
1067 minChars?: number;
1068 columns?: ColumnTypes;
1069 matches?: (rng: Range, text: string, pattern: string) => boolean;
1070 fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>;
1071 onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
1072 maxResults?: number;
1073 highlightOn?: string[];
1074}
1075interface AutocompleterInstanceApi {
1076 hide: () => void;
1077 reload: (fetchOptions: Record<string, any>) => void;
1078}
1079type ContextPosition = 'node' | 'selection' | 'line';
1080type ContextScope = 'node' | 'editor';
1081interface ContextBarSpec {
1082 predicate?: (elem: Element) => boolean;
1083 position?: ContextPosition;
1084 scope?: ContextScope;
1085}
1086interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> {
1087 type: 'contextformbutton';
1088}
1089interface ContextFormLaunchToggleButtonSpec extends BaseToolbarToggleButtonSpec<BaseToolbarToggleButtonInstanceApi> {
1090 type: 'contextformtogglebutton';
1091}
1092interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi {
1093}
1094interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
1095}
1096interface ContextFormButtonSpec<T> extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> {
1097 type?: 'contextformbutton';
1098 primary?: boolean;
1099 align?: 'start' | 'end';
1100 onAction: (formApi: ContextFormInstanceApi<T>, api: ContextFormButtonInstanceApi) => void;
1101}
1102interface ContextFormToggleButtonSpec<T> extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> {
1103 type?: 'contextformtogglebutton';
1104 primary?: boolean;
1105 align?: 'start' | 'end';
1106 onAction: (formApi: ContextFormInstanceApi<T>, buttonApi: ContextFormToggleButtonInstanceApi) => void;
1107}
1108interface ContextFormInstanceApi<T> {
1109 setInputEnabled: (state: boolean) => void;
1110 isInputEnabled: () => boolean;
1111 hide: () => void;
1112 back: () => void;
1113 getValue: () => T;
1114 setValue: (value: T) => void;
1115}
1116interface SizeData {
1117 width: string;
1118 height: string;
1119}
1120interface BaseContextFormSpec<T> extends ContextBarSpec {
1121 initValue?: () => T;
1122 label?: string;
1123 launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec;
1124 commands: Array<ContextFormToggleButtonSpec<T> | ContextFormButtonSpec<T>>;
1125 onInput?: (api: ContextFormInstanceApi<T>) => void;
1126 onSetup?: (api: ContextFormInstanceApi<T>) => (api: ContextFormInstanceApi<T>) => void;
1127}
1128interface ContextInputFormSpec extends BaseContextFormSpec<string> {
1129 type?: 'contextform';
1130 placeholder?: string;
1131}
1132interface ContextSliderFormSpec extends BaseContextFormSpec<number> {
1133 type: 'contextsliderform';
1134 min?: () => number;
1135 max?: () => number;
1136}
1137interface ContextSizeInputFormSpec extends BaseContextFormSpec<SizeData> {
1138 type: 'contextsizeinputform';
1139}
1140type ContextFormSpec = ContextInputFormSpec | ContextSliderFormSpec | ContextSizeInputFormSpec;
1141interface ToolbarGroupSpec {
1142 name?: string;
1143 label?: string;
1144 items: string[];
1145}
1146interface ContextToolbarSpec extends ContextBarSpec {
1147 type?: 'contexttoolbar';
1148 items: string | ToolbarGroupSpec[];
1149}
1150type PublicDialog_d_AlertBannerSpec = AlertBannerSpec;
1151type PublicDialog_d_BarSpec = BarSpec;
1152type PublicDialog_d_BodyComponentSpec = BodyComponentSpec;
1153type PublicDialog_d_ButtonSpec = ButtonSpec;
1154type PublicDialog_d_CheckboxSpec = CheckboxSpec;
1155type PublicDialog_d_CollectionItem = CollectionItem;
1156type PublicDialog_d_CollectionSpec = CollectionSpec;
1157type PublicDialog_d_ColorInputSpec = ColorInputSpec;
1158type PublicDialog_d_ColorPickerSpec = ColorPickerSpec;
1159type PublicDialog_d_CustomEditorSpec = CustomEditorSpec;
1160type PublicDialog_d_CustomEditorInit = CustomEditorInit;
1161type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn;
1162type PublicDialog_d_DialogData = DialogData;
1163type PublicDialog_d_DialogSize = DialogSize;
1164type PublicDialog_d_DialogSpec<T extends DialogData> = DialogSpec<T>;
1165type PublicDialog_d_DialogInstanceApi<T extends DialogData> = DialogInstanceApi<T>;
1166type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec;
1167type PublicDialog_d_DialogActionDetails = DialogActionDetails;
1168type PublicDialog_d_DialogChangeDetails<T> = DialogChangeDetails<T>;
1169type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails;
1170type PublicDialog_d_DropZoneSpec = DropZoneSpec;
1171type PublicDialog_d_GridSpec = GridSpec;
1172type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec;
1173type PublicDialog_d_IframeSpec = IframeSpec;
1174type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec;
1175type PublicDialog_d_InputSpec = InputSpec;
1176type PublicDialog_d_LabelSpec = LabelSpec;
1177type PublicDialog_d_ListBoxSpec = ListBoxSpec;
1178type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec;
1179type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec;
1180type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec;
1181type PublicDialog_d_PanelSpec = PanelSpec;
1182type PublicDialog_d_SelectBoxSpec = SelectBoxSpec;
1183type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec;
1184type PublicDialog_d_SizeInputSpec = SizeInputSpec;
1185type PublicDialog_d_SliderSpec = SliderSpec;
1186type PublicDialog_d_TableSpec = TableSpec;
1187type PublicDialog_d_TabSpec = TabSpec;
1188type PublicDialog_d_TabPanelSpec = TabPanelSpec;
1189type PublicDialog_d_TextAreaSpec = TextAreaSpec;
1190type PublicDialog_d_TreeSpec = TreeSpec;
1191type PublicDialog_d_TreeItemSpec = TreeItemSpec;
1192type PublicDialog_d_UrlInputData = UrlInputData;
1193type PublicDialog_d_UrlInputSpec = UrlInputSpec;
1194type PublicDialog_d_UrlDialogSpec = UrlDialogSpec;
1195type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec;
1196type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi;
1197type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails;
1198type PublicDialog_d_UrlDialogMessage = UrlDialogMessage;
1199declare namespace PublicDialog_d {
1200 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_TreeSpec as TreeSpec, PublicDialog_d_TreeItemSpec as TreeItemSpec, DirectorySpec as TreeDirectorySpec, LeafSpec as TreeLeafSpec, 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, };
1201}
1202type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec;
1203type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec;
1204type PublicInlineContent_d_AutocompleterContents = AutocompleterContents;
1205type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi;
1206type PublicInlineContent_d_ContextPosition = ContextPosition;
1207type PublicInlineContent_d_ContextScope = ContextScope;
1208type PublicInlineContent_d_ContextFormSpec = ContextFormSpec;
1209type PublicInlineContent_d_ContextFormInstanceApi<T> = ContextFormInstanceApi<T>;
1210type PublicInlineContent_d_ContextFormButtonSpec<T> = ContextFormButtonSpec<T>;
1211type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi;
1212type PublicInlineContent_d_ContextFormToggleButtonSpec<T> = ContextFormToggleButtonSpec<T>;
1213type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi;
1214type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec;
1215type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec;
1216declare namespace PublicInlineContent_d {
1217 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, };
1218}
1219type PublicMenu_d_MenuItemSpec = MenuItemSpec;
1220type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi;
1221type PublicMenu_d_NestedMenuItemContents = NestedMenuItemContents;
1222type PublicMenu_d_NestedMenuItemSpec = NestedMenuItemSpec;
1223type PublicMenu_d_NestedMenuItemInstanceApi = NestedMenuItemInstanceApi;
1224type PublicMenu_d_FancyMenuItemSpec = FancyMenuItemSpec;
1225type PublicMenu_d_ColorSwatchMenuItemSpec = ColorSwatchMenuItemSpec;
1226type PublicMenu_d_InsertTableMenuItemSpec = InsertTableMenuItemSpec;
1227type PublicMenu_d_ToggleMenuItemSpec = ToggleMenuItemSpec;
1228type PublicMenu_d_ToggleMenuItemInstanceApi = ToggleMenuItemInstanceApi;
1229type PublicMenu_d_ChoiceMenuItemSpec = ChoiceMenuItemSpec;
1230type PublicMenu_d_ChoiceMenuItemInstanceApi = ChoiceMenuItemInstanceApi;
1231type PublicMenu_d_SeparatorMenuItemSpec = SeparatorMenuItemSpec;
1232type PublicMenu_d_ContextMenuApi = ContextMenuApi;
1233type PublicMenu_d_ContextMenuContents = ContextMenuContents;
1234type PublicMenu_d_ContextMenuItem = ContextMenuItem;
1235type PublicMenu_d_ContextSubMenu = ContextSubMenu;
1236type PublicMenu_d_CardMenuItemSpec = CardMenuItemSpec;
1237type PublicMenu_d_CardMenuItemInstanceApi = CardMenuItemInstanceApi;
1238type PublicMenu_d_CardItemSpec = CardItemSpec;
1239type PublicMenu_d_CardContainerSpec = CardContainerSpec;
1240type PublicMenu_d_CardImageSpec = CardImageSpec;
1241type PublicMenu_d_CardTextSpec = CardTextSpec;
1242declare namespace PublicMenu_d {
1243 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, };
1244}
1245interface SidebarInstanceApi {
1246 element: () => HTMLElement;
1247}
1248interface SidebarSpec {
1249 icon?: string;
1250 tooltip?: string;
1251 onShow?: (api: SidebarInstanceApi) => void;
1252 onSetup?: (api: SidebarInstanceApi) => (api: SidebarInstanceApi) => void;
1253 onHide?: (api: SidebarInstanceApi) => void;
1254}
1255type PublicSidebar_d_SidebarSpec = SidebarSpec;
1256type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi;
1257declare namespace PublicSidebar_d {
1258 export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, };
1259}
1260type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec;
1261type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi;
1262type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec;
1263type PublicToolbar_d_ToolbarSplitButtonInstanceApi = ToolbarSplitButtonInstanceApi;
1264type PublicToolbar_d_ToolbarMenuButtonSpec = ToolbarMenuButtonSpec;
1265type PublicToolbar_d_ToolbarMenuButtonInstanceApi = ToolbarMenuButtonInstanceApi;
1266type PublicToolbar_d_ToolbarToggleButtonSpec = ToolbarToggleButtonSpec;
1267type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanceApi;
1268type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec;
1269type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi;
1270declare namespace PublicToolbar_d {
1271 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, };
1272}
1273interface ViewButtonApi {
1274 setIcon: (newIcon: string) => void;
1275}
1276interface ViewToggleButtonApi extends ViewButtonApi {
1277 isActive: () => boolean;
1278 setActive: (state: boolean) => void;
1279 focus: () => void;
1280}
1281interface BaseButtonSpec<Api extends ViewButtonApi> {
1282 text?: string;
1283 icon?: string;
1284 tooltip?: string;
1285 buttonType?: 'primary' | 'secondary';
1286 borderless?: boolean;
1287 onAction: (api: Api) => void;
1288 context?: string;
1289}
1290interface ViewNormalButtonSpec extends BaseButtonSpec<ViewButtonApi> {
1291 text: string;
1292 type: 'button';
1293}
1294interface ViewToggleButtonSpec extends BaseButtonSpec<ViewToggleButtonApi> {
1295 type: 'togglebutton';
1296 active?: boolean;
1297 onAction: (api: ViewToggleButtonApi) => void;
1298}
1299interface ViewButtonsGroupSpec {
1300 type: 'group';
1301 buttons: Array<ViewNormalButtonSpec | ViewToggleButtonSpec>;
1302}
1303type ViewButtonSpec = ViewNormalButtonSpec | ViewToggleButtonSpec | ViewButtonsGroupSpec;
1304interface ViewInstanceApi {
1305 getContainer: () => HTMLElement;
1306}
1307interface ViewSpec {
1308 buttons?: ViewButtonSpec[];
1309 onShow: (api: ViewInstanceApi) => void;
1310 onHide: (api: ViewInstanceApi) => void;
1311}
1312type PublicView_d_ViewSpec = ViewSpec;
1313type PublicView_d_ViewInstanceApi = ViewInstanceApi;
1314declare namespace PublicView_d {
1315 export { PublicView_d_ViewSpec as ViewSpec, PublicView_d_ViewInstanceApi as ViewInstanceApi, };
1316}
1317interface Registry$1 {
1318 addButton: (name: string, spec: ToolbarButtonSpec) => void;
1319 addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void;
1320 addToggleButton: (name: string, spec: ToolbarToggleButtonSpec) => void;
1321 addMenuButton: (name: string, spec: ToolbarMenuButtonSpec) => void;
1322 addSplitButton: (name: string, spec: ToolbarSplitButtonSpec) => void;
1323 addMenuItem: (name: string, spec: MenuItemSpec) => void;
1324 addNestedMenuItem: (name: string, spec: NestedMenuItemSpec) => void;
1325 addToggleMenuItem: (name: string, spec: ToggleMenuItemSpec) => void;
1326 addContextMenu: (name: string, spec: ContextMenuApi) => void;
1327 addContextToolbar: (name: string, spec: ContextToolbarSpec) => void;
1328 addContextForm: (name: string, spec: ContextFormSpec) => void;
1329 addIcon: (name: string, svgData: string) => void;
1330 addAutocompleter: (name: string, spec: AutocompleterSpec) => void;
1331 addSidebar: (name: string, spec: SidebarSpec) => void;
1332 addView: (name: string, spec: ViewSpec) => void;
1333 addContext: (name: string, pred: (args: string) => boolean) => void;
1334 getAll: () => {
1335 buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>;
1336 menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>;
1337 popups: Record<string, AutocompleterSpec>;
1338 contextMenus: Record<string, ContextMenuApi>;
1339 contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>;
1340 icons: Record<string, string>;
1341 sidebars: Record<string, SidebarSpec>;
1342 views: Record<string, ViewSpec>;
1343 contexts: Record<string, (args: string) => boolean>;
1344 };
1345}
1346interface AutocompleteLookupData {
1347 readonly matchText: string;
1348 readonly items: AutocompleterContents[];
1349 readonly columns: ColumnTypes;
1350 readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
1351 readonly highlightOn: string[];
1352}
1353interface AutocompleterEventArgs {
1354 readonly lookupData: AutocompleteLookupData[];
1355}
1356interface RangeLikeObject {
1357 startContainer: Node;
1358 startOffset: number;
1359 endContainer: Node;
1360 endOffset: number;
1361}
1362type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
1363type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
1364type Format = ApplyFormat | RemoveFormat;
1365type Formats = Record<string, Format | Format[]>;
1366type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string | null);
1367type FormatVars = Record<string, string | null>;
1368interface BaseFormat<T> {
1369 ceFalseOverride?: boolean;
1370 classes?: string | string[];
1371 collapsed?: boolean;
1372 exact?: boolean;
1373 expand?: boolean;
1374 links?: boolean;
1375 mixed?: boolean;
1376 block_expand?: boolean;
1377 onmatch?: (node: Element, fmt: T, itemName: string) => boolean;
1378 remove?: 'none' | 'empty' | 'all';
1379 remove_similar?: boolean;
1380 split?: boolean;
1381 deep?: boolean;
1382 preserve_attributes?: string[];
1383}
1384interface Block {
1385 block: string;
1386 list_block?: string;
1387 wrapper?: boolean;
1388}
1389interface Inline {
1390 inline: string;
1391}
1392interface Selector {
1393 selector: string;
1394 inherit?: boolean;
1395}
1396interface CommonFormat<T> extends BaseFormat<T> {
1397 attributes?: Record<string, FormatAttrOrStyleValue>;
1398 styles?: Record<string, FormatAttrOrStyleValue>;
1399 toggle?: boolean;
1400 preview?: string | false;
1401 onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
1402 clear_child_styles?: boolean;
1403 merge_siblings?: boolean;
1404 merge_with_parents?: boolean;
1405}
1406interface BlockFormat extends Block, CommonFormat<BlockFormat> {
1407}
1408interface InlineFormat extends Inline, CommonFormat<InlineFormat> {
1409}
1410interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> {
1411}
1412interface CommonRemoveFormat<T> extends BaseFormat<T> {
1413 attributes?: string[] | Record<string, FormatAttrOrStyleValue>;
1414 styles?: string[] | Record<string, FormatAttrOrStyleValue>;
1415}
1416interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> {
1417}
1418interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> {
1419}
1420interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
1421}
1422interface Filter<C extends Function> {
1423 name: string;
1424 callbacks: C[];
1425}
1426interface ParserArgs {
1427 getInner?: boolean | number;
1428 forced_root_block?: boolean | string;
1429 context?: string;
1430 isRootContent?: boolean;
1431 format?: string;
1432 invalid?: boolean;
1433 no_events?: boolean;
1434 [key: string]: any;
1435}
1436type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
1437interface ParserFilter extends Filter<ParserFilterCallback> {
1438}
1439interface DomParserSettings {
1440 allow_html_data_urls?: boolean;
1441 allow_svg_data_urls?: boolean;
1442 allow_conditional_comments?: boolean;
1443 allow_html_in_named_anchor?: boolean;
1444 allow_script_urls?: boolean;
1445 allow_unsafe_link_target?: boolean;
1446 allow_mathml_annotation_encodings?: string[];
1447 blob_cache?: BlobCache;
1448 convert_fonts_to_spans?: boolean;
1449 convert_unsafe_embeds?: boolean;
1450 document?: Document;
1451 fix_list_elements?: boolean;
1452 font_size_legacy_values?: string;
1453 forced_root_block?: boolean | string;
1454 forced_root_block_attrs?: Record<string, string>;
1455 inline_styles?: boolean;
1456 pad_empty_with_br?: boolean;
1457 preserve_cdata?: boolean;
1458 root_name?: string;
1459 sandbox_iframes?: boolean;
1460 sandbox_iframes_exclusions?: string[];
1461 sanitize?: boolean;
1462 validate?: boolean;
1463}
1464interface DomParser {
1465 schema: Schema;
1466 addAttributeFilter: (name: string, callback: ParserFilterCallback) => void;
1467 getAttributeFilters: () => ParserFilter[];
1468 removeAttributeFilter: (name: string, callback?: ParserFilterCallback) => void;
1469 addNodeFilter: (name: string, callback: ParserFilterCallback) => void;
1470 getNodeFilters: () => ParserFilter[];
1471 removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void;
1472 parse: (html: string, args?: ParserArgs) => AstNode;
1473}
1474interface StyleSheetLoaderSettings {
1475 maxLoadTime?: number;
1476 contentCssCors?: boolean;
1477 referrerPolicy?: ReferrerPolicy;
1478}
1479interface StyleSheetLoader {
1480 load: (url: string) => Promise<void>;
1481 loadRawCss: (key: string, css: string) => void;
1482 loadAll: (urls: string[]) => Promise<string[]>;
1483 unload: (url: string) => void;
1484 unloadRawCss: (key: string) => void;
1485 unloadAll: (urls: string[]) => void;
1486 _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
1487 _setContentCssCors: (contentCssCors: boolean) => void;
1488}
1489type Registry = Registry$1;
1490interface EditorUiApi {
1491 show: () => void;
1492 hide: () => void;
1493 setEnabled: (state: boolean) => void;
1494 isEnabled: () => boolean;
1495}
1496interface EditorUi extends EditorUiApi {
1497 registry: Registry;
1498 styleSheetLoader: StyleSheetLoader;
1499}
1500type Ui_d_Registry = Registry;
1501type Ui_d_EditorUiApi = EditorUiApi;
1502type Ui_d_EditorUi = EditorUi;
1503declare namespace Ui_d {
1504 export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicView_d as View, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
1505}
1506interface WindowParams {
1507 readonly inline?: 'cursor' | 'toolbar' | 'bottom';
1508 readonly ariaAttrs?: boolean;
1509 readonly persistent?: boolean;
1510}
1511type InstanceApi<T extends DialogData> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1512interface WindowManagerImpl {
1513 open: <T extends DialogData>(config: DialogSpec<T>, params: WindowParams | undefined, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1514 openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
1515 alert: (message: string, callback: () => void) => void;
1516 confirm: (message: string, callback: (state: boolean) => void) => void;
1517 close: (dialog: InstanceApi<any>) => void;
1518}
1519interface WindowManager {
1520 open: <T extends DialogData>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1521 openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
1522 alert: (message: string, callback?: () => void, scope?: any) => void;
1523 confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
1524 close: () => void;
1525}
1526interface ExecCommandEvent {
1527 command: string;
1528 ui: boolean;
1529 value?: any;
1530}
1531interface BeforeGetContentEvent extends GetContentArgs {
1532 selection?: boolean;
1533}
1534interface GetContentEvent extends BeforeGetContentEvent {
1535 content: string;
1536}
1537interface BeforeSetContentEvent extends SetContentArgs {
1538 content: string;
1539 selection?: boolean;
1540}
1541interface SetContentEvent extends BeforeSetContentEvent {
1542 content: string;
1543}
1544interface SaveContentEvent extends GetContentEvent {
1545 save: boolean;
1546}
1547interface NewBlockEvent {
1548 newBlock: Element;
1549}
1550interface NodeChangeEvent {
1551 element: Element;
1552 parents: Node[];
1553 selectionChange?: boolean;
1554 initial?: boolean;
1555}
1556interface FormatEvent {
1557 format: string;
1558 vars?: FormatVars;
1559 node?: Node | RangeLikeObject | null;
1560}
1561interface ObjectResizeEvent {
1562 target: HTMLElement;
1563 width: number;
1564 height: number;
1565 origin: string;
1566}
1567interface ObjectSelectedEvent {
1568 target: Node;
1569 targetClone?: Node;
1570}
1571interface ScrollIntoViewEvent {
1572 elm: HTMLElement;
1573 alignToTop: boolean | undefined;
1574}
1575interface SetSelectionRangeEvent {
1576 range: Range;
1577 forward: boolean | undefined;
1578}
1579interface ShowCaretEvent {
1580 target: Node;
1581 direction: number;
1582 before: boolean;
1583}
1584interface SwitchModeEvent {
1585 mode: string;
1586}
1587interface ChangeEvent {
1588 level: UndoLevel;
1589 lastLevel: UndoLevel | undefined;
1590}
1591interface AddUndoEvent extends ChangeEvent {
1592 originalEvent: Event | undefined;
1593}
1594interface UndoRedoEvent {
1595 level: UndoLevel;
1596}
1597interface WindowEvent<T extends DialogData> {
1598 dialog: InstanceApi<T>;
1599}
1600interface ProgressStateEvent {
1601 state: boolean;
1602 time?: number;
1603}
1604interface AfterProgressStateEvent {
1605 state: boolean;
1606}
1607interface PlaceholderToggleEvent {
1608 state: boolean;
1609}
1610interface LoadErrorEvent {
1611 message: string;
1612}
1613interface PreProcessEvent extends ParserArgs {
1614 node: Element;
1615}
1616interface PostProcessEvent extends ParserArgs {
1617 content: string;
1618}
1619interface PastePlainTextToggleEvent {
1620 state: boolean;
1621}
1622interface PastePreProcessEvent {
1623 content: string;
1624 readonly internal: boolean;
1625}
1626interface PastePostProcessEvent {
1627 node: HTMLElement;
1628 readonly internal: boolean;
1629}
1630interface EditableRootStateChangeEvent {
1631 state: boolean;
1632}
1633interface NewTableRowEvent {
1634 node: HTMLTableRowElement;
1635}
1636interface NewTableCellEvent {
1637 node: HTMLTableCellElement;
1638}
1639interface TableEventData {
1640 readonly structure: boolean;
1641 readonly style: boolean;
1642}
1643interface TableModifiedEvent extends TableEventData {
1644 readonly table: HTMLTableElement;
1645}
1646interface BeforeOpenNotificationEvent {
1647 notification: NotificationSpec;
1648}
1649interface OpenNotificationEvent {
1650 notification: NotificationApi;
1651}
1652interface DisabledStateChangeEvent {
1653 readonly state: boolean;
1654}
1655interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1656 'activate': {
1657 relatedTarget: Editor | null;
1658 };
1659 'deactivate': {
1660 relatedTarget: Editor;
1661 };
1662 'focus': {
1663 blurredEditor: Editor | null;
1664 };
1665 'blur': {
1666 focusedEditor: Editor | null;
1667 };
1668 'resize': UIEvent;
1669 'scroll': UIEvent;
1670 'input': InputEvent;
1671 'beforeinput': InputEvent;
1672 'detach': {};
1673 'remove': {};
1674 'init': {};
1675 'ScrollIntoView': ScrollIntoViewEvent;
1676 'AfterScrollIntoView': ScrollIntoViewEvent;
1677 'ObjectResized': ObjectResizeEvent;
1678 'ObjectResizeStart': ObjectResizeEvent;
1679 'SwitchMode': SwitchModeEvent;
1680 'ScrollWindow': Event;
1681 'ResizeWindow': UIEvent;
1682 'SkinLoaded': {};
1683 'SkinLoadError': LoadErrorEvent;
1684 'PluginLoadError': LoadErrorEvent;
1685 'ModelLoadError': LoadErrorEvent;
1686 'IconsLoadError': LoadErrorEvent;
1687 'ThemeLoadError': LoadErrorEvent;
1688 'LanguageLoadError': LoadErrorEvent;
1689 'BeforeExecCommand': ExecCommandEvent;
1690 'ExecCommand': ExecCommandEvent;
1691 'NodeChange': NodeChangeEvent;
1692 'FormatApply': FormatEvent;
1693 'FormatRemove': FormatEvent;
1694 'ShowCaret': ShowCaretEvent;
1695 'SelectionChange': {};
1696 'ObjectSelected': ObjectSelectedEvent;
1697 'BeforeObjectSelected': ObjectSelectedEvent;
1698 'GetSelectionRange': {
1699 range: Range;
1700 };
1701 'SetSelectionRange': SetSelectionRangeEvent;
1702 'AfterSetSelectionRange': SetSelectionRangeEvent;
1703 'BeforeGetContent': BeforeGetContentEvent;
1704 'GetContent': GetContentEvent;
1705 'BeforeSetContent': BeforeSetContentEvent;
1706 'SetContent': SetContentEvent;
1707 'SaveContent': SaveContentEvent;
1708 'RawSaveContent': SaveContentEvent;
1709 'LoadContent': {
1710 load: boolean;
1711 element: HTMLElement;
1712 };
1713 'PreviewFormats': {};
1714 'AfterPreviewFormats': {};
1715 'ScriptsLoaded': {};
1716 'PreInit': {};
1717 'PostRender': {};
1718 'NewBlock': NewBlockEvent;
1719 'ClearUndos': {};
1720 'TypingUndo': {};
1721 'Redo': UndoRedoEvent;
1722 'Undo': UndoRedoEvent;
1723 'BeforeAddUndo': AddUndoEvent;
1724 'AddUndo': AddUndoEvent;
1725 'change': ChangeEvent;
1726 'CloseWindow': WindowEvent<any>;
1727 'OpenWindow': WindowEvent<any>;
1728 'ProgressState': ProgressStateEvent;
1729 'AfterProgressState': AfterProgressStateEvent;
1730 'PlaceholderToggle': PlaceholderToggleEvent;
1731 'tap': TouchEvent;
1732 'longpress': TouchEvent;
1733 'longpresscancel': {};
1734 'PreProcess': PreProcessEvent;
1735 'PostProcess': PostProcessEvent;
1736 'AutocompleterStart': AutocompleterEventArgs;
1737 'AutocompleterUpdate': AutocompleterEventArgs;
1738 'AutocompleterEnd': {};
1739 'PastePlainTextToggle': PastePlainTextToggleEvent;
1740 'PastePreProcess': PastePreProcessEvent;
1741 'PastePostProcess': PastePostProcessEvent;
1742 'TableModified': TableModifiedEvent;
1743 'NewRow': NewTableRowEvent;
1744 'NewCell': NewTableCellEvent;
1745 'SetAttrib': SetAttribEvent;
1746 'hide': {};
1747 'show': {};
1748 'dirty': {};
1749 'BeforeOpenNotification': BeforeOpenNotificationEvent;
1750 'OpenNotification': OpenNotificationEvent;
1751}
1752interface EditorManagerEventMap {
1753 'AddEditor': {
1754 editor: Editor;
1755 };
1756 'RemoveEditor': {
1757 editor: Editor;
1758 };
1759 'BeforeUnload': {
1760 returnValue: any;
1761 };
1762}
1763type EventTypes_d_ExecCommandEvent = ExecCommandEvent;
1764type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent;
1765type EventTypes_d_GetContentEvent = GetContentEvent;
1766type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent;
1767type EventTypes_d_SetContentEvent = SetContentEvent;
1768type EventTypes_d_SaveContentEvent = SaveContentEvent;
1769type EventTypes_d_NewBlockEvent = NewBlockEvent;
1770type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
1771type EventTypes_d_FormatEvent = FormatEvent;
1772type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent;
1773type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent;
1774type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
1775type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
1776type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
1777type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
1778type EventTypes_d_ChangeEvent = ChangeEvent;
1779type EventTypes_d_AddUndoEvent = AddUndoEvent;
1780type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
1781type EventTypes_d_WindowEvent<T extends DialogData> = WindowEvent<T>;
1782type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
1783type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
1784type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
1785type EventTypes_d_LoadErrorEvent = LoadErrorEvent;
1786type EventTypes_d_PreProcessEvent = PreProcessEvent;
1787type EventTypes_d_PostProcessEvent = PostProcessEvent;
1788type EventTypes_d_PastePlainTextToggleEvent = PastePlainTextToggleEvent;
1789type EventTypes_d_PastePreProcessEvent = PastePreProcessEvent;
1790type EventTypes_d_PastePostProcessEvent = PastePostProcessEvent;
1791type EventTypes_d_EditableRootStateChangeEvent = EditableRootStateChangeEvent;
1792type EventTypes_d_NewTableRowEvent = NewTableRowEvent;
1793type EventTypes_d_NewTableCellEvent = NewTableCellEvent;
1794type EventTypes_d_TableEventData = TableEventData;
1795type EventTypes_d_TableModifiedEvent = TableModifiedEvent;
1796type EventTypes_d_BeforeOpenNotificationEvent = BeforeOpenNotificationEvent;
1797type EventTypes_d_OpenNotificationEvent = OpenNotificationEvent;
1798type EventTypes_d_DisabledStateChangeEvent = DisabledStateChangeEvent;
1799type EventTypes_d_EditorEventMap = EditorEventMap;
1800type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
1801declare namespace EventTypes_d {
1802 export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_SaveContentEvent as SaveContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_ChangeEvent as ChangeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_EditableRootStateChangeEvent as EditableRootStateChangeEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_BeforeOpenNotificationEvent as BeforeOpenNotificationEvent, EventTypes_d_OpenNotificationEvent as OpenNotificationEvent, EventTypes_d_DisabledStateChangeEvent as DisabledStateChangeEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
1803}
1804type Format_d_Formats = Formats;
1805type Format_d_Format = Format;
1806type Format_d_ApplyFormat = ApplyFormat;
1807type Format_d_BlockFormat = BlockFormat;
1808type Format_d_InlineFormat = InlineFormat;
1809type Format_d_SelectorFormat = SelectorFormat;
1810type Format_d_RemoveFormat = RemoveFormat;
1811type Format_d_RemoveBlockFormat = RemoveBlockFormat;
1812type Format_d_RemoveInlineFormat = RemoveInlineFormat;
1813type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
1814declare namespace Format_d {
1815 export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, };
1816}
1817type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
1818type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
1819interface Separator {
1820 title: string;
1821}
1822interface FormatReference {
1823 title: string;
1824 format: string;
1825 icon?: string;
1826}
1827interface NestedFormatting {
1828 title: string;
1829 items: Array<FormatReference | StyleFormat>;
1830}
1831interface CommonStyleFormat {
1832 name?: string;
1833 title: string;
1834 icon?: string;
1835}
1836interface BlockStyleFormat extends BlockFormat, CommonStyleFormat {
1837}
1838interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
1839}
1840interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
1841}
1842type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
1843interface ContentLanguage {
1844 readonly title: string;
1845 readonly code: string;
1846 readonly customCode?: string;
1847}
1848type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1849 editorContainer: HTMLElement;
1850 iframeContainer: HTMLElement;
1851 height?: number;
1852 iframeHeight?: number;
1853 api?: EditorUiApi;
1854};
1855type SetupCallback = (editor: Editor) => void;
1856type FilePickerCallback = (callback: (value: string, meta?: Record<string, any>) => void, value: string, meta: Record<string, any>) => void;
1857type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1858type FilePickerValidationCallback = (info: {
1859 type: string;
1860 url: string;
1861}, callback: (validation: {
1862 status: FilePickerValidationStatus;
1863 message: string;
1864}) => void) => void;
1865type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
1866type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
1867type URLConverter = (url: string, name: string, elm?: string | Element) => string;
1868type URLConverterCallback = (url: string, node: Node | string | undefined, on_save: boolean, name: string) => string;
1869interface ToolbarGroup {
1870 name?: string;
1871 label?: string;
1872 items: string[];
1873}
1874type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1875type ToolbarLocation = 'top' | 'bottom' | 'auto';
1876interface BaseEditorOptions {
1877 a11y_advanced_options?: boolean;
1878 add_form_submit_trigger?: boolean;
1879 add_unload_trigger?: boolean;
1880 allow_conditional_comments?: boolean;
1881 allow_html_data_urls?: boolean;
1882 allow_html_in_named_anchor?: boolean;
1883 allow_script_urls?: boolean;
1884 allow_svg_data_urls?: boolean;
1885 allow_unsafe_link_target?: boolean;
1886 anchor_bottom?: false | string;
1887 anchor_top?: false | string;
1888 auto_focus?: string | true;
1889 automatic_uploads?: boolean;
1890 base_url?: string;
1891 block_formats?: string;
1892 block_unsupported_drop?: boolean;
1893 body_id?: string;
1894 body_class?: string;
1895 br_in_pre?: boolean;
1896 br_newline_selector?: string;
1897 browser_spellcheck?: boolean;
1898 branding?: boolean;
1899 cache_suffix?: string;
1900 color_cols?: number;
1901 color_cols_foreground?: number;
1902 color_cols_background?: number;
1903 color_map?: string[];
1904 color_map_foreground?: string[];
1905 color_map_background?: string[];
1906 color_default_foreground?: string;
1907 color_default_background?: string;
1908 content_css?: boolean | string | string[];
1909 content_css_cors?: boolean;
1910 content_security_policy?: string;
1911 content_style?: string;
1912 content_langs?: ContentLanguage[];
1913 contextmenu?: string | string[] | false;
1914 contextmenu_never_use_native?: boolean;
1915 convert_fonts_to_spans?: boolean;
1916 convert_unsafe_embeds?: boolean;
1917 convert_urls?: boolean;
1918 custom_colors?: boolean;
1919 custom_elements?: string | Record<string, CustomElementSpec>;
1920 custom_ui_selector?: string;
1921 custom_undo_redo_levels?: number;
1922 default_font_stack?: string[];
1923 deprecation_warnings?: boolean;
1924 directionality?: 'ltr' | 'rtl';
1925 doctype?: string;
1926 document_base_url?: string;
1927 draggable_modal?: boolean;
1928 editable_class?: string;
1929 editable_root?: boolean;
1930 element_format?: 'xhtml' | 'html';
1931 elementpath?: boolean;
1932 encoding?: string;
1933 end_container_on_empty_block?: boolean | string;
1934 entities?: string;
1935 entity_encoding?: EntityEncoding;
1936 extended_valid_elements?: string;
1937 event_root?: string;
1938 file_picker_callback?: FilePickerCallback;
1939 file_picker_types?: string;
1940 file_picker_validator_handler?: FilePickerValidationCallback;
1941 fix_list_elements?: boolean;
1942 fixed_toolbar_container?: string;
1943 fixed_toolbar_container_target?: HTMLElement;
1944 font_css?: string | string[];
1945 font_family_formats?: string;
1946 font_size_classes?: string;
1947 font_size_legacy_values?: string;
1948 font_size_style_values?: string;
1949 font_size_formats?: string;
1950 font_size_input_default_unit?: string;
1951 forced_root_block?: string;
1952 forced_root_block_attrs?: Record<string, string>;
1953 formats?: Formats;
1954 format_noneditable_selector?: string;
1955 height?: number | string;
1956 help_accessibility?: boolean;
1957 hidden_input?: boolean;
1958 highlight_on_focus?: boolean;
1959 icons?: string;
1960 icons_url?: string;
1961 id?: string;
1962 iframe_aria_text?: string;
1963 iframe_attrs?: Record<string, string>;
1964 images_file_types?: string;
1965 images_replace_blob_uris?: boolean;
1966 images_reuse_filename?: boolean;
1967 images_upload_base_path?: string;
1968 images_upload_credentials?: boolean;
1969 images_upload_handler?: UploadHandler;
1970 images_upload_url?: string;
1971 indent?: boolean;
1972 indent_after?: string;
1973 indent_before?: string;
1974 indent_use_margin?: boolean;
1975 indentation?: string;
1976 init_instance_callback?: SetupCallback;
1977 inline?: boolean;
1978 inline_boundaries?: boolean;
1979 inline_boundaries_selector?: string;
1980 inline_styles?: boolean;
1981 invalid_elements?: string;
1982 invalid_styles?: string | Record<string, string>;
1983 keep_styles?: boolean;
1984 language?: string;
1985 language_load?: boolean;
1986 language_url?: string;
1987 line_height_formats?: string;
1988 max_height?: number;
1989 max_width?: number;
1990 menu?: Record<string, {
1991 title: string;
1992 items: string;
1993 }>;
1994 menubar?: boolean | string;
1995 min_height?: number;
1996 min_width?: number;
1997 model?: string;
1998 model_url?: string;
1999 newdocument_content?: string;
2000 newline_behavior?: 'block' | 'linebreak' | 'invert' | 'default';
2001 no_newline_selector?: string;
2002 noneditable_class?: string;
2003 noneditable_regexp?: RegExp | RegExp[];
2004 nowrap?: boolean;
2005 object_resizing?: boolean | string;
2006 pad_empty_with_br?: boolean;
2007 paste_as_text?: boolean;
2008 paste_block_drop?: boolean;
2009 paste_data_images?: boolean;
2010 paste_merge_formats?: boolean;
2011 paste_postprocess?: PastePostProcessFn;
2012 paste_preprocess?: PastePreProcessFn;
2013 paste_remove_styles_if_webkit?: boolean;
2014 paste_tab_spaces?: number;
2015 paste_webkit_styles?: string;
2016 placeholder?: string;
2017 preserve_cdata?: boolean;
2018 preview_styles?: false | string;
2019 promotion?: boolean;
2020 protect?: RegExp[];
2021 readonly?: boolean;
2022 referrer_policy?: ReferrerPolicy;
2023 relative_urls?: boolean;
2024 remove_script_host?: boolean;
2025 remove_trailing_brs?: boolean;
2026 removed_menuitems?: string;
2027 resize?: boolean | 'both';
2028 resize_img_proportional?: boolean;
2029 root_name?: string;
2030 sandbox_iframes?: boolean;
2031 sandbox_iframes_exclusions?: string[];
2032 schema?: SchemaType;
2033 selector?: string;
2034 setup?: SetupCallback;
2035 sidebar_show?: string;
2036 skin?: boolean | string;
2037 skin_url?: string;
2038 smart_paste?: boolean;
2039 statusbar?: boolean;
2040 style_formats?: AllowedFormat[];
2041 style_formats_autohide?: boolean;
2042 style_formats_merge?: boolean;
2043 submit_patch?: boolean;
2044 suffix?: string;
2045 table_tab_navigation?: boolean;
2046 target?: HTMLElement;
2047 text_patterns?: RawPattern[] | false;
2048 text_patterns_lookup?: RawDynamicPatternsLookup;
2049 theme?: string | ThemeInitFunc | false;
2050 theme_url?: string;
2051 toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
2052 toolbar1?: string;
2053 toolbar2?: string;
2054 toolbar3?: string;
2055 toolbar4?: string;
2056 toolbar5?: string;
2057 toolbar6?: string;
2058 toolbar7?: string;
2059 toolbar8?: string;
2060 toolbar9?: string;
2061 toolbar_groups?: Record<string, GroupToolbarButtonSpec>;
2062 toolbar_location?: ToolbarLocation;
2063 toolbar_mode?: ToolbarMode;
2064 toolbar_sticky?: boolean;
2065 toolbar_sticky_offset?: number;
2066 typeahead_urls?: boolean;
2067 ui_mode?: 'combined' | 'split';
2068 url_converter?: URLConverter;
2069 url_converter_scope?: any;
2070 urlconverter_callback?: URLConverterCallback;
2071 valid_children?: string;
2072 valid_classes?: string | Record<string, string>;
2073 valid_elements?: string;
2074 valid_styles?: string | Record<string, string>;
2075 verify_html?: boolean;
2076 visual?: boolean;
2077 visual_anchor_class?: string;
2078 visual_table_class?: string;
2079 width?: number | string;
2080 xss_sanitization?: boolean;
2081 license_key?: string;
2082 disabled?: boolean;
2083 disable_nodechange?: boolean;
2084 forced_plugins?: string | string[];
2085 plugin_base_urls?: Record<string, string>;
2086 service_message?: string;
2087 [key: string]: any;
2088}
2089interface RawEditorOptions extends BaseEditorOptions {
2090 external_plugins?: Record<string, string>;
2091 mobile?: RawEditorOptions;
2092 plugins?: string | string[];
2093}
2094interface NormalizedEditorOptions extends BaseEditorOptions {
2095 external_plugins: Record<string, string>;
2096 forced_plugins: string[];
2097 plugins: string[];
2098}
2099interface EditorOptions extends NormalizedEditorOptions {
2100 a11y_advanced_options: boolean;
2101 allow_unsafe_link_target: boolean;
2102 anchor_bottom: string;
2103 anchor_top: string;
2104 automatic_uploads: boolean;
2105 block_formats: string;
2106 body_class: string;
2107 body_id: string;
2108 br_newline_selector: string;
2109 color_map: string[];
2110 color_cols: number;
2111 color_cols_foreground: number;
2112 color_cols_background: number;
2113 color_default_background: string;
2114 color_default_foreground: string;
2115 content_css: string[];
2116 contextmenu: string[];
2117 convert_unsafe_embeds: boolean;
2118 custom_colors: boolean;
2119 default_font_stack: string[];
2120 document_base_url: string;
2121 init_content_sync: boolean;
2122 draggable_modal: boolean;
2123 editable_class: string;
2124 editable_root: boolean;
2125 font_css: string[];
2126 font_family_formats: string;
2127 font_size_classes: string;
2128 font_size_formats: string;
2129 font_size_input_default_unit: string;
2130 font_size_legacy_values: string;
2131 font_size_style_values: string;
2132 forced_root_block: string;
2133 forced_root_block_attrs: Record<string, string>;
2134 format_noneditable_selector: string;
2135 height: number | string;
2136 highlight_on_focus: boolean;
2137 iframe_attrs: Record<string, string>;
2138 images_file_types: string;
2139 images_upload_base_path: string;
2140 images_upload_credentials: boolean;
2141 images_upload_url: string;
2142 indent_use_margin: boolean;
2143 indentation: string;
2144 inline: boolean;
2145 inline_boundaries_selector: string;
2146 language: string;
2147 language_load: boolean;
2148 language_url: string;
2149 line_height_formats: string;
2150 menu: Record<string, {
2151 title: string;
2152 items: string;
2153 }>;
2154 menubar: boolean | string;
2155 model: string;
2156 newdocument_content: string;
2157 no_newline_selector: string;
2158 noneditable_class: string;
2159 noneditable_regexp: RegExp[];
2160 object_resizing: string;
2161 pad_empty_with_br: boolean;
2162 paste_as_text: boolean;
2163 preview_styles: string;
2164 promotion: boolean;
2165 readonly: boolean;
2166 removed_menuitems: string;
2167 sandbox_iframes: boolean;
2168 sandbox_iframes_exclusions: string[];
2169 toolbar: boolean | string | string[] | Array<ToolbarGroup>;
2170 toolbar_groups: Record<string, GroupToolbarButtonSpec>;
2171 toolbar_location: ToolbarLocation;
2172 toolbar_mode: ToolbarMode;
2173 toolbar_persist: boolean;
2174 toolbar_sticky: boolean;
2175 toolbar_sticky_offset: number;
2176 text_patterns: Pattern[];
2177 text_patterns_lookup: DynamicPatternsLookup;
2178 visual: boolean;
2179 visual_anchor_class: string;
2180 visual_table_class: string;
2181 width: number | string;
2182 xss_sanitization: boolean;
2183 disabled: boolean;
2184}
2185type StyleMap = Record<string, string | number>;
2186interface StylesSettings {
2187 allow_script_urls?: boolean;
2188 allow_svg_data_urls?: boolean;
2189 url_converter?: URLConverter;
2190 url_converter_scope?: any;
2191}
2192interface Styles {
2193 parse: (css: string | undefined) => Record<string, string>;
2194 serialize: (styles: StyleMap, elementName?: string) => string;
2195}
2196type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void | boolean;
2197type EventUtilsEvent<T> = NormalizedEvent<T> & {
2198 metaKey: boolean;
2199};
2200interface Callback$1<T> {
2201 func: EventUtilsCallback<T>;
2202 scope: any;
2203}
2204interface CallbackList<T> extends Array<Callback$1<T>> {
2205 fakeName: string | false;
2206 capture: boolean;
2207 nativeHandler: EventListener;
2208}
2209interface EventUtilsConstructor {
2210 readonly prototype: EventUtils;
2211 new (): EventUtils;
2212 Event: EventUtils;
2213}
2214declare class EventUtils {
2215 static Event: EventUtils;
2216 domLoaded: boolean;
2217 events: Record<number, Record<string, CallbackList<any>>>;
2218 private readonly expando;
2219 private hasFocusIn;
2220 private count;
2221 constructor();
2222 bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
2223 bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
2224 unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
2225 unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
2226 unbind(target: any): this;
2227 fire(target: any, name: string, args?: {}): this;
2228 dispatch(target: any, name: string, args?: {}): this;
2229 clean(target: any): this;
2230 destroy(): void;
2231 cancel<T>(e: EventUtilsEvent<T>): boolean;
2232 private executeHandlers;
2233}
2234interface SetAttribEvent {
2235 attrElm: HTMLElement;
2236 attrName: string;
2237 attrValue: string | boolean | number | null;
2238}
2239interface DOMUtilsSettings {
2240 schema: Schema;
2241 url_converter: URLConverter;
2242 url_converter_scope: any;
2243 ownEvents: boolean;
2244 keep_values: boolean;
2245 update_styles: boolean;
2246 root_element: HTMLElement | null;
2247 collect: boolean;
2248 onSetAttrib: (event: SetAttribEvent) => void;
2249 contentCssCors: boolean;
2250 referrerPolicy: ReferrerPolicy;
2251}
2252type Target = Node | Window;
2253type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null;
2254type BoundEvent = [
2255 Target,
2256 string,
2257 EventUtilsCallback<any>,
2258 any
2259];
2260type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
2261type RunResult<T, R> = T extends Array<any> ? R[] : false | R;
2262interface DOMUtils {
2263 doc: Document;
2264 settings: Partial<DOMUtilsSettings>;
2265 win: Window;
2266 files: Record<string, boolean>;
2267 stdMode: boolean;
2268 boxModel: boolean;
2269 styleSheetLoader: StyleSheetLoader;
2270 boundEvents: BoundEvent[];
2271 styles: Styles;
2272 schema: Schema;
2273 events: EventUtils;
2274 root: Node | null;
2275 isBlock: {
2276 (node: Node | null): node is HTMLElement;
2277 (node: string): boolean;
2278 };
2279 clone: (node: Node, deep: boolean) => Node;
2280 getRoot: () => HTMLElement;
2281 getViewPort: (argWin?: Window) => GeomRect;
2282 getRect: (elm: string | HTMLElement) => GeomRect;
2283 getSize: (elm: string | HTMLElement) => {
2284 w: number;
2285 h: number;
2286 };
2287 getParent: {
2288 <K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
2289 <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
2290 (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
2291 };
2292 getParents: {
2293 <K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
2294 <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
2295 (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
2296 };
2297 get: {
2298 <T extends Node>(elm: T): T;
2299 (elm: string): HTMLElement | null;
2300 };
2301 getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
2302 getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
2303 select: {
2304 <K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
2305 <T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
2306 };
2307 is: {
2308 <T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
2309 (elm: Node | Node[] | null, selector: string): boolean;
2310 };
2311 add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
2312 create: {
2313 <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
2314 (name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
2315 };
2316 createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
2317 createFragment: (html?: string) => DocumentFragment;
2318 remove: {
2319 <T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
2320 <T extends Node>(node: string, keepChildren?: boolean): T | false;
2321 };
2322 getStyle: {
2323 (elm: Element, name: string, computed: true): string;
2324 (elm: string | Element | null, name: string, computed?: boolean): string | undefined;
2325 };
2326 setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
2327 setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
2328 removeAllAttribs: (e: RunArguments<Element>) => void;
2329 setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
2330 setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
2331 getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
2332 getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
2333 getPos: (elm: string | Element, rootElm?: Node) => {
2334 x: number;
2335 y: number;
2336 };
2337 parseStyle: (cssText: string) => Record<string, string>;
2338 serializeStyle: (stylesArg: StyleMap, name?: string) => string;
2339 addStyle: (cssText: string) => void;
2340 loadCSS: (url: string) => void;
2341 hasClass: (elm: string | Element, cls: string) => boolean;
2342 addClass: (elm: RunArguments<Element>, cls: string) => void;
2343 removeClass: (elm: RunArguments<Element>, cls: string) => void;
2344 toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
2345 show: (elm: string | Node | Node[]) => void;
2346 hide: (elm: string | Node | Node[]) => void;
2347 isHidden: (elm: string | Node) => boolean;
2348 uniqueId: (prefix?: string) => string;
2349 setHTML: (elm: RunArguments<Element>, html: string) => void;
2350 getOuterHTML: (elm: string | Node) => string;
2351 setOuterHTML: (elm: string | Node | Node[], html: string) => void;
2352 decode: (text: string) => string;
2353 encode: (text: string) => string;
2354 insertAfter: {
2355 <T extends Node>(node: T | T[], reference: string | Node): T;
2356 <T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
2357 };
2358 replace: {
2359 <T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
2360 <T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
2361 };
2362 rename: {
2363 <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
2364 (elm: Element, name: string): Element;
2365 };
2366 findCommonAncestor: (a: Node, b: Node) => Node | null;
2367 run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
2368 run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
2369 isEmpty: (node: Node, elements?: Record<string, any>, options?: IsEmptyOptions) => boolean;
2370 createRng: () => Range;
2371 nodeIndex: (node: Node, normalized?: boolean) => number;
2372 split: {
2373 <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
2374 <T extends Node>(parentElm: Node, splitElm: T): T | undefined;
2375 };
2376 bind: {
2377 <K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
2378 <K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
2379 };
2380 unbind: {
2381 <K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
2382 <K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
2383 };
2384 fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
2385 dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
2386 getContentEditable: (node: Node) => string | null;
2387 getContentEditableParent: (node: Node) => string | null;
2388 isEditable: (node: Node | null | undefined) => boolean;
2389 destroy: () => void;
2390 isChildOf: (node: Node, parent: Node) => boolean;
2391 dumpRng: (r: Range) => string;
2392}
2393interface ClientRect {
2394 left: number;
2395 top: number;
2396 bottom: number;
2397 right: number;
2398 width: number;
2399 height: number;
2400}
2401interface BookmarkManager {
2402 getBookmark: (type?: number, normalized?: boolean) => Bookmark;
2403 moveToBookmark: (bookmark: Bookmark) => void;
2404}
2405interface ControlSelection {
2406 isResizable: (elm: Element) => boolean;
2407 showResizeRect: (elm: HTMLElement) => void;
2408 hideResizeRect: () => void;
2409 updateResizeRect: (evt: EditorEvent<any>) => void;
2410 destroy: () => void;
2411}
2412interface WriterSettings {
2413 element_format?: 'xhtml' | 'html';
2414 entities?: string;
2415 entity_encoding?: EntityEncoding;
2416 indent?: boolean;
2417 indent_after?: string;
2418 indent_before?: string;
2419}
2420type Attributes = Array<{
2421 name: string;
2422 value: string;
2423}>;
2424interface Writer {
2425 cdata: (text: string) => void;
2426 comment: (text: string) => void;
2427 doctype: (text: string) => void;
2428 end: (name: string) => void;
2429 getContent: () => string;
2430 pi: (name: string, text?: string) => void;
2431 reset: () => void;
2432 start: (name: string, attrs?: Attributes | null, empty?: boolean) => void;
2433 text: (text: string, raw?: boolean) => void;
2434}
2435interface HtmlSerializerSettings extends WriterSettings {
2436 inner?: boolean;
2437 validate?: boolean;
2438}
2439interface HtmlSerializer {
2440 serialize: (node: AstNode) => string;
2441}
2442interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings {
2443 remove_trailing_brs?: boolean;
2444 url_converter?: URLConverter;
2445 url_converter_scope?: {};
2446}
2447interface DomSerializerImpl {
2448 schema: Schema;
2449 addNodeFilter: (name: string, callback: ParserFilterCallback) => void;
2450 addAttributeFilter: (name: string, callback: ParserFilterCallback) => void;
2451 getNodeFilters: () => ParserFilter[];
2452 getAttributeFilters: () => ParserFilter[];
2453 removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void;
2454 removeAttributeFilter: (name: string, callback?: ParserFilterCallback) => void;
2455 serialize: {
2456 (node: Element, parserArgs: {
2457 format: 'tree';
2458 } & ParserArgs): AstNode;
2459 (node: Element, parserArgs?: ParserArgs): string;
2460 };
2461 addRules: (rules: string) => void;
2462 setRules: (rules: string) => void;
2463 addTempAttr: (name: string) => void;
2464 getTempAttrs: () => string[];
2465}
2466interface DomSerializer extends DomSerializerImpl {
2467}
2468interface EditorSelection {
2469 bookmarkManager: BookmarkManager;
2470 controlSelection: ControlSelection;
2471 dom: DOMUtils;
2472 win: Window;
2473 serializer: DomSerializer;
2474 editor: Editor;
2475 collapse: (toStart?: boolean) => void;
2476 setCursorLocation: {
2477 (node: Node, offset: number): void;
2478 (): void;
2479 };
2480 getContent: {
2481 (args: {
2482 format: 'tree';
2483 } & Partial<GetSelectionContentArgs>): AstNode;
2484 (args?: Partial<GetSelectionContentArgs>): string;
2485 };
2486 setContent: (content: string, args?: Partial<SetSelectionContentArgs>) => void;
2487 getBookmark: (type?: number, normalized?: boolean) => Bookmark;
2488 moveToBookmark: (bookmark: Bookmark) => void;
2489 select: (node: Node, content?: boolean) => Node;
2490 isCollapsed: () => boolean;
2491 isEditable: () => boolean;
2492 isForward: () => boolean;
2493 setNode: (elm: Element) => Element;
2494 getNode: () => HTMLElement;
2495 getSel: () => Selection | null;
2496 setRng: (rng: Range, forward?: boolean) => void;
2497 getRng: () => Range;
2498 getStart: (real?: boolean) => Element;
2499 getEnd: (real?: boolean) => Element;
2500 getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[];
2501 normalize: () => Range;
2502 selectorChanged: (selector: string, callback: (active: boolean, args: {
2503 node: Node;
2504 selector: String;
2505 parents: Node[];
2506 }) => void) => EditorSelection;
2507 selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
2508 node: Node;
2509 selector: String;
2510 parents: Node[];
2511 }) => void) => {
2512 unbind: () => void;
2513 };
2514 getScrollContainer: () => HTMLElement | undefined;
2515 scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
2516 placeCaretAt: (clientX: number, clientY: number) => void;
2517 getBoundingClientRect: () => ClientRect | DOMRect;
2518 destroy: () => void;
2519 expand: (options?: {
2520 type: 'word';
2521 }) => void;
2522}
2523type EditorCommandCallback<S> = (this: S, ui: boolean, value: any) => void;
2524type EditorCommandsCallback = (command: string, ui: boolean, value?: any) => void;
2525interface Commands {
2526 state: Record<string, (command: string) => boolean>;
2527 exec: Record<string, EditorCommandsCallback>;
2528 value: Record<string, (command: string) => string>;
2529}
2530interface ExecCommandArgs {
2531 skip_focus?: boolean;
2532}
2533interface EditorCommandsConstructor {
2534 readonly prototype: EditorCommands;
2535 new (editor: Editor): EditorCommands;
2536}
2537declare class EditorCommands {
2538 private readonly editor;
2539 private commands;
2540 constructor(editor: Editor);
2541 execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
2542 queryCommandState(command: string): boolean;
2543 queryCommandValue(command: string): string;
2544 addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
2545 addCommands(commandList: Record<string, EditorCommandsCallback>): void;
2546 addCommand<S>(command: string, callback: EditorCommandCallback<S>, scope: S): void;
2547 addCommand(command: string, callback: EditorCommandCallback<Editor>): void;
2548 queryCommandSupported(command: string): boolean;
2549 addQueryStateHandler<S>(command: string, callback: (this: S) => boolean, scope: S): void;
2550 addQueryStateHandler(command: string, callback: (this: Editor) => boolean): void;
2551 addQueryValueHandler<S>(command: string, callback: (this: S) => string, scope: S): void;
2552 addQueryValueHandler(command: string, callback: (this: Editor) => string): void;
2553}
2554interface RawString {
2555 raw: string;
2556}
2557type Primitive = string | number | boolean | Record<string | number, any> | Function;
2558type TokenisedString = [
2559 string,
2560 ...Primitive[]
2561];
2562type Untranslated = Primitive | TokenisedString | RawString | null | undefined;
2563type TranslatedString = string;
2564interface I18n {
2565 getData: () => Record<string, Record<string, string>>;
2566 setCode: (newCode: string) => void;
2567 getCode: () => string;
2568 add: (code: string, items: Record<string, string>) => void;
2569 translate: (text: Untranslated) => TranslatedString;
2570 isRtl: () => boolean;
2571 hasCode: (code: string) => boolean;
2572}
2573interface Observable<T extends {}> {
2574 fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2575 dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2576 on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
2577 off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
2578 once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
2579 hasEventListeners(name: string): boolean;
2580}
2581interface URISettings {
2582 base_uri?: URI;
2583}
2584interface URIConstructor {
2585 readonly prototype: URI;
2586 new (url: string, settings?: URISettings): URI;
2587 getDocumentBaseUrl: (loc: {
2588 protocol: string;
2589 host?: string;
2590 href?: string;
2591 pathname?: string;
2592 }) => string;
2593 parseDataUri: (uri: string) => {
2594 type: string;
2595 data: string;
2596 };
2597}
2598interface SafeUriOptions {
2599 readonly allow_html_data_urls?: boolean;
2600 readonly allow_script_urls?: boolean;
2601 readonly allow_svg_data_urls?: boolean;
2602}
2603declare class URI {
2604 static parseDataUri(uri: string): {
2605 type: string | undefined;
2606 data: string;
2607 };
2608 static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean;
2609 static getDocumentBaseUrl(loc: {
2610 protocol: string;
2611 host?: string;
2612 href?: string;
2613 pathname?: string;
2614 }): string;
2615 source: string;
2616 protocol: string | undefined;
2617 authority: string | undefined;
2618 userInfo: string | undefined;
2619 user: string | undefined;
2620 password: string | undefined;
2621 host: string | undefined;
2622 port: string | undefined;
2623 relative: string | undefined;
2624 path: string;
2625 directory: string;
2626 file: string | undefined;
2627 query: string | undefined;
2628 anchor: string | undefined;
2629 settings: URISettings;
2630 constructor(url: string, settings?: URISettings);
2631 setPath(path: string): void;
2632 toRelative(uri: string): string;
2633 toAbsolute(uri: string, noHost?: boolean): string;
2634 isSameOrigin(uri: URI): boolean;
2635 toRelPath(base: string, path: string): string;
2636 toAbsPath(base: string, path: string): string;
2637 getURI(noProtoHost?: boolean): string;
2638}
2639interface EditorManager extends Observable<EditorManagerEventMap> {
2640 defaultOptions: RawEditorOptions;
2641 majorVersion: string;
2642 minorVersion: string;
2643 releaseDate: string;
2644 activeEditor: Editor | null;
2645 focusedEditor: Editor | null;
2646 baseURI: URI;
2647 baseURL: string;
2648 documentBaseURL: string;
2649 i18n: I18n;
2650 suffix: string;
2651 add(this: EditorManager, editor: Editor): Editor;
2652 addI18n: (code: string, item: Record<string, string>) => void;
2653 createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor;
2654 execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
2655 get(this: EditorManager): Editor[];
2656 get(this: EditorManager, id: number | string): Editor | null;
2657 init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>;
2658 overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void;
2659 remove(this: EditorManager): void;
2660 remove(this: EditorManager, selector: string): void;
2661 remove(this: EditorManager, editor: Editor): Editor | null;
2662 setActive(this: EditorManager, editor: Editor): void;
2663 setup(this: EditorManager): void;
2664 translate: (text: Untranslated) => TranslatedString;
2665 triggerSave: () => void;
2666 _setBaseUrl(this: EditorManager, baseUrl: string): void;
2667}
2668interface EditorObservable extends Observable<EditorEventMap> {
2669 bindPendingEventDelegates(this: Editor): void;
2670 toggleNativeEvent(this: Editor, name: string, state: boolean): void;
2671 unbindAllNativeEvents(this: Editor): void;
2672}
2673interface ProcessorSuccess<T> {
2674 valid: true;
2675 value: T;
2676}
2677interface ProcessorError {
2678 valid: false;
2679 message: string;
2680}
2681type SimpleProcessor = (value: unknown) => boolean;
2682type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError;
2683interface BuiltInOptionTypeMap {
2684 'string': string;
2685 'number': number;
2686 'boolean': boolean;
2687 'array': any[];
2688 'function': Function;
2689 'object': any;
2690 'string[]': string[];
2691 'object[]': any[];
2692 'regexp': RegExp;
2693}
2694type BuiltInOptionType = keyof BuiltInOptionTypeMap;
2695interface BaseOptionSpec {
2696 immutable?: boolean;
2697 deprecated?: boolean;
2698 docsUrl?: string;
2699}
2700interface BuiltInOptionSpec<K extends BuiltInOptionType> extends BaseOptionSpec {
2701 processor: K;
2702 default?: BuiltInOptionTypeMap[K];
2703}
2704interface SimpleOptionSpec<T> extends BaseOptionSpec {
2705 processor: SimpleProcessor;
2706 default?: T;
2707}
2708interface OptionSpec<T, U> extends BaseOptionSpec {
2709 processor: Processor<U>;
2710 default?: T;
2711}
2712interface Options {
2713 register: {
2714 <K extends BuiltInOptionType>(name: string, spec: BuiltInOptionSpec<K>): void;
2715 <K extends keyof NormalizedEditorOptions>(name: K, spec: OptionSpec<NormalizedEditorOptions[K], EditorOptions[K]> | SimpleOptionSpec<NormalizedEditorOptions[K]>): void;
2716 <T, U>(name: string, spec: OptionSpec<T, U>): void;
2717 <T>(name: string, spec: SimpleOptionSpec<T>): void;
2718 };
2719 isRegistered: (name: string) => boolean;
2720 get: {
2721 <K extends keyof EditorOptions>(name: K): EditorOptions[K];
2722 <T>(name: string): T | undefined;
2723 };
2724 set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean;
2725 unset: (name: string) => boolean;
2726 isSet: (name: string) => boolean;
2727 debug: () => void;
2728}
2729interface UploadResult$1 {
2730 element: HTMLImageElement;
2731 status: boolean;
2732 blobInfo: BlobInfo;
2733 uploadUri: string;
2734 removed: boolean;
2735}
2736interface EditorUpload {
2737 blobCache: BlobCache;
2738 addFilter: (filter: (img: HTMLImageElement) => boolean) => void;
2739 uploadImages: () => Promise<UploadResult$1[]>;
2740 uploadImagesAuto: () => Promise<UploadResult$1[]>;
2741 scanForImages: () => Promise<BlobInfoImagePair[]>;
2742 destroy: () => void;
2743}
2744type FormatChangeCallback = (state: boolean, data: {
2745 node: Node;
2746 format: string;
2747 parents: Element[];
2748}) => void;
2749interface FormatRegistry {
2750 get: {
2751 (name: string): Format[] | undefined;
2752 (): Record<string, Format[]>;
2753 };
2754 has: (name: string) => boolean;
2755 register: (name: string | Formats, format?: Format[] | Format) => void;
2756 unregister: (name: string) => Formats;
2757}
2758interface Formatter extends FormatRegistry {
2759 apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
2760 remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void;
2761 toggle: (name: string, vars?: FormatVars, node?: Node) => void;
2762 match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean;
2763 closest: (names: string[]) => string | null;
2764 matchAll: (names: string[], vars?: FormatVars) => string[];
2765 matchNode: (node: Node | null, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
2766 canApply: (name: string) => boolean;
2767 formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => {
2768 unbind: () => void;
2769 };
2770 getCssText: (format: string | ApplyFormat) => string;
2771}
2772interface EditorMode {
2773 isReadOnly: () => boolean;
2774 set: (mode: string) => void;
2775 get: () => string;
2776 register: (mode: string, api: EditorModeApi) => void;
2777}
2778interface EditorModeApi {
2779 activate: () => void;
2780 deactivate: () => void;
2781 editorReadOnly: boolean;
2782}
2783interface Model {
2784 readonly table: {
2785 readonly getSelectedCells: () => HTMLTableCellElement[];
2786 readonly clearSelectedCells: (container: Node) => void;
2787 };
2788}
2789type ModelManager = AddOnManager<Model>;
2790interface Plugin {
2791 getMetadata?: () => {
2792 name: string;
2793 url: string;
2794 };
2795 init?: (editor: Editor, url: string) => void;
2796 [key: string]: any;
2797}
2798type PluginManager = AddOnManager<void | Plugin>;
2799interface ShortcutsConstructor {
2800 readonly prototype: Shortcuts;
2801 new (editor: Editor): Shortcuts;
2802}
2803type CommandFunc = string | [
2804 string,
2805 boolean,
2806 any
2807] | (() => void);
2808declare class Shortcuts {
2809 private readonly editor;
2810 private readonly shortcuts;
2811 private pendingPatterns;
2812 constructor(editor: Editor);
2813 add(pattern: string, desc: string | null, cmdFunc: CommandFunc, scope?: any): boolean;
2814 remove(pattern: string): boolean;
2815 private normalizeCommandFunc;
2816 private createShortcut;
2817 private hasModifier;
2818 private isFunctionKey;
2819 private matchShortcut;
2820 private executeShortcutAction;
2821}
2822interface RenderResult {
2823 iframeContainer?: HTMLElement;
2824 editorContainer: HTMLElement;
2825 api?: Partial<EditorUiApi>;
2826}
2827interface Theme {
2828 ui?: any;
2829 inline?: any;
2830 execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
2831 destroy?: () => void;
2832 init?: (editor: Editor, url: string) => void;
2833 renderUI?: () => Promise<RenderResult> | RenderResult;
2834 getNotificationManagerImpl?: () => NotificationManagerImpl;
2835 getWindowManagerImpl?: () => WindowManagerImpl;
2836}
2837type ThemeManager = AddOnManager<void | Theme>;
2838interface EditorConstructor {
2839 readonly prototype: Editor;
2840 new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor;
2841}
2842declare class Editor implements EditorObservable {
2843 documentBaseUrl: string;
2844 baseUri: URI;
2845 id: string;
2846 plugins: Record<string, Plugin>;
2847 documentBaseURI: URI;
2848 baseURI: URI;
2849 contentCSS: string[];
2850 contentStyles: string[];
2851 ui: EditorUi;
2852 mode: EditorMode;
2853 options: Options;
2854 editorUpload: EditorUpload;
2855 shortcuts: Shortcuts;
2856 loadedCSS: Record<string, any>;
2857 editorCommands: EditorCommands;
2858 suffix: string;
2859 editorManager: EditorManager;
2860 hidden: boolean;
2861 inline: boolean;
2862 hasVisual: boolean;
2863 isNotDirty: boolean;
2864 annotator: Annotator;
2865 bodyElement: HTMLElement | undefined;
2866 bookmark: any;
2867 composing: boolean;
2868 container: HTMLElement;
2869 contentAreaContainer: HTMLElement;
2870 contentDocument: Document;
2871 contentWindow: Window;
2872 delegates: Record<string, EventUtilsCallback<any>> | undefined;
2873 destroyed: boolean;
2874 dom: DOMUtils;
2875 editorContainer: HTMLElement;
2876 eventRoot: Element | undefined;
2877 formatter: Formatter;
2878 formElement: HTMLElement | undefined;
2879 formEventDelegate: ((e: Event) => void) | undefined;
2880 hasHiddenInput: boolean;
2881 iframeElement: HTMLIFrameElement | null;
2882 iframeHTML: string | undefined;
2883 initialized: boolean;
2884 notificationManager: NotificationManager;
2885 orgDisplay: string;
2886 orgVisibility: string | undefined;
2887 parser: DomParser;
2888 quirks: Quirks;
2889 readonly: boolean;
2890 removed: boolean;
2891 schema: Schema;
2892 selection: EditorSelection;
2893 serializer: DomSerializer;
2894 startContent: string;
2895 targetElm: HTMLElement;
2896 theme: Theme;
2897 model: Model;
2898 undoManager: UndoManager;
2899 windowManager: WindowManager;
2900 _beforeUnload: (() => void) | undefined;
2901 _eventDispatcher: EventDispatcher<NativeEventMap> | undefined;
2902 _nodeChangeDispatcher: NodeChange;
2903 _pendingNativeEvents: string[];
2904 _selectionOverrides: SelectionOverrides;
2905 _skinLoaded: boolean;
2906 _editableRoot: boolean;
2907 bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates'];
2908 toggleNativeEvent: EditorObservable['toggleNativeEvent'];
2909 unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents'];
2910 fire: EditorObservable['fire'];
2911 dispatch: EditorObservable['dispatch'];
2912 on: EditorObservable['on'];
2913 off: EditorObservable['off'];
2914 once: EditorObservable['once'];
2915 hasEventListeners: EditorObservable['hasEventListeners'];
2916 constructor(id: string, options: RawEditorOptions, editorManager: EditorManager);
2917 render(): void;
2918 focus(skipFocus?: boolean): void;
2919 hasFocus(): boolean;
2920 translate(text: Untranslated): TranslatedString;
2921 getParam<K extends BuiltInOptionType>(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K];
2922 getParam<K extends keyof NormalizedEditorOptions>(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K];
2923 getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T;
2924 hasPlugin(name: string, loaded?: boolean): boolean;
2925 nodeChanged(args?: any): void;
2926 addCommand<S>(name: string, callback: EditorCommandCallback<S>, scope: S): void;
2927 addCommand(name: string, callback: EditorCommandCallback<Editor>): void;
2928 addQueryStateHandler<S>(name: string, callback: (this: S) => boolean, scope?: S): void;
2929 addQueryStateHandler(name: string, callback: (this: Editor) => boolean): void;
2930 addQueryValueHandler<S>(name: string, callback: (this: S) => string, scope: S): void;
2931 addQueryValueHandler(name: string, callback: (this: Editor) => string): void;
2932 addShortcut(pattern: string, desc: string, cmdFunc: string | [
2933 string,
2934 boolean,
2935 any
2936 ] | (() => void), scope?: any): void;
2937 execCommand(cmd: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
2938 queryCommandState(cmd: string): boolean;
2939 queryCommandValue(cmd: string): string;
2940 queryCommandSupported(cmd: string): boolean;
2941 show(): void;
2942 hide(): void;
2943 isHidden(): boolean;
2944 setProgressState(state: boolean, time?: number): void;
2945 load(args?: Partial<SetContentArgs>): string;
2946 save(args?: Partial<GetContentArgs>): string;
2947 setContent(content: string, args?: Partial<SetContentArgs>): string;
2948 setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode;
2949 setContent(content: Content, args?: Partial<SetContentArgs>): Content;
2950 getContent(args: {
2951 format: 'tree';
2952 } & Partial<GetContentArgs>): AstNode;
2953 getContent(args?: Partial<GetContentArgs>): string;
2954 insertContent(content: string, args?: any): void;
2955 resetContent(initialContent?: string): void;
2956 isDirty(): boolean;
2957 setDirty(state: boolean): void;
2958 getContainer(): HTMLElement;
2959 getContentAreaContainer(): HTMLElement;
2960 getElement(): HTMLElement;
2961 getWin(): Window;
2962 getDoc(): Document;
2963 getBody(): HTMLElement;
2964 convertURL(url: string, name: string, elm?: string | Element): string;
2965 addVisual(elm?: HTMLElement): void;
2966 setEditableRoot(state: boolean): void;
2967 hasEditableRoot(): boolean;
2968 remove(): void;
2969 destroy(automatic?: boolean): void;
2970 uploadImages(): Promise<UploadResult$1[]>;
2971 _scanForImages(): Promise<BlobInfoImagePair[]>;
2972}
2973interface UrlObject {
2974 prefix: string;
2975 resource: string;
2976 suffix: string;
2977}
2978type WaitState = 'added' | 'loaded';
2979type AddOnConstructor<T> = (editor: Editor, url: string) => T;
2980interface AddOnManager<T> {
2981 items: AddOnConstructor<T>[];
2982 urls: Record<string, string>;
2983 lookup: Record<string, {
2984 instance: AddOnConstructor<T>;
2985 }>;
2986 get: (name: string) => AddOnConstructor<T> | undefined;
2987 requireLangPack: (name: string, languages?: string) => void;
2988 add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
2989 remove: (name: string) => void;
2990 createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
2991 load: (name: string, addOnUrl: string | UrlObject) => Promise<void>;
2992 waitFor: (name: string, state?: WaitState) => Promise<void>;
2993}
2994interface RangeUtils {
2995 walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
2996 split: (rng: Range) => RangeLikeObject;
2997 normalize: (rng: Range) => boolean;
2998 expand: (rng: Range, options?: {
2999 type: 'word';
3000 }) => Range;
3001}
3002interface ScriptLoaderSettings {
3003 referrerPolicy?: ReferrerPolicy;
3004}
3005interface ScriptLoaderConstructor {
3006 readonly prototype: ScriptLoader;
3007 new (): ScriptLoader;
3008 ScriptLoader: ScriptLoader;
3009}
3010declare class ScriptLoader {
3011 static ScriptLoader: ScriptLoader;
3012 private settings;
3013 private states;
3014 private queue;
3015 private scriptLoadedCallbacks;
3016 private queueLoadedCallbacks;
3017 private loading;
3018 constructor(settings?: ScriptLoaderSettings);
3019 _setReferrerPolicy(referrerPolicy: ReferrerPolicy): void;
3020 loadScript(url: string): Promise<void>;
3021 isDone(url: string): boolean;
3022 markDone(url: string): void;
3023 add(url: string): Promise<void>;
3024 load(url: string): Promise<void>;
3025 remove(url: string): void;
3026 loadQueue(): Promise<void>;
3027 loadScripts(scripts: string[]): Promise<void>;
3028}
3029type TextProcessCallback = (node: Text, offset: number, text: string) => number;
3030interface Spot {
3031 container: Text;
3032 offset: number;
3033}
3034interface TextSeeker {
3035 backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
3036 forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
3037}
3038interface DomTreeWalkerConstructor {
3039 readonly prototype: DomTreeWalker;
3040 new (startNode: Node, rootNode: Node): DomTreeWalker;
3041}
3042declare class DomTreeWalker {
3043 private readonly rootNode;
3044 private node;
3045 constructor(startNode: Node, rootNode: Node);
3046 current(): Node | null | undefined;
3047 next(shallow?: boolean): Node | null | undefined;
3048 prev(shallow?: boolean): Node | null | undefined;
3049 prev2(shallow?: boolean): Node | null | undefined;
3050 private findSibling;
3051 private findPreviousNode;
3052}
3053interface Version {
3054 major: number;
3055 minor: number;
3056}
3057interface Env {
3058 transparentSrc: string;
3059 documentMode: number;
3060 cacheSuffix: any;
3061 container: any;
3062 canHaveCSP: boolean;
3063 windowsPhone: boolean;
3064 browser: {
3065 current: string | undefined;
3066 version: Version;
3067 isEdge: () => boolean;
3068 isChromium: () => boolean;
3069 isIE: () => boolean;
3070 isOpera: () => boolean;
3071 isFirefox: () => boolean;
3072 isSafari: () => boolean;
3073 };
3074 os: {
3075 current: string | undefined;
3076 version: Version;
3077 isWindows: () => boolean;
3078 isiOS: () => boolean;
3079 isAndroid: () => boolean;
3080 isMacOS: () => boolean;
3081 isLinux: () => boolean;
3082 isSolaris: () => boolean;
3083 isFreeBSD: () => boolean;
3084 isChromeOS: () => boolean;
3085 };
3086 deviceType: {
3087 isiPad: () => boolean;
3088 isiPhone: () => boolean;
3089 isTablet: () => boolean;
3090 isPhone: () => boolean;
3091 isTouch: () => boolean;
3092 isWebView: () => boolean;
3093 isDesktop: () => boolean;
3094 };
3095}
3096interface FakeClipboardItem {
3097 readonly items: Record<string, any>;
3098 readonly types: ReadonlyArray<string>;
3099 readonly getType: <D = any>(type: string) => D | undefined;
3100}
3101interface FakeClipboard {
3102 readonly FakeClipboardItem: (items: Record<string, any>) => FakeClipboardItem;
3103 readonly write: (data: FakeClipboardItem[]) => void;
3104 readonly read: () => FakeClipboardItem[] | undefined;
3105 readonly clear: () => void;
3106}
3107interface FocusManager {
3108 isEditorUIElement: (elm: Element) => boolean;
3109}
3110interface EntitiesMap {
3111 [name: string]: string;
3112}
3113interface Entities {
3114 encodeRaw: (text: string, attr?: boolean) => string;
3115 encodeAllRaw: (text: string) => string;
3116 encodeNumeric: (text: string, attr?: boolean) => string;
3117 encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string;
3118 getEncodeFunc: (name: string, entities?: string) => (text: string, attr?: boolean) => string;
3119 decode: (text: string) => string;
3120}
3121interface IconPack {
3122 icons: Record<string, string>;
3123}
3124interface IconManager {
3125 add: (id: string, iconPack: IconPack) => void;
3126 get: (id: string) => IconPack;
3127 has: (id: string) => boolean;
3128}
3129interface Resource {
3130 load: <T = any>(id: string, url: string) => Promise<T>;
3131 add: (id: string, data: any) => void;
3132 has: (id: string) => boolean;
3133 get: (id: string) => any;
3134 unload: (id: string) => void;
3135}
3136type TextPatterns_d_Pattern = Pattern;
3137type TextPatterns_d_RawPattern = RawPattern;
3138type TextPatterns_d_DynamicPatternsLookup = DynamicPatternsLookup;
3139type TextPatterns_d_RawDynamicPatternsLookup = RawDynamicPatternsLookup;
3140type TextPatterns_d_DynamicPatternContext = DynamicPatternContext;
3141type TextPatterns_d_BlockCmdPattern = BlockCmdPattern;
3142type TextPatterns_d_BlockPattern = BlockPattern;
3143type TextPatterns_d_BlockFormatPattern = BlockFormatPattern;
3144type TextPatterns_d_InlineCmdPattern = InlineCmdPattern;
3145type TextPatterns_d_InlinePattern = InlinePattern;
3146type TextPatterns_d_InlineFormatPattern = InlineFormatPattern;
3147declare namespace TextPatterns_d {
3148 export { TextPatterns_d_Pattern as Pattern, TextPatterns_d_RawPattern as RawPattern, TextPatterns_d_DynamicPatternsLookup as DynamicPatternsLookup, TextPatterns_d_RawDynamicPatternsLookup as RawDynamicPatternsLookup, TextPatterns_d_DynamicPatternContext as DynamicPatternContext, TextPatterns_d_BlockCmdPattern as BlockCmdPattern, TextPatterns_d_BlockPattern as BlockPattern, TextPatterns_d_BlockFormatPattern as BlockFormatPattern, TextPatterns_d_InlineCmdPattern as InlineCmdPattern, TextPatterns_d_InlinePattern as InlinePattern, TextPatterns_d_InlineFormatPattern as InlineFormatPattern, };
3149}
3150interface Delay {
3151 setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
3152 setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
3153}
3154type UploadResult = UploadResult$2;
3155interface ImageUploader {
3156 upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
3157}
3158type ArrayCallback$1<T, R> = (this: any, x: T, i: number, xs: ArrayLike<T>) => R;
3159type ObjCallback$1<T, R> = (this: any, value: T, key: string, obj: Record<string, T>) => R;
3160type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
3161type ObjCallback<T, R> = ObjCallback$1<T, R>;
3162type WalkCallback<T> = (this: any, o: T, i: string, n: keyof T | undefined) => boolean | void;
3163interface Tools {
3164 is: (obj: any, type?: string) => boolean;
3165 isArray: <T>(arr: any) => arr is Array<T>;
3166 inArray: <T>(arr: ArrayLike<T>, value: T) => number;
3167 grep: {
3168 <T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[];
3169 <T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[];
3170 };
3171 trim: (str: string | null | undefined) => string;
3172 toArray: <T>(obj: ArrayLike<T>) => T[];
3173 hasOwn: (obj: any, name: string) => boolean;
3174 makeMap: (items: ArrayLike<string> | string | undefined, delim?: string | RegExp, map?: Record<string, {}>) => Record<string, {}>;
3175 each: {
3176 <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
3177 <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
3178 };
3179 map: {
3180 <T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[];
3181 <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
3182 };
3183 extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
3184 walk: <T extends Record<string, any>>(obj: T, f: WalkCallback<T>, n?: keyof T, scope?: any) => void;
3185 resolve: (path: string, o?: Object) => any;
3186 explode: (s: string | string[], d?: string | RegExp) => string[];
3187 _addCacheSuffix: (url: string) => string;
3188}
3189interface KeyboardLikeEvent {
3190 shiftKey: boolean;
3191 ctrlKey: boolean;
3192 altKey: boolean;
3193 metaKey: boolean;
3194}
3195interface VK {
3196 BACKSPACE: number;
3197 DELETE: number;
3198 DOWN: number;
3199 ENTER: number;
3200 ESC: number;
3201 LEFT: number;
3202 RIGHT: number;
3203 SPACEBAR: number;
3204 TAB: number;
3205 UP: number;
3206 PAGE_UP: number;
3207 PAGE_DOWN: number;
3208 END: number;
3209 HOME: number;
3210 modifierPressed: (e: KeyboardLikeEvent) => boolean;
3211 metaKeyPressed: (e: KeyboardLikeEvent) => boolean;
3212}
3213interface DOMUtilsNamespace {
3214 (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils;
3215 DOM: DOMUtils;
3216 nodeIndex: (node: Node, normalized?: boolean) => number;
3217}
3218interface RangeUtilsNamespace {
3219 (dom: DOMUtils): RangeUtils;
3220 compareRanges: (rng1: RangeLikeObject, rng2: RangeLikeObject) => boolean;
3221 getCaretRangeFromPoint: (clientX: number, clientY: number, doc: Document) => Range;
3222 getSelectedNode: (range: Range) => Node;
3223 getNode: (container: Node, offset: number) => Node;
3224}
3225interface AddOnManagerNamespace {
3226 <T>(): AddOnManager<T>;
3227 language: string | undefined;
3228 languageLoad: boolean;
3229 baseURL: string;
3230 PluginManager: PluginManager;
3231 ThemeManager: ThemeManager;
3232 ModelManager: ModelManager;
3233}
3234interface BookmarkManagerNamespace {
3235 (selection: EditorSelection): BookmarkManager;
3236 isBookmarkNode: (node: Node) => boolean;
3237}
3238interface TinyMCE extends EditorManager {
3239 geom: {
3240 Rect: Rect;
3241 };
3242 util: {
3243 Delay: Delay;
3244 Tools: Tools;
3245 VK: VK;
3246 URI: URIConstructor;
3247 EventDispatcher: EventDispatcherConstructor<any>;
3248 Observable: Observable<any>;
3249 I18n: I18n;
3250 LocalStorage: Storage;
3251 ImageUploader: ImageUploader;
3252 };
3253 dom: {
3254 EventUtils: EventUtilsConstructor;
3255 TreeWalker: DomTreeWalkerConstructor;
3256 TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker;
3257 DOMUtils: DOMUtilsNamespace;
3258 ScriptLoader: ScriptLoaderConstructor;
3259 RangeUtils: RangeUtilsNamespace;
3260 Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer;
3261 ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection;
3262 BookmarkManager: BookmarkManagerNamespace;
3263 Selection: (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection;
3264 StyleSheetLoader: (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader;
3265 Event: EventUtils;
3266 };
3267 html: {
3268 Styles: (settings?: StylesSettings, schema?: Schema) => Styles;
3269 Entities: Entities;
3270 Node: AstNodeConstructor;
3271 Schema: (settings?: SchemaSettings) => Schema;
3272 DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser;
3273 Writer: (settings?: WriterSettings) => Writer;
3274 Serializer: (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer;
3275 };
3276 AddOnManager: AddOnManagerNamespace;
3277 Annotator: (editor: Editor) => Annotator;
3278 Editor: EditorConstructor;
3279 EditorCommands: EditorCommandsConstructor;
3280 EditorManager: EditorManager;
3281 EditorObservable: EditorObservable;
3282 Env: Env;
3283 FocusManager: FocusManager;
3284 Formatter: (editor: Editor) => Formatter;
3285 NotificationManager: (editor: Editor) => NotificationManager;
3286 Shortcuts: ShortcutsConstructor;
3287 UndoManager: (editor: Editor) => UndoManager;
3288 WindowManager: (editor: Editor) => WindowManager;
3289 DOM: DOMUtils;
3290 ScriptLoader: ScriptLoader;
3291 PluginManager: PluginManager;
3292 ThemeManager: ThemeManager;
3293 ModelManager: ModelManager;
3294 IconManager: IconManager;
3295 Resource: Resource;
3296 FakeClipboard: FakeClipboard;
3297 trim: Tools['trim'];
3298 isArray: Tools['isArray'];
3299 is: Tools['is'];
3300 toArray: Tools['toArray'];
3301 makeMap: Tools['makeMap'];
3302 each: Tools['each'];
3303 map: Tools['map'];
3304 grep: Tools['grep'];
3305 inArray: Tools['inArray'];
3306 extend: Tools['extend'];
3307 walk: Tools['walk'];
3308 resolve: Tools['resolve'];
3309 explode: Tools['explode'];
3310 _addCacheSuffix: Tools['_addCacheSuffix'];
3311}
3312declare const tinymce: TinyMCE;
3313export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextPatterns_d as TextPatterns, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };