@bufbuild/protobuf 0.0.1-alpha.1 → 0.0.2-alpha.2

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 (138) hide show
  1. package/dist/cjs/binary-encoding.js +414 -409
  2. package/dist/cjs/binary-format.js +13 -0
  3. package/dist/cjs/descriptor-registry.js +420 -449
  4. package/dist/cjs/descriptor-set.js +429 -513
  5. package/dist/cjs/enum.js +13 -0
  6. package/dist/cjs/field-list.js +13 -0
  7. package/dist/cjs/field.js +43 -30
  8. package/dist/cjs/google/protobuf/any_pb.js +122 -140
  9. package/dist/cjs/google/protobuf/api_pb.js +177 -224
  10. package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
  11. package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
  12. package/dist/cjs/google/protobuf/duration_pb.js +72 -88
  13. package/dist/cjs/google/protobuf/empty_pb.js +17 -17
  14. package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
  15. package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
  16. package/dist/cjs/google/protobuf/struct_pb.js +144 -181
  17. package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
  18. package/dist/cjs/google/protobuf/type_pb.js +406 -462
  19. package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
  20. package/dist/cjs/google/varint.js +166 -171
  21. package/dist/cjs/index.js +41 -122
  22. package/dist/cjs/json-format.js +13 -0
  23. package/dist/cjs/message-type.js +13 -0
  24. package/dist/cjs/message.js +89 -85
  25. package/dist/cjs/private/assert.js +33 -26
  26. package/dist/cjs/private/base64.js +93 -79
  27. package/dist/cjs/private/binary-format-common.js +208 -208
  28. package/dist/cjs/private/binary-format-proto2.js +88 -109
  29. package/dist/cjs/private/binary-format-proto3.js +70 -90
  30. package/dist/cjs/private/enum.js +77 -44
  31. package/dist/cjs/private/field-list.js +64 -50
  32. package/dist/cjs/private/field-wrapper.js +21 -10
  33. package/dist/cjs/private/field.js +35 -25
  34. package/dist/cjs/private/json-format-common.js +427 -440
  35. package/dist/cjs/private/json-format-proto2.js +91 -89
  36. package/dist/cjs/private/json-format-proto3.js +82 -93
  37. package/dist/cjs/private/message-type.js +39 -27
  38. package/dist/cjs/private/names.js +71 -62
  39. package/dist/cjs/private/options-map.js +13 -0
  40. package/dist/cjs/private/proto-runtime.js +25 -16
  41. package/dist/cjs/private/scalars.js +113 -103
  42. package/dist/cjs/private/util-common.js +193 -210
  43. package/dist/cjs/private/util.js +13 -0
  44. package/dist/cjs/proto-int64.js +123 -111
  45. package/dist/cjs/proto2.js +63 -63
  46. package/dist/cjs/proto3.js +74 -74
  47. package/dist/cjs/service-type.js +27 -17
  48. package/dist/cjs/type-registry.js +46 -31
  49. package/dist/esm/binary-encoding.js +414 -414
  50. package/dist/esm/binary-format.js +13 -0
  51. package/dist/esm/descriptor-registry.js +422 -458
  52. package/dist/esm/descriptor-set.js +430 -478
  53. package/dist/esm/enum.js +13 -0
  54. package/dist/esm/field-list.js +13 -0
  55. package/dist/esm/field.js +42 -29
  56. package/dist/esm/google/protobuf/any_pb.js +122 -140
  57. package/dist/esm/google/protobuf/api_pb.js +177 -197
  58. package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
  59. package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
  60. package/dist/esm/google/protobuf/duration_pb.js +72 -88
  61. package/dist/esm/google/protobuf/empty_pb.js +17 -17
  62. package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
  63. package/dist/esm/google/protobuf/source_context_pb.js +25 -25
  64. package/dist/esm/google/protobuf/struct_pb.js +143 -180
  65. package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
  66. package/dist/esm/google/protobuf/type_pb.js +401 -421
  67. package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
  68. package/dist/esm/google/varint.js +165 -164
  69. package/dist/esm/index.js +14 -1
  70. package/dist/esm/json-format.js +13 -0
  71. package/dist/esm/message-type.js +13 -0
  72. package/dist/esm/message.js +89 -85
  73. package/dist/esm/private/assert.js +32 -21
  74. package/dist/esm/private/base64.js +92 -78
  75. package/dist/esm/private/binary-format-common.js +209 -207
  76. package/dist/esm/private/binary-format-proto2.js +89 -81
  77. package/dist/esm/private/binary-format-proto3.js +71 -67
  78. package/dist/esm/private/enum.js +75 -43
  79. package/dist/esm/private/field-list.js +64 -50
  80. package/dist/esm/private/field-wrapper.js +21 -10
  81. package/dist/esm/private/field.js +35 -22
  82. package/dist/esm/private/json-format-common.js +427 -435
  83. package/dist/esm/private/json-format-proto2.js +89 -81
  84. package/dist/esm/private/json-format-proto3.js +79 -80
  85. package/dist/esm/private/message-type.js +40 -28
  86. package/dist/esm/private/names.js +70 -57
  87. package/dist/esm/private/options-map.js +13 -0
  88. package/dist/esm/private/proto-runtime.js +26 -12
  89. package/dist/esm/private/scalars.js +112 -99
  90. package/dist/esm/private/util-common.js +193 -192
  91. package/dist/esm/private/util.js +13 -0
  92. package/dist/esm/proto-int64.js +123 -111
  93. package/dist/esm/proto2.js +63 -57
  94. package/dist/esm/proto3.js +74 -68
  95. package/dist/esm/service-type.js +25 -12
  96. package/dist/esm/type-registry.js +46 -31
  97. package/dist/types/binary-encoding.d.ts +398 -398
  98. package/dist/types/binary-format.d.ts +69 -91
  99. package/dist/types/descriptor-registry.d.ts +23 -29
  100. package/dist/types/descriptor-set.d.ts +107 -128
  101. package/dist/types/enum.d.ts +21 -21
  102. package/dist/types/field-list.d.ts +21 -21
  103. package/dist/types/field.d.ts +191 -231
  104. package/dist/types/google/protobuf/any_pb.d.ts +56 -77
  105. package/dist/types/google/protobuf/api_pb.d.ts +144 -187
  106. package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
  107. package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
  108. package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
  109. package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
  110. package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
  111. package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
  112. package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
  113. package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
  114. package/dist/types/google/protobuf/type_pb.d.ts +355 -422
  115. package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
  116. package/dist/types/google/varint.d.ts +6 -13
  117. package/dist/types/index.d.ts +4 -27
  118. package/dist/types/json-format.d.ts +70 -89
  119. package/dist/types/message-type.d.ts +37 -45
  120. package/dist/types/message.d.ts +62 -87
  121. package/dist/types/private/assert.d.ts +1 -4
  122. package/dist/types/private/binary-format-common.d.ts +6 -32
  123. package/dist/types/private/enum.d.ts +13 -11
  124. package/dist/types/private/field-list.d.ts +14 -21
  125. package/dist/types/private/field-wrapper.d.ts +4 -10
  126. package/dist/types/private/field.d.ts +12 -12
  127. package/dist/types/private/json-format-common.d.ts +5 -27
  128. package/dist/types/private/message-type.d.ts +12 -7
  129. package/dist/types/private/names.d.ts +1 -4
  130. package/dist/types/private/options-map.d.ts +1 -1
  131. package/dist/types/private/proto-runtime.d.ts +34 -42
  132. package/dist/types/private/scalars.d.ts +5 -12
  133. package/dist/types/private/util-common.d.ts +1 -4
  134. package/dist/types/private/util.d.ts +29 -41
  135. package/dist/types/proto-int64.d.ts +42 -42
  136. package/dist/types/service-type.d.ts +36 -56
  137. package/dist/types/type-registry.d.ts +13 -15
  138. package/package.json +2 -3
