@jbrowse/core 2.4.2 → 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.
Files changed (164) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +16 -0
  2. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +46 -0
  3. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +15 -0
  4. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +69 -0
  5. package/BaseFeatureWidget/BaseFeatureDetail/BasicField.d.ts +17 -0
  6. package/BaseFeatureWidget/BaseFeatureDetail/BasicField.js +23 -0
  7. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +12 -0
  8. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +26 -0
  9. package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.d.ts +14 -0
  10. package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.js +98 -0
  11. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +16 -0
  12. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +32 -0
  13. package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +17 -0
  14. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +31 -0
  15. package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +6 -0
  16. package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +13 -0
  17. package/BaseFeatureWidget/{BaseFeatureDetail.d.ts → BaseFeatureDetail/index.d.ts} +4 -4
  18. package/BaseFeatureWidget/{BaseFeatureDetail.js → BaseFeatureDetail/index.js} +12 -9
  19. package/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +4 -0
  20. package/BaseFeatureWidget/BaseFeatureDetail/util.js +23 -0
  21. package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.d.ts +12 -0
  22. package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.js +25 -0
  23. package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.d.ts +5 -0
  24. package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.js +12 -0
  25. package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.d.ts +5 -0
  26. package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.js +14 -0
  27. package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +8 -0
  28. package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.js +18 -0
  29. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -0
  30. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +146 -0
  31. package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.d.ts → SequenceFeatureDetails/SequenceFeatureSettingsDialog.d.ts} +0 -1
  32. package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.js → SequenceFeatureDetails/SequenceFeatureSettingsDialog.js} +1 -1
  33. package/BaseFeatureWidget/{SequenceHelpDialog.d.ts → SequenceFeatureDetails/SequenceHelpDialog.d.ts} +0 -1
  34. package/BaseFeatureWidget/{SequenceHelpDialog.js → SequenceFeatureDetails/SequenceHelpDialog.js} +6 -9
  35. package/BaseFeatureWidget/{SequencePanel.d.ts → SequenceFeatureDetails/SequencePanel.d.ts} +1 -1
  36. package/BaseFeatureWidget/{SequencePanel.js → SequenceFeatureDetails/SequencePanel.js} +10 -8
  37. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +10 -0
  38. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +73 -0
  39. package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +2 -0
  40. package/BaseFeatureWidget/SequenceFeatureDetails/index.js +68 -0
  41. package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +6 -0
  42. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +11 -0
  43. package/BaseFeatureWidget/index.d.ts +4 -1
  44. package/BaseFeatureWidget/index.js +29 -17
  45. package/BaseFeatureWidget/types.d.ts +2 -2
  46. package/Plugin.d.ts +1 -1
  47. package/PluginLoader.js +17 -0
  48. package/PluginManager.d.ts +5 -2
  49. package/PluginManager.js +3 -0
  50. package/ReExports/list.js +1 -0
  51. package/ReExports/modules.d.ts +5 -2
  52. package/ReExports/modules.js +7 -4
  53. package/TextSearch/TextSearchManager.d.ts +2 -9
  54. package/assemblyManager/assembly.d.ts +91 -8
  55. package/assemblyManager/assembly.js +92 -8
  56. package/assemblyManager/assemblyConfigSchema.d.ts +50 -1
  57. package/assemblyManager/assemblyManager.d.ts +115 -58
  58. package/assemblyManager/assemblyManager.js +60 -12
  59. package/configuration/configurationSchema.d.ts +14 -16
  60. package/configuration/configurationSchema.js +4 -2
  61. package/configuration/index.d.ts +1 -1
  62. package/configuration/types.d.ts +13 -0
  63. package/configuration/types.js +2 -0
  64. package/configuration/util.d.ts +5 -3
  65. package/configuration/util.js +18 -18
  66. package/data_adapters/BaseAdapter/BaseAdapter.d.ts +23 -0
  67. package/data_adapters/BaseAdapter/BaseAdapter.js +37 -0
  68. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +128 -0
  69. package/data_adapters/{BaseAdapter.js → BaseAdapter/BaseFeatureDataAdapter.js} +58 -88
  70. package/data_adapters/BaseAdapter/BaseOptions.d.ts +16 -0
  71. package/data_adapters/BaseAdapter/BaseOptions.js +2 -0
  72. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +9 -0
  73. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +2 -0
  74. package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +13 -0
  75. package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +10 -0
  76. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
  77. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +2 -0
  78. package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
  79. package/data_adapters/BaseAdapter/RegionsAdapter.js +2 -0
  80. package/data_adapters/BaseAdapter/index.d.ts +15 -0
  81. package/data_adapters/BaseAdapter/index.js +25 -0
  82. package/data_adapters/BaseAdapter/types.d.ts +21 -0
  83. package/data_adapters/BaseAdapter/types.js +2 -0
  84. package/data_adapters/BaseAdapter/util.d.ts +12 -0
  85. package/data_adapters/BaseAdapter/util.js +23 -0
  86. package/data_adapters/CytobandAdapter/configSchema.d.ts +11 -1
  87. package/package.json +4 -4
  88. package/pluggableElementTypes/AdapterType.d.ts +1 -1
  89. package/pluggableElementTypes/ConnectionType.d.ts +1 -1
  90. package/pluggableElementTypes/DisplayType.d.ts +1 -1
  91. package/pluggableElementTypes/InternetAccountType.d.ts +1 -1
  92. package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -1
  93. package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
  94. package/pluggableElementTypes/models/BaseTrackModel.js +3 -2
  95. package/pluggableElementTypes/models/InternetAccountModel.d.ts +30 -0
  96. package/pluggableElementTypes/models/InternetAccountModel.js +6 -1
  97. package/pluggableElementTypes/models/baseConnectionConfig.d.ts +18 -1
  98. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +42 -1
  99. package/pluggableElementTypes/models/baseTrackConfig.d.ts +118 -1
  100. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +0 -1
  101. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +1 -1
  102. package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
  103. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +0 -1
  104. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
  105. package/rpc/RpcManager.d.ts +8 -1
  106. package/rpc/RpcManager.js +1 -1
  107. package/rpc/baseRpcConfig.d.ts +10 -1
  108. package/rpc/configSchema.d.ts +14 -1
  109. package/rpc/coreRpcMethods.d.ts +1 -1
  110. package/rpc/coreRpcMethods.js +3 -3
  111. package/rpc/mainThreadRpcConfig.d.ts +7 -1
  112. package/rpc/methods/{CoreEstimateRegionStats.d.ts → CoreGetFeatureDensityStats.d.ts} +2 -2
  113. package/rpc/methods/{CoreEstimateRegionStats.js → CoreGetFeatureDensityStats.js} +4 -4
  114. package/rpc/methods/CoreGetFeatureDetails.js +5 -5
  115. package/rpc/webWorkerRpcConfig.d.ts +7 -1
  116. package/tsconfig.build.tsbuildinfo +1 -1
  117. package/ui/AboutDialog.d.ts +0 -1
  118. package/ui/AppLogo.d.ts +0 -1
  119. package/ui/AssemblySelector.d.ts +0 -1
  120. package/ui/CascadingMenu.d.ts +0 -1
  121. package/ui/ColorPicker.d.ts +0 -1
  122. package/ui/Dialog.d.ts +0 -1
  123. package/ui/Dialog.js +14 -1
  124. package/ui/DrawerWidget.d.ts +1 -2
  125. package/ui/DrawerWidget.js +5 -3
  126. package/ui/DropDownMenu.d.ts +0 -1
  127. package/ui/ErrorMessage.d.ts +0 -1
  128. package/ui/FactoryResetDialog.d.ts +0 -1
  129. package/ui/FatalErrorDialog.d.ts +0 -1
  130. package/ui/FileSelector/FileSelector.d.ts +0 -1
  131. package/ui/FileSelector/LocalFileChooser.d.ts +0 -1
  132. package/ui/FileSelector/UrlChooser.d.ts +0 -1
  133. package/ui/Icons.d.ts +0 -1
  134. package/ui/LoadingEllipses.d.ts +0 -1
  135. package/ui/Logo.d.ts +0 -1
  136. package/ui/PrerenderedCanvas.d.ts +0 -1
  137. package/ui/ResizeBar.js +1 -1
  138. package/ui/ResizeHandle.d.ts +0 -1
  139. package/ui/ReturnToImportFormDialog.d.ts +0 -1
  140. package/ui/SanitizedHTML.d.ts +0 -1
  141. package/ui/SanitizedHTML.js +6 -0
  142. package/ui/Snackbar.d.ts +0 -1
  143. package/ui/Tooltip.d.ts +0 -1
  144. package/ui/ViewContainerTitle.d.ts +0 -1
  145. package/ui/ViewLauncher.d.ts +0 -1
  146. package/ui/ViewMenu.d.ts +1 -2
  147. package/ui/ViewPanel.d.ts +0 -1
  148. package/ui/react-colorful.d.ts +1 -1
  149. package/ui/theme.js +3 -18
  150. package/util/index.d.ts +4 -2
  151. package/util/index.js +13 -4
  152. package/util/layouts/PrecomputedMultiLayout.d.ts +1 -1
  153. package/util/stats.d.ts +5 -5
  154. package/util/types/index.d.ts +3 -1
  155. package/util/types/mst.d.ts +12 -9
  156. package/BaseFeatureWidget/SequenceBox.d.ts +0 -29
  157. package/BaseFeatureWidget/SequenceBox.js +0 -63
  158. package/BaseFeatureWidget/SequenceFeatureDetails.d.ts +0 -3
  159. package/BaseFeatureWidget/SequenceFeatureDetails.js +0 -230
  160. package/data_adapters/BaseAdapter.d.ts +0 -138
  161. /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.d.ts +0 -0
  162. /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.js +0 -0
  163. /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.d.ts +0 -0
  164. /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.js +0 -0
