import { Observable } from 'rxjs'; import { I18n, I18nString, Keymap } from '@textbus/core'; import { Tool, ToolFactoryParams, ToolFactory } from '../help'; import { Commander } from '../commander'; import { Matcher } from '../matcher/matcher'; export interface AdditionalViewer { elementRef: HTMLElement; onAction: Observable; onDestroy: Observable; destroy(): void; } /** * 附加视图工具的配置接口 */ export interface AdditionalToolConfig { /** 按扭控件点击后调用的命令 */ commanderFactory(): Commander; /** 下拉控件展开后显示的内容 */ viewFactory(i18n: I18n): AdditionalViewer; /** 状态查询器 */ matcher?: Matcher; /** 设置按扭显示的文字 */ label?: I18nString; /** 给按扭控件添加一组 css class 类 */ classes?: string[]; /** 给按扭控件添加一组 icon css class 类 */ iconClasses?: string[]; /** 当鼠标放在控件上的提示文字 */ tooltip?: I18nString; /** 当前按扭控件的快捷键配置 */ keymap?: Keymap; } export declare class AdditionalTool implements ToolFactory { private config; private subs; constructor(config: AdditionalToolConfig); create(params: ToolFactoryParams, addTool: (tool: Tool) => void): HTMLElement; onDestroy(): void; }