@sjcrh/proteinpaint-types 2.83.0 → 2.85.0

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 (135) hide show
  1. package/dist/routes.ts +28847 -0
  2. package/package.json +17 -11
  3. package/src/Mclass.js +0 -0
  4. package/src/checkers/routes.js +167 -0
  5. package/src/dataset.js +0 -0
  6. package/src/fileOrUrl.js +0 -0
  7. package/src/filter.js +0 -0
  8. package/src/genome.js +0 -0
  9. package/src/index.js +66 -0
  10. package/src/routes/brainImaging.js +11 -0
  11. package/src/routes/brainImagingSamples.js +11 -0
  12. package/src/routes/burden.js +44 -0
  13. package/src/routes/dataset.js +12 -0
  14. package/src/routes/dsdata.js +12 -0
  15. package/src/routes/dzimages.js +12 -0
  16. package/src/routes/errorResponse.js +0 -0
  17. package/src/routes/filter.gdc.js +0 -0
  18. package/src/routes/gdc.maf.js +17 -0
  19. package/src/routes/gdc.mafBuild.js +12 -0
  20. package/src/routes/gdc.topMutatedGenes.js +12 -0
  21. package/src/routes/genelookup.js +12 -0
  22. package/src/routes/genesetEnrichment.js +12 -0
  23. package/src/routes/genesetOverrepresentation.js +12 -0
  24. package/src/routes/healthcheck.js +23 -0
  25. package/src/routes/hicdata.js +12 -0
  26. package/src/routes/hicgenome.js +29 -0
  27. package/src/routes/hicstat.js +12 -0
  28. package/src/routes/isoformlst.js +12 -0
  29. package/src/routes/ntseq.js +12 -0
  30. package/src/routes/pdomain.js +12 -0
  31. package/src/routes/routeApi.js +0 -0
  32. package/src/routes/samplewsimages.js +12 -0
  33. package/src/routes/snp.js +11 -0
  34. package/src/routes/termdb.DE.js +13 -0
  35. package/src/routes/termdb.boxplot.js +12 -0
  36. package/src/routes/termdb.categories.js +48 -0
  37. package/src/routes/termdb.cluster.js +12 -0
  38. package/src/routes/termdb.cohort.summary.js +12 -0
  39. package/src/routes/termdb.cohorts.js +12 -0
  40. package/src/routes/termdb.descrstats.js +48 -0
  41. package/src/routes/termdb.numericcategories.js +12 -0
  42. package/src/routes/termdb.percentile.js +49 -0
  43. package/src/routes/termdb.rootterm.js +27 -0
  44. package/src/routes/termdb.sampleImages.js +12 -0
  45. package/src/routes/termdb.singleSampleMutation.js +12 -0
  46. package/src/routes/termdb.singlecellDEgenes.js +12 -0
  47. package/src/routes/termdb.singlecellData.js +12 -0
  48. package/src/routes/termdb.singlecellSamples.js +12 -0
  49. package/src/routes/termdb.termchildren.js +28 -0
  50. package/src/routes/termdb.termsbyids.js +12 -0
  51. package/src/routes/termdb.topTermsByType.js +12 -0
  52. package/src/routes/termdb.topVariablyExpressedGenes.js +12 -0
  53. package/src/routes/termdb.violin.js +49 -0
  54. package/src/routes/tileserver.js +12 -0
  55. package/src/routes/wsimages.js +12 -0
  56. package/src/terms/categorical.js +0 -0
  57. package/src/terms/condition.js +0 -0
  58. package/src/terms/geneExpression.js +0 -0
  59. package/src/terms/geneVariant.js +0 -0
  60. package/src/terms/metaboliteIntensity.js +0 -0
  61. package/src/terms/numeric.js +0 -0
  62. package/src/terms/q.js +0 -0
  63. package/src/terms/samplelst.js +0 -0
  64. package/src/terms/singleCellCellType.js +0 -0
  65. package/src/terms/singleCellGeneExpression.js +0 -0
  66. package/src/terms/snp.js +0 -0
  67. package/src/terms/snps.js +0 -0
  68. package/src/terms/term.js +0 -0
  69. package/src/terms/tw.js +0 -0
  70. package/src/terms/updated-types.js +0 -0
  71. package/src/termsetting.js +0 -0
  72. package/src/test/numeric.type.spec.js +117 -0
  73. package/src/vocab.js +0 -0
  74. package/src/Mclass.ts +0 -8
  75. package/src/dataset.ts +0 -1575
  76. package/src/docs.json +0 -16417
  77. package/src/fileOrUrl.ts +0 -15
  78. package/src/filter.ts +0 -125
  79. package/src/genome.ts +0 -123
  80. package/src/index.ts +0 -57
  81. package/src/routes/brainImaging.ts +0 -21
  82. package/src/routes/burden.ts +0 -69
  83. package/src/routes/dzimages.ts +0 -9
  84. package/src/routes/errorResponse.ts +0 -6
  85. package/src/routes/filter.gdc.ts +0 -15
  86. package/src/routes/gdc.maf.ts +0 -41
  87. package/src/routes/gdc.mafBuild.ts +0 -13
  88. package/src/routes/gdc.topMutatedGenes.ts +0 -25
  89. package/src/routes/genelookup.ts +0 -10
  90. package/src/routes/genesetEnrichment.ts +0 -46
  91. package/src/routes/genesetOverrepresentation.ts +0 -36
  92. package/src/routes/healthcheck.ts +0 -57
  93. package/src/routes/hicdata.ts +0 -37
  94. package/src/routes/hicgenome.ts +0 -22
  95. package/src/routes/hicstat.ts +0 -45
  96. package/src/routes/sampledzimages.ts +0 -1
  97. package/src/routes/samplewsimages.ts +0 -15
  98. package/src/routes/termdb.DE.ts +0 -44
  99. package/src/routes/termdb.boxplot.ts +0 -40
  100. package/src/routes/termdb.categories.ts +0 -26
  101. package/src/routes/termdb.cluster.ts +0 -86
  102. package/src/routes/termdb.getSampleImages.ts +0 -14
  103. package/src/routes/termdb.getTopTermsByType.ts +0 -21
  104. package/src/routes/termdb.getdescrstats.ts +0 -31
  105. package/src/routes/termdb.getnumericcategories.ts +0 -21
  106. package/src/routes/termdb.getpercentile.ts +0 -17
  107. package/src/routes/termdb.getrootterm.ts +0 -22
  108. package/src/routes/termdb.gettermchildren.ts +0 -21
  109. package/src/routes/termdb.singleSampleMutation.ts +0 -18
  110. package/src/routes/termdb.singlecellDEgenes.ts +0 -30
  111. package/src/routes/termdb.singlecellData.ts +0 -58
  112. package/src/routes/termdb.singlecellSamples.ts +0 -35
  113. package/src/routes/termdb.termsbyids.ts +0 -15
  114. package/src/routes/termdb.topVariablyExpressedGenes.ts +0 -45
  115. package/src/routes/termdb.violin.ts +0 -74
  116. package/src/routes/wsimages.ts +0 -12
  117. package/src/terms/categorical.ts +0 -106
  118. package/src/terms/condition.ts +0 -55
  119. package/src/terms/geneExpression.ts +0 -32
  120. package/src/terms/geneVariant.ts +0 -51
  121. package/src/terms/metaboliteIntensity.ts +0 -31
  122. package/src/terms/numeric.ts +0 -253
  123. package/src/terms/q.ts +0 -38
  124. package/src/terms/samplelst.ts +0 -41
  125. package/src/terms/singleCellCellType.ts +0 -22
  126. package/src/terms/singleCellGeneExpression.ts +0 -28
  127. package/src/terms/snp.ts +0 -28
  128. package/src/terms/snps.ts +0 -110
  129. package/src/terms/term.ts +0 -184
  130. package/src/terms/tw.ts +0 -38
  131. package/src/terms/updated-types.ts +0 -9
  132. package/src/termsetting.ts +0 -197
  133. package/src/test/numeric.type.spec.ts +0 -275
  134. package/src/typedoc.js +0 -30
  135. package/src/vocab.ts +0 -37