@@ -1,11 +1,4 @@
1
- import type {
2
- BinaryReadOptions,
3
- FieldList,
4
- JsonReadOptions,
5
- JsonValue,
6
- PartialMessage,
7
- PlainMessage,
8
- } from "../../../index.js";
1
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "../../../index.js";
9
2
  import { Message } from "../../../index.js";
10
3
  import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb.js";
11
4
  /**
@@ -14,45 +7,33 @@ import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor_pb.js";
14
7
  * @generated from message google.protobuf.compiler.Version
15
8
  */
16
9
  export declare class Version extends Message<Version> {
17
- /**
18
- * @generated from field: optional int32 major = 1;
19
- */
20
- major?: number;
21
- /**
22
- * @generated from field: optional int32 minor = 2;
23
- */
24
- minor?: number;
25
- /**
26
- * @generated from field: optional int32 patch = 3;
27
- */
28
- patch?: number;
29
- /**
30
- * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
31
- * be empty for mainline stable releases.
32
- *
33
- * @generated from field: optional string suffix = 4;
34
- */
35
- suffix?: string;
36
- constructor(data?: PartialMessage<Version>);
37
- static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
38
- static readonly typeName = "google.protobuf.compiler.Version";
39
- static readonly fields: FieldList;
40
- static fromBinary(
41
- bytes: Uint8Array,
42
- options?: Partial<BinaryReadOptions>
43
- ): Version;
44
- static fromJson(
45
- jsonValue: JsonValue,
46
- options?: Partial<JsonReadOptions>
47
- ): Version;
48
- static fromJsonString(
49
- jsonString: string,
50
- options?: Partial<JsonReadOptions>
51
- ): Version;
52
- static equals(
53
- a: Version | PlainMessage<Version> | undefined,
54
- b: Version | PlainMessage<Version> | undefined
55
- ): boolean;
10
+ /**
11
+ * @generated from field: optional int32 major = 1;
12
+ */
13
+ major?: number;
14
+ /**
15
+ * @generated from field: optional int32 minor = 2;
16
+ */
17
+ minor?: number;
18
+ /**
19
+ * @generated from field: optional int32 patch = 3;
20
+ */
21
+ patch?: number;
22
+ /**
23
+ * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
24
+ * be empty for mainline stable releases.
25
+ *
26
+ * @generated from field: optional string suffix = 4;
27
+ */
28
+ suffix?: string;
29
+ constructor(data?: PartialMessage<Version>);
30
+ static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
31
+ static readonly typeName = "google.protobuf.compiler.Version";
32
+ static readonly fields: FieldList;
33
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Version;
34
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Version;
35
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Version;
36
+ static equals(a: Version | PlainMessage<Version> | undefined, b: Version | PlainMessage<Version> | undefined): boolean;
56
37
  }
