@wangeditor-next/editor
Version:
Web rich text editor, Web 富文本编辑器
30 lines (29 loc) • 847 B
TypeScript
/**
* @description create
* @author wangfupeng
*/
import type { IEditorConfig, IToolbarConfig } from '@wangeditor-next/core';
import { IDomEditor, Toolbar } from '@wangeditor-next/core';
import { Descendant } from 'slate';
import type { DOMElement } from './utils/dom';
export interface ICreateEditorOption {
selector: string | DOMElement;
config: Partial<IEditorConfig>;
content?: Descendant[];
html?: string;
mode: string;
}
export interface ICreateToolbarOption {
editor: IDomEditor | null;
selector: string | DOMElement;
config?: Partial<IToolbarConfig>;
mode?: string;
}
/**
* 创建 editor 实例
*/
export declare function createEditor(option?: Partial<ICreateEditorOption>): IDomEditor;
/**
* 创建 toolbar 实例
*/
export declare function createToolbar(option: ICreateToolbarOption): Toolbar;