protobufjs 8.6.1 → 8.6.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.
- package/LICENSE +39 -39
- package/README.md +441 -441
- package/dist/light/protobuf.js +8455 -8455
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +2999 -2999
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +10359 -10359
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/README.md +70 -70
- package/ext/debug/README.md +4 -4
- package/ext/debug/index.js +71 -71
- package/ext/descriptor/README.md +5 -5
- package/ext/descriptor/index.d.ts +2 -2
- package/ext/descriptor/index.js +2 -2
- package/ext/descriptor.d.ts +87 -87
- package/ext/descriptor.js +1354 -1354
- package/ext/protojson.LICENSE +201 -201
- package/ext/protojson.d.ts +20 -20
- package/ext/protojson.js +925 -925
- package/ext/textformat.d.ts +19 -19
- package/ext/textformat.js +1256 -1256
- package/google/LICENSE +27 -27
- package/google/README.md +1 -1
- package/google/api/annotations.json +82 -82
- package/google/api/annotations.proto +10 -10
- package/google/api/http.json +85 -85
- package/google/api/http.proto +30 -30
- package/google/protobuf/api.json +117 -117
- package/google/protobuf/api.proto +33 -33
- package/google/protobuf/compiler/plugin.json +126 -126
- package/google/protobuf/compiler/plugin.proto +47 -47
- package/google/protobuf/descriptor.json +1381 -1381
- package/google/protobuf/descriptor.proto +534 -534
- package/google/protobuf/source_context.json +19 -19
- package/google/protobuf/source_context.proto +7 -7
- package/google/protobuf/type.json +201 -201
- package/google/protobuf/type.proto +89 -89
- package/index.d.ts +1 -1
- package/index.js +4 -4
- package/light.d.ts +2 -2
- package/light.js +3 -3
- package/minimal.d.ts +2 -2
- package/minimal.js +4 -4
- package/package.json +93 -93
- package/src/common.js +399 -399
- package/src/converter.js +344 -344
- package/src/decoder.js +208 -208
- package/src/encoder.js +111 -111
- package/src/enum.js +231 -231
- package/src/field.js +497 -497
- package/src/index-light.js +104 -104
- package/src/index-minimal.js +36 -36
- package/src/index.js +12 -12
- package/src/mapfield.js +136 -136
- package/src/message.js +137 -137
- package/src/method.js +175 -175
- package/src/namespace.js +565 -565
- package/src/object.js +382 -382
- package/src/oneof.js +225 -225
- package/src/parse.js +1068 -1068
- package/src/reader.js +543 -543
- package/src/reader_buffer.js +72 -72
- package/src/root.js +416 -416
- package/src/roots.js +18 -18
- package/src/rpc/service.js +148 -148
- package/src/rpc.js +36 -36
- package/src/service.js +198 -198
- package/src/tokenize.js +421 -421
- package/src/type.js +655 -655
- package/src/types.js +196 -196
- package/src/typescript.js +25 -25
- package/src/util/aspromise.d.ts +13 -13
- package/src/util/aspromise.js +52 -52
- package/src/util/base64.d.ts +32 -32
- package/src/util/base64.js +146 -146
- package/src/util/codegen.d.ts +31 -31
- package/src/util/codegen.js +113 -113
- package/src/util/eventemitter.d.ts +45 -45
- package/src/util/eventemitter.js +86 -86
- package/src/util/fetch.d.ts +56 -56
- package/src/util/fetch.js +112 -112
- package/src/util/float.d.ts +83 -83
- package/src/util/float.js +335 -335
- package/src/util/fs.js +11 -11
- package/src/util/longbits.js +200 -200
- package/src/util/minimal.js +515 -515
- package/src/util/path.d.ts +22 -22
- package/src/util/path.js +72 -72
- package/src/util/patterns.js +7 -7
- package/src/util/pool.d.ts +32 -32
- package/src/util/pool.js +48 -48
- package/src/util/utf8.d.ts +24 -24
- package/src/util/utf8.js +130 -130
- package/src/util.js +242 -242
- package/src/verifier.js +180 -180
- package/src/wrappers.js +106 -106
- package/src/writer.js +495 -495
- package/src/writer_buffer.js +102 -102
- package/tsconfig.json +6 -6
package/ext/README.md
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
# protobuf.js Extensions
|
|
2
|
-
|
|
3
|
-
## descriptor
|
|
4
|
-
|
|
5
|
-
Optional `descriptor.proto` support for converting reflected protobuf.js roots and objects to and from descriptor messages.
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import protobuf from "protobufjs";
|
|
9
|
-
import descriptor from "protobufjs/ext/descriptor.js";
|
|
10
|
-
|
|
11
|
-
// Convert an existing root to a FileDescriptorSet message.
|
|
12
|
-
const root = ...;
|
|
13
|
-
const set = root.toDescriptor("proto2");
|
|
14
|
-
|
|
15
|
-
// Encode descriptor buffers.
|
|
16
|
-
const buffer = descriptor.FileDescriptorSet.encode(set).finish();
|
|
17
|
-
|
|
18
|
-
// Convert a FileDescriptorSet message or buffer back to a root.
|
|
19
|
-
const decodedRoot = protobuf.Root.fromDescriptor(buffer);
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The extension requires reflection metadata and also works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
23
|
-
|
|
24
|
-
Importing the extension adds `.fromDescriptor(descriptor[, editionOrContext])` and `#toDescriptor([syntaxOrEdition])` methods to reflection objects and exports the bundled descriptor types from `google.protobuf`. Descriptor inputs can be decoded messages, readers, or buffers of the corresponding descriptor messages. Direct object descriptor imports accept either an edition string or a descriptor context with `edition`, `features` and `keepCase`.
|
|
25
|
-
|
|
26
|
-
The conversion covers descriptor messages that correspond to protobuf.js reflection objects: files and file sets, messages, fields and map fields, oneofs, enums, services and methods. Descriptor-only metadata such as source locations, generated-code annotations and uninterpreted options remains available through the exported descriptor message types, but is not mapped onto reflection objects. File names are inferred when generating descriptors because roots do not retain exact file/package boundaries.
|
|
27
|
-
|
|
28
|
-
## protojson
|
|
29
|
-
|
|
30
|
-
Optional ProtoJSON support for reflected message types.
|
|
31
|
-
|
|
32
|
-
> [!NOTE]
|
|
33
|
-
> Specialized code generation for the `pbjs` static-module target is a potential future extension. If you need this for high-throughput JSON transcoding or REST fallbacks in production, consider getting in touch and supporting the codegen and conformance work.
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
import protobuf from "protobufjs";
|
|
37
|
-
import protojson from "protobufjs/ext/protojson.js";
|
|
38
|
-
|
|
39
|
-
const root = ...;
|
|
40
|
-
const MyType = root.lookupType("MyType");
|
|
41
|
-
const message = protojson.fromJson(MyType, { value: 1 });
|
|
42
|
-
const json = protojson.toJson(MyType, message);
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
```js
|
|
46
|
-
const messageFromString = protojson.fromJsonString(MyType, '{"value":1}');
|
|
47
|
-
const jsonString = protojson.toJsonString(MyType, messageFromString);
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Importing the extension has no prototype side effects. Calling `protojson.install()` installs `fromJson`, `fromJsonString`, `toJson` and `toJsonString` convenience methods on `protobuf.Type.prototype`. It works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
51
|
-
|
|
52
|
-
Unknown fields can be ignored while parsing by passing `{ ignoreUnknownFields: true }` to `fromJson` or `fromJsonString`.
|
|
53
|
-
|
|
54
|
-
## textformat
|
|
55
|
-
|
|
56
|
-
Optional Text Format support for reflected message types.
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
import protobuf from "protobufjs";
|
|
60
|
-
import textformat from "protobufjs/ext/textformat.js";
|
|
61
|
-
|
|
62
|
-
const root = ...;
|
|
63
|
-
const MyType = root.lookupType("MyType");
|
|
64
|
-
const message = textformat.fromText(MyType, "value: 1");
|
|
65
|
-
const text = textformat.toText(MyType, message);
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Importing the extension has no prototype side effects. Calling `textformat.install()` installs `fromText` and `toText` convenience methods on `protobuf.Type.prototype`. It works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
69
|
-
|
|
70
|
-
Unknown fields can be printed with numeric field names by passing `{ unknowns: true }` to `toText`.
|
|
1
|
+
# protobuf.js Extensions
|
|
2
|
+
|
|
3
|
+
## descriptor
|
|
4
|
+
|
|
5
|
+
Optional `descriptor.proto` support for converting reflected protobuf.js roots and objects to and from descriptor messages.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import protobuf from "protobufjs";
|
|
9
|
+
import descriptor from "protobufjs/ext/descriptor.js";
|
|
10
|
+
|
|
11
|
+
// Convert an existing root to a FileDescriptorSet message.
|
|
12
|
+
const root = ...;
|
|
13
|
+
const set = root.toDescriptor("proto2");
|
|
14
|
+
|
|
15
|
+
// Encode descriptor buffers.
|
|
16
|
+
const buffer = descriptor.FileDescriptorSet.encode(set).finish();
|
|
17
|
+
|
|
18
|
+
// Convert a FileDescriptorSet message or buffer back to a root.
|
|
19
|
+
const decodedRoot = protobuf.Root.fromDescriptor(buffer);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The extension requires reflection metadata and also works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
23
|
+
|
|
24
|
+
Importing the extension adds `.fromDescriptor(descriptor[, editionOrContext])` and `#toDescriptor([syntaxOrEdition])` methods to reflection objects and exports the bundled descriptor types from `google.protobuf`. Descriptor inputs can be decoded messages, readers, or buffers of the corresponding descriptor messages. Direct object descriptor imports accept either an edition string or a descriptor context with `edition`, `features` and `keepCase`.
|
|
25
|
+
|
|
26
|
+
The conversion covers descriptor messages that correspond to protobuf.js reflection objects: files and file sets, messages, fields and map fields, oneofs, enums, services and methods. Descriptor-only metadata such as source locations, generated-code annotations and uninterpreted options remains available through the exported descriptor message types, but is not mapped onto reflection objects. File names are inferred when generating descriptors because roots do not retain exact file/package boundaries.
|
|
27
|
+
|
|
28
|
+
## protojson
|
|
29
|
+
|
|
30
|
+
Optional ProtoJSON support for reflected message types.
|
|
31
|
+
|
|
32
|
+
> [!NOTE]
|
|
33
|
+
> Specialized code generation for the `pbjs` static-module target is a potential future extension. If you need this for high-throughput JSON transcoding or REST fallbacks in production, consider getting in touch and supporting the codegen and conformance work.
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import protobuf from "protobufjs";
|
|
37
|
+
import protojson from "protobufjs/ext/protojson.js";
|
|
38
|
+
|
|
39
|
+
const root = ...;
|
|
40
|
+
const MyType = root.lookupType("MyType");
|
|
41
|
+
const message = protojson.fromJson(MyType, { value: 1 });
|
|
42
|
+
const json = protojson.toJson(MyType, message);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const messageFromString = protojson.fromJsonString(MyType, '{"value":1}');
|
|
47
|
+
const jsonString = protojson.toJsonString(MyType, messageFromString);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Importing the extension has no prototype side effects. Calling `protojson.install()` installs `fromJson`, `fromJsonString`, `toJson` and `toJsonString` convenience methods on `protobuf.Type.prototype`. It works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
51
|
+
|
|
52
|
+
Unknown fields can be ignored while parsing by passing `{ ignoreUnknownFields: true }` to `fromJson` or `fromJsonString`.
|
|
53
|
+
|
|
54
|
+
## textformat
|
|
55
|
+
|
|
56
|
+
Optional Text Format support for reflected message types.
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
import protobuf from "protobufjs";
|
|
60
|
+
import textformat from "protobufjs/ext/textformat.js";
|
|
61
|
+
|
|
62
|
+
const root = ...;
|
|
63
|
+
const MyType = root.lookupType("MyType");
|
|
64
|
+
const message = textformat.fromText(MyType, "value: 1");
|
|
65
|
+
const text = textformat.toText(MyType, message);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Importing the extension has no prototype side effects. Calling `textformat.install()` installs `fromText` and `toText` convenience methods on `protobuf.Type.prototype`. It works with `protobufjs/light.js` when schemas are loaded from JSON or otherwise provided as reflection objects.
|
|
69
|
+
|
|
70
|
+
Unknown fields can be printed with numeric field names by passing `{ unknowns: true }` to `toText`.
|
package/ext/debug/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
protobufjs/ext/debug
|
|
2
|
-
=========================
|
|
3
|
-
|
|
4
|
-
Experimental debugging extension.
|
|
1
|
+
protobufjs/ext/debug
|
|
2
|
+
=========================
|
|
3
|
+
|
|
4
|
+
Experimental debugging extension.
|
package/ext/debug/index.js
CHANGED
|
@@ -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
|
+
};
|
package/ext/descriptor/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# protobufjs/ext/descriptor
|
|
2
|
-
|
|
3
|
-
This directory is kept as a backwards-compatible shim for `protobufjs/ext/descriptor` and may be removed in a future major release.
|
|
4
|
-
|
|
5
|
-
The descriptor extension documentation now lives in [../README.md](../README.md#descriptor).
|
|
1
|
+
# protobufjs/ext/descriptor
|
|
2
|
+
|
|
3
|
+
This directory is kept as a backwards-compatible shim for `protobufjs/ext/descriptor` and may be removed in a future major release.
|
|
4
|
+
|
|
5
|
+
The descriptor extension documentation now lives in [../README.md](../README.md#descriptor).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as $protobuf from "../..";
|
|
2
|
-
import Long = require("long");
|
|
1
|
+
import * as $protobuf from "../..";
|
|
2
|
+
import Long = require("long");
|
package/ext/descriptor/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
module.exports = require("../descriptor");
|
|
1
|
+
"use strict";
|
|
2
|
+
module.exports = require("../descriptor");
|
package/ext/descriptor.d.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import * as $protobuf from "..";
|
|
2
|
-
import {
|
|
3
|
-
IDescriptorProto,
|
|
4
|
-
IDescriptorContext,
|
|
5
|
-
IEnumDescriptorProto,
|
|
6
|
-
IFieldDescriptorProto,
|
|
7
|
-
IFileDescriptorSet,
|
|
8
|
-
IMethodDescriptorProto,
|
|
9
|
-
IOneofDescriptorProto,
|
|
10
|
-
IServiceDescriptorProto
|
|
11
|
-
} from "./descriptor.generated";
|
|
12
|
-
|
|
13
|
-
export * from "./descriptor.generated";
|
|
14
|
-
|
|
15
|
-
type DescriptorInput<T> = T | $protobuf.Reader | Uint8Array;
|
|
16
|
-
|
|
17
|
-
declare module ".." {
|
|
18
|
-
namespace Root {
|
|
19
|
-
/** Creates a root from a descriptor set. */
|
|
20
|
-
function fromDescriptor(descriptor: DescriptorInput<IFileDescriptorSet>, options?: { keepCase?: boolean }): $protobuf.Root;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface Root {
|
|
24
|
-
/** Converts this root to a descriptor set. */
|
|
25
|
-
toDescriptor(edition?: string): $protobuf.Message<IFileDescriptorSet> & IFileDescriptorSet;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
namespace Type {
|
|
29
|
-
/** Creates a type from a descriptor. */
|
|
30
|
-
function fromDescriptor(descriptor: DescriptorInput<IDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Type;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface Type {
|
|
34
|
-
/** Converts this type to a descriptor. */
|
|
35
|
-
toDescriptor(edition?: string): $protobuf.Message<IDescriptorProto> & IDescriptorProto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
namespace Field {
|
|
39
|
-
/** Creates a field from a descriptor. */
|
|
40
|
-
function fromDescriptor(descriptor: DescriptorInput<IFieldDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Field;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface Field {
|
|
44
|
-
/** Converts this field to a descriptor. */
|
|
45
|
-
toDescriptor(edition?: string): $protobuf.Message<IFieldDescriptorProto> & IFieldDescriptorProto;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
namespace Enum {
|
|
49
|
-
/** Creates an enum from a descriptor. */
|
|
50
|
-
function fromDescriptor(descriptor: DescriptorInput<IEnumDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Enum;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface Enum {
|
|
54
|
-
/** Converts this enum to a descriptor. */
|
|
55
|
-
toDescriptor(): $protobuf.Message<IEnumDescriptorProto> & IEnumDescriptorProto;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
namespace OneOf {
|
|
59
|
-
/** Creates a oneof from a descriptor. */
|
|
60
|
-
function fromDescriptor(descriptor: DescriptorInput<IOneofDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.OneOf;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface OneOf {
|
|
64
|
-
/** Converts this oneof to a descriptor. */
|
|
65
|
-
toDescriptor(): $protobuf.Message<IOneofDescriptorProto> & IOneofDescriptorProto;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
namespace Service {
|
|
69
|
-
/** Creates a service from a descriptor. */
|
|
70
|
-
function fromDescriptor(descriptor: DescriptorInput<IServiceDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Service;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface Service {
|
|
74
|
-
/** Converts this service to a descriptor. */
|
|
75
|
-
toDescriptor(): $protobuf.Message<IServiceDescriptorProto> & IServiceDescriptorProto;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
namespace Method {
|
|
79
|
-
/** Creates a method from a descriptor. */
|
|
80
|
-
function fromDescriptor(descriptor: DescriptorInput<IMethodDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Method;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface Method {
|
|
84
|
-
/** Converts this method to a descriptor. */
|
|
85
|
-
toDescriptor(): $protobuf.Message<IMethodDescriptorProto> & IMethodDescriptorProto;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
import * as $protobuf from "..";
|
|
2
|
+
import {
|
|
3
|
+
IDescriptorProto,
|
|
4
|
+
IDescriptorContext,
|
|
5
|
+
IEnumDescriptorProto,
|
|
6
|
+
IFieldDescriptorProto,
|
|
7
|
+
IFileDescriptorSet,
|
|
8
|
+
IMethodDescriptorProto,
|
|
9
|
+
IOneofDescriptorProto,
|
|
10
|
+
IServiceDescriptorProto
|
|
11
|
+
} from "./descriptor.generated";
|
|
12
|
+
|
|
13
|
+
export * from "./descriptor.generated";
|
|
14
|
+
|
|
15
|
+
type DescriptorInput<T> = T | $protobuf.Reader | Uint8Array;
|
|
16
|
+
|
|
17
|
+
declare module ".." {
|
|
18
|
+
namespace Root {
|
|
19
|
+
/** Creates a root from a descriptor set. */
|
|
20
|
+
function fromDescriptor(descriptor: DescriptorInput<IFileDescriptorSet>, options?: { keepCase?: boolean }): $protobuf.Root;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Root {
|
|
24
|
+
/** Converts this root to a descriptor set. */
|
|
25
|
+
toDescriptor(edition?: string): $protobuf.Message<IFileDescriptorSet> & IFileDescriptorSet;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
namespace Type {
|
|
29
|
+
/** Creates a type from a descriptor. */
|
|
30
|
+
function fromDescriptor(descriptor: DescriptorInput<IDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Type;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Type {
|
|
34
|
+
/** Converts this type to a descriptor. */
|
|
35
|
+
toDescriptor(edition?: string): $protobuf.Message<IDescriptorProto> & IDescriptorProto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
namespace Field {
|
|
39
|
+
/** Creates a field from a descriptor. */
|
|
40
|
+
function fromDescriptor(descriptor: DescriptorInput<IFieldDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Field;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface Field {
|
|
44
|
+
/** Converts this field to a descriptor. */
|
|
45
|
+
toDescriptor(edition?: string): $protobuf.Message<IFieldDescriptorProto> & IFieldDescriptorProto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
namespace Enum {
|
|
49
|
+
/** Creates an enum from a descriptor. */
|
|
50
|
+
function fromDescriptor(descriptor: DescriptorInput<IEnumDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Enum;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface Enum {
|
|
54
|
+
/** Converts this enum to a descriptor. */
|
|
55
|
+
toDescriptor(): $protobuf.Message<IEnumDescriptorProto> & IEnumDescriptorProto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
namespace OneOf {
|
|
59
|
+
/** Creates a oneof from a descriptor. */
|
|
60
|
+
function fromDescriptor(descriptor: DescriptorInput<IOneofDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.OneOf;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface OneOf {
|
|
64
|
+
/** Converts this oneof to a descriptor. */
|
|
65
|
+
toDescriptor(): $protobuf.Message<IOneofDescriptorProto> & IOneofDescriptorProto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
namespace Service {
|
|
69
|
+
/** Creates a service from a descriptor. */
|
|
70
|
+
function fromDescriptor(descriptor: DescriptorInput<IServiceDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Service;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface Service {
|
|
74
|
+
/** Converts this service to a descriptor. */
|
|
75
|
+
toDescriptor(): $protobuf.Message<IServiceDescriptorProto> & IServiceDescriptorProto;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
namespace Method {
|
|
79
|
+
/** Creates a method from a descriptor. */
|
|
80
|
+
function fromDescriptor(descriptor: DescriptorInput<IMethodDescriptorProto>, editionOrContext?: string | IDescriptorContext): $protobuf.Method;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface Method {
|
|
84
|
+
/** Converts this method to a descriptor. */
|
|
85
|
+
toDescriptor(): $protobuf.Message<IMethodDescriptorProto> & IMethodDescriptorProto;
|
|
86
|
+
}
|
|
87
|
+
}
|