/** * A helper function to determine the index * of a new value in an existed sorted array * @param array an existed sorted array * @param value the new value whose index is to be determined * @param compareFunction a compare function to determine the order, like the one in Array.prototype.sort() * @returns index of the value in the sorted array and indexed result if found */ export declare function getSortedIndex(array: T[], value: V, compareFunction: (a: T, b: V) => number): { index: number; result: T | undefined; }; /** * Sort iterable into a sorted array * @param iterable * @param compareFunction * @returns sorted array */ export declare function iterableSort(iterable: IterableIterator, compareFunction: (a: T, b: T) => number): T[]; /** * concat uint8 arrays * @param uint8Arrays * @returns */ export declare function concatUint8Arrays(...uint8Arrays: Uint8Array[]): Uint8Array; /** * Calculate the next nearest power of 2 * @param number number * @returns next nearest power of 2 */ export declare function nextPowerOfTwo(number: number): number; /** * Get time stamp seconds now * @returns time stamp now in seconds */ export declare function getTimeStampSecondsNow(): number; /** * Calculate the root hash of the merkle tree * constructed by given leaves * @param leaves merkle leaves * @returns root hash */ export declare function merkleRoot(leaves: Uint8Array[]): Promise;