@jbrowse/core 2.17.0 → 3.0.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 (354) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +1 -2
  2. package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +7 -13
  3. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
  4. package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +20 -25
  5. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -3
  6. package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +3 -7
  7. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
  8. package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +5 -8
  9. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -3
  10. package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +7 -10
  11. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
  12. package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +25 -55
  13. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +3 -4
  14. package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +16 -34
  15. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
  16. package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
  17. package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -3
  18. package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
  19. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
  20. package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +3 -5
  21. package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
  22. package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +3 -5
  23. package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +4 -5
  24. package/BaseFeatureWidget/BaseFeatureDetail/index.js +6 -14
  25. package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -13
  26. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
  27. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
  28. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -4
  29. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -41
  30. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +3 -4
  31. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +30 -29
  32. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
  33. package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
  34. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
  35. package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +11 -85
  36. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
  37. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -25
  38. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +3 -4
  39. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -46
  40. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +3 -4
  41. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +101 -96
  42. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +2 -3
  43. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
  44. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +2 -3
  45. package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +20 -55
  46. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
  47. package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
  48. package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
  49. package/BaseFeatureWidget/SequenceFeatureDetails/model.js +4 -66
  50. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +4 -5
  51. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
  52. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +3 -4
  53. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +6 -7
  54. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +3 -4
  55. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -9
  56. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +3 -4
  57. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -4
  58. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +2 -3
  59. package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -10
  60. package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
  61. package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
  62. package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
  63. package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
  64. package/BaseFeatureWidget/stateModelFactory.js +3 -73
  65. package/BaseFeatureWidget/types.d.ts +3 -3
  66. package/BaseFeatureWidget/util.js +0 -4
  67. package/CorePlugin.d.ts +1 -1
  68. package/CorePlugin.js +19 -12
  69. package/Plugin.d.ts +2 -5
  70. package/Plugin.js +0 -3
  71. package/PluginLoader.d.ts +1 -1
  72. package/PluginLoader.js +2 -19
  73. package/PluginManager.d.ts +17 -32
  74. package/PluginManager.js +15 -41
  75. package/ReExports/DataGrid.js +0 -1
  76. package/ReExports/list.d.ts +0 -5
  77. package/ReExports/list.js +3 -5
  78. package/ReExports/modules.d.ts +26 -22
  79. package/ReExports/modules.js +45 -44
  80. package/TextSearch/BaseResults.d.ts +4 -4
  81. package/TextSearch/TextSearchManager.d.ts +4 -16
  82. package/TextSearch/TextSearchManager.js +1 -13
  83. package/assemblyManager/assembly.d.ts +5 -100
  84. package/assemblyManager/assembly.js +30 -146
  85. package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
  86. package/assemblyManager/assemblyConfigSchema.js +12 -46
  87. package/assemblyManager/assemblyManager.d.ts +7 -57
  88. package/assemblyManager/assemblyManager.js +2 -57
  89. package/configuration/configurationSchema.d.ts +4 -4
  90. package/configuration/configurationSchema.js +2 -14
  91. package/configuration/configurationSlot.d.ts +2 -13
  92. package/configuration/configurationSlot.js +2 -32
  93. package/configuration/index.d.ts +2 -2
  94. package/configuration/index.js +2 -2
  95. package/configuration/types.d.ts +2 -3
  96. package/configuration/util.d.ts +1 -25
  97. package/configuration/util.js +19 -56
  98. package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
  99. package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
  100. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
  101. package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
  102. package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
  103. package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
  104. package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
  105. package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
  106. package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
  107. package/data_adapters/BaseAdapter/index.d.ts +4 -4
  108. package/data_adapters/BaseAdapter/types.d.ts +2 -2
  109. package/data_adapters/BaseAdapter/util.d.ts +6 -6
  110. package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
  111. package/data_adapters/CytobandAdapter/CytobandAdapter.js +2 -6
  112. package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
  113. package/data_adapters/CytobandAdapter/configSchema.js +1 -7
  114. package/data_adapters/CytobandAdapter/index.d.ts +1 -1
  115. package/data_adapters/CytobandAdapter/index.js +21 -8
  116. package/data_adapters/dataAdapterCache.d.ts +4 -22
  117. package/data_adapters/dataAdapterCache.js +2 -28
  118. package/data_adapters/util.d.ts +1 -0
  119. package/data_adapters/util.js +10 -0
  120. package/package.json +8 -11
  121. package/pluggableElementTypes/AdapterType.d.ts +2 -2
  122. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
  123. package/pluggableElementTypes/ConnectionType.d.ts +3 -3
  124. package/pluggableElementTypes/DisplayType.d.ts +3 -9
  125. package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
  126. package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
  127. package/pluggableElementTypes/PluggableElementBase.js +2 -2
  128. package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
  129. package/pluggableElementTypes/RpcMethodType.js +7 -19
  130. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
  131. package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
  132. package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
  133. package/pluggableElementTypes/TrackType.d.ts +3 -3
  134. package/pluggableElementTypes/ViewType.d.ts +3 -3
  135. package/pluggableElementTypes/WidgetType.d.ts +4 -3
  136. package/pluggableElementTypes/index.d.ts +11 -11
  137. package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
  138. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
  139. package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
  140. package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
  141. package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
  142. package/pluggableElementTypes/models/BaseTrackModel.js +9 -63
  143. package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
  144. package/pluggableElementTypes/models/BaseViewModel.js +2 -38
  145. package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
  146. package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
  147. package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
  148. package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
  149. package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
  150. package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
  151. package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
  152. package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
  153. package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
  154. package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
  155. package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +4 -4
  156. package/pluggableElementTypes/renderers/CircularChordRendererType.js +3 -8
  157. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
  158. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
  159. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
  160. package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
  161. package/pluggableElementTypes/renderers/RendererType.d.ts +5 -9
  162. package/pluggableElementTypes/renderers/RendererType.js +3 -7
  163. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +3 -4
  164. package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +11 -76
  165. package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -3
  166. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +10 -74
  167. package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
  168. package/pluggableElementTypes/renderers/ServerSideRendererType.js +10 -60
  169. package/pluggableElementTypes/renderers/index.d.ts +1 -1
  170. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
  171. package/rpc/BaseRpcDriver.d.ts +3 -4
  172. package/rpc/BaseRpcDriver.js +20 -80
  173. package/rpc/MainThreadRpcDriver.d.ts +3 -7
  174. package/rpc/MainThreadRpcDriver.js +0 -5
  175. package/rpc/RpcManager.d.ts +3 -3
  176. package/rpc/RpcManager.js +2 -4
  177. package/rpc/WebWorkerRpcDriver.d.ts +3 -2
  178. package/rpc/WebWorkerRpcDriver.js +2 -13
  179. package/rpc/baseRpcConfig.d.ts +0 -3
  180. package/rpc/baseRpcConfig.js +1 -7
  181. package/rpc/configSchema.d.ts +0 -6
  182. package/rpc/configSchema.js +2 -11
  183. package/rpc/mainThreadRpcConfig.js +1 -7
  184. package/rpc/methods/CoreFreeResources.d.ts +0 -6
  185. package/rpc/methods/CoreFreeResources.js +2 -9
  186. package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
  187. package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
  188. package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
  189. package/rpc/methods/CoreGetFeatureDetails.js +0 -5
  190. package/rpc/methods/CoreGetFeatures.d.ts +5 -5
  191. package/rpc/methods/CoreGetFeatures.js +4 -5
  192. package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
  193. package/rpc/methods/CoreGetFileInfo.js +1 -1
  194. package/rpc/methods/CoreGetMetadata.d.ts +1 -2
  195. package/rpc/methods/CoreGetMetadata.js +1 -1
  196. package/rpc/methods/CoreGetRefNames.d.ts +1 -2
  197. package/rpc/methods/CoreGetRefNames.js +1 -1
  198. package/rpc/methods/CoreRender.d.ts +2 -6
  199. package/rpc/methods/CoreRender.js +5 -7
  200. package/rpc/methods/util.d.ts +3 -3
  201. package/rpc/methods/util.js +0 -1
  202. package/rpc/webWorkerRpcConfig.js +1 -7
  203. package/stories/JBrowseCore.stories.d.ts +1 -1
  204. package/stories/JBrowseCore.stories.js +3 -3
  205. package/stories/examples/WithSequencePanel.d.ts +6 -7
  206. package/stories/examples/WithSequencePanel.js +9 -9
  207. package/tsconfig.build.tsbuildinfo +1 -1
  208. package/ui/AppLogo.d.ts +2 -3
  209. package/ui/AppLogo.js +2 -7
  210. package/ui/AssemblySelector.d.ts +5 -5
  211. package/ui/AssemblySelector.js +11 -36
  212. package/ui/BaseTooltip.d.ts +1 -2
  213. package/ui/BaseTooltip.js +10 -17
  214. package/ui/CascadingMenu.d.ts +3 -4
  215. package/ui/CascadingMenu.js +18 -57
  216. package/ui/CascadingMenuButton.d.ts +2 -3
  217. package/ui/CascadingMenuButton.js +18 -42
  218. package/ui/ColorPicker.d.ts +3 -4
  219. package/ui/ColorPicker.js +33 -37
  220. package/ui/Dialog.d.ts +2 -3
  221. package/ui/Dialog.js +15 -27
  222. package/ui/DraggableDialog.d.ts +5 -0
  223. package/ui/DraggableDialog.js +32 -0
  224. package/ui/DropDownMenu.d.ts +2 -3
  225. package/ui/DropDownMenu.js +10 -36
  226. package/ui/EditableTypography.d.ts +2 -3
  227. package/ui/EditableTypography.js +30 -59
  228. package/ui/ErrorBoundary.d.ts +3 -2
  229. package/ui/ErrorBoundary.js +3 -25
  230. package/ui/ErrorMessage.d.ts +1 -2
  231. package/ui/ErrorMessage.js +27 -34
  232. package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
  233. package/ui/ErrorMessageStackTraceDialog.js +13 -54
  234. package/ui/FactoryResetDialog.d.ts +1 -2
  235. package/ui/FactoryResetDialog.js +8 -13
  236. package/ui/FatalErrorDialog.d.ts +1 -2
  237. package/ui/FatalErrorDialog.js +11 -42
  238. package/ui/FileSelector/FileSelector.d.ts +5 -5
  239. package/ui/FileSelector/FileSelector.js +41 -80
  240. package/ui/FileSelector/LocalFileChooser.d.ts +2 -3
  241. package/ui/FileSelector/LocalFileChooser.js +17 -29
  242. package/ui/FileSelector/UrlChooser.d.ts +5 -5
  243. package/ui/FileSelector/UrlChooser.js +6 -7
  244. package/ui/Icons.d.ts +10 -11
  245. package/ui/Icons.js +10 -25
  246. package/ui/LoadingEllipses.d.ts +2 -3
  247. package/ui/LoadingEllipses.js +4 -7
  248. package/ui/Logo.d.ts +2 -3
  249. package/ui/Logo.js +5 -23
  250. package/ui/Menu.d.ts +3 -4
  251. package/ui/Menu.js +85 -122
  252. package/ui/MenuButton.d.ts +2 -3
  253. package/ui/MenuButton.js +11 -35
  254. package/ui/PrerenderedCanvas.d.ts +1 -2
  255. package/ui/PrerenderedCanvas.js +3 -25
  256. package/ui/RedErrorMessageBox.d.ts +1 -2
  257. package/ui/RedErrorMessageBox.js +2 -5
  258. package/ui/ResizeHandle.d.ts +1 -2
  259. package/ui/ResizeHandle.js +5 -27
  260. package/ui/ReturnToImportFormDialog.d.ts +1 -2
  261. package/ui/ReturnToImportFormDialog.js +8 -13
  262. package/ui/SanitizedHTML.d.ts +2 -3
  263. package/ui/SanitizedHTML.js +4 -24
  264. package/ui/Snackbar.d.ts +3 -4
  265. package/ui/Snackbar.js +41 -21
  266. package/ui/SnackbarContents.d.ts +5 -0
  267. package/ui/SnackbarContents.js +16 -0
  268. package/ui/SnackbarModel.d.ts +1 -26
  269. package/ui/SnackbarModel.js +22 -39
  270. package/ui/colors.d.ts +1 -1
  271. package/ui/colors.js +2 -2
  272. package/ui/index.d.ts +0 -2
  273. package/ui/index.js +1 -5
  274. package/ui/react-colorful.js +17 -10
  275. package/ui/theme.d.ts +1 -1
  276. package/ui/theme.js +7 -40
  277. package/util/Base1DUtils.d.ts +1 -1
  278. package/util/Base1DUtils.js +0 -12
  279. package/util/Base1DViewModel.d.ts +4 -81
  280. package/util/Base1DViewModel.js +4 -108
  281. package/util/QuickLRU.js +0 -9
  282. package/util/TimeTraveller.js +0 -4
  283. package/util/aborting.d.ts +0 -20
  284. package/util/aborting.js +0 -31
  285. package/util/analytics.js +1 -12
  286. package/util/blockTypes.d.ts +0 -11
  287. package/util/blockTypes.js +0 -13
  288. package/util/calculateDynamicBlocks.d.ts +1 -20
  289. package/util/calculateDynamicBlocks.js +1 -22
  290. package/util/calculateStaticBlocks.d.ts +2 -2
  291. package/util/calculateStaticBlocks.js +0 -2
  292. package/util/color/cssColorsLevel4.js +0 -1
  293. package/util/color/index.d.ts +0 -19
  294. package/util/color/index.js +0 -30
  295. package/util/compositeMap.js +0 -2
  296. package/util/dedupe.js +0 -1
  297. package/util/formatFastaStrings.d.ts +0 -13
  298. package/util/formatFastaStrings.js +0 -13
  299. package/util/idMaker.d.ts +1 -1
  300. package/util/idMaker.js +16 -12
  301. package/util/index.d.ts +27 -173
  302. package/util/index.js +53 -293
  303. package/util/io/RemoteFileWithRangeCache.d.ts +4 -5
  304. package/util/io/RemoteFileWithRangeCache.js +12 -14
  305. package/util/io/index.d.ts +3 -4
  306. package/util/io/index.js +5 -19
  307. package/util/jexl.js +3 -13
  308. package/util/jexlStrings.d.ts +0 -6
  309. package/util/jexlStrings.js +0 -8
  310. package/util/layouts/BaseLayout.d.ts +1 -1
  311. package/util/layouts/GranularRectLayout.d.ts +1 -17
  312. package/util/layouts/GranularRectLayout.js +4 -81
  313. package/util/layouts/MultiLayout.d.ts +1 -6
  314. package/util/layouts/MultiLayout.js +0 -6
  315. package/util/layouts/PrecomputedLayout.d.ts +1 -4
  316. package/util/layouts/PrecomputedLayout.js +0 -5
  317. package/util/layouts/PrecomputedMultiLayout.js +0 -2
  318. package/util/layouts/SceneGraph.d.ts +0 -12
  319. package/util/layouts/SceneGraph.js +0 -13
  320. package/util/makeAbortableReaction.d.ts +2 -0
  321. package/util/makeAbortableReaction.js +50 -0
  322. package/util/map-obj.js +0 -4
  323. package/util/mst-reflection.d.ts +1 -14
  324. package/util/mst-reflection.js +1 -28
  325. package/util/nanoid.d.ts +1 -1
  326. package/util/nanoid.js +0 -31
  327. package/util/nextTick.d.ts +1 -0
  328. package/util/nextTick.js +6 -0
  329. package/util/offscreenCanvasPonyfill.d.ts +0 -1
  330. package/util/offscreenCanvasPonyfill.js +1 -9
  331. package/util/offscreenCanvasUtils.d.ts +2 -3
  332. package/util/offscreenCanvasUtils.js +22 -21
  333. package/util/range.d.ts +0 -25
  334. package/util/range.js +0 -34
  335. package/util/rxjs.d.ts +3 -7
  336. package/util/rxjs.js +2 -9
  337. package/util/simpleFeature.d.ts +0 -50
  338. package/util/simpleFeature.js +0 -35
  339. package/util/stats.d.ts +3 -26
  340. package/util/stats.js +0 -25
  341. package/util/stopToken.d.ts +3 -0
  342. package/util/stopToken.js +29 -0
  343. package/util/tracks.d.ts +4 -26
  344. package/util/tracks.js +8 -33
  345. package/util/types/index.d.ts +14 -30
  346. package/util/types/index.js +5 -14
  347. package/util/types/mst.js +0 -9
  348. package/util/types/util.d.ts +2 -9
  349. package/util/useMeasure.d.ts +1 -1
  350. package/util/useMeasure.js +0 -1
  351. package/util/when.d.ts +1 -15
  352. package/util/when.js +3 -70
  353. package/rpc/remoteAbortSignals.d.ts +0 -36
  354. package/rpc/remoteAbortSignals.js +0 -79
