import { BlockView } from './block-view.ts'; import type { BigWigFeatureArrays, BigWigFeatureArraysMulti, BigWigHeaderWithRefNames, Feature, RequestOptions2, RequestOptions, SummaryFeatureArrays, SummaryFeatureArraysMulti } from './types.ts'; import type { GenericFilehandle } from 'generic-filehandle2'; export declare abstract class BBI { protected bbi: GenericFilehandle; private headerP?; protected renameRefSeqs: (a: string) => string; /** * Returns file header metadata including chromosome list, zoom levels, autoSql * definition, and summary statistics. * * @param opts - optional `RequestOptions` (e.g. `opts.signal` for abort) * @returns `Promise` */ getHeader(opts?: RequestOptions): Promise; /** * @param args.filehandle - a filehandle from generic-filehandle2 * @param args.path - path to a local file * @param args.url - URL of a remote file * @param args.renameRefSeqs - optional mapping function to rename internal * reference sequence names before querying */ constructor(args: { filehandle?: GenericFilehandle; path?: string; url?: string; renameRefSeqs?: (a: string) => string; }); private _getHeader; private _getMainHeader; private _readChromosomeTree; private viewCache; protected getOrCreateBlockView(refsByName: Record, rTreeOffset: number, uncompressBufSize: number, blockType: string): BlockView; protected getUnzoomedView(opts?: RequestOptions): Promise; protected abstract getView(scale: number, opts?: RequestOptions): Promise; private _getView; /** * Fetches features for a single region. * * @param refName - chromosome name as it appears in the file * @param start - 0-based half-open start coordinate * @param end - 0-based half-open end coordinate * @param opts - optional scale/basesPerSpan for zoom level selection and AbortSignal * @returns `Promise` — empty array if refName not found or no features overlap the range */ getFeatures(refName: string, start: number, end: number, opts?: RequestOptions2): Promise; /** * Fetches features for many regions in a single pass. All regions share one * zoom level, and adjacent on-disk blocks are coalesced across region * boundaries, reducing range requests for whole-genome overviews. * * @param regions - array of `{ refName, start, end }` query regions * @param opts - same options as `getFeatures` * @returns `Promise` — one `Feature[]` per input region in the * same order (`result[i]` corresponds to `regions[i]`) */ getFeaturesMulti(regions: { refName: string; start: number; end: number; }[], opts?: RequestOptions2): Promise; /** * Same query as `getFeatures` but returns typed arrays instead of an array * of objects, reducing GC pressure for large datasets. * * @param refName - chromosome name as it appears in the file * @param start - 0-based half-open start coordinate * @param end - 0-based half-open end coordinate * @param opts - optional scale/basesPerSpan for zoom level selection and AbortSignal * @returns `Promise` — use the * `isSummary` discriminant to distinguish the two shapes */ getFeaturesAsArrays(refName: string, start: number, end: number, opts?: RequestOptions2): Promise; /** * Multi-region counterpart of `getFeaturesAsArrays`. All regions share one * zoom level and adjacent on-disk blocks coalesce across region boundaries * (like `getFeaturesMulti`), but results pack into one backing set of typed * arrays instead of one object per region, minimizing allocations. * * @param regions - array of `{ refName, start, end }` query regions * @param opts - same options as `getFeatures` * @returns `Promise` — * use the `isSummary` discriminant to distinguish the two shapes; slice * region `i` with `regionOffsets[i]..regionOffsets[i + 1]` */ getFeaturesAsArraysMulti(regions: { refName: string; start: number; end: number; }[], opts?: RequestOptions2): Promise; }