UNPKG

@textbus/editor

Version:

Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.

30 lines (29 loc) 949 B
import { Injector } from '@tanbo/di'; import { QueryState, Keymap } from '@textbus/core'; import { Tool } from '../types'; export interface ButtonToolConfig<T = any> { /** 设置按扭显示的文字 */ label?: string; /** 给按扭控件添加一组 css class 类 */ classes?: string[]; /** 给按扭控件添加一组 icon css class 类 */ iconClasses?: string[]; /** 当鼠标放在控件上的提示文字 */ tooltip?: string; /** 当前按扭控件的快捷键配置 */ keymap?: Keymap; onClick(): void; queryState?(): QueryState<T>; onDestroy?(): void; } export declare class ButtonTool implements Tool { private factory; private viewer; private config; private controller; constructor(factory: (injector: Injector) => ButtonToolConfig<any>); setup(injector: Injector): HTMLElement; refreshState(): void; disabled(is: boolean): void; onDestroy(): void; }