| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface StringPathBookmark { | 
					
						
							|  |  |  |     start: string; | 
					
						
							|  |  |  |     end?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forward?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface RangeBookmark { | 
					
						
							|  |  |  |     rng: Range; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forward?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface IdBookmark { | 
					
						
							|  |  |  |     id: string; | 
					
						
							|  |  |  |     keep?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forward?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface IndexBookmark { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     index: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PathBookmark { | 
					
						
							|  |  |  |     start: number[]; | 
					
						
							|  |  |  |     end?: number[]; | 
					
						
							|  |  |  |     isFakeCaret?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forward?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark; | 
					
						
							|  |  |  | type NormalizedEvent<E, T = any> = E & { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     readonly type: string; | 
					
						
							|  |  |  |     readonly target: T; | 
					
						
							|  |  |  |     readonly isDefaultPrevented: () => boolean; | 
					
						
							|  |  |  |     readonly preventDefault: () => void; | 
					
						
							|  |  |  |     readonly isPropagationStopped: () => boolean; | 
					
						
							|  |  |  |     readonly stopPropagation: () => void; | 
					
						
							|  |  |  |     readonly isImmediatePropagationStopped: () => boolean; | 
					
						
							|  |  |  |     readonly stopImmediatePropagation: () => void; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type MappedEvent<T extends {}, K extends string> = K extends keyof T ? T[K] : any; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface NativeEventMap { | 
					
						
							|  |  |  |     'beforepaste': Event; | 
					
						
							|  |  |  |     'blur': FocusEvent; | 
					
						
							|  |  |  |     'beforeinput': InputEvent; | 
					
						
							|  |  |  |     'click': MouseEvent; | 
					
						
							|  |  |  |     'compositionend': Event; | 
					
						
							|  |  |  |     'compositionstart': Event; | 
					
						
							|  |  |  |     'compositionupdate': Event; | 
					
						
							|  |  |  |     'contextmenu': PointerEvent; | 
					
						
							|  |  |  |     'copy': ClipboardEvent; | 
					
						
							|  |  |  |     'cut': ClipboardEvent; | 
					
						
							|  |  |  |     'dblclick': MouseEvent; | 
					
						
							|  |  |  |     'drag': DragEvent; | 
					
						
							|  |  |  |     'dragdrop': DragEvent; | 
					
						
							|  |  |  |     'dragend': DragEvent; | 
					
						
							|  |  |  |     'draggesture': DragEvent; | 
					
						
							|  |  |  |     'dragover': DragEvent; | 
					
						
							|  |  |  |     'dragstart': DragEvent; | 
					
						
							|  |  |  |     'drop': DragEvent; | 
					
						
							|  |  |  |     'focus': FocusEvent; | 
					
						
							|  |  |  |     'focusin': FocusEvent; | 
					
						
							|  |  |  |     'focusout': FocusEvent; | 
					
						
							|  |  |  |     'input': InputEvent; | 
					
						
							|  |  |  |     'keydown': KeyboardEvent; | 
					
						
							|  |  |  |     'keypress': KeyboardEvent; | 
					
						
							|  |  |  |     'keyup': KeyboardEvent; | 
					
						
							|  |  |  |     'mousedown': MouseEvent; | 
					
						
							|  |  |  |     'mouseenter': MouseEvent; | 
					
						
							|  |  |  |     'mouseleave': MouseEvent; | 
					
						
							|  |  |  |     'mousemove': MouseEvent; | 
					
						
							|  |  |  |     'mouseout': MouseEvent; | 
					
						
							|  |  |  |     'mouseover': MouseEvent; | 
					
						
							|  |  |  |     'mouseup': MouseEvent; | 
					
						
							|  |  |  |     'paste': ClipboardEvent; | 
					
						
							|  |  |  |     'selectionchange': Event; | 
					
						
							|  |  |  |     'submit': Event; | 
					
						
							|  |  |  |     'touchend': TouchEvent; | 
					
						
							|  |  |  |     'touchmove': TouchEvent; | 
					
						
							|  |  |  |     'touchstart': TouchEvent; | 
					
						
							|  |  |  |     'touchcancel': TouchEvent; | 
					
						
							|  |  |  |     'wheel': WheelEvent; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type EditorEvent<T> = NormalizedEvent<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface EventDispatcherSettings { | 
					
						
							|  |  |  |     scope?: any; | 
					
						
							|  |  |  |     toggleEvent?: (name: string, state: boolean) => void | boolean; | 
					
						
							|  |  |  |     beforeFire?: <T>(args: EditorEvent<T>) => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface EventDispatcherConstructor<T extends {}> { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     readonly prototype: EventDispatcher<T>; | 
					
						
							|  |  |  |     new (settings?: EventDispatcherSettings): EventDispatcher<T>; | 
					
						
							|  |  |  |     isNative: (name: string) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | declare class EventDispatcher<T extends {}> { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     static isNative(name: string): boolean; | 
					
						
							|  |  |  |     private readonly settings; | 
					
						
							|  |  |  |     private readonly scope; | 
					
						
							|  |  |  |     private readonly toggleEvent; | 
					
						
							|  |  |  |     private bindings; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     constructor(settings?: EventDispatcherSettings); | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void | boolean), prepend?: boolean, extra?: {}): this; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this; | 
					
						
							|  |  |  |     once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this; | 
					
						
							|  |  |  |     has(name: string): boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare const enum UndoLevelType { | 
					
						
							|  |  |  |     Fragmented = "fragmented", | 
					
						
							|  |  |  |     Complete = "complete" | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface BaseUndoLevel { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     type: UndoLevelType; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     bookmark: Bookmark | null; | 
					
						
							|  |  |  |     beforeBookmark: Bookmark | null; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FragmentedUndoLevel extends BaseUndoLevel { | 
					
						
							|  |  |  |     type: UndoLevelType.Fragmented; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     fragments: string[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     content: ''; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CompleteUndoLevel extends BaseUndoLevel { | 
					
						
							|  |  |  |     type: UndoLevelType.Complete; | 
					
						
							|  |  |  |     fragments: null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     content: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel; | 
					
						
							|  |  |  | type UndoLevel = NewUndoLevel & { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     bookmark: Bookmark; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface UndoManager { | 
					
						
							|  |  |  |     data: UndoLevel[]; | 
					
						
							|  |  |  |     typing: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     dispatchChange: () => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     beforeChange: () => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     undo: () => UndoLevel | undefined; | 
					
						
							|  |  |  |     redo: () => UndoLevel | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     clear: () => void; | 
					
						
							|  |  |  |     reset: () => void; | 
					
						
							|  |  |  |     hasUndo: () => boolean; | 
					
						
							|  |  |  |     hasRedo: () => boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     transact: (callback: () => void) => UndoLevel | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     ignore: (callback: () => void) => void; | 
					
						
							|  |  |  |     extra: (callback1: () => void, callback2: () => void) => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type SchemaType = 'html4' | 'html5' | 'html5-strict'; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface ElementSettings { | 
					
						
							|  |  |  |     block_elements?: string; | 
					
						
							|  |  |  |     boolean_attributes?: string; | 
					
						
							|  |  |  |     move_caret_before_on_enter_elements?: string; | 
					
						
							|  |  |  |     non_empty_elements?: string; | 
					
						
							|  |  |  |     self_closing_elements?: string; | 
					
						
							|  |  |  |     text_block_elements?: string; | 
					
						
							|  |  |  |     text_inline_elements?: string; | 
					
						
							|  |  |  |     void_elements?: string; | 
					
						
							|  |  |  |     whitespace_elements?: string; | 
					
						
							|  |  |  |     transparent_elements?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SchemaSettings extends ElementSettings { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     custom_elements?: string; | 
					
						
							|  |  |  |     extended_valid_elements?: string; | 
					
						
							|  |  |  |     invalid_elements?: string; | 
					
						
							|  |  |  |     invalid_styles?: string | Record<string, string>; | 
					
						
							|  |  |  |     schema?: SchemaType; | 
					
						
							|  |  |  |     valid_children?: string; | 
					
						
							|  |  |  |     valid_classes?: string | Record<string, string>; | 
					
						
							|  |  |  |     valid_elements?: string; | 
					
						
							|  |  |  |     valid_styles?: string | Record<string, string>; | 
					
						
							|  |  |  |     verify_html?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     padd_empty_block_inline_children?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface Attribute { | 
					
						
							|  |  |  |     required?: boolean; | 
					
						
							|  |  |  |     defaultValue?: string; | 
					
						
							|  |  |  |     forcedValue?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     validValues?: Record<string, {}>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface DefaultAttribute { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface AttributePattern extends Attribute { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     pattern: RegExp; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ElementRule { | 
					
						
							|  |  |  |     attributes: Record<string, Attribute>; | 
					
						
							|  |  |  |     attributesDefault?: DefaultAttribute[]; | 
					
						
							|  |  |  |     attributesForced?: DefaultAttribute[]; | 
					
						
							|  |  |  |     attributesOrder: string[]; | 
					
						
							|  |  |  |     attributePatterns?: AttributePattern[]; | 
					
						
							|  |  |  |     attributesRequired?: string[]; | 
					
						
							|  |  |  |     paddEmpty?: boolean; | 
					
						
							|  |  |  |     removeEmpty?: boolean; | 
					
						
							|  |  |  |     removeEmptyAttrs?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     paddInEmptyBlock?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface SchemaElement extends ElementRule { | 
					
						
							|  |  |  |     outputName?: string; | 
					
						
							|  |  |  |     parentsRequired?: string[]; | 
					
						
							|  |  |  |     pattern?: RegExp; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SchemaMap { | 
					
						
							|  |  |  |     [name: string]: {}; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SchemaRegExpMap { | 
					
						
							|  |  |  |     [name: string]: RegExp; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Schema { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     type: SchemaType; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     children: Record<string, SchemaMap>; | 
					
						
							|  |  |  |     elements: Record<string, SchemaElement>; | 
					
						
							|  |  |  |     getValidStyles: () => Record<string, string[]> | undefined; | 
					
						
							|  |  |  |     getValidClasses: () => Record<string, SchemaMap> | undefined; | 
					
						
							|  |  |  |     getBlockElements: () => SchemaMap; | 
					
						
							|  |  |  |     getInvalidStyles: () => Record<string, SchemaMap> | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     getVoidElements: () => SchemaMap; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getTextBlockElements: () => SchemaMap; | 
					
						
							|  |  |  |     getTextInlineElements: () => SchemaMap; | 
					
						
							|  |  |  |     getBoolAttrs: () => SchemaMap; | 
					
						
							|  |  |  |     getElementRule: (name: string) => SchemaElement | undefined; | 
					
						
							|  |  |  |     getSelfClosingElements: () => SchemaMap; | 
					
						
							|  |  |  |     getNonEmptyElements: () => SchemaMap; | 
					
						
							|  |  |  |     getMoveCaretBeforeOnEnterElements: () => SchemaMap; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     getWhitespaceElements: () => SchemaMap; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getTransparentElements: () => SchemaMap; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getSpecialElements: () => SchemaRegExpMap; | 
					
						
							|  |  |  |     isValidChild: (name: string, child: string) => boolean; | 
					
						
							|  |  |  |     isValid: (name: string, attr?: string) => boolean; | 
					
						
							|  |  |  |     getCustomElements: () => SchemaMap; | 
					
						
							|  |  |  |     addValidElements: (validElements: string) => void; | 
					
						
							|  |  |  |     setValidElements: (validElements: string) => void; | 
					
						
							|  |  |  |     addCustomElements: (customElements: string) => void; | 
					
						
							|  |  |  |     addValidChildren: (validChildren: any) => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Attributes$1 = Array<{ | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     name: string; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  | }> & { | 
					
						
							|  |  |  |     map: Record<string, string>; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | interface AstNodeConstructor { | 
					
						
							|  |  |  |     readonly prototype: AstNode; | 
					
						
							|  |  |  |     new (name: string, type: number): AstNode; | 
					
						
							|  |  |  |     create(name: string, attrs?: Record<string, string>): AstNode; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class AstNode { | 
					
						
							|  |  |  |     static create(name: string, attrs?: Record<string, string>): AstNode; | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     type: number; | 
					
						
							|  |  |  |     attributes?: Attributes$1; | 
					
						
							|  |  |  |     value?: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     parent?: AstNode | null; | 
					
						
							|  |  |  |     firstChild?: AstNode | null; | 
					
						
							|  |  |  |     lastChild?: AstNode | null; | 
					
						
							|  |  |  |     next?: AstNode | null; | 
					
						
							|  |  |  |     prev?: AstNode | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     raw?: boolean; | 
					
						
							|  |  |  |     constructor(name: string, type: number); | 
					
						
							|  |  |  |     replace(node: AstNode): AstNode; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     attr(name: string, value: string | null | undefined): AstNode | undefined; | 
					
						
							|  |  |  |     attr(name: Record<string, string | null | undefined> | undefined): AstNode | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     attr(name: string): string | undefined; | 
					
						
							|  |  |  |     clone(): AstNode; | 
					
						
							|  |  |  |     wrap(wrapper: AstNode): AstNode; | 
					
						
							|  |  |  |     unwrap(): void; | 
					
						
							|  |  |  |     remove(): AstNode; | 
					
						
							|  |  |  |     append(node: AstNode): AstNode; | 
					
						
							|  |  |  |     insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode; | 
					
						
							|  |  |  |     getAll(name: string): AstNode[]; | 
					
						
							|  |  |  |     children(): AstNode[]; | 
					
						
							|  |  |  |     empty(): AstNode; | 
					
						
							|  |  |  |     isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     walk(prev?: boolean): AstNode | null | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Content = string | AstNode; | 
					
						
							|  |  |  | type ContentFormat = 'raw' | 'text' | 'html' | 'tree'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface GetContentArgs { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     format: ContentFormat; | 
					
						
							|  |  |  |     get: boolean; | 
					
						
							|  |  |  |     getInner: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     no_events?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     save?: boolean; | 
					
						
							|  |  |  |     source_view?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     [key: string]: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SetContentArgs { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     format: string; | 
					
						
							|  |  |  |     set: boolean; | 
					
						
							|  |  |  |     content: Content; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     no_events?: boolean; | 
					
						
							|  |  |  |     no_selection?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     paste?: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     load?: boolean; | 
					
						
							|  |  |  |     initial?: boolean; | 
					
						
							|  |  |  |     [key: string]: any; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface GetSelectionContentArgs extends GetContentArgs { | 
					
						
							|  |  |  |     selection?: boolean; | 
					
						
							|  |  |  |     contextual?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SetSelectionContentArgs extends SetContentArgs { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  |     selection?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface BlobInfoData { | 
					
						
							|  |  |  |     id?: string; | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     filename?: string; | 
					
						
							|  |  |  |     blob: Blob; | 
					
						
							|  |  |  |     base64: string; | 
					
						
							|  |  |  |     blobUri?: string; | 
					
						
							|  |  |  |     uri?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BlobInfo { | 
					
						
							|  |  |  |     id: () => string; | 
					
						
							|  |  |  |     name: () => string; | 
					
						
							|  |  |  |     filename: () => string; | 
					
						
							|  |  |  |     blob: () => Blob; | 
					
						
							|  |  |  |     base64: () => string; | 
					
						
							|  |  |  |     blobUri: () => string; | 
					
						
							|  |  |  |     uri: () => string | undefined; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BlobCache { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     create: { | 
					
						
							|  |  |  |         (o: BlobInfoData): BlobInfo; | 
					
						
							|  |  |  |         (id: string, blob: Blob, base64: string, name?: string, filename?: string): BlobInfo; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     add: (blobInfo: BlobInfo) => void; | 
					
						
							|  |  |  |     get: (id: string) => BlobInfo | undefined; | 
					
						
							|  |  |  |     getByUri: (blobUri: string) => BlobInfo | undefined; | 
					
						
							|  |  |  |     getByData: (base64: string, type: string) => BlobInfo | undefined; | 
					
						
							|  |  |  |     findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined; | 
					
						
							|  |  |  |     removeByUri: (blobUri: string) => void; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BlobInfoImagePair { | 
					
						
							|  |  |  |     image: HTMLImageElement; | 
					
						
							|  |  |  |     blobInfo: BlobInfo; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class NodeChange { | 
					
						
							|  |  |  |     private readonly editor; | 
					
						
							|  |  |  |     private lastPath; | 
					
						
							|  |  |  |     constructor(editor: Editor); | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     nodeChanged(args?: Record<string, any>): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     private isSameElementPath; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SelectionOverrides { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null; | 
					
						
							|  |  |  |     showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     hideFakeCaret: () => void; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Quirks { | 
					
						
							|  |  |  |     refreshContentEditable(): void; | 
					
						
							|  |  |  |     isHidden(): boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type DecoratorData = Record<string, any>; | 
					
						
							|  |  |  | type Decorator = (uid: string, data: DecoratorData) => { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     attributes?: {}; | 
					
						
							|  |  |  |     classes?: string[]; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type AnnotationListener = (state: boolean, name: string, data?: { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     uid: string; | 
					
						
							|  |  |  |     nodes: any[]; | 
					
						
							|  |  |  | }) => void; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type AnnotationListenerApi = AnnotationListener; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface AnnotatorSettings { | 
					
						
							|  |  |  |     decorate: Decorator; | 
					
						
							|  |  |  |     persistent?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Annotator { | 
					
						
							|  |  |  |     register: (name: string, settings: AnnotatorSettings) => void; | 
					
						
							|  |  |  |     annotate: (name: string, data: DecoratorData) => void; | 
					
						
							|  |  |  |     annotationChanged: (name: string, f: AnnotationListenerApi) => void; | 
					
						
							|  |  |  |     remove: (name: string) => void; | 
					
						
							|  |  |  |     removeAll: (name: string) => void; | 
					
						
							|  |  |  |     getAll: (name: string) => Record<string, Element[]>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface GeomRect { | 
					
						
							|  |  |  |     readonly x: number; | 
					
						
							|  |  |  |     readonly y: number; | 
					
						
							|  |  |  |     readonly w: number; | 
					
						
							|  |  |  |     readonly h: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Rect { | 
					
						
							|  |  |  |     inflate: (rect: GeomRect, w: number, h: number) => GeomRect; | 
					
						
							|  |  |  |     relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect; | 
					
						
							|  |  |  |     findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null; | 
					
						
							|  |  |  |     intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null; | 
					
						
							|  |  |  |     clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect; | 
					
						
							|  |  |  |     create: (x: number, y: number, w: number, h: number) => GeomRect; | 
					
						
							|  |  |  |     fromClientRect: (clientRect: DOMRect) => GeomRect; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface NotificationManagerImpl { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     open: (spec: NotificationSpec, closeCallback: () => void) => NotificationApi; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     close: <T extends NotificationApi>(notification: T) => void; | 
					
						
							|  |  |  |     getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NotificationSpec { | 
					
						
							|  |  |  |     type?: 'info' | 'warning' | 'error' | 'success'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     progressBar?: boolean; | 
					
						
							|  |  |  |     timeout?: number; | 
					
						
							|  |  |  |     closeButton?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NotificationApi { | 
					
						
							|  |  |  |     close: () => void; | 
					
						
							|  |  |  |     progressBar: { | 
					
						
							|  |  |  |         value: (percent: number) => void; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     text: (text: string) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     reposition: () => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getEl: () => HTMLElement; | 
					
						
							|  |  |  |     settings: NotificationSpec; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NotificationManager { | 
					
						
							|  |  |  |     open: (spec: NotificationSpec) => NotificationApi; | 
					
						
							|  |  |  |     close: () => void; | 
					
						
							|  |  |  |     getNotifications: () => NotificationApi[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface UploadFailure { | 
					
						
							|  |  |  |     message: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ProgressFn = (percent: number) => void; | 
					
						
							|  |  |  | type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface UploadResult$2 { | 
					
						
							|  |  |  |     url: string; | 
					
						
							|  |  |  |     blobInfo: BlobInfo; | 
					
						
							|  |  |  |     status: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     error?: UploadFailure; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface RawPattern { | 
					
						
							|  |  |  |     start?: any; | 
					
						
							|  |  |  |     end?: any; | 
					
						
							|  |  |  |     format?: any; | 
					
						
							|  |  |  |     cmd?: any; | 
					
						
							|  |  |  |     value?: any; | 
					
						
							|  |  |  |     replacement?: any; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface InlineBasePattern { | 
					
						
							|  |  |  |     readonly start: string; | 
					
						
							|  |  |  |     readonly end: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface InlineFormatPattern extends InlineBasePattern { | 
					
						
							|  |  |  |     readonly type: 'inline-format'; | 
					
						
							|  |  |  |     readonly format: string[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface InlineCmdPattern extends InlineBasePattern { | 
					
						
							|  |  |  |     readonly type: 'inline-command'; | 
					
						
							|  |  |  |     readonly cmd: string; | 
					
						
							|  |  |  |     readonly value?: any; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type InlinePattern = InlineFormatPattern | InlineCmdPattern; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BlockBasePattern { | 
					
						
							|  |  |  |     readonly start: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BlockFormatPattern extends BlockBasePattern { | 
					
						
							|  |  |  |     readonly type: 'block-format'; | 
					
						
							|  |  |  |     readonly format: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BlockCmdPattern extends BlockBasePattern { | 
					
						
							|  |  |  |     readonly type: 'block-command'; | 
					
						
							|  |  |  |     readonly cmd: string; | 
					
						
							|  |  |  |     readonly value?: any; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type BlockPattern = BlockFormatPattern | BlockCmdPattern; | 
					
						
							|  |  |  | type Pattern = InlinePattern | BlockPattern; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface DynamicPatternContext { | 
					
						
							|  |  |  |     readonly text: string; | 
					
						
							|  |  |  |     readonly block: Element; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[]; | 
					
						
							|  |  |  | type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface AlertBannerSpec { | 
					
						
							|  |  |  |     type: 'alertbanner'; | 
					
						
							|  |  |  |     level: 'info' | 'warn' | 'error' | 'success'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     icon: string; | 
					
						
							|  |  |  |     url?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ButtonSpec { | 
					
						
							|  |  |  |     type: 'button'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     primary?: boolean; | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     borderless?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     buttonType?: 'primary' | 'secondary' | 'toolbar'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface FormComponentSpec { | 
					
						
							|  |  |  |     type: string; | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FormComponentWithLabelSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     label?: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface CheckboxSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     type: 'checkbox'; | 
					
						
							|  |  |  |     label: string; | 
					
						
							|  |  |  |     enabled?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface CollectionSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'collection'; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface CollectionItem { | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     icon: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface ColorInputSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'colorinput'; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     storageKey?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface ColorPickerSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'colorpicker'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CustomEditorInit { | 
					
						
							|  |  |  |     setValue: (value: string) => void; | 
					
						
							|  |  |  |     getValue: () => string; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface CustomEditorOldSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     type: 'customeditor'; | 
					
						
							|  |  |  |     tag?: string; | 
					
						
							|  |  |  |     init: (e: HTMLElement) => Promise<CustomEditorInit>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CustomEditorNewSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     type: 'customeditor'; | 
					
						
							|  |  |  |     tag?: string; | 
					
						
							|  |  |  |     scriptId: string; | 
					
						
							|  |  |  |     scriptUrl: string; | 
					
						
							|  |  |  |     settings?: any; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DropZoneSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'dropzone'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface GridSpec { | 
					
						
							|  |  |  |     type: 'grid'; | 
					
						
							|  |  |  |     columns: number; | 
					
						
							|  |  |  |     items: BodyComponentSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface HtmlPanelSpec { | 
					
						
							|  |  |  |     type: 'htmlpanel'; | 
					
						
							|  |  |  |     html: string; | 
					
						
							|  |  |  |     presets?: 'presentation' | 'document'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface IframeSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'iframe'; | 
					
						
							|  |  |  |     sandboxed?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     transparent?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ImagePreviewSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     type: 'imagepreview'; | 
					
						
							|  |  |  |     height?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface InputSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'input'; | 
					
						
							|  |  |  |     inputMode?: string; | 
					
						
							|  |  |  |     placeholder?: string; | 
					
						
							|  |  |  |     maximized?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface LabelSpec { | 
					
						
							|  |  |  |     type: 'label'; | 
					
						
							|  |  |  |     label: string; | 
					
						
							|  |  |  |     items: BodyComponentSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ListBoxSingleItemSpec { | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ListBoxNestedItemSpec { | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     items: ListBoxItemSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface ListBoxSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'listbox'; | 
					
						
							|  |  |  |     items: ListBoxItemSpec[]; | 
					
						
							|  |  |  |     disabled?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PanelSpec { | 
					
						
							|  |  |  |     type: 'panel'; | 
					
						
							|  |  |  |     classes?: string[]; | 
					
						
							|  |  |  |     items: BodyComponentSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SelectBoxItemSpec { | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SelectBoxSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'selectbox'; | 
					
						
							|  |  |  |     items: SelectBoxItemSpec[]; | 
					
						
							|  |  |  |     size?: number; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface SizeInputSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'sizeinput'; | 
					
						
							|  |  |  |     constrain?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface SliderSpec extends FormComponentSpec { | 
					
						
							|  |  |  |     type: 'slider'; | 
					
						
							|  |  |  |     label: string; | 
					
						
							|  |  |  |     min?: number; | 
					
						
							|  |  |  |     max?: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TableSpec { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     type: 'table'; | 
					
						
							|  |  |  |     header: string[]; | 
					
						
							|  |  |  |     cells: string[][]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TextAreaSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'textarea'; | 
					
						
							|  |  |  |     placeholder?: string; | 
					
						
							|  |  |  |     maximized?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     onSetup?: (api: I) => (api: I) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface BaseToolbarButtonInstanceApi { | 
					
						
							|  |  |  |     isEnabled: () => boolean; | 
					
						
							|  |  |  |     setEnabled: (state: boolean) => void; | 
					
						
							|  |  |  |     setText: (text: string) => void; | 
					
						
							|  |  |  |     setIcon: (icon: string) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> { | 
					
						
							|  |  |  |     type?: 'button'; | 
					
						
							|  |  |  |     onAction: (api: ToolbarButtonInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarGroupSetting { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     items: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type ToolbarConfig = string | ToolbarGroupSetting[]; | 
					
						
							|  |  |  | interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> { | 
					
						
							|  |  |  |     type?: 'grouptoolbarbutton'; | 
					
						
							|  |  |  |     items?: ToolbarConfig; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CardImageSpec { | 
					
						
							|  |  |  |     type: 'cardimage'; | 
					
						
							|  |  |  |     src: string; | 
					
						
							|  |  |  |     alt?: string; | 
					
						
							|  |  |  |     classes?: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CardTextSpec { | 
					
						
							|  |  |  |     type: 'cardtext'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     classes?: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec; | 
					
						
							|  |  |  | type CardContainerDirection = 'vertical' | 'horizontal'; | 
					
						
							|  |  |  | type CardContainerAlign = 'left' | 'right'; | 
					
						
							|  |  |  | type CardContainerValign = 'top' | 'middle' | 'bottom'; | 
					
						
							|  |  |  | interface CardContainerSpec { | 
					
						
							|  |  |  |     type: 'cardcontainer'; | 
					
						
							|  |  |  |     items: CardItemSpec[]; | 
					
						
							|  |  |  |     direction?: CardContainerDirection; | 
					
						
							|  |  |  |     align?: CardContainerAlign; | 
					
						
							|  |  |  |     valign?: CardContainerValign; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface CommonMenuItemSpec { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     text?: string; | 
					
						
							|  |  |  |     value?: string; | 
					
						
							|  |  |  |     meta?: Record<string, any>; | 
					
						
							|  |  |  |     shortcut?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CommonMenuItemInstanceApi { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     isEnabled: () => boolean; | 
					
						
							|  |  |  |     setEnabled: (state: boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> { | 
					
						
							|  |  |  |     type: 'cardmenuitem'; | 
					
						
							|  |  |  |     label?: string; | 
					
						
							|  |  |  |     items: CardItemSpec[]; | 
					
						
							|  |  |  |     onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void; | 
					
						
							|  |  |  |     onAction?: (api: CardMenuItemInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ChoiceMenuItemSpec extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'choiceitem'; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi { | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextMenuItem extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     type?: 'item'; | 
					
						
							|  |  |  |     onAction: () => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextSubMenu extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type: 'submenu'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     getSubmenuItems: () => string | Array<ContextMenuContents>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu; | 
					
						
							|  |  |  | interface ContextMenuApi { | 
					
						
							|  |  |  |     update: (element: Element) => string | Array<ContextMenuContents>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FancyActionArgsMap { | 
					
						
							|  |  |  |     'inserttable': { | 
					
						
							|  |  |  |         numRows: number; | 
					
						
							|  |  |  |         numColumns: number; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     'colorswatch': { | 
					
						
							|  |  |  |         value: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> { | 
					
						
							|  |  |  |     type: 'fancymenuitem'; | 
					
						
							|  |  |  |     fancytype: T; | 
					
						
							|  |  |  |     initData?: Record<string, unknown>; | 
					
						
							|  |  |  |     onAction?: (data: FancyActionArgsMap[T]) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> { | 
					
						
							|  |  |  |     fancytype: 'inserttable'; | 
					
						
							|  |  |  |     initData?: {}; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> { | 
					
						
							|  |  |  |     fancytype: 'colorswatch'; | 
					
						
							|  |  |  |     select?: (value: string) => boolean; | 
					
						
							|  |  |  |     initData?: { | 
					
						
							|  |  |  |         allowCustomColors?: boolean; | 
					
						
							|  |  |  |         colors?: ChoiceMenuItemSpec[]; | 
					
						
							|  |  |  |         storageKey?: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec; | 
					
						
							|  |  |  | interface MenuItemSpec extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'menuitem'; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void; | 
					
						
							|  |  |  |     onAction?: (api: MenuItemInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface MenuItemInstanceApi extends CommonMenuItemInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SeparatorMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'separator'; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToggleMenuItemSpec extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'togglemenuitem'; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     active?: boolean; | 
					
						
							|  |  |  |     onSetup?: (api: ToggleMenuItemInstanceApi) => void; | 
					
						
							|  |  |  |     onAction: (api: ToggleMenuItemInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi { | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec; | 
					
						
							|  |  |  | interface NestedMenuItemSpec extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'nestedmenuitem'; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     getSubmenuItems: () => string | Array<NestedMenuItemContents>; | 
					
						
							|  |  |  |     onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi { | 
					
						
							|  |  |  |     setIconFill: (id: string, value: string) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type MenuButtonItemTypes = NestedMenuItemContents; | 
					
						
							|  |  |  | type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void; | 
					
						
							|  |  |  | interface MenuButtonFetchContext { | 
					
						
							|  |  |  |     pattern: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseMenuButtonSpec { | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     search?: boolean | { | 
					
						
							|  |  |  |         placeholder?: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     fetch: (success: SuccessCallback$1, fetchContext: MenuButtonFetchContext, api: BaseMenuButtonInstanceApi) => void; | 
					
						
							|  |  |  |     onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseMenuButtonInstanceApi { | 
					
						
							|  |  |  |     isEnabled: () => boolean; | 
					
						
							|  |  |  |     setEnabled: (state: boolean) => void; | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  |     setText: (text: string) => void; | 
					
						
							|  |  |  |     setIcon: (icon: string) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec { | 
					
						
							|  |  |  |     type?: 'menubutton'; | 
					
						
							|  |  |  |     onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec; | 
					
						
							|  |  |  | type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void; | 
					
						
							|  |  |  | type SelectPredicate = (value: string) => boolean; | 
					
						
							|  |  |  | type PresetTypes = 'color' | 'normal' | 'listpreview'; | 
					
						
							|  |  |  | type ColumnTypes$1 = number | 'auto'; | 
					
						
							|  |  |  | interface ToolbarSplitButtonSpec { | 
					
						
							|  |  |  |     type?: 'splitbutton'; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     select?: SelectPredicate; | 
					
						
							|  |  |  |     presets?: PresetTypes; | 
					
						
							|  |  |  |     columns?: ColumnTypes$1; | 
					
						
							|  |  |  |     fetch: (success: SuccessCallback) => void; | 
					
						
							|  |  |  |     onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void; | 
					
						
							|  |  |  |     onAction: (api: ToolbarSplitButtonInstanceApi) => void; | 
					
						
							|  |  |  |     onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarSplitButtonInstanceApi { | 
					
						
							|  |  |  |     isEnabled: () => boolean; | 
					
						
							|  |  |  |     setEnabled: (state: boolean) => void; | 
					
						
							|  |  |  |     setIconFill: (id: string, value: string) => void; | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  |     setText: (text: string) => void; | 
					
						
							|  |  |  |     setIcon: (icon: string) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> { | 
					
						
							|  |  |  |     active?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi { | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> { | 
					
						
							|  |  |  |     type?: 'togglebutton'; | 
					
						
							|  |  |  |     onAction: (api: ToolbarToggleButtonInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type Id = string; | 
					
						
							|  |  |  | interface TreeSpec { | 
					
						
							|  |  |  |     type: 'tree'; | 
					
						
							|  |  |  |     items: TreeItemSpec[]; | 
					
						
							|  |  |  |     onLeafAction?: (id: Id) => void; | 
					
						
							|  |  |  |     defaultExpandedIds?: Id[]; | 
					
						
							|  |  |  |     onToggleExpand?: (expandedIds: Id[], { expanded, node }: { | 
					
						
							|  |  |  |         expanded: boolean; | 
					
						
							|  |  |  |         node: Id; | 
					
						
							|  |  |  |     }) => void; | 
					
						
							|  |  |  |     defaultSelectedId?: Id; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseTreeItemSpec { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     id: Id; | 
					
						
							|  |  |  |     menu?: ToolbarMenuButtonSpec; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DirectorySpec extends BaseTreeItemSpec { | 
					
						
							|  |  |  |     type: 'directory'; | 
					
						
							|  |  |  |     children: TreeItemSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface LeafSpec extends BaseTreeItemSpec { | 
					
						
							|  |  |  |     type: 'leaf'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type TreeItemSpec = DirectorySpec | LeafSpec; | 
					
						
							|  |  |  | interface UrlInputSpec extends FormComponentWithLabelSpec { | 
					
						
							|  |  |  |     type: 'urlinput'; | 
					
						
							|  |  |  |     filetype?: 'image' | 'media' | 'file'; | 
					
						
							|  |  |  |     enabled?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlInputData { | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  |     meta: { | 
					
						
							|  |  |  |         text?: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type 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; | 
					
						
							|  |  |  | interface BarSpec { | 
					
						
							|  |  |  |     type: 'bar'; | 
					
						
							|  |  |  |     items: BodyComponentSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DialogToggleMenuItemSpec extends CommonMenuItemSpec { | 
					
						
							|  |  |  |     type?: 'togglemenuitem'; | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface BaseDialogFooterButtonSpec { | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     align?: 'start' | 'end'; | 
					
						
							|  |  |  |     primary?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     enabled?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     icon?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     buttonType?: 'primary' | 'secondary'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec { | 
					
						
							|  |  |  |     type: 'submit' | 'cancel' | 'custom'; | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec { | 
					
						
							|  |  |  |     type: 'menu'; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     items: DialogFooterMenuButtonItemSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface DialogFooterToggleButtonSpec extends BaseDialogFooterButtonSpec { | 
					
						
							|  |  |  |     type: 'togglebutton'; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     active?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec | DialogFooterToggleButtonSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface TabSpec { | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     items: BodyComponentSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TabPanelSpec { | 
					
						
							|  |  |  |     type: 'tabpanel'; | 
					
						
							|  |  |  |     tabs: TabSpec[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type DialogDataItem = any; | 
					
						
							|  |  |  | type DialogData = Record<string, DialogDataItem>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DialogInstanceApi<T extends DialogData> { | 
					
						
							|  |  |  |     getData: () => T; | 
					
						
							|  |  |  |     setData: (data: Partial<T>) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     setEnabled: (name: string, state: boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     focus: (name: string) => void; | 
					
						
							|  |  |  |     showTab: (name: string) => void; | 
					
						
							|  |  |  |     redial: (nu: DialogSpec<T>) => void; | 
					
						
							|  |  |  |     block: (msg: string) => void; | 
					
						
							|  |  |  |     unblock: () => void; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     toggleFullscreen: () => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     close: () => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DialogActionDetails { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     value?: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DialogChangeDetails<T> { | 
					
						
							|  |  |  |     name: keyof T; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DialogTabChangeDetails { | 
					
						
							|  |  |  |     newTabName: string; | 
					
						
							|  |  |  |     oldTabName: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type DialogActionHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void; | 
					
						
							|  |  |  | type DialogChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void; | 
					
						
							|  |  |  | type DialogSubmitHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void; | 
					
						
							|  |  |  | type DialogCloseHandler = () => void; | 
					
						
							|  |  |  | type DialogCancelHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void; | 
					
						
							|  |  |  | type DialogTabChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void; | 
					
						
							|  |  |  | type DialogSize = 'normal' | 'medium' | 'large'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DialogSpec<T extends DialogData> { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     size?: DialogSize; | 
					
						
							|  |  |  |     body: TabPanelSpec | PanelSpec; | 
					
						
							|  |  |  |     buttons: DialogFooterButtonSpec[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     initialData?: Partial<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     onAction?: DialogActionHandler<T>; | 
					
						
							|  |  |  |     onChange?: DialogChangeHandler<T>; | 
					
						
							|  |  |  |     onSubmit?: DialogSubmitHandler<T>; | 
					
						
							|  |  |  |     onClose?: DialogCloseHandler; | 
					
						
							|  |  |  |     onCancel?: DialogCancelHandler<T>; | 
					
						
							|  |  |  |     onTabChange?: DialogTabChangeHandler<T>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlDialogInstanceApi { | 
					
						
							|  |  |  |     block: (msg: string) => void; | 
					
						
							|  |  |  |     unblock: () => void; | 
					
						
							|  |  |  |     close: () => void; | 
					
						
							|  |  |  |     sendMessage: (msg: any) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlDialogActionDetails { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     value?: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlDialogMessage { | 
					
						
							|  |  |  |     mceAction: string; | 
					
						
							|  |  |  |     [key: string]: any; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void; | 
					
						
							|  |  |  | type UrlDialogCloseHandler = () => void; | 
					
						
							|  |  |  | type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void; | 
					
						
							|  |  |  | type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec { | 
					
						
							|  |  |  |     type: 'cancel' | 'custom'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlDialogSpec { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     url: string; | 
					
						
							|  |  |  |     height?: number; | 
					
						
							|  |  |  |     width?: number; | 
					
						
							|  |  |  |     buttons?: UrlDialogFooterButtonSpec[]; | 
					
						
							|  |  |  |     onAction?: UrlDialogActionHandler; | 
					
						
							|  |  |  |     onClose?: UrlDialogCloseHandler; | 
					
						
							|  |  |  |     onCancel?: UrlDialogCancelHandler; | 
					
						
							|  |  |  |     onMessage?: UrlDialogMessageHandler; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ColumnTypes = number | 'auto'; | 
					
						
							|  |  |  | type SeparatorItemSpec = SeparatorMenuItemSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface AutocompleterItemSpec { | 
					
						
							|  |  |  |     type?: 'autocompleteitem'; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     meta?: Record<string, any>; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface AutocompleterSpec { | 
					
						
							|  |  |  |     type?: 'autocompleter'; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     ch?: string; | 
					
						
							|  |  |  |     trigger?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     minChars?: number; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     columns?: ColumnTypes; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     matches?: (rng: Range, text: string, pattern: string) => boolean; | 
					
						
							|  |  |  |     fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>; | 
					
						
							|  |  |  |     onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void; | 
					
						
							|  |  |  |     maxResults?: number; | 
					
						
							|  |  |  |     highlightOn?: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface AutocompleterInstanceApi { | 
					
						
							|  |  |  |     hide: () => void; | 
					
						
							|  |  |  |     reload: (fetchOptions: Record<string, any>) => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ContextPosition = 'node' | 'selection' | 'line'; | 
					
						
							|  |  |  | type ContextScope = 'node' | 'editor'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface ContextBarSpec { | 
					
						
							|  |  |  |     predicate?: (elem: Element) => boolean; | 
					
						
							|  |  |  |     position?: ContextPosition; | 
					
						
							|  |  |  |     scope?: ContextScope; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> { | 
					
						
							|  |  |  |     type: 'contextformbutton'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormLaunchToggleButtonSpec extends BaseToolbarToggleButtonSpec<BaseToolbarToggleButtonInstanceApi> { | 
					
						
							|  |  |  |     type: 'contextformtogglebutton'; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormButtonSpec extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> { | 
					
						
							|  |  |  |     type?: 'contextformbutton'; | 
					
						
							|  |  |  |     primary?: boolean; | 
					
						
							|  |  |  |     onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> { | 
					
						
							|  |  |  |     type?: 'contextformtogglebutton'; | 
					
						
							|  |  |  |     onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void; | 
					
						
							|  |  |  |     primary?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormInstanceApi { | 
					
						
							|  |  |  |     hide: () => void; | 
					
						
							|  |  |  |     getValue: () => string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextFormSpec extends ContextBarSpec { | 
					
						
							|  |  |  |     type?: 'contextform'; | 
					
						
							|  |  |  |     initValue?: () => string; | 
					
						
							|  |  |  |     label?: string; | 
					
						
							|  |  |  |     launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec; | 
					
						
							|  |  |  |     commands: Array<ContextFormToggleButtonSpec | ContextFormButtonSpec>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ContextToolbarSpec extends ContextBarSpec { | 
					
						
							|  |  |  |     type?: 'contexttoolbar'; | 
					
						
							|  |  |  |     items: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type PublicDialog_d_AlertBannerSpec = AlertBannerSpec; | 
					
						
							|  |  |  | type PublicDialog_d_BarSpec = BarSpec; | 
					
						
							|  |  |  | type PublicDialog_d_BodyComponentSpec = BodyComponentSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ButtonSpec = ButtonSpec; | 
					
						
							|  |  |  | type PublicDialog_d_CheckboxSpec = CheckboxSpec; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type PublicDialog_d_CollectionItem = CollectionItem; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_CollectionSpec = CollectionSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ColorInputSpec = ColorInputSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ColorPickerSpec = ColorPickerSpec; | 
					
						
							|  |  |  | type PublicDialog_d_CustomEditorSpec = CustomEditorSpec; | 
					
						
							|  |  |  | type PublicDialog_d_CustomEditorInit = CustomEditorInit; | 
					
						
							|  |  |  | type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn; | 
					
						
							|  |  |  | type PublicDialog_d_DialogData = DialogData; | 
					
						
							|  |  |  | type PublicDialog_d_DialogSize = DialogSize; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type PublicDialog_d_DialogSpec<T extends DialogData> = DialogSpec<T>; | 
					
						
							|  |  |  | type PublicDialog_d_DialogInstanceApi<T extends DialogData> = DialogInstanceApi<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec; | 
					
						
							|  |  |  | type PublicDialog_d_DialogActionDetails = DialogActionDetails; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type PublicDialog_d_DialogChangeDetails<T> = DialogChangeDetails<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails; | 
					
						
							|  |  |  | type PublicDialog_d_DropZoneSpec = DropZoneSpec; | 
					
						
							|  |  |  | type PublicDialog_d_GridSpec = GridSpec; | 
					
						
							|  |  |  | type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec; | 
					
						
							|  |  |  | type PublicDialog_d_IframeSpec = IframeSpec; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_InputSpec = InputSpec; | 
					
						
							|  |  |  | type PublicDialog_d_LabelSpec = LabelSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ListBoxSpec = ListBoxSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec; | 
					
						
							|  |  |  | type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec; | 
					
						
							|  |  |  | type PublicDialog_d_PanelSpec = PanelSpec; | 
					
						
							|  |  |  | type PublicDialog_d_SelectBoxSpec = SelectBoxSpec; | 
					
						
							|  |  |  | type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec; | 
					
						
							|  |  |  | type PublicDialog_d_SizeInputSpec = SizeInputSpec; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type PublicDialog_d_SliderSpec = SliderSpec; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_TableSpec = TableSpec; | 
					
						
							|  |  |  | type PublicDialog_d_TabSpec = TabSpec; | 
					
						
							|  |  |  | type PublicDialog_d_TabPanelSpec = TabPanelSpec; | 
					
						
							|  |  |  | type PublicDialog_d_TextAreaSpec = TextAreaSpec; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type PublicDialog_d_TreeSpec = TreeSpec; | 
					
						
							|  |  |  | type PublicDialog_d_TreeItemSpec = TreeItemSpec; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type PublicDialog_d_UrlInputData = UrlInputData; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | type PublicDialog_d_UrlInputSpec = UrlInputSpec; | 
					
						
							|  |  |  | type PublicDialog_d_UrlDialogSpec = UrlDialogSpec; | 
					
						
							|  |  |  | type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec; | 
					
						
							|  |  |  | type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi; | 
					
						
							|  |  |  | type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails; | 
					
						
							|  |  |  | type PublicDialog_d_UrlDialogMessage = UrlDialogMessage; | 
					
						
							|  |  |  | declare namespace PublicDialog_d { | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     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, }; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_AutocompleterContents = AutocompleterContents; | 
					
						
							|  |  |  | type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextPosition = ContextPosition; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextScope = ContextScope; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormSpec = ContextFormSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormInstanceApi = ContextFormInstanceApi; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormButtonSpec = ContextFormButtonSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormToggleButtonSpec = ContextFormToggleButtonSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi; | 
					
						
							|  |  |  | type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec; | 
					
						
							|  |  |  | type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec; | 
					
						
							|  |  |  | declare namespace PublicInlineContent_d { | 
					
						
							|  |  |  |     export { PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type PublicMenu_d_MenuItemSpec = MenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi; | 
					
						
							|  |  |  | type PublicMenu_d_NestedMenuItemContents = NestedMenuItemContents; | 
					
						
							|  |  |  | type PublicMenu_d_NestedMenuItemSpec = NestedMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_NestedMenuItemInstanceApi = NestedMenuItemInstanceApi; | 
					
						
							|  |  |  | type PublicMenu_d_FancyMenuItemSpec = FancyMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_ColorSwatchMenuItemSpec = ColorSwatchMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_InsertTableMenuItemSpec = InsertTableMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_ToggleMenuItemSpec = ToggleMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_ToggleMenuItemInstanceApi = ToggleMenuItemInstanceApi; | 
					
						
							|  |  |  | type PublicMenu_d_ChoiceMenuItemSpec = ChoiceMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_ChoiceMenuItemInstanceApi = ChoiceMenuItemInstanceApi; | 
					
						
							|  |  |  | type PublicMenu_d_SeparatorMenuItemSpec = SeparatorMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_ContextMenuApi = ContextMenuApi; | 
					
						
							|  |  |  | type PublicMenu_d_ContextMenuContents = ContextMenuContents; | 
					
						
							|  |  |  | type PublicMenu_d_ContextMenuItem = ContextMenuItem; | 
					
						
							|  |  |  | type PublicMenu_d_ContextSubMenu = ContextSubMenu; | 
					
						
							|  |  |  | type PublicMenu_d_CardMenuItemSpec = CardMenuItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_CardMenuItemInstanceApi = CardMenuItemInstanceApi; | 
					
						
							|  |  |  | type PublicMenu_d_CardItemSpec = CardItemSpec; | 
					
						
							|  |  |  | type PublicMenu_d_CardContainerSpec = CardContainerSpec; | 
					
						
							|  |  |  | type PublicMenu_d_CardImageSpec = CardImageSpec; | 
					
						
							|  |  |  | type PublicMenu_d_CardTextSpec = CardTextSpec; | 
					
						
							|  |  |  | declare namespace PublicMenu_d { | 
					
						
							|  |  |  |     export { PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardTextSpec as CardTextSpec, }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SidebarInstanceApi { | 
					
						
							|  |  |  |     element: () => HTMLElement; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SidebarSpec { | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							|  |  |  |     onShow?: (api: SidebarInstanceApi) => void; | 
					
						
							|  |  |  |     onSetup?: (api: SidebarInstanceApi) => (api: SidebarInstanceApi) => void; | 
					
						
							|  |  |  |     onHide?: (api: SidebarInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type PublicSidebar_d_SidebarSpec = SidebarSpec; | 
					
						
							|  |  |  | type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi; | 
					
						
							|  |  |  | declare namespace PublicSidebar_d { | 
					
						
							|  |  |  |     export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarSplitButtonInstanceApi = ToolbarSplitButtonInstanceApi; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarMenuButtonSpec = ToolbarMenuButtonSpec; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarMenuButtonInstanceApi = ToolbarMenuButtonInstanceApi; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarToggleButtonSpec = ToolbarToggleButtonSpec; | 
					
						
							|  |  |  | type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanceApi; | 
					
						
							|  |  |  | type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec; | 
					
						
							|  |  |  | type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi; | 
					
						
							|  |  |  | declare namespace PublicToolbar_d { | 
					
						
							|  |  |  |     export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface ViewButtonApi { | 
					
						
							|  |  |  |     setIcon: (newIcon: string) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ViewToggleButtonApi extends ViewButtonApi { | 
					
						
							|  |  |  |     isActive: () => boolean; | 
					
						
							|  |  |  |     setActive: (state: boolean) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BaseButtonSpec<Api extends ViewButtonApi> { | 
					
						
							|  |  |  |     text?: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  |     tooltip?: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     buttonType?: 'primary' | 'secondary'; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     borderless?: boolean; | 
					
						
							|  |  |  |     onAction: (api: Api) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ViewNormalButtonSpec extends BaseButtonSpec<ViewButtonApi> { | 
					
						
							|  |  |  |     text: string; | 
					
						
							|  |  |  |     type: 'button'; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface ViewToggleButtonSpec extends BaseButtonSpec<ViewToggleButtonApi> { | 
					
						
							|  |  |  |     type: 'togglebutton'; | 
					
						
							|  |  |  |     active?: boolean; | 
					
						
							|  |  |  |     onAction: (api: ViewToggleButtonApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ViewButtonsGroupSpec { | 
					
						
							|  |  |  |     type: 'group'; | 
					
						
							|  |  |  |     buttons: Array<ViewNormalButtonSpec | ViewToggleButtonSpec>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type ViewButtonSpec = ViewNormalButtonSpec | ViewToggleButtonSpec | ViewButtonsGroupSpec; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface ViewInstanceApi { | 
					
						
							|  |  |  |     getContainer: () => HTMLElement; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ViewSpec { | 
					
						
							|  |  |  |     buttons?: ViewButtonSpec[]; | 
					
						
							|  |  |  |     onShow: (api: ViewInstanceApi) => void; | 
					
						
							|  |  |  |     onHide: (api: ViewInstanceApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type PublicView_d_ViewSpec = ViewSpec; | 
					
						
							|  |  |  | type PublicView_d_ViewInstanceApi = ViewInstanceApi; | 
					
						
							|  |  |  | declare namespace PublicView_d { | 
					
						
							|  |  |  |     export { PublicView_d_ViewSpec as ViewSpec, PublicView_d_ViewInstanceApi as ViewInstanceApi, }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface Registry$1 { | 
					
						
							|  |  |  |     addButton: (name: string, spec: ToolbarButtonSpec) => void; | 
					
						
							|  |  |  |     addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void; | 
					
						
							|  |  |  |     addToggleButton: (name: string, spec: ToolbarToggleButtonSpec) => void; | 
					
						
							|  |  |  |     addMenuButton: (name: string, spec: ToolbarMenuButtonSpec) => void; | 
					
						
							|  |  |  |     addSplitButton: (name: string, spec: ToolbarSplitButtonSpec) => void; | 
					
						
							|  |  |  |     addMenuItem: (name: string, spec: MenuItemSpec) => void; | 
					
						
							|  |  |  |     addNestedMenuItem: (name: string, spec: NestedMenuItemSpec) => void; | 
					
						
							|  |  |  |     addToggleMenuItem: (name: string, spec: ToggleMenuItemSpec) => void; | 
					
						
							|  |  |  |     addContextMenu: (name: string, spec: ContextMenuApi) => void; | 
					
						
							|  |  |  |     addContextToolbar: (name: string, spec: ContextToolbarSpec) => void; | 
					
						
							|  |  |  |     addContextForm: (name: string, spec: ContextFormSpec) => void; | 
					
						
							|  |  |  |     addIcon: (name: string, svgData: string) => void; | 
					
						
							|  |  |  |     addAutocompleter: (name: string, spec: AutocompleterSpec) => void; | 
					
						
							|  |  |  |     addSidebar: (name: string, spec: SidebarSpec) => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     addView: (name: string, spec: ViewSpec) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getAll: () => { | 
					
						
							|  |  |  |         buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>; | 
					
						
							|  |  |  |         menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>; | 
					
						
							|  |  |  |         popups: Record<string, AutocompleterSpec>; | 
					
						
							|  |  |  |         contextMenus: Record<string, ContextMenuApi>; | 
					
						
							|  |  |  |         contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>; | 
					
						
							|  |  |  |         icons: Record<string, string>; | 
					
						
							|  |  |  |         sidebars: Record<string, SidebarSpec>; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         views: Record<string, ViewSpec>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface AutocompleteLookupData { | 
					
						
							|  |  |  |     readonly matchText: string; | 
					
						
							|  |  |  |     readonly items: AutocompleterContents[]; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     readonly columns: ColumnTypes; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void; | 
					
						
							|  |  |  |     readonly highlightOn: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface AutocompleterEventArgs { | 
					
						
							|  |  |  |     readonly lookupData: AutocompleteLookupData[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface RangeLikeObject { | 
					
						
							|  |  |  |     startContainer: Node; | 
					
						
							|  |  |  |     startOffset: number; | 
					
						
							|  |  |  |     endContainer: Node; | 
					
						
							|  |  |  |     endOffset: number; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat; | 
					
						
							|  |  |  | type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat; | 
					
						
							|  |  |  | type Format = ApplyFormat | RemoveFormat; | 
					
						
							|  |  |  | type Formats = Record<string, Format | Format[]>; | 
					
						
							|  |  |  | type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string | null); | 
					
						
							|  |  |  | type FormatVars = Record<string, string | null>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BaseFormat<T> { | 
					
						
							|  |  |  |     ceFalseOverride?: boolean; | 
					
						
							|  |  |  |     classes?: string | string[]; | 
					
						
							|  |  |  |     collapsed?: boolean; | 
					
						
							|  |  |  |     exact?: boolean; | 
					
						
							|  |  |  |     expand?: boolean; | 
					
						
							|  |  |  |     links?: boolean; | 
					
						
							|  |  |  |     mixed?: boolean; | 
					
						
							|  |  |  |     block_expand?: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     onmatch?: (node: Element, fmt: T, itemName: string) => boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     remove?: 'none' | 'empty' | 'all'; | 
					
						
							|  |  |  |     remove_similar?: boolean; | 
					
						
							|  |  |  |     split?: boolean; | 
					
						
							|  |  |  |     deep?: boolean; | 
					
						
							|  |  |  |     preserve_attributes?: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Block { | 
					
						
							|  |  |  |     block: string; | 
					
						
							|  |  |  |     list_block?: string; | 
					
						
							|  |  |  |     wrapper?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Inline { | 
					
						
							|  |  |  |     inline: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Selector { | 
					
						
							|  |  |  |     selector: string; | 
					
						
							|  |  |  |     inherit?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CommonFormat<T> extends BaseFormat<T> { | 
					
						
							|  |  |  |     attributes?: Record<string, FormatAttrOrStyleValue>; | 
					
						
							|  |  |  |     styles?: Record<string, FormatAttrOrStyleValue>; | 
					
						
							|  |  |  |     toggle?: boolean; | 
					
						
							|  |  |  |     preview?: string | false; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     clear_child_styles?: boolean; | 
					
						
							|  |  |  |     merge_siblings?: boolean; | 
					
						
							|  |  |  |     merge_with_parents?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BlockFormat extends Block, CommonFormat<BlockFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface InlineFormat extends Inline, CommonFormat<InlineFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CommonRemoveFormat<T> extends BaseFormat<T> { | 
					
						
							|  |  |  |     attributes?: string[] | Record<string, FormatAttrOrStyleValue>; | 
					
						
							|  |  |  |     styles?: string[] | Record<string, FormatAttrOrStyleValue>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Filter<C extends Function> { | 
					
						
							|  |  |  |     name: string; | 
					
						
							|  |  |  |     callbacks: C[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ParserArgs { | 
					
						
							|  |  |  |     getInner?: boolean | number; | 
					
						
							|  |  |  |     forced_root_block?: boolean | string; | 
					
						
							|  |  |  |     context?: string; | 
					
						
							|  |  |  |     isRootContent?: boolean; | 
					
						
							|  |  |  |     format?: string; | 
					
						
							|  |  |  |     invalid?: boolean; | 
					
						
							|  |  |  |     no_events?: boolean; | 
					
						
							|  |  |  |     [key: string]: any; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ParserFilter extends Filter<ParserFilterCallback> { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DomParserSettings { | 
					
						
							|  |  |  |     allow_html_data_urls?: boolean; | 
					
						
							|  |  |  |     allow_svg_data_urls?: boolean; | 
					
						
							|  |  |  |     allow_conditional_comments?: boolean; | 
					
						
							|  |  |  |     allow_html_in_named_anchor?: boolean; | 
					
						
							|  |  |  |     allow_script_urls?: boolean; | 
					
						
							|  |  |  |     allow_unsafe_link_target?: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     blob_cache?: BlobCache; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     convert_fonts_to_spans?: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     document?: Document; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     fix_list_elements?: boolean; | 
					
						
							|  |  |  |     font_size_legacy_values?: string; | 
					
						
							|  |  |  |     forced_root_block?: boolean | string; | 
					
						
							|  |  |  |     forced_root_block_attrs?: Record<string, string>; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     inline_styles?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     preserve_cdata?: boolean; | 
					
						
							|  |  |  |     remove_trailing_brs?: boolean; | 
					
						
							|  |  |  |     root_name?: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     sanitize?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     validate?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DomParser { | 
					
						
							|  |  |  |     schema: Schema; | 
					
						
							|  |  |  |     addAttributeFilter: (name: string, callback: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     getAttributeFilters: () => ParserFilter[]; | 
					
						
							|  |  |  |     removeAttributeFilter: (name: string, callback?: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     addNodeFilter: (name: string, callback: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     getNodeFilters: () => ParserFilter[]; | 
					
						
							|  |  |  |     removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     parse: (html: string, args?: ParserArgs) => AstNode; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface StyleSheetLoaderSettings { | 
					
						
							|  |  |  |     maxLoadTime?: number; | 
					
						
							|  |  |  |     contentCssCors?: boolean; | 
					
						
							|  |  |  |     referrerPolicy?: ReferrerPolicy; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface StyleSheetLoader { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     load: (url: string) => Promise<void>; | 
					
						
							|  |  |  |     loadAll: (urls: string[]) => Promise<string[]>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     unload: (url: string) => void; | 
					
						
							|  |  |  |     unloadAll: (urls: string[]) => void; | 
					
						
							|  |  |  |     _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     _setContentCssCors: (contentCssCors: boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Registry = Registry$1; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface EditorUiApi { | 
					
						
							|  |  |  |     show: () => void; | 
					
						
							|  |  |  |     hide: () => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     setEnabled: (state: boolean) => void; | 
					
						
							|  |  |  |     isEnabled: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface EditorUi extends EditorUiApi { | 
					
						
							|  |  |  |     registry: Registry; | 
					
						
							|  |  |  |     styleSheetLoader: StyleSheetLoader; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type Ui_d_Registry = Registry; | 
					
						
							|  |  |  | type Ui_d_EditorUiApi = EditorUiApi; | 
					
						
							|  |  |  | type Ui_d_EditorUi = EditorUi; | 
					
						
							|  |  |  | declare namespace Ui_d { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     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, }; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface WindowParams { | 
					
						
							|  |  |  |     readonly inline?: 'cursor' | 'toolbar'; | 
					
						
							|  |  |  |     readonly ariaAttrs?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type InstanceApi<T extends DialogData> = UrlDialogInstanceApi | DialogInstanceApi<T>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface WindowManagerImpl { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     open: <T extends DialogData>(config: DialogSpec<T>, params: WindowParams | undefined, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi; | 
					
						
							|  |  |  |     alert: (message: string, callback: () => void) => void; | 
					
						
							|  |  |  |     confirm: (message: string, callback: (state: boolean) => void) => void; | 
					
						
							|  |  |  |     close: (dialog: InstanceApi<any>) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface WindowManager { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     open: <T extends DialogData>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi; | 
					
						
							|  |  |  |     alert: (message: string, callback?: () => void, scope?: any) => void; | 
					
						
							|  |  |  |     confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void; | 
					
						
							|  |  |  |     close: () => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ExecCommandEvent { | 
					
						
							|  |  |  |     command: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     ui: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     value?: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BeforeGetContentEvent extends GetContentArgs { | 
					
						
							|  |  |  |     selection?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface GetContentEvent extends BeforeGetContentEvent { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BeforeSetContentEvent extends SetContentArgs { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  |     selection?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SetContentEvent extends BeforeSetContentEvent { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface SaveContentEvent extends GetContentEvent { | 
					
						
							|  |  |  |     save: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface NewBlockEvent { | 
					
						
							|  |  |  |     newBlock: Element; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NodeChangeEvent { | 
					
						
							|  |  |  |     element: Element; | 
					
						
							|  |  |  |     parents: Node[]; | 
					
						
							|  |  |  |     selectionChange?: boolean; | 
					
						
							|  |  |  |     initial?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FormatEvent { | 
					
						
							|  |  |  |     format: string; | 
					
						
							|  |  |  |     vars?: FormatVars; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     node?: Node | RangeLikeObject | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface ObjectResizeEvent { | 
					
						
							|  |  |  |     target: HTMLElement; | 
					
						
							|  |  |  |     width: number; | 
					
						
							|  |  |  |     height: number; | 
					
						
							|  |  |  |     origin: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ObjectSelectedEvent { | 
					
						
							|  |  |  |     target: Node; | 
					
						
							|  |  |  |     targetClone?: Node; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ScrollIntoViewEvent { | 
					
						
							|  |  |  |     elm: HTMLElement; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     alignToTop: boolean | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface SetSelectionRangeEvent { | 
					
						
							|  |  |  |     range: Range; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     forward: boolean | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface ShowCaretEvent { | 
					
						
							|  |  |  |     target: Node; | 
					
						
							|  |  |  |     direction: number; | 
					
						
							|  |  |  |     before: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SwitchModeEvent { | 
					
						
							|  |  |  |     mode: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface ChangeEvent { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     level: UndoLevel; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     lastLevel: UndoLevel | undefined; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface AddUndoEvent extends ChangeEvent { | 
					
						
							|  |  |  |     originalEvent: Event | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface UndoRedoEvent { | 
					
						
							|  |  |  |     level: UndoLevel; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface WindowEvent<T extends DialogData> { | 
					
						
							|  |  |  |     dialog: InstanceApi<T>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ProgressStateEvent { | 
					
						
							|  |  |  |     state: boolean; | 
					
						
							|  |  |  |     time?: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface AfterProgressStateEvent { | 
					
						
							|  |  |  |     state: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PlaceholderToggleEvent { | 
					
						
							|  |  |  |     state: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface LoadErrorEvent { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     message: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface PreProcessEvent extends ParserArgs { | 
					
						
							|  |  |  |     node: Element; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PostProcessEvent extends ParserArgs { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PastePlainTextToggleEvent { | 
					
						
							|  |  |  |     state: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PastePreProcessEvent { | 
					
						
							|  |  |  |     content: string; | 
					
						
							|  |  |  |     readonly internal: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface PastePostProcessEvent { | 
					
						
							|  |  |  |     node: HTMLElement; | 
					
						
							|  |  |  |     readonly internal: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | interface EditableRootStateChangeEvent { | 
					
						
							|  |  |  |     state: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface NewTableRowEvent { | 
					
						
							|  |  |  |     node: HTMLTableRowElement; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NewTableCellEvent { | 
					
						
							|  |  |  |     node: HTMLTableCellElement; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TableEventData { | 
					
						
							|  |  |  |     readonly structure: boolean; | 
					
						
							|  |  |  |     readonly style: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TableModifiedEvent extends TableEventData { | 
					
						
							|  |  |  |     readonly table: HTMLTableElement; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface BeforeOpenNotificationEvent { | 
					
						
							|  |  |  |     notification: NotificationSpec; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface OpenNotificationEvent { | 
					
						
							|  |  |  |     notification: NotificationApi; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> { | 
					
						
							|  |  |  |     'activate': { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         relatedTarget: Editor | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     'deactivate': { | 
					
						
							|  |  |  |         relatedTarget: Editor; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     'focus': { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         blurredEditor: Editor | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     'blur': { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         focusedEditor: Editor | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     'resize': UIEvent; | 
					
						
							|  |  |  |     'scroll': UIEvent; | 
					
						
							|  |  |  |     'detach': {}; | 
					
						
							|  |  |  |     'remove': {}; | 
					
						
							|  |  |  |     'init': {}; | 
					
						
							|  |  |  |     'ScrollIntoView': ScrollIntoViewEvent; | 
					
						
							|  |  |  |     'AfterScrollIntoView': ScrollIntoViewEvent; | 
					
						
							|  |  |  |     'ObjectResized': ObjectResizeEvent; | 
					
						
							|  |  |  |     'ObjectResizeStart': ObjectResizeEvent; | 
					
						
							|  |  |  |     'SwitchMode': SwitchModeEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     'ScrollWindow': Event; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     'ResizeWindow': UIEvent; | 
					
						
							|  |  |  |     'SkinLoaded': {}; | 
					
						
							|  |  |  |     'SkinLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'PluginLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'ModelLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'IconsLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'ThemeLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'LanguageLoadError': LoadErrorEvent; | 
					
						
							|  |  |  |     'BeforeExecCommand': ExecCommandEvent; | 
					
						
							|  |  |  |     'ExecCommand': ExecCommandEvent; | 
					
						
							|  |  |  |     'NodeChange': NodeChangeEvent; | 
					
						
							|  |  |  |     'FormatApply': FormatEvent; | 
					
						
							|  |  |  |     'FormatRemove': FormatEvent; | 
					
						
							|  |  |  |     'ShowCaret': ShowCaretEvent; | 
					
						
							|  |  |  |     'SelectionChange': {}; | 
					
						
							|  |  |  |     'ObjectSelected': ObjectSelectedEvent; | 
					
						
							|  |  |  |     'BeforeObjectSelected': ObjectSelectedEvent; | 
					
						
							|  |  |  |     'GetSelectionRange': { | 
					
						
							|  |  |  |         range: Range; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     'SetSelectionRange': SetSelectionRangeEvent; | 
					
						
							|  |  |  |     'AfterSetSelectionRange': SetSelectionRangeEvent; | 
					
						
							|  |  |  |     'BeforeGetContent': BeforeGetContentEvent; | 
					
						
							|  |  |  |     'GetContent': GetContentEvent; | 
					
						
							|  |  |  |     'BeforeSetContent': BeforeSetContentEvent; | 
					
						
							|  |  |  |     'SetContent': SetContentEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     'SaveContent': SaveContentEvent; | 
					
						
							|  |  |  |     'RawSaveContent': SaveContentEvent; | 
					
						
							|  |  |  |     'LoadContent': { | 
					
						
							|  |  |  |         load: boolean; | 
					
						
							|  |  |  |         element: HTMLElement; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     'PreviewFormats': {}; | 
					
						
							|  |  |  |     'AfterPreviewFormats': {}; | 
					
						
							|  |  |  |     'ScriptsLoaded': {}; | 
					
						
							|  |  |  |     'PreInit': {}; | 
					
						
							|  |  |  |     'PostRender': {}; | 
					
						
							|  |  |  |     'NewBlock': NewBlockEvent; | 
					
						
							|  |  |  |     'ClearUndos': {}; | 
					
						
							|  |  |  |     'TypingUndo': {}; | 
					
						
							|  |  |  |     'Redo': UndoRedoEvent; | 
					
						
							|  |  |  |     'Undo': UndoRedoEvent; | 
					
						
							|  |  |  |     'BeforeAddUndo': AddUndoEvent; | 
					
						
							|  |  |  |     'AddUndo': AddUndoEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     'change': ChangeEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     'CloseWindow': WindowEvent<any>; | 
					
						
							|  |  |  |     'OpenWindow': WindowEvent<any>; | 
					
						
							|  |  |  |     'ProgressState': ProgressStateEvent; | 
					
						
							|  |  |  |     'AfterProgressState': AfterProgressStateEvent; | 
					
						
							|  |  |  |     'PlaceholderToggle': PlaceholderToggleEvent; | 
					
						
							|  |  |  |     'tap': TouchEvent; | 
					
						
							|  |  |  |     'longpress': TouchEvent; | 
					
						
							|  |  |  |     'longpresscancel': {}; | 
					
						
							|  |  |  |     'PreProcess': PreProcessEvent; | 
					
						
							|  |  |  |     'PostProcess': PostProcessEvent; | 
					
						
							|  |  |  |     'AutocompleterStart': AutocompleterEventArgs; | 
					
						
							|  |  |  |     'AutocompleterUpdate': AutocompleterEventArgs; | 
					
						
							|  |  |  |     'AutocompleterEnd': {}; | 
					
						
							|  |  |  |     'PastePlainTextToggle': PastePlainTextToggleEvent; | 
					
						
							|  |  |  |     'PastePreProcess': PastePreProcessEvent; | 
					
						
							|  |  |  |     'PastePostProcess': PastePostProcessEvent; | 
					
						
							|  |  |  |     'TableModified': TableModifiedEvent; | 
					
						
							|  |  |  |     'NewRow': NewTableRowEvent; | 
					
						
							|  |  |  |     'NewCell': NewTableCellEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     'SetAttrib': SetAttribEvent; | 
					
						
							|  |  |  |     'hide': {}; | 
					
						
							|  |  |  |     'show': {}; | 
					
						
							|  |  |  |     'dirty': {}; | 
					
						
							|  |  |  |     'BeforeOpenNotification': BeforeOpenNotificationEvent; | 
					
						
							|  |  |  |     'OpenNotification': OpenNotificationEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface EditorManagerEventMap { | 
					
						
							|  |  |  |     'AddEditor': { | 
					
						
							|  |  |  |         editor: Editor; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     'RemoveEditor': { | 
					
						
							|  |  |  |         editor: Editor; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     'BeforeUnload': { | 
					
						
							|  |  |  |         returnValue: any; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | type EventTypes_d_ExecCommandEvent = ExecCommandEvent; | 
					
						
							|  |  |  | type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent; | 
					
						
							|  |  |  | type EventTypes_d_GetContentEvent = GetContentEvent; | 
					
						
							|  |  |  | type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent; | 
					
						
							|  |  |  | type EventTypes_d_SetContentEvent = SetContentEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type EventTypes_d_SaveContentEvent = SaveContentEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type EventTypes_d_NewBlockEvent = NewBlockEvent; | 
					
						
							|  |  |  | type EventTypes_d_NodeChangeEvent = NodeChangeEvent; | 
					
						
							|  |  |  | type EventTypes_d_FormatEvent = FormatEvent; | 
					
						
							|  |  |  | type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent; | 
					
						
							|  |  |  | type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent; | 
					
						
							|  |  |  | type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent; | 
					
						
							|  |  |  | type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent; | 
					
						
							|  |  |  | type EventTypes_d_ShowCaretEvent = ShowCaretEvent; | 
					
						
							|  |  |  | type EventTypes_d_SwitchModeEvent = SwitchModeEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type EventTypes_d_ChangeEvent = ChangeEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type EventTypes_d_AddUndoEvent = AddUndoEvent; | 
					
						
							|  |  |  | type EventTypes_d_UndoRedoEvent = UndoRedoEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type EventTypes_d_WindowEvent<T extends DialogData> = WindowEvent<T>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type EventTypes_d_ProgressStateEvent = ProgressStateEvent; | 
					
						
							|  |  |  | type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent; | 
					
						
							|  |  |  | type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent; | 
					
						
							|  |  |  | type EventTypes_d_LoadErrorEvent = LoadErrorEvent; | 
					
						
							|  |  |  | type EventTypes_d_PreProcessEvent = PreProcessEvent; | 
					
						
							|  |  |  | type EventTypes_d_PostProcessEvent = PostProcessEvent; | 
					
						
							|  |  |  | type EventTypes_d_PastePlainTextToggleEvent = PastePlainTextToggleEvent; | 
					
						
							|  |  |  | type EventTypes_d_PastePreProcessEvent = PastePreProcessEvent; | 
					
						
							|  |  |  | type EventTypes_d_PastePostProcessEvent = PastePostProcessEvent; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type EventTypes_d_EditableRootStateChangeEvent = EditableRootStateChangeEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type EventTypes_d_NewTableRowEvent = NewTableRowEvent; | 
					
						
							|  |  |  | type EventTypes_d_NewTableCellEvent = NewTableCellEvent; | 
					
						
							|  |  |  | type EventTypes_d_TableEventData = TableEventData; | 
					
						
							|  |  |  | type EventTypes_d_TableModifiedEvent = TableModifiedEvent; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type EventTypes_d_BeforeOpenNotificationEvent = BeforeOpenNotificationEvent; | 
					
						
							|  |  |  | type EventTypes_d_OpenNotificationEvent = OpenNotificationEvent; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | type EventTypes_d_EditorEventMap = EditorEventMap; | 
					
						
							|  |  |  | type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap; | 
					
						
							|  |  |  | declare namespace EventTypes_d { | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     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_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							|  |  |  | type Format_d_Formats = Formats; | 
					
						
							|  |  |  | type Format_d_Format = Format; | 
					
						
							|  |  |  | type Format_d_ApplyFormat = ApplyFormat; | 
					
						
							|  |  |  | type Format_d_BlockFormat = BlockFormat; | 
					
						
							|  |  |  | type Format_d_InlineFormat = InlineFormat; | 
					
						
							|  |  |  | type Format_d_SelectorFormat = SelectorFormat; | 
					
						
							|  |  |  | type Format_d_RemoveFormat = RemoveFormat; | 
					
						
							|  |  |  | type Format_d_RemoveBlockFormat = RemoveBlockFormat; | 
					
						
							|  |  |  | type Format_d_RemoveInlineFormat = RemoveInlineFormat; | 
					
						
							|  |  |  | type Format_d_RemoveSelectorFormat = RemoveSelectorFormat; | 
					
						
							|  |  |  | declare namespace Format_d { | 
					
						
							|  |  |  |     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, }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat; | 
					
						
							|  |  |  | type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface Separator { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FormatReference { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     format: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface NestedFormatting { | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     items: Array<FormatReference | StyleFormat>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CommonStyleFormat { | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     title: string; | 
					
						
							|  |  |  |     icon?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BlockStyleFormat extends BlockFormat, CommonStyleFormat { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface InlineStyleFormat extends InlineFormat, CommonStyleFormat { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat { | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named'; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ContentLanguage { | 
					
						
							|  |  |  |     readonly title: string; | 
					
						
							|  |  |  |     readonly code: string; | 
					
						
							|  |  |  |     readonly customCode?: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     editorContainer: HTMLElement; | 
					
						
							|  |  |  |     iframeContainer: HTMLElement; | 
					
						
							|  |  |  |     height?: number; | 
					
						
							|  |  |  |     iframeHeight?: number; | 
					
						
							|  |  |  |     api?: EditorUiApi; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type SetupCallback = (editor: Editor) => void; | 
					
						
							|  |  |  | type FilePickerCallback = (callback: (value: string, meta?: Record<string, any>) => void, value: string, meta: Record<string, any>) => void; | 
					
						
							|  |  |  | type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none'; | 
					
						
							|  |  |  | type FilePickerValidationCallback = (info: { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     type: string; | 
					
						
							|  |  |  |     url: string; | 
					
						
							|  |  |  | }, callback: (validation: { | 
					
						
							|  |  |  |     status: FilePickerValidationStatus; | 
					
						
							|  |  |  |     message: string; | 
					
						
							|  |  |  | }) => void) => void; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void; | 
					
						
							|  |  |  | type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void; | 
					
						
							|  |  |  | type URLConverter = (url: string, name: string, elm?: string | Element) => string; | 
					
						
							|  |  |  | type URLConverterCallback = (url: string, node: Node | string | undefined, on_save: boolean, name: string) => string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ToolbarGroup { | 
					
						
							|  |  |  |     name?: string; | 
					
						
							|  |  |  |     items: string[]; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap'; | 
					
						
							|  |  |  | type ToolbarLocation = 'top' | 'bottom' | 'auto'; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BaseEditorOptions { | 
					
						
							|  |  |  |     a11y_advanced_options?: boolean; | 
					
						
							|  |  |  |     add_form_submit_trigger?: boolean; | 
					
						
							|  |  |  |     add_unload_trigger?: boolean; | 
					
						
							|  |  |  |     allow_conditional_comments?: boolean; | 
					
						
							|  |  |  |     allow_html_data_urls?: boolean; | 
					
						
							|  |  |  |     allow_html_in_named_anchor?: boolean; | 
					
						
							|  |  |  |     allow_script_urls?: boolean; | 
					
						
							|  |  |  |     allow_svg_data_urls?: boolean; | 
					
						
							|  |  |  |     allow_unsafe_link_target?: boolean; | 
					
						
							|  |  |  |     anchor_bottom?: false | string; | 
					
						
							|  |  |  |     anchor_top?: false | string; | 
					
						
							|  |  |  |     auto_focus?: string | true; | 
					
						
							|  |  |  |     automatic_uploads?: boolean; | 
					
						
							|  |  |  |     base_url?: string; | 
					
						
							|  |  |  |     block_formats?: string; | 
					
						
							|  |  |  |     block_unsupported_drop?: boolean; | 
					
						
							|  |  |  |     body_id?: string; | 
					
						
							|  |  |  |     body_class?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     br_in_pre?: boolean; | 
					
						
							|  |  |  |     br_newline_selector?: string; | 
					
						
							|  |  |  |     browser_spellcheck?: boolean; | 
					
						
							|  |  |  |     branding?: boolean; | 
					
						
							|  |  |  |     cache_suffix?: string; | 
					
						
							|  |  |  |     color_cols?: number; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     color_cols_foreground?: number; | 
					
						
							|  |  |  |     color_cols_background?: number; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     color_map?: string[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     color_map_foreground?: string[]; | 
					
						
							|  |  |  |     color_map_background?: string[]; | 
					
						
							|  |  |  |     color_default_foreground?: string; | 
					
						
							|  |  |  |     color_default_background?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     content_css?: boolean | string | string[]; | 
					
						
							|  |  |  |     content_css_cors?: boolean; | 
					
						
							|  |  |  |     content_security_policy?: string; | 
					
						
							|  |  |  |     content_style?: string; | 
					
						
							|  |  |  |     content_langs?: ContentLanguage[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     contextmenu?: string | string[] | false; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     contextmenu_never_use_native?: boolean; | 
					
						
							|  |  |  |     convert_fonts_to_spans?: boolean; | 
					
						
							|  |  |  |     convert_urls?: boolean; | 
					
						
							|  |  |  |     custom_colors?: boolean; | 
					
						
							|  |  |  |     custom_elements?: string; | 
					
						
							|  |  |  |     custom_ui_selector?: string; | 
					
						
							|  |  |  |     custom_undo_redo_levels?: number; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     deprecation_warnings?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     directionality?: 'ltr' | 'rtl'; | 
					
						
							|  |  |  |     doctype?: string; | 
					
						
							|  |  |  |     document_base_url?: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     draggable_modal?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     editable_class?: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     editable_root?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     element_format?: 'xhtml' | 'html'; | 
					
						
							|  |  |  |     elementpath?: boolean; | 
					
						
							|  |  |  |     encoding?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     end_container_on_empty_block?: boolean | string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     entities?: string; | 
					
						
							|  |  |  |     entity_encoding?: EntityEncoding; | 
					
						
							|  |  |  |     extended_valid_elements?: string; | 
					
						
							|  |  |  |     event_root?: string; | 
					
						
							|  |  |  |     file_picker_callback?: FilePickerCallback; | 
					
						
							|  |  |  |     file_picker_types?: string; | 
					
						
							|  |  |  |     file_picker_validator_handler?: FilePickerValidationCallback; | 
					
						
							|  |  |  |     fix_list_elements?: boolean; | 
					
						
							|  |  |  |     fixed_toolbar_container?: string; | 
					
						
							|  |  |  |     fixed_toolbar_container_target?: HTMLElement; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     font_css?: string | string[]; | 
					
						
							|  |  |  |     font_family_formats?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     font_size_classes?: string; | 
					
						
							|  |  |  |     font_size_legacy_values?: string; | 
					
						
							|  |  |  |     font_size_style_values?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     font_size_formats?: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     font_size_input_default_unit?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forced_root_block?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     forced_root_block_attrs?: Record<string, string>; | 
					
						
							|  |  |  |     formats?: Formats; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     format_noneditable_selector?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     height?: number | string; | 
					
						
							|  |  |  |     hidden_input?: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     highlight_on_focus?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     icons?: string; | 
					
						
							|  |  |  |     icons_url?: string; | 
					
						
							|  |  |  |     id?: string; | 
					
						
							|  |  |  |     iframe_aria_text?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     iframe_attrs?: Record<string, string>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     images_file_types?: string; | 
					
						
							|  |  |  |     images_replace_blob_uris?: boolean; | 
					
						
							|  |  |  |     images_reuse_filename?: boolean; | 
					
						
							|  |  |  |     images_upload_base_path?: string; | 
					
						
							|  |  |  |     images_upload_credentials?: boolean; | 
					
						
							|  |  |  |     images_upload_handler?: UploadHandler; | 
					
						
							|  |  |  |     images_upload_url?: string; | 
					
						
							|  |  |  |     indent?: boolean; | 
					
						
							|  |  |  |     indent_after?: string; | 
					
						
							|  |  |  |     indent_before?: string; | 
					
						
							|  |  |  |     indent_use_margin?: boolean; | 
					
						
							|  |  |  |     indentation?: string; | 
					
						
							|  |  |  |     init_instance_callback?: SetupCallback; | 
					
						
							|  |  |  |     inline?: boolean; | 
					
						
							|  |  |  |     inline_boundaries?: boolean; | 
					
						
							|  |  |  |     inline_boundaries_selector?: string; | 
					
						
							|  |  |  |     inline_styles?: boolean; | 
					
						
							|  |  |  |     invalid_elements?: string; | 
					
						
							|  |  |  |     invalid_styles?: string | Record<string, string>; | 
					
						
							|  |  |  |     keep_styles?: boolean; | 
					
						
							|  |  |  |     language?: string; | 
					
						
							|  |  |  |     language_load?: boolean; | 
					
						
							|  |  |  |     language_url?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     line_height_formats?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     max_height?: number; | 
					
						
							|  |  |  |     max_width?: number; | 
					
						
							|  |  |  |     menu?: Record<string, { | 
					
						
							|  |  |  |         title: string; | 
					
						
							|  |  |  |         items: string; | 
					
						
							|  |  |  |     }>; | 
					
						
							|  |  |  |     menubar?: boolean | string; | 
					
						
							|  |  |  |     min_height?: number; | 
					
						
							|  |  |  |     min_width?: number; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     model?: string; | 
					
						
							|  |  |  |     model_url?: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     newdocument_content?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     newline_behavior?: 'block' | 'linebreak' | 'invert' | 'default'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     no_newline_selector?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     noneditable_class?: string; | 
					
						
							|  |  |  |     noneditable_regexp?: RegExp | RegExp[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     nowrap?: boolean; | 
					
						
							|  |  |  |     object_resizing?: boolean | string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     paste_as_text?: boolean; | 
					
						
							|  |  |  |     paste_block_drop?: boolean; | 
					
						
							|  |  |  |     paste_data_images?: boolean; | 
					
						
							|  |  |  |     paste_merge_formats?: boolean; | 
					
						
							|  |  |  |     paste_postprocess?: PastePostProcessFn; | 
					
						
							|  |  |  |     paste_preprocess?: PastePreProcessFn; | 
					
						
							|  |  |  |     paste_remove_styles_if_webkit?: boolean; | 
					
						
							|  |  |  |     paste_tab_spaces?: number; | 
					
						
							|  |  |  |     paste_webkit_styles?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     placeholder?: string; | 
					
						
							|  |  |  |     preserve_cdata?: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     preview_styles?: false | string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     promotion?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     protect?: RegExp[]; | 
					
						
							|  |  |  |     readonly?: boolean; | 
					
						
							|  |  |  |     referrer_policy?: ReferrerPolicy; | 
					
						
							|  |  |  |     relative_urls?: boolean; | 
					
						
							|  |  |  |     remove_script_host?: boolean; | 
					
						
							|  |  |  |     remove_trailing_brs?: boolean; | 
					
						
							|  |  |  |     removed_menuitems?: string; | 
					
						
							|  |  |  |     resize?: boolean | 'both'; | 
					
						
							|  |  |  |     resize_img_proportional?: boolean; | 
					
						
							|  |  |  |     root_name?: string; | 
					
						
							|  |  |  |     schema?: SchemaType; | 
					
						
							|  |  |  |     selector?: string; | 
					
						
							|  |  |  |     setup?: SetupCallback; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     sidebar_show?: string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     skin?: boolean | string; | 
					
						
							|  |  |  |     skin_url?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     smart_paste?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     statusbar?: boolean; | 
					
						
							|  |  |  |     style_formats?: AllowedFormat[]; | 
					
						
							|  |  |  |     style_formats_autohide?: boolean; | 
					
						
							|  |  |  |     style_formats_merge?: boolean; | 
					
						
							|  |  |  |     submit_patch?: boolean; | 
					
						
							|  |  |  |     suffix?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     table_tab_navigation?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     target?: HTMLElement; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     text_patterns?: RawPattern[] | false; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     text_patterns_lookup?: RawDynamicPatternsLookup; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     theme?: string | ThemeInitFunc | false; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     theme_url?: string; | 
					
						
							|  |  |  |     toolbar?: boolean | string | string[] | Array<ToolbarGroup>; | 
					
						
							|  |  |  |     toolbar1?: string; | 
					
						
							|  |  |  |     toolbar2?: string; | 
					
						
							|  |  |  |     toolbar3?: string; | 
					
						
							|  |  |  |     toolbar4?: string; | 
					
						
							|  |  |  |     toolbar5?: string; | 
					
						
							|  |  |  |     toolbar6?: string; | 
					
						
							|  |  |  |     toolbar7?: string; | 
					
						
							|  |  |  |     toolbar8?: string; | 
					
						
							|  |  |  |     toolbar9?: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     toolbar_groups?: Record<string, GroupToolbarButtonSpec>; | 
					
						
							|  |  |  |     toolbar_location?: ToolbarLocation; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     toolbar_mode?: ToolbarMode; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     toolbar_sticky?: boolean; | 
					
						
							|  |  |  |     toolbar_sticky_offset?: number; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     typeahead_urls?: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     ui_mode?: 'combined' | 'split'; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     url_converter?: URLConverter; | 
					
						
							|  |  |  |     url_converter_scope?: any; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     urlconverter_callback?: URLConverterCallback; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     valid_children?: string; | 
					
						
							|  |  |  |     valid_classes?: string | Record<string, string>; | 
					
						
							|  |  |  |     valid_elements?: string; | 
					
						
							|  |  |  |     valid_styles?: string | Record<string, string>; | 
					
						
							|  |  |  |     verify_html?: boolean; | 
					
						
							|  |  |  |     visual?: boolean; | 
					
						
							|  |  |  |     visual_anchor_class?: string; | 
					
						
							|  |  |  |     visual_table_class?: string; | 
					
						
							|  |  |  |     width?: number | string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     xss_sanitization?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     disable_nodechange?: boolean; | 
					
						
							|  |  |  |     forced_plugins?: string | string[]; | 
					
						
							|  |  |  |     plugin_base_urls?: Record<string, string>; | 
					
						
							|  |  |  |     service_message?: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     [key: string]: any; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface RawEditorOptions extends BaseEditorOptions { | 
					
						
							|  |  |  |     external_plugins?: Record<string, string>; | 
					
						
							|  |  |  |     mobile?: RawEditorOptions; | 
					
						
							|  |  |  |     plugins?: string | string[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface NormalizedEditorOptions extends BaseEditorOptions { | 
					
						
							|  |  |  |     external_plugins: Record<string, string>; | 
					
						
							|  |  |  |     forced_plugins: string[]; | 
					
						
							|  |  |  |     plugins: string[]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EditorOptions extends NormalizedEditorOptions { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     a11y_advanced_options: boolean; | 
					
						
							|  |  |  |     allow_unsafe_link_target: boolean; | 
					
						
							|  |  |  |     anchor_bottom: string; | 
					
						
							|  |  |  |     anchor_top: string; | 
					
						
							|  |  |  |     automatic_uploads: boolean; | 
					
						
							|  |  |  |     block_formats: string; | 
					
						
							|  |  |  |     body_class: string; | 
					
						
							|  |  |  |     body_id: string; | 
					
						
							|  |  |  |     br_newline_selector: string; | 
					
						
							|  |  |  |     color_map: string[]; | 
					
						
							|  |  |  |     color_cols: number; | 
					
						
							|  |  |  |     color_cols_foreground: number; | 
					
						
							|  |  |  |     color_cols_background: number; | 
					
						
							|  |  |  |     color_default_background: string; | 
					
						
							|  |  |  |     color_default_foreground: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     content_css: string[]; | 
					
						
							|  |  |  |     contextmenu: string[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     custom_colors: boolean; | 
					
						
							|  |  |  |     document_base_url: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     init_content_sync: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     draggable_modal: boolean; | 
					
						
							|  |  |  |     editable_class: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     editable_root: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     font_css: string[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     font_family_formats: string; | 
					
						
							|  |  |  |     font_size_classes: string; | 
					
						
							|  |  |  |     font_size_formats: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     font_size_input_default_unit: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     font_size_legacy_values: string; | 
					
						
							|  |  |  |     font_size_style_values: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     forced_root_block: string; | 
					
						
							|  |  |  |     forced_root_block_attrs: Record<string, string>; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     format_noneditable_selector: string; | 
					
						
							|  |  |  |     height: number | string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     highlight_on_focus: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     iframe_attrs: Record<string, string>; | 
					
						
							|  |  |  |     images_file_types: string; | 
					
						
							|  |  |  |     images_upload_base_path: string; | 
					
						
							|  |  |  |     images_upload_credentials: boolean; | 
					
						
							|  |  |  |     images_upload_url: string; | 
					
						
							|  |  |  |     indent_use_margin: boolean; | 
					
						
							|  |  |  |     indentation: string; | 
					
						
							|  |  |  |     inline: boolean; | 
					
						
							|  |  |  |     inline_boundaries_selector: string; | 
					
						
							|  |  |  |     language: string; | 
					
						
							|  |  |  |     language_load: boolean; | 
					
						
							|  |  |  |     language_url: string; | 
					
						
							|  |  |  |     line_height_formats: string; | 
					
						
							|  |  |  |     menu: Record<string, { | 
					
						
							|  |  |  |         title: string; | 
					
						
							|  |  |  |         items: string; | 
					
						
							|  |  |  |     }>; | 
					
						
							|  |  |  |     menubar: boolean | string; | 
					
						
							|  |  |  |     model: string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     newdocument_content: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     no_newline_selector: string; | 
					
						
							|  |  |  |     noneditable_class: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     noneditable_regexp: RegExp[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     object_resizing: string; | 
					
						
							|  |  |  |     paste_as_text: boolean; | 
					
						
							|  |  |  |     preview_styles: string; | 
					
						
							|  |  |  |     promotion: boolean; | 
					
						
							|  |  |  |     readonly: boolean; | 
					
						
							|  |  |  |     removed_menuitems: string; | 
					
						
							|  |  |  |     toolbar: boolean | string | string[] | Array<ToolbarGroup>; | 
					
						
							|  |  |  |     toolbar_groups: Record<string, GroupToolbarButtonSpec>; | 
					
						
							|  |  |  |     toolbar_location: ToolbarLocation; | 
					
						
							|  |  |  |     toolbar_mode: ToolbarMode; | 
					
						
							|  |  |  |     toolbar_persist: boolean; | 
					
						
							|  |  |  |     toolbar_sticky: boolean; | 
					
						
							|  |  |  |     toolbar_sticky_offset: number; | 
					
						
							|  |  |  |     text_patterns: Pattern[]; | 
					
						
							|  |  |  |     text_patterns_lookup: DynamicPatternsLookup; | 
					
						
							|  |  |  |     visual: boolean; | 
					
						
							|  |  |  |     visual_anchor_class: string; | 
					
						
							|  |  |  |     visual_table_class: string; | 
					
						
							|  |  |  |     width: number | string; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     xss_sanitization: boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type StyleMap = Record<string, string | number>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface StylesSettings { | 
					
						
							|  |  |  |     allow_script_urls?: boolean; | 
					
						
							|  |  |  |     allow_svg_data_urls?: boolean; | 
					
						
							|  |  |  |     url_converter?: URLConverter; | 
					
						
							|  |  |  |     url_converter_scope?: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Styles { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     parse: (css: string | undefined) => Record<string, string>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     serialize: (styles: StyleMap, elementName?: string) => string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void | boolean; | 
					
						
							|  |  |  | type EventUtilsEvent<T> = NormalizedEvent<T> & { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     metaKey: boolean; | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface Callback$1<T> { | 
					
						
							|  |  |  |     func: EventUtilsCallback<T>; | 
					
						
							|  |  |  |     scope: any; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface CallbackList<T> extends Array<Callback$1<T>> { | 
					
						
							|  |  |  |     fakeName: string | false; | 
					
						
							|  |  |  |     capture: boolean; | 
					
						
							|  |  |  |     nativeHandler: EventListener; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface EventUtilsConstructor { | 
					
						
							|  |  |  |     readonly prototype: EventUtils; | 
					
						
							|  |  |  |     new (): EventUtils; | 
					
						
							|  |  |  |     Event: EventUtils; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class EventUtils { | 
					
						
							|  |  |  |     static Event: EventUtils; | 
					
						
							|  |  |  |     domLoaded: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     events: Record<number, Record<string, CallbackList<any>>>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     private readonly expando; | 
					
						
							|  |  |  |     private hasFocusIn; | 
					
						
							|  |  |  |     private count; | 
					
						
							|  |  |  |     constructor(); | 
					
						
							|  |  |  |     bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>; | 
					
						
							|  |  |  |     bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>; | 
					
						
							|  |  |  |     unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this; | 
					
						
							|  |  |  |     unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this; | 
					
						
							|  |  |  |     unbind(target: any): this; | 
					
						
							|  |  |  |     fire(target: any, name: string, args?: {}): this; | 
					
						
							|  |  |  |     dispatch(target: any, name: string, args?: {}): this; | 
					
						
							|  |  |  |     clean(target: any): this; | 
					
						
							|  |  |  |     destroy(): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     cancel<T>(e: EventUtilsEvent<T>): boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     private executeHandlers; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface SetAttribEvent { | 
					
						
							|  |  |  |     attrElm: HTMLElement; | 
					
						
							|  |  |  |     attrName: string; | 
					
						
							|  |  |  |     attrValue: string | boolean | number | null; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DOMUtilsSettings { | 
					
						
							|  |  |  |     schema: Schema; | 
					
						
							|  |  |  |     url_converter: URLConverter; | 
					
						
							|  |  |  |     url_converter_scope: any; | 
					
						
							|  |  |  |     ownEvents: boolean; | 
					
						
							|  |  |  |     keep_values: boolean; | 
					
						
							|  |  |  |     update_styles: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     root_element: HTMLElement | null; | 
					
						
							|  |  |  |     collect: boolean; | 
					
						
							|  |  |  |     onSetAttrib: (event: SetAttribEvent) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     contentCssCors: boolean; | 
					
						
							|  |  |  |     referrerPolicy: ReferrerPolicy; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Target = Node | Window; | 
					
						
							|  |  |  | type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null; | 
					
						
							|  |  |  | type BoundEvent = [ | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     Target, | 
					
						
							|  |  |  |     string, | 
					
						
							|  |  |  |     EventUtilsCallback<any>, | 
					
						
							|  |  |  |     any | 
					
						
							|  |  |  | ]; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>; | 
					
						
							|  |  |  | type RunResult<T, R> = T extends Array<any> ? R[] : false | R; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface DOMUtils { | 
					
						
							|  |  |  |     doc: Document; | 
					
						
							|  |  |  |     settings: Partial<DOMUtilsSettings>; | 
					
						
							|  |  |  |     win: Window; | 
					
						
							|  |  |  |     files: Record<string, boolean>; | 
					
						
							|  |  |  |     stdMode: boolean; | 
					
						
							|  |  |  |     boxModel: boolean; | 
					
						
							|  |  |  |     styleSheetLoader: StyleSheetLoader; | 
					
						
							|  |  |  |     boundEvents: BoundEvent[]; | 
					
						
							|  |  |  |     styles: Styles; | 
					
						
							|  |  |  |     schema: Schema; | 
					
						
							|  |  |  |     events: EventUtils; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     root: Node | null; | 
					
						
							|  |  |  |     isBlock: { | 
					
						
							|  |  |  |         (node: Node | null): node is HTMLElement; | 
					
						
							|  |  |  |         (node: string): boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     clone: (node: Node, deep: boolean) => Node; | 
					
						
							|  |  |  |     getRoot: () => HTMLElement; | 
					
						
							|  |  |  |     getViewPort: (argWin?: Window) => GeomRect; | 
					
						
							|  |  |  |     getRect: (elm: string | HTMLElement) => GeomRect; | 
					
						
							|  |  |  |     getSize: (elm: string | HTMLElement) => { | 
					
						
							|  |  |  |         w: number; | 
					
						
							|  |  |  |         h: number; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     getParent: { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         <K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null; | 
					
						
							|  |  |  |         <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null; | 
					
						
							|  |  |  |         (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     getParents: { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         <K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>; | 
					
						
							|  |  |  |         <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[]; | 
					
						
							|  |  |  |         (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[]; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     get: { | 
					
						
							|  |  |  |         <T extends Node>(elm: T): T; | 
					
						
							|  |  |  |         (elm: string): HTMLElement | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null; | 
					
						
							|  |  |  |     getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     select: { | 
					
						
							|  |  |  |         <K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>; | 
					
						
							|  |  |  |         <T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[]; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     is: { | 
					
						
							|  |  |  |         <T extends Element>(elm: Node | Node[] | null, selector: string): elm is T; | 
					
						
							|  |  |  |         (elm: Node | Node[] | null, selector: string): boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     create: { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K]; | 
					
						
							|  |  |  |         (name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     createFragment: (html?: string) => DocumentFragment; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     remove: { | 
					
						
							|  |  |  |         <T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T; | 
					
						
							|  |  |  |         <T extends Node>(node: string, keepChildren?: boolean): T | false; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     getStyle: { | 
					
						
							|  |  |  |         (elm: Element, name: string, computed: true): string; | 
					
						
							|  |  |  |         (elm: string | Element | null, name: string, computed?: boolean): string | undefined; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void; | 
					
						
							|  |  |  |     setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     removeAllAttribs: (e: RunArguments<Element>) => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void; | 
					
						
							|  |  |  |     setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void; | 
					
						
							|  |  |  |     getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string; | 
					
						
							|  |  |  |     getAttribs: (elm: string | Element) => NamedNodeMap | Attr[]; | 
					
						
							|  |  |  |     getPos: (elm: string | Element, rootElm?: Node) => { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         x: number; | 
					
						
							|  |  |  |         y: number; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     parseStyle: (cssText: string) => Record<string, string>; | 
					
						
							|  |  |  |     serializeStyle: (stylesArg: StyleMap, name?: string) => string; | 
					
						
							|  |  |  |     addStyle: (cssText: string) => void; | 
					
						
							|  |  |  |     loadCSS: (url: string) => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     hasClass: (elm: string | Element, cls: string) => boolean; | 
					
						
							|  |  |  |     addClass: (elm: RunArguments<Element>, cls: string) => void; | 
					
						
							|  |  |  |     removeClass: (elm: RunArguments<Element>, cls: string) => void; | 
					
						
							|  |  |  |     toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     show: (elm: string | Node | Node[]) => void; | 
					
						
							|  |  |  |     hide: (elm: string | Node | Node[]) => void; | 
					
						
							|  |  |  |     isHidden: (elm: string | Node) => boolean; | 
					
						
							|  |  |  |     uniqueId: (prefix?: string) => string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     setHTML: (elm: RunArguments<Element>, html: string) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getOuterHTML: (elm: string | Node) => string; | 
					
						
							|  |  |  |     setOuterHTML: (elm: string | Node | Node[], html: string) => void; | 
					
						
							|  |  |  |     decode: (text: string) => string; | 
					
						
							|  |  |  |     encode: (text: string) => string; | 
					
						
							|  |  |  |     insertAfter: { | 
					
						
							|  |  |  |         <T extends Node>(node: T | T[], reference: string | Node): T; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         <T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     replace: { | 
					
						
							|  |  |  |         <T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T; | 
					
						
							|  |  |  |         <T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     rename: { | 
					
						
							|  |  |  |         <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K]; | 
					
						
							|  |  |  |         (elm: Element, name: string): Element; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     findCommonAncestor: (a: Node, b: Node) => Node | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R; | 
					
						
							|  |  |  |     run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     isEmpty: (node: Node, elements?: Record<string, any>, options?: ({ | 
					
						
							|  |  |  |         includeZwsp?: boolean; | 
					
						
							|  |  |  |     })) => boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     createRng: () => Range; | 
					
						
							|  |  |  |     nodeIndex: (node: Node, normalized?: boolean) => number; | 
					
						
							|  |  |  |     split: { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined; | 
					
						
							|  |  |  |         <T extends Node>(parentElm: Node, splitElm: T): T | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     bind: { | 
					
						
							|  |  |  |         <K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>; | 
					
						
							|  |  |  |         <K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[]; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     unbind: { | 
					
						
							|  |  |  |         <K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils; | 
					
						
							|  |  |  |         <K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[]; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     fire: (target: Node | Window, name: string, evt?: {}) => EventUtils; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getContentEditable: (node: Node) => string | null; | 
					
						
							|  |  |  |     getContentEditableParent: (node: Node) => string | null; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     isEditable: (node: Node | null | undefined) => boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     destroy: () => void; | 
					
						
							|  |  |  |     isChildOf: (node: Node, parent: Node) => boolean; | 
					
						
							|  |  |  |     dumpRng: (r: Range) => string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ClientRect { | 
					
						
							|  |  |  |     left: number; | 
					
						
							|  |  |  |     top: number; | 
					
						
							|  |  |  |     bottom: number; | 
					
						
							|  |  |  |     right: number; | 
					
						
							|  |  |  |     width: number; | 
					
						
							|  |  |  |     height: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BookmarkManager { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getBookmark: (type?: number, normalized?: boolean) => Bookmark; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     moveToBookmark: (bookmark: Bookmark) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ControlSelection { | 
					
						
							|  |  |  |     isResizable: (elm: Element) => boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     showResizeRect: (elm: HTMLElement) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     hideResizeRect: () => void; | 
					
						
							|  |  |  |     updateResizeRect: (evt: EditorEvent<any>) => void; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface WriterSettings { | 
					
						
							|  |  |  |     element_format?: 'xhtml' | 'html'; | 
					
						
							|  |  |  |     entities?: string; | 
					
						
							|  |  |  |     entity_encoding?: EntityEncoding; | 
					
						
							|  |  |  |     indent?: boolean; | 
					
						
							|  |  |  |     indent_after?: string; | 
					
						
							|  |  |  |     indent_before?: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Attributes = Array<{ | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     name: string; | 
					
						
							|  |  |  |     value: string; | 
					
						
							|  |  |  | }>; | 
					
						
							|  |  |  | interface Writer { | 
					
						
							|  |  |  |     cdata: (text: string) => void; | 
					
						
							|  |  |  |     comment: (text: string) => void; | 
					
						
							|  |  |  |     doctype: (text: string) => void; | 
					
						
							|  |  |  |     end: (name: string) => void; | 
					
						
							|  |  |  |     getContent: () => string; | 
					
						
							|  |  |  |     pi: (name: string, text?: string) => void; | 
					
						
							|  |  |  |     reset: () => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     start: (name: string, attrs?: Attributes | null, empty?: boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     text: (text: string, raw?: boolean) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface HtmlSerializerSettings extends WriterSettings { | 
					
						
							|  |  |  |     inner?: boolean; | 
					
						
							|  |  |  |     validate?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface HtmlSerializer { | 
					
						
							|  |  |  |     serialize: (node: AstNode) => string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings { | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     remove_trailing_brs?: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     url_converter?: URLConverter; | 
					
						
							|  |  |  |     url_converter_scope?: {}; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DomSerializerImpl { | 
					
						
							|  |  |  |     schema: Schema; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     addNodeFilter: (name: string, callback: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     addAttributeFilter: (name: string, callback: ParserFilterCallback) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getNodeFilters: () => ParserFilter[]; | 
					
						
							|  |  |  |     getAttributeFilters: () => ParserFilter[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void; | 
					
						
							|  |  |  |     removeAttributeFilter: (name: string, callback?: ParserFilterCallback) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     serialize: { | 
					
						
							|  |  |  |         (node: Element, parserArgs: { | 
					
						
							|  |  |  |             format: 'tree'; | 
					
						
							|  |  |  |         } & ParserArgs): AstNode; | 
					
						
							|  |  |  |         (node: Element, parserArgs?: ParserArgs): string; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     addRules: (rules: string) => void; | 
					
						
							|  |  |  |     setRules: (rules: string) => void; | 
					
						
							|  |  |  |     addTempAttr: (name: string) => void; | 
					
						
							|  |  |  |     getTempAttrs: () => string[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface DomSerializer extends DomSerializerImpl { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface EditorSelection { | 
					
						
							|  |  |  |     bookmarkManager: BookmarkManager; | 
					
						
							|  |  |  |     controlSelection: ControlSelection; | 
					
						
							|  |  |  |     dom: DOMUtils; | 
					
						
							|  |  |  |     win: Window; | 
					
						
							|  |  |  |     serializer: DomSerializer; | 
					
						
							|  |  |  |     editor: Editor; | 
					
						
							|  |  |  |     collapse: (toStart?: boolean) => void; | 
					
						
							|  |  |  |     setCursorLocation: { | 
					
						
							|  |  |  |         (node: Node, offset: number): void; | 
					
						
							|  |  |  |         (): void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     getContent: { | 
					
						
							|  |  |  |         (args: { | 
					
						
							|  |  |  |             format: 'tree'; | 
					
						
							|  |  |  |         } & Partial<GetSelectionContentArgs>): AstNode; | 
					
						
							|  |  |  |         (args?: Partial<GetSelectionContentArgs>): string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     setContent: (content: string, args?: Partial<SetSelectionContentArgs>) => void; | 
					
						
							|  |  |  |     getBookmark: (type?: number, normalized?: boolean) => Bookmark; | 
					
						
							|  |  |  |     moveToBookmark: (bookmark: Bookmark) => void; | 
					
						
							|  |  |  |     select: (node: Node, content?: boolean) => Node; | 
					
						
							|  |  |  |     isCollapsed: () => boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     isEditable: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     isForward: () => boolean; | 
					
						
							|  |  |  |     setNode: (elm: Element) => Element; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getNode: () => HTMLElement; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     getSel: () => Selection | null; | 
					
						
							|  |  |  |     setRng: (rng: Range, forward?: boolean) => void; | 
					
						
							|  |  |  |     getRng: () => Range; | 
					
						
							|  |  |  |     getStart: (real?: boolean) => Element; | 
					
						
							|  |  |  |     getEnd: (real?: boolean) => Element; | 
					
						
							|  |  |  |     getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[]; | 
					
						
							|  |  |  |     normalize: () => Range; | 
					
						
							|  |  |  |     selectorChanged: (selector: string, callback: (active: boolean, args: { | 
					
						
							|  |  |  |         node: Node; | 
					
						
							|  |  |  |         selector: String; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         parents: Node[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     }) => void) => EditorSelection; | 
					
						
							|  |  |  |     selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: { | 
					
						
							|  |  |  |         node: Node; | 
					
						
							|  |  |  |         selector: String; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         parents: Node[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     }) => void) => { | 
					
						
							|  |  |  |         unbind: () => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getScrollContainer: () => HTMLElement | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void; | 
					
						
							|  |  |  |     placeCaretAt: (clientX: number, clientY: number) => void; | 
					
						
							|  |  |  |     getBoundingClientRect: () => ClientRect | DOMRect; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     expand: (options?: { | 
					
						
							|  |  |  |         type: 'word'; | 
					
						
							|  |  |  |     }) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type EditorCommandCallback<S> = (this: S, ui: boolean, value: any) => void; | 
					
						
							|  |  |  | type EditorCommandsCallback = (command: string, ui: boolean, value?: any) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface Commands { | 
					
						
							|  |  |  |     state: Record<string, (command: string) => boolean>; | 
					
						
							|  |  |  |     exec: Record<string, EditorCommandsCallback>; | 
					
						
							|  |  |  |     value: Record<string, (command: string) => string>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ExecCommandArgs { | 
					
						
							|  |  |  |     skip_focus?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EditorCommandsConstructor { | 
					
						
							|  |  |  |     readonly prototype: EditorCommands; | 
					
						
							|  |  |  |     new (editor: Editor): EditorCommands; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class EditorCommands { | 
					
						
							|  |  |  |     private readonly editor; | 
					
						
							|  |  |  |     private commands; | 
					
						
							|  |  |  |     constructor(editor: Editor); | 
					
						
							|  |  |  |     execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean; | 
					
						
							|  |  |  |     queryCommandState(command: string): boolean; | 
					
						
							|  |  |  |     queryCommandValue(command: string): string; | 
					
						
							|  |  |  |     addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void; | 
					
						
							|  |  |  |     addCommands(commandList: Record<string, EditorCommandsCallback>): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     addCommand<S>(command: string, callback: EditorCommandCallback<S>, scope: S): void; | 
					
						
							|  |  |  |     addCommand(command: string, callback: EditorCommandCallback<Editor>): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     queryCommandSupported(command: string): boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     addQueryStateHandler<S>(command: string, callback: (this: S) => boolean, scope: S): void; | 
					
						
							|  |  |  |     addQueryStateHandler(command: string, callback: (this: Editor) => boolean): void; | 
					
						
							|  |  |  |     addQueryValueHandler<S>(command: string, callback: (this: S) => string, scope: S): void; | 
					
						
							|  |  |  |     addQueryValueHandler(command: string, callback: (this: Editor) => string): void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface RawString { | 
					
						
							|  |  |  |     raw: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Primitive = string | number | boolean | Record<string | number, any> | Function; | 
					
						
							|  |  |  | type TokenisedString = [ | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     string, | 
					
						
							|  |  |  |     ...Primitive[] | 
					
						
							|  |  |  | ]; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type Untranslated = Primitive | TokenisedString | RawString | null | undefined; | 
					
						
							|  |  |  | type TranslatedString = string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface I18n { | 
					
						
							|  |  |  |     getData: () => Record<string, Record<string, string>>; | 
					
						
							|  |  |  |     setCode: (newCode: string) => void; | 
					
						
							|  |  |  |     getCode: () => string; | 
					
						
							|  |  |  |     add: (code: string, items: Record<string, string>) => void; | 
					
						
							|  |  |  |     translate: (text: Untranslated) => TranslatedString; | 
					
						
							|  |  |  |     isRtl: () => boolean; | 
					
						
							|  |  |  |     hasCode: (code: string) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface Observable<T extends {}> { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>; | 
					
						
							|  |  |  |     off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>; | 
					
						
							|  |  |  |     once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>; | 
					
						
							|  |  |  |     hasEventListeners(name: string): boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface URISettings { | 
					
						
							|  |  |  |     base_uri?: URI; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface URIConstructor { | 
					
						
							|  |  |  |     readonly prototype: URI; | 
					
						
							|  |  |  |     new (url: string, settings?: URISettings): URI; | 
					
						
							|  |  |  |     getDocumentBaseUrl: (loc: { | 
					
						
							|  |  |  |         protocol: string; | 
					
						
							|  |  |  |         host?: string; | 
					
						
							|  |  |  |         href?: string; | 
					
						
							|  |  |  |         pathname?: string; | 
					
						
							|  |  |  |     }) => string; | 
					
						
							|  |  |  |     parseDataUri: (uri: string) => { | 
					
						
							|  |  |  |         type: string; | 
					
						
							|  |  |  |         data: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SafeUriOptions { | 
					
						
							|  |  |  |     readonly allow_html_data_urls?: boolean; | 
					
						
							|  |  |  |     readonly allow_script_urls?: boolean; | 
					
						
							|  |  |  |     readonly allow_svg_data_urls?: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class URI { | 
					
						
							|  |  |  |     static parseDataUri(uri: string): { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         type: string | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         data: string; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean; | 
					
						
							|  |  |  |     static getDocumentBaseUrl(loc: { | 
					
						
							|  |  |  |         protocol: string; | 
					
						
							|  |  |  |         host?: string; | 
					
						
							|  |  |  |         href?: string; | 
					
						
							|  |  |  |         pathname?: string; | 
					
						
							|  |  |  |     }): string; | 
					
						
							|  |  |  |     source: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     protocol: string | undefined; | 
					
						
							|  |  |  |     authority: string | undefined; | 
					
						
							|  |  |  |     userInfo: string | undefined; | 
					
						
							|  |  |  |     user: string | undefined; | 
					
						
							|  |  |  |     password: string | undefined; | 
					
						
							|  |  |  |     host: string | undefined; | 
					
						
							|  |  |  |     port: string | undefined; | 
					
						
							|  |  |  |     relative: string | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     path: string; | 
					
						
							|  |  |  |     directory: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     file: string | undefined; | 
					
						
							|  |  |  |     query: string | undefined; | 
					
						
							|  |  |  |     anchor: string | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     settings: URISettings; | 
					
						
							|  |  |  |     constructor(url: string, settings?: URISettings); | 
					
						
							|  |  |  |     setPath(path: string): void; | 
					
						
							|  |  |  |     toRelative(uri: string): string; | 
					
						
							|  |  |  |     toAbsolute(uri: string, noHost?: boolean): string; | 
					
						
							|  |  |  |     isSameOrigin(uri: URI): boolean; | 
					
						
							|  |  |  |     toRelPath(base: string, path: string): string; | 
					
						
							|  |  |  |     toAbsPath(base: string, path: string): string; | 
					
						
							|  |  |  |     getURI(noProtoHost?: boolean): string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EditorManager extends Observable<EditorManagerEventMap> { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     defaultOptions: RawEditorOptions; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     majorVersion: string; | 
					
						
							|  |  |  |     minorVersion: string; | 
					
						
							|  |  |  |     releaseDate: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     activeEditor: Editor | null; | 
					
						
							|  |  |  |     focusedEditor: Editor | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     baseURI: URI; | 
					
						
							|  |  |  |     baseURL: string; | 
					
						
							|  |  |  |     documentBaseURL: string; | 
					
						
							|  |  |  |     i18n: I18n; | 
					
						
							|  |  |  |     suffix: string; | 
					
						
							|  |  |  |     add(this: EditorManager, editor: Editor): Editor; | 
					
						
							|  |  |  |     addI18n: (code: string, item: Record<string, string>) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean; | 
					
						
							|  |  |  |     get(this: EditorManager): Editor[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     get(this: EditorManager, id: number | string): Editor | null; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>; | 
					
						
							|  |  |  |     overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove(this: EditorManager): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     remove(this: EditorManager, selector: string): void; | 
					
						
							|  |  |  |     remove(this: EditorManager, editor: Editor): Editor | null; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     setActive(this: EditorManager, editor: Editor): void; | 
					
						
							|  |  |  |     setup(this: EditorManager): void; | 
					
						
							|  |  |  |     translate: (text: Untranslated) => TranslatedString; | 
					
						
							|  |  |  |     triggerSave: () => void; | 
					
						
							|  |  |  |     _setBaseUrl(this: EditorManager, baseUrl: string): void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EditorObservable extends Observable<EditorEventMap> { | 
					
						
							|  |  |  |     bindPendingEventDelegates(this: Editor): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     toggleNativeEvent(this: Editor, name: string, state: boolean): void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     unbindAllNativeEvents(this: Editor): void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface ProcessorSuccess<T> { | 
					
						
							|  |  |  |     valid: true; | 
					
						
							|  |  |  |     value: T; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ProcessorError { | 
					
						
							|  |  |  |     valid: false; | 
					
						
							|  |  |  |     message: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type SimpleProcessor = (value: unknown) => boolean; | 
					
						
							|  |  |  | type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BuiltInOptionTypeMap { | 
					
						
							|  |  |  |     'string': string; | 
					
						
							|  |  |  |     'number': number; | 
					
						
							|  |  |  |     'boolean': boolean; | 
					
						
							|  |  |  |     'array': any[]; | 
					
						
							|  |  |  |     'function': Function; | 
					
						
							|  |  |  |     'object': any; | 
					
						
							|  |  |  |     'string[]': string[]; | 
					
						
							|  |  |  |     'object[]': any[]; | 
					
						
							|  |  |  |     'regexp': RegExp; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type BuiltInOptionType = keyof BuiltInOptionTypeMap; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface BaseOptionSpec { | 
					
						
							|  |  |  |     immutable?: boolean; | 
					
						
							|  |  |  |     deprecated?: boolean; | 
					
						
							|  |  |  |     docsUrl?: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface BuiltInOptionSpec<K extends BuiltInOptionType> extends BaseOptionSpec { | 
					
						
							|  |  |  |     processor: K; | 
					
						
							|  |  |  |     default?: BuiltInOptionTypeMap[K]; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface SimpleOptionSpec<T> extends BaseOptionSpec { | 
					
						
							|  |  |  |     processor: SimpleProcessor; | 
					
						
							|  |  |  |     default?: T; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface OptionSpec<T, U> extends BaseOptionSpec { | 
					
						
							|  |  |  |     processor: Processor<U>; | 
					
						
							|  |  |  |     default?: T; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Options { | 
					
						
							|  |  |  |     register: { | 
					
						
							|  |  |  |         <K extends BuiltInOptionType>(name: string, spec: BuiltInOptionSpec<K>): void; | 
					
						
							|  |  |  |         <K extends keyof NormalizedEditorOptions>(name: K, spec: OptionSpec<NormalizedEditorOptions[K], EditorOptions[K]> | SimpleOptionSpec<NormalizedEditorOptions[K]>): void; | 
					
						
							|  |  |  |         <T, U>(name: string, spec: OptionSpec<T, U>): void; | 
					
						
							|  |  |  |         <T>(name: string, spec: SimpleOptionSpec<T>): void; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     isRegistered: (name: string) => boolean; | 
					
						
							|  |  |  |     get: { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |         <K extends keyof EditorOptions>(name: K): EditorOptions[K]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         <T>(name: string): T | undefined; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean; | 
					
						
							|  |  |  |     unset: (name: string) => boolean; | 
					
						
							|  |  |  |     isSet: (name: string) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface UploadResult$1 { | 
					
						
							|  |  |  |     element: HTMLImageElement; | 
					
						
							|  |  |  |     status: boolean; | 
					
						
							|  |  |  |     blobInfo: BlobInfo; | 
					
						
							|  |  |  |     uploadUri: string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     removed: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface EditorUpload { | 
					
						
							|  |  |  |     blobCache: BlobCache; | 
					
						
							|  |  |  |     addFilter: (filter: (img: HTMLImageElement) => boolean) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     uploadImages: () => Promise<UploadResult$1[]>; | 
					
						
							|  |  |  |     uploadImagesAuto: () => Promise<UploadResult$1[]>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     scanForImages: () => Promise<BlobInfoImagePair[]>; | 
					
						
							|  |  |  |     destroy: () => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type FormatChangeCallback = (state: boolean, data: { | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     node: Node; | 
					
						
							|  |  |  |     format: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     parents: Element[]; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | }) => void; | 
					
						
							|  |  |  | interface FormatRegistry { | 
					
						
							|  |  |  |     get: { | 
					
						
							|  |  |  |         (name: string): Format[] | undefined; | 
					
						
							|  |  |  |         (): Record<string, Format[]>; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     has: (name: string) => boolean; | 
					
						
							|  |  |  |     register: (name: string | Formats, format?: Format[] | Format) => void; | 
					
						
							|  |  |  |     unregister: (name: string) => Formats; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Formatter extends FormatRegistry { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void; | 
					
						
							|  |  |  |     toggle: (name: string, vars?: FormatVars, node?: Node) => void; | 
					
						
							|  |  |  |     match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean; | 
					
						
							|  |  |  |     closest: (names: string[]) => string | null; | 
					
						
							|  |  |  |     matchAll: (names: string[], vars?: FormatVars) => string[]; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     matchNode: (node: Node | null, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     canApply: (name: string) => boolean; | 
					
						
							|  |  |  |     formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => { | 
					
						
							|  |  |  |         unbind: () => void; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getCssText: (format: string | ApplyFormat) => string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface EditorMode { | 
					
						
							|  |  |  |     isReadOnly: () => boolean; | 
					
						
							|  |  |  |     set: (mode: string) => void; | 
					
						
							|  |  |  |     get: () => string; | 
					
						
							|  |  |  |     register: (mode: string, api: EditorModeApi) => void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EditorModeApi { | 
					
						
							|  |  |  |     activate: () => void; | 
					
						
							|  |  |  |     deactivate: () => void; | 
					
						
							|  |  |  |     editorReadOnly: boolean; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface Model { | 
					
						
							|  |  |  |     readonly table: { | 
					
						
							|  |  |  |         readonly getSelectedCells: () => HTMLTableCellElement[]; | 
					
						
							|  |  |  |         readonly clearSelectedCells: (container: Node) => void; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ModelManager = AddOnManager<Model>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface Plugin { | 
					
						
							|  |  |  |     getMetadata?: () => { | 
					
						
							|  |  |  |         name: string; | 
					
						
							|  |  |  |         url: string; | 
					
						
							|  |  |  |     }; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     init?: (editor: Editor, url: string) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     [key: string]: any; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type PluginManager = AddOnManager<void | Plugin>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface ShortcutsConstructor { | 
					
						
							|  |  |  |     readonly prototype: Shortcuts; | 
					
						
							|  |  |  |     new (editor: Editor): Shortcuts; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type CommandFunc = string | [ | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     string, | 
					
						
							|  |  |  |     boolean, | 
					
						
							|  |  |  |     any | 
					
						
							|  |  |  | ] | (() => void); | 
					
						
							|  |  |  | declare class Shortcuts { | 
					
						
							|  |  |  |     private readonly editor; | 
					
						
							|  |  |  |     private readonly shortcuts; | 
					
						
							|  |  |  |     private pendingPatterns; | 
					
						
							|  |  |  |     constructor(editor: Editor); | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     add(pattern: string, desc: string | null, cmdFunc: CommandFunc, scope?: any): boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove(pattern: string): boolean; | 
					
						
							|  |  |  |     private normalizeCommandFunc; | 
					
						
							|  |  |  |     private createShortcut; | 
					
						
							|  |  |  |     private hasModifier; | 
					
						
							|  |  |  |     private isFunctionKey; | 
					
						
							|  |  |  |     private matchShortcut; | 
					
						
							|  |  |  |     private executeShortcutAction; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | interface RenderResult { | 
					
						
							|  |  |  |     iframeContainer?: HTMLElement; | 
					
						
							|  |  |  |     editorContainer: HTMLElement; | 
					
						
							|  |  |  |     api?: Partial<EditorUiApi>; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface Theme { | 
					
						
							|  |  |  |     ui?: any; | 
					
						
							|  |  |  |     inline?: any; | 
					
						
							|  |  |  |     execCommand?: (command: string, ui?: boolean, value?: any) => boolean; | 
					
						
							|  |  |  |     destroy?: () => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     init?: (editor: Editor, url: string) => void; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     renderUI?: () => Promise<RenderResult> | RenderResult; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getNotificationManagerImpl?: () => NotificationManagerImpl; | 
					
						
							|  |  |  |     getWindowManagerImpl?: () => WindowManagerImpl; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ThemeManager = AddOnManager<void | Theme>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface EditorConstructor { | 
					
						
							|  |  |  |     readonly prototype: Editor; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | declare class Editor implements EditorObservable { | 
					
						
							|  |  |  |     documentBaseUrl: string; | 
					
						
							|  |  |  |     baseUri: URI; | 
					
						
							|  |  |  |     id: string; | 
					
						
							|  |  |  |     plugins: Record<string, Plugin>; | 
					
						
							|  |  |  |     documentBaseURI: URI; | 
					
						
							|  |  |  |     baseURI: URI; | 
					
						
							|  |  |  |     contentCSS: string[]; | 
					
						
							|  |  |  |     contentStyles: string[]; | 
					
						
							|  |  |  |     ui: EditorUi; | 
					
						
							|  |  |  |     mode: EditorMode; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     options: Options; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     editorUpload: EditorUpload; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     shortcuts: Shortcuts; | 
					
						
							|  |  |  |     loadedCSS: Record<string, any>; | 
					
						
							|  |  |  |     editorCommands: EditorCommands; | 
					
						
							|  |  |  |     suffix: string; | 
					
						
							|  |  |  |     editorManager: EditorManager; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     hidden: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     inline: boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     hasVisual: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     isNotDirty: boolean; | 
					
						
							|  |  |  |     annotator: Annotator; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     bodyElement: HTMLElement | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     bookmark: any; | 
					
						
							|  |  |  |     composing: boolean; | 
					
						
							|  |  |  |     container: HTMLElement; | 
					
						
							|  |  |  |     contentAreaContainer: HTMLElement; | 
					
						
							|  |  |  |     contentDocument: Document; | 
					
						
							|  |  |  |     contentWindow: Window; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     delegates: Record<string, EventUtilsCallback<any>> | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     destroyed: boolean; | 
					
						
							|  |  |  |     dom: DOMUtils; | 
					
						
							|  |  |  |     editorContainer: HTMLElement; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     eventRoot: Element | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     formatter: Formatter; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     formElement: HTMLElement | undefined; | 
					
						
							|  |  |  |     formEventDelegate: ((e: Event) => void) | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     hasHiddenInput: boolean; | 
					
						
							|  |  |  |     iframeElement: HTMLIFrameElement | null; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     iframeHTML: string | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     initialized: boolean; | 
					
						
							|  |  |  |     notificationManager: NotificationManager; | 
					
						
							|  |  |  |     orgDisplay: string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     orgVisibility: string | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     parser: DomParser; | 
					
						
							|  |  |  |     quirks: Quirks; | 
					
						
							|  |  |  |     readonly: boolean; | 
					
						
							|  |  |  |     removed: boolean; | 
					
						
							|  |  |  |     schema: Schema; | 
					
						
							|  |  |  |     selection: EditorSelection; | 
					
						
							|  |  |  |     serializer: DomSerializer; | 
					
						
							|  |  |  |     startContent: string; | 
					
						
							|  |  |  |     targetElm: HTMLElement; | 
					
						
							|  |  |  |     theme: Theme; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     model: Model; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     undoManager: UndoManager; | 
					
						
							|  |  |  |     windowManager: WindowManager; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     _beforeUnload: (() => void) | undefined; | 
					
						
							|  |  |  |     _eventDispatcher: EventDispatcher<NativeEventMap> | undefined; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     _nodeChangeDispatcher: NodeChange; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     _pendingNativeEvents: string[]; | 
					
						
							|  |  |  |     _selectionOverrides: SelectionOverrides; | 
					
						
							|  |  |  |     _skinLoaded: boolean; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     _editableRoot: boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates']; | 
					
						
							|  |  |  |     toggleNativeEvent: EditorObservable['toggleNativeEvent']; | 
					
						
							|  |  |  |     unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents']; | 
					
						
							|  |  |  |     fire: EditorObservable['fire']; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     dispatch: EditorObservable['dispatch']; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     on: EditorObservable['on']; | 
					
						
							|  |  |  |     off: EditorObservable['off']; | 
					
						
							|  |  |  |     once: EditorObservable['once']; | 
					
						
							|  |  |  |     hasEventListeners: EditorObservable['hasEventListeners']; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     constructor(id: string, options: RawEditorOptions, editorManager: EditorManager); | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     render(): void; | 
					
						
							|  |  |  |     focus(skipFocus?: boolean): void; | 
					
						
							|  |  |  |     hasFocus(): boolean; | 
					
						
							|  |  |  |     translate(text: Untranslated): TranslatedString; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     getParam<K extends BuiltInOptionType>(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K]; | 
					
						
							|  |  |  |     getParam<K extends keyof NormalizedEditorOptions>(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K]; | 
					
						
							|  |  |  |     getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     hasPlugin(name: string, loaded?: boolean): boolean; | 
					
						
							|  |  |  |     nodeChanged(args?: any): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     addCommand<S>(name: string, callback: EditorCommandCallback<S>, scope: S): void; | 
					
						
							|  |  |  |     addCommand(name: string, callback: EditorCommandCallback<Editor>): void; | 
					
						
							|  |  |  |     addQueryStateHandler<S>(name: string, callback: (this: S) => boolean, scope?: S): void; | 
					
						
							|  |  |  |     addQueryStateHandler(name: string, callback: (this: Editor) => boolean): void; | 
					
						
							|  |  |  |     addQueryValueHandler<S>(name: string, callback: (this: S) => string, scope: S): void; | 
					
						
							|  |  |  |     addQueryValueHandler(name: string, callback: (this: Editor) => string): void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     addShortcut(pattern: string, desc: string, cmdFunc: string | [ | 
					
						
							|  |  |  |         string, | 
					
						
							|  |  |  |         boolean, | 
					
						
							|  |  |  |         any | 
					
						
							|  |  |  |     ] | (() => void), scope?: any): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     execCommand(cmd: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     queryCommandState(cmd: string): boolean; | 
					
						
							|  |  |  |     queryCommandValue(cmd: string): string; | 
					
						
							|  |  |  |     queryCommandSupported(cmd: string): boolean; | 
					
						
							|  |  |  |     show(): void; | 
					
						
							|  |  |  |     hide(): void; | 
					
						
							|  |  |  |     isHidden(): boolean; | 
					
						
							|  |  |  |     setProgressState(state: boolean, time?: number): void; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     load(args?: Partial<SetContentArgs>): string; | 
					
						
							|  |  |  |     save(args?: Partial<GetContentArgs>): string; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     setContent(content: string, args?: Partial<SetContentArgs>): string; | 
					
						
							|  |  |  |     setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode; | 
					
						
							|  |  |  |     setContent(content: Content, args?: Partial<SetContentArgs>): Content; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     getContent(args: { | 
					
						
							|  |  |  |         format: 'tree'; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     } & Partial<GetContentArgs>): AstNode; | 
					
						
							|  |  |  |     getContent(args?: Partial<GetContentArgs>): string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     insertContent(content: string, args?: any): void; | 
					
						
							|  |  |  |     resetContent(initialContent?: string): void; | 
					
						
							|  |  |  |     isDirty(): boolean; | 
					
						
							|  |  |  |     setDirty(state: boolean): void; | 
					
						
							|  |  |  |     getContainer(): HTMLElement; | 
					
						
							|  |  |  |     getContentAreaContainer(): HTMLElement; | 
					
						
							|  |  |  |     getElement(): HTMLElement; | 
					
						
							|  |  |  |     getWin(): Window; | 
					
						
							|  |  |  |     getDoc(): Document; | 
					
						
							|  |  |  |     getBody(): HTMLElement; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     convertURL(url: string, name: string, elm?: string | Element): string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     addVisual(elm?: HTMLElement): void; | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  |     setEditableRoot(state: boolean): void; | 
					
						
							|  |  |  |     hasEditableRoot(): boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove(): void; | 
					
						
							|  |  |  |     destroy(automatic?: boolean): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     uploadImages(): Promise<UploadResult$1[]>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     _scanForImages(): Promise<BlobInfoImagePair[]>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface UrlObject { | 
					
						
							|  |  |  |     prefix: string; | 
					
						
							|  |  |  |     resource: string; | 
					
						
							|  |  |  |     suffix: string; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type WaitState = 'added' | 'loaded'; | 
					
						
							|  |  |  | type AddOnConstructor<T> = (editor: Editor, url: string) => T; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface AddOnManager<T> { | 
					
						
							|  |  |  |     items: AddOnConstructor<T>[]; | 
					
						
							|  |  |  |     urls: Record<string, string>; | 
					
						
							|  |  |  |     lookup: Record<string, { | 
					
						
							|  |  |  |         instance: AddOnConstructor<T>; | 
					
						
							|  |  |  |     }>; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     get: (name: string) => AddOnConstructor<T> | undefined; | 
					
						
							|  |  |  |     requireLangPack: (name: string, languages?: string) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove: (name: string) => void; | 
					
						
							|  |  |  |     createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     load: (name: string, addOnUrl: string | UrlObject) => Promise<void>; | 
					
						
							|  |  |  |     waitFor: (name: string, state?: WaitState) => Promise<void>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface RangeUtils { | 
					
						
							|  |  |  |     walk: (rng: Range, callback: (nodes: Node[]) => void) => void; | 
					
						
							|  |  |  |     split: (rng: Range) => RangeLikeObject; | 
					
						
							|  |  |  |     normalize: (rng: Range) => boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     expand: (rng: Range, options?: { | 
					
						
							|  |  |  |         type: 'word'; | 
					
						
							|  |  |  |     }) => Range; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface ScriptLoaderSettings { | 
					
						
							|  |  |  |     referrerPolicy?: ReferrerPolicy; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface ScriptLoaderConstructor { | 
					
						
							|  |  |  |     readonly prototype: ScriptLoader; | 
					
						
							|  |  |  |     new (): ScriptLoader; | 
					
						
							|  |  |  |     ScriptLoader: ScriptLoader; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class ScriptLoader { | 
					
						
							|  |  |  |     static ScriptLoader: ScriptLoader; | 
					
						
							|  |  |  |     private settings; | 
					
						
							|  |  |  |     private states; | 
					
						
							|  |  |  |     private queue; | 
					
						
							|  |  |  |     private scriptLoadedCallbacks; | 
					
						
							|  |  |  |     private queueLoadedCallbacks; | 
					
						
							|  |  |  |     private loading; | 
					
						
							|  |  |  |     constructor(settings?: ScriptLoaderSettings); | 
					
						
							|  |  |  |     _setReferrerPolicy(referrerPolicy: ReferrerPolicy): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     loadScript(url: string): Promise<void>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     isDone(url: string): boolean; | 
					
						
							|  |  |  |     markDone(url: string): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     add(url: string): Promise<void>; | 
					
						
							|  |  |  |     load(url: string): Promise<void>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     remove(url: string): void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     loadQueue(): Promise<void>; | 
					
						
							|  |  |  |     loadScripts(scripts: string[]): Promise<void>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type TextProcessCallback = (node: Text, offset: number, text: string) => number; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface Spot { | 
					
						
							|  |  |  |     container: Text; | 
					
						
							|  |  |  |     offset: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TextSeeker { | 
					
						
							|  |  |  |     backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null; | 
					
						
							|  |  |  |     forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DomTreeWalkerConstructor { | 
					
						
							|  |  |  |     readonly prototype: DomTreeWalker; | 
					
						
							|  |  |  |     new (startNode: Node, rootNode: Node): DomTreeWalker; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare class DomTreeWalker { | 
					
						
							|  |  |  |     private readonly rootNode; | 
					
						
							|  |  |  |     private node; | 
					
						
							|  |  |  |     constructor(startNode: Node, rootNode: Node); | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     current(): Node | null | undefined; | 
					
						
							|  |  |  |     next(shallow?: boolean): Node | null | undefined; | 
					
						
							|  |  |  |     prev(shallow?: boolean): Node | null | undefined; | 
					
						
							|  |  |  |     prev2(shallow?: boolean): Node | null | undefined; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     private findSibling; | 
					
						
							|  |  |  |     private findPreviousNode; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Version { | 
					
						
							|  |  |  |     major: number; | 
					
						
							|  |  |  |     minor: number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Env { | 
					
						
							|  |  |  |     transparentSrc: string; | 
					
						
							|  |  |  |     documentMode: number; | 
					
						
							|  |  |  |     cacheSuffix: any; | 
					
						
							|  |  |  |     container: any; | 
					
						
							|  |  |  |     canHaveCSP: boolean; | 
					
						
							|  |  |  |     windowsPhone: boolean; | 
					
						
							|  |  |  |     browser: { | 
					
						
							|  |  |  |         current: string | undefined; | 
					
						
							|  |  |  |         version: Version; | 
					
						
							|  |  |  |         isEdge: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         isChromium: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         isIE: () => boolean; | 
					
						
							|  |  |  |         isOpera: () => boolean; | 
					
						
							|  |  |  |         isFirefox: () => boolean; | 
					
						
							|  |  |  |         isSafari: () => boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     os: { | 
					
						
							|  |  |  |         current: string | undefined; | 
					
						
							|  |  |  |         version: Version; | 
					
						
							|  |  |  |         isWindows: () => boolean; | 
					
						
							|  |  |  |         isiOS: () => boolean; | 
					
						
							|  |  |  |         isAndroid: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         isMacOS: () => boolean; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         isLinux: () => boolean; | 
					
						
							|  |  |  |         isSolaris: () => boolean; | 
					
						
							|  |  |  |         isFreeBSD: () => boolean; | 
					
						
							|  |  |  |         isChromeOS: () => boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     deviceType: { | 
					
						
							|  |  |  |         isiPad: () => boolean; | 
					
						
							|  |  |  |         isiPhone: () => boolean; | 
					
						
							|  |  |  |         isTablet: () => boolean; | 
					
						
							|  |  |  |         isPhone: () => boolean; | 
					
						
							|  |  |  |         isTouch: () => boolean; | 
					
						
							|  |  |  |         isWebView: () => boolean; | 
					
						
							|  |  |  |         isDesktop: () => boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface FakeClipboardItem { | 
					
						
							|  |  |  |     readonly items: Record<string, any>; | 
					
						
							|  |  |  |     readonly types: ReadonlyArray<string>; | 
					
						
							|  |  |  |     readonly getType: <D = any>(type: string) => D | undefined; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface FakeClipboard { | 
					
						
							|  |  |  |     readonly FakeClipboardItem: (items: Record<string, any>) => FakeClipboardItem; | 
					
						
							|  |  |  |     readonly write: (data: FakeClipboardItem[]) => void; | 
					
						
							|  |  |  |     readonly read: () => FakeClipboardItem[] | undefined; | 
					
						
							|  |  |  |     readonly clear: () => void; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface FocusManager { | 
					
						
							|  |  |  |     isEditorUIElement: (elm: Element) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface EntitiesMap { | 
					
						
							|  |  |  |     [name: string]: string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Entities { | 
					
						
							|  |  |  |     encodeRaw: (text: string, attr?: boolean) => string; | 
					
						
							|  |  |  |     encodeAllRaw: (text: string) => string; | 
					
						
							|  |  |  |     encodeNumeric: (text: string, attr?: boolean) => string; | 
					
						
							|  |  |  |     encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     getEncodeFunc: (name: string, entities?: string) => (text: string, attr?: boolean) => string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     decode: (text: string) => string; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface IconPack { | 
					
						
							|  |  |  |     icons: Record<string, string>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface IconManager { | 
					
						
							|  |  |  |     add: (id: string, iconPack: IconPack) => void; | 
					
						
							|  |  |  |     get: (id: string) => IconPack; | 
					
						
							|  |  |  |     has: (id: string) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface Resource { | 
					
						
							|  |  |  |     load: <T = any>(id: string, url: string) => Promise<T>; | 
					
						
							|  |  |  |     add: (id: string, data: any) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     unload: (id: string) => void; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | type TextPatterns_d_Pattern = Pattern; | 
					
						
							|  |  |  | type TextPatterns_d_RawPattern = RawPattern; | 
					
						
							|  |  |  | type TextPatterns_d_DynamicPatternsLookup = DynamicPatternsLookup; | 
					
						
							|  |  |  | type TextPatterns_d_RawDynamicPatternsLookup = RawDynamicPatternsLookup; | 
					
						
							|  |  |  | type TextPatterns_d_DynamicPatternContext = DynamicPatternContext; | 
					
						
							|  |  |  | type TextPatterns_d_BlockCmdPattern = BlockCmdPattern; | 
					
						
							|  |  |  | type TextPatterns_d_BlockPattern = BlockPattern; | 
					
						
							|  |  |  | type TextPatterns_d_BlockFormatPattern = BlockFormatPattern; | 
					
						
							|  |  |  | type TextPatterns_d_InlineCmdPattern = InlineCmdPattern; | 
					
						
							|  |  |  | type TextPatterns_d_InlinePattern = InlinePattern; | 
					
						
							|  |  |  | type TextPatterns_d_InlineFormatPattern = InlineFormatPattern; | 
					
						
							|  |  |  | declare namespace TextPatterns_d { | 
					
						
							|  |  |  |     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, }; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface Delay { | 
					
						
							|  |  |  |     setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number; | 
					
						
							|  |  |  |     setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type UploadResult = UploadResult$2; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | interface ImageUploader { | 
					
						
							|  |  |  |     upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-06-29 05:45:21 +08:00
										 |  |  | type ArrayCallback$1<T, R> = (this: any, x: T, i: number, xs: ArrayLike<T>) => R; | 
					
						
							|  |  |  | type ObjCallback$1<T, R> = (this: any, value: T, key: string, obj: Record<string, T>) => R; | 
					
						
							|  |  |  | type ArrayCallback<T, R> = ArrayCallback$1<T, R>; | 
					
						
							|  |  |  | type ObjCallback<T, R> = ObjCallback$1<T, R>; | 
					
						
							|  |  |  | type WalkCallback<T> = (this: any, o: T, i: string, n: keyof T | undefined) => boolean | void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  | interface Tools { | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     is: (obj: any, type?: string) => boolean; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     isArray: <T>(arr: any) => arr is Array<T>; | 
					
						
							|  |  |  |     inArray: <T>(arr: ArrayLike<T>, value: T) => number; | 
					
						
							|  |  |  |     grep: { | 
					
						
							|  |  |  |         <T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[]; | 
					
						
							|  |  |  |         <T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[]; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     trim: (str: string | null | undefined) => string; | 
					
						
							|  |  |  |     toArray: <T>(obj: ArrayLike<T>) => T[]; | 
					
						
							|  |  |  |     hasOwn: (obj: any, name: string) => boolean; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     makeMap: (items: ArrayLike<string> | string | undefined, delim?: string | RegExp, map?: Record<string, {}>) => Record<string, {}>; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     each: { | 
					
						
							|  |  |  |         <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean; | 
					
						
							|  |  |  |         <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     map: { | 
					
						
							|  |  |  |         <T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[]; | 
					
						
							|  |  |  |         <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[]; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     extend: (obj: Object, ext: Object, ...objs: Object[]) => any; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     walk: <T extends Record<string, any>>(obj: T, f: WalkCallback<T>, n?: keyof T, scope?: any) => void; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     resolve: (path: string, o?: Object) => any; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  |     explode: (s: string | string[], d?: string | RegExp) => string[]; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     _addCacheSuffix: (url: string) => string; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface KeyboardLikeEvent { | 
					
						
							|  |  |  |     shiftKey: boolean; | 
					
						
							|  |  |  |     ctrlKey: boolean; | 
					
						
							|  |  |  |     altKey: boolean; | 
					
						
							|  |  |  |     metaKey: boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface VK { | 
					
						
							|  |  |  |     BACKSPACE: number; | 
					
						
							|  |  |  |     DELETE: number; | 
					
						
							|  |  |  |     DOWN: number; | 
					
						
							|  |  |  |     ENTER: number; | 
					
						
							|  |  |  |     ESC: number; | 
					
						
							|  |  |  |     LEFT: number; | 
					
						
							|  |  |  |     RIGHT: number; | 
					
						
							|  |  |  |     SPACEBAR: number; | 
					
						
							|  |  |  |     TAB: number; | 
					
						
							|  |  |  |     UP: number; | 
					
						
							|  |  |  |     PAGE_UP: number; | 
					
						
							|  |  |  |     PAGE_DOWN: number; | 
					
						
							|  |  |  |     END: number; | 
					
						
							|  |  |  |     HOME: number; | 
					
						
							|  |  |  |     modifierPressed: (e: KeyboardLikeEvent) => boolean; | 
					
						
							|  |  |  |     metaKeyPressed: (e: KeyboardLikeEvent) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface DOMUtilsNamespace { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     DOM: DOMUtils; | 
					
						
							|  |  |  |     nodeIndex: (node: Node, normalized?: boolean) => number; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface RangeUtilsNamespace { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     (dom: DOMUtils): RangeUtils; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     compareRanges: (rng1: RangeLikeObject, rng2: RangeLikeObject) => boolean; | 
					
						
							|  |  |  |     getCaretRangeFromPoint: (clientX: number, clientY: number, doc: Document) => Range; | 
					
						
							|  |  |  |     getSelectedNode: (range: Range) => Node; | 
					
						
							|  |  |  |     getNode: (container: Node, offset: number) => Node; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface AddOnManagerNamespace { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     <T>(): AddOnManager<T>; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     language: string | undefined; | 
					
						
							|  |  |  |     languageLoad: boolean; | 
					
						
							|  |  |  |     baseURL: string; | 
					
						
							|  |  |  |     PluginManager: PluginManager; | 
					
						
							|  |  |  |     ThemeManager: ThemeManager; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     ModelManager: ModelManager; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  | } | 
					
						
							|  |  |  | interface BookmarkManagerNamespace { | 
					
						
							|  |  |  |     (selection: EditorSelection): BookmarkManager; | 
					
						
							|  |  |  |     isBookmarkNode: (node: Node) => boolean; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | interface TinyMCE extends EditorManager { | 
					
						
							|  |  |  |     geom: { | 
					
						
							|  |  |  |         Rect: Rect; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     util: { | 
					
						
							|  |  |  |         Delay: Delay; | 
					
						
							|  |  |  |         Tools: Tools; | 
					
						
							|  |  |  |         VK: VK; | 
					
						
							|  |  |  |         URI: URIConstructor; | 
					
						
							|  |  |  |         EventDispatcher: EventDispatcherConstructor<any>; | 
					
						
							|  |  |  |         Observable: Observable<any>; | 
					
						
							|  |  |  |         I18n: I18n; | 
					
						
							|  |  |  |         LocalStorage: Storage; | 
					
						
							|  |  |  |         ImageUploader: ImageUploader; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     dom: { | 
					
						
							|  |  |  |         EventUtils: EventUtilsConstructor; | 
					
						
							|  |  |  |         TreeWalker: DomTreeWalkerConstructor; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         DOMUtils: DOMUtilsNamespace; | 
					
						
							|  |  |  |         ScriptLoader: ScriptLoaderConstructor; | 
					
						
							|  |  |  |         RangeUtils: RangeUtilsNamespace; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection; | 
					
						
							|  |  |  |         BookmarkManager: BookmarkManagerNamespace; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         Selection: (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection; | 
					
						
							|  |  |  |         StyleSheetLoader: (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         Event: EventUtils; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |     html: { | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         Styles: (settings?: StylesSettings, schema?: Schema) => Styles; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |         Entities: Entities; | 
					
						
							|  |  |  |         Node: AstNodeConstructor; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |         Schema: (settings?: SchemaSettings) => Schema; | 
					
						
							|  |  |  |         DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser; | 
					
						
							|  |  |  |         Writer: (settings?: WriterSettings) => Writer; | 
					
						
							|  |  |  |         Serializer: (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  |     AddOnManager: AddOnManagerNamespace; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     Annotator: (editor: Editor) => Annotator; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     Editor: EditorConstructor; | 
					
						
							|  |  |  |     EditorCommands: EditorCommandsConstructor; | 
					
						
							|  |  |  |     EditorManager: EditorManager; | 
					
						
							|  |  |  |     EditorObservable: EditorObservable; | 
					
						
							|  |  |  |     Env: Env; | 
					
						
							|  |  |  |     FocusManager: FocusManager; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     Formatter: (editor: Editor) => Formatter; | 
					
						
							|  |  |  |     NotificationManager: (editor: Editor) => NotificationManager; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     Shortcuts: ShortcutsConstructor; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     UndoManager: (editor: Editor) => UndoManager; | 
					
						
							|  |  |  |     WindowManager: (editor: Editor) => WindowManager; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     DOM: DOMUtils; | 
					
						
							|  |  |  |     ScriptLoader: ScriptLoader; | 
					
						
							|  |  |  |     PluginManager: PluginManager; | 
					
						
							|  |  |  |     ThemeManager: ThemeManager; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     ModelManager: ModelManager; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     IconManager: IconManager; | 
					
						
							|  |  |  |     Resource: Resource; | 
					
						
							| 
									
										
										
										
											2022-07-18 01:33:03 +08:00
										 |  |  |     FakeClipboard: FakeClipboard; | 
					
						
							| 
									
										
										
										
											2022-02-06 00:55:53 +08:00
										 |  |  |     trim: Tools['trim']; | 
					
						
							|  |  |  |     isArray: Tools['isArray']; | 
					
						
							|  |  |  |     is: Tools['is']; | 
					
						
							|  |  |  |     toArray: Tools['toArray']; | 
					
						
							|  |  |  |     makeMap: Tools['makeMap']; | 
					
						
							|  |  |  |     each: Tools['each']; | 
					
						
							|  |  |  |     map: Tools['map']; | 
					
						
							|  |  |  |     grep: Tools['grep']; | 
					
						
							|  |  |  |     inArray: Tools['inArray']; | 
					
						
							|  |  |  |     extend: Tools['extend']; | 
					
						
							|  |  |  |     walk: Tools['walk']; | 
					
						
							|  |  |  |     resolve: Tools['resolve']; | 
					
						
							|  |  |  |     explode: Tools['explode']; | 
					
						
							|  |  |  |     _addCacheSuffix: Tools['_addCacheSuffix']; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | declare const tinymce: TinyMCE; | 
					
						
							| 
									
										
										
										
											2023-02-18 05:16:42 +08:00
										 |  |  | export { 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 }; |