UNPKG

2.17 kBTypeScriptView Raw
1/// <reference types="node" />
2import TypedArray = NodeJS.TypedArray;
3/**
4 * Writes value to array at the specified offset. The value must be a valid unsigned 8-bit integer.
5 * @param array Uint8Array to be written to
6 * @param value Number to be written to array.
7 * @param offset plus the number of bytes written.
8 */
9export declare function writeUInt8(array: Uint8Array, value: number, offset: number): void;
10/**
11 * Writes value to array at the specified offset as big-endian. The value must be a valid unsigned 16-bit integer.
12 * @param array Uint8Array to be written to
13 * @param value Number to be written to array.
14 * @param offset plus the number of bytes written.
15 */
16export declare function writeUInt16BE(array: Uint8Array, value: number, offset: number): void;
17/**
18 * Writes value to array at the specified offset as big-endian. The value must be a valid unsigned 32-bit integer.
19 * @param array Uint8Array to be written to
20 * @param value Number to be written to array.
21 * @param offset plus the number of bytes written.
22 */
23export declare function writeUInt32BE(array: Uint8Array, value: number, offset: number): void;
24/**
25 * Reads an unsigned, big-endian 16-bit integer from the array at the specified offset.
26 * @param array Uint8Array to read
27 * @param offset Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2
28 */
29export declare function readUInt16BE(array: Uint8Array, offset: number): string;
30/**
31 * Reads an unsigned, big-endian 16-bit integer from the array at the specified offset.
32 * @param array Uint8Array to read
33 * @param offset Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4
34 */
35export declare function readUInt32BE(array: Uint8Array, offset: number): string;
36/**
37 * Compares two Uint8Array or ArrayBuffers
38 * @param a first array to compare
39 * @param b second array to compare
40 */
41export declare function equal(a: Uint8Array | ArrayBuffer, b: Uint8Array | ArrayBuffer): boolean;
42/**
43 * Compare two TypedArrays
44 * @param a first array to compare
45 * @param b second array to compare
46 */
47export declare function compare(a: TypedArray, b: TypedArray): 1 | -1 | 0;