import type { CramFileSource } from './cramFile/file.ts';
export interface IndexOpts {
    signal?: AbortSignal;
    /**
     * Called as the index (.crai) 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.
     */
    onProgress?: (bytesDownloaded: number, totalBytes?: number) => void;
}
export interface Slice {
    start: number;
    span: number;
    containerStart: number;
    sliceStart: number;
    sliceBytes: number;
}
type ParsedIndex = Record<string, Slice[] | undefined>;
export default class CraiIndex {
    private parseIndexP?;
    private filehandle;
    /**
     *
     * @param {object} args
     * @param {string} [args.path]
     * @param {string} [args.url]
     * @param {FileHandle} [args.filehandle]
     */
    constructor(args: CramFileSource);
    parseIndex(opts?: IndexOpts): Promise<ParsedIndex>;
    getIndex(opts?: IndexOpts): Promise<ParsedIndex>;
    /**
     * @param {number} seqId
     * @returns {Promise} true if the index contains entries for
     * the given reference sequence ID, false otherwise
     */
    hasDataForReferenceSequence(seqId: number): Promise<boolean>;
    /**
     * fetch index entries for the given range
     *
     * @param {number} seqId
     * @param {number} queryStart
     * @param {number} queryEnd
     *
     * @returns {Promise} promise for
     * an array of objects of the form
     * `{start, span, containerStart, sliceStart, sliceBytes }`
     */
    getEntriesForRange(seqId: number, queryStart: number, queryEnd: number, opts?: IndexOpts): Promise<Slice[]>;
}
export {};
