1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var Printer_1 = require("../Printer");
|
4 | var util_1 = require("../util");
|
5 | function 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 | }
|
19 | exports.printEnum = printEnum;
|
20 |
|
\ | No newline at end of file |