@igli.kokici/st-open-api
Version:
Generates API client SDKs from an OpenAPI specification written in OpenAPI version 3.x.x
37 lines • 1.64 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var render_mustache_1 = require("../function/render-mustache");
var unique_array_1 = require("./unique-array");
var formatText_1 = require("../function/formatText");
var InterfaceArrayProperty = /** @class */ (function () {
function InterfaceArrayProperty(originalName, _import, refClassName) {
this.originalName = originalName;
this.refClassName = refClassName;
this.description = [];
this.imports = new unique_array_1.UniqueArray();
this.convertName(originalName);
this.imports.push(_import);
}
InterfaceArrayProperty.prototype.convertName = function (originalName) {
this.interfaceName = formatText_1.formatText(originalName, 'ANY', 'PascalCase');
this.fileName = formatText_1.formatText(originalName, 'ANY', 'KebabCase');
};
InterfaceArrayProperty.prototype.render = function () {
var viewData = {
interfaceName: this.interfaceName,
refClassName: this.refClassName,
isImport: this.imports.get().length > 0,
imports: this.imports.get().sort(),
isDescription: (this.description || '').length > 0,
description: this.description,
};
return {
classEnumName: this.interfaceName,
fileName: this.fileName,
render: render_mustache_1.renderMustache('interface-array.mustache', viewData)
};
};
return InterfaceArrayProperty;
}());
exports.InterfaceArrayProperty = InterfaceArrayProperty;
//# sourceMappingURL=interface-array-property.js.map