import { CustomMap, CustomSet } from '@fuman/utils'; import { default as Long } from 'long'; /** * Get a random Long * * @param unsigned Whether the number should be unsigned */ export declare function randomLong(unsigned?: boolean): Long; /** * Read a Long from a buffer * * @param buf Buffer to read from * @param unsigned Whether the number should be unsigned * @param le Whether the number is little-endian */ export declare function longFromBuffer(buf: Uint8Array, unsigned?: boolean, le?: boolean): Long; /** * Remove a Long from an array * * @param arr Array to remove from * @param val Value to remove */ export declare function removeFromLongArray(arr: Long[], val: Long): boolean; /** * Compare two Longs and return -1, 0 or 1, * to be used as a comparator function. */ export declare function compareLongs(a: Long, b: Long): number; /** * Serialize a Long (int64) to its fast string representation: * `$high|$low`. * * This method is about 500* times faster than using `Long.toString()`, * and very useful when the string will only ever be used internally * (e.g. for keying a map) * * _\* benchmark result, YMMV_ * * @param val */ export declare function longToFastString(val: Long): string; /** * Parse a Long (int64) from its fast string representation: * `$high|$low`. * * This method is about 2 times faster than using Long.fromString. * * @param val * @param unsigned */ export declare function longFromFastString(val: string, unsigned?: boolean): Long; /** * Map with Longs as key. * * Uses fast string representation internally. */ export declare class LongMap extends CustomMap { constructor(); } /** * Set for Longs. * * Uses fast string representation internally */ export declare class LongSet extends CustomSet { constructor(); }