UNPKG

tinymce

Version:

Web based JavaScript HTML WYSIWYG editor control.

1,307 lines 129 kB
interface StringPathBookmark { start: string; end?: string; forward?: boolean; } interface RangeBookmark { rng: Range; forward?: boolean; } interface IdBookmark { id: string; keep?: boolean; forward?: boolean; } interface IndexBookmark { name: string; index: number; } interface PathBookmark { start: number[]; end?: number[]; isFakeCaret?: boolean; forward?: boolean; } type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark; type NormalizedEvent<E, T = any> = E & { readonly type: string; readonly target: T; readonly isDefaultPrevented: () => boolean; readonly preventDefault: () => void; readonly isPropagationStopped: () => boolean; readonly stopPropagation: () => void; readonly isImmediatePropagationStopped: () => boolean; readonly stopImmediatePropagation: () => void; }; type MappedEvent<T extends {}, K extends string> = K extends keyof T ? T[K] : any; interface NativeEventMap { beforepaste: Event; blur: FocusEvent; beforeinput: InputEvent; click: MouseEvent; compositionend: Event; compositionstart: Event; compositionupdate: Event; contextmenu: PointerEvent; copy: ClipboardEvent; cut: ClipboardEvent; dblclick: MouseEvent; drag: DragEvent; dragdrop: DragEvent; dragend: DragEvent; draggesture: DragEvent; dragover: DragEvent; dragstart: DragEvent; drop: DragEvent; focus: FocusEvent; focusin: FocusEvent; focusout: FocusEvent; input: InputEvent; keydown: KeyboardEvent; keypress: KeyboardEvent; keyup: KeyboardEvent; mousedown: MouseEvent; mouseenter: MouseEvent; mouseleave: MouseEvent; mousemove: MouseEvent; mouseout: MouseEvent; mouseover: MouseEvent; mouseup: MouseEvent; paste: ClipboardEvent; selectionchange: Event; submit: Event; touchend: TouchEvent; touchmove: TouchEvent; touchstart: TouchEvent; touchcancel: TouchEvent; wheel: WheelEvent; } type EditorEvent<T> = NormalizedEvent<T>; interface EventDispatcherSettings { scope?: any; toggleEvent?: (name: string, state: boolean) => void | boolean; beforeFire?: <T>(args: EditorEvent<T>) => void; } interface EventDispatcherConstructor<T extends {}> { readonly prototype: EventDispatcher<T>; new (settings?: EventDispatcherSettings): EventDispatcher<T>; isNative: (name: string) => boolean; } declare class EventDispatcher<T extends {}> { static isNative(name: string): boolean; private readonly settings; private readonly scope; private readonly toggleEvent; private bindings; constructor(settings?: EventDispatcherSettings); fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>; on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void | boolean), prepend?: boolean, extra?: {}): this; off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this; once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this; has(name: string): boolean; } type UndoLevelType = 'fragmented' | 'complete'; interface BaseUndoLevel { type: UndoLevelType; bookmark: Bookmark | null; beforeBookmark: Bookmark | null; } interface FragmentedUndoLevel extends BaseUndoLevel { type: 'fragmented'; fragments: string[]; content: ''; } interface CompleteUndoLevel extends BaseUndoLevel { type: 'complete'; fragments: null; content: string; } type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel; type UndoLevel = NewUndoLevel & { bookmark: Bookmark; }; interface UndoManager { data: UndoLevel[]; typing: boolean; add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null; dispatchChange: () => void; beforeChange: () => void; undo: () => UndoLevel | undefined; redo: () => UndoLevel | undefined; clear: () => void; reset: () => void; hasUndo: () => boolean; hasRedo: () => boolean; transact: (callback: () => void) => UndoLevel | null; ignore: (callback: () => void) => void; extra: (callback1: () => void, callback2: () => void) => void; } type SchemaType = 'html4' | 'html5' | 'html5-strict'; 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; wrap_block_elements?: string; } interface SchemaSettings extends ElementSettings { custom_elements?: string | Record<string, CustomElementSpec>; 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; padd_empty_block_inline_children?: boolean; } interface Attribute { required?: boolean; defaultValue?: string; forcedValue?: string; validValues?: Record<string, {}>; } interface DefaultAttribute { name: string; value: string; } interface AttributePattern extends Attribute { pattern: RegExp; } interface ElementRule { attributes: Record<string, Attribute>; attributesDefault?: DefaultAttribute[]; attributesForced?: DefaultAttribute[]; attributesOrder: string[]; attributePatterns?: AttributePattern[]; attributesRequired?: string[]; paddEmpty?: boolean; removeEmpty?: boolean; removeEmptyAttrs?: boolean; paddInEmptyBlock?: boolean; } interface SchemaElement extends ElementRule { outputName?: string; parentsRequired?: string[]; pattern?: RegExp; } interface SchemaMap { [name: string]: {}; } interface SchemaRegExpMap { [name: string]: RegExp; } interface CustomElementSpec { extends?: string; attributes?: string[]; children?: string[]; padEmpty?: boolean; } interface Schema { type: SchemaType; children: Record<string, SchemaMap>; elements: Record<string, SchemaElement>; getValidStyles: () => Record<string, string[]> | undefined; getValidClasses: () => Record<string, SchemaMap> | undefined; getBlockElements: () => SchemaMap; getInvalidStyles: () => Record<string, SchemaMap> | undefined; getVoidElements: () => SchemaMap; getTextBlockElements: () => SchemaMap; getTextInlineElements: () => SchemaMap; getBoolAttrs: () => SchemaMap; getElementRule: (name: string) => SchemaElement | undefined; getSelfClosingElements: () => SchemaMap; getNonEmptyElements: () => SchemaMap; getMoveCaretBeforeOnEnterElements: () => SchemaMap; getWhitespaceElements: () => SchemaMap; getTransparentElements: () => SchemaMap; getSpecialElements: () => SchemaRegExpMap; isValidChild: (name: string, child: string) => boolean; isValid: (name: string, attr?: string) => boolean; isBlock: (name: string) => boolean; isInline: (name: string) => boolean; isWrapper: (name: string) => boolean; getCustomElements: () => SchemaMap; addValidElements: (validElements: string) => void; setValidElements: (validElements: string) => void; addCustomElements: (customElements: string | Record<string, CustomElementSpec>) => void; addValidChildren: (validChildren: any) => void; } type Attributes$1 = Array<{ name: string; value: string; }> & { map: Record<string, string>; }; interface AstNodeConstructor { readonly prototype: AstNode; new (name: string, type: number): AstNode; create(name: string, attrs?: Record<string, string>): AstNode; } declare class AstNode { static create(name: string, attrs?: Record<string, string>): AstNode; name: string; type: number; attributes?: Attributes$1; value?: string; parent?: AstNode | null; firstChild?: AstNode | null; lastChild?: AstNode | null; next?: AstNode | null; prev?: AstNode | null; raw?: boolean; constructor(name: string, type: number); replace(node: AstNode): AstNode; attr(name: string, value: string | null | undefined): AstNode | undefined; attr(name: Record<string, string | null | undefined> | undefined): AstNode | undefined; attr(name: string): string | undefined; clone(): AstNode; wrap(wrapper: AstNode): AstNode; unwrap(): void; remove(): AstNode; append(node: AstNode): AstNode; insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode; getAll(name: string): AstNode[]; children(): AstNode[]; empty(): AstNode; isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean; walk(prev?: boolean): AstNode | null | undefined; } type Content = string | AstNode; type ContentFormat = 'raw' | 'text' | 'html' | 'tree'; interface GetContentArgs { format: ContentFormat; get: boolean; getInner: boolean; no_events?: boolean; save?: boolean; source_view?: boolean; [key: string]: any; } interface SetContentArgs { format: string; set: boolean; content: Content; no_events?: boolean; no_selection?: boolean; paste?: boolean; load?: boolean; initial?: boolean; [key: string]: any; } interface GetSelectionContentArgs extends GetContentArgs { selection?: boolean; contextual?: boolean; } interface SetSelectionContentArgs extends SetContentArgs { content: string; selection?: boolean; } interface BlobInfoData { id?: string; name?: string; filename?: string; blob: Blob; base64: string; blobUri?: string; uri?: string; } interface BlobInfo { id: () => string; name: () => string; filename: () => string; blob: () => Blob; base64: () => string; blobUri: () => string; uri: () => string | undefined; } interface BlobCache { create: { (o: BlobInfoData): BlobInfo; (id: string, blob: Blob, base64: string, name?: string, filename?: string): BlobInfo; }; add: (blobInfo: BlobInfo) => void; get: (id: string) => BlobInfo | undefined; getByUri: (blobUri: string) => BlobInfo | undefined; getByData: (base64: string, type: string) => BlobInfo | undefined; findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined; removeByUri: (blobUri: string) => void; destroy: () => void; } interface BlobInfoImagePair { image: HTMLImageElement; blobInfo: BlobInfo; } declare class NodeChange { private readonly editor; private lastPath; constructor(editor: Editor); nodeChanged(args?: Record<string, any>): void; private isSameElementPath; } interface SelectionOverrides { showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null; showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void; hideFakeCaret: () => void; destroy: () => void; } interface Quirks { refreshContentEditable(): void; isHidden(): boolean; } type DecoratorData = Record<string, any>; type Decorator = (uid: string, data: DecoratorData) => { attributes?: {}; classes?: string[]; }; type AnnotationListener = (state: boolean, name: string, data?: { uid: string; nodes: any[]; }) => void; type AnnotationListenerApi = AnnotationListener; interface AnnotatorSettings { decorate: Decorator; persistent?: boolean; } interface Annotator { register: (name: string, settings: AnnotatorSettings) => void; annotate: (name: string, data: DecoratorData) => void; annotationChanged: (name: string, f: AnnotationListenerApi) => void; remove: (name: string) => void; removeAll: (name: string) => void; getAll: (name: string) => Record<string, Element[]>; } interface IsEmptyOptions { readonly skipBogus?: boolean; readonly includeZwsp?: boolean; readonly checkRootAsContent?: boolean; readonly isContent?: (node: Node) => boolean; } interface GeomRect { readonly x: number; readonly y: number; readonly w: number; readonly h: number; } interface Rect { inflate: (rect: GeomRect, w: number, h: number) => GeomRect; relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect; findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null; intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null; clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect; create: (x: number, y: number, w: number, h: number) => GeomRect; fromClientRect: (clientRect: DOMRect) => GeomRect; } interface NotificationManagerImpl { open: (spec: NotificationSpec, closeCallback: () => void, hasEditorFocus: () => boolean) => NotificationApi; close: <T extends NotificationApi>(notification: T) => void; getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec; } interface NotificationSpec { type?: 'info' | 'warning' | 'error' | 'success'; text: string; icon?: string; progressBar?: boolean; timeout?: number; } interface NotificationApi { close: () => void; progressBar: { value: (percent: number) => void; }; text: (text: string) => void; reposition: () => void; getEl: () => HTMLElement; settings: NotificationSpec; } interface NotificationManager { open: (spec: NotificationSpec) => NotificationApi; close: () => void; getNotifications: () => NotificationApi[]; } interface UploadFailure { message: string; remove?: boolean; } type ProgressFn = (percent: number) => void; type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>; interface UploadResult$2 { url: string; blobInfo: BlobInfo; status: boolean; error?: UploadFailure; } type BlockPatternTrigger = 'enter' | 'space'; interface RawPattern { start?: any; end?: any; format?: any; cmd?: any; value?: any; replacement?: any; trigger?: BlockPatternTrigger; } interface InlineBasePattern { readonly start: string; readonly end: string; } interface InlineFormatPattern extends InlineBasePattern { readonly type: 'inline-format'; readonly format: string[]; } interface InlineCmdPattern extends InlineBasePattern { readonly type: 'inline-command'; readonly cmd: string; readonly value?: any; } type InlinePattern = InlineFormatPattern | InlineCmdPattern; interface BlockBasePattern { readonly start: string; readonly trigger: BlockPatternTrigger; } interface BlockFormatPattern extends BlockBasePattern { readonly type: 'block-format'; readonly format: string; } interface BlockCmdPattern extends BlockBasePattern { readonly type: 'block-command'; readonly cmd: string; readonly value?: any; } type BlockPattern = BlockFormatPattern | BlockCmdPattern; type Pattern = InlinePattern | BlockPattern; interface DynamicPatternContext { readonly text: string; readonly block: Element; } type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[]; type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[]; interface AlertBannerSpec { type: 'alertbanner'; level: 'info' | 'warn' | 'error' | 'success'; text: string; icon: string; url?: string; } interface ButtonSpec { type: 'button'; text: string; enabled?: boolean; primary?: boolean; name?: string; icon?: string; borderless?: boolean; buttonType?: 'primary' | 'secondary' | 'toolbar'; context?: string; } interface FormComponentSpec { type: string; name: string; } interface FormComponentWithLabelSpec extends FormComponentSpec { label?: string; } interface CheckboxSpec extends FormComponentSpec { type: 'checkbox'; label: string; enabled?: boolean; context?: string; } interface CollectionSpec extends FormComponentWithLabelSpec { type: 'collection'; context?: string; } interface CollectionItem { value: string; text: string; icon: string; } interface ColorInputSpec extends FormComponentWithLabelSpec { type: 'colorinput'; storageKey?: string; context?: string; } interface ColorPickerSpec extends FormComponentWithLabelSpec { type: 'colorpicker'; } interface CustomEditorInit { setValue: (value: string) => void; getValue: () => string; destroy: () => void; } type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>; interface CustomEditorOldSpec extends FormComponentSpec { type: 'customeditor'; tag?: string; init: (e: HTMLElement) => Promise<CustomEditorInit>; } interface CustomEditorNewSpec extends FormComponentSpec { type: 'customeditor'; tag?: string; scriptId: string; scriptUrl: string; onFocus?: (e: HTMLElement) => void; settings?: any; } type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec; interface DropZoneSpec extends FormComponentWithLabelSpec { type: 'dropzone'; context?: string; } interface GridSpec { type: 'grid'; columns: number; items: BodyComponentSpec[]; } interface HtmlPanelSpec { type: 'htmlpanel'; html: string; onInit?: (el: HTMLElement) => void; presets?: 'presentation' | 'document'; stretched?: boolean; } interface IframeSpec extends FormComponentWithLabelSpec { type: 'iframe'; border?: boolean; sandboxed?: boolean; streamContent?: boolean; transparent?: boolean; } interface ImagePreviewSpec extends FormComponentSpec { type: 'imagepreview'; height?: string; } interface InputSpec extends FormComponentWithLabelSpec { type: 'input'; inputMode?: string; placeholder?: string; maximized?: boolean; enabled?: boolean; context?: string; } type Alignment = 'start' | 'center' | 'end'; interface LabelSpec { type: 'label'; label: string; items: BodyComponentSpec[]; align?: Alignment; for?: string; } interface ListBoxSingleItemSpec { text: string; value: string; } interface ListBoxNestedItemSpec { text: string; items: ListBoxItemSpec[]; } type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec; interface ListBoxSpec extends FormComponentWithLabelSpec { type: 'listbox'; items: ListBoxItemSpec[]; disabled?: boolean; context?: string; } interface PanelSpec { type: 'panel'; classes?: string[]; items: BodyComponentSpec[]; } interface SelectBoxItemSpec { text: string; value: string; } interface SelectBoxSpec extends FormComponentWithLabelSpec { type: 'selectbox'; items: SelectBoxItemSpec[]; size?: number; enabled?: boolean; context?: string; } interface SizeInputSpec extends FormComponentWithLabelSpec { type: 'sizeinput'; constrain?: boolean; enabled?: boolean; context?: string; } interface SliderSpec extends FormComponentSpec { type: 'slider'; label: string; min?: number; max?: number; } interface TableSpec { type: 'table'; header: string[]; cells: string[][]; } interface TextAreaSpec extends FormComponentWithLabelSpec { type: 'textarea'; placeholder?: string; maximized?: boolean; enabled?: boolean; context?: string; } interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> { enabled?: boolean; tooltip?: string; icon?: string; text?: string; onSetup?: (api: I) => (api: I) => void; context?: string; } interface BaseToolbarButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; setText: (text: string) => void; setIcon: (icon: string) => void; } interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> { type?: 'button'; onAction: (api: ToolbarButtonInstanceApi) => void; shortcut?: string; } 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; } interface CommonMenuItemSpec { enabled?: boolean; text?: string; value?: string; meta?: Record<string, any>; shortcut?: string; context?: string; } interface CommonMenuItemInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; } 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; label?: 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 ResetImageItemSpec extends CommonMenuItemSpec { icon: string; type: 'resetimage'; label: string; tooltip?: string; value: string; } interface ImageMenuItemSpec extends CommonMenuItemSpec { type?: 'imageitem'; url: string; label?: string; tooltip?: string; } interface FancyActionArgsMap { inserttable: { numRows: number; numColumns: number; }; colorswatch: { value: string; }; imageselect: { 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; }; } interface ImageSelectMenuItemSpec extends BaseFancyMenuItemSpec<'imageselect'> { fancytype: 'imageselect'; select?: (value: string) => boolean; initData: { columns: number; items: (ImageMenuItemSpec | ResetImageItemSpec)[]; }; } type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec | ImageSelectMenuItemSpec; 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 { setTooltip: (tooltip: string) => void; setIconFill: (id: string, value: string) => void; } type MenuButtonItemTypes = NestedMenuItemContents; type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void; interface MenuButtonFetchContext { pattern: string; } interface BaseMenuButtonSpec { buttonType?: 'default' | 'bordered'; 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; context?: string; } interface BaseMenuButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; isActive: () => boolean; setActive: (state: boolean) => void; setTooltip: (tooltip: string) => 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 | ImageMenuItemSpec; type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void; type SelectPredicate = (value: string) => boolean; type PresetTypes = 'color' | 'normal' | 'listpreview' | 'imageselector'; 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; context?: string; } interface ToolbarSplitButtonInstanceApi { isEnabled: () => boolean; setEnabled: (state: boolean) => void; setIconFill: (id: string, value: string) => void; isActive: () => boolean; setActive: (state: boolean) => void; setTooltip: (tooltip: string) => 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; shortcut?: string; } 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; customStateIcon?: string; customStateIconTooltip?: string; } 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; picker_text?: string; context?: string; } 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[]; } interface DialogToggleMenuItemSpec extends CommonMenuItemSpec { type?: 'togglemenuitem'; name: string; } type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec; interface BaseDialogFooterButtonSpec { name?: string; align?: 'start' | 'end'; primary?: boolean; enabled?: boolean; icon?: string; buttonType?: 'primary' | 'secondary'; context?: string; } interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec { type: 'submit' | 'cancel' | 'custom'; text: string; } interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec { type: 'menu'; text?: string; tooltip?: string; icon?: string; items: DialogFooterMenuButtonItemSpec[]; } interface DialogFooterToggleButtonSpec extends BaseDialogFooterButtonSpec { type: 'togglebutton'; tooltip?: string; icon?: string; text?: string; active?: boolean; } type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec | DialogFooterToggleButtonSpec; interface TabSpec { name?: string; title: string; items: BodyComponentSpec[]; } interface TabPanelSpec { type: 'tabpanel'; tabs: TabSpec[]; } type DialogDataItem = any; type DialogData = Record<string, DialogDataItem>; interface DialogInstanceApi<T extends DialogData> { getData: () => T; setData: (data: Partial<T>) => void; setEnabled: (name: string, state: boolean) => void; focus: (name: string) => void; showTab: (name: string) => void; redial: (nu: DialogSpec<T>) => void; block: (msg: string) => void; unblock: () => void; toggleFullscreen: () => void; close: () => void; } interface DialogActionDetails { name: string; value?: any; } interface DialogChangeDetails<T> { name: keyof T; } interface DialogTabChangeDetails { newTabName: string; oldTabName: string; } 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'; interface DialogSpec<T extends DialogData> { title: string; size?: DialogSize; body: TabPanelSpec | PanelSpec; buttons?: DialogFooterButtonSpec[]; initialData?: Partial<T>; onAction?: DialogActionHandler<T>; onChange?: DialogChangeHandler<T>; onSubmit?: DialogSubmitHandler<T>; onClose?: DialogCloseHandler; onCancel?: DialogCancelHandler<T>; onTabChange?: DialogTabChangeHandler<T>; } interface UrlDialogInstanceApi { block: (msg: string) => void; unblock: () => void; close: () => void; sendMessage: (msg: any) => void; } interface UrlDialogActionDetails { name: string; value?: any; } interface UrlDialogMessage { mceAction: string; [key: string]: any; } type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void; type UrlDialogCloseHandler = () => void; type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void; type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void; interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec { type: 'cancel' | 'custom'; } interface UrlDialogSpec { title: string; url: string; height?: number; width?: number; buttons?: UrlDialogFooterButtonSpec[]; onAction?: UrlDialogActionHandler; onClose?: UrlDialogCloseHandler; onCancel?: UrlDialogCancelHandler; onMessage?: UrlDialogMessageHandler; } type ColumnTypes = number | 'auto'; type SeparatorItemSpec = SeparatorMenuItemSpec; interface AutocompleterItemSpec { type?: 'autocompleteitem'; value: string; text?: string; icon?: string; meta?: Record<string, any>; } type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec; interface AutocompleterSpec { type?: 'autocompleter'; trigger: string; minChars?: number; columns?: ColumnTypes; 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; } type ContextPosition = 'node' | 'selection' | 'line'; type ContextScope = 'node' | 'editor'; 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<T> extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> { type?: 'contextformbutton'; primary?: boolean; align?: 'start' | 'end'; onAction: (formApi: ContextFormInstanceApi<T>, api: ContextFormButtonInstanceApi) => void; } interface ContextFormToggleButtonSpec<T> extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> { type?: 'contextformtogglebutton'; primary?: boolean; align?: 'start' | 'end'; onAction: (formApi: ContextFormInstanceApi<T>, buttonApi: ContextFormToggleButtonInstanceApi) => void; } interface ContextFormInstanceApi<T> { setInputEnabled: (state: boolean) => void; isInputEnabled: () => boolean; hide: () => void; back: () => void; getValue: () => T; setValue: (value: T) => void; } interface SizeData { width: string; height: string; } interface BaseContextFormSpec<T> extends ContextBarSpec { initValue?: () => T; label?: string; launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec; commands: Array<ContextFormToggleButtonSpec<T> | ContextFormButtonSpec<T>>; onInput?: (api: ContextFormInstanceApi<T>) => void; onSetup?: (api: ContextFormInstanceApi<T>) => (api: ContextFormInstanceApi<T>) => void; } interface ContextInputFormSpec extends BaseContextFormSpec<string> { type?: 'contextform'; placeholder?: string; } interface ContextSliderFormSpec extends BaseContextFormSpec<number> { type: 'contextsliderform'; min?: () => number; max?: () => number; } interface ContextSizeInputFormSpec extends BaseContextFormSpec<SizeData> { type: 'contextsizeinputform'; } type ContextFormSpec = ContextInputFormSpec | ContextSliderFormSpec | ContextSizeInputFormSpec; interface ToolbarGroupSpec { name?: string; label?: string; items: string[]; } interface ContextToolbarLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> { type?: 'contexttoolbarbutton'; } interface ContextToolbarSpec extends ContextBarSpec { type?: 'contexttoolbar'; launch?: ContextToolbarLaunchButtonApi; items: string | ToolbarGroupSpec[]; } type PublicDialog_d_AlertBannerSpec = AlertBannerSpec; type PublicDialog_d_BarSpec = BarSpec; type PublicDialog_d_BodyComponentSpec = BodyComponentSpec; type PublicDialog_d_ButtonSpec = ButtonSpec; type PublicDialog_d_CheckboxSpec = CheckboxSpec; type PublicDialog_d_CollectionItem = CollectionItem; type PublicDialog_d_CollectionSpec = CollectionSpec; type PublicDialog_d_ColorInputSpec = ColorInputSpec; type PublicDialog_d_ColorPickerSpec = ColorPickerSpec; type PublicDialog_d_CustomEditorSpec = CustomEditorSpec; type PublicDialog_d_CustomEditorInit = CustomEditorInit; type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn; type PublicDialog_d_DialogData = DialogData; type PublicDialog_d_DialogSize = DialogSize; type PublicDialog_d_DialogSpec<T extends DialogData> = DialogSpec<T>; type PublicDialog_d_DialogInstanceApi<T extends DialogData> = DialogInstanceApi<T>; type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec; type PublicDialog_d_DialogActionDetails = DialogActionDetails; type PublicDialog_d_DialogChangeDetails<T> = DialogChangeDetails<T>; type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails; type PublicDialog_d_DropZoneSpec = DropZoneSpec; type PublicDialog_d_GridSpec = GridSpec; type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec; type PublicDialog_d_IframeSpec = IframeSpec; type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec; type PublicDialog_d_InputSpec = InputSpec; type PublicDialog_d_LabelSpec = LabelSpec; type PublicDialog_d_ListBoxSpec = ListBoxSpec; type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec; type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec; type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec; type PublicDialog_d_PanelSpec = PanelSpec; type PublicDialog_d_SelectBoxSpec = SelectBoxSpec; type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec; type PublicDialog_d_SizeInputSpec = SizeInputSpec; type PublicDialog_d_SliderSpec = SliderSpec; type PublicDialog_d_TableSpec = TableSpec; type PublicDialog_d_TabSpec = TabSpec; type PublicDialog_d_TabPanelSpec = TabPanelSpec; type PublicDialog_d_TextAreaSpec = TextAreaSpec; type PublicDialog_d_TreeSpec = TreeSpec; type PublicDialog_d_TreeItemSpec = TreeItemSpec; type PublicDialog_d_UrlInputData = UrlInputData; type PublicDialog_d_UrlInputSpec = UrlInputSpec; type PublicDialog_d_UrlDialogSpec = UrlDialogSpec; type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec; type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi; type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails; type PublicDialog_d_UrlDialogMessage = UrlDialogMessage; declare namespace PublicDialog_d { export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_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, }; } 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<T> = ContextFormInstanceApi<T>; type PublicInlineContent_d_ContextFormButtonSpec<T> = ContextFormButtonSpec<T>; type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi; type PublicInlineContent_d_ContextFormToggleButtonSpec<T> = ContextFormToggleButtonSpec<T>; 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, }; } interface ViewButtonApi { setIcon: (newIcon: string) => void; } interface ViewToggleButtonA