loom-browser 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loom-react.esm.js +3877 -3173
- package/dist/loom-react.esm.min.js +1 -1
- package/dist/loom-react.esm.min.js.map +1 -1
- package/dist/loom-worker.js +191 -137
- package/dist/loom-worker.min.js +1 -1
- package/dist/loom-worker.min.js.map +1 -1
- package/dist/loom.esm.js +4163 -3412
- package/dist/loom.esm.min.js +1 -1
- package/dist/loom.esm.min.js.map +1 -1
- package/dist/loom.js +4174 -3415
- package/dist/loom.min.js +1 -1
- package/dist/loom.min.js.map +1 -1
- package/dist/tsconfig.src.tsbuildinfo +1 -1
- package/dist/types/browser/dom/browserExport.d.ts +32 -0
- package/dist/types/browser/dom/contextMenu.d.ts +64 -0
- package/dist/types/browser/dom/contextMenuManager.d.ts +49 -0
- package/dist/types/browser/dom/defaultProviders.d.ts +23 -0
- package/dist/types/browser/dom/genomeBrowser.d.ts +171 -0
- package/dist/types/browser/dom/pointerEventManager.d.ts +109 -0
- package/dist/types/browser/dom/roiOverlayManager.d.ts +38 -0
- package/dist/types/browser/dom/svgFeatureOverlay.d.ts +27 -0
- package/dist/types/browser/headless/errors.d.ts +10 -0
- package/dist/types/browser/headless/headlessGenomeBrowser.d.ts +391 -0
- package/dist/types/browser/headless/roiManager.d.ts +47 -0
- package/dist/types/browser/headless/session.d.ts +45 -0
- package/dist/types/browser/headless/trackDataManager.d.ts +48 -0
- package/dist/types/browser/headless/trackFactories.d.ts +145 -0
- package/dist/types/browser/index.d.ts +24 -0
- package/dist/types/browserExport.d.ts +32 -0
- package/dist/types/commandDispatcher.d.ts +1 -1
- package/dist/types/contextMenuManager.d.ts +49 -0
- package/dist/types/data/searchService.d.ts +24 -0
- package/dist/types/dataSourceWorkerProvider.d.ts +3 -3
- package/dist/types/dataSources/bigWigDataSource.d.ts +2 -2
- package/dist/types/dataSources/config.d.ts +40 -0
- package/dist/types/dataSources/configureDataSource.d.ts +17 -0
- package/dist/types/dataSources/createDataSource.d.ts +14 -0
- package/dist/types/dataSources/geneDataSource.d.ts +4 -3
- package/dist/types/dataSources/gtxDataSource.d.ts +2 -2
- package/dist/types/dataSources/memoryDataSource.d.ts +2 -2
- package/dist/types/dataSources/sequenceDataSource.d.ts +4 -1
- package/dist/types/dataSources/textFeatureSource.d.ts +4 -2
- package/dist/types/dataSources/wholeGenomeUtils.d.ts +37 -0
- package/dist/types/defaultProviders.d.ts +23 -0
- package/dist/types/errors.d.ts +10 -0
- package/dist/types/formats/featureParser.d.ts +1 -1
- package/dist/types/genomeBrowser.d.ts +18 -91
- package/dist/types/headlessGenomeBrowser.d.ts +88 -227
- package/dist/types/index.d.ts +21 -14
- package/dist/types/io/binaryParser.d.ts +0 -1
- package/dist/types/logger.d.ts +20 -0
- package/dist/types/pointerEventManager.d.ts +109 -0
- package/dist/types/react/GenomeBrowserContext.d.ts +1 -1
- package/dist/types/react/LoomBrowser.d.ts +4 -4
- package/dist/types/react/hooks/useBrowserEvent.d.ts +1 -1
- package/dist/types/react/hooks/useGenomeBrowser.d.ts +1 -1
- package/dist/types/react/hooks/useTrackManager.d.ts +1 -1
- package/dist/types/react/tracks/BedTrack.d.ts +1 -5
- package/dist/types/react/ui/ChromosomeSelect.d.ts +1 -1
- package/dist/types/react/ui/ExportControls.d.ts +1 -1
- package/dist/types/react/ui/LocusInput.d.ts +1 -1
- package/dist/types/react/ui/Navbar.d.ts +1 -1
- package/dist/types/react/ui/WindowSize.d.ts +1 -1
- package/dist/types/react/ui/ZoomControls.d.ts +1 -1
- package/dist/types/remoteProtocol.d.ts +1 -1
- package/dist/types/roiManager.d.ts +47 -0
- package/dist/types/roiOverlayManager.d.ts +38 -0
- package/dist/types/stateProjection.d.ts +1 -1
- package/dist/types/trackDataManager.d.ts +48 -0
- package/dist/types/trackFactories.d.ts +140 -0
- package/dist/types/trackSelector.d.ts +1 -1
- package/dist/types/tracks/annotation/annotationTrackCanvas.d.ts +0 -1
- package/dist/types/tracks/annotation/config.d.ts +61 -0
- package/dist/types/tracks/baseTrackCanvas.d.ts +10 -0
- package/dist/types/tracks/configDiff.d.ts +14 -0
- package/dist/types/tracks/interaction/config.d.ts +40 -0
- package/dist/types/tracks/ruler/config.d.ts +24 -0
- package/dist/types/tracks/sequence/config.d.ts +56 -0
- package/dist/types/tracks/sequence/sequenceTrackCanvas.d.ts +3 -0
- package/dist/types/tracks/wig/config.d.ts +77 -0
- package/dist/types/types/igvCompat.d.ts +36 -0
- package/dist/types/types.d.ts +49 -285
- package/dist/types/ui/components/LoomBrowserShell.d.ts +2 -2
- package/dist/types/ui/components/LoomChromosomeSelect.d.ts +1 -1
- package/dist/types/ui/components/LoomContextMenu.d.ts +1 -0
- package/dist/types/ui/components/LoomExportControls.d.ts +1 -1
- package/dist/types/ui/components/LoomLocusInput.d.ts +1 -1
- package/dist/types/ui/components/LoomNavbar.d.ts +1 -1
- package/dist/types/ui/components/LoomWindowSize.d.ts +1 -1
- package/dist/types/ui/components/LoomZoomControls.d.ts +1 -1
- package/dist/types/undoManager.d.ts +49 -0
- package/dist/types/worker/dataSourceRegistry.d.ts +2 -2
- package/dist/types/worker/serializedError.d.ts +16 -0
- package/dist/types/worker/taskTimeout.d.ts +21 -0
- package/dist/types/worker/webWorkerPool.d.ts +5 -2
- package/dist/types/worker/webWorkerProvider.d.ts +3 -0
- package/dist/types/workerDataSource.d.ts +2 -2
- package/dist/types/workerProvider.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Headless GenomeBrowser — pure data/navigation/caching core with zero DOM dependencies.
|
|
3
3
|
*
|
|
4
|
-
* Manages locus state, track coordination, data lifecycle
|
|
5
|
-
*
|
|
4
|
+
* Manages locus state, track coordination, data lifecycle, events, and theming.
|
|
5
|
+
* Can run in Node.js, workers, or any environment.
|
|
6
|
+
*
|
|
7
|
+
* Delegates to focused single-responsibility modules:
|
|
8
|
+
* - ROIManager: Region of Interest CRUD and spatial queries
|
|
9
|
+
* - TrackDataManager: fetch dedup, caching, abort, debounce
|
|
10
|
+
* - Track factories: convenience track creation (trackFactories.ts)
|
|
6
11
|
*
|
|
7
12
|
* The DOM-attached `GenomeBrowser` extends this class to add pointer events,
|
|
8
13
|
* ResizeObserver, canvas stacking, and sweep-to-zoom.
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
* browser.setLocus({ chr: 'chr17', start: 7670000, end: 7680000 })
|
|
17
22
|
* browser.dispose()
|
|
18
23
|
*/
|
|
19
|
-
import type { Locus, Track, DataSource, FeatureCacheEntry, SessionConfig, TrackSessionConfig, DataSourceConfig, TrackInteractionEvent, TrackContextMenuEvent,
|
|
24
|
+
import type { Locus, Track, DataSource, FeatureCacheEntry, SessionConfig, TrackSessionConfig, DataSourceConfig, TrackInteractionEvent, TrackContextMenuEvent, WigFeature, BedFeature, SequenceProvider, Genome, ROI, ROISetConfig, ROIInteractionEvent } from './types';
|
|
20
25
|
import { ROISet } from './roi/roiSet';
|
|
21
26
|
import type { CanvasProvider } from './canvasProvider';
|
|
22
27
|
import type { WorkerProvider } from './workerProvider';
|
|
@@ -27,13 +32,17 @@ import type { RenderTheme } from './themes/renderTheme';
|
|
|
27
32
|
import { EventEmitter } from './events';
|
|
28
33
|
import type { ChromSizes, CumulativeOffsets } from './genome/chromSizes';
|
|
29
34
|
import { type CreateTrackFromSessionOptions } from './session';
|
|
30
|
-
import { RulerTrackCanvas } from './tracks/ruler/rulerTrackCanvas';
|
|
31
|
-
import { WigTrackCanvas } from './tracks/wig/wigTrackCanvas';
|
|
32
|
-
import { AnnotationTrackCanvas } from './tracks/annotation/annotationTrackCanvas';
|
|
33
35
|
import { SequenceTrackCanvas } from './tracks/sequence/sequenceTrackCanvas';
|
|
34
|
-
import { InteractionTrackCanvas } from './tracks/interaction/interactionTrackCanvas';
|
|
35
36
|
import { StateProjection } from './stateProjection';
|
|
36
37
|
import type { TrackSelector } from './trackSelector';
|
|
38
|
+
import type { UndoEntry, UndoEntryType } from './undoManager';
|
|
39
|
+
import { ROIManager } from './roiManager';
|
|
40
|
+
import { TrackDataManager } from './trackDataManager';
|
|
41
|
+
export type { AddRulerOptions, AddWigTrackOptions, AddGtxTrackOptions, AddSequenceTrackOptions, AddBedTrackOptions, AddInteractionTrackOptions, AddAnnotationTrackOptions, AddWigTrackWithFeaturesOptions, AddBedTrackWithFeaturesOptions, } from './trackFactories';
|
|
42
|
+
import type { RulerTrackCanvas } from './tracks/ruler/rulerTrackCanvas';
|
|
43
|
+
import type { WigTrackCanvas } from './tracks/wig/wigTrackCanvas';
|
|
44
|
+
import type { AnnotationTrackCanvas } from './tracks/annotation/annotationTrackCanvas';
|
|
45
|
+
import type { InteractionTrackCanvas } from './tracks/interaction/interactionTrackCanvas';
|
|
37
46
|
export declare const BrowserEvent: {
|
|
38
47
|
readonly LocusChange: "locuschange";
|
|
39
48
|
readonly TrackAdded: "trackadded";
|
|
@@ -51,6 +60,10 @@ export declare const BrowserEvent: {
|
|
|
51
60
|
readonly ROIClick: "roiclick";
|
|
52
61
|
readonly ROIContextMenu: "roicontextmenu";
|
|
53
62
|
readonly ThemeChanged: "themechange";
|
|
63
|
+
readonly TrackConfigChanged: "trackconfigchanged";
|
|
64
|
+
readonly Undo: "undo";
|
|
65
|
+
readonly Redo: "redo";
|
|
66
|
+
readonly UndoStackChanged: "undostackchanged";
|
|
54
67
|
};
|
|
55
68
|
export interface BrowserEvents {
|
|
56
69
|
[BrowserEvent.LocusChange]: {
|
|
@@ -97,6 +110,19 @@ export interface BrowserEvents {
|
|
|
97
110
|
[BrowserEvent.ThemeChanged]: {
|
|
98
111
|
theme: RenderTheme;
|
|
99
112
|
};
|
|
113
|
+
[BrowserEvent.TrackConfigChanged]: {
|
|
114
|
+
track: Track;
|
|
115
|
+
};
|
|
116
|
+
[BrowserEvent.Undo]: {
|
|
117
|
+
entry: UndoEntry;
|
|
118
|
+
};
|
|
119
|
+
[BrowserEvent.Redo]: {
|
|
120
|
+
entry: UndoEntry;
|
|
121
|
+
};
|
|
122
|
+
[BrowserEvent.UndoStackChanged]: {
|
|
123
|
+
canUndo: boolean;
|
|
124
|
+
canRedo: boolean;
|
|
125
|
+
};
|
|
100
126
|
}
|
|
101
127
|
/** Internal bookkeeping for a track + optional data source. */
|
|
102
128
|
export interface ManagedTrack {
|
|
@@ -141,136 +167,10 @@ export interface HeadlessGenomeBrowserOptions {
|
|
|
141
167
|
/** Custom StateProjection subclass instance. Default: lazily created StateProjection. */
|
|
142
168
|
stateProjection?: StateProjection;
|
|
143
169
|
}
|
|
144
|
-
export interface AddRulerOptions {
|
|
145
|
-
config?: Partial<RulerRenderConfig>;
|
|
146
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
147
|
-
maxTrackHeight?: number;
|
|
148
|
-
}
|
|
149
|
-
export interface AddWigTrackOptions {
|
|
150
|
-
config?: Partial<WigRenderConfig>;
|
|
151
|
-
/** Fixed pixel height (overrides config.height). */
|
|
152
|
-
height?: number;
|
|
153
|
-
/** Background color. */
|
|
154
|
-
background?: string;
|
|
155
|
-
/** Window function for BigWig summarization. Default: 'mean'. */
|
|
156
|
-
windowFunction?: WindowFunction;
|
|
157
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
158
|
-
maxTrackHeight?: number;
|
|
159
|
-
/** Track name for axis label. */
|
|
160
|
-
name?: string;
|
|
161
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
162
|
-
metadata?: Record<string, string>;
|
|
163
|
-
}
|
|
164
|
-
export interface AddGtxTrackOptions {
|
|
165
|
-
/** Experiment ID within the GTX file. */
|
|
166
|
-
experimentId: string;
|
|
167
|
-
config?: Partial<WigRenderConfig>;
|
|
168
|
-
/** Fixed pixel height (overrides config.height). */
|
|
169
|
-
height?: number;
|
|
170
|
-
/** Background color. */
|
|
171
|
-
background?: string;
|
|
172
|
-
/** Window function for summarization. Default: 'mean'. */
|
|
173
|
-
windowFunction?: WindowFunction;
|
|
174
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
175
|
-
maxTrackHeight?: number;
|
|
176
|
-
/** Track name for axis label. */
|
|
177
|
-
name?: string;
|
|
178
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
179
|
-
metadata?: Record<string, string>;
|
|
180
|
-
}
|
|
181
|
-
export interface AddSequenceTrackOptions {
|
|
182
|
-
config?: Partial<SequenceRenderConfig>;
|
|
183
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
184
|
-
maxTrackHeight?: number;
|
|
185
|
-
}
|
|
186
|
-
export interface AddBedTrackOptions {
|
|
187
|
-
config?: Partial<AnnotationRenderConfig>;
|
|
188
|
-
/** Fixed pixel height. */
|
|
189
|
-
height?: number;
|
|
190
|
-
/** Background color. */
|
|
191
|
-
background?: string;
|
|
192
|
-
/** Explicit format override. When absent, inferred from URL. */
|
|
193
|
-
format?: TextFileFormat;
|
|
194
|
-
/** Index URL override for tabix-indexed files. */
|
|
195
|
-
indexURL?: string;
|
|
196
|
-
/** Whether the file is tabix-indexed. Auto-detected if absent. */
|
|
197
|
-
indexed?: boolean;
|
|
198
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
199
|
-
maxTrackHeight?: number;
|
|
200
|
-
/** Track name for axis label. */
|
|
201
|
-
name?: string;
|
|
202
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
203
|
-
metadata?: Record<string, string>;
|
|
204
|
-
}
|
|
205
|
-
export interface AddInteractionTrackOptions {
|
|
206
|
-
config?: Partial<InteractionRenderConfig>;
|
|
207
|
-
/** Background color. */
|
|
208
|
-
background?: string;
|
|
209
|
-
/** Explicit format override (e.g., 'bedpe', 'interact'). Inferred from URL if absent. */
|
|
210
|
-
format?: TextFileFormat;
|
|
211
|
-
/** Index URL override for tabix-indexed files. */
|
|
212
|
-
indexURL?: string;
|
|
213
|
-
/** Whether the file is tabix-indexed. Auto-detected if absent. */
|
|
214
|
-
indexed?: boolean;
|
|
215
|
-
/** Track name for axis label. */
|
|
216
|
-
name?: string;
|
|
217
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
218
|
-
metadata?: Record<string, string>;
|
|
219
|
-
}
|
|
220
|
-
export interface AddAnnotationTrackOptions {
|
|
221
|
-
config?: Partial<AnnotationRenderConfig>;
|
|
222
|
-
/** Fixed pixel height. */
|
|
223
|
-
height?: number;
|
|
224
|
-
/** Background color. */
|
|
225
|
-
background?: string;
|
|
226
|
-
/** Genome assembly for UCSC API. Default: 'hg38'. */
|
|
227
|
-
genome?: string;
|
|
228
|
-
/** UCSC track name. Default: 'ncbiRefSeq'. */
|
|
229
|
-
track?: string;
|
|
230
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
231
|
-
maxTrackHeight?: number;
|
|
232
|
-
/** Track name for axis label. Default: 'Genes'. */
|
|
233
|
-
name?: string;
|
|
234
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
235
|
-
metadata?: Record<string, string>;
|
|
236
|
-
}
|
|
237
|
-
export interface AddWigTrackWithFeaturesOptions {
|
|
238
|
-
config?: Partial<WigRenderConfig>;
|
|
239
|
-
/** Fixed pixel height (overrides config.height). */
|
|
240
|
-
height?: number;
|
|
241
|
-
/** Background color. */
|
|
242
|
-
background?: string;
|
|
243
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
244
|
-
maxTrackHeight?: number;
|
|
245
|
-
/** Track name for axis label. */
|
|
246
|
-
name?: string;
|
|
247
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
248
|
-
metadata?: Record<string, string>;
|
|
249
|
-
}
|
|
250
|
-
export interface AddBedTrackWithFeaturesOptions {
|
|
251
|
-
config?: Partial<AnnotationRenderConfig>;
|
|
252
|
-
/** Fixed pixel height. */
|
|
253
|
-
height?: number;
|
|
254
|
-
/** Background color. */
|
|
255
|
-
background?: string;
|
|
256
|
-
/** Max visible height — enables scrollable container in DOM browser. */
|
|
257
|
-
maxTrackHeight?: number;
|
|
258
|
-
/** Track name for axis label. */
|
|
259
|
-
name?: string;
|
|
260
|
-
/** Arbitrary key-value metadata (e.g., assay, biosample, tissue). */
|
|
261
|
-
metadata?: Record<string, string>;
|
|
262
|
-
}
|
|
263
170
|
export declare class HeadlessGenomeBrowser {
|
|
264
171
|
protected _locus: Locus;
|
|
265
172
|
protected _viewportWidth: number;
|
|
266
173
|
protected managedTracks: ManagedTrack[];
|
|
267
|
-
protected roiSets: ROISet[];
|
|
268
|
-
/** Inflight fetch promises keyed by (cacheKey + fetchRegion + bpPerPixel) for deduplication. */
|
|
269
|
-
private inflightFetches;
|
|
270
|
-
/** Timer for debouncing data loads during rapid zoom/pan. */
|
|
271
|
-
private loadDebounceTimer;
|
|
272
|
-
/** Set to true by dispose() to suppress post-dispose promise handlers. */
|
|
273
|
-
private _disposed;
|
|
274
174
|
/** When true, sortTracks() is a no-op. Used for batch track additions (e.g. loadSession). */
|
|
275
175
|
private _deferSort;
|
|
276
176
|
/** Canvas provider for environment abstraction. Available for convenience API / future use. */
|
|
@@ -298,23 +198,46 @@ export declare class HeadlessGenomeBrowser {
|
|
|
298
198
|
readonly sequenceProvider?: SequenceProvider;
|
|
299
199
|
readonly events: EventEmitter<BrowserEvents>;
|
|
300
200
|
private _state?;
|
|
201
|
+
private readonly _undoManager;
|
|
202
|
+
/** ROI management — owns all ROI sets and operations. */
|
|
203
|
+
protected readonly roiManager: ROIManager;
|
|
204
|
+
/** Data lifecycle — owns fetch dedup, caching, abort, debounce. */
|
|
205
|
+
protected readonly dataManager: TrackDataManager;
|
|
301
206
|
get theme(): RenderTheme;
|
|
302
207
|
get locus(): Locus;
|
|
303
208
|
get viewportWidth(): number;
|
|
209
|
+
/** Whether undo is available. Accepts optional skip predicate for filtering entry types. */
|
|
210
|
+
canUndo(skip?: (e: UndoEntry) => boolean): boolean;
|
|
211
|
+
/** Whether redo is available. Accepts optional skip predicate for filtering entry types. */
|
|
212
|
+
canRedo(skip?: (e: UndoEntry) => boolean): boolean;
|
|
304
213
|
/** Agent-friendly state projection manager. Lazily created on first access. */
|
|
305
214
|
get state(): StateProjection;
|
|
306
215
|
constructor(options: HeadlessGenomeBrowserOptions);
|
|
307
|
-
/**
|
|
308
|
-
|
|
309
|
-
* if dataSourceWorkerProvider is not set. Handles create + chrom alias + offsets wiring.
|
|
310
|
-
*/
|
|
311
|
-
private createWorkerDataSource;
|
|
216
|
+
/** Build the factory context from current browser state. */
|
|
217
|
+
private factoryContext;
|
|
312
218
|
/** Clamp a locus to valid chromosome bounds. No-op if chromSizes is not set. */
|
|
313
219
|
protected clamp(locus: Locus): Locus;
|
|
314
220
|
/** Subscribe to a browser event. Returns an unsubscribe function. */
|
|
315
221
|
on<K extends keyof BrowserEvents>(event: K, handler: (data: BrowserEvents[K]) => void): () => void;
|
|
316
222
|
/** Unsubscribe from a browser event. */
|
|
317
223
|
off<K extends keyof BrowserEvents>(event: K, handler?: (data: BrowserEvents[K]) => void): void;
|
|
224
|
+
/**
|
|
225
|
+
* Snapshot the current state before a mutation.
|
|
226
|
+
* No-op while paused (e.g., during loadSession restoration from undo/redo).
|
|
227
|
+
*/
|
|
228
|
+
protected _snapshotForUndo(type: UndoEntryType): void;
|
|
229
|
+
/**
|
|
230
|
+
* Undo the last mutation. Restores the previous session state.
|
|
231
|
+
* Optionally skip entries matching a predicate (e.g., skip navigation-only entries).
|
|
232
|
+
*/
|
|
233
|
+
undo(skip?: (e: UndoEntry) => boolean): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Redo the last undone mutation.
|
|
236
|
+
* Optionally skip entries matching a predicate.
|
|
237
|
+
*/
|
|
238
|
+
redo(skip?: (e: UndoEntry) => boolean): boolean;
|
|
239
|
+
/** Clear all undo/redo history. */
|
|
240
|
+
clearUndoHistory(): void;
|
|
318
241
|
/**
|
|
319
242
|
* Update the viewport width and re-render.
|
|
320
243
|
* In headless mode, call this when the logical viewport size changes.
|
|
@@ -332,16 +255,13 @@ export declare class HeadlessGenomeBrowser {
|
|
|
332
255
|
moveTrack(track: Track, toIndex: number): void;
|
|
333
256
|
/**
|
|
334
257
|
* Sort tracks by priority (descending): positive = top, 0 = middle, negative = bottom.
|
|
335
|
-
* Priority comes from the track type default + per-track `order` override.
|
|
336
|
-
* Within the same effective priority, insertion order is preserved (stable sort).
|
|
337
258
|
*/
|
|
338
259
|
private sortTracks;
|
|
339
260
|
/** Hook for subclasses to react to track order changes (e.g., DOM reorder). */
|
|
340
261
|
protected onTracksSorted(): void;
|
|
341
262
|
/**
|
|
342
263
|
* Persist current array positions into mt.order so future sorts preserve
|
|
343
|
-
* manual reordering.
|
|
344
|
-
* above the type-priority range so explicit order dominates.
|
|
264
|
+
* manual reordering.
|
|
345
265
|
*/
|
|
346
266
|
protected _assignOrderFromPosition(): void;
|
|
347
267
|
/** Find the ManagedTrack entry for a given track canvas. */
|
|
@@ -354,41 +274,24 @@ export declare class HeadlessGenomeBrowser {
|
|
|
354
274
|
getTrack(id: string): Track | undefined;
|
|
355
275
|
/** Get all managed tracks (read-only snapshot). */
|
|
356
276
|
getManagedTracks(): readonly ManagedTrack[];
|
|
357
|
-
/**
|
|
358
|
-
* Find all managed tracks matching a selector.
|
|
359
|
-
*
|
|
360
|
-
* ```ts
|
|
361
|
-
* browser.findTracks({ type: 'wig', where: { biosample: 'K562' } })
|
|
362
|
-
* browser.findTracks({ name: 'H3K27ac' })
|
|
363
|
-
* ```
|
|
364
|
-
*/
|
|
277
|
+
/** Find all managed tracks matching a selector. */
|
|
365
278
|
findTracks(selector: TrackSelector): ManagedTrack[];
|
|
366
|
-
/**
|
|
367
|
-
* Remove all tracks matching a selector. Returns the number of tracks removed.
|
|
368
|
-
*
|
|
369
|
-
* ```ts
|
|
370
|
-
* browser.removeTracks({ where: { assay: 'ATAC-seq' } }) // remove all ATAC-seq tracks
|
|
371
|
-
* browser.removeTracks({ type: 'wig' }) // remove all wig tracks
|
|
372
|
-
* ```
|
|
373
|
-
*/
|
|
279
|
+
/** Remove all tracks matching a selector. Returns the number of tracks removed. */
|
|
374
280
|
removeTracks(selector: TrackSelector): number;
|
|
375
|
-
/**
|
|
376
|
-
* Merge metadata into all tracks matching a selector. Returns the number of tracks updated.
|
|
377
|
-
* New keys are added; existing keys are overwritten.
|
|
378
|
-
*
|
|
379
|
-
* ```ts
|
|
380
|
-
* browser.updateTrackMetadata({ type: 'wig' }, { project: 'ENCODE' })
|
|
381
|
-
* ```
|
|
382
|
-
*/
|
|
281
|
+
/** Merge metadata into all tracks matching a selector. Returns the number of tracks updated. */
|
|
383
282
|
updateTrackMetadata(selector: TrackSelector, metadata: Record<string, string>): number;
|
|
384
283
|
/** Update the locus and re-render all tracks. Clamped to chromosome bounds. */
|
|
385
284
|
setLocus(locus: Locus): void;
|
|
386
285
|
/**
|
|
387
|
-
* Parse a locus string and navigate to it.
|
|
388
|
-
*
|
|
389
|
-
*
|
|
286
|
+
* Parse a locus string or gene name and navigate to it.
|
|
287
|
+
*
|
|
288
|
+
* Search order (matches igv.js js/search.ts):
|
|
289
|
+
* 1. Coordinate string: "chr17:7,668,000-7,688,000"
|
|
290
|
+
* 2. Whole genome: "all" / "*"
|
|
291
|
+
* 3. Bare chromosome name: "chr17", "chrX"
|
|
292
|
+
* 4. Gene/feature name via web service: "BRCA1", "TP53"
|
|
390
293
|
*/
|
|
391
|
-
search(query: string): boolean
|
|
294
|
+
search(query: string): Promise<boolean>;
|
|
392
295
|
/** Zoom in by a factor (default 2x) around the center. */
|
|
393
296
|
zoomIn(factor?: number): void;
|
|
394
297
|
/** Zoom out by a factor (default 2x) around the center. */
|
|
@@ -411,10 +314,7 @@ export declare class HeadlessGenomeBrowser {
|
|
|
411
314
|
getCachedFeatures<F>(track: Track): F[] | undefined;
|
|
412
315
|
/** Re-render all tracks at current locus. */
|
|
413
316
|
render(): void;
|
|
414
|
-
/**
|
|
415
|
-
* Add a single ROI to a named set. Creates a user-defined set if it doesn't exist.
|
|
416
|
-
* Returns the ROI (with generated ID if none provided).
|
|
417
|
-
*/
|
|
317
|
+
/** Add a single ROI to a named set. Creates a user-defined set if it doesn't exist. */
|
|
418
318
|
addROI(roi: ROI, setName?: string): ROI;
|
|
419
319
|
/** Add a full ROI set from config. Returns the created ROISet. */
|
|
420
320
|
addROISet(config: ROISetConfig): ROISet;
|
|
@@ -436,15 +336,6 @@ export declare class HeadlessGenomeBrowser {
|
|
|
436
336
|
getVisibleROIs(): ROI[];
|
|
437
337
|
/**
|
|
438
338
|
* Export the current view as an SVG string.
|
|
439
|
-
*
|
|
440
|
-
* Creates a Canvas2SVG context, renders each track with clipped groups and
|
|
441
|
-
* vertical offsets, and returns the serialized SVG. Named entities are
|
|
442
|
-
* replaced with numeric equivalents for standalone SVG compatibility.
|
|
443
|
-
*
|
|
444
|
-
* Mirrors igv.js Browser.toSVG() (js/browser.ts lines 352-388).
|
|
445
|
-
*
|
|
446
|
-
* @param options.width — Override viewport width (defaults to current viewportWidth).
|
|
447
|
-
* @param options.backdropColor — Background color (defaults to 'white').
|
|
448
339
|
*/
|
|
449
340
|
toSVG(options?: {
|
|
450
341
|
width?: number;
|
|
@@ -452,56 +343,41 @@ export declare class HeadlessGenomeBrowser {
|
|
|
452
343
|
}): string;
|
|
453
344
|
/**
|
|
454
345
|
* Serialize browser state to a SessionConfig.
|
|
455
|
-
* Track configs are serialized via per-type serializers that drop
|
|
456
|
-
* non-serializable values (functions, Promises) and only include
|
|
457
|
-
* fields that differ from theme defaults.
|
|
458
346
|
*/
|
|
459
347
|
toJSON(): SessionConfig;
|
|
460
348
|
/**
|
|
461
349
|
* Load a session, replacing all current tracks.
|
|
462
350
|
* Disposes existing state, sets locus, and recreates tracks + data sources.
|
|
463
|
-
*
|
|
464
|
-
* Tracks are created headlessly (not attached to the DOM). Subclasses like
|
|
465
|
-
* GenomeBrowser can override this to also attach track canvases to the DOM.
|
|
466
351
|
*/
|
|
467
352
|
loadSession(session: SessionConfig, options?: CreateTrackFromSessionOptions): void;
|
|
468
353
|
/**
|
|
469
354
|
* Create a new HeadlessGenomeBrowser from a session config.
|
|
470
|
-
* Creates the browser and loads all tracks from the session.
|
|
471
355
|
*/
|
|
472
356
|
static fromSession(session: SessionConfig, options?: HeadlessGenomeBrowserOptions & CreateTrackFromSessionOptions): HeadlessGenomeBrowser;
|
|
473
357
|
/**
|
|
474
358
|
* Add a track from a session config using the track registry.
|
|
475
|
-
*
|
|
476
|
-
* Mirrors igv.js `Browser.createTrack(config)` (js/browser.ts lines 1074-1151)
|
|
477
|
-
* which resolves type aliases via `getTrack()` and instantiates through the
|
|
478
|
-
* track factory. Our version delegates to `createTrackFromConfig()` in the
|
|
479
|
-
* registry, then registers the created track with this browser's data lifecycle.
|
|
480
|
-
*
|
|
481
|
-
* This is the generic entry point — the convenience methods below
|
|
482
|
-
* (addRuler, addWigTrack, addGeneTrack) are sugar for common cases.
|
|
483
359
|
*/
|
|
484
360
|
addTrackFromConfig(trackConfig: TrackSessionConfig): Track;
|
|
361
|
+
/** Register a factory result: addTrack + wire metadata + post-registration callback. */
|
|
362
|
+
private registerFactory;
|
|
485
363
|
/** Add a ruler track. */
|
|
486
|
-
addRuler(options?: AddRulerOptions): RulerTrackCanvas;
|
|
364
|
+
addRuler(options?: import('./trackFactories').AddRulerOptions): RulerTrackCanvas;
|
|
487
365
|
/** Add a BigWig signal track. */
|
|
488
|
-
addWigTrack(url: string, options?: AddWigTrackOptions): WigTrackCanvas;
|
|
366
|
+
addWigTrack(url: string, options?: import('./trackFactories').AddWigTrackOptions): WigTrackCanvas;
|
|
489
367
|
/** Add a GTX signal track (single experiment from a multi-experiment GTX file). */
|
|
490
|
-
addGtxTrack(url: string, options: AddGtxTrackOptions): WigTrackCanvas;
|
|
368
|
+
addGtxTrack(url: string, options: import('./trackFactories').AddGtxTrackOptions): WigTrackCanvas;
|
|
491
369
|
/** Add a UCSC gene annotation track. */
|
|
492
|
-
addGeneTrack(options?: AddAnnotationTrackOptions): AnnotationTrackCanvas;
|
|
493
|
-
/** Add a BED/peak annotation track from a URL.
|
|
494
|
-
addBedTrack(url: string, options?: AddBedTrackOptions): AnnotationTrackCanvas;
|
|
370
|
+
addGeneTrack(options?: import('./trackFactories').AddAnnotationTrackOptions): AnnotationTrackCanvas;
|
|
371
|
+
/** Add a BED/peak annotation track from a URL. */
|
|
372
|
+
addBedTrack(url: string, options?: import('./trackFactories').AddBedTrackOptions): AnnotationTrackCanvas;
|
|
495
373
|
/** Add an interaction (arc/BEDPE) track from a URL. */
|
|
496
|
-
addInteractionTrack(url: string, options?: AddInteractionTrackOptions): InteractionTrackCanvas;
|
|
374
|
+
addInteractionTrack(url: string, options?: import('./trackFactories').AddInteractionTrackOptions): InteractionTrackCanvas;
|
|
497
375
|
/** Add a BigWig-style signal track backed by in-memory features (no URL required). */
|
|
498
|
-
addWigTrackWithFeatures(features: WigFeature[], options?: AddWigTrackWithFeaturesOptions): WigTrackCanvas;
|
|
499
|
-
/** Add a BED/annotation track backed by in-memory features (no URL required).
|
|
500
|
-
addBedTrackWithFeatures(features: (
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
/** Add a DNA/RNA sequence track. Data fetching is handled automatically via the genome's sequence provider. */
|
|
504
|
-
addSequenceTrack(options?: AddSequenceTrackOptions): SequenceTrackCanvas;
|
|
376
|
+
addWigTrackWithFeatures(features: WigFeature[], options?: import('./trackFactories').AddWigTrackWithFeaturesOptions): WigTrackCanvas;
|
|
377
|
+
/** Add a BED/annotation track backed by in-memory features (no URL required). */
|
|
378
|
+
addBedTrackWithFeatures(features: BedFeature[], options?: import('./trackFactories').AddBedTrackWithFeaturesOptions): AnnotationTrackCanvas;
|
|
379
|
+
/** Add a DNA/RNA sequence track. */
|
|
380
|
+
addSequenceTrack(options?: import('./trackFactories').AddSequenceTrackOptions): SequenceTrackCanvas;
|
|
505
381
|
/** Apply a new render theme to the browser and all existing tracks. */
|
|
506
382
|
setTheme(theme: Partial<RenderTheme>): void;
|
|
507
383
|
/** Clean up event listeners, abort in-flight requests, clear tracks and ROIs. */
|
|
@@ -509,22 +385,7 @@ export declare class HeadlessGenomeBrowser {
|
|
|
509
385
|
/**
|
|
510
386
|
* Resolve pixel coordinates on a track canvas to interaction data.
|
|
511
387
|
* Used by GenomeBrowser to build event payloads from pointer events.
|
|
512
|
-
* Returns null if the track has no features at the given point.
|
|
513
388
|
*/
|
|
514
389
|
protected resolveInteraction(track: Track, x: number, y: number): TrackInteractionEvent | null;
|
|
515
|
-
/**
|
|
516
|
-
* Debounced wrapper around loadAllTracksIfNeeded.
|
|
517
|
-
* During rapid zoom/pan, this coalesces multiple setLocus() calls into a
|
|
518
|
-
* single data fetch cycle after the interaction settles (100ms quiet period).
|
|
519
|
-
* Abort in-flight requests immediately so they don't race with the eventual fetch.
|
|
520
|
-
*/
|
|
521
|
-
private debouncedLoad;
|
|
522
390
|
protected loadAllTracksIfNeeded(): void;
|
|
523
|
-
/**
|
|
524
|
-
* Load data for a single track, deduplicating against inflight fetches
|
|
525
|
-
* from other tracks with the same data source identity.
|
|
526
|
-
*
|
|
527
|
-
* Works for both initial addTrack() loads and bulk loadAllTracksIfNeeded() calls.
|
|
528
|
-
*/
|
|
529
|
-
private loadTrackWithDedup;
|
|
530
391
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export type { CanvasProvider, CanvasAndContext } from './canvasProvider';
|
|
|
2
2
|
export { DOMCanvasProvider, defaultCanvasProvider } from './canvasProvider';
|
|
3
3
|
export type { PopupProvider } from './popupProvider';
|
|
4
4
|
export type { ContextMenuProvider } from './contextMenuProvider';
|
|
5
|
-
export type { ContextMenuCallbacks, ROIMenuCallbacks } from './contextMenu';
|
|
6
|
-
export { commonContextMenuItems, numericDataMenuItems, roiContextMenuItems } from './contextMenu';
|
|
5
|
+
export type { ContextMenuCallbacks, ROIMenuCallbacks } from './browser/dom/contextMenu';
|
|
6
|
+
export { commonContextMenuItems, numericDataMenuItems, roiContextMenuItems } from './browser/dom/contextMenu';
|
|
7
7
|
export type { WorkerProvider, WorkerTask, WorkerTaskResultMap } from './workerProvider';
|
|
8
8
|
export type { PackTask, SummarizeWigTask, ComputeWigRangeTask, ParseFeaturesTask, } from './workerProvider';
|
|
9
9
|
export { MainThreadProvider, mainThreadProvider } from './workerProvider';
|
|
@@ -23,10 +23,12 @@ export type { SequenceRenderConfig, SequenceType, SequenceTrackSessionConfig, Se
|
|
|
23
23
|
export { defaultSequenceRenderConfig } from './types';
|
|
24
24
|
export type { InteractionFeature, InteractionRenderConfig, ArcOrientation, ArcDisplayMode, InteractionTrackSessionConfig, InteractionSessionOverrides } from './types';
|
|
25
25
|
export { defaultInteractionRenderConfig } from './types';
|
|
26
|
-
export type { DataSource, FeatureCacheEntry, DataDrivenTrack } from './types';
|
|
26
|
+
export type { DataSource, ConfigurableDataSource, DataSourceConfigMethod, FeatureCacheEntry, DataDrivenTrack, ZoomAwareTrack } from './types';
|
|
27
|
+
export { isZoomAware } from './types';
|
|
27
28
|
export type { PopupDataItem, HitTestResult, TrackInteractionEvent, ContextMenuItem, TrackContextMenuEvent, NumericState, ROI, ROISetConfig, ROIInteractionEvent, FeatureRect } from './types';
|
|
28
|
-
export type { SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, SequenceProvider,
|
|
29
|
+
export type { SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, SequenceProvider, Chromosome, Genome, GenomeConfig, ChromAliasRecord, Strand, TextFileFormat, BedFeature, PeakFeature, BedGraphFeature, GFFRecord, GFFFeature, TextFeature, } from './types';
|
|
29
30
|
export { defaultAnnotationRenderConfig, defaultRulerRenderConfig, defaultWigRenderConfig } from './types';
|
|
31
|
+
export type { IgvSessionObject, IgvReferenceConfig, IgvTrackConfig } from './types/igvCompat';
|
|
30
32
|
export type { Packable } from './pack';
|
|
31
33
|
export { packFeatures } from './pack';
|
|
32
34
|
export { renderAnnotationTrack } from './tracks/annotation/annotationRenderer';
|
|
@@ -41,14 +43,20 @@ export { renderWigTrack } from './tracks/wig/wigRenderer';
|
|
|
41
43
|
export { WigTrackCanvas } from './tracks/wig/wigTrackCanvas';
|
|
42
44
|
export type { WigTrackCanvasOptions } from './tracks/wig/wigTrackCanvas';
|
|
43
45
|
export { summarizeWigData, computeWigDataRange } from './tracks/wig/wigSummary';
|
|
44
|
-
export { HeadlessGenomeBrowser, BrowserEvent } from './headlessGenomeBrowser';
|
|
45
|
-
export type { HeadlessGenomeBrowserOptions, ManagedTrack, AddRulerOptions, AddWigTrackOptions, AddGtxTrackOptions, AddBedTrackOptions, AddAnnotationTrackOptions, AddInteractionTrackOptions, AddSequenceTrackOptions, AddWigTrackWithFeaturesOptions, AddBedTrackWithFeaturesOptions } from './headlessGenomeBrowser';
|
|
46
|
-
export { GenomeBrowser } from './genomeBrowser';
|
|
47
|
-
export type { GenomeBrowserOptions, BrowserEvents } from './genomeBrowser';
|
|
46
|
+
export { HeadlessGenomeBrowser, BrowserEvent } from './browser/headless/headlessGenomeBrowser';
|
|
47
|
+
export type { HeadlessGenomeBrowserOptions, ManagedTrack, AddRulerOptions, AddWigTrackOptions, AddGtxTrackOptions, AddBedTrackOptions, AddAnnotationTrackOptions, AddInteractionTrackOptions, AddSequenceTrackOptions, AddWigTrackWithFeaturesOptions, AddBedTrackWithFeaturesOptions } from './browser/headless/headlessGenomeBrowser';
|
|
48
|
+
export { GenomeBrowser } from './browser/dom/genomeBrowser';
|
|
49
|
+
export type { GenomeBrowserOptions, BrowserEvents } from './browser/dom/genomeBrowser';
|
|
50
|
+
export { createDefaultContextMenuProvider, createDefaultPopupProvider } from './browser/dom/defaultProviders';
|
|
51
|
+
export { renderDOMBrowserSVG, svgToPNG, triggerDownload } from './browser/dom/browserExport';
|
|
48
52
|
export type { ChromSizes, CumulativeOffsets } from './genome/chromSizes';
|
|
49
53
|
export { hg38ChromSizes, getChromLength, isMainChromosome, mainChromosomeNames, computeCumulativeOffsets, genomeToChromCoord, parseChromSizes } from './genome/chromSizes';
|
|
50
54
|
export { hg38Genome, createGenome, createGenomeSync } from './genome/genome';
|
|
51
55
|
export { ChromAliasDefaults, addCaseAliases } from './genome/chromAlias';
|
|
56
|
+
export { UndoManager } from './undoManager';
|
|
57
|
+
export type { UndoEntry, UndoEntryType } from './undoManager';
|
|
58
|
+
export type { LogLevel } from './logger';
|
|
59
|
+
export { setLogLevel, getLogLevel } from './logger';
|
|
52
60
|
export { EventEmitter } from './events';
|
|
53
61
|
export { parseLocus, formatLocus, formatBpLength, clampLocus, isWholeGenomeView } from './locusUtils';
|
|
54
62
|
export { LoomChromosomeSelect, LoomLocusInput, LoomZoomControls, LoomWindowSize, LoomExportControls, LoomNavbar, LoomBrowserShell, createShell, classicThemeCSS, modernThemeCSS, getThemeCSS, LoomPopup, DefaultPopupProvider, LoomContextMenu, DefaultContextMenuProvider, LoomInputDialog, } from './ui';
|
|
@@ -83,21 +91,20 @@ export type { FetchGenesOptions } from './data/ucscApi';
|
|
|
83
91
|
export { fetchSequence } from './data/ucscSequence';
|
|
84
92
|
export type { FetchSequenceOptions } from './data/ucscSequence';
|
|
85
93
|
export { createCachedSequence } from './data/cachedSequence';
|
|
94
|
+
export { searchWebService, parseSearchResults } from './data/searchService';
|
|
95
|
+
export type { SearchResult } from './data/searchService';
|
|
86
96
|
export { fetchBigWigFeatures, fetchBigWigWGFeatures, clearBigWigCache, BigWigReader } from './bigwig';
|
|
87
97
|
export type { FetchBigWigOptions, BigWigHeader, BigWigTotalSummary } from './bigwig';
|
|
88
98
|
export { fetchGtxFeatures, fetchGtxWGFeatures, fetchGtxMultiFeatures, clearGtxCache, GtxReader } from './gtx';
|
|
89
99
|
export type { FetchGtxOptions, GtxHeader, ChromEntry, ExperimentEntry } from './gtx';
|
|
90
100
|
export { TabixReader } from './tabix';
|
|
91
101
|
export type { TabixReaderOptions, TabixHeader } from './tabix';
|
|
92
|
-
export { BinaryParser } from './io/binaryParser';
|
|
93
|
-
export { fetchRange, BufferedRangeReader } from './io/rangeReader';
|
|
94
|
-
export type { ByteRange } from './io/rangeReader';
|
|
95
102
|
export { BigWigDataSource } from './dataSources/bigWigDataSource';
|
|
96
103
|
export { GtxDataSource } from './dataSources/gtxDataSource';
|
|
97
104
|
export { GeneDataSource } from './dataSources/geneDataSource';
|
|
98
105
|
export { TextFeatureSource } from './dataSources/textFeatureSource';
|
|
99
106
|
export type { TextFeatureSourceConfig } from './dataSources/textFeatureSource';
|
|
100
|
-
export { SequenceDataSource } from './dataSources/sequenceDataSource';
|
|
107
|
+
export { SequenceDataSource, DEFAULT_BPP_SEQUENCE_THRESHOLD } from './dataSources/sequenceDataSource';
|
|
101
108
|
export { MemoryDataSource } from './dataSources/memoryDataSource';
|
|
102
109
|
export { createFeatureSource } from './dataSources/featureSourceFactory';
|
|
103
110
|
export type { FeatureSourceConfig, FeatureSourceResult } from './dataSources/featureSourceFactory';
|
|
@@ -117,8 +124,8 @@ export { renderROIOverlays } from './roi';
|
|
|
117
124
|
export type { ROIRenderOptions } from './roi';
|
|
118
125
|
export { registerTrackCreator, registerTypeAlias, getTrackCreator, knownTrackTypes, createTrackFromConfig, } from './trackRegistry';
|
|
119
126
|
export type { TrackCreatorContext, TrackCreator, CreatedTrack } from './trackRegistry';
|
|
120
|
-
export { SESSION_VERSION,
|
|
121
|
-
export type {
|
|
127
|
+
export { SESSION_VERSION, createTrackFromSession, fromIgvSession, toIgvSession, } from './browser/headless/session';
|
|
128
|
+
export type { CreateTrackFromSessionOptions } from './browser/headless/session';
|
|
122
129
|
export { StateProjection } from './stateProjection';
|
|
123
130
|
export type { ZoomLevel, TrackSummary, ProjectedState, StateDiff, TrackChangeDiff, GetStateOptions } from './stateProjection';
|
|
124
131
|
export { matchesSelector, selectTracks } from './trackSelector';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured logger for the Loom genome browser.
|
|
3
|
+
*
|
|
4
|
+
* Replaces scattered `console.log/warn/error` calls with a level-gated logger
|
|
5
|
+
* that can be silenced or redirected by consumers.
|
|
6
|
+
*
|
|
7
|
+
* Default level: 'warn' — only warnings and errors are logged.
|
|
8
|
+
* Call `setLogLevel('silent')` to suppress all output in production.
|
|
9
|
+
*/
|
|
10
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
11
|
+
/** Set the minimum log level. Messages below this level are suppressed. */
|
|
12
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
13
|
+
/** Get the current log level. */
|
|
14
|
+
export declare function getLogLevel(): LogLevel;
|
|
15
|
+
export declare const log: {
|
|
16
|
+
debug(...args: unknown[]): void;
|
|
17
|
+
info(...args: unknown[]): void;
|
|
18
|
+
warn(...args: unknown[]): void;
|
|
19
|
+
error(...args: unknown[]): void;
|
|
20
|
+
};
|