import { DOMParser, Schema } from 'prosemirror-model'; import { Plugin } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; import { ISylApiAdapterOptions, SylApi } from './api'; import { IBasicCtrlConfig } from './basic/basic-ctrl'; import { ICustomCtrlConfig } from './basic/custom-ctrl'; import { TSylKeymap } from './basic/keymap'; import { EventChannel } from './event'; import { ISylPluginConfig, Types } from './libs/types'; import { IModuleType, ModuleManager } from './module'; import { IEventHandler, SylController, SylPlugin, TKeymapHandler } from './schema'; interface IExtraConfig { spellCheck?: boolean; autoFocus?: boolean; onError?: (error: Error, args?: any) => any; onBlur?: () => void; onFocus?: () => void; } interface IBaseConfig { emitter?: EventChannel; locale?: Types.StringMap; disable?: boolean; disableShortcut?: boolean; } interface IKeymapConfig { keymap?: Types.StringMap; } interface IConfiguration extends IBaseConfig, IBasicCtrlConfig, ICustomCtrlConfig, IExtraConfig, IKeymapConfig { } declare type TSylEventType = EventChannel['LocalEvent'] | string | symbol; declare class SylConfigurator { mount: HTMLElement; view: EditorView; moduleManage?: ModuleManager; private adapter?; private localStore?; domParser?: DOMParser; private sylPluginConfigs; private sylPluginInstances; private customCtrlPlugin?; private customKeyMapPlugin?; basicConfiguration: Required; extraConfiguration: Required; baseConfiguration: Required; customConfiguration: ICustomCtrlConfig; keymapConfiguration: TSylKeymap; plugins: Array; schema: Schema; get onError(): (error: Error, args?: any) => any; get emitter(): EventChannel; constructor(mount: HTMLElement, sylPluginConfigs?: Array, config?: IConfiguration); init(adapter: SylApi, module?: Types.StringMap): void; private constructParser; private installModule; private installSylPlugins; private initNativePlugin; private installController; private collectCommands; registerController: (name: string, Controller: typeof SylController, controllerProps?: Types.StringMap | undefined) => void; unregisterController: (name: string) => void; private setExtraConfiguration; private setBaseConfiguration; private setBasicCtrlConfiguration; update(config: IConfiguration & ISylApiAdapterOptions): void; private setCustomConfiguration; registerEventHandler: (eventHandler: IEventHandler) => void; unregisterEventHandler: (eventHandler: IEventHandler) => void; private setKeymapConfiguration; registerKeymap: (keymap: TSylKeymap) => void; unregisterKeymap: (keymap: Types.StringMap) => void; on(event: TSylEventType, handler: (...args: any[]) => void): EventChannel; off(event: TSylEventType, handler: (...args: Array) => void): EventChannel; emit(event: TSylEventType, ...args: any[]): boolean; getLocaleValue(name: string): any; setEditable(editable: boolean): void; setShortcutAble(enable: boolean): void; setLocale(locale?: Types.StringMap): boolean | undefined; getSylPlugins(): SylPlugin[]; uninstall(): void; } export { IConfiguration, SylConfigurator, TSylEventType };