UNPKG

905 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Printer_1 = require("../Printer");
4var util_1 = require("../util");
5function printEnum(enumDescriptor, indentLevel) {
6 var printer = new Printer_1.Printer(indentLevel);
7 var enumInterfaceName = enumDescriptor.getName() + "Map";
8 printer.printEmptyLn();
9 printer.printLn("export interface " + enumInterfaceName + " {");
10 enumDescriptor.getValueList().forEach(function (value) {
11 var valueName = value.getName() || util_1.throwError("Missing value name");
12 printer.printIndentedLn(valueName.toUpperCase() + ": " + value.getNumber() + ";");
13 });
14 printer.printLn("}");
15 printer.printEmptyLn();
16 printer.printLn("export const " + enumDescriptor.getName() + ": " + enumInterfaceName + ";");
17 return printer.getOutput();
18}
19exports.printEnum = printEnum;
20//# sourceMappingURL=enum.js.map
\No newline at end of file