@@ -1,41 +0,0 @@
1
- import { BaseTerm, BaseQ } from './term.ts'
2
- import { TermWrapper } from './tw.ts'
3
- import { TermSettingInstance } from '../termsetting.ts'
4
-
5
- /*
6
- --------EXPORTED--------
7
- SampleLstTermValues
8
- SampleLstQ
9
- SampleLstTerm
10
- SampleLstTW
11
- SampleLstSettingInstance
12
-
13
- */
14
-
15
- export type SampleLstTermValues = {
16
- [index: string | number]: {
17
- name: string
18
- inuse: boolean
19
- list: { sampleId: string; sample: string }[]
20
- values: any
21
- }
22
- }
23
-
24
- export type SampleLstQ = BaseQ & {
25
- groups: SampleLstTermValues
26
- }
27
-
28
- export type SampleLstTerm = BaseTerm & {
29
- values: SampleLstTermValues
30
- }
31
-
32
- export type SampleLstTW = TermWrapper & {
33
- q: SampleLstQ
34
- term: SampleLstTerm
35
- }
36
-
37
- //temporary, will eventually change to SampleLstHandler
38
- export type SampleLstTermSettingInstance = TermSettingInstance & {
39
- q: SampleLstQ
40
- term: SampleLstTerm
41
- }
@@ -1,22 +0,0 @@
1
- import { BaseTerm, BaseTW, GroupSettingQ, TermGroupSetting, TermValues } from './term.ts'
2
- import { MinBaseQ } from './q.ts'
3
-
4
- type SingleCellCellTypeBaseQ = MinBaseQ & { mode: 'discrete' | 'binary' }
5
-
6
- export type SingleCellCellTypeQ = SingleCellCellTypeBaseQ & GroupSettingQ
7
-
8
- export type SingleCellCellTypeTerm = BaseTerm & {
9
- type: 'singleCellCellType'
10
- /** the cell types may be also cell attributes like CNV, Fusion, etc */
11
- values: TermValues
12
- /** single cell terms require a sample to read the term values, they are associated with a sample */
13
- sample: string
14
- /** the plot defined in the dataset contains a column with the term values for the sample, it needs to be passed to read the sample values */
15
- plot: string
16
- groupsetting: TermGroupSetting
17
- }
18
-
19
- export type SingleCellCellTypeTW = BaseTW & {
20
- term: SingleCellCellTypeTerm
21
- q: SingleCellCellTypeQ
22
- }
@@ -1,28 +0,0 @@
1
- import { TermWrapper } from './tw.ts'
2
- import { BaseQ } from './term.ts'
3
- import { GeneExpressionQ } from './geneExpression.ts'
4
- import { TermSettingInstance } from '../termsetting.ts'
5
- import { NumericTerm } from './numeric.ts'
6
-
7
- /*
8
- --------EXPORTED--------
9
- GeneExpressionQ
10
- GeneExpressionTermWrapper
11
- GeneExpressionTermSettingInstance
12
-
13
- */
14
-
15
- export type SingleCellGeneExpressionTW = TermWrapper & {
16
- q: GeneExpressionQ
17
- term: SingleCellGeneExpressionTerm
18
- }
19
-
20
- export type SingleCellGeneExpressionTerm = NumericTerm & {
21
- gene: string
22
- sample: string
23
- }
24
-
25
- export type SingleCellGeneExpressionTermSettingInstance = TermSettingInstance & {
26
- q: GeneExpressionQ
27
- term: SingleCellGeneExpressionTerm
28
- }
package/src/terms/snp.ts DELETED
@@ -1,28 +0,0 @@
1
- import { TermWrapper } from './tw.ts'
2
- import { BaseQ, BaseTerm, GroupSettingQ, TermGroupSetting } from './term.ts'
3
- import { TermSettingInstance } from '../termsetting.ts'
4
-
5
- /*
6
- For term type 'snp'
7
- */
8
-
9
- export type SnpQ = BaseQ & GroupSettingQ
10
-
11
- export type SnpTW = TermWrapper & {
12
- q: SnpQ
13
- term: SnpTerm
14
- }
15
-
16
- export type SnpTerm = BaseTerm & {
17
- chr: string
18
- start: number
19
- stop: number
20
- ref: string
21
- alt: string[]
22
- groupsetting: TermGroupSetting
23
- }
24
-
25
- export type SnpTermSettingInstance = TermSettingInstance & {
26
- q: SnpQ
27
- term: SnpTerm
28
- }
package/src/terms/snps.ts DELETED
@@ -1,110 +0,0 @@
1
- import { BaseTW, BaseQ, BaseTerm } from './term.ts'
2
- import { TermSettingInstance, InstanceDom, UseCase } from '../termsetting.ts'
3
- import { VocabApi } from '../vocab.ts'
4
- import { Tvs, Filter } from '../filter.ts'
5
-
6
- /*
7
- --------EXPORTED--------
8
- SnpsQ
9
- SnpsEntry
10
- SnpsTerm
11
- SnpsTW
12
- SnpsVocabApi
13
- SnpsTermSettingInstance
14
-
15
- */
16
-
17
- type RestrictAncestry = {
18
- name: string
19
- tvs: Tvs
20
- }
21
-
22
- export type SnpsQ = BaseQ & {
23
- // termType: 'snplocus' | 'snplst'
24
- //for snplst and snplocus term types
25
- AFcutoff: number
26
- alleleType: number
27
- cacheid: string
28
- doNotRestrictAncestry: any
29
- geneticModel: number
30
- info_fields?: any //[] Not documented
31
- missingGenotype?: number
32
- numOfSampleWithAnyValidGT: number
33
- restrictAncestry: RestrictAncestry
34
- snp2effAle?: any
35
- snp2refGrp: any //[] maybe??
36
- variant_filter: Filter
37
- //Position
38
- chr: string
39
- start: number
40
- stop: number
41
- }
42
-
43
- type AllelesEntry = {
44
- allele: string
45
- count: number
46
- isRef: boolean
47
- }
48
-
49
- export type SnpsEntry = {
50
- alt2csq?: any //{} In document but not implemented?
51
- altAlleles?: string[]
52
- alleles?: AllelesEntry[]
53
- effectAllele: boolean
54
- gt2count?: {
55
- k: string
56
- v: string | number
57
- }
58
- invalid?: boolean
59
- referenceAllele?: string
60
- rsid: string
61
- snpid: string
62
- tobe_deleted?: any
63
- //Position properties
64
- chr?: string
65
- pos?: number
66
- }
67
-
68
- export type SnpsTerm = BaseTerm & {
69
- id: string
70
- reachedVariantLimit?: boolean
71
- snps?: SnpsEntry[]
72
- }
73
-
74
- export type SnpsTW = BaseTW & {
75
- q: SnpsQ
76
- term: SnpsTerm
77
- }
78
-
79
- type VariantFilter = {
80
- active: any
81
- filter: any
82
- opts: any
83
- terms: any
84
- }
85
-
86
- export type SnpsVocabApi = VocabApi & {
87
- validateSnps: (f?: any) => {
88
- error?: any
89
- cacheid: string
90
- snps: any
91
- reachedVariantLimit: any
92
- }
93
- get_variantFilter: () => any
94
- }
95
-
96
- type SnpsDom = InstanceDom & {
97
- input_AFcutoff_label: any
98
- restrictAncestriesRow: any
99
- setEffectAlleleAsHint: any
100
- snplst_table: any
101
- }
102
-
103
- export type SnpsTermSettingInstance = TermSettingInstance & {
104
- dom: SnpsDom
105
- q: Partial<SnpsQ>
106
- term: SnpsTerm
107
- usecase: UseCase
108
- variantFilter: VariantFilter
109
- vocabApi: SnpsVocabApi
110
- }
package/src/terms/term.ts DELETED
@@ -1,184 +0,0 @@
1
- import { Filter } from '../filter.js'
2
- import { CategoricalTerm, CategoricalBaseQ } from './categorical.js'
3
- import { ConditionTerm } from './condition.js'
4
- import { NumericTerm } from './numeric.js'
5
- import { GeneVariantTerm } from './geneVariant.js'
6
- import { SampleLstTerm } from './samplelst.js'
7
- import { SnpsTerm } from './snps.js'
8
-
9
- /**
10
- * @param id term.id for dictionary terms, undefined for non-dictionary terms
11
- * @params $id client-computed deterministic unique identifier, to distinguish tw with the same term but different q, that are in the same payload
12
- */
13
-
14
- /*** types supporting termwrapper q ***/
15
-
16
- export type HiddenValues = {
17
- [index: string]: number
18
- }
19
-
20
- // TODO: replace BaseQ with MinBaseQ (see below)
21
- // keeping BaseQ for now to not break old code
22
- export type BaseQ = {
23
- /**Automatically set by fillTermWrapper()
24
- Applies to barchart, survival plot, and cuminc plot.
25
- Contains categories of a term to be hidden in its chart. This should only apply to client-side rendering, and should not be part of “dataName” when requesting data from server. Server will always provide a summary for all categories. It’s up to the client to show/hide categories.
26
- This allows the key visibility to be stored in state, while toggling visibility will not trigger data re-request.
27
- Currently termsetting menu does not manage this attribute. It’s managed by barchart legend.
28
- */
29
- hiddenValues?: HiddenValues
30
- /**indicates this object should not be extended by a copy-merge tool */
31
- isAtomic?: boolean
32
- name?: string
33
- mode?:
34
- | 'discrete'
35
- /** Binary is a special case of discrete. */
36
- | 'binary'
37
- | 'continuous'
38
- /** Only for numeric terms in regression analysis. Requires q.knots */
39
- | 'spline'
40
- /** Only applies to condition term. Requires q.breaks[] to have one grade value.*/
41
- | 'cuminc'
42
- /** Only applies to condition term for cox regression outcome. Requires q.breaks[] to have one grade value, for event and q.timeScale.*/
43
- | 'cox'
44
-
45
- reuseId?: string
46
- /** To define ways to divide up cohort based on a term, using methods specific to term types.*/
47
- type?: /** Requires term.values{} to access categories for categorical term, and grade for condition term */
48
- | 'values'
49
- /** Applies to numeric terms */
50
- | 'regular-bin'
51
- /** Applies to numeric terms */
52
- | 'custom-bin'
53
- /** Applies to categorical, condition, geneVariant, and singleCellCellType terms */
54
- | 'predefined-groupset'
55
- /** Applies to categorical, condition, geneVariant, and singleCellCellType terms */
56
- | 'custom-groupset'
57
- /** Applies to samplelst terms */
58
- | 'custom-samplelst'
59
- }
60
-
61
- export type ValuesQ = CategoricalBaseQ & {
62
- type: 'values'
63
- }
64
-
65
- export type PredefinedGroupSettingQ = CategoricalBaseQ & {
66
- type: 'predefined-groupset'
67
- predefined_groupset_idx: number
68
- }
69
-
70
- export type CustomGroupSettingQ = CategoricalBaseQ & {
71
- type: 'custom-groupset'
72
- customset: BaseGroupSet
73
- }
74
-
75
- export type GroupSettingQ = ValuesQ | PredefinedGroupSettingQ | CustomGroupSettingQ
76
-
77
- /*** types supporting termwrapper term ***/
78
-
79
- export type BaseValue = {
80
- key?: string
81
- uncomputable?: boolean
82
- label?: string | number
83
- order?: string
84
- color?: string
85
- group?: number
86
- filter?: Filter
87
- }
88
-
89
- export type TermValues = {
90
- [key: string | number]: BaseValue
91
- }
92
-
93
- export type BaseTerm = {
94
- id: string
95
- name: string
96
- type: string
97
- child_types?: string[]
98
- hashtmldetail?: boolean
99
- included_types?: string[]
100
- isleaf?: boolean
101
- values?: TermValues
102
- }
103
-
104
- export type Term = BaseTerm &
105
- (NumericTerm | CategoricalTerm | ConditionTerm | GeneVariantTerm | SampleLstTerm | SnpsTerm)
106
-
107
- export type ValuesGroup = {
108
- name: string
109
- type: 'values' | string // can remove boolean fallback once problematic js files are converted to .ts and can declare `type: 'values' as const`
110
- values: { key: number | string; label: string }[]
111
- uncomputable?: boolean // if true, do not include this group in computations
112
- }
113
-
114
- // TODO: determine if this is used
115
- export type FilterGroup = {
116
- name: string
117
- type: 'filter'
118
- filter: Filter
119
- }
120
-
121
- export type GroupEntry = ValuesGroup | FilterGroup
122
-
123
- export type BaseGroupSet = {
124
- groups: GroupEntry[]
125
- }
126
-
127
- type Groupset = {
128
- name: string
129
- is_grade?: boolean
130
- is_subcondition?: boolean
131
- } & BaseGroupSet
132
-
133
- export type EnabledTermGroupSetting = {
134
- disabled?: false | boolean // can remove boolean fallback once common.js is converted to .ts and can declare `disabled: false as const`
135
- lst: Groupset[]
136
- }
137
-
138
- export type TermGroupSetting =
139
- | EnabledTermGroupSetting
140
- | {
141
- /** disabled=false when groupsetting is not applicable for term (e.g., when term has only two categories) */
142
- disabled: true | boolean // can remove boolean fallback once common.js is converted to .ts and can declare `disabled: true as const`
143
- lst?: []
144
- }
145
-
146
- /*** types supporting termwrapper ***/
147
-
148
- export type BaseTW = {
149
- id?: string
150
- $id?: string
151
- isAtomic?: true
152
- // plot-specific customizations that are applied to a tw copy
153
- // todo: should rethink these
154
- legend?: any
155
- settings?: {
156
- [key: string]: any
157
- }
158
- sortSamples?: any
159
- minNumSamples?: number
160
- valueFilter?: any
161
- }
162
-
163
- /*** types supporting Term types ***/
164
-
165
- export type Subconditions = {
166
- [index: string | number]: {
167
- label: string
168
- }
169
- }
170
-
171
- /*** other types ***/
172
-
173
- export type RangeEntry = {
174
- //Used binconfig.lst[] and in tvs.ranges[]
175
- start?: number
176
- startunbounded?: boolean
177
- startinclusive?: boolean
178
- stop?: number
179
- stopunbounded?: boolean
180
- stopinclusive?: boolean
181
- label?: string //for binconfig.lst[]
182
- value?: string //for tvs.ranges[]
183
- range?: any //No idea what this is
184
- }
package/src/terms/tw.ts DELETED
@@ -1,38 +0,0 @@
1
- import { BaseQ, BaseTW, Term } from './term.ts'
2
- import { CategoricalQ, CategoricalTW } from './categorical.ts'
3
- import { NumericQ, NumericTW } from './numeric.ts'
4
- import { SnpsQ, SnpsTW } from './snps.ts'
5
- import { ConditionQ } from './condition.ts'
6
- import { GeneVariantQ } from './geneVariant.ts'
7
- import { SampleLstQ } from './samplelst.ts'
8
-
9
- export type TermWrapper = CategoricalTW | NumericTW | SnpsTW | (BaseTW & { term: Term; q: Q })
10
- export type TwLst = TermWrapper[]
11
-
12
- export type Q = BaseQ | CategoricalQ | ConditionQ | NumericQ | GeneVariantQ | SampleLstQ | SnpsQ
13
-
14
- export type RawTW =
15
- //{ id: string } | RawCatTW
16
- //
17
- // BELOW TYPE IS NOT TESTED, only being used to compare tsc type checking behavior
18
- // between non-union versus type-unions, which way is easier to code against
19
- {
20
- id?: string
21
- term?: {
22
- type: 'categorical' | 'condition'
23
- [key: string | number]: any
24
- }
25
- q?: {
26
- //predefined_groupset_idx?: number
27
- //customset?: any
28
- [key: string]: any
29
- //type?: string //'custom-groupset' |
30
- //customset?: any
31
- }
32
- isAtomic?: true
33
- $id?: string
34
- }
35
-
36
- export interface TwHandler {
37
- render?: (opts?: any) => void
38
- }
@@ -1,9 +0,0 @@
1
- // temporary code file to hold updated type definitions
2
- // as part of the tw router/handler refactor
3
-
4
- import { CatTWTypes, CategoricalQ } from './categorical.ts'
5
- import { NumTWTypes, NumericQ } from './numeric.ts'
6
-
7
- export type TermWrapper = CatTWTypes | NumTWTypes
8
-
9
- export type Q = CategoricalQ | NumericQ // | other q
@@ -1,197 +0,0 @@
1
- // TODO: will deprecate this code, should use client/termsetting/types.ts instead
2
- import { VocabApi } from './vocab.ts'
3
- import { TermWrapper, Q } from './terms/tw.ts'
4
- import { Term } from './terms/term.ts'
5
- import { Filter } from './filter.ts'
6
-
7
- /*
8
-
9
- !!!
10
- For shared/types:
11
- - Declare only the types that are used in the request and response payloads, or in *both* client and server-side code
12
- - Do not track client or server-specific type declarations here, those belong in the corresponding workspace code
13
- !!!
14
-
15
- --------EXPORTED--------
16
- Dom
17
- Api
18
- NoTermPromptOptsEntry
19
- UseCase
20
- SampleCountsEntry
21
- Handler
22
- PillData
23
- TermSettingOpts
24
- InstanceDom
25
- TermSettingInstance
26
-
27
- */
28
-
29
- /*** types supporting TermSettingOpts & PillData types ***/
30
-
31
- export type Dom = {
32
- holder: Selection
33
- tip: any //TODO Menu type??
34
- tip2: any //same as above
35
- nopilldiv?: Selection
36
- pilldiv?: Selection
37
- btnDiv?: Selection
38
- }
39
-
40
- export type NoTermPromptOptsEntry = {
41
- isDictionary?: boolean
42
- termtype?: string
43
- text?: string
44
- html?: string
45
- q?: Q
46
- /** whether or not opt is invalid */
47
- invalid?: boolean
48
- /** message displayed when opt is invalid */
49
- invalidMsg?: string
50
- }
51
-
52
- type NumericContEditOptsEntry = {
53
- scale: string
54
- transform: string
55
- }
56
-
57
- export type UseCase = {
58
- target: string
59
- detail?: string //Maybe?
60
- regressionType?: string //Maybe?
61
- term1type?: string //Maybe? not documented
62
- }
63
-
64
- type DefaultQ4fillTW = {
65
- [index: string]: Q
66
- }
67
-
68
- export type SampleCountsEntry = {
69
- key: string
70
- value: number //This maybe a string???
71
- label?: string //Not documented?? in key or no?
72
- }
73
-
74
- export type Handler = {
75
- getPillName: (d: any) => string
76
- getPillStatus: (f?: any) => any
77
- showEditMenu: (div: Selection) => void
78
- validateQ?: (d: Q) => void
79
- postMain?: () => void
80
- }
81
-
82
- type BaseTermSettingOpts = {
83
- //Optional
84
- abbrCutoff?: number
85
- activeCohort?: number
86
- disable_terms?: string[]
87
- handler: Handler
88
- noTermPromptOptions?: NoTermPromptOptsEntry[]
89
- }
90
-
91
- export type PillData = BaseTermSettingOpts & {
92
- $id?: string
93
- doNotHideTipInMain: boolean
94
- dom: Dom
95
- error?: string
96
- filter?: Filter
97
- q?: Q
98
- sampleCounts?: SampleCountsEntry[]
99
- term?: Term
100
- }
101
-
102
- export type TermSettingOpts = BaseTermSettingOpts & {
103
- //Required
104
- holder: any
105
- vocabApi: VocabApi
106
- //Optional
107
- $id?: string
108
- buttons?: string[] //replace, delete, info
109
- defaultQ4fillTW?: DefaultQ4fillTW
110
- menuOptions: string //all, edit, replace, remove
111
- menuLayout?: string //horizonal, all
112
- numericEditMenuVersion?: string[]
113
- geneVariantEditMenuOnlyGrp?: boolean
114
- numericContinuousEditOptions?: NumericContEditOptsEntry[]
115
- placeholder?: string
116
- placeholderIcon?: string //default '+'
117
- renderAs: string //none
118
- tip?: any //TODO: Menu type?
119
- use_bins_less?: boolean
120
- usecase?: UseCase
121
- debug?: boolean | number //true or 1
122
- //'snplocus' types
123
- genomeObj?: any
124
-
125
- //vocab??
126
-
127
- // required callback function. argument is the updated termwrapper object
128
- callback: (f: TermWrapper | null) => void
129
-
130
- // ?
131
- customFillTw?: (f: TermWrapper) => void
132
-
133
- // to pass in purpose and context-specific arguments that will be merged to client request parameters
134
- getBodyParams?: () => any
135
- }
136
-
137
- /*** types supporting TermSettingInstance type ***/
138
-
139
- export type InstanceDom = {
140
- //Separate from the Dom outlined in termsetting.ts?????
141
- //Required
142
- holder: any
143
- tip: any //TODO Menu type??
144
- tip2: any //same as above
145
- nopilldiv?: any
146
- pilldiv?: any
147
- btnDiv?: any
148
- //Optional
149
- customBinBoundaryInput?: any
150
- customBinBoundaryPercentileCheckbox?: any
151
- customBinLabelInput?: any
152
- customBinRanges?: any
153
- cutoff_div?: any
154
- num_holder?: any
155
- pill_termname?: any
156
- rangeAndLabelDiv?: any
157
- }
158
-
159
- export type TermSettingInstance = {
160
- activeCohort?: number
161
- clickNoPillDiv?: any
162
- dom: InstanceDom
163
- doNotHideTipInMain?: boolean
164
- disable_terms?: string[]
165
- durations: { exit: number }
166
- filter?: Filter
167
- handler?: Handler
168
- handlerByType?: { [index: string]: Handler }
169
- hasError?: boolean
170
- noTermPromptOptions?: NoTermPromptOptsEntry[]
171
- opts: TermSettingOpts
172
- placeholder: string | undefined
173
- q: Q
174
- term: Term
175
- usecase?: UseCase
176
- vocabApi: VocabApi
177
-
178
- //Methods
179
- /*
180
- TODOs:
181
- - Move specifc methods to their own intersection instance type within in termsetting/handler/*.ts, out of main type
182
- */
183
- cancelGroupsetting?: () => void
184
- enterPill?: () => void
185
- exitPill?: () => void
186
- initUI: () => void
187
- removeTerm?: () => void
188
- runCallback: (f?: any) => any
189
- setHandler?: (f: string) => any
190
- showGeneSearch: (clickedElem: Element | null, event: MouseEvent) => void
191
- showMenu: (event: MouseEvent, clickedElem: string | null, menuHolder: any) => void
192
- showReuseMenu?: (div: any) => void
193
- showTree: (holder: Selection, event?: MouseEvent) => void
194
- tabCallback?: (event: any, tab: any) => void
195
- updatePill?: () => void
196
- updateUI: () => void
197
- }