naijarea-ts 1.0.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.
@@ -0,0 +1,144 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
5
+ * URL that describes the type of the serialized message.
6
+ *
7
+ * Protobuf library provides support to pack/unpack Any values in the form
8
+ * of utility functions or additional generated methods of the Any type.
9
+ *
10
+ * Example 1: Pack and unpack a message in C++.
11
+ *
12
+ * Foo foo = ...;
13
+ * Any any;
14
+ * any.PackFrom(foo);
15
+ * ...
16
+ * if (any.UnpackTo(&foo)) {
17
+ * ...
18
+ * }
19
+ *
20
+ * Example 2: Pack and unpack a message in Java.
21
+ *
22
+ * Foo foo = ...;
23
+ * Any any = Any.pack(foo);
24
+ * ...
25
+ * if (any.is(Foo.class)) {
26
+ * foo = any.unpack(Foo.class);
27
+ * }
28
+ * // or ...
29
+ * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
30
+ * foo = any.unpack(Foo.getDefaultInstance());
31
+ * }
32
+ *
33
+ * Example 3: Pack and unpack a message in Python.
34
+ *
35
+ * foo = Foo(...)
36
+ * any = Any()
37
+ * any.Pack(foo)
38
+ * ...
39
+ * if any.Is(Foo.DESCRIPTOR):
40
+ * any.Unpack(foo)
41
+ * ...
42
+ *
43
+ * Example 4: Pack and unpack a message in Go
44
+ *
45
+ * foo := &pb.Foo{...}
46
+ * any, err := anypb.New(foo)
47
+ * if err != nil {
48
+ * ...
49
+ * }
50
+ * ...
51
+ * foo := &pb.Foo{}
52
+ * if err := any.UnmarshalTo(foo); err != nil {
53
+ * ...
54
+ * }
55
+ *
56
+ * The pack methods provided by protobuf library will by default use
57
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
58
+ * methods only use the fully qualified type name after the last '/'
59
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
60
+ * name "y.z".
61
+ *
62
+ * JSON
63
+ * ====
64
+ * The JSON representation of an `Any` value uses the regular
65
+ * representation of the deserialized, embedded message, with an
66
+ * additional field `@type` which contains the type URL. Example:
67
+ *
68
+ * package google.profile;
69
+ * message Person {
70
+ * string first_name = 1;
71
+ * string last_name = 2;
72
+ * }
73
+ *
74
+ * {
75
+ * "@type": "type.googleapis.com/google.profile.Person",
76
+ * "firstName": <string>,
77
+ * "lastName": <string>
78
+ * }
79
+ *
80
+ * If the embedded message type is well-known and has a custom JSON
81
+ * representation, that representation will be embedded adding a field
82
+ * `value` which holds the custom JSON in addition to the `@type`
83
+ * field. Example (for message [google.protobuf.Duration][]):
84
+ *
85
+ * {
86
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
87
+ * "value": "1.212s"
88
+ * }
89
+ */
90
+ export interface Any {
91
+ /**
92
+ * A URL/resource name that uniquely identifies the type of the serialized
93
+ * protocol buffer message. This string must contain at least
94
+ * one "/" character. The last segment of the URL's path must represent
95
+ * the fully qualified name of the type (as in
96
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
97
+ * (e.g., leading "." is not accepted).
98
+ *
99
+ * In practice, teams usually precompile into the binary all types that they
100
+ * expect it to use in the context of Any. However, for URLs which use the
101
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
102
+ * server that maps type URLs to message definitions as follows:
103
+ *
104
+ * * If no scheme is provided, `https` is assumed.
105
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
106
+ * value in binary format, or produce an error.
107
+ * * Applications are allowed to cache lookup results based on the
108
+ * URL, or have them precompiled into a binary to avoid any
109
+ * lookup. Therefore, binary compatibility needs to be preserved
110
+ * on changes to types. (Use versioned type names to manage
111
+ * breaking changes.)
112
+ *
113
+ * Note: this functionality is not currently available in the official
114
+ * protobuf release, and it is not used for type URLs beginning with
115
+ * type.googleapis.com. As of May 2023, there are no widely used type server
116
+ * implementations and no plans to implement one.
117
+ *
118
+ * Schemes other than `http`, `https` (or the empty scheme) might be
119
+ * used with implementation specific semantics.
120
+ */
121
+ typeUrl: string;
122
+ /** Must be a valid serialized protocol buffer of the above specified type. */
123
+ value: Uint8Array;
124
+ }
125
+ export declare const Any: MessageFns<Any>;
126
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
127
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
128
+ [K in keyof T]?: DeepPartial<T[K]>;
129
+ } : Partial<T>;
130
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
131
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
132
+ [K in keyof P]: Exact<P[K], I[K]>;
133
+ } & {
134
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
135
+ };
136
+ export interface MessageFns<T> {
137
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
138
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
139
+ fromJSON(object: any): T;
140
+ toJSON(message: T): unknown;
141
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
142
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
143
+ }
144
+ export {};
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.10.0
5
+ // protoc v6.33.2
6
+ // source: google/protobuf/any.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Any = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "google.protobuf";
12
+ function createBaseAny() {
13
+ return { typeUrl: "", value: new Uint8Array(0) };
14
+ }
15
+ exports.Any = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ if (message.typeUrl !== "") {
18
+ writer.uint32(10).string(message.typeUrl);
19
+ }
20
+ if (message.value.length !== 0) {
21
+ writer.uint32(18).bytes(message.value);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
27
+ const end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseAny();
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1: {
33
+ if (tag !== 10) {
34
+ break;
35
+ }
36
+ message.typeUrl = reader.string();
37
+ continue;
38
+ }
39
+ case 2: {
40
+ if (tag !== 18) {
41
+ break;
42
+ }
43
+ message.value = reader.bytes();
44
+ continue;
45
+ }
46
+ }
47
+ if ((tag & 7) === 4 || tag === 0) {
48
+ break;
49
+ }
50
+ reader.skip(tag & 7);
51
+ }
52
+ return message;
53
+ },
54
+ fromJSON(object) {
55
+ return {
56
+ typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "",
57
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
58
+ };
59
+ },
60
+ toJSON(message) {
61
+ const obj = {};
62
+ if (message.typeUrl !== "") {
63
+ obj.typeUrl = message.typeUrl;
64
+ }
65
+ if (message.value.length !== 0) {
66
+ obj.value = base64FromBytes(message.value);
67
+ }
68
+ return obj;
69
+ },
70
+ create(base) {
71
+ return exports.Any.fromPartial(base !== null && base !== void 0 ? base : {});
72
+ },
73
+ fromPartial(object) {
74
+ var _a, _b;
75
+ const message = createBaseAny();
76
+ message.typeUrl = (_a = object.typeUrl) !== null && _a !== void 0 ? _a : "";
77
+ message.value = (_b = object.value) !== null && _b !== void 0 ? _b : new Uint8Array(0);
78
+ return message;
79
+ },
80
+ };
81
+ function bytesFromBase64(b64) {
82
+ if (globalThis.Buffer) {
83
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
84
+ }
85
+ else {
86
+ const bin = globalThis.atob(b64);
87
+ const arr = new Uint8Array(bin.length);
88
+ for (let i = 0; i < bin.length; ++i) {
89
+ arr[i] = bin.charCodeAt(i);
90
+ }
91
+ return arr;
92
+ }
93
+ }
94
+ function base64FromBytes(arr) {
95
+ if (globalThis.Buffer) {
96
+ return globalThis.Buffer.from(arr).toString("base64");
97
+ }
98
+ else {
99
+ const bin = [];
100
+ arr.forEach((byte) => {
101
+ bin.push(globalThis.String.fromCharCode(byte));
102
+ });
103
+ return globalThis.btoa(bin.join(""));
104
+ }
105
+ }
106
+ function isSet(value) {
107
+ return value !== null && value !== undefined;
108
+ }