protobufjs 7.3.2 → 7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +727 -727
  3. package/dist/light/protobuf.js +6259 -6259
  4. package/dist/light/protobuf.js.map +1 -1
  5. package/dist/light/protobuf.min.js +2 -2
  6. package/dist/light/protobuf.min.js.map +1 -1
  7. package/dist/minimal/protobuf.js +1930 -1930
  8. package/dist/minimal/protobuf.js.map +1 -1
  9. package/dist/minimal/protobuf.min.js +2 -2
  10. package/dist/minimal/protobuf.min.js.map +1 -1
  11. package/dist/protobuf.js +7972 -7968
  12. package/dist/protobuf.js.map +1 -1
  13. package/dist/protobuf.min.js +3 -3
  14. package/dist/protobuf.min.js.map +1 -1
  15. package/ext/debug/README.md +4 -4
  16. package/ext/debug/index.js +71 -71
  17. package/ext/descriptor/README.md +72 -72
  18. package/ext/descriptor/index.d.ts +191 -191
  19. package/ext/descriptor/index.js +1052 -1052
  20. package/ext/descriptor/test.js +54 -54
  21. package/google/LICENSE +27 -27
  22. package/google/README.md +1 -1
  23. package/google/api/annotations.json +82 -82
  24. package/google/api/annotations.proto +10 -10
  25. package/google/api/http.json +85 -85
  26. package/google/api/http.proto +30 -30
  27. package/google/protobuf/api.json +117 -117
  28. package/google/protobuf/api.proto +33 -33
  29. package/google/protobuf/descriptor.json +738 -738
  30. package/google/protobuf/descriptor.proto +286 -286
  31. package/google/protobuf/source_context.json +19 -19
  32. package/google/protobuf/source_context.proto +7 -7
  33. package/google/protobuf/type.json +201 -201
  34. package/google/protobuf/type.proto +89 -89
  35. package/index.d.ts +2741 -2741
  36. package/index.js +4 -4
  37. package/light.d.ts +2 -2
  38. package/light.js +3 -3
  39. package/minimal.d.ts +2 -2
  40. package/minimal.js +4 -4
  41. package/package.json +112 -111
  42. package/scripts/postinstall.js +32 -32
  43. package/src/common.js +399 -399
  44. package/src/converter.js +301 -301
  45. package/src/decoder.js +129 -129
  46. package/src/encoder.js +100 -100
  47. package/src/enum.js +198 -198
  48. package/src/field.js +377 -377
  49. package/src/index-light.js +104 -104
  50. package/src/index-minimal.js +36 -36
  51. package/src/index.js +12 -12
  52. package/src/mapfield.js +126 -126
  53. package/src/message.js +138 -138
  54. package/src/method.js +160 -160
  55. package/src/namespace.js +433 -433
  56. package/src/object.js +243 -243
  57. package/src/oneof.js +203 -203
  58. package/src/parse.js +893 -889
  59. package/src/reader.js +416 -416
  60. package/src/reader_buffer.js +51 -51
  61. package/src/root.js +368 -368
  62. package/src/roots.js +18 -18
  63. package/src/rpc/service.js +142 -142
  64. package/src/rpc.js +36 -36
  65. package/src/service.js +167 -167
  66. package/src/tokenize.js +416 -416
  67. package/src/type.js +589 -589
  68. package/src/types.js +196 -196
  69. package/src/typescript.jsdoc +15 -15
  70. package/src/util/longbits.js +200 -200
  71. package/src/util/minimal.js +438 -438
  72. package/src/util.js +212 -212
  73. package/src/verifier.js +176 -176
  74. package/src/wrappers.js +102 -102
  75. package/src/writer.js +465 -465
  76. package/src/writer_buffer.js +85 -85
  77. package/tsconfig.json +7 -7
