import Chunk from './chunk';
import { Offset, VirtualOffset } from './virtualOffset';
export declare function timeout(ms: number): Promise<unknown>;
/**
 * Properly check if the given AbortSignal is aborted.
 *
 * Per the standard, if the signal reads as aborted, this function throws
 * either a DOMException AbortError, or a regular error with a `code` attribute
 * set to `ERR_ABORTED`.
 *
 * For convenience, passing `undefined` is a no-op
 *
 * @param {AbortSignal} [signal] an AbortSignal, or anything with an `aborted` attribute
 * @returns nothing
 */
export declare function checkAbortSignal(signal?: AbortSignal): void;
/**
 * Skips to the next tick, then runs `checkAbortSignal`.
 * Await this to inside an otherwise synchronous loop to
 * provide a place to break when an abort signal is received.
 * @param {AbortSignal} signal
 */
export declare function abortBreakPoint(signal?: AbortSignal): Promise<void>;
export declare function canMergeBlocks(chunk1: Chunk, chunk2: Chunk): boolean;
export interface BamOpts {
    viewAsPairs?: boolean;
    pairAcrossChr?: boolean;
    maxInsertSize?: number;
    signal?: AbortSignal;
}
export interface BaseOpts {
    signal?: AbortSignal;
}
export declare function makeOpts(obj?: AbortSignal | BaseOpts): BaseOpts;
export declare function optimizeChunks(chunks: Chunk[], lowest?: Offset): Chunk[];
export declare function parsePseudoBin(bytes: Uint8Array, offset: number): {
    lineCount: number;
};
export declare function findFirstData(firstDataLine: VirtualOffset | undefined, virtualOffset: VirtualOffset): VirtualOffset;
export declare function parseNameBytes(namesBytes: Uint8Array, renameRefSeq?: (arg: string) => string): {
    refNameToId: Record<string, number>;
    refIdToName: string[];
};
export declare function sum(array: Uint8Array[]): number;
export declare function concatUint8Array(args: Uint8Array[]): Uint8Array<ArrayBuffer>;
export declare function gen2array<T>(gen: AsyncIterable<T[]>): Promise<T[]>;