57
38
  /**
58
39
  * An encoded CodeGeneratorRequest is written to the plugin's stdin.
@@ -60,65 +41,53 @@ export declare class Version extends Message<Version> {
60
41
  * @generated from message google.protobuf.compiler.CodeGeneratorRequest
61
42
  */
62
43
  export declare class CodeGeneratorRequest extends Message<CodeGeneratorRequest> {
63
- /**
64
- * The .proto files that were explicitly listed on the command-line. The
65
- * code generator should generate code only for these files. Each file's
66
- * descriptor will be included in proto_file, below.
67
- *
68
- * @generated from field: repeated string file_to_generate = 1;
69
- */
70
- fileToGenerate: string[];
71
- /**
72
- * The generator parameter passed on the command-line.
73
- *
74
- * @generated from field: optional string parameter = 2;
75
- */
76
- parameter?: string;
77
- /**
78
- * FileDescriptorProtos for all files in files_to_generate and everything
79
- * they import. The files will appear in topological order, so each file
80
- * appears before any file that imports it.
81
- *
82
- * protoc guarantees that all proto_files will be written after
83
- * the fields above, even though this is not technically guaranteed by the
84
- * protobuf wire format. This theoretically could allow a plugin to stream
85
- * in the FileDescriptorProtos and handle them one by one rather than read
86
- * the entire set into memory at once. However, as of this writing, this
87
- * is not similarly optimized on protoc's end -- it will store all fields in
88
- * memory at once before sending them to the plugin.
89
- *
90
- * Type names of fields and extensions in the FileDescriptorProto are always
91
- * fully qualified.
92
- *
93
- * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15;
94
- */
95
- protoFile: FileDescriptorProto[];
96
- /**
97
- * The version number of protocol compiler.
98
- *
99
- * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3;
100
- */
101
- compilerVersion?: Version;
102
- constructor(data?: PartialMessage<CodeGeneratorRequest>);
103
- static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
104
- static readonly typeName = "google.protobuf.compiler.CodeGeneratorRequest";
105
- static readonly fields: FieldList;
106
- static fromBinary(
107
- bytes: Uint8Array,
108
- options?: Partial<BinaryReadOptions>
109
- ): CodeGeneratorRequest;
110
- static fromJson(
111
- jsonValue: JsonValue,
112
- options?: Partial<JsonReadOptions>
113
- ): CodeGeneratorRequest;
114
- static fromJsonString(
115
- jsonString: string,
116
- options?: Partial<JsonReadOptions>
117
- ): CodeGeneratorRequest;
118
- static equals(
119
- a: CodeGeneratorRequest | PlainMessage<CodeGeneratorRequest> | undefined,
120
- b: CodeGeneratorRequest | PlainMessage<CodeGeneratorRequest> | undefined
121
- ): boolean;
44
+ /**
45
+ * The .proto files that were explicitly listed on the command-line. The
46
+ * code generator should generate code only for these files. Each file's
47
+ * descriptor will be included in proto_file, below.
48
+ *
49
+ * @generated from field: repeated string file_to_generate = 1;
50
+ */
51
+ fileToGenerate: string[];
52
+ /**
53
+ * The generator parameter passed on the command-line.
54
+ *
55
+ * @generated from field: optional string parameter = 2;
56
+ */
57
+ parameter?: string;
58
+ /**
59
+ * FileDescriptorProtos for all files in files_to_generate and everything
60
+ * they import. The files will appear in topological order, so each file
61
+ * appears before any file that imports it.
62
+ *
63
+ * protoc guarantees that all proto_files will be written after
64
+ * the fields above, even though this is not technically guaranteed by the
65
+ * protobuf wire format. This theoretically could allow a plugin to stream
66
+ * in the FileDescriptorProtos and handle them one by one rather than read
67
+ * the entire set into memory at once. However, as of this writing, this
68
+ * is not similarly optimized on protoc's end -- it will store all fields in
69
+ * memory at once before sending them to the plugin.
70
+ *
71
+ * Type names of fields and extensions in the FileDescriptorProto are always
72
+ * fully qualified.
73
+ *
74
+ * @generated from field: repeated google.protobuf.FileDescriptorProto proto_file = 15;
75
+ */
76
+ protoFile: FileDescriptorProto[];
77
+ /**
78
+ * The version number of protocol compiler.
79
+ *
80
+ * @generated from field: optional google.protobuf.compiler.Version compiler_version = 3;
81
+ */
82
+ compilerVersion?: Version;
83
+ constructor(data?: PartialMessage<CodeGeneratorRequest>);
84
+ static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
85
+ static readonly typeName = "google.protobuf.compiler.CodeGeneratorRequest";
86
+ static readonly fields: FieldList;
87
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CodeGeneratorRequest;
88
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CodeGeneratorRequest;
89
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CodeGeneratorRequest;
90
+ static equals(a: CodeGeneratorRequest | PlainMessage<CodeGeneratorRequest> | undefined, b: CodeGeneratorRequest | PlainMessage<CodeGeneratorRequest> | undefined): boolean;
122
91
  }
