Skip to content

Commit

Permalink
relax some too strict type bounds
Browse files Browse the repository at this point in the history
Signed-off-by: eternal-flame-AD <[email protected]>
  • Loading branch information
eternal-flame-AD committed Sep 2, 2024
1 parent a9fceda commit 3f38ef7
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions js/igv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type TrackLoad<T extends TrackType> =
T extends "mut" ? (Tracks.MutationTrackOptions & Tracks.TypeFormatPair<'mut', Tracks.MutationFormat>) :
T extends "seg" ? (Tracks.SegTrackOptions & Tracks.TypeFormatPair<'seg', Tracks.SegFormat>) :
T extends "gwas" ? (Tracks.GWASTrackOptions<Tracks.GWASFormat> & Tracks.TypeFormatPair<'gwas', Tracks.GWASFormat>) :
T extends "interact" ? (Tracks.InteractTrackOptions & Tracks.TypeFormatPair<'interact' | 'interaction', Tracks.InteractFormat>) :
T extends "interact" | "interaction" ? (Tracks.InteractTrackOptions & Tracks.TypeFormatPair<'interact' | 'interaction', Tracks.InteractFormat>) :
T extends "qtl" ? (Tracks.QTLTrackOptions & Tracks.TypeFormatPair<'qtl', Tracks.QTLFormat>) :
T extends "junction" ? (Tracks.JunctionTrackOptions & Tracks.TypeFormatPair<'junction', Tracks.JunctionFormat>) :
T extends "cnvpytor" ? (Tracks.CnvPyTorTrackOptions & Tracks.TypeFormatPair<'cnvpytor', Tracks.CnvPyTorFormat>) :
Expand Down Expand Up @@ -469,7 +469,7 @@ export namespace Tracks {
} | ({
features?: never;
source?: never;
} & Pick<TrackCommonOptions, 'url'>) |
} & Required<Pick<TrackCommonOptions, 'url'>>) |
{
source: StaticFeatureConfig<{
chr: string;
Expand Down Expand Up @@ -656,25 +656,6 @@ export interface ReferenceGenome {
wholeGenomeView?: boolean;
}

interface GenomeFrag {
/**
* String identifier defining genome (e.g. "hg19"). See Reference Genome for details and list of supported identifiers. Note: One (but only one) of either genome or reference properties must be set.
*
* @type {string}
*/
genome: HostedGenomes | (string & {});
reference?: never;
}
interface ReferenceFrag {
/**
* Object defining reference genome. See Reference Genome for details. Note: One (but only one) of either genome or reference properties must be set.
*
* @type {ReferenceGenome}
*/
reference: ReferenceGenome;
genome?: never;
}

interface CreateOptExtras {
/**
*
Expand Down Expand Up @@ -745,7 +726,7 @@ export namespace BrowserEvents {
popoverData?: Record<string, string>,
) => EventReturn<T> :
T extends "trackorderchanged" ? (trackNames: string[]) => EventReturn<T> :
never;
(payload: any) => EventReturn<T>;

export type EventReturn<T extends EventType> =
T extends "trackclick" ? boolean :
Expand Down

0 comments on commit 3f38ef7

Please sign in to comment.