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) · 1.02 KB
/
__module.ts
File metadata and controls
47 lines (41 loc) · 1.02 KB
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 {EditorModules} from '../types-internal/editor-modules';
import {EditorConfig} from '../../types';
import {ModuleConfig} from '../types-internal/module-config';
/**
* @abstract
* @class Module
* @classdesc All modules inherits from this class.
*
* @typedef {Module} Module
* @property {Object} config - Editor user settings
* @property {EditorModules} Editor - List of Editor modules
*/
export default class Module {
/**
* Editor modules list
* @type {EditorModules}
*/
protected Editor: EditorModules;
/**
* Editor configuration object
* @type {EditorConfig}
*/
protected config: EditorConfig;
/**
* @constructor
* @param {EditorConfig}
*/
constructor({config}: ModuleConfig) {
if (new.target === Module) {
throw new TypeError('Constructors for abstract class Module are not allowed.');
}
this.config = config;
}
/**
* Editor modules setter
* @param {EditorModules} Editor
*/
set state(Editor: EditorModules) {
this.Editor = Editor;
}
}