UNPKG

higlass

Version:

HiGlass Hi-C / genomic / large data viewer

45 lines (44 loc) 1.57 kB
export default fillInMinWidths; export type CompleteTracks = { center: Array<t.TrackConfig>; left: Array<t.TrackConfig>; right: Array<t.TrackConfig>; top: Array<t.TrackConfig>; bottom: Array<t.TrackConfig>; whole: Array<t.TrackConfig>; gallery: Array<t.TrackConfig>; }; export type WithMinWidth<K extends t.TrackPosition, T extends Array<t.TrackConfig>> = Array<T[number] & { width: number; }>; /** @import * as t from '../types' */ /** * @typedef CompleteTracks * @property {Array<t.TrackConfig>} center * @property {Array<t.TrackConfig>} left * @property {Array<t.TrackConfig>} right * @property {Array<t.TrackConfig>} top * @property {Array<t.TrackConfig>} bottom * @property {Array<t.TrackConfig>} whole * @property {Array<t.TrackConfig>} gallery */ /** * @template {t.TrackPosition} K * @template {Array<t.TrackConfig>} T * @typedef {Array<T[number] & { width: number }>} WithMinWidth */ /** * If tracks don't have specified dimensions, add in the known minimums * * WARNING: Mutates `tracks` argument * * @template {Partial<CompleteTracks>} T * @param {T} tracks * @returns {{ * [K in t.TrackPosition]: K extends keyof T ? T[K] extends undefined ? Array<t.TrackConfig> : T[K] : Array<t.TrackConfig> * }} * * Operates on the tracks stored for this TiledPlot. */ declare function fillInMinWidths<T extends Partial<CompleteTracks>>(tracks: T): { [K in t.TrackPosition]: K extends keyof T ? T[K] extends undefined ? Array<t.TrackConfig> : T[K] : Array<t.TrackConfig>; }; import type * as t from '../types';