jodit
Version:
Jodit is awesome and usefully wysiwyg editor with filebrowser
42 lines (32 loc) • 1.06 kB
TypeScript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2020 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import { IJodit } from './jodit';
import { IDestructible, IInitable } from './types';
import { IViewBased } from './view';
export class IPlugin implements IDestructible, IInitable {
jodit: IJodit;
requires?: string[];
hasStyle?: boolean;
init(jodit: IJodit): void;
destruct(jodit?: IJodit): void;
constructor(jodit?: IJodit);
}
interface PluginFunction {
// eslint-disable-next-line @typescript-eslint/no-misused-new
constructor(jodit: IViewBased): void;
}
export type PluginType = typeof IPlugin | IPlugin | PluginFunction;
export type PluginInstance = IPlugin | object;
export interface IExtraPlugin {
name: string;
url?: string;
}
export interface IPluginSystem {
add(name: string, plugin: PluginType): void;
get(name: string): PluginType | void;
remove(name: string): void;
init(jodit: IJodit): Promise<void>;
}