UNPKG

ern-api-gen

Version:

Electrode Native API generator

45 lines 1.56 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Parameter_1 = require("./Parameter"); const RefType_1 = __importDefault(require("../refs/RefType")); const GenericRef_1 = __importDefault(require("../refs/GenericRef")); class RefParameter extends Parameter_1.Parameter { constructor({ $ref } = {}) { super(); this.set$ref($ref); } asDefault(ref) { this.set$ref(RefType_1.default.PARAMETER.getInternalPrefix() + ref); return this; } set$ref(ref) { this.genericRef = new GenericRef_1.default(RefType_1.default.PARAMETER, ref); } getRefFormat() { return this.genericRef.getFormat(); } getSimpleRef() { return this.genericRef.getSimpleRef(); } copy() { const res = new RefParameter(); res.required = this.required; res.vendorExtensions = this.vendorExtensions; res.uniqueItems = this.uniqueItems; res.exclusiveMinimum = this.exclusiveMinimum; res.exclusiveMaximum = this.exclusiveMaximum; res.format = this.format; res.in = this.in; res.readOnly = this.readOnly; res.defaultValue = this.defaultValue; res.required = this.required; res.genericRef = this.genericRef; return res; } } RefParameter.TYPE = 'ref'; exports.RefParameter = RefParameter; //# sourceMappingURL=RefParameter.js.map