@bufbuild/protobuf 0.0.1-alpha.1 → 0.0.1
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/README.md +21 -1
- package/dist/cjs/binary-encoding.js +402 -410
- package/dist/cjs/descriptor-registry.js +407 -449
- package/dist/cjs/descriptor-set.js +416 -513
- package/dist/cjs/field.js +30 -30
- package/dist/cjs/google/protobuf/any_pb.js +122 -140
- package/dist/cjs/google/protobuf/api_pb.js +177 -224
- package/dist/cjs/google/protobuf/compiler/plugin_pb.js +125 -227
- package/dist/cjs/google/protobuf/descriptor_pb.js +1029 -1888
- package/dist/cjs/google/protobuf/duration_pb.js +72 -88
- package/dist/cjs/google/protobuf/empty_pb.js +17 -17
- package/dist/cjs/google/protobuf/field_mask_pb.js +77 -94
- package/dist/cjs/google/protobuf/source_context_pb.js +25 -25
- package/dist/cjs/google/protobuf/struct_pb.js +144 -181
- package/dist/cjs/google/protobuf/timestamp_pb.js +86 -123
- package/dist/cjs/google/protobuf/type_pb.js +406 -462
- package/dist/cjs/google/protobuf/wrappers_pb.js +407 -470
- package/dist/cjs/index.js +24 -122
- package/dist/cjs/message.js +81 -89
- package/dist/cjs/private/assert.js +20 -26
- package/dist/cjs/private/base64.js +79 -78
- package/dist/cjs/private/binary-format-common.js +195 -208
- package/dist/cjs/private/binary-format-proto2.js +75 -109
- package/dist/cjs/private/binary-format-proto3.js +57 -90
- package/dist/cjs/private/enum.js +38 -43
- package/dist/cjs/private/field-list.js +51 -50
- package/dist/cjs/private/field-wrapper.js +8 -10
- package/dist/cjs/private/field.js +22 -25
- package/dist/cjs/private/goog-varint.js +275 -0
- package/dist/cjs/private/json-format-common.js +414 -440
- package/dist/cjs/private/json-format-proto2.js +78 -89
- package/dist/cjs/private/json-format-proto3.js +69 -93
- package/dist/cjs/private/message-type.js +26 -27
- package/dist/cjs/private/names.js +58 -62
- package/dist/cjs/private/proto-runtime.js +11 -16
- package/dist/cjs/private/scalars.js +100 -103
- package/dist/cjs/private/util-common.js +180 -210
- package/dist/cjs/proto-int64.js +111 -112
- package/dist/cjs/proto2.js +50 -63
- package/dist/cjs/proto3.js +61 -74
- package/dist/cjs/service-type.js +14 -17
- package/dist/cjs/type-registry.js +33 -31
- package/dist/esm/binary-encoding.js +401 -414
- package/dist/esm/descriptor-registry.js +409 -458
- package/dist/esm/descriptor-set.js +417 -478
- package/dist/esm/field.js +29 -29
- package/dist/esm/google/protobuf/any_pb.js +122 -140
- package/dist/esm/google/protobuf/api_pb.js +177 -197
- package/dist/esm/google/protobuf/compiler/plugin_pb.js +123 -216
- package/dist/esm/google/protobuf/descriptor_pb.js +1013 -1804
- package/dist/esm/google/protobuf/duration_pb.js +72 -88
- package/dist/esm/google/protobuf/empty_pb.js +17 -17
- package/dist/esm/google/protobuf/field_mask_pb.js +77 -94
- package/dist/esm/google/protobuf/source_context_pb.js +25 -25
- package/dist/esm/google/protobuf/struct_pb.js +143 -180
- package/dist/esm/google/protobuf/timestamp_pb.js +86 -123
- package/dist/esm/google/protobuf/type_pb.js +401 -421
- package/dist/esm/google/protobuf/wrappers_pb.js +406 -397
- package/dist/esm/index.js +1 -1
- package/dist/esm/message.js +81 -89
- package/dist/esm/private/assert.js +19 -21
- package/dist/esm/private/base64.js +79 -78
- package/dist/esm/private/binary-format-common.js +196 -207
- package/dist/esm/private/binary-format-proto2.js +76 -81
- package/dist/esm/private/binary-format-proto3.js +58 -67
- package/dist/esm/private/enum.js +38 -43
- package/dist/esm/private/field-list.js +51 -50
- package/dist/esm/private/field-wrapper.js +8 -10
- package/dist/esm/private/field.js +22 -22
- package/dist/esm/private/goog-varint.js +266 -0
- package/dist/esm/private/json-format-common.js +414 -435
- package/dist/esm/private/json-format-proto2.js +76 -81
- package/dist/esm/private/json-format-proto3.js +66 -80
- package/dist/esm/private/message-type.js +27 -28
- package/dist/esm/private/names.js +57 -57
- package/dist/esm/private/proto-runtime.js +11 -11
- package/dist/esm/private/scalars.js +99 -99
- package/dist/esm/private/util-common.js +180 -192
- package/dist/esm/proto-int64.js +111 -112
- package/dist/esm/proto2.js +50 -57
- package/dist/esm/proto3.js +61 -68
- package/dist/esm/service-type.js +12 -12
- package/dist/esm/type-registry.js +33 -31
- package/dist/types/binary-encoding.d.ts +398 -398
- package/dist/types/binary-format.d.ts +69 -91
- package/dist/types/descriptor-registry.d.ts +23 -29
- package/dist/types/descriptor-set.d.ts +107 -128
- package/dist/types/enum.d.ts +21 -21
- package/dist/types/field-list.d.ts +21 -21
- package/dist/types/field.d.ts +191 -231
- package/dist/types/google/protobuf/any_pb.d.ts +56 -77
- package/dist/types/google/protobuf/api_pb.d.ts +144 -187
- package/dist/types/google/protobuf/compiler/plugin_pb.d.ts +195 -257
- package/dist/types/google/protobuf/descriptor_pb.d.ts +1360 -1737
- package/dist/types/google/protobuf/duration_pb.d.ts +30 -50
- package/dist/types/google/protobuf/empty_pb.d.ts +9 -28
- package/dist/types/google/protobuf/field_mask_pb.d.ts +17 -37
- package/dist/types/google/protobuf/source_context_pb.d.ts +16 -35
- package/dist/types/google/protobuf/struct_pb.d.ts +64 -115
- package/dist/types/google/protobuf/timestamp_pb.d.ts +31 -51
- package/dist/types/google/protobuf/type_pb.d.ts +355 -422
- package/dist/types/google/protobuf/wrappers_pb.d.ts +181 -297
- package/dist/types/index.d.ts +4 -27
- package/dist/types/json-format.d.ts +70 -89
- package/dist/types/message-type.d.ts +38 -46
- package/dist/types/message.d.ts +73 -99
- package/dist/types/private/assert.d.ts +1 -4
- package/dist/types/private/binary-format-common.d.ts +6 -32
- package/dist/types/private/enum.d.ts +4 -11
- package/dist/types/private/field-list.d.ts +14 -21
- package/dist/types/private/field-wrapper.d.ts +5 -11
- package/dist/types/private/field.d.ts +12 -12
- package/dist/types/{google/varint.d.ts → private/goog-varint.d.ts} +6 -13
- package/dist/types/private/json-format-common.d.ts +5 -27
- package/dist/types/private/message-type.d.ts +3 -8
- package/dist/types/private/names.d.ts +1 -4
- package/dist/types/private/options-map.d.ts +1 -1
- package/dist/types/private/proto-runtime.d.ts +29 -42
- package/dist/types/private/scalars.d.ts +5 -12
- package/dist/types/private/util-common.d.ts +1 -4
- package/dist/types/private/util.d.ts +29 -41
- package/dist/types/proto-int64.d.ts +42 -42
- package/dist/types/service-type.d.ts +37 -57
- package/dist/types/type-registry.d.ts +13 -15
- package/package.json +2 -2
- package/dist/cjs/google/varint.js +0 -280
- package/dist/esm/google/varint.js +0 -265
|
@@ -1,109 +1,87 @@
|
|
|
1
1
|
import type { Message } from "./message.js";
|
|
2
|
-
import type {
|
|
3
|
-
IBinaryReader,
|
|
4
|
-
IBinaryWriter,
|
|
5
|
-
WireType,
|
|
6
|
-
} from "./binary-encoding.js";
|
|
2
|
+
import type { IBinaryReader, IBinaryWriter, WireType } from "./binary-encoding.js";
|
|
7
3
|
/**
|
|
8
4
|
* BinaryFormat is the contract for serializing messages to and from binary
|
|
9
5
|
* data. Implementations may be specific to a proto syntax, and can be
|
|
10
6
|
* reflection based, or delegate to speed optimized generated code.
|
|
11
7
|
*/
|
|
12
8
|
export interface BinaryFormat {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Retrieve the unknown fields for the given message and write them to
|
|
61
|
-
* the given writer. This method is called when a message is serialized,
|
|
62
|
-
* so the fields that are unknown to the parser persist through a round
|
|
63
|
-
* trip.
|
|
64
|
-
*/
|
|
65
|
-
writeUnknownFields(message: Message, writer: IBinaryWriter): void;
|
|
66
|
-
/**
|
|
67
|
-
* Store an unknown field for the given message. The parser will use this
|
|
68
|
-
* method if it does not recognize a field, unless the option
|
|
69
|
-
* `readUnknownFields` has been disabled.
|
|
70
|
-
*/
|
|
71
|
-
onUnknownField(
|
|
72
|
-
message: Message,
|
|
73
|
-
no: number,
|
|
74
|
-
wireType: WireType,
|
|
75
|
-
data: Uint8Array
|
|
76
|
-
): void;
|
|
9
|
+
/**
|
|
10
|
+
* Provide options for parsing binary data.
|
|
11
|
+
*/
|
|
12
|
+
makeReadOptions(options?: Partial<BinaryReadOptions>): Readonly<BinaryReadOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* Provide options for serializing binary data.
|
|
15
|
+
*/
|
|
16
|
+
makeWriteOptions(options?: Partial<BinaryWriteOptions>): Readonly<BinaryWriteOptions>;
|
|
17
|
+
/**
|
|
18
|
+
* Parse a message from binary data, merging fields.
|
|
19
|
+
*/
|
|
20
|
+
readMessage<T extends Message>(message: T, reader: IBinaryReader, length: number, options: BinaryReadOptions): void;
|
|
21
|
+
/**
|
|
22
|
+
* Serialize a message to binary data.
|
|
23
|
+
*/
|
|
24
|
+
writeMessage(message: Message, writer: IBinaryWriter, options: BinaryWriteOptions): void;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve the unknown fields for the given message.
|
|
27
|
+
*
|
|
28
|
+
* Unknown fields are well-formed protocol buffer serialized data for
|
|
29
|
+
* fields that the parserdoes not recognize.
|
|
30
|
+
*
|
|
31
|
+
* For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns
|
|
32
|
+
*/
|
|
33
|
+
listUnknownFields(message: Message): ReadonlyArray<{
|
|
34
|
+
no: number;
|
|
35
|
+
wireType: WireType;
|
|
36
|
+
data: Uint8Array;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Discard unknown fields for the given message.
|
|
40
|
+
*/
|
|
41
|
+
discardUnknownFields(message: Message): void;
|
|
42
|
+
/**
|
|
43
|
+
* Retrieve the unknown fields for the given message and write them to
|
|
44
|
+
* the given writer. This method is called when a message is serialized,
|
|
45
|
+
* so the fields that are unknown to the parser persist through a round
|
|
46
|
+
* trip.
|
|
47
|
+
*/
|
|
48
|
+
writeUnknownFields(message: Message, writer: IBinaryWriter): void;
|
|
49
|
+
/**
|
|
50
|
+
* Store an unknown field for the given message. The parser will use this
|
|
51
|
+
* method if it does not recognize a field, unless the option
|
|
52
|
+
* `readUnknownFields` has been disabled.
|
|
53
|
+
*/
|
|
54
|
+
onUnknownField(message: Message, no: number, wireType: WireType, data: Uint8Array): void;
|
|
77
55
|
}
|
|
78
56
|
/**
|
|
79
57
|
* Options for parsing binary data.
|
|
80
58
|
*/
|
|
81
59
|
export interface BinaryReadOptions {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Retain unknown fields during parsing? The default behavior is to retain
|
|
62
|
+
* unknown fields and include them in the serialized output.
|
|
63
|
+
*
|
|
64
|
+
* For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns
|
|
65
|
+
*/
|
|
66
|
+
readUnknownFields: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Allows to use a custom implementation to decode binary data.
|
|
69
|
+
*/
|
|
70
|
+
readerFactory: (bytes: Uint8Array) => IBinaryReader;
|
|
93
71
|
}
|
|
94
72
|
/**
|
|
95
73
|
* Options for serializing to binary data.
|
|
96
74
|
*/
|
|
97
75
|
export interface BinaryWriteOptions {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Include unknown fields in the serialized output? The default behavior
|
|
78
|
+
* is to retain unknown fields and include them in the serialized output.
|
|
79
|
+
*
|
|
80
|
+
* For more details see https://developers.google.com/protocol-buffers/docs/proto3#unknowns
|
|
81
|
+
*/
|
|
82
|
+
writeUnknownFields: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Allows to use a custom implementation to encode binary data.
|
|
85
|
+
*/
|
|
86
|
+
writerFactory: () => IBinaryWriter;
|
|
109
87
|
}
|
|
@@ -2,11 +2,7 @@ import type { FileDescriptorProto } from "./google/protobuf/descriptor_pb.js";
|
|
|
2
2
|
import type { MessageType } from "./message-type.js";
|
|
3
3
|
import type { EnumType } from "./enum.js";
|
|
4
4
|
import { DescriptorSet } from "./descriptor-set.js";
|
|
5
|
-
import type {
|
|
6
|
-
IEnumTypeRegistry,
|
|
7
|
-
IMessageTypeRegistry,
|
|
8
|
-
IServiceTypeRegistry,
|
|
9
|
-
} from "./type-registry.js";
|
|
5
|
+
import type { IEnumTypeRegistry, IMessageTypeRegistry, IServiceTypeRegistry } from "./type-registry.js";
|
|
10
6
|
import type { ServiceType } from "./service-type.js";
|
|
11
7
|
/**
|
|
12
8
|
* DescriptorRegistry is a type registry that dynamically creates types
|
|
@@ -15,28 +11,26 @@ import type { ServiceType } from "./service-type.js";
|
|
|
15
11
|
* By default, all well-known types with a specialized JSON representation
|
|
16
12
|
* are replaced with their generated counterpart in this package.
|
|
17
13
|
*/
|
|
18
|
-
export declare class DescriptorRegistry
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
findService(typeName: string): ServiceType | undefined;
|
|
14
|
+
export declare class DescriptorRegistry implements IMessageTypeRegistry, IEnumTypeRegistry, IServiceTypeRegistry {
|
|
15
|
+
private readonly ds;
|
|
16
|
+
private readonly enums;
|
|
17
|
+
private readonly messages;
|
|
18
|
+
private readonly services;
|
|
19
|
+
constructor(descriptorSet?: DescriptorSet, replaceWkt?: boolean);
|
|
20
|
+
/**
|
|
21
|
+
* May raise an error on invalid descriptors.
|
|
22
|
+
*/
|
|
23
|
+
add(...files: FileDescriptorProto[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* May raise an error on invalid descriptors.
|
|
26
|
+
*/
|
|
27
|
+
findEnum(typeName: string): EnumType | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* May raise an error on invalid descriptors.
|
|
30
|
+
*/
|
|
31
|
+
findMessage(typeName: string): MessageType | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* May raise an error on invalid descriptors.
|
|
34
|
+
*/
|
|
35
|
+
findService(typeName: string): ServiceType | undefined;
|
|
42
36
|
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
EnumDescriptorProto,
|
|
4
|
-
EnumValueDescriptorProto,
|
|
5
|
-
FieldDescriptorProto,
|
|
6
|
-
OneofDescriptorProto,
|
|
7
|
-
} from "./google/protobuf/descriptor_pb.js";
|
|
8
|
-
import {
|
|
9
|
-
FieldDescriptorProto_Type,
|
|
10
|
-
FileDescriptorProto,
|
|
11
|
-
MethodDescriptorProto,
|
|
12
|
-
ServiceDescriptorProto,
|
|
13
|
-
} from "./google/protobuf/descriptor_pb.js";
|
|
1
|
+
import type { DescriptorProto, EnumDescriptorProto, EnumValueDescriptorProto, FieldDescriptorProto, OneofDescriptorProto } from "./google/protobuf/descriptor_pb.js";
|
|
2
|
+
import { FieldDescriptorProto_Type, FileDescriptorProto, MethodDescriptorProto, ServiceDescriptorProto } from "./google/protobuf/descriptor_pb.js";
|
|
14
3
|
import { ScalarType } from "./field.js";
|
|
15
4
|
import { MethodIdempotency, MethodKind } from "./service-type.js";
|
|
16
5
|
/**
|
|
@@ -21,151 +10,141 @@ import { MethodIdempotency, MethodKind } from "./service-type.js";
|
|
|
21
10
|
* with a leading dot.
|
|
22
11
|
*/
|
|
23
12
|
export declare class DescriptorSet implements UnresolvedSet {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
readonly enums: Record<string, UnresolvedEnum | undefined>;
|
|
14
|
+
readonly messages: Record<string, UnresolvedMessage | undefined>;
|
|
15
|
+
readonly services: Record<string, UnresolvedService | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* May raise an error on invalid descriptors.
|
|
18
|
+
*/
|
|
19
|
+
add(...files: FileDescriptorProto[]): void;
|
|
20
|
+
listEnums(): UnresolvedEnum[];
|
|
21
|
+
listMessages(): UnresolvedMessage[];
|
|
22
|
+
listServices(): UnresolvedService[];
|
|
34
23
|
}
|
|
35
24
|
interface UnresolvedSet {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
readonly enums: Record<string, UnresolvedEnum | undefined>;
|
|
26
|
+
readonly messages: Record<string, UnresolvedMessage | undefined>;
|
|
27
|
+
readonly services: Record<string, UnresolvedService | undefined>;
|
|
39
28
|
}
|
|
40
29
|
interface File {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
readonly proto: FileDescriptorProto;
|
|
31
|
+
readonly syntax: "proto3" | "proto2";
|
|
32
|
+
readonly name: string;
|
|
33
|
+
toString(): string;
|
|
45
34
|
}
|
|
46
35
|
interface UnresolvedEnum {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
readonly proto: EnumDescriptorProto;
|
|
37
|
+
readonly file: File;
|
|
38
|
+
readonly parent: UnresolvedMessage | undefined;
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly typeName: string;
|
|
41
|
+
readonly protoTypeName: string;
|
|
42
|
+
readonly values: UnresolvedEnumValue[];
|
|
43
|
+
toString(): string;
|
|
55
44
|
}
|
|
56
45
|
interface UnresolvedEnumValue {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
readonly proto: EnumValueDescriptorProto;
|
|
47
|
+
readonly parent: UnresolvedEnum;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly number: number;
|
|
50
|
+
toString(): string;
|
|
62
51
|
}
|
|
63
52
|
interface UnresolvedMessage {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
readonly proto: DescriptorProto;
|
|
54
|
+
readonly file: File;
|
|
55
|
+
readonly parent: UnresolvedMessage | undefined;
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly typeName: string;
|
|
58
|
+
readonly protoTypeName: string;
|
|
59
|
+
readonly fields: UnresolvedField[];
|
|
60
|
+
readonly oneofs: UnresolvedOneof[];
|
|
61
|
+
readonly nestedEnums: UnresolvedEnum[];
|
|
62
|
+
readonly nestedMessages: UnresolvedMessage[];
|
|
63
|
+
readonly nestedExtensions: UnresolvedExtension[];
|
|
64
|
+
toString(): string;
|
|
76
65
|
}
|
|
77
66
|
interface UnresolvedField {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
67
|
+
readonly proto: FieldDescriptorProto;
|
|
68
|
+
readonly number: number;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly type: FieldDescriptorProto_Type;
|
|
71
|
+
readonly parent: UnresolvedMessage;
|
|
72
|
+
readonly oneof: UnresolvedOneof | undefined;
|
|
73
|
+
readonly optional: boolean;
|
|
74
|
+
readonly packed: boolean;
|
|
75
|
+
toString(): string;
|
|
76
|
+
resolve(us: UnresolvedSet): ResolvedField;
|
|
88
77
|
}
|
|
89
|
-
declare type ResolvedField =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
readonly message: undefined;
|
|
115
|
-
readonly enum: undefined;
|
|
116
|
-
readonly map: Map;
|
|
117
|
-
});
|
|
78
|
+
declare type ResolvedField = (UnresolvedField & {
|
|
79
|
+
repeated: boolean;
|
|
80
|
+
readonly scalarType: ScalarType;
|
|
81
|
+
readonly message: undefined;
|
|
82
|
+
readonly enum: undefined;
|
|
83
|
+
readonly map: undefined;
|
|
84
|
+
}) | (UnresolvedField & {
|
|
85
|
+
repeated: boolean;
|
|
86
|
+
readonly scalarType: undefined;
|
|
87
|
+
readonly message: UnresolvedMessage;
|
|
88
|
+
readonly enum: undefined;
|
|
89
|
+
readonly map: undefined;
|
|
90
|
+
}) | (UnresolvedField & {
|
|
91
|
+
repeated: boolean;
|
|
92
|
+
readonly scalarType: undefined;
|
|
93
|
+
readonly message: undefined;
|
|
94
|
+
readonly enum: UnresolvedEnum;
|
|
95
|
+
readonly map: undefined;
|
|
96
|
+
}) | (UnresolvedField & {
|
|
97
|
+
repeated: false;
|
|
98
|
+
readonly scalarType: undefined;
|
|
99
|
+
readonly message: undefined;
|
|
100
|
+
readonly enum: undefined;
|
|
101
|
+
readonly map: Map;
|
|
102
|
+
});
|
|
118
103
|
declare type Map = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES
|
|
122
|
-
>;
|
|
123
|
-
value:
|
|
124
|
-
| {
|
|
104
|
+
key: Exclude<ScalarType, ScalarType.FLOAT | ScalarType.DOUBLE | ScalarType.BYTES>;
|
|
105
|
+
value: {
|
|
125
106
|
enum: UnresolvedEnum;
|
|
126
107
|
message: undefined;
|
|
127
108
|
scalar: undefined;
|
|
128
|
-
|
|
129
|
-
| {
|
|
109
|
+
} | {
|
|
130
110
|
enum: undefined;
|
|
131
111
|
message: UnresolvedMessage;
|
|
132
112
|
scalar: undefined;
|
|
133
|
-
|
|
134
|
-
| {
|
|
113
|
+
} | {
|
|
135
114
|
enum: undefined;
|
|
136
115
|
message: undefined;
|
|
137
116
|
scalarType: ScalarType;
|
|
138
|
-
|
|
117
|
+
};
|
|
139
118
|
};
|
|
140
119
|
interface UnresolvedOneof {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
120
|
+
readonly proto: OneofDescriptorProto;
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly parent: UnresolvedMessage;
|
|
123
|
+
readonly file: File;
|
|
124
|
+
readonly fields: UnresolvedField[];
|
|
125
|
+
toString(): string;
|
|
147
126
|
}
|
|
148
127
|
interface UnresolvedExtension {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
128
|
+
readonly proto: FieldDescriptorProto;
|
|
129
|
+
readonly parent: UnresolvedMessage | undefined;
|
|
130
|
+
readonly file: File;
|
|
152
131
|
}
|
|
153
132
|
interface UnresolvedService {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
133
|
+
readonly proto: ServiceDescriptorProto;
|
|
134
|
+
readonly file: File;
|
|
135
|
+
readonly methods: UnresolvedMethod[];
|
|
136
|
+
readonly typeName: string;
|
|
137
|
+
readonly protoTypeName: string;
|
|
138
|
+
toString(): string;
|
|
160
139
|
}
|
|
161
140
|
interface UnresolvedMethod {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
141
|
+
readonly proto: MethodDescriptorProto;
|
|
142
|
+
readonly parent: UnresolvedService;
|
|
143
|
+
readonly name: string;
|
|
144
|
+
readonly kind: MethodKind;
|
|
145
|
+
readonly inputTypeName: string;
|
|
146
|
+
readonly outputTypeName: string;
|
|
147
|
+
readonly idempotency?: MethodIdempotency;
|
|
148
|
+
toString(): string;
|
|
170
149
|
}
|
|
171
150
|
export {};
|
package/dist/types/enum.d.ts
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
* Reflection information for a protobuf enum.
|
|
3
3
|
*/
|
|
4
4
|
export interface EnumType {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The fully qualified name of the enum.
|
|
7
|
+
*/
|
|
8
|
+
readonly typeName: string;
|
|
9
|
+
readonly values: readonly EnumValueInfo[];
|
|
10
|
+
/**
|
|
11
|
+
* Find an enum value by its (protobuf) name.
|
|
12
|
+
*/
|
|
13
|
+
findName(name: string): EnumValueInfo | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Find an enum value by its number.
|
|
16
|
+
*/
|
|
17
|
+
findNumber(no: number): EnumValueInfo | undefined;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Reflection information for a protobuf enum value.
|
|
21
21
|
*/
|
|
22
22
|
export interface EnumValueInfo {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The number of the value as specified in proto.
|
|
25
|
+
*/
|
|
26
|
+
readonly no: number;
|
|
27
|
+
/**
|
|
28
|
+
* The name of the value as specified in proto.
|
|
29
|
+
*/
|
|
30
|
+
readonly name: string;
|
|
31
31
|
}
|
|
@@ -3,25 +3,25 @@ import type { FieldInfo, OneofInfo } from "./field.js";
|
|
|
3
3
|
* Provides convenient access to field information of a message type.
|
|
4
4
|
*/
|
|
5
5
|
export interface FieldList {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Find field information by field name or json_name.
|
|
8
|
+
*/
|
|
9
|
+
findJsonName(jsonName: string): FieldInfo | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Find field information by proto field number.
|
|
12
|
+
*/
|
|
13
|
+
find(fieldNo: number): FieldInfo | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Return field information in the order they appear in the source.
|
|
16
|
+
*/
|
|
17
|
+
list(): readonly FieldInfo[];
|
|
18
|
+
/**
|
|
19
|
+
* Return field information ordered by field number ascending.
|
|
20
|
+
*/
|
|
21
|
+
byNumber(): readonly FieldInfo[];
|
|
22
|
+
/**
|
|
23
|
+
* In order of appearance in the source, list fields and
|
|
24
|
+
* oneof groups.
|
|
25
|
+
*/
|
|
26
|
+
byMember(): readonly (FieldInfo | OneofInfo)[];
|
|
27
27
|
}
|