123
92
  /**
124
93
  * The plugin writes an encoded CodeGeneratorResponse to stdout.
@@ -126,50 +95,38 @@ export declare class CodeGeneratorRequest extends Message<CodeGeneratorRequest>
126
95
  * @generated from message google.protobuf.compiler.CodeGeneratorResponse
127
96
  */
128
97
  export declare class CodeGeneratorResponse extends Message<CodeGeneratorResponse> {
129
- /**
130
- * Error message. If non-empty, code generation failed. The plugin process
131
- * should exit with status code zero even if it reports an error in this way.
132
- *
133
- * This should be used to indicate errors in .proto files which prevent the
134
- * code generator from generating correct code. Errors which indicate a
135
- * problem in protoc itself -- such as the input CodeGeneratorRequest being
136
- * unparseable -- should be reported by writing a message to stderr and
137
- * exiting with a non-zero status code.
138
- *
139
- * @generated from field: optional string error = 1;
140
- */
141
- error?: string;
142
- /**
143
- * A bitmask of supported features that the code generator supports.
144
- * This is a bitwise "or" of values from the Feature enum.
145
- *
146
- * @generated from field: optional uint64 supported_features = 2;
147
- */
148
- supportedFeatures?: bigint;
149
- /**
150
- * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
151
- */
152
- file: CodeGeneratorResponse_File[];
153
- constructor(data?: PartialMessage<CodeGeneratorResponse>);
154
- static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
155
- static readonly typeName = "google.protobuf.compiler.CodeGeneratorResponse";
156
- static readonly fields: FieldList;
157
- static fromBinary(
158
- bytes: Uint8Array,
159
- options?: Partial<BinaryReadOptions>
160
- ): CodeGeneratorResponse;
161
- static fromJson(
162
- jsonValue: JsonValue,
163
- options?: Partial<JsonReadOptions>
164
- ): CodeGeneratorResponse;
165
- static fromJsonString(
166
- jsonString: string,
167
- options?: Partial<JsonReadOptions>
168
- ): CodeGeneratorResponse;
169
- static equals(
170
- a: CodeGeneratorResponse | PlainMessage<CodeGeneratorResponse> | undefined,
171
- b: CodeGeneratorResponse | PlainMessage<CodeGeneratorResponse> | undefined
172
- ): boolean;
98
+ /**
99
+ * Error message. If non-empty, code generation failed. The plugin process
100
+ * should exit with status code zero even if it reports an error in this way.
101
+ *
102
+ * This should be used to indicate errors in .proto files which prevent the
103
+ * code generator from generating correct code. Errors which indicate a
104
+ * problem in protoc itself -- such as the input CodeGeneratorRequest being
105
+ * unparseable -- should be reported by writing a message to stderr and
106
+ * exiting with a non-zero status code.
107
+ *
108
+ * @generated from field: optional string error = 1;
109
+ */
110
+ error?: string;
111
+ /**
112
+ * A bitmask of supported features that the code generator supports.
113
+ * This is a bitwise "or" of values from the Feature enum.
114
+ *
115
+ * @generated from field: optional uint64 supported_features = 2;
116
+ */
117
+ supportedFeatures?: bigint;
118
+ /**
119
+ * @generated from field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
120
+ */
121
+ file: CodeGeneratorResponse_File[];
122
+ constructor(data?: PartialMessage<CodeGeneratorResponse>);
123
+ static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
124
+ static readonly typeName = "google.protobuf.compiler.CodeGeneratorResponse";
125
+ static readonly fields: FieldList;
126
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CodeGeneratorResponse;
127
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CodeGeneratorResponse;
128
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CodeGeneratorResponse;
129
+ static equals(a: CodeGeneratorResponse | PlainMessage<CodeGeneratorResponse> | undefined, b: CodeGeneratorResponse | PlainMessage<CodeGeneratorResponse> | undefined): boolean;
173
130
  }
