@jbrowse/core 2.4.1 → 2.5.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/ArrayValue.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +46 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +15 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +69 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicField.d.ts +17 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicField.js +23 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +12 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +26 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.d.ts +14 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.js +98 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +32 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +17 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +31 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +6 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +13 -0
- package/BaseFeatureWidget/{BaseFeatureDetail.d.ts → BaseFeatureDetail/index.d.ts} +5 -7
- package/BaseFeatureWidget/{BaseFeatureDetail.js → BaseFeatureDetail/index.js} +12 -9
- package/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +4 -0
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +23 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.d.ts +12 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.js +25 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.d.ts +5 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.js +12 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.d.ts +5 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.js +14 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.js +18 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +146 -0
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.d.ts → SequenceFeatureDetails/SequenceFeatureSettingsDialog.d.ts} +0 -1
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.js → SequenceFeatureDetails/SequenceFeatureSettingsDialog.js} +1 -1
- package/BaseFeatureWidget/{SequenceHelpDialog.d.ts → SequenceFeatureDetails/SequenceHelpDialog.d.ts} +0 -1
- package/BaseFeatureWidget/{SequenceHelpDialog.js → SequenceFeatureDetails/SequenceHelpDialog.js} +6 -9
- package/BaseFeatureWidget/{SequencePanel.d.ts → SequenceFeatureDetails/SequencePanel.d.ts} +1 -1
- package/BaseFeatureWidget/{SequencePanel.js → SequenceFeatureDetails/SequencePanel.js} +10 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +73 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.js +68 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +11 -0
- package/BaseFeatureWidget/index.d.ts +5 -2
- package/BaseFeatureWidget/index.js +29 -20
- package/BaseFeatureWidget/types.d.ts +2 -2
- package/Plugin.d.ts +1 -1
- package/PluginLoader.js +17 -0
- package/PluginManager.d.ts +6 -5
- package/PluginManager.js +3 -0
- package/ReExports/list.js +1 -0
- package/ReExports/modules.d.ts +6 -5
- package/ReExports/modules.js +7 -4
- package/TextSearch/TextSearchManager.d.ts +2 -9
- package/assemblyManager/assembly.d.ts +91 -8
- package/assemblyManager/assembly.js +92 -8
- package/assemblyManager/assemblyConfigSchema.d.ts +50 -1
- package/assemblyManager/assemblyManager.d.ts +115 -58
- package/assemblyManager/assemblyManager.js +60 -12
- package/configuration/configurationSchema.d.ts +13 -13
- package/configuration/configurationSchema.js +4 -2
- package/configuration/configurationSlot.d.ts +1 -0
- package/configuration/index.d.ts +1 -1
- package/configuration/types.d.ts +13 -0
- package/configuration/types.js +2 -0
- package/configuration/util.d.ts +5 -3
- package/configuration/util.js +18 -18
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +23 -0
- package/data_adapters/BaseAdapter/BaseAdapter.js +37 -0
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +128 -0
- package/data_adapters/{BaseAdapter.js → BaseAdapter/BaseFeatureDataAdapter.js} +58 -88
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +16 -0
- package/data_adapters/BaseAdapter/BaseOptions.js +2 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +9 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +2 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +13 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +10 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +2 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.js +2 -0
- package/data_adapters/BaseAdapter/index.d.ts +15 -0
- package/data_adapters/BaseAdapter/index.js +25 -0
- package/data_adapters/BaseAdapter/types.d.ts +21 -0
- package/data_adapters/BaseAdapter/types.js +2 -0
- package/data_adapters/BaseAdapter/util.d.ts +12 -0
- package/data_adapters/BaseAdapter/util.js +23 -0
- package/data_adapters/CytobandAdapter/configSchema.d.ts +11 -1
- package/package.json +4 -5
- package/pluggableElementTypes/AdapterType.d.ts +1 -1
- package/pluggableElementTypes/ConnectionType.d.ts +1 -1
- package/pluggableElementTypes/DisplayType.d.ts +1 -1
- package/pluggableElementTypes/InternetAccountType.d.ts +1 -1
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.js +3 -2
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +30 -0
- package/pluggableElementTypes/models/InternetAccountModel.js +6 -1
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +18 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +42 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +118 -1
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -1
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +0 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +0 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/rpc/RpcManager.d.ts +8 -1
- package/rpc/RpcManager.js +1 -1
- package/rpc/baseRpcConfig.d.ts +10 -1
- package/rpc/configSchema.d.ts +14 -1
- package/rpc/coreRpcMethods.d.ts +1 -1
- package/rpc/coreRpcMethods.js +3 -3
- package/rpc/mainThreadRpcConfig.d.ts +7 -1
- package/rpc/methods/{CoreEstimateRegionStats.d.ts → CoreGetFeatureDensityStats.d.ts} +2 -2
- package/rpc/methods/{CoreEstimateRegionStats.js → CoreGetFeatureDensityStats.js} +4 -4
- package/rpc/methods/CoreGetFeatureDetails.js +5 -5
- package/rpc/webWorkerRpcConfig.d.ts +7 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.d.ts +0 -1
- package/ui/AppLogo.d.ts +0 -1
- package/ui/AssemblySelector.d.ts +0 -1
- package/ui/CascadingMenu.d.ts +0 -1
- package/ui/ColorPicker.d.ts +0 -1
- package/ui/Dialog.d.ts +0 -1
- package/ui/Dialog.js +14 -1
- package/ui/DrawerWidget.d.ts +1 -2
- package/ui/DrawerWidget.js +5 -3
- package/ui/DropDownMenu.d.ts +0 -1
- package/ui/ErrorMessage.d.ts +0 -1
- package/ui/FactoryResetDialog.d.ts +0 -1
- package/ui/FatalErrorDialog.d.ts +0 -1
- package/ui/FileSelector/FileSelector.d.ts +0 -1
- package/ui/FileSelector/LocalFileChooser.d.ts +0 -1
- package/ui/FileSelector/UrlChooser.d.ts +0 -1
- package/ui/Icons.d.ts +0 -1
- package/ui/LoadingEllipses.d.ts +0 -1
- package/ui/Logo.d.ts +0 -1
- package/ui/PrerenderedCanvas.d.ts +0 -1
- package/ui/ResizeBar.js +1 -1
- package/ui/ResizeHandle.d.ts +0 -1
- package/ui/ReturnToImportFormDialog.d.ts +0 -1
- package/ui/SanitizedHTML.d.ts +0 -1
- package/ui/SanitizedHTML.js +6 -0
- package/ui/Snackbar.d.ts +0 -1
- package/ui/Tooltip.d.ts +0 -1
- package/ui/ViewContainer.d.ts +2 -3
- package/ui/ViewContainer.js +7 -39
- package/ui/ViewContainerTitle.d.ts +5 -0
- package/ui/ViewContainerTitle.js +42 -0
- package/ui/ViewLauncher.d.ts +0 -1
- package/ui/ViewMenu.d.ts +1 -2
- package/ui/ViewPanel.d.ts +0 -1
- package/ui/react-colorful.d.ts +1 -1
- package/ui/theme.js +3 -18
- package/util/index.d.ts +9 -4
- package/util/index.js +30 -6
- package/util/io/index.d.ts +3 -1
- package/util/io/index.js +9 -4
- package/util/layouts/PrecomputedMultiLayout.d.ts +1 -1
- package/util/mst-reflection.d.ts +12 -17
- package/util/mst-reflection.js +13 -12
- package/util/stats.d.ts +5 -5
- package/util/types/index.d.ts +4 -1
- package/util/types/mst.d.ts +12 -9
- package/util/useMeasure.d.ts +5 -0
- package/util/useMeasure.js +34 -0
- package/BaseFeatureWidget/SequenceBox.d.ts +0 -29
- package/BaseFeatureWidget/SequenceBox.js +0 -63
- package/BaseFeatureWidget/SequenceFeatureDetails.d.ts +0 -3
- package/BaseFeatureWidget/SequenceFeatureDetails.js +0 -237
- package/data_adapters/BaseAdapter.d.ts +0 -138
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.d.ts +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.js +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.d.ts +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.js +0 -0
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { IAnyType } from 'mobx-state-tree';
|
|
2
2
|
import { Assembly } from './assembly';
|
|
3
3
|
import PluginManager from '../PluginManager';
|
|
4
|
+
import RpcManager from '../rpc/RpcManager';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel AssemblyManager
|
|
7
|
+
*/
|
|
4
8
|
declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): import("mobx-state-tree").IModelType<{
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
* this is automatically managed by an autorun which looks in the parent
|
|
12
|
+
* session.assemblies, session.sessionAssemblies, and
|
|
13
|
+
* session.temporaryAssemblies
|
|
14
|
+
*/
|
|
5
15
|
assemblies: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
6
16
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
|
|
7
17
|
}, {
|
|
@@ -10,10 +20,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
10
20
|
loadingP: Promise<void> | undefined;
|
|
11
21
|
volatileRegions: import("./assembly").BasicRegion[] | undefined;
|
|
12
22
|
refNameAliases: {
|
|
13
|
-
[x: string]: string;
|
|
23
|
+
[x: string]: string | undefined;
|
|
14
24
|
} | undefined;
|
|
15
25
|
lowerCaseRefNameAliases: {
|
|
16
|
-
[x: string]: string;
|
|
26
|
+
[x: string]: string | undefined;
|
|
17
27
|
} | undefined;
|
|
18
28
|
cytobands: import("../util").Feature[] | undefined;
|
|
19
29
|
} & {
|
|
@@ -27,12 +37,12 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
27
37
|
readonly allRefNames: string[] | undefined;
|
|
28
38
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
29
39
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
30
|
-
readonly rpcManager:
|
|
40
|
+
readonly rpcManager: RpcManager;
|
|
31
41
|
readonly refNameColors: string[];
|
|
32
42
|
} & {
|
|
33
43
|
readonly refNames: string[] | undefined;
|
|
34
44
|
} & {
|
|
35
|
-
getCanonicalRefName(refName: string): string;
|
|
45
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
36
46
|
getRefNameColor(refName: string): string | undefined;
|
|
37
47
|
isValidRefName(refName: string): boolean;
|
|
38
48
|
} & {
|
|
@@ -40,24 +50,27 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
40
50
|
setError(e: unknown): void;
|
|
41
51
|
setRegions(regions: import("../util").Region[]): void;
|
|
42
52
|
setRefNameAliases(aliases: {
|
|
43
|
-
[x: string]: string;
|
|
53
|
+
[x: string]: string | undefined;
|
|
44
54
|
}, lcAliases: {
|
|
45
|
-
[x: string]: string;
|
|
55
|
+
[x: string]: string | undefined;
|
|
46
56
|
}): void;
|
|
47
57
|
setCytobands(cytobands: import("../util").Feature[]): void;
|
|
48
58
|
setLoadingP(p?: Promise<void> | undefined): void;
|
|
49
59
|
load(): Promise<void>;
|
|
50
60
|
loadPre(): Promise<void>;
|
|
51
61
|
} & {
|
|
52
|
-
getAdapterMapEntry(adapterConf: unknown, options: import("
|
|
53
|
-
getRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
54
|
-
[x: string]: string;
|
|
62
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("../data_adapters/BaseAdapter").BaseOptions): Promise<import("./assembly").RefNameMap>;
|
|
63
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
64
|
+
[x: string]: string | undefined;
|
|
55
65
|
}>;
|
|
56
|
-
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
57
|
-
[x: string]: string;
|
|
66
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
67
|
+
[x: string]: string | undefined;
|
|
58
68
|
}>;
|
|
59
69
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
60
70
|
}, {
|
|
71
|
+
/**
|
|
72
|
+
* #method
|
|
73
|
+
*/
|
|
61
74
|
get(asmName: string): ({
|
|
62
75
|
configuration: any;
|
|
63
76
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -66,10 +79,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
66
79
|
loadingP: Promise<void> | undefined;
|
|
67
80
|
volatileRegions: import("./assembly").BasicRegion[] | undefined;
|
|
68
81
|
refNameAliases: {
|
|
69
|
-
[x: string]: string;
|
|
82
|
+
[x: string]: string | undefined;
|
|
70
83
|
} | undefined;
|
|
71
84
|
lowerCaseRefNameAliases: {
|
|
72
|
-
[x: string]: string;
|
|
85
|
+
[x: string]: string | undefined;
|
|
73
86
|
} | undefined;
|
|
74
87
|
cytobands: import("../util").Feature[] | undefined;
|
|
75
88
|
} & {
|
|
@@ -83,12 +96,12 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
83
96
|
readonly allRefNames: string[] | undefined;
|
|
84
97
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
85
98
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
86
|
-
readonly rpcManager:
|
|
99
|
+
readonly rpcManager: RpcManager;
|
|
87
100
|
readonly refNameColors: string[];
|
|
88
101
|
} & {
|
|
89
102
|
readonly refNames: string[] | undefined;
|
|
90
103
|
} & {
|
|
91
|
-
getCanonicalRefName(refName: string): string;
|
|
104
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
92
105
|
getRefNameColor(refName: string): string | undefined;
|
|
93
106
|
isValidRefName(refName: string): boolean;
|
|
94
107
|
} & {
|
|
@@ -96,21 +109,21 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
96
109
|
setError(e: unknown): void;
|
|
97
110
|
setRegions(regions: import("../util").Region[]): void;
|
|
98
111
|
setRefNameAliases(aliases: {
|
|
99
|
-
[x: string]: string;
|
|
112
|
+
[x: string]: string | undefined;
|
|
100
113
|
}, lcAliases: {
|
|
101
|
-
[x: string]: string;
|
|
114
|
+
[x: string]: string | undefined;
|
|
102
115
|
}): void;
|
|
103
116
|
setCytobands(cytobands: import("../util").Feature[]): void;
|
|
104
117
|
setLoadingP(p?: Promise<void> | undefined): void;
|
|
105
118
|
load(): Promise<void>;
|
|
106
119
|
loadPre(): Promise<void>;
|
|
107
120
|
} & {
|
|
108
|
-
getAdapterMapEntry(adapterConf: unknown, options: import("
|
|
109
|
-
getRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
110
|
-
[x: string]: string;
|
|
121
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("../data_adapters/BaseAdapter").BaseOptions): Promise<import("./assembly").RefNameMap>;
|
|
122
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
123
|
+
[x: string]: string | undefined;
|
|
111
124
|
}>;
|
|
112
|
-
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
113
|
-
[x: string]: string;
|
|
125
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
126
|
+
[x: string]: string | undefined;
|
|
114
127
|
}>;
|
|
115
128
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
116
129
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
|
|
@@ -120,10 +133,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
120
133
|
loadingP: Promise<void> | undefined;
|
|
121
134
|
volatileRegions: import("./assembly").BasicRegion[] | undefined;
|
|
122
135
|
refNameAliases: {
|
|
123
|
-
[x: string]: string;
|
|
136
|
+
[x: string]: string | undefined;
|
|
124
137
|
} | undefined;
|
|
125
138
|
lowerCaseRefNameAliases: {
|
|
126
|
-
[x: string]: string;
|
|
139
|
+
[x: string]: string | undefined;
|
|
127
140
|
} | undefined;
|
|
128
141
|
cytobands: import("../util").Feature[] | undefined;
|
|
129
142
|
} & {
|
|
@@ -137,12 +150,12 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
137
150
|
readonly allRefNames: string[] | undefined;
|
|
138
151
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
139
152
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
140
|
-
readonly rpcManager:
|
|
153
|
+
readonly rpcManager: RpcManager;
|
|
141
154
|
readonly refNameColors: string[];
|
|
142
155
|
} & {
|
|
143
156
|
readonly refNames: string[] | undefined;
|
|
144
157
|
} & {
|
|
145
|
-
getCanonicalRefName(refName: string): string;
|
|
158
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
146
159
|
getRefNameColor(refName: string): string | undefined;
|
|
147
160
|
isValidRefName(refName: string): boolean;
|
|
148
161
|
} & {
|
|
@@ -150,31 +163,44 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
150
163
|
setError(e: unknown): void;
|
|
151
164
|
setRegions(regions: import("../util").Region[]): void;
|
|
152
165
|
setRefNameAliases(aliases: {
|
|
153
|
-
[x: string]: string;
|
|
166
|
+
[x: string]: string | undefined;
|
|
154
167
|
}, lcAliases: {
|
|
155
|
-
[x: string]: string;
|
|
168
|
+
[x: string]: string | undefined;
|
|
156
169
|
}): void;
|
|
157
170
|
setCytobands(cytobands: import("../util").Feature[]): void;
|
|
158
171
|
setLoadingP(p?: Promise<void> | undefined): void;
|
|
159
172
|
load(): Promise<void>;
|
|
160
173
|
loadPre(): Promise<void>;
|
|
161
174
|
} & {
|
|
162
|
-
getAdapterMapEntry(adapterConf: unknown, options: import("
|
|
163
|
-
getRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
164
|
-
[x: string]: string;
|
|
175
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("../data_adapters/BaseAdapter").BaseOptions): Promise<import("./assembly").RefNameMap>;
|
|
176
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
177
|
+
[x: string]: string | undefined;
|
|
165
178
|
}>;
|
|
166
|
-
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
167
|
-
[x: string]: string;
|
|
179
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
180
|
+
[x: string]: string | undefined;
|
|
168
181
|
}>;
|
|
169
182
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* #getter
|
|
185
|
+
*/
|
|
170
186
|
readonly assemblyNamesList: any[];
|
|
187
|
+
/**
|
|
188
|
+
* #getter
|
|
189
|
+
* looks at jbrowse.assemblies, session.sessionAssemblies, and
|
|
190
|
+
* session.temporaryAssemblies to load from
|
|
191
|
+
*/
|
|
171
192
|
readonly assemblyList: ({
|
|
172
193
|
[x: string]: any;
|
|
173
194
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
174
195
|
setSubschema(slotName: string, data: unknown): any;
|
|
175
196
|
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
176
|
-
readonly rpcManager:
|
|
197
|
+
readonly rpcManager: RpcManager;
|
|
177
198
|
} & {
|
|
199
|
+
/**
|
|
200
|
+
* #method
|
|
201
|
+
* use this method instead of assemblyManager.get(assemblyName)
|
|
202
|
+
* to get an assembly with regions loaded
|
|
203
|
+
*/
|
|
178
204
|
waitForAssembly(assemblyName: string): Promise<({
|
|
179
205
|
configuration: any;
|
|
180
206
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -183,10 +209,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
183
209
|
loadingP: Promise<void> | undefined;
|
|
184
210
|
volatileRegions: import("./assembly").BasicRegion[] | undefined;
|
|
185
211
|
refNameAliases: {
|
|
186
|
-
[x: string]: string;
|
|
212
|
+
[x: string]: string | undefined;
|
|
187
213
|
} | undefined;
|
|
188
214
|
lowerCaseRefNameAliases: {
|
|
189
|
-
[x: string]: string;
|
|
215
|
+
[x: string]: string | undefined;
|
|
190
216
|
} | undefined;
|
|
191
217
|
cytobands: import("../util").Feature[] | undefined;
|
|
192
218
|
} & {
|
|
@@ -200,12 +226,12 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
200
226
|
readonly allRefNames: string[] | undefined;
|
|
201
227
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
202
228
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
203
|
-
readonly rpcManager:
|
|
229
|
+
readonly rpcManager: RpcManager;
|
|
204
230
|
readonly refNameColors: string[];
|
|
205
231
|
} & {
|
|
206
232
|
readonly refNames: string[] | undefined;
|
|
207
233
|
} & {
|
|
208
|
-
getCanonicalRefName(refName: string): string;
|
|
234
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
209
235
|
getRefNameColor(refName: string): string | undefined;
|
|
210
236
|
isValidRefName(refName: string): boolean;
|
|
211
237
|
} & {
|
|
@@ -213,21 +239,21 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
213
239
|
setError(e: unknown): void;
|
|
214
240
|
setRegions(regions: import("../util").Region[]): void;
|
|
215
241
|
setRefNameAliases(aliases: {
|
|
216
|
-
[x: string]: string;
|
|
242
|
+
[x: string]: string | undefined;
|
|
217
243
|
}, lcAliases: {
|
|
218
|
-
[x: string]: string;
|
|
244
|
+
[x: string]: string | undefined;
|
|
219
245
|
}): void;
|
|
220
246
|
setCytobands(cytobands: import("../util").Feature[]): void;
|
|
221
247
|
setLoadingP(p?: Promise<void> | undefined): void;
|
|
222
248
|
load(): Promise<void>;
|
|
223
249
|
loadPre(): Promise<void>;
|
|
224
250
|
} & {
|
|
225
|
-
getAdapterMapEntry(adapterConf: unknown, options: import("
|
|
226
|
-
getRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
227
|
-
[x: string]: string;
|
|
251
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("../data_adapters/BaseAdapter").BaseOptions): Promise<import("./assembly").RefNameMap>;
|
|
252
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
253
|
+
[x: string]: string | undefined;
|
|
228
254
|
}>;
|
|
229
|
-
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
230
|
-
[x: string]: string;
|
|
255
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
256
|
+
[x: string]: string | undefined;
|
|
231
257
|
}>;
|
|
232
258
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
233
259
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
|
|
@@ -237,10 +263,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
237
263
|
loadingP: Promise<void> | undefined;
|
|
238
264
|
volatileRegions: import("./assembly").BasicRegion[] | undefined;
|
|
239
265
|
refNameAliases: {
|
|
240
|
-
[x: string]: string;
|
|
266
|
+
[x: string]: string | undefined;
|
|
241
267
|
} | undefined;
|
|
242
268
|
lowerCaseRefNameAliases: {
|
|
243
|
-
[x: string]: string;
|
|
269
|
+
[x: string]: string | undefined;
|
|
244
270
|
} | undefined;
|
|
245
271
|
cytobands: import("../util").Feature[] | undefined;
|
|
246
272
|
} & {
|
|
@@ -254,12 +280,12 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
254
280
|
readonly allRefNames: string[] | undefined;
|
|
255
281
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
256
282
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
257
|
-
readonly rpcManager:
|
|
283
|
+
readonly rpcManager: RpcManager;
|
|
258
284
|
readonly refNameColors: string[];
|
|
259
285
|
} & {
|
|
260
286
|
readonly refNames: string[] | undefined;
|
|
261
287
|
} & {
|
|
262
|
-
getCanonicalRefName(refName: string): string;
|
|
288
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
263
289
|
getRefNameColor(refName: string): string | undefined;
|
|
264
290
|
isValidRefName(refName: string): boolean;
|
|
265
291
|
} & {
|
|
@@ -267,40 +293,71 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
|
|
|
267
293
|
setError(e: unknown): void;
|
|
268
294
|
setRegions(regions: import("../util").Region[]): void;
|
|
269
295
|
setRefNameAliases(aliases: {
|
|
270
|
-
[x: string]: string;
|
|
296
|
+
[x: string]: string | undefined;
|
|
271
297
|
}, lcAliases: {
|
|
272
|
-
[x: string]: string;
|
|
298
|
+
[x: string]: string | undefined;
|
|
273
299
|
}): void;
|
|
274
300
|
setCytobands(cytobands: import("../util").Feature[]): void;
|
|
275
301
|
setLoadingP(p?: Promise<void> | undefined): void;
|
|
276
302
|
load(): Promise<void>;
|
|
277
303
|
loadPre(): Promise<void>;
|
|
278
304
|
} & {
|
|
279
|
-
getAdapterMapEntry(adapterConf: unknown, options: import("
|
|
280
|
-
getRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
281
|
-
[x: string]: string;
|
|
305
|
+
getAdapterMapEntry(adapterConf: unknown, options: import("../data_adapters/BaseAdapter").BaseOptions): Promise<import("./assembly").RefNameMap>;
|
|
306
|
+
getRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
307
|
+
[x: string]: string | undefined;
|
|
282
308
|
}>;
|
|
283
|
-
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("
|
|
284
|
-
[x: string]: string;
|
|
309
|
+
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: import("../data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
310
|
+
[x: string]: string | undefined;
|
|
285
311
|
}>;
|
|
286
312
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined>;
|
|
313
|
+
/**
|
|
314
|
+
* #method
|
|
315
|
+
*/
|
|
287
316
|
getRefNameMapForAdapter(adapterConf: unknown, assemblyName: string | undefined, opts: {
|
|
288
317
|
signal?: AbortSignal;
|
|
289
318
|
sessionId: string;
|
|
290
319
|
}): Promise<{
|
|
291
|
-
[x: string]: string;
|
|
320
|
+
[x: string]: string | undefined;
|
|
292
321
|
} | undefined>;
|
|
322
|
+
/**
|
|
323
|
+
* #method
|
|
324
|
+
*/
|
|
293
325
|
getReverseRefNameMapForAdapter(adapterConf: unknown, assemblyName: string | undefined, opts: {
|
|
294
326
|
signal?: AbortSignal;
|
|
295
327
|
sessionId: string;
|
|
296
328
|
}): Promise<{
|
|
297
|
-
[x: string]: string;
|
|
329
|
+
[x: string]: string | undefined;
|
|
298
330
|
} | undefined>;
|
|
331
|
+
/**
|
|
332
|
+
* #method
|
|
333
|
+
*/
|
|
299
334
|
isValidRefName(refName: string, assemblyName: string): boolean;
|
|
300
335
|
} & {
|
|
301
336
|
afterAttach(): void;
|
|
337
|
+
/**
|
|
338
|
+
* #action
|
|
339
|
+
* private: you would generally want to add to manipulate
|
|
340
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
341
|
+
* session.temporaryAssemblies instead of using this directly
|
|
342
|
+
*/
|
|
302
343
|
removeAssembly(asm: Assembly): void;
|
|
344
|
+
/**
|
|
345
|
+
* #action
|
|
346
|
+
* private: you would generally want to add to manipulate
|
|
347
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
348
|
+
* session.temporaryAssemblies instead of using this directly
|
|
349
|
+
*
|
|
350
|
+
* this can take an active instance of an assembly, in which case it is
|
|
351
|
+
* referred to, or it can take an identifier e.g. assembly name, which is
|
|
352
|
+
* used as a reference. snapshots cannot be used
|
|
353
|
+
*/
|
|
303
354
|
addAssembly(configuration: any): void;
|
|
355
|
+
/**
|
|
356
|
+
* #action
|
|
357
|
+
* private: you would generally want to add to manipulate
|
|
358
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
359
|
+
* session.temporaryAssemblies instead of using this directly
|
|
360
|
+
*/
|
|
304
361
|
replaceAssembly(idx: number, configuration: any): void;
|
|
305
362
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
306
363
|
export default assemblyManagerFactory;
|
|
@@ -8,18 +8,38 @@ const util_1 = require("../util");
|
|
|
8
8
|
const mobx_1 = require("mobx");
|
|
9
9
|
const configuration_1 = require("../configuration");
|
|
10
10
|
const assembly_1 = __importDefault(require("./assembly"));
|
|
11
|
+
/**
|
|
12
|
+
* #stateModel AssemblyManager
|
|
13
|
+
*/
|
|
11
14
|
function assemblyManagerFactory(conf, pm) {
|
|
12
15
|
return mobx_state_tree_1.types
|
|
13
16
|
.model({
|
|
17
|
+
/**
|
|
18
|
+
* #property
|
|
19
|
+
* this is automatically managed by an autorun which looks in the parent
|
|
20
|
+
* session.assemblies, session.sessionAssemblies, and
|
|
21
|
+
* session.temporaryAssemblies
|
|
22
|
+
*/
|
|
14
23
|
assemblies: mobx_state_tree_1.types.array((0, assembly_1.default)(conf, pm)),
|
|
15
24
|
})
|
|
16
25
|
.views(self => ({
|
|
26
|
+
/**
|
|
27
|
+
* #method
|
|
28
|
+
*/
|
|
17
29
|
get(asmName) {
|
|
18
30
|
return self.assemblies.find(asm => asm.hasName(asmName));
|
|
19
31
|
},
|
|
32
|
+
/**
|
|
33
|
+
* #getter
|
|
34
|
+
*/
|
|
20
35
|
get assemblyNamesList() {
|
|
21
36
|
return this.assemblyList.map(asm => asm.name);
|
|
22
37
|
},
|
|
38
|
+
/**
|
|
39
|
+
* #getter
|
|
40
|
+
* looks at jbrowse.assemblies, session.sessionAssemblies, and
|
|
41
|
+
* session.temporaryAssemblies to load from
|
|
42
|
+
*/
|
|
23
43
|
get assemblyList() {
|
|
24
44
|
// name is the explicit identifier and can be accessed without getConf,
|
|
25
45
|
// hence the union with {name:string}
|
|
@@ -38,8 +58,11 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
38
58
|
},
|
|
39
59
|
}))
|
|
40
60
|
.views(self => ({
|
|
41
|
-
|
|
42
|
-
|
|
61
|
+
/**
|
|
62
|
+
* #method
|
|
63
|
+
* use this method instead of assemblyManager.get(assemblyName)
|
|
64
|
+
* to get an assembly with regions loaded
|
|
65
|
+
*/
|
|
43
66
|
async waitForAssembly(assemblyName) {
|
|
44
67
|
if (!assemblyName) {
|
|
45
68
|
throw new Error('no assembly name supplied to waitForAssembly');
|
|
@@ -65,6 +88,9 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
65
88
|
}
|
|
66
89
|
return assembly;
|
|
67
90
|
},
|
|
91
|
+
/**
|
|
92
|
+
* #method
|
|
93
|
+
*/
|
|
68
94
|
async getRefNameMapForAdapter(adapterConf, assemblyName, opts) {
|
|
69
95
|
if (assemblyName) {
|
|
70
96
|
const asm = await this.waitForAssembly(assemblyName);
|
|
@@ -72,6 +98,9 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
72
98
|
}
|
|
73
99
|
return {};
|
|
74
100
|
},
|
|
101
|
+
/**
|
|
102
|
+
* #method
|
|
103
|
+
*/
|
|
75
104
|
async getReverseRefNameMapForAdapter(adapterConf, assemblyName, opts) {
|
|
76
105
|
if (assemblyName) {
|
|
77
106
|
const asm = await this.waitForAssembly(assemblyName);
|
|
@@ -79,6 +108,9 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
79
108
|
}
|
|
80
109
|
return {};
|
|
81
110
|
},
|
|
111
|
+
/**
|
|
112
|
+
* #method
|
|
113
|
+
*/
|
|
82
114
|
isValidRefName(refName, assemblyName) {
|
|
83
115
|
const assembly = self.get(assemblyName);
|
|
84
116
|
if (assembly) {
|
|
@@ -89,31 +121,47 @@ function assemblyManagerFactory(conf, pm) {
|
|
|
89
121
|
}))
|
|
90
122
|
.actions(self => ({
|
|
91
123
|
afterAttach() {
|
|
92
|
-
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(
|
|
93
|
-
// have to slice it to be properly reacted to
|
|
94
|
-
() => self.assemblyList, assemblyConfigs => {
|
|
124
|
+
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.reaction)(() => self.assemblyList, assemblyConfs => {
|
|
95
125
|
self.assemblies.forEach(asm => {
|
|
96
126
|
if (!asm.configuration) {
|
|
97
127
|
this.removeAssembly(asm);
|
|
98
128
|
}
|
|
99
129
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.addAssembly(assemblyConfig);
|
|
130
|
+
assemblyConfs.forEach(conf => {
|
|
131
|
+
if (!self.assemblies.some(a => a.name === (0, configuration_1.readConfObject)(conf, 'name'))) {
|
|
132
|
+
this.addAssembly(conf);
|
|
104
133
|
}
|
|
105
134
|
});
|
|
106
135
|
}, { fireImmediately: true, name: 'assemblyManagerAfterAttach' }));
|
|
107
136
|
},
|
|
137
|
+
/**
|
|
138
|
+
* #action
|
|
139
|
+
* private: you would generally want to add to manipulate
|
|
140
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
141
|
+
* session.temporaryAssemblies instead of using this directly
|
|
142
|
+
*/
|
|
108
143
|
removeAssembly(asm) {
|
|
109
144
|
self.assemblies.remove(asm);
|
|
110
145
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
146
|
+
/**
|
|
147
|
+
* #action
|
|
148
|
+
* private: you would generally want to add to manipulate
|
|
149
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
150
|
+
* session.temporaryAssemblies instead of using this directly
|
|
151
|
+
*
|
|
152
|
+
* this can take an active instance of an assembly, in which case it is
|
|
153
|
+
* referred to, or it can take an identifier e.g. assembly name, which is
|
|
154
|
+
* used as a reference. snapshots cannot be used
|
|
155
|
+
*/
|
|
114
156
|
addAssembly(configuration) {
|
|
115
157
|
self.assemblies.push({ configuration });
|
|
116
158
|
},
|
|
159
|
+
/**
|
|
160
|
+
* #action
|
|
161
|
+
* private: you would generally want to add to manipulate
|
|
162
|
+
* jbrowse.assemblies, session.sessionAssemblies, or
|
|
163
|
+
* session.temporaryAssemblies instead of using this directly
|
|
164
|
+
*/
|
|
117
165
|
replaceAssembly(idx, configuration) {
|
|
118
166
|
self.assemblies[idx] = (0, mobx_state_tree_1.cast)({ configuration });
|
|
119
167
|
},
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IAnyType } from 'mobx-state-tree';
|
|
2
2
|
import { ConfigSlotDefinition } from './configurationSlot';
|
|
3
|
+
import { AnyConfigurationSchemaType } from './types';
|
|
4
|
+
export type { AnyConfigurationSchemaType, AnyConfigurationModel, AnyConfigurationSlot, AnyConfigurationSlotType, } from './types';
|
|
3
5
|
export interface ConfigurationSchemaDefinition {
|
|
4
6
|
[n: string]: ConfigSlotDefinition | ConfigurationSchemaDefinition | string | number | IAnyType;
|
|
5
7
|
}
|
|
6
|
-
interface ConfigurationSchemaOptions {
|
|
8
|
+
export interface ConfigurationSchemaOptions<BASE_SCHEMA extends AnyConfigurationSchemaType | undefined, EXPLICIT_IDENTIFIER extends string | undefined> {
|
|
7
9
|
explicitlyTyped?: boolean;
|
|
8
|
-
explicitIdentifier?:
|
|
10
|
+
explicitIdentifier?: EXPLICIT_IDENTIFIER;
|
|
9
11
|
implicitIdentifier?: string | boolean;
|
|
10
|
-
baseConfiguration?:
|
|
12
|
+
baseConfiguration?: BASE_SCHEMA;
|
|
11
13
|
actions?: (self: unknown) => any;
|
|
12
14
|
views?: (self: unknown) => any;
|
|
13
15
|
extend?: (self: unknown) => any;
|
|
14
16
|
preProcessSnapshot?: (snapshot: {}) => {};
|
|
15
17
|
}
|
|
16
|
-
declare function makeConfigurationSchemaModel<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions
|
|
18
|
+
declare function makeConfigurationSchemaModel<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions<any, any>>(modelName: string, schemaDefinition: DEFINITION, options: OPTIONS): import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<Record<string, any>, {
|
|
17
19
|
setSubschema(slotName: string, data: unknown): any;
|
|
18
20
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
19
|
-
export interface
|
|
21
|
+
export interface ConfigurationSchemaType<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions<any, any>> extends ReturnType<typeof makeConfigurationSchemaModel<DEFINITION, OPTIONS>> {
|
|
20
22
|
isJBrowseConfigurationSchema: boolean;
|
|
21
|
-
jbrowseSchemaDefinition:
|
|
22
|
-
jbrowseSchemaOptions:
|
|
23
|
+
jbrowseSchemaDefinition: DEFINITION;
|
|
24
|
+
jbrowseSchemaOptions: OPTIONS;
|
|
23
25
|
type: string;
|
|
26
|
+
[key: string]: unknown;
|
|
24
27
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export declare function ConfigurationSchema<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions>(modelName: string, inputSchemaDefinition: DEFINITION, inputOptions?: OPTIONS): AnyConfigurationSchemaType;
|
|
28
|
-
export declare function ConfigurationReference(schemaType: IAnyType): import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
29
|
-
export {};
|
|
28
|
+
export declare function ConfigurationSchema<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions<BASE_SCHEMA, EXPLICIT_IDENTIFIER>, BASE_SCHEMA extends AnyConfigurationSchemaType | undefined = undefined, EXPLICIT_IDENTIFIER extends string | undefined = undefined>(modelName: string, inputSchemaDefinition: DEFINITION, inputOptions?: ConfigurationSchemaOptions<BASE_SCHEMA, EXPLICIT_IDENTIFIER>): ConfigurationSchemaType<DEFINITION, OPTIONS>;
|
|
29
|
+
export declare function ConfigurationReference<SCHEMATYPE extends AnyConfigurationSchemaType>(schemaType: SCHEMATYPE): SCHEMATYPE;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ConfigurationReference = exports.ConfigurationSchema = void 0;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
8
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
9
|
const mst_1 = require("../util/types/mst");
|
|
9
10
|
const configurationSlot_1 = __importDefault(require("./configurationSlot"));
|
|
@@ -41,7 +42,6 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
|
|
|
41
42
|
}
|
|
42
43
|
function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
|
|
43
44
|
// now assemble the MST model of the configuration schema
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
45
|
const modelDefinition = {};
|
|
46
46
|
let identifier;
|
|
47
47
|
if (options.explicitlyTyped) {
|
|
@@ -70,7 +70,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
|
|
|
70
70
|
identifier = 'id';
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
73
|
const volatileConstants = {
|
|
75
74
|
isJBrowseConfigurationSchema: true,
|
|
76
75
|
jbrowseSchema: {
|
|
@@ -181,6 +180,9 @@ function ConfigurationSchema(modelName, inputSchemaDefinition, inputOptions) {
|
|
|
181
180
|
}
|
|
182
181
|
exports.ConfigurationSchema = ConfigurationSchema;
|
|
183
182
|
function ConfigurationReference(schemaType) {
|
|
183
|
+
// we cast this to SCHEMATYPE, because the reference *should* behave just
|
|
184
|
+
// like the object it points to. It won't be undefined (this is a
|
|
185
|
+
// `reference`, not a `safeReference`)
|
|
184
186
|
return mobx_state_tree_1.types.union(mobx_state_tree_1.types.reference(schemaType), schemaType);
|
|
185
187
|
}
|
|
186
188
|
exports.ConfigurationReference = ConfigurationReference;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAnyModelType, IAnyComplexType } from 'mobx-state-tree';
|
|
2
2
|
export interface ConfigSlotDefinition {
|
|
3
|
+
/** human-readable description of the slot's meaning */
|
|
3
4
|
description?: string;
|
|
4
5
|
/** custom base MST model for the slot's value */
|
|
5
6
|
model?: IAnyModelType | IAnyComplexType;
|
package/configuration/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ConfigurationSchema, ConfigurationReference, } from './configurationSchema';
|
|
2
|
-
export type { AnyConfigurationModel,
|
|
2
|
+
export type { AnyConfigurationSchemaType, AnyConfigurationModel, AnyConfigurationSlot, AnyConfigurationSlotType, } from './types';
|
|
3
3
|
export * from './util';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IStateTreeNode, Instance } from 'mobx-state-tree';
|
|
2
|
+
import type { ConfigurationSchemaType, ConfigurationSchemaOptions } from './configurationSchema';
|
|
3
|
+
import type ConfigSlot from './configurationSlot';
|
|
4
|
+
export type GetOptions<SCHEMA> = SCHEMA extends ConfigurationSchemaType<any, infer OPTIONS> ? OPTIONS : never;
|
|
5
|
+
export type GetBase<SCHEMA> = SCHEMA extends undefined ? never : GetOptions<SCHEMA> extends ConfigurationSchemaOptions<undefined, any> ? undefined : GetOptions<SCHEMA> extends ConfigurationSchemaOptions<infer BASE extends AnyConfigurationSchemaType, any> ? BASE : never;
|
|
6
|
+
export type GetExplicitIdentifier<SCHEMA> = GetOptions<SCHEMA> extends ConfigurationSchemaOptions<any, infer EXPLICIT_IDENTIFIER extends string> ? EXPLICIT_IDENTIFIER : never;
|
|
7
|
+
export type ConfigurationSchemaForModel<MODEL> = MODEL extends IStateTreeNode<infer SCHEMA extends AnyConfigurationSchemaType> ? SCHEMA : never;
|
|
8
|
+
export type ConfigurationSlotName<SCHEMA> = SCHEMA extends undefined ? never : SCHEMA extends ConfigurationSchemaType<infer D, any> ? (keyof D & string) | GetExplicitIdentifier<SCHEMA> | (GetBase<SCHEMA> extends ConfigurationSchemaType<any, any> ? ConfigurationSlotName<GetBase<SCHEMA>> : never) : never;
|
|
9
|
+
export type AnyConfigurationSchemaType = ConfigurationSchemaType<any, any>;
|
|
10
|
+
export type AnyConfigurationModel = Instance<AnyConfigurationSchemaType>;
|
|
11
|
+
export type AnyConfigurationSlotType = ReturnType<typeof ConfigSlot>;
|
|
12
|
+
export type AnyConfigurationSlot = Instance<AnyConfigurationSlotType>;
|
|
13
|
+
export type ConfigurationModel<SCHEMA extends AnyConfigurationSchemaType> = Instance<SCHEMA>;
|