index.d.ts 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
/**
 * @description 编辑区域,入口文件
 * @author wangfupeng
 */
import Editor from '../editor/index';
import { NodeListType } from './getChildrenJSON';
declare type TextEventHooks = {
    changeEvents: Function[];
    dropEvents: Function[];
    clickEvents: Function[];
    keyupEvents: Function[];
    tabUpEvents: Function[];
    tabDownEvents: Function[];
    enterUpEvents: Function[];
    enterDownEvents: Function[];
    deleteUpEvents: Function[];
    deleteDownEvents: Function[];
    pasteEvents: Function[];
    linkClickEvents: Function[];
    codeClickEvents: Function[];
    textScrollEvents: Function[];
    toolbarClickEvents: Function[];
    imgClickEvents: Function[];
    imgDragBarMouseDownEvents: Function[];
    tableClickEvents: Function[];
    menuClickEvents: Function[];
    dropListMenuHoverEvents: Function[];
    splitLineEvents: Function[];
};
declare class Text {
    editor: Editor;
    eventHooks: TextEventHooks;
    constructor(editor: Editor);
    /**
     * 初始化
     */
    init(): void;
    /**
     * 切换placeholder
     */
    togglePlaceholder(): void;
    /**
     * 清空内容
     */
    clear(): void;
    /**
     * 设置/获取 html
     * @param val html 字符串
     */
    html(val?: string): void | string;
    /**
     * 获取 json 格式的数据
     */
    getJSON(): NodeListType;
    /**
     * 获取/设置 字符串内容
     * @param val text 字符串
     */
    text(val?: string): void | string;
    /**
     * 追加 html 内容
     * @param html html 字符串
     */
    append(html: string): void;
    /**
     * 每一步操作,都实时保存选区范围
     */
    private _saveRange;
    /**
     * 绑定事件,事件会触发钩子函数
     */
    private _bindEventHooks;
}
export default Text;