diff --git a/js/igv.d.ts b/js/igv.d.ts new file mode 100644 index 000000000..e93f8b342 --- /dev/null +++ b/js/igv.d.ts @@ -0,0 +1,772 @@ +// either uppercase or lowercase +type AnyCase = Uppercase | Lowercase; + +// any action that can be deferred as a promise or a thenable +type Deferrable = T | Promise | Thenable | (() => T | Promise | Thenable); + +// a custom future implementation supported by igv.js +export interface Thenable { + then(resolve: (value: T) => void, reject: (error: E) => void): void; +} + +// simply prevents the type from being inferred +declare class Opaque { + private readonly __opaque_brand: N; +} + +export type TrackType = + "annotation" | "wig" | "alignment" | "variant" | "mut" | "seg" | + "gwas" | "interact" | 'interaction' | "qtl" | "junction" | "cnvpytor" | "merged" | "arc" | + /* undocumented options */ + "snp" | "eqtl"; + +// converts a track type into the options needed to create it +export type TrackLoad = + Tracks.TrackCommonOptions & + (T extends "annotation" ? Tracks.AnnotationTrackOptions & TypeFormatPair<'annotation'> : + T extends "wig" ? Tracks.WigTrackOptions & TypeFormatPair<'wig'> : + T extends "alignment" ? Tracks.AlignmentTrackOptions & TypeFormatPair<'alignment'> : + T extends "variant" ? Tracks.VariantTrackOptions & TypeFormatPair<'variant'> : + T extends "mut" ? Tracks.MutationTrackOptions & TypeFormatPair<'mut'> : + T extends "seg" ? Tracks.SegTrackOptions & TypeFormatPair<'seg'> : + T extends "gwas" ? Tracks.GWASTrackOptions & TypeFormatPair<'gwas'> : + T extends "interact" | "interaction" ? Tracks.InteractTrackOptions & TypeFormatPair<'interact' | 'interaction'> : + T extends "qtl" ? Tracks.QTLTrackOptions & TypeFormatPair<'qtl'> : + T extends "junction" ? Tracks.JunctionTrackOptions & TypeFormatPair<'junction'> : + T extends "cnvpytor" ? Tracks.CnvPyTorTrackOptions & TypeFormatPair<'cnvpytor'> : + T extends "merged" ? Tracks.WigMergedTrackOptions & { type: 'merged' } : + T extends "arc" ? Tracks.ArcTrackOptions & TypeFormatPair<'arc'> : + /* undocumented options */ + T extends "snp" ? Tracks.SNPTrackOptions & TypeFormatPair<'snp'> : + T extends "eqtl" ? Tracks.EQTLTrackOptions & TypeFormatPair<'eqtl'> : + never); + +export type TypeFormatPair = { + type?: T; + // if we know the format, type is not required + format: TrackFormatOf; + // in this case URL can be anything + url: Deferrable; +} | { + type?: T; + format?: TrackFormatOf; + // if we can infer the URL, we do not need type or format + url: TrackFormatOf extends string ? Deferrable>> : never; +} | ({ + // an explicit type and manual reader is allowed, however format and url will not make sense in this context + type: T; + format?: never; + url?: never; +} & (CustomReaderOf | ManualFeatureOf)) | { + type: T; + format?: TrackFormatOf; + // if there is only one possible format, we permit format to be omitted + url: TrackFormatOf extends string ? (string extends TrackFormatOf ? never : Deferrable>>) : never; +}; + +// converts a track type into the file formats that it can accept +export type TrackFormatOf = + T extends "annotation" ? Tracks.AnnotationFormat : + T extends "wig" ? Tracks.WigFormat : + T extends "alignment" ? Tracks.AlignmentFormat : + T extends "variant" ? Tracks.VariantFormat : + T extends "mut" ? Tracks.MutationFormat : + T extends "seg" ? Tracks.SegFormat : + T extends "gwas" ? Tracks.GWASFormat : + T extends "interact" | 'interaction' ? Tracks.InteractFormat : + T extends "qtl" ? Tracks.QTLFormat : + T extends "junction" ? Tracks.JunctionFormat : + T extends "cnvpytor" ? Tracks.CnvPyTorFormat : + T extends "arc" ? Tracks.ArcFormat : + /* undocumented options */ + T extends "snp" ? Tracks.SNPFormat : + T extends "eqtl" ? Tracks.EQTLFormat : + never; + +// converts a track type into the manual features that it can accept +export type ManualFeatureOf = + T extends "annotation" ? { + features: Record[]; + } : + T extends "wig" ? { + features: Tracks.WigTrackManualFeatures; + } : + T extends "seg" ? { + features: { + chr: string; + start: number; + end: number; + value: number; + sample: string; + }[]; + } : never; + +// some tracks can support a custom reader that polls data based on options +export type CustomReaderOf = + T extends "annotation" ? { reader: Tracks.AnnotationCustomReader } | + { + source: { + url: string; + method?: "GET" | "POST"; + contentType?: string; + body?: string; + } + } : + T extends "seg" ? { + source: { + url: (options: { chr: string }) => string; + method?: "GET" | "POST"; + contentType?: string; + body?: string; + mappings: Record; + } + } : + never; + +// converts a track type into the actual track class +export type TrackOf = + T extends "annotation" ? Tracks.Track : + T extends "wig" ? Tracks.Track : + T extends "alignment" ? Tracks.AlignmentTrack : + T extends "variant" ? Tracks.Track : + T extends "mut" ? Tracks.Track : + T extends "seg" ? Tracks.Track : + T extends "gwas" ? Tracks.Track : + T extends "interact" | 'interaction' ? Tracks.Track : + T extends "qtl" ? Tracks.Track : + T extends "junction" ? Tracks.Track : + T extends "cnvpytor" ? Tracks.Track : + T extends "merged" ? Tracks.Track : + T extends "arc" ? Tracks.Track : + /* undocumented options */ + T extends "snp" ? Tracks.Track : + T extends "eqtl" ? Tracks.Track : + never; + + +export type StaticFeatureConfig> = { + url(options: T): string; + method?: "GET" | "POST"; + contentType?: string; + body?: string; + mappings: Record; +} + +// ref: https://github.com/igvteam/igv-utils/blob/master/src/fileUtils.js +export namespace URLInference { + type StripLast = S extends `${infer _}${SEP}${infer P}` ? StripLast : S; + type StripQuery = S extends `${infer P}?${infer _}` ? P : S; + type StripSuffix = S extends `${infer P}.${T}` ? P : S; + + export type FilenameOfURL = StripLast, '/'> + + type AuxExtensions = ".gz" | ".tab" | ".txt" | ".bgz"; + + // infer the extension of a URL, with auxillary extensions stripped + export type InferExtension = Lowercase extends `${infer B}${AuxExtensions}` ? StripLast : StripLast, '.'> + + type Query = `?${string}`; + + // matches a URL with an extension + export type URLWithExtension = + `${string}.${E}${AuxExtensions | ''}${Query | ''}`; +} + +export namespace Tracks { + export class Track { + public readonly id: string; + public readonly type: string; + public readonly name?: string; + } + + + export interface TrackCommonOptions { + name?: string; + indexURL?: string | Promise; + indexed?: false; + order?: number; + height?: number; + autoHeight?: boolean; + minHeight?: number; + maxHeight?: number; + visibilityWindow?: number | string; + removable?: boolean; + headers?: Record; + oauthToken?: string | (() => string | Promise); + sourceType?: string; + filename?: string; + roi?: DefineROI[]; + } + + export class AnnotationCustomReader { + constructor(config: TrackCommonOptions & AnnotationTrackOptions); + readFeatures(chr: string, start: number, end: number): Promise[]>; + } + + export type AnnotationFormat = "bed" | "gff3" | "gtf" | + "genePred" | "genePredExt" | "peaks" | + "narrowPeak" | "broadPeak" | "bigBed" | "bedpe" | "rmsk" | "vcf" | + "gtexgwas"; + + export type AnnotationTrackDisplay = { + displayMode: AnyCase<"EXPANDED"> + expandedRowHeight?: number, + } | { + displayMode: AnyCase<"SQUISHED"> + squishedRowHeight: number, + } | { + displayMode?: AnyCase<"COLLAPSED"> + } + + export type AnnotationTrackSearch = { + searchable: true, + searchableFields: string[], + } | { + searchable?: false, + } + + export interface AnnotationTrackCommonOptions { + nameField?: string; + maxRows?: number; + filterTypes?: string[]; + color?: string | ((feature: { + chr: string; + getAttributeValue: (name: string) => string; + }) => string); + colorBy?: string; + altColor?: string, rBy?: string, + colorTable?: Record, + } + + export type AnnotationTrackOptions = AnnotationTrackDisplay & AnnotationTrackSearch & AnnotationTrackCommonOptions; + + export type WigFormat = AnyCase<"wig"> | "bigWig" | AnyCase<'bigWig'> | AnyCase<'tdf'> | AnyCase<'bw'>; + + export interface WigTrackOptions { + autoscale?: boolean; + autoscaleGroup?: string; + min?: number; + max?: number; + color?: string, + altColor?: string, + guidelines?: { color: string, y: number, dotted: boolean }[]; + graphType?: "points" | "bar"; + flipAxis?: boolean; + windowFunction?: "mean" | "max" | "min"; + + height?: number; + + displayMode?: AnyCase<"EXPANDED" | "SQUISHED" | "COLLAPSED">; + } + + export type WigTrackManualFeatures = { + chr: string; + start: number; + end: number; + value: number; + }[]; + + export type WigMergedTrackOptions = { + tracks: (Partial & ((TypeFormatPair<'wig'> & WigTrackOptions) | (TypeFormatPair<'junction'> & JunctionTrackOptions)))[]; + }; + + export type VariantFormat = "vcf"; + + export type VCFItem = { + chrom: string; + pos: number; + id: string; + ref: string; + alt: string; + qual: number; + filter: string; + info: Record; + } + + export type VariantTrackOptions = { + displayMode?: AnyCase<"EXPANDED" | "SQUISHED" | "COLLAPSED">; + squishedCallHeight?: number; + expandedCallHeight?: number; + color?: string | ((variant: VCFItem) => string); + colorBy?: string; + colorTable?: Record; + noCallColor?: string; + homvarColor?: string; + hetvarColor?: string; + homrefColor?: string; + supportsWholeGenome?: boolean; + showGenotypes?: boolean; + strokecolor?: (variant: VCFItem) => string | void; + context_hook?: (variant: VCFItem, ctx: Draw.CanvasContext, x: number, y: number, w: number, h: number) => void; + }; + + export type CnvPyTorFormat = "pytor" | "vcf"; + + export type CnvPyTorTrackOptions = { + signal_name?: string; + cnv_caller?: "ReadDepth" | "2D"; + bin_size?: number; + colors?: string[]; + } + + export type AlignmentFormat = "bam" | "cram"; + + type AlignmentBy = (string & {}) // tag:tagName and base:position + + export type AlignmentSortOptions = { + chr: string; + position: number; + direction?: "ASC" | "DESC"; + } & ({ + option: "BASE" | "STRAND" | "INSERT_SIZE" | "MATR_CHR" | "MQ"; + } | { + option: "TAG"; + tag: string; + }); + + export type AlignmentTrackOptions = { + showCoverage?: boolean; + showAlignments?: boolean; + viewAsPairs?: boolean; + pairsSupported?: boolean; + coverageColor?: string; + color?: string; + deletionColor?: string; + displayMode?: AnyCase<"FULL" | "EXPANDED" | "SQUISHED">; + groupBy?: + "strand" | "firstOfPairStrand" | "pairOrientation" | "mateChr" | "chimeric" | "supplementary" | "readOrder" | AlignmentBy; + samplingWindowSize?: number; + samplingDepth?: number; + readGroup?: string; + sort?: AlignmentSortOptions; + filter?: { + vendorFailed?: boolean; + duplicates?: boolean; + secondary?: boolean; + supplementary?: boolean; + mq?: number; + readGroups?: string[]; + }; + showSoftClips?: boolean; + showMismatches?: boolean; + showAllBases?: boolean; + showInsertionText?: boolean; + insertionTextColor?: string; + alignmentRowHeight?: number; + squishedRowHeight?: number; + } & ( + { + colorBy: "strand" | "firstOfPairStrand"; + insertionColor?: string; + negStrandColor?: string; + } | + { + colorBy: "pairOrientation" | "tlen" + | "unexpectedPair" + | "basemod" | "basemod2" + | AlignmentBy; + } | + { + colorBy?: "fragmentLength"; + }); + + + class AlignmentTrack extends Track { + setHighlightedReads(readNames: string[], color: string): void; + sort(options: AlignmentSortOptions): void; + } + + export type GWASFormat = "gwas" | "bed"; + + export type GWASTrackOptions = { + min?: number; + max?: number; + posteriorProbability?: boolean; + dotSize?: number; + colorTable?: Record; + columns?: F extends "gwas" ? { + chromosome: number; + position: number; + value: number; + } : never; + } + + export type MutationFormat = "maf" | "mut"; + + export type MutationTrackOptions = { + displayMode?: AnyCase<"EXPANDED" | "SQUISHED" | "COLLAPSED">; + } + + export type SegFormat = "seg"; + + export type SegTrackOptions = { + displayMode?: AnyCase<"EXPANDED" | "SQUISHED" | "FILL">; + sort?: ({ + option: "value" | "VALUE"; + } | { + option: "attribute" | "ATTRIBUTE"; + attribute: string; + }); + samples?: string[]; + } & ( + { + isLog?: boolean; + log?: never; + } | { + log?: boolean; + isLog?: never; + }); + + + export type InteractFormat = "interact" | "bedpe" | "bigInteract" | "bb"; + + export type InteractTrackOptions = { + arcType?: "nested" | "proportional" | "inView" | "partialInView"; + arcOrientation?: "UP" | "DOWN" | boolean; + color?: string; + alpha?: number | string; + logScale?: boolean; + showBlocks?: boolean; + thickness?: number; + useScore?: boolean; + max?: number; + } + + export type QTLFormat = "qtl"; + + export type QTLTrackOptions = { + min?: number; + max?: number; + autoscalePercentile?: number; + } + + export type JunctionFormat = "bed"; + + export type JunctionTrackFilteringOptions = { + minUniquelyMappedReads?: number; + minTotalReads?: number; + maxFractionMultiMappedReads?: number; + minSplicedAlignmentOverhang?: number; + hideStrand?: "+" | "-"; + hideAnnotatedJunctions?: boolean; + hideUnannotatedJunctions?: boolean; + hideMotifs?: string[]; + } + + export type JunctionTrackOptions = ({ + colorBy?: "numUniqueReads" | "numReads"; + colorByNumReadsThreshold: number; + } | { + colorBy: "isAnnotatedJunction" | "strand" | "motif"; + colorByNumReadsThreshold?: never; + }) & { + displayMode?: AnyCase<"COLLAPSED" | "EXPANDED" | "SQUISHED">; + thicknessBasedOn?: "numUniqueReads" | "numReads" | "isAnnotatedJunction"; + bounceHeightBasedOn?: "random" | "distance" | "thickness"; + labelUniqueReadCount?: boolean; + labelMultiMappedReadCount?: boolean; + labelTotalReadCount?: boolean; + labelMotif?: boolean; + // TODO: documented but not implemented? + // labelAnnotatedJunction?: string | null; + minSplicedAlignmentOverhang?: number; + } & JunctionTrackFilteringOptions; + + export type ArcFormat = "bp"; + + export type ArcTrackOptions = { + arcOrientation?: "UP" | "DOWN"; + } + + // TODO: undocumented + export type SNPFormat = "snp"; + + export interface SNPTrackOptions { + } + + export type EQTLFormat = "eqtl"; + + export interface EQTLTrackOptions { + sourceType: "gtex-ws"; + tissueSiteDetailId: string; + } +} + +type Nucleotide = 'A' | 'C' | 'G' | 'T' | 'N'; + +type HostedGenomes = "hs1" | "chm13v1.1" | "hg38" | "hg38_1kg" | "hg19" | + "hg18" | "mm39" | "mm10" | "mm9" | "rn7" | + "rn6" | "gorGor6" | "gorGor4" | "panTro6" | "panTro5" | + "panTro4" | "macFas5" | "GCA_011100615.1" | "panPan2" | "canFam3" | + "canFam4" | "canFam5" | "bosTau9" | "bosTau8" | "susScr11" | + "galGal6" | "GCF_016699485.2" | "danRer11" | "danRer10" | "ce11" | + "dm6" | "dm3" | "dmel_r5.9" | "sacCer3" | "ASM294v2" | + "ASM985889v3" | "tair10" | "GCA_003086295.2" | "GCF_001433935.1" | "NC_016856.1" | + "GCA_000182895.1" + +export type GenomeDef = (HostedGenomes | (string & {})) | ReferenceGenome; + +export type GenomeOpt = { reference: GenomeDef, genome?: never } | { genome: GenomeDef, reference?: never }; + +/** + * To define or customize a reference genome the reference property can be used. + */ +export interface ReferenceGenome { + id?: string; + name?: string; + fastaURL: string; + indexURL?: string; + cytobandURL?: string; + aliasURL?: string; + /** + * @deprecated + */ + indexed?: true; + chromosomeOrder?: string[]; + headers?: Record; + wholeGenomeView?: boolean; +} + +interface CreateOptExtras { + supportQueryParameters?: boolean; + queryParametersSupported?: boolean; + + showNavigation?: boolean; + + showSampleNames?: boolean; + sampleNameViewportWidth?: number; + locus?: string | string[]; + nucleotideColors?: Partial>; + + roi?: DefineROI[]; + tracks?: TrackLoad[]; + + search?: { + url: string; + chromosomeField: string; + displayName: string; + }; +} + +export namespace BrowserEvents { + export type EventType = "trackremoved" | "trackdrag" | "trackdragend" | "locuschange" | "trackclick" | "trackorderchanged"; + + // returns the type of the event handler based on the event type + export type EventHandler = + T extends "trackremoved" ? (tracks: Tracks.Track[]) => EventReturn : + T extends "locusChange" ? (loci: { + chr: string; + start: number; + end: number; + getLocusString: () => string; + }[]) => EventReturn : + T extends "trackclick" ? ( + track: Tracks.Track, + popoverData?: Record, + ) => EventReturn : + T extends "trackorderchanged" ? (trackNames: string[]) => EventReturn : + (payload: any) => EventReturn; + + export type EventReturn = + T extends "trackclick" ? boolean : + void; +} + +export type CreateOpt = (GenomeOpt & CreateOptExtras) | ( + // if a session URL is provided, we do not need a complete definition, additionally we should not allow a different genome + { + sessionURL: string; + } & Partial +) + +export interface ROISet { + url: string; + name: string; + indexed: boolean; + isUserDefined: boolean; + color: string; + headerColor: string; + isvisible: boolean; + chr: string; + start: number; + end: number; +} + +export type DefineROI = { + name?: string; + color: string; +} & ({ + url: string; + indexed?: boolean; + format?: string; +} | { + features: { + chr: string; + start: number; + end: number; + }[] +}); + + +declare class _Browser { + currentLoci(): string[] | string; + loadGenome(genome: string | ReferenceGenome): Promise; + loadSessionObject(session: Opaque<'igv.js session JSON'>): void; + loadSession(session: string): void; + loadTrack(track: TrackLoad): Promise>; + loadSampleInfo({ url: string }): void; + findTracks(func: (track: Tracks.Track) => boolean): Tracks.Track[]; + findTracks(property: string, value: any): Tracks.Track[]; + removeTrack(track: Tracks.Track): void; + removeTrackByName(trackName: string): void; + loadROI(roi: DefineROI | DefineROI[]): void; + clearROIs(): void; + getUserDefinedROIs(): Promise; + search(query: string): void; + zoomIn(): void; + zoomOut(): void; + visibilityChange(): void; + toJSON(): Opaque<'igv.js session JSON'>; + compressedSession(): string; + toSVG(): string; + setCustomCursorGuideMouseHandler(handler: (state: { + bp: number, + start: number, + end: number, + interpolant: number, + }) => void): void; + + sessionURL(): string; + + on(event: T, handler: BrowserEvents.EventHandler): void; + off(event: BrowserEvents.EventType): void; +} + +export type Browser = _Browser; + +type CreateBrowser = (div: HTMLElement, options: CreateOpt) => Promise; + +export type GlobalConfig = { + minimumBases: number; + showIdeogram: boolean; + showCircularView: boolean; + showCircularViewButton: boolean; + showTrackLabelButton: boolean; + showTrackLabels: boolean; + doShowROITableButton: boolean; + showROITable: boolean; + showCursorTrackingGuideButton: boolean; + showCursorTrackingGuide: boolean; + showCenterGuideButton: boolean; + showCenterGuide: boolean; + showSampleNames: boolean; + showSVGButton: boolean; + showControls: boolean; + showNavigation: boolean; + showRuler: boolean; + flanking: number; + pairsSupported: boolean; + tracks: TrackLoad[]; +} + + +export type IGV = { + readonly setDefaults: (config: Partial) => void; + /** + * Create an igv.browser instance. This object defines the public API for interacting with the genome browser. + * + * @param parentDiv - DOM tree root + * @param config - configuration options. + * + */ + readonly createBrowser: CreateBrowser; + readonly removeBrowser: (browser: Browser) => void; + readonly removeAllBrowsers: () => void; + readonly setApiKey: (apiKey: string) => void; + readonly setGoogleOauthToken: (token: string) => void; + readonly setOauthToken: (token: string, host: string) => void; + readonly getAllBrowsers: () => Browser[]; + /** + * This function provided so clients can inform igv of a visibility change, typically when an igv instance is + * made visible from a tab, accordion, or similar widget. + */ + readonly visibilityChange: () => Promise; + readonly version: () => string; +} + +declare namespace Draw { + // ref: canvas2svg.js + export class CanvasContext { + public readonly canvas: this; + public readonly isSVG: boolean; + + public strokeStyle: string; + public lineWidth: number; + + private constructor(config: { + ctx?: any; + width?: number; + height?: number; + enableMirroring?: boolean; + viewBox?: { + x: number; + y: number; + width: number; + height: number; + }; + multiLocusGap?: any; + backdropColor?: string; + document?: Document; + }); + setWidth(width: number): void; + setHeight(height: number): void; + getSerializedSvg(fixNamedEntitles?: boolean): string; + getSvg(): SVGSVGElement; + saveWithTranslationAndClipRect(id: string, tx: number, ty: number, width: number, height: number, clipYOffset: number): void; + save(): void; + restore(): void; + addTrackGroupWithTranslationAndClipRect( + id: string, + tx: number, + ty: number, + width: number, + height: number, + clipYOffset: number, + ) + scale(x: number, y: number): void; + rotate(angle: number): void; + translate(x: number, y: number): void; + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + beginPath(): void; + moveTo(x: number, y: number): void; + closePath(): void; + lineTo(x: number, y: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + quadraticCurveTo(cp1x: number, cp1y: number, x: number, y: number): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + stroke(): void; + fill(): void; + rect(x: number, y: number, w: number, h: number): void; + fillRect(x: number, y: number, w: number, h: number): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeEllipse(cx: number, cy: number, rx: number, ry: number, + rotation: number, startAngle: number, endAngle: number, + isCCW: boolean): void; + fillEllipse(cx: number, cy: number, rx: number, ry: number, + rotation: number, startAngle: number, endAngle: number, + isCCW: boolean): void; + clearRect(x: number, y: number, w: number, h: number): void; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + strokeText(text: string, x: number, y: number): void; + measureText(text: string): TextMetrics; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + clip(): void; + drawImage(); + createPattern(image: CanvasImageSource, repetition?: string): CanvasPattern; + } +} + +declare const igv: IGV; + +export default igv; diff --git a/package.json b/package.json index cf9426559..22cff4d2f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "main": "dist/igv.esm.js", "browser": "dist/igv.js", "module": "dist/igv.esm.js", + "types": "dist/igv.d.ts", "type": "module", "description": "Embeddable genomic visualization component based on the Integrative Genomics Viewer", "files": [ @@ -12,8 +13,8 @@ "scripts": { "prepack": "npm run build", "prepare": "npm run build", - "build": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config", - "build_iife": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config rollup.config.iife.js", + "build": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config && cp js/igv.d.ts dist/igv.d.ts", + "build_iife": "node scripts/updateVersion.cjs && node scripts/generateEmbedCss.cjs && npx rollup --config rollup.config.iife.js && cp js/igv.d.ts dist/igv.d.ts", "updateCSS": "node scripts/generateEmbedCss.cjs", "test": "node test/utils/forceESM.cjs && mocha -ui tdd" }, @@ -58,9 +59,9 @@ "igv-utils": "github:igvteam/igv-utils#v1.5.8", "mocha": "^10.2.0", "rollup": "^2.66.0", - "rollup-plugin-copy": "^3.3.0", + "rollup-plugin-copy": "^3.5.0", "sass": "^1.45.1", "vanilla-picker": "^2.12.1", "w3c-xmlhttprequest": "^3.0.0" } -} +} \ No newline at end of file