@@ -99,6 +99,7 @@ export default class PluginManager {
99
99
  getElementType(groupName: PluggableElementTypeGroup, typeName: string): PluggableElementBase;
100
100
  getElementTypesInGroup(groupName: PluggableElementTypeGroup): PluggableElementBase[];
101
101
  getTrackElements(): TrackType[];
102
+ getConnectionElements(): ConnectionType[];
102
103
  getAddTrackWorkflowElements(): AddTrackWorkflowType[];
103
104
  getRpcElements(): RpcMethodType[];
104
105
  getDisplayElements(): DisplayType[];
@@ -214,11 +215,12 @@ export default class PluginManager {
214
215
  mobx: typeof import("mobx");
215
216
  'mobx-state-tree': typeof import("mobx-state-tree");
216
217
  react: typeof import("react");
218
+ 'react/jsx-runtime': typeof import("react/jsx-runtime");
217
219
  'react-dom': typeof import("react-dom");
218
220
  'mobx-react': typeof import("mobx-react");
219
221
  '@mui/x-data-grid': {
220
222
  useGridApiContext: typeof import("@mui/x-data-grid").useGridApiContext;
221
- useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/models/api/gridApiCommunity").GridApiCommunity>() => import("react").MutableRefObject<Api>;
223
+ useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon<any, any> = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("react").MutableRefObject<Api>;
222
224
  useGridRootProps: () => import("@mui/x-data-grid/models/props/DataGridProps").DataGridProcessedProps<any>;
223
225
  };
224
226
  '@mui/material/utils': typeof import("@mui/material/utils");
@@ -243,7 +245,8 @@ export default class PluginManager {
243
245
  makeStyles: (args: any) => () => Record<string, string>;
244
246
  };
245
247
  '@mui/material': {
246
- [k: string]: (props: any) => JSX.Element;
248
+ alpha: typeof import("@mui/system").alpha;
249
+ useTheme: typeof import("@mui/material").useTheme;
247
250
  };
248
251
  'prop-types': typeof import("prop-types");
249
252
  '@mui/material/styles': typeof import("@mui/material/styles");
package/PluginManager.js CHANGED
@@ -236,6 +236,9 @@ class PluginManager {
236
236
  getTrackElements() {
237
237
  return this.getElementTypesInGroup('track');
238
238
  }
239
+ getConnectionElements() {
240
+ return this.getElementTypesInGroup('connection');
241
+ }
239
242
  getAddTrackWorkflowElements() {
240
243
  return this.getElementTypesInGroup('add track workflow');
241
244
  }
package/ReExports/list.js CHANGED
@@ -9,6 +9,7 @@ exports.default = [
9
9
  'mobx',
10
10
  'mobx-state-tree',
11
11
  'react',
12
+ 'react/jsx-runtime',
12
13
  'react-dom',
13
14
  'mobx-react',
14
15
  '@mui/x-data-grid',
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import * as ReactJSXRuntime from 'react/jsx-runtime';
2
3
  import * as ReactDom from 'react-dom';
3
4
  import * as mobx from 'mobx';
4
5
  import * as mst from 'mobx-state-tree';
@@ -131,11 +132,12 @@ declare const libs: {
131
132
  mobx: typeof mobx;
132
133
  'mobx-state-tree': typeof mst;
133
134
  react: typeof React;
135
+ 'react/jsx-runtime': typeof ReactJSXRuntime;
134
136
  'react-dom': typeof ReactDom;
135
137
  'mobx-react': typeof mxreact;
136
138
  '@mui/x-data-grid': {
137
139
  useGridApiContext: typeof useGridApiContext;
138
- useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/models/api/gridApiCommunity").GridApiCommunity>() => React.MutableRefObject<Api>;
140
+ useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon<any, any> = import("@mui/x-data-grid/internals").GridApiCommunity>() => React.MutableRefObject<Api>;
139
141
  useGridRootProps: () => import("@mui/x-data-grid/models/props/DataGridProps").DataGridProcessedProps<any>;
140
142
  };
141
143
  '@mui/material/utils': typeof MUIUtils;
@@ -160,7 +162,8 @@ declare const libs: {
160
162
  makeStyles: (args: any) => () => Record<string, string>;
161
163
  };
162
164
  '@mui/material': {
163
- [k: string]: (props: any) => JSX.Element;
165
+ alpha: typeof MUIStyles.alpha;
166
+ useTheme: typeof MUIStyles.useTheme;
164
167
  };
165
168
  'prop-types': typeof PropTypes;
166
169
  '@mui/material/styles': typeof MUIStyles;
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  // this is all the stuff that the pluginManager re-exports for plugins to use
30
30
  const react_1 = __importStar(require("react"));
31
+ const ReactJSXRuntime = __importStar(require("react/jsx-runtime"));
31
32
  const ReactDom = __importStar(require("react-dom"));
32
33
  const mobx = __importStar(require("mobx"));
33
34
  const mst = __importStar(require("mobx-state-tree"));
@@ -208,9 +209,6 @@ const DataGridEntries = {
208
209
  GridArrowUpwardIcon: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
209
210
  default: module.GridArrowUpwardIcon,
210
211
  }))),
211
- GridAutoSizer: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
212
- default: module.GridAutoSizer,
213
- }))),
214
212
  GridCellCheckboxForwardRef: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('@mui/x-data-grid'))).then(module => ({
215
213
  default: module.GridCellCheckboxForwardRef,
216
214
  }))),
