tsioc
Version:
tsioc is AOP, Ioc container, via typescript decorator
64 lines (62 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var index_1 = require("./utils/index");
/**
* injecto token.
* @export
* @class Registration
* @template T
*/
var Registration = /** @class */ (function () {
/**
* Creates an instance of Registration.
* @param {Type<T> | AbstractType<T>} classType
* @param {string} desc
* @memberof Registration
*/
function Registration(classType, desc) {
this.classType = classType;
this.desc = desc;
this.type = 'Registration';
}
/**
* get class.
*
* @returns
* @memberof Registration
*/
Registration.prototype.getClass = function () {
if (index_1.isClass(this.classType)) {
return this.classType;
}
return null;
};
/**
* get desc.
*
* @returns
* @memberof Registration
*/
Registration.prototype.getDesc = function () {
return this.desc;
};
/**
* to string.
*
* @returns {string}
* @memberof Registration
*/
Registration.prototype.toString = function () {
var name = '';
if (index_1.isFunction(this.classType)) {
name = this.classType.classAnnations ? this.classType.classAnnations.name : this.classType.name;
}
else {
name = this.classType.toString();
}
return this.type + " " + name + " " + this.desc;
};
return Registration;
}());
exports.Registration = Registration;
//# sourceMappingURL=sourcemaps/Registration.js.map