UNPKG

1.01 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Printer_1 = require("../Printer");
4var util_1 = require("../util");
5var FieldTypes_1 = require("./FieldTypes");
6function printExtension(fileName, exportMap, extension, indentLevel) {
7 var printer = new Printer_1.Printer(indentLevel + 1);
8 printer.printEmptyLn();
9 var extensionName = extension.getName() || util_1.throwError("Missing extension name");
10 var extensionType = extension.getType() || util_1.throwError("Missing extension type");
11 var extensionTypeName = extension.getTypeName() || null;
12 var camelExtensionName = util_1.snakeToCamel(extensionName);
13 var fieldType = FieldTypes_1.getFieldType(extensionType, extensionTypeName ? extensionTypeName.slice(1) : null, fileName, exportMap);
14 printer.printLn("export const " + camelExtensionName + ": jspb.ExtensionFieldInfo<" + fieldType + ">;");
15 return printer.output;
16}
17exports.printExtension = printExtension;
18//# sourceMappingURL=extensions.js.map
\No newline at end of file