Debian Codegraph @

node/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts

raw
1 /**
2 * Read a 64 bit varint as two JS numbers.
3 *
4 * Stores the low and high words on the reader.
5 *
6 * Copyright 2008 Google Inc. All rights reserved.
7 *
8 * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175
9 */
10 export declare function varint64read<T extends ReaderLike>(this: T): void;
11 /**
12 * Write a 64 bit varint, given as two JS numbers, to the given bytes array.
13 *
14 * Copyright 2008 Google Inc. All rights reserved.
15 *
16 * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344
17 */
18 export declare function varint64write(lo: number, hi: number, bytes: number[]): void;
19 /**
20 * Parse decimal string of 64 bit integer value as two JS numbers.
21 *
22 * Copyright 2008 Google Inc. All rights reserved.
23 *
24 * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
25 */
26 export declare function int64FromString(dec: string): {
27 lo: number;
28 hi: number;
29 };
30 /**
31 * Losslessly converts a 64-bit signed integer in 32:32 split representation
32 * into a decimal string.
33 *
34 * Copyright 2008 Google Inc. All rights reserved.
35 *
36 * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
37 */
38 export declare function int64ToString(lo: number, hi: number): string;
39 /**
40 * Losslessly converts a 64-bit unsigned integer in 32:32 split representation
41 * into a decimal string.
42 *
43 * Copyright 2008 Google Inc. All rights reserved.
44 *
45 * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
46 */
47 export declare function uInt64ToString(lo: number, hi: number): string;
48 /**
49 * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`
50 *
51 * Copyright 2008 Google Inc. All rights reserved.
52 *
53 * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144
54 */
55 export declare function varint32write(value: number, bytes: number[]): void;
56 /**
57 * Read an unsigned 32 bit varint.
58 *
59 * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220
60 */
61 export declare function varint32read<T extends ReaderLike>(this: T): number;
62 type ReaderLike = {
63 buf: Uint8Array;
64 pos: number;
65 len: number;
66 varint64Lo: number;
67 varint64Hi: number;
68 assertBounds(): void;
69 };
70 export {};