New component and event framework
This commit is contained in:
@@ -3,17 +3,34 @@ var __extends = (this && this.__extends) || function (d, b) {
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
|
||||
switch (arguments.length) {
|
||||
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
|
||||
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
|
||||
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
|
||||
}
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var index_1 = require("../../models/reflections/index");
|
||||
var ReflectionGroup_1 = require("../../models/ReflectionGroup");
|
||||
var component_1 = require("../../utils/component");
|
||||
var converter_1 = require("../converter");
|
||||
var plugin_1 = require("../plugin");
|
||||
var GroupPlugin = (function (_super) {
|
||||
__extends(GroupPlugin, _super);
|
||||
function GroupPlugin(converter) {
|
||||
_super.call(this, converter);
|
||||
converter.on(converter_1.Converter.EVENT_RESOLVE, this.onResolve, this);
|
||||
converter.on(converter_1.Converter.EVENT_RESOLVE_END, this.onEndResolve, this);
|
||||
function GroupPlugin() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
GroupPlugin.prototype.initialize = function () {
|
||||
this.listenTo(this.owner, (_a = {},
|
||||
_a[converter_1.Converter.EVENT_RESOLVE] = this.onResolve,
|
||||
_a[converter_1.Converter.EVENT_RESOLVE_END] = this.onEndResolve,
|
||||
_a
|
||||
));
|
||||
var _a;
|
||||
};
|
||||
GroupPlugin.prototype.onResolve = function (context, reflection) {
|
||||
var reflection = reflection;
|
||||
reflection.kindString = GroupPlugin.getKindSingular(reflection.kind);
|
||||
@@ -158,7 +175,10 @@ var GroupPlugin = (function (_super) {
|
||||
plurals[index_1.ReflectionKind.TypeAlias] = 'Type aliases';
|
||||
return plurals;
|
||||
})();
|
||||
GroupPlugin = __decorate([
|
||||
component_1.Component('group'),
|
||||
__metadata('design:paramtypes', [])
|
||||
], GroupPlugin);
|
||||
return GroupPlugin;
|
||||
})(plugin_1.ConverterPlugin);
|
||||
})(component_1.ConverterComponent);
|
||||
exports.GroupPlugin = GroupPlugin;
|
||||
converter_1.Converter.registerPlugin('group', GroupPlugin);
|
||||
|
||||
Reference in New Issue
Block a user