import { BaseModule, SylApi, Types } from '@syllepsis/adapter'; import { IRenderer } from '../../../../renderer'; import { IToolbarOption } from '../../..'; import { ToolbarLib } from '../..'; declare module '@syllepsis/adapter' { interface ISylApiCommand { toolbarInline?: { show: () => void; hide: () => void; getVisible: () => boolean; enable: () => void; disable: () => void; getEnable: () => boolean; }; } } interface IToolbarInlineOption extends Omit { threshold?: { top?: number; left?: number; right?: number; bottom?: number; }; judgeShow?: (editor: SylApi) => boolean; zIndex?: number; } interface IToolbarInlineProps { editor: SylApi; option: IToolbarInlineOption; visible: boolean; activeFormat: Types.StringMap; toolbarLib: ToolbarLib; } /** * - positioning rules of InlineToolbar * + vertical position is based on the selection area, horizon position is based on mouse position * + display when there is text content, and display it at the top of the selection area first * + When selecting across rows, it will be displayed above or below according to the position where the mouse is released * + Drag to select. When the position where the mouse is released is too far from the selection, it will be displayed at the position where the mouse is released first, and keep the left and right positions * + in other cases where there is a selection area but no `InlineToolbar`, move the mouse to appear, centered on the mouse position */ declare class ToolbarInlineLoader extends BaseModule { bridge: IRenderer; private dom; private _visible; private mousedown; private preferDir; private preferLeft; private _isEnable; private lastClickElement; get isEnable(): boolean; set isEnable(val: boolean); get visible(): boolean; set visible(val: boolean); get threshold(): Required['threshold']>; constructor(adapter: SylApi, originOption: IToolbarInlineOption); enable: () => void; disable: () => void; updateFormat(exec?: boolean): void | Types.StringMap; show: () => void; hide: () => void; handleMouseUp: (e: any) => void; handleMouseDown: (e: Event) => void; tracePos: import("lodash").DebouncedFunc<(e?: MouseEvent | undefined, force?: boolean | undefined) => void>; checkShow: import("lodash").DebouncedFunc<(e: any) => void>; checkHide: import("lodash").DebouncedFunc<() => void>; storedClick: (e: MouseEvent) => Element; bindEvent(): void; setProps(option: IToolbarInlineOption): void; render: () => void; destructor(): void; } export { IToolbarInlineOption, IToolbarInlineProps, ToolbarInlineLoader };