@sjcrh/proteinpaint-types 2.87.0 → 2.87.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/dataset.ts +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.87.0",
3
+ "version": "2.87.1",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Mclass } from './Mclass.ts'
1
+ import type { Mclass } from './Mclass.ts'
2
2
 
3
3
  /*** General usage types ***/
4
4
  type FileObj = {
@@ -1188,7 +1188,6 @@ type AssayAvailability = {
1188
1188
 
1189
1189
  //Shared with genome.ts
1190
1190
  export type Cohort = {
1191
- allowedChartTypes?: string[]
1192
1191
  cumburden?: {
1193
1192
  files: {
1194
1193
  fit: string
@@ -1545,6 +1544,16 @@ export type PreInit = {
1545
1544
  }
1546
1545
  }
1547
1546
 
1547
+ /** supply "isSupported()" kind of callback per chart type,
1548
+ that will overwrite default logic in getSupportedChartTypes()
1549
+ - the callback can have arbitrary logic based on requirements from this ds
1550
+ - can supply ()=>false to hide charts that will otherwise shown
1551
+ - can define arbitrary chart type names for purpose-specific charts
1552
+ */
1553
+ export type isSupportedChartCallbacks = {
1554
+ [chartType: string]: (f: any, auth: any) => boolean | undefined
1555
+ }
1556
+
1548
1557
  export type Mds3 = BaseMds & {
1549
1558
  label?: Title
1550
1559
  isMds3: boolean
@@ -1555,6 +1564,7 @@ export type Mds3 = BaseMds & {
1555
1564
  dsinfo?: KeyVal[]
1556
1565
  queries?: Mds3Queries
1557
1566
  cohort?: Cohort
1567
+ isSupportedChartOverride?: isSupportedChartCallbacks
1558
1568
  // TODO: termdb should be nested under cohort
1559
1569
  termdb?: Termdb
1560
1570
  validate_filter0?: (f: any) => void