export type ByteSource = ArrayBuffer | Uint8Array | number[] | string; /** * Converts any type defined in jspb.ByteSource into a Uint8Array. */ export declare function byteSourceToUint8Array(data: ByteSource): Uint8Array; /** * Converts split 64-bit values from zigzag encoding to standard two's * complement encoding. Invokes the provided function to produce final result. * */ export declare function fromZigzag64(bitsLow: number, bitsHigh: number, convert: (a: number, b: number) => T): T; /** * Converts split 64-bit values from standard two's complement encoding to * zig-zag encoding. Invokes the provided function to produce final result. */ export declare function toZigzag64(bitsLow: number, bitsHigh: number, convert: (a: number, b: number) => T): T; /** * Converts a signed or unsigned decimal string into its hash string * representation. */ export declare function decimalStringToHash64(dec: string): string; /** * Javascript can't natively handle 64-bit data types, so to manipulate them we * have to split them into two 32-bit halves and do the math manually. * * Instead of instantiating and passing small structures around to do this, we * instead just use two global temporary values. This one stores the low 32 * bits of a split value - for example, if the original value was a 64-bit * integer, this temporary value will contain the low 32 bits of that integer. * If the original value was a double, this temporary value will contain the * low 32 bits of the binary representation of that double, etcetera. */ export declare let split64Low: number; /** * And correspondingly, this temporary variable will contain the high 32 bits * of whatever value was split. */ export declare let split64High: number; /** * Splits a signed Javascript integer into two 32-bit halves and stores it in * the temp values above. */ export declare const splitInt64: (value: number) => void; /** * Splits an unsigned Javascript integer into two 32-bit halves and stores it * in the temp values above. */ export declare const splitUint64: (value: number) => void; /** * Converts a signed Javascript integer into zigzag format, splits it into two * 32-bit halves, and stores it in the temp values above. */ export declare const splitZigzag64: (value: number) => void; /** * Converts an 8-character hash string into two 32-bit numbers and stores them * in the temp values above. */ export declare const splitHash64: (hash: string) => void; /** * Converts a floating-point number into 32-bit IEEE representation and stores * it in the temp values above. */ export declare const splitFloat32: (value: number) => void; /** * Converts a floating-point number into 64-bit IEEE representation and stores * it in the temp values above. */ export declare const splitFloat64: (value: number) => void; /** * Joins two 32-bit values into a 64-bit unsigned integer. Precision will be * lost if the result is greater than 2^52. */ export declare const joinUint64: (bitsLow: number, bitsHigh: number) => number; /** * Joins two 32-bit values into a 64-bit signed integer. Precision will be lost * if the result is greater than 2^52. */ export declare const joinInt64: (bitsLow: number, bitsHigh: number) => number; /** * Joins two 32-bit values into a 64-bit unsigned integer and applies zigzag * decoding. Precision will be lost if the result is greater than 2^52. */ export declare const joinZigzag64: (bitsLow: number, bitsHigh: number) => number; /** * Joins two 32-bit values into an 8-character hash string. */ export declare const joinHash64: (bitsLow: number, bitsHigh: number) => string; /** * Joins two 32-bit values into a 32-bit IEEE floating point number and * converts it back into a Javascript number. */ export declare function joinFloat32(bitsLow: number): number; /** * Joins two 32-bit values into a 64-bit IEEE floating point number and * converts it back into a Javascript number. */ export declare const joinFloat64: (bitsLow: number, bitsHigh: number) => number; /** * Losslessly converts a 64-bit unsigned integer in 32:32 split representation * into a decimal string. */ export declare const joinUnsignedDecimalString: (bitsLow: number, bitsHigh: number) => string; /** * Losslessly converts a 64-bit signed integer in 32:32 split representation * into a decimal string. */ export declare const joinSignedDecimalString: (bitsLow: number, bitsHigh: number) => string;