@jbrowse/core 1.7.11 → 2.1.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.
- package/BaseFeatureWidget/BaseFeatureDetail.d.ts +20 -4
- package/BaseFeatureWidget/BaseFeatureDetail.js +313 -558
- package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -473
- package/BaseFeatureWidget/index.d.ts +2 -2
- package/BaseFeatureWidget/index.js +88 -124
- package/BaseFeatureWidget/types.d.ts +1 -0
- package/BaseFeatureWidget/types.js +1 -4
- package/BaseFeatureWidget/util.js +40 -75
- package/CorePlugin.js +55 -94
- package/Plugin.js +9 -34
- package/PluginLoader.js +153 -422
- package/PluginManager.d.ts +84 -117
- package/PluginManager.js +377 -666
- package/ReExports/Attributes.d.ts +2 -0
- package/ReExports/Attributes.js +5 -0
- package/ReExports/BaseCard.d.ts +2 -0
- package/ReExports/BaseCard.js +5 -0
- package/ReExports/DataGrid.d.ts +2 -0
- package/ReExports/DataGrid.js +6 -0
- package/ReExports/FeatureDetails.d.ts +2 -0
- package/ReExports/FeatureDetails.js +5 -0
- package/ReExports/index.js +6 -12
- package/ReExports/list.d.ts +5 -0
- package/ReExports/list.js +271 -7
- package/ReExports/material-ui-colors.d.ts +1 -19
- package/ReExports/material-ui-colors.js +16 -158
- package/ReExports/modules.d.ts +68 -109
- package/ReExports/modules.js +455 -244
- package/TextSearch/BaseResults.js +51 -123
- package/TextSearch/TextSearchManager.d.ts +3 -1
- package/TextSearch/TextSearchManager.js +66 -144
- package/assemblyManager/assembly.js +280 -554
- package/assemblyManager/assemblyConfigSchema.js +47 -64
- package/assemblyManager/assemblyManager.d.ts +12 -10
- package/assemblyManager/assemblyManager.js +126 -270
- package/assemblyManager/index.js +9 -22
- package/configuration/configurationSchema.js +167 -203
- package/configuration/configurationSlot.js +248 -326
- package/configuration/index.js +19 -35
- package/configuration/util.d.ts +1 -1
- package/configuration/util.js +131 -173
- package/data_adapters/BaseAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter.js +132 -521
- package/data_adapters/CytobandAdapter.js +40 -126
- package/data_adapters/dataAdapterCache.js +77 -158
- package/package.json +16 -18
- package/pluggableElementTypes/AdapterType.js +24 -79
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
- package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
- package/pluggableElementTypes/ConnectionType.js +22 -65
- package/pluggableElementTypes/DisplayType.js +35 -82
- package/pluggableElementTypes/InternetAccountType.js +23 -64
- package/pluggableElementTypes/PluggableElementBase.js +8 -20
- package/pluggableElementTypes/RpcMethodType.js +85 -427
- package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
- package/pluggableElementTypes/TrackType.js +26 -70
- package/pluggableElementTypes/ViewType.js +21 -63
- package/pluggableElementTypes/WidgetType.js +21 -64
- package/pluggableElementTypes/index.d.ts +4 -3
- package/pluggableElementTypes/index.js +42 -125
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -10
- package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.js +139 -200
- package/pluggableElementTypes/models/BaseViewModel.js +24 -40
- package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
- package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
- package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
- package/pluggableElementTypes/models/index.js +21 -70
- package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
- package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -255
- package/pluggableElementTypes/renderers/RendererType.js +31 -105
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
- package/pluggableElementTypes/renderers/index.js +19 -62
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
- package/rpc/BaseRpcDriver.js +169 -405
- package/rpc/MainThreadRpcDriver.js +27 -150
- package/rpc/RpcManager.js +58 -159
- package/rpc/WebWorkerRpcDriver.js +54 -171
- package/rpc/configSchema.js +25 -49
- package/rpc/coreRpcMethods.d.ts +1 -3
- package/rpc/coreRpcMethods.js +221 -959
- package/rpc/remoteAbortSignals.js +46 -70
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.js +107 -158
- package/ui/App.js +157 -261
- package/ui/AssemblySelector.d.ts +1 -1
- package/ui/AssemblySelector.js +59 -115
- package/ui/CascadingMenu.js +100 -199
- package/ui/ColorPicker.d.ts +16 -0
- package/ui/ColorPicker.js +97 -0
- package/ui/Drawer.js +28 -58
- package/ui/DrawerWidget.js +109 -209
- package/ui/DropDownMenu.d.ts +0 -8
- package/ui/DropDownMenu.js +60 -97
- package/ui/EditableTypography.d.ts +1 -1
- package/ui/EditableTypography.js +87 -155
- package/ui/ErrorMessage.js +41 -66
- package/ui/FactoryResetDialog.js +24 -57
- package/ui/FatalErrorDialog.js +59 -91
- package/ui/FileSelector/FileSelector.js +123 -189
- package/ui/FileSelector/LocalFileChooser.js +44 -71
- package/ui/FileSelector/UrlChooser.js +17 -38
- package/ui/FileSelector/index.js +6 -12
- package/ui/Icons.d.ts +1 -1
- package/ui/Icons.js +45 -69
- package/ui/Logo.js +57 -110
- package/ui/Menu.d.ts +1 -1
- package/ui/Menu.js +232 -355
- package/ui/PrerenderedCanvas.js +63 -78
- package/ui/ResizeHandle.js +87 -114
- package/ui/ReturnToImportFormDialog.js +32 -59
- package/ui/SanitizedHTML.js +63 -52
- package/ui/Snackbar.js +74 -99
- package/ui/SnackbarModel.js +37 -51
- package/ui/Tooltip.d.ts +3 -1
- package/ui/Tooltip.js +49 -74
- package/ui/ViewContainer.js +113 -183
- package/ui/colors.d.ts +10 -0
- package/ui/colors.js +78 -0
- package/ui/index.js +51 -181
- package/ui/react-colorful.d.ts +17 -0
- package/ui/react-colorful.js +455 -0
- package/ui/theme.d.ts +279 -131
- package/ui/theme.js +197 -225
- package/util/Base1DUtils.d.ts +32 -0
- package/util/Base1DUtils.js +174 -0
- package/util/Base1DViewModel.d.ts +16 -37
- package/util/Base1DViewModel.js +116 -295
- package/util/QuickLRU.js +84 -332
- package/util/TimeTraveller.d.ts +19 -0
- package/util/TimeTraveller.js +86 -0
- package/util/aborting.js +49 -127
- package/util/analytics.js +91 -154
- package/util/blockTypes.js +106 -240
- package/util/calculateDynamicBlocks.js +98 -128
- package/util/calculateStaticBlocks.js +105 -125
- package/util/color/cssColorsLevel4.js +156 -160
- package/util/color/index.js +33 -55
- package/util/compositeMap.js +49 -333
- package/util/formatFastaStrings.js +9 -14
- package/util/idMaker.js +18 -31
- package/util/index.d.ts +18 -39
- package/util/index.js +743 -1236
- package/util/io/RemoteFileWithRangeCache.js +88 -257
- package/util/io/index.js +95 -169
- package/util/jexl.js +60 -115
- package/util/jexlStrings.js +24 -29
- package/util/layouts/BaseLayout.js +1 -4
- package/util/layouts/GranularRectLayout.js +388 -557
- package/util/layouts/MultiLayout.js +41 -109
- package/util/layouts/PrecomputedLayout.js +56 -114
- package/util/layouts/PrecomputedMultiLayout.js +22 -59
- package/util/layouts/SceneGraph.js +127 -197
- package/util/layouts/index.js +29 -66
- package/util/mst-reflection.js +55 -71
- package/util/offscreenCanvasPonyfill.js +66 -134
- package/util/offscreenCanvasUtils.d.ts +2 -7
- package/util/offscreenCanvasUtils.js +49 -146
- package/util/range.js +29 -40
- package/util/rxjs.js +20 -27
- package/util/simpleFeature.js +88 -152
- package/util/stats.js +91 -151
- package/util/tracks.js +130 -171
- package/util/types/index.d.ts +3 -3
- package/util/types/index.js +110 -179
- package/util/types/mst.d.ts +3 -3
- package/util/types/mst.js +91 -142
- package/util/types/util.js +1 -4
- package/util/when.js +54 -101
- package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
- package/BaseFeatureWidget/index.test.js +0 -51
- package/TextSearch/BaseResults.test.js +0 -42
- package/configuration/configurationSchema.test.js +0 -266
- package/configuration/configurationSlot.test.js +0 -69
- package/configuration/util.test.js +0 -39
- package/data_adapters/BaseAdapter.test.js +0 -200
- package/declare.d.js +0 -1
- package/pluggableElementTypes/RpcMethodType.test.js +0 -118
- package/pluggableElementTypes/renderers/declare.d.js +0 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
- package/rpc/BaseRpcDriver.test.js +0 -540
- package/rpc/declaration.d.js +0 -1
- package/ui/FatalErrorDialog.test.js +0 -82
- package/ui/SanitizedHTML.test.js +0 -36
- package/ui/theme.test.js +0 -111
- package/util/Base1DViewModel.test.js +0 -130
- package/util/calculateDynamicBlocks.test.js +0 -74
- package/util/calculateStaticBlocks.test.js +0 -297
- package/util/declare.d.js +0 -1
- package/util/formatFastaStrings.test.js +0 -40
- package/util/index.test.js +0 -213
- package/util/jexlStrings.test.js +0 -48
- package/util/layouts/GranularRectLayout.test.js +0 -99
- package/util/range.test.js +0 -64
- package/util/simpleFeature.test.js +0 -34
- package/util/stats.test.js +0 -172
package/configuration/util.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getConf = getConf;
|
|
9
|
-
exports.getTypeNamesFromExplicitlyTypedUnion = getTypeNamesFromExplicitlyTypedUnion;
|
|
10
|
-
exports.isBareConfigurationSchemaType = isBareConfigurationSchemaType;
|
|
11
|
-
exports.isConfigurationModel = isConfigurationModel;
|
|
12
|
-
exports.isConfigurationSchemaType = isConfigurationSchemaType;
|
|
13
|
-
exports.isConfigurationSlotType = isConfigurationSlotType;
|
|
14
|
-
exports.readConfObject = readConfObject;
|
|
15
|
-
|
|
16
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
|
-
|
|
20
|
-
var _mobxStateTree = require("mobx-state-tree");
|
|
21
|
-
|
|
22
|
-
var _mstReflection = require("../util/mst-reflection");
|
|
23
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isConfigurationSlotType = exports.isConfigurationModel = exports.isConfigurationSchemaType = exports.isBareConfigurationSchemaType = exports.getTypeNamesFromExplicitlyTypedUnion = exports.getConf = exports.readConfObject = void 0;
|
|
4
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
|
+
const mst_reflection_1 = require("../util/mst-reflection");
|
|
24
6
|
/**
|
|
25
7
|
* given a configuration model (an instance of a ConfigurationSchema),
|
|
26
8
|
* read the configuration variable at the given path
|
|
@@ -30,70 +12,63 @@ var _mstReflection = require("../util/mst-reflection");
|
|
|
30
12
|
* @param args - extra arguments e.g. for a feature callback,
|
|
31
13
|
* will be sent to each of the slotNames
|
|
32
14
|
*/
|
|
33
|
-
function readConfObject(confObject
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw new TypeError('must provide conf object to read');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!slotPath) {
|
|
42
|
-
return JSON.parse(JSON.stringify((0, _mobxStateTree.getSnapshot)(confObject)));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (typeof slotPath === 'string') {
|
|
46
|
-
var slot = confObject[slotPath]; // check for the subconf being a map if we don't find it immediately
|
|
47
|
-
|
|
48
|
-
if (!slot && (0, _mobxStateTree.isStateTreeNode)(confObject) && (0, _mobxStateTree.isMapType)((0, _mobxStateTree.getType)(confObject))) {
|
|
49
|
-
slot = confObject.get(slotPath);
|
|
15
|
+
function readConfObject(confObject, slotPath = undefined,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
args = {}) {
|
|
18
|
+
if (!confObject) {
|
|
19
|
+
throw new TypeError('must provide conf object to read');
|
|
50
20
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return undefined; // if we want to be very strict about config slots, we could uncomment the below
|
|
54
|
-
// instead of returning undefine
|
|
55
|
-
//
|
|
56
|
-
// const modelType = getType(model)
|
|
57
|
-
// const schemaType = model.configuration && getType(model.configuration)
|
|
58
|
-
// throw new Error(
|
|
59
|
-
// `no slot "${slotName}" found in ${modelType.name} configuration (${
|
|
60
|
-
// schemaType.name
|
|
61
|
-
// })`,
|
|
62
|
-
// )
|
|
21
|
+
if (!slotPath) {
|
|
22
|
+
return JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(confObject)));
|
|
63
23
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
24
|
+
if (typeof slotPath === 'string') {
|
|
25
|
+
let slot = confObject[slotPath];
|
|
26
|
+
// check for the subconf being a map if we don't find it immediately
|
|
27
|
+
if (!slot &&
|
|
28
|
+
(0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
|
|
29
|
+
(0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
|
|
30
|
+
slot = confObject.get(slotPath);
|
|
31
|
+
}
|
|
32
|
+
if (!slot) {
|
|
33
|
+
return undefined;
|
|
34
|
+
// if we want to be very strict about config slots, we could uncomment the below
|
|
35
|
+
// instead of returning undefine
|
|
36
|
+
//
|
|
37
|
+
// const modelType = getType(model)
|
|
38
|
+
// const schemaType = model.configuration && getType(model.configuration)
|
|
39
|
+
// throw new Error(
|
|
40
|
+
// `no slot "${slotName}" found in ${modelType.name} configuration (${
|
|
41
|
+
// schemaType.name
|
|
42
|
+
// })`,
|
|
43
|
+
// )
|
|
44
|
+
}
|
|
45
|
+
if (slot.expr) {
|
|
46
|
+
const appliedFunc = slot.expr.evalSync(args);
|
|
47
|
+
if ((0, mobx_state_tree_1.isStateTreeNode)(appliedFunc)) {
|
|
48
|
+
return JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(appliedFunc)));
|
|
49
|
+
}
|
|
50
|
+
return appliedFunc;
|
|
51
|
+
}
|
|
52
|
+
if ((0, mobx_state_tree_1.isStateTreeNode)(slot)) {
|
|
53
|
+
return JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(slot)));
|
|
54
|
+
}
|
|
55
|
+
return slot;
|
|
77
56
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
subConf = confObject.get(slotName);
|
|
57
|
+
const slotName = slotPath[0];
|
|
58
|
+
if (slotPath.length > 1) {
|
|
59
|
+
const newPath = slotPath.slice(1);
|
|
60
|
+
let subConf = confObject[slotName];
|
|
61
|
+
// check for the subconf being a map if we don't find it immediately
|
|
62
|
+
if (!subConf &&
|
|
63
|
+
(0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
|
|
64
|
+
(0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
|
|
65
|
+
subConf = confObject.get(slotName);
|
|
66
|
+
}
|
|
67
|
+
return subConf ? readConfObject(subConf, newPath, args) : undefined;
|
|
90
68
|
}
|
|
91
|
-
|
|
92
|
-
return subConf ? readConfObject(subConf, newPath, args) : undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return readConfObject(confObject, slotName, args);
|
|
69
|
+
return readConfObject(confObject, slotName, args);
|
|
96
70
|
}
|
|
71
|
+
exports.readConfObject = readConfObject;
|
|
97
72
|
/**
|
|
98
73
|
* helper method for readConfObject, reads the config from a mst model
|
|
99
74
|
*
|
|
@@ -102,25 +77,19 @@ function readConfObject(confObject) {
|
|
|
102
77
|
* @param args - extra arguments e.g. for a feature callback,
|
|
103
78
|
* will be sent to each of the slotNames
|
|
104
79
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
configuration = _ref.configuration;
|
|
117
|
-
|
|
118
|
-
if (isConfigurationModel(configuration)) {
|
|
119
|
-
return readConfObject(configuration, slotPath, args);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
throw new TypeError('cannot getConf on this model, it has no configuration');
|
|
80
|
+
function getConf(model, slotPath = undefined,
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
args = {}) {
|
|
83
|
+
if (!model) {
|
|
84
|
+
throw new TypeError('must provide a model object');
|
|
85
|
+
}
|
|
86
|
+
const { configuration } = model;
|
|
87
|
+
if (isConfigurationModel(configuration)) {
|
|
88
|
+
return readConfObject(configuration, slotPath, args);
|
|
89
|
+
}
|
|
90
|
+
throw new TypeError('cannot getConf on this model, it has no configuration');
|
|
123
91
|
}
|
|
92
|
+
exports.getConf = getConf;
|
|
124
93
|
/**
|
|
125
94
|
* given a union of explicitly typed configuration schema types,
|
|
126
95
|
* extract an array of the type names contained in the union
|
|
@@ -128,90 +97,79 @@ function getConf(model) {
|
|
|
128
97
|
* @param unionType -
|
|
129
98
|
* @returns Array of type names contained in the union
|
|
130
99
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
100
|
function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
101
|
+
if ((0, mobx_state_tree_1.isType)(maybeUnionType)) {
|
|
102
|
+
maybeUnionType = (0, mst_reflection_1.resolveLateType)(maybeUnionType);
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
if ((0, mobx_state_tree_1.isUnionType)(maybeUnionType)) {
|
|
105
|
+
const typeNames = [];
|
|
106
|
+
(0, mst_reflection_1.getUnionSubTypes)(maybeUnionType).forEach(type => {
|
|
107
|
+
type = (0, mst_reflection_1.resolveLateType)(type);
|
|
108
|
+
let typeName = getTypeNamesFromExplicitlyTypedUnion(type);
|
|
109
|
+
if (!typeName.length) {
|
|
110
|
+
const def = (0, mst_reflection_1.getDefaultValue)(type);
|
|
111
|
+
typeName = [def.type];
|
|
112
|
+
}
|
|
113
|
+
if (!typeName[0]) {
|
|
114
|
+
// debugger
|
|
115
|
+
throw new Error(`invalid config schema type ${type}`);
|
|
116
|
+
}
|
|
117
|
+
typeNames.push(...typeName);
|
|
118
|
+
});
|
|
119
|
+
return typeNames;
|
|
146
120
|
}
|
|
147
|
-
|
|
148
|
-
if (!typeName[0]) {
|
|
149
|
-
// debugger
|
|
150
|
-
throw new Error("invalid config schema type ".concat(type));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
typeNames.push.apply(typeNames, (0, _toConsumableArray2.default)(typeName));
|
|
154
|
-
});
|
|
155
|
-
return typeNames;
|
|
156
121
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return [];
|
|
122
|
+
return [];
|
|
160
123
|
}
|
|
161
|
-
|
|
124
|
+
exports.getTypeNamesFromExplicitlyTypedUnion = getTypeNamesFromExplicitlyTypedUnion;
|
|
162
125
|
function isBareConfigurationSchemaType(thing) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
126
|
+
if ((0, mobx_state_tree_1.isType)(thing)) {
|
|
127
|
+
if ((0, mobx_state_tree_1.isModelType)(thing) &&
|
|
128
|
+
('isJBrowseConfigurationSchema' in thing ||
|
|
129
|
+
thing.name.includes('ConfigurationSchema'))) {
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
// if it's a late type, assume its a config schema
|
|
133
|
+
if ((0, mobx_state_tree_1.isLateType)(thing)) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
171
136
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
return false;
|
|
137
|
+
return false;
|
|
175
138
|
}
|
|
176
|
-
|
|
139
|
+
exports.isBareConfigurationSchemaType = isBareConfigurationSchemaType;
|
|
177
140
|
function isConfigurationSchemaType(thing) {
|
|
178
|
-
|
|
141
|
+
if (!(0, mobx_state_tree_1.isType)(thing)) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
// written as a series of if-statements instead of a big logical OR
|
|
145
|
+
// because this construction gives much better debugging backtraces.
|
|
146
|
+
// also, note that the order of these statements matters, because
|
|
147
|
+
// for example some union types are also optional types
|
|
148
|
+
if (isBareConfigurationSchemaType(thing)) {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
if ((0, mobx_state_tree_1.isUnionType)(thing)) {
|
|
152
|
+
return (0, mst_reflection_1.getUnionSubTypes)(thing).every(t => isConfigurationSchemaType(t) || t.name === 'undefined');
|
|
153
|
+
}
|
|
154
|
+
if ((0, mobx_state_tree_1.isOptionalType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
if ((0, mobx_state_tree_1.isArrayType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
if ((0, mobx_state_tree_1.isMapType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
179
163
|
return false;
|
|
180
|
-
} // written as a series of if-statements instead of a big logical OR
|
|
181
|
-
// because this construction gives much better debugging backtraces.
|
|
182
|
-
// also, note that the order of these statements matters, because
|
|
183
|
-
// for example some union types are also optional types
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (isBareConfigurationSchemaType(thing)) {
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if ((0, _mobxStateTree.isUnionType)(thing)) {
|
|
191
|
-
return (0, _mstReflection.getUnionSubTypes)(thing).every(function (t) {
|
|
192
|
-
return isConfigurationSchemaType(t) || t.name === 'undefined';
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if ((0, _mobxStateTree.isOptionalType)(thing) && isConfigurationSchemaType((0, _mstReflection.getSubType)(thing))) {
|
|
197
|
-
return true;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if ((0, _mobxStateTree.isArrayType)(thing) && isConfigurationSchemaType((0, _mstReflection.getSubType)(thing))) {
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if ((0, _mobxStateTree.isMapType)(thing) && isConfigurationSchemaType((0, _mstReflection.getSubType)(thing))) {
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return false;
|
|
209
164
|
}
|
|
210
|
-
|
|
165
|
+
exports.isConfigurationSchemaType = isConfigurationSchemaType;
|
|
211
166
|
function isConfigurationModel(thing) {
|
|
212
|
-
|
|
167
|
+
return (0, mobx_state_tree_1.isStateTreeNode)(thing) && isConfigurationSchemaType((0, mobx_state_tree_1.getType)(thing));
|
|
213
168
|
}
|
|
214
|
-
|
|
169
|
+
exports.isConfigurationModel = isConfigurationModel;
|
|
215
170
|
function isConfigurationSlotType(thing) {
|
|
216
|
-
|
|
217
|
-
|
|
171
|
+
return (typeof thing === 'object' &&
|
|
172
|
+
thing !== null &&
|
|
173
|
+
'isJBrowseConfigurationSlot' in thing);
|
|
174
|
+
}
|
|
175
|
+
exports.isConfigurationSlotType = isConfigurationSlotType;
|
|
@@ -34,6 +34,7 @@ export declare abstract class BaseAdapter {
|
|
|
34
34
|
id: string;
|
|
35
35
|
static capabilities: string[];
|
|
36
36
|
constructor(config?: AnyConfigurationModel, getSubAdapter?: getSubAdapterType | undefined, pluginManager?: PluginManager | undefined);
|
|
37
|
+
getConf(arg: string | string[]): any;
|
|
37
38
|
/**
|
|
38
39
|
* Called to provide a hint that data tied to a certain region will not be
|
|
39
40
|
* needed for the forseeable future and can be purged from caches, etc
|
|
@@ -59,11 +60,10 @@ export declare abstract class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
59
60
|
* @param opts - Feature adapter options
|
|
60
61
|
*/
|
|
61
62
|
abstract getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
62
|
-
getConf(arg: string | string[]): any;
|
|
63
63
|
/**
|
|
64
64
|
* Get features from the data source that overlap a region
|
|
65
65
|
* @param region - Region
|
|
66
|
-
* @param
|
|
66
|
+
* @param opts - Feature adapter options
|
|
67
67
|
* @returns Observable of Feature objects in the region
|
|
68
68
|
*/
|
|
69
69
|
abstract getFeatures(region: Region, opts?: BaseOptions): Observable<Feature>;
|