@bufbuild/protobuf 2.2.4 → 2.3.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 (70) hide show
  1. package/dist/cjs/clone.js +4 -6
  2. package/dist/cjs/codegenv1/boot.js +1 -1
  3. package/dist/cjs/codegenv1/embed.js +0 -1
  4. package/dist/cjs/codegenv1/file.js +1 -1
  5. package/dist/cjs/codegenv1/symbols.js +1 -1
  6. package/dist/cjs/create.js +0 -1
  7. package/dist/cjs/equals.js +2 -1
  8. package/dist/cjs/extensions.js +3 -3
  9. package/dist/cjs/from-binary.js +5 -3
  10. package/dist/cjs/from-json.js +8 -10
  11. package/dist/cjs/proto-int64.js +4 -1
  12. package/dist/cjs/reflect/guard.js +2 -1
  13. package/dist/cjs/reflect/index.d.ts +1 -0
  14. package/dist/cjs/reflect/index.js +1 -0
  15. package/dist/cjs/reflect/names.d.ts +8 -0
  16. package/dist/cjs/reflect/names.js +28 -0
  17. package/dist/cjs/reflect/path.d.ts +107 -0
  18. package/dist/cjs/reflect/path.js +376 -0
  19. package/dist/cjs/reflect/reflect-check.js +3 -3
  20. package/dist/cjs/reflect/reflect-types.d.ts +1 -1
  21. package/dist/cjs/reflect/reflect.js +9 -7
  22. package/dist/cjs/reflect/scalar.js +4 -5
  23. package/dist/cjs/reflect/unsafe.d.ts +3 -6
  24. package/dist/cjs/reflect/unsafe.js +11 -10
  25. package/dist/cjs/registry.js +17 -25
  26. package/dist/cjs/to-binary.js +1 -1
  27. package/dist/cjs/to-json.d.ts +6 -0
  28. package/dist/cjs/to-json.js +16 -18
  29. package/dist/cjs/wire/base64-encoding.js +4 -3
  30. package/dist/cjs/wire/binary-encoding.js +7 -6
  31. package/dist/cjs/wire/text-encoding.js +1 -1
  32. package/dist/cjs/wire/text-format.js +3 -4
  33. package/dist/cjs/wire/varint.js +0 -1
  34. package/dist/cjs/wkt/timestamp.js +3 -2
  35. package/dist/esm/clone.js +4 -6
  36. package/dist/esm/codegenv1/boot.js +1 -1
  37. package/dist/esm/codegenv1/embed.js +0 -1
  38. package/dist/esm/codegenv1/file.js +1 -1
  39. package/dist/esm/codegenv1/symbols.js +1 -1
  40. package/dist/esm/create.js +0 -2
  41. package/dist/esm/equals.js +2 -1
  42. package/dist/esm/extensions.js +3 -3
  43. package/dist/esm/from-binary.js +5 -3
  44. package/dist/esm/from-json.js +8 -10
  45. package/dist/esm/proto-int64.js +4 -1
  46. package/dist/esm/reflect/guard.js +2 -1
  47. package/dist/esm/reflect/index.d.ts +1 -0
  48. package/dist/esm/reflect/index.js +1 -0
  49. package/dist/esm/reflect/names.d.ts +8 -0
  50. package/dist/esm/reflect/names.js +27 -0
  51. package/dist/esm/reflect/path.d.ts +107 -0
  52. package/dist/esm/reflect/path.js +369 -0
  53. package/dist/esm/reflect/reflect-check.js +3 -3
  54. package/dist/esm/reflect/reflect-types.d.ts +1 -1
  55. package/dist/esm/reflect/reflect-types.js +0 -1
  56. package/dist/esm/reflect/reflect.js +9 -7
  57. package/dist/esm/reflect/scalar.js +4 -5
  58. package/dist/esm/reflect/unsafe.d.ts +3 -6
  59. package/dist/esm/reflect/unsafe.js +11 -10
  60. package/dist/esm/registry.js +17 -25
  61. package/dist/esm/to-binary.js +1 -1
  62. package/dist/esm/to-json.d.ts +6 -0
  63. package/dist/esm/to-json.js +16 -18
  64. package/dist/esm/wire/base64-encoding.js +4 -3
  65. package/dist/esm/wire/binary-encoding.js +7 -6
  66. package/dist/esm/wire/text-encoding.js +1 -1
  67. package/dist/esm/wire/text-format.js +3 -4
  68. package/dist/esm/wire/varint.js +0 -1
  69. package/dist/esm/wkt/timestamp.js +3 -2
  70. package/package.json +9 -24
