forked from codex-team/editor.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__module.ts
More file actions
47 lines (41 loc) · 1001 Bytes
/
__module.ts
File metadata and controls
47 lines (41 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import IEditor from './interfaces/editor';
import IEditorConfig from './interfaces/editor-config';
import IModuleConfig from './interfaces/module-config';
/**
* @abstract
* @class Module
* @classdesc All modules inherits from this class.
*
* @typedef {Module} Module
* @property {Object} config - Editor user settings
* @property {IEditorConfig} Editor - List of Editor modules
*/
export default class Module {
/**
* Editor modules list
* @type {IEditor}
*/
protected Editor: IEditor;
/**
* Editor configuration object
* @type {IEditorConfig}
*/
protected config: IEditorConfig;
/**
* @constructor
* @param {IModuleConfig}
*/
constructor({config}: IModuleConfig) {
if (new.target === Module) {
throw new TypeError('Constructors for abstract class Module are not allowed.');
}
this.config = config;
}
/**
* Editor modules setter
* @param {IEditor} Editor
*/
set state(Editor) {
this.Editor = Editor;
}
}