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