cst
Version:
JavaScript CST Implementation
47 lines (36 loc) • 1.6 kB
JavaScript
/**
* Plugin abstract class.
* Every plugin should implement this interface.
* All plugins inside cst package should extend this class.
*/
;
Object.defineProperty(exports, '__esModule', {
value: true
});
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var BasePlugin = (function () {
function BasePlugin() {
_classCallCheck(this, BasePlugin);
}
_createClass(BasePlugin, [{
key: 'createApiForProgram',
/**
* Returns plugin API.
* Plugin's API will be accessible using `program.plugins.<pluginName>`.
*/
value: function createApiForProgram(program) {}
}, {
key: 'pluginName',
/**
* Returns plugin name.
* Plugin's API will be accessible using `program.plugins.<pluginName>`.
*/
get: function get() {
return 'basePlugin';
}
}]);
return BasePlugin;
})();
exports['default'] = BasePlugin;
module.exports = exports['default'];