import { IDisposable, IInital, KV } from 'ts-toolset'; import { IPropGroupEntity } from '../../../models/base'; import { IEditorOption, EditorOption } from './editorOption'; import { IInstanceFactory } from '../../../common/instanceFactory'; import { EditorOptionlMaterial, EditorValue, EditorHookParam, EditorOptionGroup, IEditorOptionGroup } from './types'; export declare type InitialOptions = { data?: any; propGroups?: IPropGroupEntity[]; }; export interface IEditor extends IInital, IDisposable { readonly isInitial: boolean; readonly editorOptions: IEditorOption[]; readonly editorOptionMap: Map; readonly editorOptionGroups: IEditorOptionGroup[]; readonly changeEditorOptions: KV; getValues(): any; getChangeValues(): any; importValues(values: any, ...params: any[]): void; setValues(values: EditorValue | EditorValue[], once?: boolean): void; callHooks(editorParams: EditorHookParam | EditorHookParam[]): void; } export declare abstract class Editor implements IEditor { private _options; protected _editorOptionInstances: IInstanceFactory; protected _editorOptions: EditorOption[]; protected _editorOptionMap: Map; protected _editorOptionGroups: EditorOptionGroup[]; protected _isInitial: boolean; protected _changeEditorOptions: KV; constructor(); get isInitial(): boolean; get editorOptions(): EditorOption[]; get editorOptionMap(): Map; get editorOptionGroups(): EditorOptionGroup[]; get changeEditorOptions(): KV; protected _mergeValue(editorOption: EditorOption, value: any): void; /** 编辑器设置值 */ protected _setValue({ defaultHooks, ...value }: EditorValue): void; protected _getEditorOptionInstance(material: EditorOptionlMaterial, data: any): EditorOption; /** 调用编辑器项钩子 */ protected _callHook(param: EditorHookParam): void; /** 初始化编辑器 */ initial(materials: EditorOptionlMaterial[], { data, propGroups }?: InitialOptions): void; protected abstract abstractInitial(): void; getValues(): any; getChangeValues(): any; importValues(values: any, ...params: any[]): void; protected abstract abstractImportValues(values: any, ...params: any[]): void; setValues(values: EditorValue | EditorValue[], once?: boolean): void; protected abstract abstractChangeValues(): void; callHooks(editorParams: EditorHookParam | EditorHookParam[]): void; dispose(): void; protected abstract abstractDestroy(): void; }