@@ -279,9 +279,24 @@ export class Field extends FieldBase {
279
279
*/
280
280
public static fromJSON ( name : string , json : IField ) : Field ;
281
281
282
- /** Determines whether this field is packed. Only relevant when repeated and working with proto2. */
282
+ /** Determines whether this field is required. */
283
+ public readonly required : boolean ;
284
+
285
+ /** Determines whether this field is not required. */
286
+ public readonly optional : boolean ;
287
+
288
+ /**
289
+ * Determines whether this field uses tag-delimited encoding. In proto2 this
290
+ * corresponded to group syntax.
291
+ */
292
+ public readonly delimited : boolean ;
293
+
294
+ /** Determines whether this field is packed. Only relevant when repeated. */
283
295
public readonly packed : boolean ;
284
296
297
+ /** Determines whether this field tracks presence. */
298
+ public readonly hasPresence : boolean ;
299
+
285
300
/**
286
301
* Field decorator (TypeScript).
287
302
* @param fieldId Field id
@@ -326,12 +341,6 @@ export class FieldBase extends ReflectionObject {
326
341
/** Extended type if different from parent. */
327
342
public extend ?: string ;
328
343
329
- /** Whether this field is required. */
330
- public required : boolean ;
331
-
332
- /** Whether this field is optional. */
333
- public optional : boolean ;
334
-
335
344
/** Whether this field is repeated. */
336
345
public repeated : boolean ;
337
346
@@ -381,6 +390,14 @@ export class FieldBase extends ReflectionObject {
381
390
* @throws {Error } If any reference cannot be resolved
382
391
*/
383
392
public resolve ( ) : Field ;
393
+
394
+ /**
395
+ * Infers field features from legacy syntax that may have been specified differently.
396
+ * in older editions.
397
+ * @param edition The edition this proto is on, or undefined if pre-editions
398
+ * @returns The feature values to override
399
+ */
400
+ public _inferLegacyProtoFeatures ( edition : ( string | undefined ) ) : object ;
384
401
}
385
402
386
403
/** Field descriptor. */
@@ -940,6 +957,14 @@ export abstract class ReflectionObject {
940
957
/** Resolves child features from parent features */
941
958
public _resolveFeatures ( ) : void ;
942
959
960
+ /**
961
+ * Infers features from legacy syntax that may have been specified differently.
962
+ * in older editions.
963
+ * @param edition The edition this proto is on, or undefined if pre-editions
964
+ * @returns The feature values to override
965
+ */
966
+ public _inferLegacyProtoFeatures ( edition : ( string | undefined ) ) : object ;
967
+
943
968
/**
944
969
* Gets an option value.
945
970
* @param name Option name
@@ -1031,6 +1056,13 @@ export class OneOf extends ReflectionObject {
1031
1056
*/
1032
1057
public remove ( field : Field ) : OneOf ;
1033
1058
1059
+ /**
1060
+ * Determines whether this field corresponds to a synthetic oneof created for
1061
+ * a proto3 optional field. No behavioral logic should depend on this, but it
1062
+ * can be relevant for reflection.
1063
+ */
1064
+ public readonly isProto3Optional : boolean ;
1065
+
1034
1066
/**
1035
1067
* OneOf decorator (TypeScript).
1036
1068
* @param fieldNames Field names
@@ -1076,9 +1108,6 @@ export interface IParserResult {
1076
1108
/** Weak imports, if any */
1077
1109
weakImports : ( string [ ] | undefined ) ;
1078
1110
1079
- /** Syntax, if specified (either `"proto2"` or `"proto3"`) */
1080
- syntax : ( string | undefined ) ;
1081
-
1082
1111
/** Populated root instance */
1083
1112
root : Root ;
1084
1113
}
0 commit comments