import Chunk from './chunk.ts'; import type { Offset, VirtualOffset } from './virtualOffset.ts'; export interface BamOpts { viewAsPairs?: boolean; pairAcrossChr?: boolean; maxInsertSize?: number; signal?: AbortSignal; /** * Called as the BGZF blocks covering the query are fetched, with cumulative * downloaded bytes and the total to fetch. Reported at block granularity (one * tick per chunk, including instant ticks for cache hits) since chunk byte * sizes are known up front from the index. Lets callers render a determinate * download progress bar. */ onProgress?: (bytesDownloaded: number, totalBytes?: number) => void; } export interface BaseOpts { signal?: AbortSignal; /** * Called as the index (.bai/.csi) is downloaded, with cumulative downloaded * bytes and the total. The index is a whole-file read, so this streams real * byte progress. Lets callers show a determinate "downloading index" bar. * (total is optional to match generic-filehandle2's streaming callback.) */ onProgress?: (bytesDownloaded: number, totalBytes?: number) => void; } export declare function optimizeChunks(chunks: Chunk[], lowest?: Offset): Chunk[]; export declare function parsePseudoBin(bytes: Uint8Array, offset: number): { lineCount: number; }; export declare function clampChunkEnds(chunks: Chunk[], extraBoundaries?: number[]): void; export declare function parseRefSeqs(uncba: Uint8Array, start: number, renameRefSeq: (s: string) => string): { chrToIndex: Record; indexToChr: { refName: string; length: number; }[]; } | undefined; export declare function findFirstData(firstDataLine: VirtualOffset | undefined, virtualOffset: VirtualOffset): VirtualOffset; export declare function parseNameBytes(namesBytes: Uint8Array, renameRefSeq?: (arg: string) => string): { refNameToId: Record; refIdToName: string[]; }; export declare function concatUint8Array(args: Uint8Array[]): Uint8Array; interface Positioned { ref_id: number; start: number; end: number; } export declare function appendInRange(records: T[], chrId: number, min: number, max: number, out?: T[]): T[]; export {};