package/dist/cjs/clone.js CHANGED
@@ -30,24 +30,22 @@ function cloneReflect(i) {
30
30
  continue;
31
31
  }
32
32
  switch (f.fieldKind) {
33
- default: {
34
- o.set(f, cloneSingular(f, i.get(f)));
35
- break;
36
- }
37
33
  case "list":
38
- // eslint-disable-next-line no-case-declarations
39
34
  const list = o.get(f);
40
35
  for (const item of i.get(f)) {
41
36
  list.add(cloneSingular(f, item));
42
37
  }
43
38
  break;
44
39
  case "map":
45
- // eslint-disable-next-line no-case-declarations
46
40
  const map = o.get(f);
47
41
  for (const entry of i.get(f).entries()) {
48
42
  map.set(entry[0], cloneSingular(f, entry[1]));
49
43
  }
50
44
  break;
45
+ default: {
46
+ o.set(f, cloneSingular(f, i.get(f)));
47
+ break;
48
+ }
51
49
  }
52
50
  }
53
51
  const unknown = i.getUnknown();
@@ -29,7 +29,7 @@ function boot(boot) {
29
29
  const root = bootFileDescriptorProto(boot);
30
30
  root.messageType.forEach(restore_json_names_js_1.restoreJsonNames);
31
31
  const reg = (0, registry_js_1.createFileRegistry)(root, () => undefined);
32
- // non-null assertion because we just created the registry from the file we look up
32
+ // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
33
33
  return reg.getFile(root.name);
34
34
  }
35
35
  /**
@@ -235,7 +235,6 @@ function createEnumDescriptorBoot(proto) {
235
235
  * Assert that condition is truthy or throw error.
236
236
  */
237
237
  function assert(condition) {
238
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions -- we want the implicit conversion to boolean
239
238
  if (!condition) {
240
239
  throw new Error();
241
240
  }
@@ -30,6 +30,6 @@ function fileDesc(b64, imports) {
30
30
  root.messageType.forEach(restore_json_names_js_1.restoreJsonNames);
31
31
  root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : [];
32
32
  const reg = (0, registry_js_1.createFileRegistry)(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName));
33
- // non-null assertion because we just created the registry from the file we look up
33
+ // biome-ignore lint/style/noNonNullAssertion: non-null assertion because we just created the registry from the file we look up
34
34
  return reg.getFile(root.name);
35
35
  }
