@vitessce/constants 3.4.9 → 3.4.10

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.
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ const FileType$2 = {
37
37
  // Joint file types
38
38
  ANNDATA_ZARR: "anndata.zarr",
39
39
  ANNDATA_ZARR_ZIP: "anndata.zarr.zip",
40
+ ANNDATA_H5AD: "anndata.h5ad",
40
41
  SPATIALDATA_ZARR: "spatialdata.zarr",
41
42
  // Atomic file types
42
43
  OBS_EMBEDDING_CSV: "obsEmbedding.csv",
@@ -77,6 +78,18 @@ const FileType$2 = {
77
78
  OBS_LABELS_ANNDATA_ZARR_ZIP: "obsLabels.anndata.zarr.zip",
78
79
  FEATURE_LABELS_ANNDATA_ZARR_ZIP: "featureLabels.anndata.zarr.zip",
79
80
  SAMPLE_EDGES_ANNDATA_ZARR_ZIP: "sampleEdges.anndata.zarr.zip",
81
+ // AnnData - h5ad via reference spec
82
+ OBS_FEATURE_MATRIX_ANNDATA_H5AD: "obsFeatureMatrix.anndata.h5ad",
83
+ OBS_FEATURE_COLUMNS_ANNDATA_H5AD: "obsFeatureColumns.anndata.h5ad",
84
+ OBS_SETS_ANNDATA_H5AD: "obsSets.anndata.h5ad",
85
+ OBS_EMBEDDING_ANNDATA_H5AD: "obsEmbedding.anndata.h5ad",
86
+ OBS_SPOTS_ANNDATA_H5AD: "obsSpots.anndata.h5ad",
87
+ OBS_POINTS_ANNDATA_H5AD: "obsPoints.anndata.h5ad",
88
+ OBS_LOCATIONS_ANNDATA_H5AD: "obsLocations.anndata.h5ad",
89
+ OBS_SEGMENTATIONS_ANNDATA_H5AD: "obsSegmentations.anndata.h5ad",
90
+ OBS_LABELS_ANNDATA_H5AD: "obsLabels.anndata.h5ad",
91
+ FEATURE_LABELS_ANNDATA_H5AD: "featureLabels.anndata.h5ad",
92
+ SAMPLE_EDGES_ANNDATA_H5AD: "sampleEdges.anndata.h5ad",
80
93
  // SpatialData
81
94
  IMAGE_SPATIALDATA_ZARR: "image.spatialdata.zarr",
82
95
  LABELS_SPATIALDATA_ZARR: "labels.spatialdata.zarr",
@@ -425,10 +438,11 @@ function makeConstantWithDeprecationMessage(currObj, oldObj) {
425
438
  const handler = {
426
439
  get(obj, prop) {
427
440
  const oldKeys = Object.keys(oldObj);
428
- if (oldKeys.includes(prop)) {
429
- console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':
430
- ${oldObj[prop][1]}`);
431
- return oldObj[prop];
441
+ const propKey = String(prop);
442
+ if (oldKeys.includes(propKey)) {
443
+ console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':
444
+ ${oldObj[propKey][1]}`);
445
+ return oldObj[propKey];
432
446
  }
433
447
  return obj[prop];
434
448
  }
@@ -1,5 +1,243 @@
1
- export const ViewType: any;
2
- export const DataType: any;
3
- export const FileType: any;
4
- export const CoordinationType: any;
1
+ export const ViewType: {
2
+ DESCRIPTION: string;
3
+ STATUS: string;
4
+ SCATTERPLOT: string;
5
+ SPATIAL: string;
6
+ SPATIAL_BETA: string;
7
+ HEATMAP: string;
8
+ LAYER_CONTROLLER: string;
9
+ LAYER_CONTROLLER_BETA: string;
10
+ GENOMIC_PROFILES: string;
11
+ GATING: string;
12
+ FEATURE_LIST: string;
13
+ OBS_SETS: string;
14
+ OBS_SET_SIZES: string;
15
+ OBS_SET_FEATURE_VALUE_DISTRIBUTION: string;
16
+ FEATURE_VALUE_HISTOGRAM: string;
17
+ DOT_PLOT: string;
18
+ FEATURE_BAR_PLOT: string;
19
+ };
20
+ export const DataType: {
21
+ OBS_LABELS: string;
22
+ OBS_EMBEDDING: string;
23
+ OBS_FEATURE_MATRIX: string;
24
+ OBS_SETS: string;
25
+ FEATURE_LABELS: string;
26
+ IMAGE: string;
27
+ OBS_SEGMENTATIONS: string;
28
+ NEIGHBORHOODS: string;
29
+ GENOMIC_PROFILES: string;
30
+ OBS_SPOTS: string;
31
+ OBS_POINTS: string;
32
+ OBS_LOCATIONS: string;
33
+ SAMPLE_SETS: string;
34
+ SAMPLE_EDGES: string;
35
+ };
36
+ export const FileType: {
37
+ ANNDATA_ZARR: string;
38
+ ANNDATA_ZARR_ZIP: string;
39
+ ANNDATA_H5AD: string;
40
+ SPATIALDATA_ZARR: string;
41
+ OBS_EMBEDDING_CSV: string;
42
+ OBS_SPOTS_CSV: string;
43
+ OBS_POINTS_CSV: string;
44
+ OBS_LOCATIONS_CSV: string;
45
+ OBS_LABELS_CSV: string;
46
+ FEATURE_LABELS_CSV: string;
47
+ OBS_FEATURE_MATRIX_CSV: string;
48
+ OBS_SEGMENTATIONS_JSON: string;
49
+ OBS_SETS_CSV: string;
50
+ OBS_SETS_JSON: string;
51
+ SAMPLE_SETS_CSV: string;
52
+ IMAGE_OME_ZARR: string;
53
+ OBS_SEGMENTATIONS_OME_ZARR: string;
54
+ OBS_FEATURE_MATRIX_ANNDATA_ZARR: string;
55
+ OBS_FEATURE_COLUMNS_ANNDATA_ZARR: string;
56
+ OBS_SETS_ANNDATA_ZARR: string;
57
+ OBS_EMBEDDING_ANNDATA_ZARR: string;
58
+ OBS_SPOTS_ANNDATA_ZARR: string;
59
+ OBS_POINTS_ANNDATA_ZARR: string;
60
+ OBS_LOCATIONS_ANNDATA_ZARR: string;
61
+ OBS_SEGMENTATIONS_ANNDATA_ZARR: string;
62
+ OBS_LABELS_ANNDATA_ZARR: string;
63
+ FEATURE_LABELS_ANNDATA_ZARR: string;
64
+ SAMPLE_EDGES_ANNDATA_ZARR: string;
65
+ OBS_FEATURE_MATRIX_ANNDATA_ZARR_ZIP: string;
66
+ OBS_FEATURE_COLUMNS_ANNDATA_ZARR_ZIP: string;
67
+ OBS_SETS_ANNDATA_ZARR_ZIP: string;
68
+ OBS_EMBEDDING_ANNDATA_ZARR_ZIP: string;
69
+ OBS_SPOTS_ANNDATA_ZARR_ZIP: string;
70
+ OBS_POINTS_ANNDATA_ZARR_ZIP: string;
71
+ OBS_LOCATIONS_ANNDATA_ZARR_ZIP: string;
72
+ OBS_SEGMENTATIONS_ANNDATA_ZARR_ZIP: string;
73
+ OBS_LABELS_ANNDATA_ZARR_ZIP: string;
74
+ FEATURE_LABELS_ANNDATA_ZARR_ZIP: string;
75
+ SAMPLE_EDGES_ANNDATA_ZARR_ZIP: string;
76
+ OBS_FEATURE_MATRIX_ANNDATA_H5AD: string;
77
+ OBS_FEATURE_COLUMNS_ANNDATA_H5AD: string;
78
+ OBS_SETS_ANNDATA_H5AD: string;
79
+ OBS_EMBEDDING_ANNDATA_H5AD: string;
80
+ OBS_SPOTS_ANNDATA_H5AD: string;
81
+ OBS_POINTS_ANNDATA_H5AD: string;
82
+ OBS_LOCATIONS_ANNDATA_H5AD: string;
83
+ OBS_SEGMENTATIONS_ANNDATA_H5AD: string;
84
+ OBS_LABELS_ANNDATA_H5AD: string;
85
+ FEATURE_LABELS_ANNDATA_H5AD: string;
86
+ SAMPLE_EDGES_ANNDATA_H5AD: string;
87
+ IMAGE_SPATIALDATA_ZARR: string;
88
+ LABELS_SPATIALDATA_ZARR: string;
89
+ SHAPES_SPATIALDATA_ZARR: string;
90
+ OBS_FEATURE_MATRIX_SPATIALDATA_ZARR: string;
91
+ OBS_SETS_SPATIALDATA_ZARR: string;
92
+ OBS_SPOTS_SPATIALDATA_ZARR: string;
93
+ FEATURE_LABELS_SPATIALDATA_ZARR: string;
94
+ OBS_FEATURE_MATRIX_MUDATA_ZARR: string;
95
+ OBS_SETS_MUDATA_ZARR: string;
96
+ OBS_EMBEDDING_MUDATA_ZARR: string;
97
+ OBS_SPOTS_MUDATA_ZARR: string;
98
+ OBS_POINTS_MUDATA_ZARR: string;
99
+ OBS_LOCATIONS_MUDATA_ZARR: string;
100
+ OBS_SEGMENTATIONS_MUDATA_ZARR: string;
101
+ OBS_LABELS_MUDATA_ZARR: string;
102
+ FEATURE_LABELS_MUDATA_ZARR: string;
103
+ GENOMIC_PROFILES_ZARR: string;
104
+ NEIGHBORHOODS_JSON: string;
105
+ IMAGE_OME_TIFF: string;
106
+ OBS_SEGMENTATIONS_OME_TIFF: string;
107
+ OBS_SEGMENTATIONS_GLB: string;
108
+ OBS_EMBEDDING_CELLS_JSON: string;
109
+ OBS_SEGMENTATIONS_CELLS_JSON: string;
110
+ OBS_LOCATIONS_CELLS_JSON: string;
111
+ OBS_LABELS_CELLS_JSON: string;
112
+ OBS_SETS_CELL_SETS_JSON: string;
113
+ OBS_FEATURE_MATRIX_GENES_JSON: string;
114
+ OBS_FEATURE_MATRIX_CLUSTERS_JSON: string;
115
+ OBS_FEATURE_MATRIX_EXPRESSION_MATRIX_ZARR: string;
116
+ IMAGE_RASTER_JSON: string;
117
+ OBS_SEGMENTATIONS_RASTER_JSON: string;
118
+ OBS_LOCATIONS_MOLECULES_JSON: string;
119
+ OBS_LABELS_MOLECULES_JSON: string;
120
+ CELLS_JSON: string;
121
+ CELL_SETS_JSON: string;
122
+ ANNDATA_CELL_SETS_ZARR: string;
123
+ ANNDATA_CELLS_ZARR: string;
124
+ EXPRESSION_MATRIX_ZARR: string;
125
+ MOLECULES_JSON: string;
126
+ RASTER_JSON: string;
127
+ RASTER_OME_ZARR: string;
128
+ CLUSTERS_JSON: string;
129
+ GENES_JSON: string;
130
+ ANNDATA_EXPRESSION_MATRIX_ZARR: string;
131
+ };
132
+ export const CoordinationType: {
133
+ META_COORDINATION_SCOPES: string;
134
+ META_COORDINATION_SCOPES_BY: string;
135
+ DATASET: string;
136
+ OBS_TYPE: string;
137
+ FEATURE_TYPE: string;
138
+ FEATURE_VALUE_TYPE: string;
139
+ OBS_LABELS_TYPE: string;
140
+ EMBEDDING_TYPE: string;
141
+ EMBEDDING_ZOOM: string;
142
+ EMBEDDING_ROTATION: string;
143
+ EMBEDDING_TARGET_X: string;
144
+ EMBEDDING_TARGET_Y: string;
145
+ EMBEDDING_TARGET_Z: string;
146
+ EMBEDDING_OBS_SET_POLYGONS_VISIBLE: string;
147
+ EMBEDDING_OBS_SET_LABELS_VISIBLE: string;
148
+ EMBEDDING_OBS_SET_LABEL_SIZE: string;
149
+ EMBEDDING_OBS_RADIUS: string;
150
+ EMBEDDING_OBS_RADIUS_MODE: string;
151
+ EMBEDDING_OBS_OPACITY: string;
152
+ EMBEDDING_OBS_OPACITY_MODE: string;
153
+ SPATIAL_ZOOM: string;
154
+ SPATIAL_ROTATION: string;
155
+ SPATIAL_TARGET_X: string;
156
+ SPATIAL_TARGET_Y: string;
157
+ SPATIAL_TARGET_Z: string;
158
+ SPATIAL_TARGET_T: string;
159
+ SPATIAL_ROTATION_X: string;
160
+ SPATIAL_ROTATION_Y: string;
161
+ SPATIAL_ROTATION_Z: string;
162
+ SPATIAL_ROTATION_ORBIT: string;
163
+ SPATIAL_ORBIT_AXIS: string;
164
+ SPATIAL_AXIS_FIXED: string;
165
+ HEATMAP_ZOOM_X: string;
166
+ HEATMAP_ZOOM_Y: string;
167
+ HEATMAP_TARGET_X: string;
168
+ HEATMAP_TARGET_Y: string;
169
+ OBS_FILTER: string;
170
+ OBS_HIGHLIGHT: string;
171
+ OBS_SET_SELECTION: string;
172
+ OBS_SET_HIGHLIGHT: string;
173
+ OBS_SET_EXPANSION: string;
174
+ OBS_SET_COLOR: string;
175
+ FEATURE_FILTER: string;
176
+ FEATURE_HIGHLIGHT: string;
177
+ FEATURE_SELECTION: string;
178
+ FEATURE_VALUE_COLORMAP: string;
179
+ FEATURE_VALUE_TRANSFORM: string;
180
+ FEATURE_VALUE_COLORMAP_RANGE: string;
181
+ OBS_COLOR_ENCODING: string;
182
+ SPATIAL_IMAGE_LAYER: string;
183
+ SPATIAL_SEGMENTATION_LAYER: string;
184
+ SPATIAL_POINT_LAYER: string;
185
+ SPATIAL_NEIGHBORHOOD_LAYER: string;
186
+ GENOMIC_ZOOM_X: string;
187
+ GENOMIC_ZOOM_Y: string;
188
+ GENOMIC_TARGET_X: string;
189
+ GENOMIC_TARGET_Y: string;
190
+ ADDITIONAL_OBS_SETS: string;
191
+ MOLECULE_HIGHLIGHT: string;
192
+ GATING_FEATURE_SELECTION_X: string;
193
+ GATING_FEATURE_SELECTION_Y: string;
194
+ FEATURE_VALUE_TRANSFORM_COEFFICIENT: string;
195
+ FEATURE_VALUE_POSITIVITY_THRESHOLD: string;
196
+ TOOLTIPS_VISIBLE: string;
197
+ FILE_UID: string;
198
+ IMAGE_LAYER: string;
199
+ IMAGE_CHANNEL: string;
200
+ SEGMENTATION_LAYER: string;
201
+ SEGMENTATION_CHANNEL: string;
202
+ SPATIAL_TARGET_C: string;
203
+ SPATIAL_LAYER_VISIBLE: string;
204
+ SPATIAL_LAYER_OPACITY: string;
205
+ SPATIAL_LAYER_COLORMAP: string;
206
+ SPATIAL_LAYER_TRANSPARENT_COLOR: string;
207
+ SPATIAL_LAYER_MODEL_MATRIX: string;
208
+ SPATIAL_SEGMENTATION_FILLED: string;
209
+ SPATIAL_SEGMENTATION_STROKE_WIDTH: string;
210
+ SPATIAL_CHANNEL_COLOR: string;
211
+ SPATIAL_CHANNEL_VISIBLE: string;
212
+ SPATIAL_CHANNEL_OPACITY: string;
213
+ SPATIAL_CHANNEL_WINDOW: string;
214
+ PHOTOMETRIC_INTERPRETATION: string;
215
+ SPATIAL_RENDERING_MODE: string;
216
+ VOLUMETRIC_RENDERING_ALGORITHM: string;
217
+ SPATIAL_TARGET_RESOLUTION: string;
218
+ SPATIAL_SLICE_X: string;
219
+ SPATIAL_SLICE_Y: string;
220
+ SPATIAL_SLICE_Z: string;
221
+ SPOT_LAYER: string;
222
+ POINT_LAYER: string;
223
+ SPATIAL_SPOT_RADIUS: string;
224
+ SPATIAL_SPOT_FILLED: string;
225
+ SPATIAL_SPOT_STROKE_WIDTH: string;
226
+ SPATIAL_LAYER_COLOR: string;
227
+ PIXEL_HIGHLIGHT: string;
228
+ TOOLTIP_CROSSHAIRS_VISIBLE: string;
229
+ LEGEND_VISIBLE: string;
230
+ SPATIAL_CHANNEL_LABELS_VISIBLE: string;
231
+ SPATIAL_CHANNEL_LABELS_ORIENTATION: string;
232
+ SPATIAL_CHANNEL_LABEL_SIZE: string;
233
+ SAMPLE_TYPE: string;
234
+ SAMPLE_SET_SELECTION: string;
235
+ SAMPLE_SET_COLOR: string;
236
+ EMBEDDING_POINTS_VISIBLE: string;
237
+ EMBEDDING_CONTOURS_VISIBLE: string;
238
+ EMBEDDING_CONTOURS_FILLED: string;
239
+ EMBEDDING_CONTOUR_PERCENTILES: string;
240
+ CONTOUR_COLOR_ENCODING: string;
241
+ CONTOUR_COLOR: string;
242
+ };
5
243
  //# sourceMappingURL=constants-merged.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants-merged.d.ts","sourceRoot":"","sources":["../src/constants-merged.js"],"names":[],"mappings":"AAkCA,2BAGE;AACF,2BAGE;AACF,2BAGE;AACF,mCAGE"}
1
+ {"version":3,"file":"constants-merged.d.ts","sourceRoot":"","sources":["../src/constants-merged.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;EAGE;AACF;;;;;;;;;;;;;;;EAGE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGE"}
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * The exports from this file are not intended to be used for internal development.
3
4
  * They are only meant to be exported from the package's main index.js to enable
@@ -5,13 +6,22 @@
5
6
  */
6
7
  import { ViewType as ViewTypeCurr, DataType as DataTypeCurr, FileType as FileTypeCurr, CoordinationType as CoordinationTypeCurr, } from '@vitessce/constants-internal';
7
8
  import { ViewType as ViewTypeOld, DataType as DataTypeOld, FileType as FileTypeOld, CoordinationType as CoordinationTypeOld, } from './constants-old.js';
9
+ /**
10
+ * Creates a constant with a deprecation message.
11
+ * @template {ViewTypeCurr | DataTypeCurr | FileTypeCurr | CoordinationTypeCurr} T
12
+ * @param {T} currObj
13
+ * @param {ViewTypeOld | DataTypeOld | FileTypeOld | CoordinationTypeOld} oldObj
14
+ * @returns {T} A proxy object with deprecation warnings.
15
+ */
8
16
  function makeConstantWithDeprecationMessage(currObj, oldObj) {
17
+ /** @type {ProxyHandler<any & string>} */
9
18
  const handler = {
10
19
  get(obj, prop) {
11
20
  const oldKeys = Object.keys(oldObj);
12
- if (oldKeys.includes(prop)) {
13
- console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':\n${oldObj[prop][1]}`);
14
- return oldObj[prop];
21
+ const propKey = String(prop);
22
+ if (oldKeys.includes(propKey)) {
23
+ console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':\n${oldObj[propKey][1]}`);
24
+ return oldObj[propKey];
15
25
  }
16
26
  return obj[prop];
17
27
  },
@@ -16,29 +16,29 @@ export namespace DataType {
16
16
  export const FileType: {};
17
17
  export namespace CoordinationType {
18
18
  let SPATIAL_LAYERS: string[];
19
- let SPATIAL_RASTER_LAYERS: any[];
20
- let SPATIAL_CELLS_LAYER: any[];
21
- let SPATIAL_MOLECULES_LAYER: any[];
22
- let SPATIAL_NEIGHBORHOODS_LAYER: any[];
23
- let EMBEDDING_CELL_SET_POLYGONS_VISIBLE: any[];
24
- let EMBEDDING_CELL_SET_LABELS_VISIBLE: any[];
25
- let EMBEDDING_CELL_SET_LABEL_SIZE: any[];
26
- let EMBEDDING_CELL_RADIUS: any[];
27
- let EMBEDDING_CELL_RADIUS_MODE: any[];
28
- let EMBEDDING_CELL_OPACITY: any[];
29
- let EMBEDDING_CELL_OPACITY_MODE: any[];
30
- let CELL_FILTER: any[];
31
- let CELL_HIGHLIGHT: any[];
32
- let CELL_SET_SELECTION: any[];
33
- let CELL_SET_HIGHLIGHT: any[];
34
- let CELL_SET_COLOR: any[];
35
- let CELL_COLOR_ENCODING: any[];
36
- let ADDITIONAL_CELL_SETS: any[];
37
- let GENE_FILTER: any[];
38
- let GENE_HIGHLIGHT: any[];
39
- let GENE_SELECTION: any[];
40
- let GENE_EXPRESSION_COLORMAP: any[];
41
- let GENE_EXPRESSION_TRANSFORM: any[];
42
- let GENE_EXPRESSION_COLORMAP_RANGE: any[];
19
+ let SPATIAL_RASTER_LAYERS: string[];
20
+ let SPATIAL_CELLS_LAYER: string[];
21
+ let SPATIAL_MOLECULES_LAYER: string[];
22
+ let SPATIAL_NEIGHBORHOODS_LAYER: string[];
23
+ let EMBEDDING_CELL_SET_POLYGONS_VISIBLE: string[];
24
+ let EMBEDDING_CELL_SET_LABELS_VISIBLE: string[];
25
+ let EMBEDDING_CELL_SET_LABEL_SIZE: string[];
26
+ let EMBEDDING_CELL_RADIUS: string[];
27
+ let EMBEDDING_CELL_RADIUS_MODE: string[];
28
+ let EMBEDDING_CELL_OPACITY: string[];
29
+ let EMBEDDING_CELL_OPACITY_MODE: string[];
30
+ let CELL_FILTER: string[];
31
+ let CELL_HIGHLIGHT: string[];
32
+ let CELL_SET_SELECTION: string[];
33
+ let CELL_SET_HIGHLIGHT: string[];
34
+ let CELL_SET_COLOR: string[];
35
+ let CELL_COLOR_ENCODING: string[];
36
+ let ADDITIONAL_CELL_SETS: string[];
37
+ let GENE_FILTER: string[];
38
+ let GENE_HIGHLIGHT: string[];
39
+ let GENE_SELECTION: string[];
40
+ let GENE_EXPRESSION_COLORMAP: string[];
41
+ let GENE_EXPRESSION_TRANSFORM: string[];
42
+ let GENE_EXPRESSION_COLORMAP_RANGE: string[];
43
43
  }
44
44
  //# sourceMappingURL=constants-old.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants-old.d.ts","sourceRoot":"","sources":["../src/constants-old.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkDA,0BAA2B"}
1
+ {"version":3,"file":"constants-old.d.ts","sourceRoot":"","sources":["../src/constants-old.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAoDA,0BAA2B"}
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  /**
2
3
  * Old constant values with deprecation log messages.
3
4
  * Values should be tuples like [oldValue, deprecationMessage].
@@ -47,6 +48,11 @@ export const DataType = {
47
48
  ],
48
49
  };
49
50
  export const FileType = {};
51
+ /**
52
+ * @param {string} newTypeName
53
+ * @param {string} newVersion
54
+ * @returns {[string, string, string]}
55
+ */
50
56
  function makeChangeMessage(newTypeName, newVersion) {
51
57
  return [
52
58
  `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`,
package/dist-tsc/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  export { ViewType, DataType, FileType, CoordinationType, } from './constants-merged.js';
2
3
  // For internal usage:
3
4
  export { CoordinationType as OldCoordinationType } from './constants-old.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/constants",
3
- "version": "3.4.9",
3
+ "version": "3.4.10",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "dist-tsc"
17
17
  ],
18
18
  "dependencies": {
19
- "@vitessce/constants-internal": "3.4.9"
19
+ "@vitessce/constants-internal": "3.4.10"
20
20
  },
21
21
  "scripts": {
22
22
  "bundle": "pnpm exec vite build -c ../../scripts/vite.config.js"
@@ -1,8 +1,10 @@
1
+ // @ts-check
1
2
  /**
2
3
  * The exports from this file are not intended to be used for internal development.
3
4
  * They are only meant to be exported from the package's main index.js to enable
4
5
  * backwards compatibility.
5
6
  */
7
+
6
8
  import {
7
9
  ViewType as ViewTypeCurr,
8
10
  DataType as DataTypeCurr,
@@ -16,13 +18,22 @@ import {
16
18
  CoordinationType as CoordinationTypeOld,
17
19
  } from './constants-old.js';
18
20
 
21
+ /**
22
+ * Creates a constant with a deprecation message.
23
+ * @template {ViewTypeCurr | DataTypeCurr | FileTypeCurr | CoordinationTypeCurr} T
24
+ * @param {T} currObj
25
+ * @param {ViewTypeOld | DataTypeOld | FileTypeOld | CoordinationTypeOld} oldObj
26
+ * @returns {T} A proxy object with deprecation warnings.
27
+ */
19
28
  function makeConstantWithDeprecationMessage(currObj, oldObj) {
29
+ /** @type {ProxyHandler<any & string>} */
20
30
  const handler = {
21
31
  get(obj, prop) {
22
32
  const oldKeys = Object.keys(oldObj);
23
- if (oldKeys.includes(prop)) {
24
- console.warn(`Notice about the constant mapping ${prop}: '${oldObj[prop][0]}':\n${oldObj[prop][1]}`);
25
- return oldObj[prop];
33
+ const propKey = String(prop);
34
+ if (oldKeys.includes(propKey)) {
35
+ console.warn(`Notice about the constant mapping ${propKey}: '${oldObj[propKey][0]}':\n${oldObj[propKey][1]}`);
36
+ return oldObj[propKey];
26
37
  }
27
38
  return obj[prop];
28
39
  },
@@ -1,7 +1,9 @@
1
+ // @ts-check
1
2
  /**
2
3
  * Old constant values with deprecation log messages.
3
4
  * Values should be tuples like [oldValue, deprecationMessage].
4
5
  */
6
+
5
7
  export const ViewType = {
6
8
  GENES: [
7
9
  'genes',
@@ -50,6 +52,11 @@ export const DataType = {
50
52
 
51
53
  export const FileType = {};
52
54
 
55
+ /**
56
+ * @param {string} newTypeName
57
+ * @param {string} newVersion
58
+ * @returns {[string, string, string]}
59
+ */
53
60
  function makeChangeMessage(newTypeName, newVersion) {
54
61
  return [
55
62
  `This coordination type was changed to ${newTypeName} in view config schema version ${newVersion}`,
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @ts-check
1
2
  export {
2
3
  ViewType, DataType, FileType, CoordinationType,
3
4
  } from './constants-merged.js';