@textbus/editor
Version:
Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.
54 lines (53 loc) • 1.65 kB
TypeScript
import { Injector } from '@tanbo/di';
import { Tool } from '../types';
import { ButtonToolConfig } from './button-tool';
import { SelectToolConfig } from './select-tool';
import { DropdownToolConfig } from './dropdown-tool';
import { DialogToolConfig } from './dialog-tool';
export declare enum ToolType {
Select = 0,
Button = 1,
Dropdown = 2,
Dialog = 3
}
export interface ButtonToolMenu extends ButtonToolConfig {
type: ToolType.Button;
}
export interface SelectToolMenu extends SelectToolConfig {
type: ToolType.Select;
label: string;
}
export interface DropdownMenu extends DropdownToolConfig {
type: ToolType.Dropdown;
}
export interface DialogMenu extends DialogToolConfig {
type: ToolType.Dialog;
}
export interface GroupToolConfig {
/** 设置按扭显示的文字 */
label?: string;
/** 给按扭控件添加一组 css class 类 */
classes?: string[];
/** 给按扭控件添加一组 icon css class 类 */
iconClasses?: string[];
/** 当鼠标放在控件上的提示文字 */
tooltip?: string;
items: Array<ButtonToolMenu | SelectToolMenu | DropdownMenu | DialogMenu>;
}
export declare class GroupTool implements Tool {
private factory;
private menus;
private config;
private uiDropdown;
private controller;
constructor(factory: (injector: Injector) => GroupToolConfig);
setup(injector: Injector, limitElement: HTMLElement): HTMLElement;
refreshState(): void;
disabled(): void;
onDestroy(): void;
private createDialog;
private createDropdown;
private createSelect;
private createButton;
private _createItem;
}