@@ -373,6 +371,7 @@ const libs = {
373
371
  mobx,
374
372
  'mobx-state-tree': mst,
375
373
  react: react_1.default,
374
+ 'react/jsx-runtime': ReactJSXRuntime,
376
375
  'react-dom': ReactDom,
377
376
  'mobx-react': mxreact,
378
377
  '@mui/x-data-grid': {
@@ -395,7 +394,11 @@ const libs = {
395
394
  return () => useStyles().classes;
396
395
  },
397
396
  },
398
- '@mui/material': LazyMUICore,
397
+ '@mui/material': {
398
+ ...LazyMUICore,
399
+ alpha: MUIStyles.alpha,
400
+ useTheme: MUIStyles.useTheme,
401
+ },
399
402
  'prop-types': prop_types_1.default,
400
403
  // end special case
401
404
  // material-ui subcomponents, should get rid of these
@@ -1,15 +1,8 @@
1
1
  import BaseResult from './BaseResults';
2
2
  import PluginManager from '../PluginManager';
3
3
  import QuickLRU from '../util/QuickLRU';
4
- import { SearchType, BaseTextSearchAdapter } from '../data_adapters/BaseAdapter';
4
+ import { BaseTextSearchAdapter, BaseTextSearchArgs } from '../data_adapters/BaseAdapter';
5
5
  import { AnyConfigurationModel } from '../configuration';
6
- export interface BaseArgs {
7
- queryString: string;
8
- searchType?: SearchType;
9
- signal?: AbortSignal;
10
- limit?: number;
11
- pageNumber?: number;
12
- }
13
6
  export interface SearchScope {
14
7
  includeAggregateIndexes: boolean;
15
8
  assemblyName: string;
@@ -36,7 +29,7 @@ export default class TextSearchManager {
36
29
  * @param args - search options/arguments include: search query
37
30
  * limit of results to return, searchType...prefix | full | exact", etc.
38
31
  */
39
- search(args: BaseArgs, searchScope: SearchScope, rankFn: (results: BaseResult[]) => BaseResult[]): Promise<BaseResult[]>;
32
+ search(args: BaseTextSearchArgs, searchScope: SearchScope, rankFn: (results: BaseResult[]) => BaseResult[]): Promise<BaseResult[]>;
40
33
  /**
41
34
  * Returns array of revelevant and sorted results
42
35
  * @param results - array of results from all text search adapters
@@ -1,12 +1,9 @@
1
1
  import { Instance, IAnyType } from 'mobx-state-tree';
2
+ import { BaseOptions } from '../data_adapters/BaseAdapter';
2
3
  import PluginManager from '../PluginManager';
3
4
  import { Region, Feature } from '../util';
4
- type RefNameAliases = Record<string, string>;
5
- export interface BaseOptions {
6
- signal?: AbortSignal;
7
- sessionId: string;
8
- statusCallback?: Function;
9
- }
5
+ import RpcManager from '../rpc/RpcManager';
6
+ type RefNameAliases = Record<string, string | undefined>;
10
7
  export interface RefNameMap {
11
8
  forwardMap: RefNameAliases;
12
9
  reverseMap: RefNameAliases;
@@ -23,7 +20,13 @@ export interface Loading {
23
20
  lowerCaseRefNameAliases: RefNameAliases;
24
21
  cytobands: Feature[];
25
22
  }
23
+ /**
24
+ * #stateModel Assembly
25
+ */
26
26
  export default function assemblyFactory(assemblyConfigType: IAnyType, pm: PluginManager): import("mobx-state-tree").IModelType<{
27
+ /**
28
+ * #property
29
+ */
27
30
  configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
28
31
  }, {
29
32
  error: unknown;
@@ -34,40 +37,120 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pm: Plugin
34
37
  lowerCaseRefNameAliases: RefNameAliases | undefined;
35
38
  cytobands: Feature[] | undefined;
36
39
  } & {
40
+ /**
41
+ * #getter
42
+ */
37
43
  readonly initialized: boolean;
44
+ /**
45
+ * #getter
46
+ */
38
47
  readonly name: string;
48
+ /**
49
+ * #getter
50
+ */
39
51
  readonly regions: BasicRegion[] | undefined;
52
+ /**
53
+ * #getter
54
+ */
40
55
  readonly aliases: string[];
56
+ /**
57
+ * #getter
58
+ */
41
59
  readonly displayName: string | undefined;
60
+ /**
61
+ * #getter
62
+ */
42
63
  hasName(name: string): boolean;
64
+ /**
65
+ * #getter
66
+ */
43
67
  readonly allAliases: string[];
68
+ /**
69
+ * #getter
70
+ * note: lowerCaseRefNameAliases not included here: this allows the list
71
+ * of refnames to be just the "normal casing", but things like
72
+ * getCanonicalRefName can resolve a lower-case name if needed
73
+ */
44
74
  readonly allRefNames: string[] | undefined;
75
+ /**
76
+ * #getter
77
+ */
45
78
  readonly lowerCaseRefNames: string[] | undefined;
79
+ /**
80
+ * #getter
81
+ */
46
82
  readonly allRefNamesWithLowerCase: string[] | undefined;
47
- readonly rpcManager: any;
83
+ /**
84
+ * #getter
85
+ */
86
+ readonly rpcManager: RpcManager;
87
+ /**
88
+ * #getter
89
+ */
48
90
  readonly refNameColors: string[];
49
91
  } & {
92
+ /**
93
+ * #getter
94
+ */
50
95
  readonly refNames: string[] | undefined;
51
96
  } & {
52
- getCanonicalRefName(refName: string): string;
97
+ /**
98
+ * #method
99
+ */
100
+ getCanonicalRefName(refName: string): string | undefined;
101
+ /**
102
+ * #method
103
+ */
53
104
  getRefNameColor(refName: string): string | undefined;
105
+ /**
106
+ * #method
107
+ */
54
108
  isValidRefName(refName: string): boolean;
55
109
  } & {
110
+ /**
111
+ * #action
112
+ */
56
113
  setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: Loading): void;
114
+ /**
115
+ * #action
116
+ */
57
117
  setError(e: unknown): void;
118
+ /**
119
+ * #action
120
+ */
58
121
  setRegions(regions: Region[]): void;
122
+ /**
123
+ * #action
124
+ */
59
125
  setRefNameAliases(aliases: RefNameAliases, lcAliases: RefNameAliases): void;
126
+ /**
127
+ * #action
128
+ */
60
129
  setCytobands(cytobands: Feature[]): void;
130
+ /**
131
+ * #action
132
+ */
61
133
  setLoadingP(p?: Promise<void>): void;
134
+ /**
135
+ * #action
136
+ */
62
137
  load(): Promise<void>;
138
+ /**
139
+ * #action
140
+ */
63
141
  loadPre(): Promise<void>;
64
142
  } & {
143
+ /**
144
+ * #method
145
+ */
65
146
  getAdapterMapEntry(adapterConf: unknown, options: BaseOptions): Promise<RefNameMap>;
66
147
  /**
148
+ * #method
67
149
  * get Map of `canonical-name -> adapter-specific-name`
68
150
  */
69
151
  getRefNameMapForAdapter(adapterConf: unknown, opts: BaseOptions): Promise<RefNameAliases>;
70
152
  /**
153
+ * #method
71
154
  * get Map of `adapter-specific-name -> canonical-name`
72
155
  */
73
156
  getReverseRefNameMapForAdapter(adapterConf: unknown, opts: BaseOptions): Promise<RefNameAliases>;
@@ -49,7 +49,7 @@ async function loadRefNameMap(assembly, adapterConfig, options, signal) {
49
49
  signal,
50
50
  name: 'when assembly ready',
51
51
  });
52
- const refNames = (await assembly.rpcManager.call(sessionId, 'CoreGetRefNames', {
52
+ const refNames = (await assembly.rpcManager.call(sessionId || 'assemblyRpc', 'CoreGetRefNames', {
53
53
  adapterConfig,
54
54
  signal,
55
55
  ...options,
@@ -81,9 +81,13 @@ function checkRefName(refName) {
81
81
  function getAdapterId(adapterConf) {
82
82
  return (0, json_stable_stringify_1.default)(adapterConf);
83
83
  }
84
+ /**
85
+ * #stateModel Assembly
86
+ */
84
87
  function assemblyFactory(assemblyConfigType, pm) {
85
88
  const adapterLoads = new abortable_promise_cache_1.default({
86
89
  cache: new QuickLRU_1.default({ maxSize: 1000 }),
90
+ // @ts-expect-error
87
91
  async fill(args, signal, statusCallback) {
88
92
  const { adapterConf, self, options } = args;
89
93
  return loadRefNameMap(self, adapterConf, { ...options, statusCallback }, signal);
@@ -91,6 +95,9 @@ function assemblyFactory(assemblyConfigType, pm) {
91
95
  });
92
96
  return mobx_state_tree_1.types
93
97
  .model({
98
+ /**
99
+ * #property
100
+ */
94
101
  configuration: mobx_state_tree_1.types.safeReference(assemblyConfigType),
95
102
  })
96
103
  .volatile(() => ({
@@ -103,71 +110,116 @@ function assemblyFactory(assemblyConfigType, pm) {
103
110
  cytobands: undefined,
104
111
  }))
105
112
  .views(self => ({
113
+ /**
114
+ * #getter
115
+ */
106
116
  get initialized() {
107
117
  // @ts-expect-error
108
118
  self.load();
109
119
  return !!self.refNameAliases;
110
120
  },
121
+ /**
122
+ * #getter
123
+ */
111
124
  get name() {
112
125
  return (0, configuration_1.getConf)(self, 'name');
113
126
  },
127
+ /**
128
+ * #getter
129
+ */
114
130
  get regions() {
115
131
  // @ts-expect-error
116
132
  self.load();
117
133
  return self.volatileRegions;
118
134
  },
135
+ /**
136
+ * #getter
137
+ */
119
138
  get aliases() {
120
139
  return (0, configuration_1.getConf)(self, 'aliases');
121
140
  },
141
+ /**
142
+ * #getter
143
+ */
122
144
  get displayName() {
123
145
  return (0, configuration_1.getConf)(self, 'displayName');
124
146
  },
147
+ /**
148
+ * #getter
149
+ */
125
150
  hasName(name) {
126
151
  return this.allAliases.includes(name);
127
152
  },
153
+ /**
154
+ * #getter
155
+ */
128
156
  get allAliases() {
129
157
  return [this.name, ...this.aliases];
130
158
  },
131
- // note: lowerCaseRefNameAliases not included here: this allows the list
132
- // of refnames to be just the "normal casing", but things like
133
- // getCanonicalRefName can resolve a lower-case name if needed
159
+ /**
160
+ * #getter
161
+ * note: lowerCaseRefNameAliases not included here: this allows the list
162
+ * of refnames to be just the "normal casing", but things like
163
+ * getCanonicalRefName can resolve a lower-case name if needed
164
+ */
134
165
  get allRefNames() {
135
166
  return !self.refNameAliases
136
167
  ? undefined
137
168
  : Object.keys(self.refNameAliases);
138
169
  },
170
+ /**
171
+ * #getter
172
+ */
139
173
  get lowerCaseRefNames() {
140
174
  return !self.lowerCaseRefNameAliases
141
175
  ? undefined
142
176
  : Object.keys(self.lowerCaseRefNameAliases || {});
143
177
  },
178
+ /**
179
+ * #getter
180
+ */
144
181
  get allRefNamesWithLowerCase() {
145
182
  return this.allRefNames && this.lowerCaseRefNames
146
183
  ? [...new Set([...this.allRefNames, ...this.lowerCaseRefNames])]
147
184
  : undefined;
148
185
  },
186
+ /**
187
+ * #getter
188
+ */
149
189
  get rpcManager() {
150
190
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
151
191
  return (0, mobx_state_tree_1.getParent)(self, 2).rpcManager;
152
192
  },
193
+ /**
194
+ * #getter
195
+ */
153
196
  get refNameColors() {
154
197
  const colors = (0, configuration_1.getConf)(self, 'refNameColors');
155
198
  return colors.length === 0 ? refNameColors : colors;
156
199
  },
157
200
  }))
158
201
  .views(self => ({
202
+ /**
203
+ * #getter
204
+ */
159
205
  get refNames() {
160
206
  var _a;
161
207
  return (_a = self.regions) === null || _a === void 0 ? void 0 : _a.map(region => region.refName);
162
208
  },
163
209
  }))
164
210
  .views(self => ({
211
+ /**
212
+ * #method
213
+ */
165
214
  getCanonicalRefName(refName) {
166
215
  if (!self.refNameAliases || !self.lowerCaseRefNameAliases) {
167
216
  throw new Error('aliases not loaded, we expect them to be loaded before getCanonicalRefName can be called');
168
217
  }
169
218
  return (self.refNameAliases[refName] || self.lowerCaseRefNameAliases[refName]);
170
219
  },
220
+ /**
221
+ * #method
222
+ */
171
223
  getRefNameColor(refName) {
172
224
  if (!self.refNames) {
173
225
  return undefined;
@@ -178,6 +230,9 @@ function assemblyFactory(assemblyConfigType, pm) {
178
230
  }
179
231
  return self.refNameColors[idx % self.refNameColors.length];
180
232
  },
233
+ /**
234
+ * #method
235
+ */
181
236
  isValidRefName(refName) {
182
237
  if (!self.refNameAliases) {
183
238
  throw new Error('isValidRefName cannot be called yet, the assembly has not finished loading');
@@ -186,29 +241,50 @@ function assemblyFactory(assemblyConfigType, pm) {
186
241
  },
187
242
  }))
188
243
  .actions(self => ({
244
+ /**
245
+ * #action
246
+ */
189
247
  setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }) {
190
248
  self.loaded = true;
191
249
  this.setRegions(adapterRegionsWithAssembly);
192
250
  this.setRefNameAliases(refNameAliases, lowerCaseRefNameAliases);
193
251
  this.setCytobands(cytobands);
194
252
  },
253
+ /**
254
+ * #action
255
+ */
195
256
  setError(e) {
196
257
  console.error(e);
197
258
  self.error = e;
198
259
  },
260
+ /**
261
+ * #action
262
+ */
199
263
  setRegions(regions) {
200
264
  self.volatileRegions = regions;
201
265
  },
266
+ /**
267
+ * #action
268
+ */
202
269
  setRefNameAliases(aliases, lcAliases) {
203
270
  self.refNameAliases = aliases;
204
271
  self.lowerCaseRefNameAliases = lcAliases;
205
272
  },
273
+ /**
274
+ * #action
275
+ */
206
276
  setCytobands(cytobands) {
207
277
  self.cytobands = cytobands;
208
278
  },
279
+ /**
280
+ * #action
281
+ */
209
282
  setLoadingP(p) {
210
283
  self.loadingP = p;
211
284
  },
285
+ /**
286
+ * #action
287
+ */
212
288
  load() {
213
289
  if (!self.loadingP) {
214
290
  self.loadingP = this.loadPre().catch(e => {
@@ -218,12 +294,15 @@ function assemblyFactory(assemblyConfigType, pm) {
218
294
  }
219
295
  return self.loadingP;
220
296
  },
297
+ /**
298
+ * #action
299
+ */
221
300
  async loadPre() {
222
301
  var _a, _b;
223
302
  const conf = self.configuration;
224
- const refNameAliasesAdapterConf = (_a = conf.refNameAliases) === null || _a === void 0 ? void 0 : _a.adapter;
225
- const cytobandAdapterConf = (_b = conf.cytobands) === null || _b === void 0 ? void 0 : _b.adapter;
226
- const sequenceAdapterConf = conf.sequence.adapter;
303
+ const refNameAliasesAdapterConf = (_a = conf === null || conf === void 0 ? void 0 : conf.refNameAliases) === null || _a === void 0 ? void 0 : _a.adapter;
304
+ const cytobandAdapterConf = (_b = conf === null || conf === void 0 ? void 0 : conf.cytobands) === null || _b === void 0 ? void 0 : _b.adapter;
305
+ const sequenceAdapterConf = conf === null || conf === void 0 ? void 0 : conf.sequence.adapter;
227
306
  const assemblyName = self.name;
228
307
  const regions = await getAssemblyRegions(sequenceAdapterConf, pm);
229
308
  const adapterRegionsWithAssembly = regions.map(r => {
@@ -256,6 +335,9 @@ function assemblyFactory(assemblyConfigType, pm) {
256
335
  },
257
336
  }))
258
337
  .views(self => ({
338
+ /**
339
+ * #method
340
+ */
259
341
  getAdapterMapEntry(adapterConf, options) {
260
342
  const { signal, statusCallback, ...rest } = options;
261
343
  if (!options.sessionId) {
@@ -272,16 +354,18 @@ function assemblyFactory(assemblyConfigType, pm) {
272
354
  undefined, statusCallback);
273
355
  },
274
356
  /**
357
+ * #method
275
358
  * get Map of `canonical-name -> adapter-specific-name`
276
359
  */
277
360
  async getRefNameMapForAdapter(adapterConf, opts) {
278
- if (!opts || !opts.sessionId) {
361
+ if (!(opts === null || opts === void 0 ? void 0 : opts.sessionId)) {
279
362
  throw new Error('sessionId is required');
280
363
  }
281
364
  const map = await this.getAdapterMapEntry(adapterConf, opts);
282
365
  return map.forwardMap;
283
366
  },
284
367
  /**
368
+ * #method
285
369
  * get Map of `adapter-specific-name -> canonical-name`
286
370
  */
287
371
  async getReverseRefNameMapForAdapter(adapterConf, opts) {
@@ -3,5 +3,54 @@ import PluginManager from '../PluginManager';
3
3
  * #config BaseAssembly
4
4
  * This corresponds to the assemblies section of the config
5
5
  */
6
- declare function assemblyConfigSchema(pluginManager: PluginManager): import("../configuration").AnyConfigurationSchemaType;
6
+ declare function assemblyConfigSchema(pluginManager: PluginManager): import("../configuration/configurationSchema").ConfigurationSchemaType<{
7
+ /**
8
+ * #slot
9
+ * aliases are "reference name aliases" e.g. aliases for hg38 might be "GRCh38"
10
+ */
11
+ aliases: {
12
+ type: string;
13
+ defaultValue: never[];
14
+ description: string;
15
+ };
16
+ /**
17
+ * #slot
18
+ * sequence refers to a reference sequence track that has an adapter containing,
19
+ * importantly, a sequence adapter such as IndexedFastaAdapter
20
+ */
21
+ sequence: import("../configuration").AnyConfigurationSchemaType;
22
+ /**
23
+ * #slot
24
+ */
25
+ refNameColors: {
26
+ type: string;
27
+ defaultValue: never[];
28
+ description: string;
29
+ };
30
+ refNameAliases: import("../configuration/configurationSchema").ConfigurationSchemaType<{
31
+ /**
32
+ * #slot refNameAliases.adapter
33
+ * refNameAliases help resolve e.g. chr1 and 1 as the same entity
34
+ * the data for refNameAliases are fetched from an adapter, that is
35
+ * commonly a tsv like chromAliases.txt from UCSC or similar
36
+ */
37
+ adapter: import("mobx-state-tree").IAnyModelType;
38
+ }, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
39
+ cytobands: import("../configuration/configurationSchema").ConfigurationSchemaType<{
40
+ /**
41
+ * #slot cytobands.adapter
42
+ * cytoband data is fetched from an adapter, and can be displayed by a
43
+ * view type as ideograms
44
+ */
45
+ adapter: import("mobx-state-tree").IAnyModelType;
46
+ }, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
47
+ /**
48
+ * #slot
49
+ */
50
+ displayName: {
51
+ type: string;
52
+ defaultValue: string;
53
+ description: string;
54
+ };
55
+ }, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>;
7
56
  export default assemblyConfigSchema;