UNPKG

ts-budgie

Version:

Converts TypeScript code to Budgie.

46 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Shared context for visitors in a file. */ var VisitorContext = /** @class */ (function () { /** * Initializes a new instance of the VisitorContext class. * * @param options Constant conversion options for visiting nodes. */ function VisitorContext(options) { this.options = options; } Object.defineProperty(VisitorContext.prototype, "coercion", { /** * @returns The current type coercion, if any exists. */ get: function () { return this.typeCoercion; }, enumerable: true, configurable: true }); /** * Sets a new type coercion. * * @param coercion A new type coercion. */ VisitorContext.prototype.setTypeCoercion = function (coercion) { this.typeCoercion = coercion; }; /** * Exists the type coercion. * * @returns The exited type coercion, if any. */ VisitorContext.prototype.exitTypeCoercion = function () { var coercion = this.typeCoercion; this.typeCoercion = undefined; return coercion; }; return VisitorContext; }()); exports.VisitorContext = VisitorContext; //# sourceMappingURL=context.js.map