mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 23:55:49 +01:00
43 lines
No EOL
853 B
JavaScript
43 lines
No EOL
853 B
JavaScript
/**
|
|
* @abstract
|
|
* @class Module
|
|
* @classdesc All modules inherites from this class.
|
|
*
|
|
* @typedef {Module} Module
|
|
* @property {Object} config - Editor user settings
|
|
* @property {Object} Editor - List of Editor modules
|
|
*/
|
|
export default class Module {
|
|
|
|
/**
|
|
* @constructor
|
|
*
|
|
* @param {EditorConfig} config
|
|
*/
|
|
constructor({ config } = {}) {
|
|
|
|
if (new.target === Module) {
|
|
|
|
throw new TypeError('Constructors for abstract class Module are not allowed.');
|
|
|
|
}
|
|
|
|
this.config = config;
|
|
this.Editor = null;
|
|
|
|
}
|
|
|
|
/**
|
|
* Editor modules setter
|
|
*
|
|
* @param Editor
|
|
* @param Editor.modules {@link CodexEditor#moduleInstances}
|
|
* @param Editor.config {@link CodexEditor#configuration}
|
|
*/
|
|
set state(Editor) {
|
|
|
|
this.Editor = Editor;
|
|
|
|
}
|
|
|
|
} |