@@ -3,24 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const mobx_state_tree_1 = require("mobx-state-tree");
7
6
  const mobx_1 = require("mobx");
8
- // locals
9
- const util_1 = require("../util");
7
+ const mobx_state_tree_1 = require("mobx-state-tree");
10
8
  const configuration_1 = require("../configuration");
9
+ const util_1 = require("../util");
11
10
  const assembly_1 = __importDefault(require("./assembly"));
12
- /**
13
- * #stateModel AssemblyManager
14
- */
15
11
  function assemblyManagerFactory(conf, pm) {
16
12
  return mobx_state_tree_1.types
17
13
  .model({
18
- /**
19
- * #property
20
- * this is automatically managed by an autorun which looks in the parent
21
- * session.assemblies, session.sessionAssemblies, and
22
- * session.temporaryAssemblies
23
- */
24
14
  assemblies: mobx_state_tree_1.types.array((0, assembly_1.default)(conf, pm)),
25
15
  })
26
16
  .views(self => ({
@@ -35,26 +25,13 @@ function assemblyManagerFactory(conf, pm) {
35
25
  },
36
26
  }))
37
27
  .views(self => ({
38
- /**
39
- * #method
40
- */
41
28
  get(asmName) {
42
29
  return self.assemblyNameMap[asmName];
43
30
  },
44
- /**
45
- * #getter
46
- */
47
31
  get assemblyNamesList() {
48
32
  return this.assemblyList.map(asm => asm.name);
49
33
  },
50
- /**
51
- * #getter
52
- * looks at jbrowse.assemblies, session.sessionAssemblies, and
53
- * session.temporaryAssemblies to load from
54
- */
55
34
  get assemblyList() {
56
- // name is the explicit identifier and can be accessed without getConf,
57
- // hence the union with {name:string}
58
35
  const { jbrowse: { assemblies }, session: { sessionAssemblies = [], temporaryAssemblies = [] } = {}, } = (0, mobx_state_tree_1.getParent)(self);
59
36
  return [
60
37
  ...assemblies,
@@ -67,11 +44,6 @@ function assemblyManagerFactory(conf, pm) {
67
44
  },
68
45
  }))
69
46
  .views(self => ({
70
- /**
71
- * #method
72
- * use this method instead of assemblyManager.get(assemblyName)
73
- * to get an assembly with regions loaded
74
- */
75
47
  async waitForAssembly(assemblyName) {
76
48
  if (!assemblyName) {
77
49
  throw new Error('no assembly name supplied to waitForAssembly');
@@ -83,7 +55,6 @@ function assemblyManagerFactory(conf, pm) {
83
55
  assembly = self.get(assemblyName);
84
56
  }
85
57
  catch (e) {
86
- // ignore
87
58
  }
88
59
  }
89
60
  if (!assembly) {
@@ -92,14 +63,10 @@ function assemblyManagerFactory(conf, pm) {
92
63
  await assembly.load();
93
64
  await (0, util_1.when)(() => !!(assembly.regions && assembly.refNameAliases) || !!assembly.error);
94
65
  if (assembly.error) {
95
- // eslint-disable-next-line @typescript-eslint/only-throw-error
96
66
  throw assembly.error;
97
67
  }
98
68
  return assembly;
99
69
  },
100
- /**
101
- * #method
102
- */
103
70
  async getRefNameMapForAdapter(adapterConf, assemblyName, opts) {
104
71
  if (assemblyName) {
105
72
  const asm = await this.waitForAssembly(assemblyName);
@@ -107,9 +74,6 @@ function assemblyManagerFactory(conf, pm) {
107
74
  }
108
75
  return {};
109
76
  },
110
- /**
111
- * #method
112
- */
113
77
  async getReverseRefNameMapForAdapter(adapterConf, assemblyName, opts) {
114
78
  if (assemblyName) {
115
79
  const asm = await this.waitForAssembly(assemblyName);
@@ -117,9 +81,6 @@ function assemblyManagerFactory(conf, pm) {
117
81
  }
118
82
  return {};
119
83
  },
120
- /**
121
- * #method
122
- */
123
84
  isValidRefName(refName, assemblyName) {
124
85
  const assembly = self.get(assemblyName);
125
86
  if (assembly) {
@@ -144,25 +105,9 @@ function assemblyManagerFactory(conf, pm) {
144
105
  }
145
106
  }, { fireImmediately: true, name: 'assemblyManagerAfterAttach' }));
146
107
  },
147
- /**
148
- * #action
149
- * private: you would generally want to add to manipulate
150
- * jbrowse.assemblies, session.sessionAssemblies, or
151
- * session.temporaryAssemblies instead of using this directly
152
- */
153
108
  removeAssembly(asm) {
154
109
  self.assemblies.remove(asm);
155
110
  },
156
- /**
157
- * #action
158
- * private: you would generally want to add to manipulate
159
- * jbrowse.assemblies, session.sessionAssemblies, or
160
- * session.temporaryAssemblies instead of using this directly
161
- *
162
- * this can take an active instance of an assembly, in which case it is
163
- * referred to, or it can take an identifier e.g. assembly name, which is
164
- * used as a reference. snapshots cannot be used
165
- */
166
111
  addAssembly(configuration) {
167
112
  self.assemblies.push({ configuration });
168
113
  },
@@ -1,7 +1,7 @@
1
- import { IAnyType } from 'mobx-state-tree';
2
- import { ConfigSlotDefinition } from './configurationSlot';
3
- import { AnyConfigurationSchemaType } from './types';
4
- export type { AnyConfigurationSchemaType, AnyConfigurationModel, AnyConfigurationSlot, AnyConfigurationSlotType, } from './types';
1
+ import type { ConfigSlotDefinition } from './configurationSlot';
2
+ import type { AnyConfigurationSchemaType } from './types';
3
+ import type { IAnyType } from 'mobx-state-tree';
4
+ export type { AnyConfigurationModel, AnyConfigurationSchemaType, AnyConfigurationSlot, AnyConfigurationSlotType, } from './types';
5
5
  export interface ConfigurationSchemaDefinition {
6
6
  [n: string]: ConfigSlotDefinition | ConfigurationSchemaDefinition | string | number | IAnyType;
7
7
  }
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfigurationSchema = ConfigurationSchema;
7
7
  exports.ConfigurationReference = ConfigurationReference;
8
8
  const mobx_state_tree_1 = require("mobx-state-tree");
9
- const mst_1 = require("../util/types/mst");
10
9
  const configurationSlot_1 = __importDefault(require("./configurationSlot"));
11
10
  const util_1 = require("./util");
11
+ const mst_1 = require("../util/types/mst");
12
12
  function isEmptyObject(thing) {
13
13
  return (typeof thing === 'object' &&
14
14
  !Array.isArray(thing) &&
@@ -23,8 +23,6 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
23
23
  if (typeof modelName !== 'string') {
24
24
  throw new Error('first arg must be string name of the model that this config schema goes with');
25
25
  }
26
- // if we have a base configuration schema that we are
27
- // extending, grab the slot definitions from that
28
26
  let schemaDefinition = inputSchemaDefinition;
29
27
  let options = inputOptions;
30
28
  if ((_a = inputOptions.baseConfiguration) === null || _a === void 0 ? void 0 : _a.jbrowseSchemaDefinition) {
@@ -41,7 +39,6 @@ function preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition
41
39
  return { schemaDefinition, options };
42
40
  }
43
41
  function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
44
- // now assemble the MST model of the configuration schema
45
42
  const modelDefinition = {};
46
43
  let identifier;
47
44
  if (options.explicitlyTyped) {
@@ -81,8 +78,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
81
78
  Object.entries(schemaDefinition).forEach(([slotName, slotDefinition]) => {
82
79
  if (((0, mobx_state_tree_1.isType)(slotDefinition) && (0, mobx_state_tree_1.isLateType)(slotDefinition)) ||
83
80
  (0, util_1.isConfigurationSchemaType)(slotDefinition)) {
84
- // this is either an MST late() type (which we assume to be a sub-configuration),
85
- // or an actual sub-configuration
86
81
  modelDefinition[slotName] = slotDefinition;
87
82
  }
88
83
  else if (typeof slotDefinition === 'string' ||
@@ -90,7 +85,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
90
85
  volatileConstants[slotName] = slotDefinition;
91
86
  }
92
87
  else if (typeof slotDefinition === 'object') {
93
- // this is a slot definition
94
88
  if (!slotDefinition.type) {
95
89
  throw new Error(`no type set for config slot ${modelName}.${slotName}`);
96
90
  }
@@ -120,7 +114,7 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
120
114
  },
121
115
  }));
122
116
  if (Object.keys(volatileConstants).length) {
123
- completeModel = completeModel.volatile(( /* self */) => volatileConstants);
117
+ completeModel = completeModel.volatile(() => volatileConstants);
124
118
  }
125
119
  if (options.actions) {
126
120
  completeModel = completeModel.actions(options.actions);
@@ -139,7 +133,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
139
133
  completeModel = completeModel.postProcessSnapshot(snap => {
140
134
  const newSnap = {};
141
135
  let matchesDefault = true;
142
- // let keyCount = 0
143
136
  for (const [key, value] of Object.entries(snap)) {
144
137
  if (matchesDefault) {
145
138
  if (typeof defaultSnap[key] === 'object' && typeof value === 'object') {
@@ -155,7 +148,6 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
155
148
  volatileConstants[key] === undefined &&
156
149
  !isEmptyObject(value) &&
157
150
  !isEmptyArray(value)) {
158
- // keyCount += 1
159
151
  newSnap[key] = value;
160
152
  }
161
153
  }
@@ -172,15 +164,11 @@ function makeConfigurationSchemaModel(modelName, schemaDefinition, options) {
172
164
  function ConfigurationSchema(modelName, inputSchemaDefinition, inputOptions) {
173
165
  const { schemaDefinition, options } = preprocessConfigurationSchemaArguments(modelName, inputSchemaDefinition, inputOptions);
174
166
  const schemaType = makeConfigurationSchemaModel(modelName, schemaDefinition, options);
175
- // saving a couple of jbrowse-specific things in the type object. hope nobody gets mad.
176
167
  schemaType.isJBrowseConfigurationSchema = true;
177
168
  schemaType.jbrowseSchemaDefinition = schemaDefinition;
178
169
  schemaType.jbrowseSchemaOptions = options;
179
170
  return schemaType;
180
171
  }
181
172
  function ConfigurationReference(schemaType) {
182
- // we cast this to SCHEMATYPE, because the reference *should* behave just
183
- // like the object it points to. It won't be undefined (this is a
184
- // `reference`, not a `safeReference`)
185
173
  return mobx_state_tree_1.types.union(mobx_state_tree_1.types.reference(schemaType), schemaType);
186
174
  }
@@ -1,22 +1,11 @@
1
- import { IAnyModelType, IAnyComplexType } from 'mobx-state-tree';
1
+ import type { IAnyComplexType, IAnyModelType } from 'mobx-state-tree';
2
2
  export interface ConfigSlotDefinition {
3
- /** human-readable description of the slot's meaning */
4
3
  description?: string;
5
- /** custom base MST model for the slot's value */
6
4
  model?: IAnyModelType | IAnyComplexType;
7
- /** name of the type of slot, e.g. "string", "number", "stringArray" */
8
5
  type: string;
9
- /** default value of the slot */
10
6
  defaultValue: any;
11
- /** parameter names of the function callback */
12
7
  contextVariable?: string[];
13
8
  }
14
- /**
15
- * builds a MST model for a configuration slot
16
- *
17
- * @param slotName -
18
- * @param definition -
19
- */
20
9
  export default function ConfigSlot(slotName: string, { description, model, type, defaultValue, contextVariable, }: ConfigSlotDefinition): import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
21
10
  name: import("mobx-state-tree").ISimpleType<string>;
22
11
  description: import("mobx-state-tree").ISimpleType<string>;
@@ -28,7 +17,7 @@ export default function ConfigSlot(slotName: string, { description, model, type,
28
17
  readonly isCallback: boolean;
29
18
  } & {
30
19
  readonly expr: any;
31
- readonly valueJSON: string | any[] | Record<string, any> | undefined;
20
+ readonly valueJSON: any[] | Record<string, any> | string | undefined;
32
21
  } & {
33
22
  set(newVal: any): void;
34
23
  reset(): void;
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = ConfigSlot;
4
4
  const mobx_state_tree_1 = require("mobx-state-tree");
5
+ const util_1 = require("../util");
5
6
  const jexlStrings_1 = require("../util/jexlStrings");
6
7
  const mst_1 = require("../util/types/mst");
7
- const util_1 = require("../util");
8
- function isValidColorString( /* str */) {
9
- // TODO: check all the crazy cases for whether it's a valid HTML/CSS color string
8
+ function isValidColorString() {
10
9
  return true;
11
10
  }
12
11
  const typeModels = {
@@ -22,7 +21,6 @@ const typeModels = {
22
21
  fileLocation: mst_1.FileLocation,
23
22
  frozen: mobx_state_tree_1.types.frozen(),
24
23
  };
25
- // default values we use if the defaultValue is malformed or does not work
26
24
  const fallbackDefaults = {
27
25
  stringArray: [],
28
26
  stringArrayMap: {},
@@ -50,14 +48,12 @@ const objectJSON = (self) => ({
50
48
  },
51
49
  },
52
50
  });
53
- // custom actions for modifying the value models
54
51
  const typeModelExtensions = {
55
52
  fileLocation: objectJSON,
56
53
  number: literalJSON,
57
54
  integer: literalJSON,
58
55
  boolean: literalJSON,
59
56
  frozen: objectJSON,
60
- // special actions for working with stringArray slots
61
57
  stringArray: (self) => ({
62
58
  views: {
63
59
  get valueJSON() {
@@ -128,21 +124,10 @@ const typeModelExtensions = {
128
124
  },
129
125
  }),
130
126
  };
131
- // const FunctionStringType = types.refinement(
132
- // 'FunctionString',
133
- // types.string,
134
- // str => functionRegexp.test(str),
135
- // )
136
127
  const JexlStringType = mobx_state_tree_1.types.refinement('JexlString', mobx_state_tree_1.types.string, str => str.startsWith('jexl:'));
137
128
  function json(value) {
138
129
  return (value === null || value === void 0 ? void 0 : value.toJSON) ? value.toJSON() : `"${value}"`;
139
130
  }
140
- /**
141
- * builds a MST model for a configuration slot
142
- *
143
- * @param slotName -
144
- * @param definition -
145
- */
146
131
  function ConfigSlot(slotName, { description = '', model, type, defaultValue, contextVariable = [], }) {
147
132
  if (!type) {
148
133
  throw new Error('type name required');
@@ -156,8 +141,6 @@ function ConfigSlot(slotName, { description = '', model, type, defaultValue, con
156
141
  if (defaultValue === undefined) {
157
142
  throw new Error("no 'defaultValue' provided");
158
143
  }
159
- // if the `type` is something like `color`, then the model name
160
- // here will be `ColorConfigSlot`
161
144
  const configSlotModelName = `${slotName
162
145
  .charAt(0)
163
146
  .toUpperCase()}${slotName.slice(1)}ConfigSlot`;
@@ -179,20 +162,14 @@ function ConfigSlot(slotName, { description = '', model, type, defaultValue, con
179
162
  .views(self => ({
180
163
  get expr() {
181
164
  if (self.isCallback) {
182
- // compile as jexl function
183
165
  const { pluginManager } = (0, util_1.getEnv)(self);
184
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
185
166
  if (!pluginManager && typeof jest === 'undefined') {
186
167
  console.warn('no pluginManager detected on config env (if you dynamically instantiate a config, for example in renderProps for your display model, check that you add the env argument)');
187
168
  }
188
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
189
169
  return (0, jexlStrings_1.stringToJexlExpression)(String(self.value), pluginManager === null || pluginManager === void 0 ? void 0 : pluginManager.jexl);
190
170
  }
191
171
  return { evalSync: () => self.value };
192
172
  },
193
- // JS representation of the value of this slot, suitable
194
- // for embedding in either JSON or a JS function string.
195
- // many of the data types override this in typeModelExtensions
196
173
  get valueJSON() {
197
174
  if (self.isCallback) {
198
175
  return undefined;
@@ -233,7 +210,6 @@ function ConfigSlot(slotName, { description = '', model, type, defaultValue, con
233
210
  if (!self.isCallback) {
234
211
  return;
235
212
  }
236
- // try calling it with no arguments
237
213
  try {
238
214
  const funcResult = self.expr.evalSync();
239
215
  if (funcResult !== undefined) {
@@ -242,20 +218,14 @@ function ConfigSlot(slotName, { description = '', model, type, defaultValue, con
242
218
  }
243
219
  }
244
220
  catch (e) {
245
- /* ignore */
246
221
  }
247
222
  self.value = defaultValue;
248
- // if it is still a callback (happens if the defaultValue is a
249
- // callback), then use the last-resort fallback default
250
- // if defaultValue has jexl: string, run this part
251
223
  if (!(type in fallbackDefaults)) {
252
224
  throw new Error(`no fallbackDefault defined for type ${type}`);
253
225
  }
254
226
  self.value = fallbackDefaults[type];
255
227
  },
256
228
  }));
257
- // if there are any type-specific extensions (views or actions)
258
- // to the slot, add those in
259
229
  if (typeModelExtensions[type]) {
260
230
  slot = slot.extend(typeModelExtensions[type]);
261
231
  }
@@ -1,3 +1,3 @@
1
- export { ConfigurationSchema, ConfigurationReference, } from './configurationSchema';
2
- export type { AnyConfigurationSchemaType, AnyConfigurationModel, AnyConfigurationSlot, AnyConfigurationSlotType, AnyConfiguration, } from './types';
1
+ export { ConfigurationReference, ConfigurationSchema, } from './configurationSchema';
2
+ export type { AnyConfiguration, AnyConfigurationModel, AnyConfigurationSchemaType, AnyConfigurationSlot, AnyConfigurationSlotType, } from './types';
3
3
  export * from './util';
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ConfigurationReference = exports.ConfigurationSchema = void 0;
17
+ exports.ConfigurationSchema = exports.ConfigurationReference = void 0;
18
18
  var configurationSchema_1 = require("./configurationSchema");
19
- Object.defineProperty(exports, "ConfigurationSchema", { enumerable: true, get: function () { return configurationSchema_1.ConfigurationSchema; } });
20
19
  Object.defineProperty(exports, "ConfigurationReference", { enumerable: true, get: function () { return configurationSchema_1.ConfigurationReference; } });
20
+ Object.defineProperty(exports, "ConfigurationSchema", { enumerable: true, get: function () { return configurationSchema_1.ConfigurationSchema; } });
21
21
  __exportStar(require("./util"), exports);
@@ -1,6 +1,6 @@
1
- import type { IStateTreeNode, Instance, SnapshotOut } from 'mobx-state-tree';
2
- import type { ConfigurationSchemaType, ConfigurationSchemaOptions } from './configurationSchema';
1
+ import type { ConfigurationSchemaOptions, ConfigurationSchemaType } from './configurationSchema';
3
2
  import type ConfigSlot from './configurationSlot';
3
+ import type { IStateTreeNode, Instance, SnapshotOut } from 'mobx-state-tree';
4
4
  export type GetOptions<SCHEMA> = SCHEMA extends ConfigurationSchemaType<any, infer OPTIONS> ? OPTIONS : never;
5
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
6
  export type GetExplicitIdentifier<SCHEMA> = GetOptions<SCHEMA> extends ConfigurationSchemaOptions<any, infer EXPLICIT_IDENTIFIER extends string> ? EXPLICIT_IDENTIFIER : never;
@@ -10,6 +10,5 @@ export type AnyConfigurationSchemaType = ConfigurationSchemaType<any, any>;
10
10
  export type AnyConfigurationModel = Instance<AnyConfigurationSchemaType>;
11
11
  export type AnyConfigurationSlotType = ReturnType<typeof ConfigSlot>;
12
12
  export type AnyConfigurationSlot = Instance<AnyConfigurationSlotType>;
13
- /** any configuration model, or snapshot thereof */
14
13
  export type AnyConfiguration = AnyConfigurationModel | SnapshotOut<AnyConfigurationModel>;
15
14
  export type ConfigurationModel<SCHEMA extends AnyConfigurationSchemaType> = Instance<SCHEMA>;
@@ -1,32 +1,8 @@
1
- import { AnyConfigurationModel, AnyConfigurationSchemaType, ConfigurationSlotName, ConfigurationSchemaForModel } from './types';
2
- /**
3
- * given a configuration model (an instance of a ConfigurationSchema),
4
- * read the configuration variable at the given path
5
- *
6
- * @param model - instance of ConfigurationSchema
7
- * @param slotPaths - array of paths to read
8
- * @param args - extra arguments e.g. for a feature callback,
9
- * will be sent to each of the slotNames
10
- */
1
+ import type { AnyConfigurationModel, AnyConfigurationSchemaType, ConfigurationSchemaForModel, ConfigurationSlotName } from './types';
11
2
  export declare function readConfObject<CONFMODEL extends AnyConfigurationModel>(confObject: CONFMODEL, slotPath?: ConfigurationSlotName<ConfigurationSchemaForModel<CONFMODEL>> | string[], args?: Record<string, unknown>): any;
12
- /**
13
- * helper method for readConfObject, reads the config from a mst model
14
- *
15
- * @param model - object containing a 'configuration' member
16
- * @param slotPaths - array of paths to read
17
- * @param args - extra arguments e.g. for a feature callback,
18
- * will be sent to each of the slotNames
19
- */
20
3
  export declare function getConf<CONFMODEL extends AnyConfigurationModel>(model: {
21
4
  configuration: CONFMODEL;
22
5
  }, slotPath?: Parameters<typeof readConfObject<CONFMODEL>>[1], args?: Parameters<typeof readConfObject<CONFMODEL>>[2]): any;
23
- /**
24
- * given a union of explicitly typed configuration schema types,
25
- * extract an array of the type names contained in the union
26
- *
27
- * @param unionType -
28
- * @returns Array of type names contained in the union
29
- */
30
6
  export declare function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType: unknown): string[];
31
7
  export declare function isBareConfigurationSchemaType(thing: unknown): thing is AnyConfigurationSchemaType;
32
8
  export declare function isConfigurationSchemaType(thing: unknown): thing is AnyConfigurationSchemaType;
@@ -9,22 +9,12 @@ exports.isConfigurationModel = isConfigurationModel;
9
9
  exports.isConfigurationSlotType = isConfigurationSlotType;
10
10
  const mobx_state_tree_1 = require("mobx-state-tree");
11
11
  const mst_reflection_1 = require("../util/mst-reflection");
12
- /**
13
- * given a configuration model (an instance of a ConfigurationSchema),
14
- * read the configuration variable at the given path
15
- *
16
- * @param model - instance of ConfigurationSchema
17
- * @param slotPaths - array of paths to read
18
- * @param args - extra arguments e.g. for a feature callback,
19
- * will be sent to each of the slotNames
20
- */
21
12
  function readConfObject(confObject, slotPath, args = {}) {
22
13
  if (!slotPath) {
23
- return JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(confObject)));
14
+ return structuredClone((0, mobx_state_tree_1.getSnapshot)(confObject));
24
15
  }
25
- if (typeof slotPath === 'string') {
16
+ else if (typeof slotPath === 'string') {
26
17
  let slot = confObject[slotPath];
27
- // check for the subconf being a map if we don't find it immediately
28
18
  if (!slot &&
29
19
  (0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
30
20
  (0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
@@ -32,28 +22,19 @@ function readConfObject(confObject, slotPath, args = {}) {
32
22
  }
33
23
  if (!slot) {
34
24
  return undefined;
35
- // if we want to be very strict about config slots, we could uncomment the below
36
- // instead of returning undefined
37
- //
38
- // const modelType = getType(model)
39
- // const schemaType = model.configuration && getType(model.configuration)
40
- // throw new Error(
41
- // `no slot "${slotName}" found in ${modelType.name} configuration (${
42
- // schemaType.name
43
- // })`,
44
- // )
45
25
  }
46
- const val = slot.expr ? slot.expr.evalSync(args) : slot;
47
- return (0, mobx_state_tree_1.isStateTreeNode)(val)
48
- ? JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(val)))
49
- : val;
26
+ else {
27
+ const val = slot.expr ? slot.expr.evalSync(args) : slot;
28
+ return (0, mobx_state_tree_1.isStateTreeNode)(val)
29
+ ? JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(val)))
30
+ : val;
31
+ }
50
32
  }
51
- if (Array.isArray(slotPath)) {
33
+ else if (Array.isArray(slotPath)) {
52
34
  const slotName = slotPath[0];
53
35
  if (slotPath.length > 1) {
54
36
  const newPath = slotPath.slice(1);
55
37
  let subConf = confObject[slotName];
56
- // check for the subconf being a map if we don't find it immediately
57
38
  if (!subConf &&
58
39
  (0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
59
40
  (0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
@@ -65,14 +46,6 @@ function readConfObject(confObject, slotPath, args = {}) {
65
46
  }
66
47
  throw new TypeError('slotPath must be a string or array');
67
48
  }
68
- /**
69
- * helper method for readConfObject, reads the config from a mst model
70
- *
71
- * @param model - object containing a 'configuration' member
72
- * @param slotPaths - array of paths to read
73
- * @param args - extra arguments e.g. for a feature callback,
74
- * will be sent to each of the slotNames
75
- */
76
49
  function getConf(model, slotPath, args) {
77
50
  const { configuration } = model;
78
51
  if (isConfigurationModel(configuration)) {
@@ -80,17 +53,9 @@ function getConf(model, slotPath, args) {
80
53
  }
81
54
  throw new TypeError('cannot getConf on this model, it has no configuration');
82
55
  }
83
- /**
84
- * given a union of explicitly typed configuration schema types,
85
- * extract an array of the type names contained in the union
86
- *
87
- * @param unionType -
88
- * @returns Array of type names contained in the union
89
- */
90
56
  function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
91
57
  if ((0, mobx_state_tree_1.isType)(maybeUnionType)) {
92
58
  maybeUnionType = (0, mst_reflection_1.resolveLateType)(maybeUnionType);
93
- // @ts-expect-error
94
59
  if ((0, mobx_state_tree_1.isUnionType)(maybeUnionType)) {
95
60
  const typeNames = [];
96
61
  (0, mst_reflection_1.getUnionSubTypes)(maybeUnionType).forEach(type => {
@@ -101,7 +66,6 @@ function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
101
66
  typeName = [def.type];
102
67
  }
103
68
  if (!typeName[0]) {
104
- // debugger
105
69
  throw new Error(`invalid config schema type ${type}`);
106
70
  }
107
71
  typeNames.push(...typeName);
@@ -118,7 +82,6 @@ function isBareConfigurationSchemaType(thing) {
118
82
  thing.name.includes('ConfigurationSchema'))) {
119
83
  return true;
120
84
  }
121
- // if it's a late type, assume its a config schema
122
85
  if ((0, mobx_state_tree_1.isLateType)(thing)) {
123
86
  return true;
124
87
  }
@@ -129,26 +92,26 @@ function isConfigurationSchemaType(thing) {
129
92
  if (!(0, mobx_state_tree_1.isType)(thing)) {
130
93
  return false;
131
94
  }
132
- // written as a series of if-statements instead of a big logical OR
133
- // because this construction gives much better debugging backtraces.
134
- // also, note that the order of these statements matters, because
135
- // for example some union types are also optional types
136
- if (isBareConfigurationSchemaType(thing)) {
95
+ else if (isBareConfigurationSchemaType(thing)) {
137
96
  return true;
138
97
  }
139
- if ((0, mobx_state_tree_1.isUnionType)(thing)) {
98
+ else if ((0, mobx_state_tree_1.isUnionType)(thing)) {
140
99
  return (0, mst_reflection_1.getUnionSubTypes)(thing).every(t => isConfigurationSchemaType(t) || t.name === 'undefined');
141
100
  }
142
- if ((0, mobx_state_tree_1.isOptionalType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
101
+ else if ((0, mobx_state_tree_1.isOptionalType)(thing) &&
102
+ isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
143
103
  return true;
144
104
  }
145
- if ((0, mobx_state_tree_1.isArrayType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
105
+ else if ((0, mobx_state_tree_1.isArrayType)(thing) &&
106
+ isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
146
107
  return true;
147
108
  }
148
- if ((0, mobx_state_tree_1.isMapType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
109
+ else if ((0, mobx_state_tree_1.isMapType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
149
110
  return true;
150
111
  }
151
- return false;
112
+ else {
113
+ return false;
114
+ }
152
115
  }
153
116
  function isConfigurationModel(thing) {
154
117
  return (0, mobx_state_tree_1.isStateTreeNode)(thing) && isConfigurationSchemaType((0, mobx_state_tree_1.getType)(thing));
@@ -1,7 +1,7 @@
1
- import { AnyConfigurationModel } from '../../configuration';
2
- import { getSubAdapterType } from '../dataAdapterCache';
3
- import { AugmentedRegion as Region } from '../../util/types';
4
- import PluginManager from '../../PluginManager';
1
+ import type PluginManager from '../../PluginManager';
2
+ import type { AnyConfigurationModel } from '../../configuration';
3
+ import type { AugmentedRegion as Region } from '../../util/types';
4
+ import type { getSubAdapterType } from '../dataAdapterCache';
5
5
  export declare abstract class BaseAdapter {
6
6
  config: AnyConfigurationModel;
7
7
  getSubAdapter?: getSubAdapterType | undefined;
@@ -9,16 +9,6 @@ export declare abstract class BaseAdapter {
9
9
  id: string;
10
10
  static capabilities: string[];
11
11
  constructor(config?: AnyConfigurationModel, getSubAdapter?: getSubAdapterType | undefined, pluginManager?: PluginManager | undefined);
12
- /**
13
- * Same as `readConfObject(this.config, arg)`.
14
- * Note: Does not offer the same TS type checking as `readConfObject`,
15
- * consider using that instead.
16
- */
17
12
  getConf(arg: string | string[]): any;
18
- /**
19
- * Called to provide a hint that data tied to a certain region will not be
20
- * needed for the foreseeable future and can be purged from caches, etc
21
- * @param region - Region
22
- */
23
13
  abstract freeResources(region: Region): void;
24
14
  }
@@ -5,18 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.BaseAdapter = void 0;
7
7
  const mobx_state_tree_1 = require("mobx-state-tree");
8
- // locals
9
8
  const configuration_1 = require("../../configuration");
10
9
  const idMaker_1 = __importDefault(require("../../util/idMaker"));
11
- const configuration_2 = require("../../configuration");
12
- const EmptyConfig = (0, configuration_2.ConfigurationSchema)('empty', {});
10
+ const EmptyConfig = (0, configuration_1.ConfigurationSchema)('empty', {});
13
11
  class BaseAdapter {
14
12
  constructor(config = EmptyConfig.create(), getSubAdapter, pluginManager) {
15
13
  this.config = config;
16
14
  this.getSubAdapter = getSubAdapter;
17
15
  this.pluginManager = pluginManager;
18
- // note: we use switch on jest here for more simple feature IDs
19
- // in test environment
20
16
  if (typeof jest === 'undefined') {
21
17
  const data = (0, mobx_state_tree_1.isStateTreeNode)(config) ? (0, mobx_state_tree_1.getSnapshot)(config) : config;
22
18
  this.id = `${(0, idMaker_1.default)(data)}`;
@@ -25,11 +21,6 @@ class BaseAdapter {
25
21
  this.id = 'test';
26
22
  }
27
23
  }
28
- /**
29
- * Same as `readConfObject(this.config, arg)`.
30
- * Note: Does not offer the same TS type checking as `readConfObject`,
31
- * consider using that instead.
32
- */
33
24
  getConf(arg) {
34
25
  return (0, configuration_1.readConfObject)(this.config, arg);
35
26
  }