@@ -38,7 +38,7 @@ exports.wktPublicImportPaths = {
38
38
  /**
39
39
  * @private
40
40
  */
41
- // prettier-ignore
41
+ // biome-ignore format: want this to read well
42
42
  exports.symbols = {
43
43
  isMessage: { typeOnly: false, bootstrapWktFrom: "../../is-message.js", from: exports.packageName },
44
44
  Message: { typeOnly: true, bootstrapWktFrom: "../../types.js", from: exports.packageName },
@@ -64,7 +64,6 @@ function initMessage(messageDesc, message, init) {
64
64
  else {
65
65
  field = member;
66
66
  }
67
- // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check -- no need to convert enum
68
67
  switch (field.fieldKind) {
69
68
  case "message":
70
69
  value = toMessage(field, value);
@@ -165,7 +165,8 @@ function unknownEquals(a, b, registry) {
165
165
  return false;
166
166
  }
167
167
  for (let i = 0; i < unknownA.length; i++) {
168
- const a = unknownA[i], b = unknownB[i];
168
+ const a = unknownA[i];
169
+ const b = unknownB[i];
169
170
  if (a.no != b.no) {
170
171
  return false;
171
172
  }
@@ -47,7 +47,7 @@ function getExtension(message, extension) {
47
47
  const [container, field, get] = createExtensionContainer(extension);
48
48
  for (const uf of ufs) {
49
49
  (0, from_binary_js_1.readField)(container, new binary_encoding_js_1.BinaryReader(uf.data), field, uf.wireType, {
50
- readUnknownFields: false,
50
+ readUnknownFields: true,
51
51
  });
52
52
  }
53
53
  return get();
@@ -64,7 +64,7 @@ function setExtension(message, extension, value) {
64
64
  const ufs = ((_a = message.$unknown) !== null && _a !== void 0 ? _a : []).filter((uf) => uf.no !== extension.number);
65
65
  const [container, field] = createExtensionContainer(extension, value);
66
66
  const writer = new binary_encoding_js_1.BinaryWriter();
67
- (0, to_binary_js_1.writeField)(writer, { writeUnknownFields: false }, container, field);
67
+ (0, to_binary_js_1.writeField)(writer, { writeUnknownFields: true }, container, field);
68
68
  const reader = new binary_encoding_js_1.BinaryReader(writer.finish());
69
69
  while (reader.pos < reader.len) {
70
70
  const [no, wireType] = reader.tag();
@@ -151,7 +151,7 @@ function createExtensionContainer(extension, value) {
151
151
  () => {
152
152
  const value = container[localName];
153
153
  if (value === undefined) {
154
- // Only message fields are undefined, rest will have a zero value.
154
+ // biome-ignore lint/style/noNonNullAssertion: Only message fields are undefined, rest will have a zero value.
155
155
  const desc = extension.message;
156
156
  if ((0, wrappers_js_1.isWrapperDesc)(desc)) {
157
157
  return (0, scalar_js_1.scalarZeroValue)(desc.fields[0].scalar, desc.fields[0].longAsString);
@@ -59,7 +59,8 @@ function mergeFromBinary(schema, target, bytes, options) {
59
59
  function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) {
60
60
  var _a;
61
61
  const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo;
62
- let fieldNo, wireType;
62
+ let fieldNo;
63
+ let wireType;
63
64
  const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
64
65
  while (reader.pos < end) {
65
66
  [fieldNo, wireType] = reader.tag();
@@ -78,7 +79,7 @@ function readMessage(message, reader, options, delimited, lengthOrDelimitedField
78
79
  }
79
80
  if (delimited) {
80
81
  if (wireType != binary_encoding_js_1.WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) {
81
- throw new Error(`invalid end group tag`);
82
+ throw new Error("invalid end group tag");
82
83
  }
83
84
  }
84
85
  if (unknownFields.length > 0) {
@@ -110,7 +111,8 @@ function readField(message, reader, field, wireType, options) {
110
111
  // Read a map field, expecting key field = 1, value field = 2
111
112
  function readMapEntry(reader, map, options) {
112
113
  const field = map.field();
113
- let key, val;
114
+ let key;
115
+ let val;
114
116
  const end = reader.pos + reader.uint32();
115
117
  while (reader.pos < end) {
116
118
  const [fieldNo] = reader.tag();
@@ -19,7 +19,6 @@ exports.fromJson = fromJson;
19
19
  exports.mergeFromJson = mergeFromJson;
20
20
  exports.enumFromJson = enumFromJson;
21
21
  exports.isEnumJson = isEnumJson;
22
- /* eslint-disable no-case-declarations,@typescript-eslint/restrict-template-expressions */
23
22
  const descriptors_js_1 = require("./descriptors.js");
24
23
  const proto_int64_js_1 = require("./proto-int64.js");
25
24
  const create_js_1 = require("./create.js");
@@ -104,7 +103,7 @@ function mergeFromJson(schema, target, json, options) {
104
103
  function enumFromJson(descEnum, json) {
105
104
  const val = readEnum(descEnum, json, false, false);
106
105
  if (val === tokenIgnoredUnknownEnum) {
107
- throw new Error(`cannot decode ${String(descEnum)} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`);
106
+ throw new Error(`cannot decode ${descEnum} from JSON: ${(0, reflect_check_js_1.formatVal)(json)}`);
108
107
  }
109
108
  return val;
110
109
  }
@@ -147,6 +146,7 @@ function readMessage(msg, json, opts) {
147
146
  let extension = undefined;
148
147
  if (jsonKey.startsWith("[") &&
149
148
  jsonKey.endsWith("]") &&
149
+ // biome-ignore lint/suspicious/noAssignInExpressions: no
150
150
  (extension = (_a = opts.registry) === null || _a === void 0 ? void 0 : _a.getExtension(jsonKey.substring(1, jsonKey.length - 1))) &&
151
151
  extension.extendee.typeName === msg.desc.typeName) {
152
152
  const [container, field, get] = (0, extensions_js_1.createExtensionContainer)(extension);
@@ -276,7 +276,6 @@ function readEnum(desc, json, ignoreUnknownFields, nullAsZeroValue) {
276
276
  }
277
277
  return nullAsZeroValue ? desc.values[0].number : tokenNull;
278
278
  }
279
- // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
280
279
  switch (typeof json) {
281
280
  case "number":
282
281
  if (Number.isInteger(json)) {
@@ -305,7 +304,6 @@ function scalarFromJson(field, json, nullAsZeroValue) {
305
304
  }
306
305
  // int64, sfixed64, sint64, fixed64, uint64: Reflect supports string and number.
307
306
  // string, bool: Supported by reflect.
308
- // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
309
307
  switch (field.scalar) {
310
308
  // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
311
309
  // Either numbers or strings are accepted. Exponent notation is also accepted.
@@ -318,11 +316,11 @@ function scalarFromJson(field, json, nullAsZeroValue) {
318
316
  if (json === "-Infinity")
319
317
  return Number.NEGATIVE_INFINITY;
320
318
  if (typeof json == "number") {
321
- if (isNaN(json)) {
319
+ if (Number.isNaN(json)) {
322
320
  // NaN must be encoded with string constants
323
321
  throw new error_js_1.FieldError(field, "unexpected NaN number");
324
322
  }
325
- if (!isFinite(json)) {
323
+ if (!Number.isFinite(json)) {
326
324
  // Infinity must be encoded with string constants
327
325
  throw new error_js_1.FieldError(field, "unexpected infinite number");
328
326
  }
@@ -338,7 +336,7 @@ function scalarFromJson(field, json, nullAsZeroValue) {
338
336
  break;
339
337
  }
340
338
  const float = Number(json);
341
- if (!isFinite(float)) {
339
+ if (!Number.isFinite(float)) {
342
340
  // Infinity and NaN must be encoded with string constants
343
341
  break;
344
342
  }
@@ -379,7 +377,6 @@ function scalarFromJson(field, json, nullAsZeroValue) {
379
377
  function mapKeyFromJson(type, json) {
380
378
  switch (type) {
381
379
  case descriptors_js_1.ScalarType.BOOL:
382
- // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
383
380
  switch (json) {
384
381
  case "true":
385
382
  return true;
@@ -497,11 +494,12 @@ function anyFromJson(any, json, opts) {
497
494
  const msg = (0, reflect_js_1.reflect)(desc);
498
495
  if (typeName.startsWith("google.protobuf.") &&
499
496
  Object.prototype.hasOwnProperty.call(json, "value")) {
500
- const value = json["value"];
497
+ const value = json.value;
501
498
  readMessage(msg, value, opts);
502
499
  }
503
500
  else {
504
501
  const copy = Object.assign({}, json);
502
+ // biome-ignore lint/performance/noDelete: <explanation>
505
503
  delete copy["@type"];
506
504
  readMessage(msg, copy, opts);
507
505
  }
@@ -516,7 +514,7 @@ function timestampFromJson(timestamp, json) {
516
514
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
517
515
  }
518
516
  const ms = Date.parse(
519
- //prettier-ignore
517
+ // biome-ignore format: want this to read well
520
518
  matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z"));
521
519
  if (Number.isNaN(ms)) {
522
520
  throw new Error(`cannot decode message ${timestamp.$typeName} from JSON: invalid RFC 3339 string`);
@@ -31,7 +31,10 @@ function makeInt64Support() {
31
31
  typeof process.env != "object" ||
32
32
  process.env.BUF_BIGINT_DISABLE !== "1");
33
33
  if (ok) {
34
- const MIN = BigInt("-9223372036854775808"), MAX = BigInt("9223372036854775807"), UMIN = BigInt("0"), UMAX = BigInt("18446744073709551615");
34
+ const MIN = BigInt("-9223372036854775808");
35
+ const MAX = BigInt("9223372036854775807");
36
+ const UMIN = BigInt("0");
37
+ const UMAX = BigInt("18446744073709551615");
35
38
  return {
36
39
  zero: BigInt(0),
37
40
  supported: true,
@@ -38,7 +38,8 @@ function isReflectList(arg, field) {
38
38
  "field" in arg &&
39
39
  typeof arg.field == "function") {
40
40
  if (field !== undefined) {
41
- const a = field, b = arg.field();
41
+ const a = field;
42
+ const b = arg.field();
42
43
  return (a.listKind == b.listKind &&
43
44
  a.scalar === b.scalar &&
44
45
  ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) &&
@@ -4,4 +4,5 @@ export * from "./nested-types.js";
4
4
  export * from "./reflect.js";
5
5
  export * from "./reflect-types.js";
6
6
  export * from "./scalar.js";
7
+ export * from "./path.js";
7
8
  export { isReflectList, isReflectMap, isReflectMessage } from "./guard.js";
@@ -34,6 +34,7 @@ __exportStar(require("./nested-types.js"), exports);
34
34
  __exportStar(require("./reflect.js"), exports);
35
35
  __exportStar(require("./reflect-types.js"), exports);
36
36
  __exportStar(require("./scalar.js"), exports);
37
+ __exportStar(require("./path.js"), exports);
37
38
  var guard_js_1 = require("./guard.js");
38
39
  Object.defineProperty(exports, "isReflectList", { enumerable: true, get: function () { return guard_js_1.isReflectList; } });
39
40
  Object.defineProperty(exports, "isReflectMap", { enumerable: true, get: function () { return guard_js_1.isReflectMap; } });
@@ -1,3 +1,11 @@
1
+ import type { AnyDesc } from "../descriptors.js";
2
+ /**
3
+ * Return a fully-qualified name for a Protobuf descriptor.
4
+ * For a file descriptor, return the original file path.
5
+ *
6
+ * See https://protobuf.com/docs/language-spec#fully-qualified-names
7
+ */
8
+ export declare function qualifiedName(desc: AnyDesc): string;
1
9
  /**
2
10
  * Converts snake_case to protoCamelCase according to the convention
3
11
  * used by protoc to convert a field name to a JSON name.
@@ -13,8 +13,36 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.qualifiedName = qualifiedName;
16
17
  exports.protoCamelCase = protoCamelCase;
17
18
  exports.safeObjectProperty = safeObjectProperty;
19
+ /**
20
+ * Return a fully-qualified name for a Protobuf descriptor.
21
+ * For a file descriptor, return the original file path.
22
+ *
23
+ * See https://protobuf.com/docs/language-spec#fully-qualified-names
24
+ */
25
+ function qualifiedName(desc) {
26
+ switch (desc.kind) {
27
+ case "field":
28
+ case "oneof":
29
+ case "rpc":
30
+ return desc.parent.typeName + "." + desc.name;
31
+ case "enum_value": {
32
+ const p = desc.parent.parent
33
+ ? desc.parent.parent.typeName
34
+ : desc.parent.file.proto.package;
35
+ return p + (p.length > 0 ? "." : "") + desc.name;
36
+ }
37
+ case "service":
38
+ case "message":
39
+ case "enum":
40
+ case "extension":
41
+ return desc.typeName;
42
+ case "file":
43
+ return desc.proto.name;
44
+ }
45
+ }
18
46
  /**
19
47
  * Converts snake_case to protoCamelCase according to the convention
20
48
  * used by protoc to convert a field name to a JSON name.
@@ -0,0 +1,107 @@
1
+ import { type DescExtension, type DescField, type DescMessage, type DescOneof } from "../descriptors.js";
2
+ import type { Registry } from "../registry.js";
3
+ /**
4
+ * A path to a (nested) member of a Protobuf message, such as a field, oneof,
5
+ * extension, list element, or map entry.
6
+ *
7
+ * Note that we may add additional types to this union in the future to support
8
+ * more use cases.
9
+ */
10
+ export type Path = (DescField | DescExtension | DescOneof | {
11
+ kind: "list_sub";
12
+ index: number;
13
+ } | {
14
+ kind: "map_sub";
15
+ key: string | number | bigint | boolean;
16
+ })[];
17
+ /**
18
+ * Builds a Path.
19
+ */
20
+ export type PathBuilder = {
21
+ /**
22
+ * The root message of the path.
23
+ */
24
+ readonly schema: DescMessage;
25
+ /**
26
+ * Add field access.
27
+ *
28
+ * Throws an InvalidPathError if the field cannot be added to the path.
29
+ */
30
+ field(field: DescField): PathBuilder;
31
+ /**
32
+ * Access a oneof.
33
+ *
34
+ * Throws an InvalidPathError if the oneof cannot be added to the path.
35
+ *
36
+ */
37
+ oneof(oneof: DescOneof): PathBuilder;
38
+ /**
39
+ * Access an extension.
40
+ *
41
+ * Throws an InvalidPathError if the extension cannot be added to the path.
42
+ */
43
+ extension(extension: DescExtension): PathBuilder;
44
+ /**
45
+ * Access a list field by index.
46
+ *
47
+ * Throws an InvalidPathError if the list access cannot be added to the path.
48
+ */
49
+ list(index: number): PathBuilder;
50
+ /**
51
+ * Access a map field by key.
52
+ *
53
+ * Throws an InvalidPathError if the map access cannot be added to the path.
54
+ */
55
+ map(key: string | number | bigint | boolean): PathBuilder;
56
+ /**
57
+ * Append a path.
58
+ *
59
+ * Throws an InvalidPathError if the path cannot be added.
60
+ */
61
+ add(path: Path | PathBuilder): PathBuilder;
62
+ /**
63
+ * Return the path.
64
+ */
65
+ toPath(): Path;
66
+ /**
67
+ * Create a copy of this builder.
68
+ */
69
+ clone(): PathBuilder;
70
+ /**
71
+ * Get the current container - a list, map, or message.
72
+ */
73
+ getLeft(): DescMessage | (DescField & {
74
+ fieldKind: "list";
75
+ }) | (DescField & {
76
+ fieldKind: "map";
77
+ }) | undefined;
78
+ };
79
+ /**
80
+ * Create a PathBuilder.
81
+ */
82
+ export declare function buildPath(schema: DescMessage): PathBuilder;
83
+ /**
84
+ * Parse a Path from a string.
85
+ *
86
+ * Throws an InvalidPathError if the path is invalid.
87
+ *
88
+ * Note that a Registry must be provided via the options argument to parse
89
+ * paths that refer to an extension.
90
+ */
91
+ export declare function parsePath(schema: DescMessage, path: string, options?: {
92
+ registry?: Registry;
93
+ }): Path;
94
+ /**
95
+ * Stringify a path.
96
+ */
97
+ export declare function pathToString(path: Path): string;
98
+ /**
99
+ * InvalidPathError is thrown for invalid Paths, for example during parsing from
100
+ * a string, or when a new Path is built.
101
+ */
102
+ export declare class InvalidPathError extends Error {
103
+ name: string;
104
+ readonly schema: DescMessage;
105
+ readonly path: Path | string;
106
+ constructor(schema: DescMessage, message: string, path: string | Path);
107
+ }