174
131
  /**
175
132
  * Sync with code_generator.h.
@@ -177,14 +134,14 @@ export declare class CodeGeneratorResponse extends Message<CodeGeneratorResponse
177
134
  * @generated from enum google.protobuf.compiler.CodeGeneratorResponse.Feature
178
135
  */
179
136
  export declare enum CodeGeneratorResponse_Feature {
180
- /**
181
- * @generated from enum value: FEATURE_NONE = 0;
182
- */
183
- NONE = 0,
184
- /**
185
- * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1;
186
- */
187
- PROTO3_OPTIONAL = 1,
137
+ /**
138
+ * @generated from enum value: FEATURE_NONE = 0;
139
+ */
140
+ NONE = 0,
141
+ /**
142
+ * @generated from enum value: FEATURE_PROTO3_OPTIONAL = 1;
143
+ */
144
+ PROTO3_OPTIONAL = 1
188
145
  }
189
146
  /**
190
147
  * Represents a single generated file.
@@ -192,103 +149,84 @@ export declare enum CodeGeneratorResponse_Feature {
192
149
  * @generated from message google.protobuf.compiler.CodeGeneratorResponse.File
193
150
  */
194
151
  export declare class CodeGeneratorResponse_File extends Message<CodeGeneratorResponse_File> {
195
- /**
196
- * The file name, relative to the output directory. The name must not
197
- * contain "." or ".." components and must be relative, not be absolute (so,
198
- * the file cannot lie outside the output directory). "/" must be used as
199
- * the path separator, not "\".
200
- *
201
- * If the name is omitted, the content will be appended to the previous
202
- * file. This allows the generator to break large files into small chunks,
203
- * and allows the generated text to be streamed back to protoc so that large
204
- * files need not reside completely in memory at one time. Note that as of
205
- * this writing protoc does not optimize for this -- it will read the entire
206
- * CodeGeneratorResponse before writing files to disk.
207
- *
208
- * @generated from field: optional string name = 1;
209
- */
210
- name?: string;
211
- /**
212
- * If non-empty, indicates that the named file should already exist, and the
213
- * content here is to be inserted into that file at a defined insertion
214
- * point. This feature allows a code generator to extend the output
215
- * produced by another code generator. The original generator may provide
216
- * insertion points by placing special annotations in the file that look
217
- * like:
218
- * @@protoc_insertion_point(NAME)
219
- * The annotation can have arbitrary text before and after it on the line,
220
- * which allows it to be placed in a comment. NAME should be replaced with
221
- * an identifier naming the point -- this is what other generators will use
222
- * as the insertion_point. Code inserted at this point will be placed
223
- * immediately above the line containing the insertion point (thus multiple
224
- * insertions to the same point will come out in the order they were added).
225
- * The double-@ is intended to make it unlikely that the generated code
226
- * could contain things that look like insertion points by accident.
227
- *
228
- * For example, the C++ code generator places the following line in the
229
- * .pb.h files that it generates:
230
- * // @@protoc_insertion_point(namespace_scope)
231
- * This line appears within the scope of the file's package namespace, but
232
- * outside of any particular class. Another plugin can then specify the
233
- * insertion_point "namespace_scope" to generate additional classes or
234
- * other declarations that should be placed in this scope.
235
- *
236
- * Note that if the line containing the insertion point begins with
237
- * whitespace, the same whitespace will be added to every line of the
238
- * inserted text. This is useful for languages like Python, where
239
- * indentation matters. In these languages, the insertion point comment
240
- * should be indented the same amount as any inserted code will need to be
241
- * in order to work correctly in that context.
242
- *
243
- * The code generator that generates the initial file and the one which
244
- * inserts into it must both run as part of a single invocation of protoc.
245
- * Code generators are executed in the order in which they appear on the
246
- * command line.
247
- *
248
- * If |insertion_point| is present, |name| must also be present.
249
- *
250
- * @generated from field: optional string insertion_point = 2;
251
- */
252
- insertionPoint?: string;
253
- /**
254
- * The file contents.
255
- *
256
- * @generated from field: optional string content = 15;
257
- */
258
- content?: string;
259
- /**
260
- * Information describing the file content being inserted. If an insertion
261
- * point is used, this information will be appropriately offset and inserted
262
- * into the code generation metadata for the generated files.
263
- *
264
- * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16;
265
- */
266
- generatedCodeInfo?: GeneratedCodeInfo;
267
- constructor(data?: PartialMessage<CodeGeneratorResponse_File>);
268
- static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
269
- static readonly typeName =
270
- "google.protobuf.compiler.CodeGeneratorResponse.File";
271
- static readonly fields: FieldList;
272
- static fromBinary(
273
- bytes: Uint8Array,
274
- options?: Partial<BinaryReadOptions>
275
- ): CodeGeneratorResponse_File;
276
- static fromJson(
277
- jsonValue: JsonValue,
278
- options?: Partial<JsonReadOptions>
279
- ): CodeGeneratorResponse_File;
280
- static fromJsonString(
281
- jsonString: string,
282
- options?: Partial<JsonReadOptions>
283
- ): CodeGeneratorResponse_File;
284
- static equals(
285
- a:
286
- | CodeGeneratorResponse_File
287
- | PlainMessage<CodeGeneratorResponse_File>
288
- | undefined,
289
- b:
290
- | CodeGeneratorResponse_File
291
- | PlainMessage<CodeGeneratorResponse_File>
292
- | undefined
293
- ): boolean;
152
+ /**
153
+ * The file name, relative to the output directory. The name must not
154
+ * contain "." or ".." components and must be relative, not be absolute (so,
155
+ * the file cannot lie outside the output directory). "/" must be used as
156
+ * the path separator, not "\".
157
+ *
158
+ * If the name is omitted, the content will be appended to the previous
159
+ * file. This allows the generator to break large files into small chunks,
160
+ * and allows the generated text to be streamed back to protoc so that large
161
+ * files need not reside completely in memory at one time. Note that as of
162
+ * this writing protoc does not optimize for this -- it will read the entire
163
+ * CodeGeneratorResponse before writing files to disk.
164
+ *
165
+ * @generated from field: optional string name = 1;
166
+ */
167
+ name?: string;
168
+ /**
169
+ * If non-empty, indicates that the named file should already exist, and the
170
+ * content here is to be inserted into that file at a defined insertion
171
+ * point. This feature allows a code generator to extend the output
172
+ * produced by another code generator. The original generator may provide
173
+ * insertion points by placing special annotations in the file that look
174
+ * like:
175
+ * @@protoc_insertion_point(NAME)
176
+ * The annotation can have arbitrary text before and after it on the line,
177
+ * which allows it to be placed in a comment. NAME should be replaced with
178
+ * an identifier naming the point -- this is what other generators will use
179
+ * as the insertion_point. Code inserted at this point will be placed
180
+ * immediately above the line containing the insertion point (thus multiple
181
+ * insertions to the same point will come out in the order they were added).
182
+ * The double-@ is intended to make it unlikely that the generated code
183
+ * could contain things that look like insertion points by accident.
184
+ *
185
+ * For example, the C++ code generator places the following line in the
186
+ * .pb.h files that it generates:
187
+ * // @@protoc_insertion_point(namespace_scope)
188
+ * This line appears within the scope of the file's package namespace, but
189
+ * outside of any particular class. Another plugin can then specify the
190
+ * insertion_point "namespace_scope" to generate additional classes or
191
+ * other declarations that should be placed in this scope.
192
+ *
193
+ * Note that if the line containing the insertion point begins with
194
+ * whitespace, the same whitespace will be added to every line of the
195
+ * inserted text. This is useful for languages like Python, where
196
+ * indentation matters. In these languages, the insertion point comment
197
+ * should be indented the same amount as any inserted code will need to be
198
+ * in order to work correctly in that context.
199
+ *
200
+ * The code generator that generates the initial file and the one which
201
+ * inserts into it must both run as part of a single invocation of protoc.
202
+ * Code generators are executed in the order in which they appear on the
203
+ * command line.
204
+ *
205
+ * If |insertion_point| is present, |name| must also be present.
206
+ *
207
+ * @generated from field: optional string insertion_point = 2;
208
+ */
209
+ insertionPoint?: string;
210
+ /**
211
+ * The file contents.
212
+ *
213
+ * @generated from field: optional string content = 15;
214
+ */
215
+ content?: string;
216
+ /**
217
+ * Information describing the file content being inserted. If an insertion
218
+ * point is used, this information will be appropriately offset and inserted
219
+ * into the code generation metadata for the generated files.
220
+ *
221
+ * @generated from field: optional google.protobuf.GeneratedCodeInfo generated_code_info = 16;
222
+ */
223
+ generatedCodeInfo?: GeneratedCodeInfo;
224
+ constructor(data?: PartialMessage<CodeGeneratorResponse_File>);
225
+ static readonly runtime: import("../../../private/proto-runtime.js").ProtoRuntime;
226
+ static readonly typeName = "google.protobuf.compiler.CodeGeneratorResponse.File";
227
+ static readonly fields: FieldList;
228
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CodeGeneratorResponse_File;
229
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CodeGeneratorResponse_File;
230
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CodeGeneratorResponse_File;
231
+ static equals(a: CodeGeneratorResponse_File | PlainMessage<CodeGeneratorResponse_File> | undefined, b: CodeGeneratorResponse_File | PlainMessage<CodeGeneratorResponse_File> | undefined): boolean;
294
232
  }