ts-simple-ast
Version:
TypeScript compiler wrapper for static analysis and code manipulation.
34 lines (33 loc) • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var base_1 = require("../base");
var callBaseSet_1 = require("../callBaseSet");
var statement_1 = require("../statement");
var callBaseGetStructure_1 = require("../callBaseGetStructure");
// todo: type node should not be able to return undefined
exports.TypeAliasDeclarationBase = base_1.ChildOrderableNode(base_1.TypeParameteredNode(base_1.TypedNode(base_1.JSDocableNode(base_1.AmbientableNode(base_1.ExportableNode(base_1.ModifierableNode(base_1.NamedNode(statement_1.Statement))))))));
var TypeAliasDeclaration = /** @class */ (function (_super) {
tslib_1.__extends(TypeAliasDeclaration, _super);
function TypeAliasDeclaration() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Sets the node from a structure.
* @param structure - Structure to set the node with.
*/
TypeAliasDeclaration.prototype.set = function (structure) {
callBaseSet_1.callBaseSet(exports.TypeAliasDeclarationBase.prototype, this, structure);
return this;
};
/**
* Gets the structure equivalent to this node.
*/
TypeAliasDeclaration.prototype.getStructure = function () {
return callBaseGetStructure_1.callBaseGetStructure(exports.TypeAliasDeclarationBase.prototype, this, {
type: this.getTypeNodeOrThrow().getText()
});
};
return TypeAliasDeclaration;
}(exports.TypeAliasDeclarationBase));
exports.TypeAliasDeclaration = TypeAliasDeclaration;