@wangeditor-next/editor
Version:
Web rich text editor, Web 富文本编辑器
55 lines (54 loc) • 2.83 kB
TypeScript
/**
* @description lightweight editor entry
* @author cycleccc
*/
import './assets/index.less';
import './utils/browser-polyfill';
import './utils/node-polyfill';
import './locale/index';
import type { IDomEditor, IEditorConfig, IModuleConf, IToolbarConfig, Toolbar } from '@wangeditor-next/core';
import Boot from './Boot';
import type { ICreateEditorOption, ICreateToolbarOption } from './create';
import { createEditor as rawCreateEditor, createToolbar as rawCreateToolbar } from './create';
export { Boot };
export interface IEditorExtension {
key?: string;
module: Partial<IModuleConf>;
}
export type EditorExtension = Partial<IModuleConf> | IEditorExtension;
export interface ICreateEditorFactoryOption {
extensions?: EditorExtension[];
editorConfig?: Partial<IEditorConfig>;
toolbarConfig?: Partial<IToolbarConfig>;
}
export type ICreateToolbarWithEditorOption = Omit<ICreateToolbarOption, 'editor'>;
export interface ICreateWithFactoryOption {
editor?: Partial<ICreateEditorOption>;
toolbar?: ICreateToolbarWithEditorOption;
}
export interface IEditorFactory {
create: (option?: ICreateWithFactoryOption) => {
editor: IDomEditor;
toolbar: Toolbar | null;
};
createEditor: (option?: Partial<ICreateEditorOption>) => IDomEditor;
createToolbar: (option: ICreateToolbarOption) => Toolbar;
registerExtensions: (extensions: EditorExtension[]) => void;
}
/**
* Register extensions (modules) once.
* Similar to tiptap's extensions list, this helper avoids duplicate registration
* when the same module reference (or explicit extension key) is reused.
*/
export declare function registerExtensions(extensions?: EditorExtension[]): void;
/**
* Create a reusable factory for on-demand composition, close to tiptap's setup style.
*/
export declare function createEditorFactory(option?: ICreateEditorFactoryOption): IEditorFactory;
export { rawCreateEditor as createEditor, rawCreateToolbar as createToolbar };
export type { ClassStylePolicy, IButtonMenu, IClassStyleUnsupportedPayload, IDomEditor, IDropPanelMenu, IEditorConfig, IModalMenu, IModuleConf, IOption, ISelectMenu, IToolbarConfig, StyleClassTokenType, TextStyleMode, } from '@wangeditor-next/core';
export { DomEditor, genModalButtonElems, genModalInputElems, genModalTextareaElems, getClassStylePolicy, getTextStyleMode, i18nAddResources, i18nChangeLanguage, i18nGetResources, reportUnsupportedClassStyle, t, Toolbar, } from '@wangeditor-next/core';
export type { Descendant as SlateDescendant, Location as SlateLocation, } from 'slate';
export { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Point as SlatePoint, Range as SlateRange, Text as SlateText, Transforms as SlateTransforms, } from 'slate';
declare const _default: {};
export default _default;