update: plugin options type
This commit is contained in:
parent
1c501e3267
commit
c02f1685c3
|
@ -47,7 +47,9 @@ const defaultConfig = (editor: EditorInterface): Config => {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
class ToolbarPlugin<T extends ToolbarOptions> extends Plugin<T> {
|
class ToolbarPlugin<
|
||||||
|
T extends ToolbarOptions = ToolbarOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'toolbar';
|
return 'toolbar';
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,9 @@ const MODE_ALIAS = {
|
||||||
'c++': 'cpp',
|
'c++': 'cpp',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class<T extends CodeBlockOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends CodeBlockOptions = CodeBlockOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'codeblock';
|
return 'codeblock';
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ export interface EmbedOptions extends PluginOptions {
|
||||||
renderBefore?: EmbedRenderBeforeEvent;
|
renderBefore?: EmbedRenderBeforeEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Embed<T extends EmbedOptions> extends Plugin<T> {
|
class Embed<T extends EmbedOptions = EmbedOptions> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'embed';
|
return 'embed';
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,9 @@ export interface FileUploaderOptions extends PluginOptions {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class<T extends FileUploaderOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends FileUploaderOptions = FileUploaderOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
private cardComponents: { [key: string]: FileComponent<FileValue> } = {};
|
private cardComponents: { [key: string]: FileComponent<FileValue> } = {};
|
||||||
|
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface HrOptions extends PluginOptions {
|
||||||
hotkey?: string | Array<string>;
|
hotkey?: string | Array<string>;
|
||||||
markdown?: boolean;
|
markdown?: boolean;
|
||||||
}
|
}
|
||||||
export default class<T extends HrOptions> extends Plugin<T> {
|
export default class<T extends HrOptions = HrOptions> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'hr';
|
return 'hr';
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,9 @@ export interface ImageUploaderOptions extends PluginOptions {
|
||||||
isRemote?: (src: string) => boolean;
|
isRemote?: (src: string) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class<T extends ImageUploaderOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends ImageUploaderOptions = ImageUploaderOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
private cardComponents: { [key: string]: ImageComponent<ImageValue> } = {};
|
private cardComponents: { [key: string]: ImageComponent<ImageValue> } = {};
|
||||||
private loadCounts: { [key: string]: number } = {};
|
private loadCounts: { [key: string]: number } = {};
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ export interface LineHeightOptions extends PluginOptions {
|
||||||
filter?: (lineHeight: string) => string | boolean;
|
filter?: (lineHeight: string) => string | boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class<T extends LineHeightOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends LineHeightOptions = LineHeightOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'line-height';
|
return 'line-height';
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,9 @@ export interface MentionOptions extends PluginOptions {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class MentionPlugin<T extends MentionOptions> extends Plugin<T> {
|
class MentionPlugin<
|
||||||
|
T extends MentionOptions = MentionOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
#request?: AjaxInterface;
|
#request?: AjaxInterface;
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'mention';
|
return 'mention';
|
||||||
|
|
|
@ -21,7 +21,9 @@ export interface PaintformatOptions extends PluginOptions {
|
||||||
|
|
||||||
const PAINTFORMAT_CLASS = 'data-paintformat-mode';
|
const PAINTFORMAT_CLASS = 'data-paintformat-mode';
|
||||||
|
|
||||||
export default class<T extends PaintformatOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends PaintformatOptions = PaintformatOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
private activeMarks?: NodeInterface[];
|
private activeMarks?: NodeInterface[];
|
||||||
private activeBlocks?: NodeInterface[];
|
private activeBlocks?: NodeInterface[];
|
||||||
private type?: string;
|
private type?: string;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { isEngine, Plugin, PluginOptions } from '@aomao/engine';
|
||||||
export interface RedoOptions extends PluginOptions {
|
export interface RedoOptions extends PluginOptions {
|
||||||
hotkey?: string | Array<string>;
|
hotkey?: string | Array<string>;
|
||||||
}
|
}
|
||||||
export default class<T extends RedoOptions> extends Plugin<T> {
|
export default class<T extends RedoOptions = RedoOptions> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'redo';
|
return 'redo';
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ import { isEngine, Plugin, PluginOptions } from '@aomao/engine';
|
||||||
export interface RemoveformatOptions extends PluginOptions {
|
export interface RemoveformatOptions extends PluginOptions {
|
||||||
hotkey?: string | Array<string>;
|
hotkey?: string | Array<string>;
|
||||||
}
|
}
|
||||||
export default class<T extends RemoveformatOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends RemoveformatOptions = RemoveformatOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'removeformat';
|
return 'removeformat';
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@ import {
|
||||||
|
|
||||||
export interface SelectAllOptions extends PluginOptions {}
|
export interface SelectAllOptions extends PluginOptions {}
|
||||||
|
|
||||||
export default class<T extends SelectAllOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends SelectAllOptions = SelectAllOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'selectall';
|
return 'selectall';
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ export interface TableOptions extends PluginOptions {
|
||||||
markdown?: boolean;
|
markdown?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Table<T extends TableOptions> extends Plugin<T> {
|
class Table<T extends TableOptions = TableOptions> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'table';
|
return 'table';
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { isEngine, Plugin, PluginOptions } from '@aomao/engine';
|
||||||
export interface UndoOptions extends PluginOptions {
|
export interface UndoOptions extends PluginOptions {
|
||||||
hotkey?: string | Array<string>;
|
hotkey?: string | Array<string>;
|
||||||
}
|
}
|
||||||
export default class<T extends UndoOptions> extends Plugin<T> {
|
export default class<T extends UndoOptions = UndoOptions> extends Plugin<T> {
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
return 'undo';
|
return 'undo';
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,9 @@ export interface VideoUploaderOptions extends PluginOptions {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class<T extends VideoUploaderOptions> extends Plugin<T> {
|
export default class<
|
||||||
|
T extends VideoUploaderOptions = VideoUploaderOptions,
|
||||||
|
> extends Plugin<T> {
|
||||||
private cardComponents: { [key: string]: VideoComponent<VideoValue> } = {};
|
private cardComponents: { [key: string]: VideoComponent<VideoValue> } = {};
|
||||||
|
|
||||||
static get pluginName() {
|
static get pluginName() {
|
||||||
|
|
Loading…
Reference in New Issue