editor.js/src/components/__module.js
Murod Khaydarov 551ae9e381 Merge branch 'rewriting-version2.0' into improvements
# Conflicts:
#	build/codex-editor.js
#	build/codex-editor.js.map
2017-12-19 21:22:44 +03:00

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;
}
}