@@ -1,4 +1,4 @@
1
- protobufjs/ext/debug
2
- =========================
3
-
4
- Experimental debugging extension.
1
+ protobufjs/ext/debug
2
+ =========================
3
+
4
+ Experimental debugging extension.
@@ -1,71 +1,71 @@
1
- "use strict";
2
- var protobuf = require("../..");
3
-
4
- /**
5
- * Debugging utility functions. Only present in debug builds.
6
- * @namespace
7
- */
8
- var debug = protobuf.debug = module.exports = {};
9
-
10
- var codegen = protobuf.util.codegen;
11
-
12
- var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g;
13
-
14
- // Counts number of calls to any generated function
15
- function codegen_debug() {
16
- codegen_debug.supported = codegen.supported;
17
- codegen_debug.verbose = codegen.verbose;
18
- var gen = codegen.apply(null, Array.prototype.slice.call(arguments));
19
- gen.str = (function(str) { return function str_debug() {
20
- return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1");
21
- };})(gen.str);
22
- return gen;
23
- }
24
-
25
- /**
26
- * Returns a list of unused types within the specified root.
27
- * @param {NamespaceBase} ns Namespace to search
28
- * @returns {Type[]} Unused types
29
- */
30
- debug.unusedTypes = function unusedTypes(ns) {
31
-
32
- /* istanbul ignore if */
33
- if (!(ns instanceof protobuf.Namespace))
34
- throw TypeError("ns must be a Namespace");
35
-
36
- /* istanbul ignore if */
37
- if (!ns.nested)
38
- return [];
39
-
40
- var unused = [];
41
- for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) {
42
- var nested = ns.nested[names[i]];
43
- if (nested instanceof protobuf.Type) {
44
- var calls = (nested.encode.calls|0)
45
- + (nested.decode.calls|0)
46
- + (nested.verify.calls|0)
47
- + (nested.toObject.calls|0)
48
- + (nested.fromObject.calls|0);
49
- if (!calls)
50
- unused.push(nested);
51
- } else if (nested instanceof protobuf.Namespace)
52
- Array.prototype.push.apply(unused, unusedTypes(nested));
53
- }
54
- return unused;
55
- };
56
-
57
- /**
58
- * Enables debugging extensions.
59
- * @returns {undefined}
60
- */
61
- debug.enable = function enable() {
62
- protobuf.util.codegen = codegen_debug;
63
- };
64
-
65
- /**
66
- * Disables debugging extensions.
67
- * @returns {undefined}
68
- */
69
- debug.disable = function disable() {
70
- protobuf.util.codegen = codegen;
71
- };
1
+ "use strict";
2
+ var protobuf = require("../..");
3
+
4
+ /**
5
+ * Debugging utility functions. Only present in debug builds.
6
+ * @namespace
7
+ */
8
+ var debug = protobuf.debug = module.exports = {};
9
+
10
+ var codegen = protobuf.util.codegen;
11
+
12
+ var debugFnRe = /function ([^(]+)\(([^)]*)\) {/g;
13
+
14
+ // Counts number of calls to any generated function
15
+ function codegen_debug() {
16
+ codegen_debug.supported = codegen.supported;
17
+ codegen_debug.verbose = codegen.verbose;
18
+ var gen = codegen.apply(null, Array.prototype.slice.call(arguments));
19
+ gen.str = (function(str) { return function str_debug() {
20
+ return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, "function $1($2) {\n\t$1.calls=($1.calls|0)+1");
21
+ };})(gen.str);
22
+ return gen;
23
+ }
24
+
25
+ /**
26
+ * Returns a list of unused types within the specified root.
27
+ * @param {NamespaceBase} ns Namespace to search
28
+ * @returns {Type[]} Unused types
29
+ */
30
+ debug.unusedTypes = function unusedTypes(ns) {
31
+
32
+ /* istanbul ignore if */
33
+ if (!(ns instanceof protobuf.Namespace))
34
+ throw TypeError("ns must be a Namespace");
35
+
36
+ /* istanbul ignore if */
37
+ if (!ns.nested)
38
+ return [];
39
+
40
+ var unused = [];
41
+ for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) {
42
+ var nested = ns.nested[names[i]];
43
+ if (nested instanceof protobuf.Type) {
44
+ var calls = (nested.encode.calls|0)
45
+ + (nested.decode.calls|0)
46
+ + (nested.verify.calls|0)
47
+ + (nested.toObject.calls|0)
48
+ + (nested.fromObject.calls|0);
49
+ if (!calls)
50
+ unused.push(nested);
51
+ } else if (nested instanceof protobuf.Namespace)
52
+ Array.prototype.push.apply(unused, unusedTypes(nested));
53
+ }
54
+ return unused;
55
+ };
56
+
57
+ /**
58
+ * Enables debugging extensions.
59
+ * @returns {undefined}
60
+ */
61
+ debug.enable = function enable() {
62
+ protobuf.util.codegen = codegen_debug;
63
+ };
64
+
65
+ /**
66
+ * Disables debugging extensions.
67
+ * @returns {undefined}
68
+ */
69
+ debug.disable = function disable() {
70
+ protobuf.util.codegen = codegen;
71
+ };
@@ -1,72 +1,72 @@
1
- protobufjs/ext/descriptor
2
- =========================
3
-
4
- Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types.
5
-
6
- Usage
7
- -----
8
-
9
- ```js
10
- var protobuf = require("protobufjs"), // requires the full library
11
- descriptor = require("protobufjs/ext/descriptor");
12
-
13
- var root = ...;
14
-
15
- // convert any existing root instance to the corresponding descriptor type
16
- var descriptorMsg = root.toDescriptor("proto2");
17
- // ^ returns a FileDescriptorSet message, see table below
18
-
19
- // encode to a descriptor buffer
20
- var buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish();
21
-
22
- // decode from a descriptor buffer
23
- var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer);
24
-
25
- // convert any existing descriptor to a root instance
26
- root = protobuf.Root.fromDescriptor(decodedDescriptor);
27
- // ^ expects a FileDescriptorSet message or buffer, see table below
28
-
29
- // and start all over again
30
- ```
31
-
32
- API
33
- ---
34
-
35
- The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto:
36
-
37
- | Descriptor type | protobuf.js type | Remarks
38
- |-------------------------------|------------------|---------
39
- | **FileDescriptorSet** | Root |
40
- | FileDescriptorProto | | dependencies are not supported
41
- | FileOptions | |
42
- | FileOptionsOptimizeMode | |
43
- | SourceCodeInfo | | not supported
44
- | SourceCodeInfoLocation | |
45
- | GeneratedCodeInfo | | not supported
46
- | GeneratedCodeInfoAnnotation | |
47
- | **DescriptorProto** | Type |
48
- | MessageOptions | |
49
- | DescriptorProtoExtensionRange | |
50
- | DescriptorProtoReservedRange | |
51
- | **FieldDescriptorProto** | Field |
52
- | FieldDescriptorProtoLabel | |
53
- | FieldDescriptorProtoType | |
54
- | FieldOptions | |
55
- | FieldOptionsCType | |
56
- | FieldOptionsJSType | |
57
- | **OneofDescriptorProto** | OneOf |
58
- | OneofOptions | |
59
- | **EnumDescriptorProto** | Enum |
60
- | EnumOptions | |
61
- | EnumValueDescriptorProto | |
62
- | EnumValueOptions | | not supported
63
- | **ServiceDescriptorProto** | Service |
64
- | ServiceOptions | |
65
- | **MethodDescriptorProto** | Method |
66
- | MethodOptions | |
67
- | UninterpretedOption | | not supported
68
- | UninterpretedOptionNamePart | |
69
-
70
- Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names.
71
-
72
- When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message<IDescriptorProto>`).
1
+ protobufjs/ext/descriptor
2
+ =========================
3
+
4
+ Experimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types.
5
+
6
+ Usage
7
+ -----
8
+
9
+ ```js
10
+ var protobuf = require("protobufjs"), // requires the full library
11
+ descriptor = require("protobufjs/ext/descriptor");
12
+
13
+ var root = ...;
14
+
15
+ // convert any existing root instance to the corresponding descriptor type
16
+ var descriptorMsg = root.toDescriptor("proto2");
17
+ // ^ returns a FileDescriptorSet message, see table below
18
+
19
+ // encode to a descriptor buffer
20
+ var buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish();
21
+
22
+ // decode from a descriptor buffer
23
+ var decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer);
24
+
25
+ // convert any existing descriptor to a root instance
26
+ root = protobuf.Root.fromDescriptor(decodedDescriptor);
27
+ // ^ expects a FileDescriptorSet message or buffer, see table below
28
+
29
+ // and start all over again
30
+ ```
31
+
32
+ API
33
+ ---
34
+
35
+ The extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto:
36
+
37
+ | Descriptor type | protobuf.js type | Remarks
38
+ |-------------------------------|------------------|---------
39
+ | **FileDescriptorSet** | Root |
40
+ | FileDescriptorProto | | dependencies are not supported
41
+ | FileOptions | |
42
+ | FileOptionsOptimizeMode | |
43
+ | SourceCodeInfo | | not supported
44
+ | SourceCodeInfoLocation | |
45
+ | GeneratedCodeInfo | | not supported
46
+ | GeneratedCodeInfoAnnotation | |
47
+ | **DescriptorProto** | Type |
48
+ | MessageOptions | |
49
+ | DescriptorProtoExtensionRange | |
50
+ | DescriptorProtoReservedRange | |
51
+ | **FieldDescriptorProto** | Field |
52
+ | FieldDescriptorProtoLabel | |
53
+ | FieldDescriptorProtoType | |
54
+ | FieldOptions | |
55
+ | FieldOptionsCType | |
56
+ | FieldOptionsJSType | |
57
+ | **OneofDescriptorProto** | OneOf |
58
+ | OneofOptions | |
59
+ | **EnumDescriptorProto** | Enum |
60
+ | EnumOptions | |
61
+ | EnumValueDescriptorProto | |
62
+ | EnumValueOptions | | not supported
63
+ | **ServiceDescriptorProto** | Service |
64
+ | ServiceOptions | |
65
+ | **MethodDescriptorProto** | Method |
66
+ | MethodOptions | |
67
+ | UninterpretedOption | | not supported
68
+ | UninterpretedOptionNamePart | |
69
+
70
+ Note that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names.
71
+
72
+ When using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message<IDescriptorProto>`).
@@ -1,191 +1,191 @@
1
- import * as $protobuf from "../..";
2
- export const FileDescriptorSet: $protobuf.Type;
3
-
4
- export const FileDescriptorProto: $protobuf.Type;
5
-
6
- export const DescriptorProto: $protobuf.Type & {
7
- ExtensionRange: $protobuf.Type,
8
- ReservedRange: $protobuf.Type
9
- };
10
-
11
- export const FieldDescriptorProto: $protobuf.Type & {
12
- Label: $protobuf.Enum,
13
- Type: $protobuf.Enum
14
- };
15
-
16
- export const OneofDescriptorProto: $protobuf.Type;
17
-
18
- export const EnumDescriptorProto: $protobuf.Type;
19
-
20
- export const ServiceDescriptorProto: $protobuf.Type;
21
-
22
- export const EnumValueDescriptorProto: $protobuf.Type;
23
-
24
- export const MethodDescriptorProto: $protobuf.Type;
25
-
26
- export const FileOptions: $protobuf.Type & {
27
- OptimizeMode: $protobuf.Enum
28
- };
29
-
30
- export const MessageOptions: $protobuf.Type;
31
-
32
- export const FieldOptions: $protobuf.Type & {
33
- CType: $protobuf.Enum,
34
- JSType: $protobuf.Enum
35
- };
36
-
37
- export const OneofOptions: $protobuf.Type;
38
-
39
- export const EnumOptions: $protobuf.Type;
40
-
41
- export const EnumValueOptions: $protobuf.Type;
42
-
43
- export const ServiceOptions: $protobuf.Type;
44
-
45
- export const MethodOptions: $protobuf.Type;
46
-
47
- export const UninterpretedOption: $protobuf.Type & {
48
- NamePart: $protobuf.Type
49
- };
50
-
51
- export const SourceCodeInfo: $protobuf.Type & {
52
- Location: $protobuf.Type
53
- };
54
-
55
- export const GeneratedCodeInfo: $protobuf.Type & {
56
- Annotation: $protobuf.Type
57
- };
58
-
59
- export interface IFileDescriptorSet {
60
- file: IFileDescriptorProto[];
61
- }
62
-
63
- export interface IFileDescriptorProto {
64
- name?: string;
65
- package?: string;
66
- dependency?: any;
67
- publicDependency?: any;
68
- weakDependency?: any;
69
- messageType?: IDescriptorProto[];
70
- enumType?: IEnumDescriptorProto[];
71
- service?: IServiceDescriptorProto[];
72
- extension?: IFieldDescriptorProto[];
73
- options?: IFileOptions;
74
- sourceCodeInfo?: any;
75
- syntax?: string;
76
- }
77
-
78
- export interface IFileOptions {
79
- javaPackage?: string;
80
- javaOuterClassname?: string;
81
- javaMultipleFiles?: boolean;
82
- javaGenerateEqualsAndHash?: boolean;
83
- javaStringCheckUtf8?: boolean;
84
- optimizeFor?: IFileOptionsOptimizeMode;
85
- goPackage?: string;
86
- ccGenericServices?: boolean;
87
- javaGenericServices?: boolean;
88
- pyGenericServices?: boolean;
89
- deprecated?: boolean;
90
- ccEnableArenas?: boolean;
91
- objcClassPrefix?: string;
92
- csharpNamespace?: string;
93
- }
94
-
95
- type IFileOptionsOptimizeMode = number;
96
-
97
- export interface IDescriptorProto {
98
- name?: string;
99
- field?: IFieldDescriptorProto[];
100
- extension?: IFieldDescriptorProto[];
101
- nestedType?: IDescriptorProto[];
102
- enumType?: IEnumDescriptorProto[];
103
- extensionRange?: IDescriptorProtoExtensionRange[];
104
- oneofDecl?: IOneofDescriptorProto[];
105
- options?: IMessageOptions;
106
- reservedRange?: IDescriptorProtoReservedRange[];
107
- reservedName?: string[];
108
- }
109
-
110
- export interface IMessageOptions {
111
- mapEntry?: boolean;
112
- }
113
-
114
- export interface IDescriptorProtoExtensionRange {
115
- start?: number;
116
- end?: number;
117
- }
118
-
119
- export interface IDescriptorProtoReservedRange {
120
- start?: number;
121
- end?: number;
122
- }
123
-
124
- export interface IFieldDescriptorProto {
125
- name?: string;
126
- number?: number;
127
- label?: IFieldDescriptorProtoLabel;
128
- type?: IFieldDescriptorProtoType;
129
- typeName?: string;
130
- extendee?: string;
131
- defaultValue?: string;
132
- oneofIndex?: number;
133
- jsonName?: any;
134
- options?: IFieldOptions;
135
- }
136
-
137
- type IFieldDescriptorProtoLabel = number;
138
-
139
- type IFieldDescriptorProtoType = number;
140
-
141
- export interface IFieldOptions {
142
- packed?: boolean;
143
- jstype?: IFieldOptionsJSType;
144
- }
145
-
146
- type IFieldOptionsJSType = number;
147
-
148
- export interface IEnumDescriptorProto {
149
- name?: string;
150
- value?: IEnumValueDescriptorProto[];
151
- options?: IEnumOptions;
152
- }
153
-
154
- export interface IEnumValueDescriptorProto {
155
- name?: string;
156
- number?: number;
157
- options?: any;
158
- }
159
-
160
- export interface IEnumOptions {
161
- allowAlias?: boolean;
162
- deprecated?: boolean;
163
- }
164
-
165
- export interface IOneofDescriptorProto {
166
- name?: string;
167
- options?: any;
168
- }
169
-
170
- export interface IServiceDescriptorProto {
171
- name?: string;
172
- method?: IMethodDescriptorProto[];
173
- options?: IServiceOptions;
174
- }
175
-
176
- export interface IServiceOptions {
177
- deprecated?: boolean;
178
- }
179
-
180
- export interface IMethodDescriptorProto {
181
- name?: string;
182
- inputType?: string;
183
- outputType?: string;
184
- options?: IMethodOptions;
185
- clientStreaming?: boolean;
186
- serverStreaming?: boolean;
187
- }
188
-
189
- export interface IMethodOptions {
190
- deprecated?: boolean;
191
- }
1
+ import * as $protobuf from "../..";
2
+ export const FileDescriptorSet: $protobuf.Type;
3
+
4
+ export const FileDescriptorProto: $protobuf.Type;
5
+
6
+ export const DescriptorProto: $protobuf.Type & {
7
+ ExtensionRange: $protobuf.Type,
8
+ ReservedRange: $protobuf.Type
9
+ };
10
+
11
+ export const FieldDescriptorProto: $protobuf.Type & {
12
+ Label: $protobuf.Enum,
13
+ Type: $protobuf.Enum
14
+ };
15
+
16
+ export const OneofDescriptorProto: $protobuf.Type;
17
+
18
+ export const EnumDescriptorProto: $protobuf.Type;
19
+
20
+ export const ServiceDescriptorProto: $protobuf.Type;
21
+
22
+ export const EnumValueDescriptorProto: $protobuf.Type;
23
+
24
+ export const MethodDescriptorProto: $protobuf.Type;
25
+
26
+ export const FileOptions: $protobuf.Type & {
27
+ OptimizeMode: $protobuf.Enum
28
+ };
29
+
30
+ export const MessageOptions: $protobuf.Type;
31
+
32
+ export const FieldOptions: $protobuf.Type & {
33
+ CType: $protobuf.Enum,
34
+ JSType: $protobuf.Enum
35
+ };
36
+
37
+ export const OneofOptions: $protobuf.Type;
38
+
39
+ export const EnumOptions: $protobuf.Type;
40
+
41
+ export const EnumValueOptions: $protobuf.Type;
42
+
43
+ export const ServiceOptions: $protobuf.Type;
44
+
45
+ export const MethodOptions: $protobuf.Type;
46
+
47
+ export const UninterpretedOption: $protobuf.Type & {
48
+ NamePart: $protobuf.Type
49
+ };
50
+
51
+ export const SourceCodeInfo: $protobuf.Type & {
52
+ Location: $protobuf.Type
53
+ };
54
+
55
+ export const GeneratedCodeInfo: $protobuf.Type & {
56
+ Annotation: $protobuf.Type
57
+ };
58
+
59
+ export interface IFileDescriptorSet {
60
+ file: IFileDescriptorProto[];
61
+ }
62
+
63
+ export interface IFileDescriptorProto {
64
+ name?: string;
65
+ package?: string;
66
+ dependency?: any;
67
+ publicDependency?: any;
68
+ weakDependency?: any;
69
+ messageType?: IDescriptorProto[];
70
+ enumType?: IEnumDescriptorProto[];
71
+ service?: IServiceDescriptorProto[];
72
+ extension?: IFieldDescriptorProto[];
73
+ options?: IFileOptions;
74
+ sourceCodeInfo?: any;
75
+ syntax?: string;
76
+ }
77
+
78
+ export interface IFileOptions {
79
+ javaPackage?: string;
80
+ javaOuterClassname?: string;
81
+ javaMultipleFiles?: boolean;
82
+ javaGenerateEqualsAndHash?: boolean;
83
+ javaStringCheckUtf8?: boolean;
84
+ optimizeFor?: IFileOptionsOptimizeMode;
85
+ goPackage?: string;
86
+ ccGenericServices?: boolean;
87
+ javaGenericServices?: boolean;
88
+ pyGenericServices?: boolean;
89
+ deprecated?: boolean;
90
+ ccEnableArenas?: boolean;
91
+ objcClassPrefix?: string;
92
+ csharpNamespace?: string;
93
+ }
94
+
95
+ type IFileOptionsOptimizeMode = number;
96
+
97
+ export interface IDescriptorProto {
98
+ name?: string;
99
+ field?: IFieldDescriptorProto[];
100
+ extension?: IFieldDescriptorProto[];
101
+ nestedType?: IDescriptorProto[];
102
+ enumType?: IEnumDescriptorProto[];
103
+ extensionRange?: IDescriptorProtoExtensionRange[];
104
+ oneofDecl?: IOneofDescriptorProto[];
105
+ options?: IMessageOptions;
106
+ reservedRange?: IDescriptorProtoReservedRange[];
107
+ reservedName?: string[];
108
+ }
109
+
110
+ export interface IMessageOptions {
111
+ mapEntry?: boolean;
112
+ }
113
+
114
+ export interface IDescriptorProtoExtensionRange {
115
+ start?: number;
116
+ end?: number;
117
+ }
118
+
119
+ export interface IDescriptorProtoReservedRange {
120
+ start?: number;
121
+ end?: number;
122
+ }
123
+
124
+ export interface IFieldDescriptorProto {
125
+ name?: string;
126
+ number?: number;
127
+ label?: IFieldDescriptorProtoLabel;
128
+ type?: IFieldDescriptorProtoType;
129
+ typeName?: string;
130
+ extendee?: string;
131
+ defaultValue?: string;
132
+ oneofIndex?: number;
133
+ jsonName?: any;
134
+ options?: IFieldOptions;
135
+ }
136
+
137
+ type IFieldDescriptorProtoLabel = number;
138
+
139
+ type IFieldDescriptorProtoType = number;
140
+
141
+ export interface IFieldOptions {
142
+ packed?: boolean;
143
+ jstype?: IFieldOptionsJSType;
144
+ }
145
+
146
+ type IFieldOptionsJSType = number;
147
+
148
+ export interface IEnumDescriptorProto {
149
+ name?: string;
150
+ value?: IEnumValueDescriptorProto[];
151
+ options?: IEnumOptions;
152
+ }
153
+
154
+ export interface IEnumValueDescriptorProto {
155
+ name?: string;
156
+ number?: number;
157
+ options?: any;
158
+ }
159
+
160
+ export interface IEnumOptions {
161
+ allowAlias?: boolean;
162
+ deprecated?: boolean;
163
+ }
164
+
165
+ export interface IOneofDescriptorProto {
166
+ name?: string;
167
+ options?: any;
168
+ }
169
+
170
+ export interface IServiceDescriptorProto {
171
+ name?: string;
172
+ method?: IMethodDescriptorProto[];
173
+ options?: IServiceOptions;
174
+ }
175
+
176
+ export interface IServiceOptions {
177
+ deprecated?: boolean;
178
+ }
179
+
180
+ export interface IMethodDescriptorProto {
181
+ name?: string;
182
+ inputType?: string;
183
+ outputType?: string;
184
+ options?: IMethodOptions;
185
+ clientStreaming?: boolean;
186
+ serverStreaming?: boolean;
187
+ }
188
+
189
+ export interface IMethodOptions {
190
+ deprecated?: boolean;
191
+ }