@jbrowse/core 2.15.0 → 2.15.2

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.
@@ -14,7 +14,7 @@ function isEmpty(obj) {
14
14
  return Object.keys(obj).length === 0;
15
15
  }
16
16
  function generateTitle(name, id, type) {
17
- return [(0, util_2.ellipses)(`${name}` || `${id}`), `${type}`]
17
+ return [(0, util_2.ellipses)(`${name || id || ''}`), `${type}`]
18
18
  .filter(f => !!f)
19
19
  .join(' - ');
20
20
  }
@@ -219,7 +219,7 @@ export default class PluginManager {
219
219
  'mobx-react': typeof import("mobx-react");
220
220
  '@mui/x-data-grid': {
221
221
  useGridApiContext: typeof import("@mui/x-data-grid").useGridApiContext;
222
- useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => import("react").MutableRefObject<Api>;
222
+ useGridApiRef: <Api extends import("@mui/x-data-grid").GridApiCommon = import("@mui/x-data-grid/internals").GridApiCommunity>() => React.MutableRefObject<Api>;
223
223
  useGridRootProps: () => import("@mui/x-data-grid/internals").DataGridProcessedProps;
224
224
  };
225
225
  '@mui/material/utils': typeof import("@mui/material/utils");
@@ -12,7 +12,7 @@ export default class TextSearchManager {
12
12
  pluginManager: PluginManager;
13
13
  adapterCache: QuickLRU<string, BaseTextSearchAdapter>;
14
14
  constructor(pluginManager: PluginManager);
15
- loadTextSearchAdapters(searchScope: SearchScope): BaseTextSearchAdapter[];
15
+ loadTextSearchAdapters(searchScope: SearchScope): Promise<BaseTextSearchAdapter[]>;
16
16
  relevantAdapters(searchScope: SearchScope): ({
17
17
  [x: string]: any;
18
18
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
@@ -30,8 +30,9 @@ export default class TextSearchManager {
30
30
  } & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
31
31
  /**
32
32
  * Returns list of relevant results given a search query and options
33
- * @param args - search options/arguments include: search query
34
- * limit of results to return, searchType...prefix | full | exact", etc.
33
+ *
34
+ * @param args - search options/arguments include: search query limit of
35
+ * results to return, searchType...prefix | full | exact", etc.
35
36
  */
36
37
  search(args: BaseTextSearchArgs, searchScope: SearchScope, rankFn: (results: BaseResult[]) => BaseResult[]): Promise<BaseResult[]>;
37
38
  /**
@@ -13,26 +13,25 @@ class TextSearchManager {
13
13
  });
14
14
  }
15
15
  loadTextSearchAdapters(searchScope) {
16
- const pm = this.pluginManager;
17
- return this.relevantAdapters(searchScope).map(conf => {
16
+ return Promise.all(this.relevantAdapters(searchScope).map(async (conf) => {
18
17
  const adapterId = (0, configuration_1.readConfObject)(conf, 'textSearchAdapterId');
19
18
  const r = this.adapterCache.get(adapterId);
20
19
  if (r) {
21
20
  return r;
22
21
  }
23
22
  else {
24
- const { AdapterClass } = pm.getTextSearchAdapterType(conf.type);
25
- const a = new AdapterClass(conf, undefined, pm);
26
- this.adapterCache.set(adapterId, a);
27
- return a;
23
+ const adapterType = this.pluginManager.getTextSearchAdapterType(conf.type);
24
+ const AdapterClass = await adapterType.getAdapterClass();
25
+ const adapterInstance = new AdapterClass(conf, undefined, this.pluginManager);
26
+ this.adapterCache.set(adapterId, adapterInstance);
27
+ return adapterInstance;
28
28
  }
29
- });
29
+ }));
30
30
  }
31
31
  relevantAdapters(searchScope) {
32
- var _a, _b;
33
- const pm = this.pluginManager;
34
- const { aggregateTextSearchAdapters } = (_a = pm.rootModel) === null || _a === void 0 ? void 0 : _a.jbrowse;
35
- const { tracks } = (_b = pm.rootModel) === null || _b === void 0 ? void 0 : _b.session;
32
+ const rootModel = this.pluginManager.rootModel;
33
+ const { aggregateTextSearchAdapters } = rootModel === null || rootModel === void 0 ? void 0 : rootModel.jbrowse;
34
+ const { tracks } = rootModel === null || rootModel === void 0 ? void 0 : rootModel.session;
36
35
  const { assemblyName } = searchScope;
37
36
  return [
38
37
  ...this.getAdaptersWithAssembly(assemblyName, aggregateTextSearchAdapters),
@@ -56,11 +55,12 @@ class TextSearchManager {
56
55
  }
57
56
  /**
58
57
  * Returns list of relevant results given a search query and options
59
- * @param args - search options/arguments include: search query
60
- * limit of results to return, searchType...prefix | full | exact", etc.
58
+ *
59
+ * @param args - search options/arguments include: search query limit of
60
+ * results to return, searchType...prefix | full | exact", etc.
61
61
  */
62
62
  async search(args, searchScope, rankFn) {
63
- const adapters = this.loadTextSearchAdapters(searchScope);
63
+ const adapters = await this.loadTextSearchAdapters(searchScope);
64
64
  const results = await Promise.all(adapters.map(a => a.searchIndex(args)));
65
65
  return this.sortResults(results.flat(), rankFn);
66
66
  }
@@ -28,14 +28,8 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pluginMana
28
28
  loadingP: Promise<void> | undefined;
29
29
  volatileRegions: BasicRegion[] | undefined;
30
30
  refNameAliases: RefNameAliases | undefined;
31
+ lowerCaseRefNameAliases: RefNameAliases | undefined;
31
32
  cytobands: Feature[] | undefined;
32
- } & {
33
- /**
34
- * #getter
35
- */
36
- readonly lowerCaseRefNameAliases: {
37
- [k: string]: string;
38
- } | undefined;
39
33
  } & {
40
34
  /**
41
35
  * #method
@@ -115,9 +109,10 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pluginMana
115
109
  /**
116
110
  * #action
117
111
  */
118
- setLoaded({ regions, refNameAliases, cytobands, }: {
112
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
119
113
  regions: Region[];
120
114
  refNameAliases: RefNameAliases;
115
+ lowerCaseRefNameAliases: RefNameAliases;
121
116
  cytobands: Feature[];
122
117
  }): void;
123
118
  /**
@@ -131,7 +126,7 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pluginMana
131
126
  /**
132
127
  * #action
133
128
  */
134
- setRefNameAliases(aliases: RefNameAliases): void;
129
+ setRefNameAliases(aliases: RefNameAliases, lowerCaseAliases: RefNameAliases): void;
135
130
  /**
136
131
  * #action
137
132
  */
@@ -102,20 +102,8 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
102
102
  loadingP: undefined,
103
103
  volatileRegions: undefined,
104
104
  refNameAliases: undefined,
105
+ lowerCaseRefNameAliases: undefined,
105
106
  cytobands: undefined,
106
- }))
107
- .views(self => ({
108
- /**
109
- * #getter
110
- */
111
- get lowerCaseRefNameAliases() {
112
- return self.refNameAliases
113
- ? Object.fromEntries(Object.entries(self.refNameAliases).map(([key, val]) => [
114
- key.toLowerCase(),
115
- val,
116
- ]))
117
- : undefined;
118
- },
119
107
  }))
120
108
  .views(self => ({
121
109
  /**
@@ -258,9 +246,9 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
258
246
  /**
259
247
  * #action
260
248
  */
261
- setLoaded({ regions, refNameAliases, cytobands, }) {
249
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }) {
262
250
  this.setRegions(regions);
263
- this.setRefNameAliases(refNameAliases);
251
+ this.setRefNameAliases(refNameAliases, lowerCaseRefNameAliases);
264
252
  this.setCytobands(cytobands);
265
253
  },
266
254
  /**
@@ -278,8 +266,9 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
278
266
  /**
279
267
  * #action
280
268
  */
281
- setRefNameAliases(aliases) {
269
+ setRefNameAliases(aliases, lowerCaseAliases) {
282
270
  self.refNameAliases = aliases;
271
+ self.lowerCaseRefNameAliases = lowerCaseAliases;
283
272
  },
284
273
  /**
285
274
  * #action
@@ -347,12 +336,17 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
347
336
  // mapping for the primary region to be an alias
348
337
  refNameAliases[_c = region.refName] || (refNameAliases[_c] = region.refName);
349
338
  }
339
+ const lowerCaseRefNameAliases = Object.fromEntries(Object.entries(refNameAliases).map(([key, val]) => [
340
+ key.toLowerCase(),
341
+ val,
342
+ ]));
350
343
  this.setLoaded({
351
344
  refNameAliases,
352
345
  regions: adapterRegionsWithAssembly.map(r => ({
353
346
  ...r,
354
347
  refName: refNameAliases[r.refName] || r.refName,
355
348
  })),
349
+ lowerCaseRefNameAliases,
356
350
  cytobands: await getCytobands({
357
351
  config: cytobandAdapterConf,
358
352
  pluginManager,
@@ -23,11 +23,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
23
23
  refNameAliases: {
24
24
  [x: string]: string;
25
25
  } | undefined;
26
- cytobands: import("../util").Feature[] | undefined;
27
- } & {
28
- readonly lowerCaseRefNameAliases: {
29
- [k: string]: string;
26
+ lowerCaseRefNameAliases: {
27
+ [x: string]: string;
30
28
  } | undefined;
29
+ cytobands: import("../util").Feature[] | undefined;
31
30
  } & {
32
31
  getConf(arg: string): any;
33
32
  } & {
@@ -50,17 +49,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
50
49
  getRefNameColor(refName: string): string | undefined;
51
50
  isValidRefName(refName: string): boolean;
52
51
  } & {
53
- setLoaded({ regions, refNameAliases, cytobands, }: {
52
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
54
53
  regions: import("../util").Region[];
55
54
  refNameAliases: {
56
55
  [x: string]: string;
57
56
  };
57
+ lowerCaseRefNameAliases: {
58
+ [x: string]: string;
59
+ };
58
60
  cytobands: import("../util").Feature[];
59
61
  }): void;
60
62
  setError(e: unknown): void;
61
63
  setRegions(regions: import("../util").Region[]): void;
62
64
  setRefNameAliases(aliases: {
63
65
  [x: string]: string;
66
+ }, lowerCaseAliases: {
67
+ [x: string]: string;
64
68
  }): void;
65
69
  setCytobands(cytobands: import("../util").Feature[]): void;
66
70
  setLoadingP(p?: Promise<void>): void;
@@ -91,11 +95,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
91
95
  refNameAliases: {
92
96
  [x: string]: string;
93
97
  } | undefined;
94
- cytobands: import("../util").Feature[] | undefined;
95
- } & {
96
- readonly lowerCaseRefNameAliases: {
97
- [k: string]: string;
98
+ lowerCaseRefNameAliases: {
99
+ [x: string]: string;
98
100
  } | undefined;
101
+ cytobands: import("../util").Feature[] | undefined;
99
102
  } & {
100
103
  getConf(arg: string): any;
101
104
  } & {
@@ -118,17 +121,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
118
121
  getRefNameColor(refName: string): string | undefined;
119
122
  isValidRefName(refName: string): boolean;
120
123
  } & {
121
- setLoaded({ regions, refNameAliases, cytobands, }: {
124
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
122
125
  regions: import("../util").Region[];
123
126
  refNameAliases: {
124
127
  [x: string]: string;
125
128
  };
129
+ lowerCaseRefNameAliases: {
130
+ [x: string]: string;
131
+ };
126
132
  cytobands: import("../util").Feature[];
127
133
  }): void;
128
134
  setError(e: unknown): void;
129
135
  setRegions(regions: import("../util").Region[]): void;
130
136
  setRefNameAliases(aliases: {
131
137
  [x: string]: string;
138
+ }, lowerCaseAliases: {
139
+ [x: string]: string;
132
140
  }): void;
133
141
  setCytobands(cytobands: import("../util").Feature[]): void;
134
142
  setLoadingP(p?: Promise<void>): void;
@@ -157,11 +165,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
157
165
  refNameAliases: {
158
166
  [x: string]: string;
159
167
  } | undefined;
160
- cytobands: import("../util").Feature[] | undefined;
161
- } & {
162
- readonly lowerCaseRefNameAliases: {
163
- [k: string]: string;
168
+ lowerCaseRefNameAliases: {
169
+ [x: string]: string;
164
170
  } | undefined;
171
+ cytobands: import("../util").Feature[] | undefined;
165
172
  } & {
166
173
  getConf(arg: string): any;
167
174
  } & {
@@ -184,17 +191,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
184
191
  getRefNameColor(refName: string): string | undefined;
185
192
  isValidRefName(refName: string): boolean;
186
193
  } & {
187
- setLoaded({ regions, refNameAliases, cytobands, }: {
194
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
188
195
  regions: import("../util").Region[];
189
196
  refNameAliases: {
190
197
  [x: string]: string;
191
198
  };
199
+ lowerCaseRefNameAliases: {
200
+ [x: string]: string;
201
+ };
192
202
  cytobands: import("../util").Feature[];
193
203
  }): void;
194
204
  setError(e: unknown): void;
195
205
  setRegions(regions: import("../util").Region[]): void;
196
206
  setRefNameAliases(aliases: {
197
207
  [x: string]: string;
208
+ }, lowerCaseAliases: {
209
+ [x: string]: string;
198
210
  }): void;
199
211
  setCytobands(cytobands: import("../util").Feature[]): void;
200
212
  setLoadingP(p?: Promise<void>): void;
@@ -228,11 +240,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
228
240
  refNameAliases: {
229
241
  [x: string]: string;
230
242
  } | undefined;
231
- cytobands: import("../util").Feature[] | undefined;
232
- } & {
233
- readonly lowerCaseRefNameAliases: {
234
- [k: string]: string;
243
+ lowerCaseRefNameAliases: {
244
+ [x: string]: string;
235
245
  } | undefined;
246
+ cytobands: import("../util").Feature[] | undefined;
236
247
  } & {
237
248
  getConf(arg: string): any;
238
249
  } & {
@@ -255,17 +266,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
255
266
  getRefNameColor(refName: string): string | undefined;
256
267
  isValidRefName(refName: string): boolean;
257
268
  } & {
258
- setLoaded({ regions, refNameAliases, cytobands, }: {
269
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
259
270
  regions: import("../util").Region[];
260
271
  refNameAliases: {
261
272
  [x: string]: string;
262
273
  };
274
+ lowerCaseRefNameAliases: {
275
+ [x: string]: string;
276
+ };
263
277
  cytobands: import("../util").Feature[];
264
278
  }): void;
265
279
  setError(e: unknown): void;
266
280
  setRegions(regions: import("../util").Region[]): void;
267
281
  setRefNameAliases(aliases: {
268
282
  [x: string]: string;
283
+ }, lowerCaseAliases: {
284
+ [x: string]: string;
269
285
  }): void;
270
286
  setCytobands(cytobands: import("../util").Feature[]): void;
271
287
  setLoadingP(p?: Promise<void>): void;
@@ -294,11 +310,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
294
310
  refNameAliases: {
295
311
  [x: string]: string;
296
312
  } | undefined;
297
- cytobands: import("../util").Feature[] | undefined;
298
- } & {
299
- readonly lowerCaseRefNameAliases: {
300
- [k: string]: string;
313
+ lowerCaseRefNameAliases: {
314
+ [x: string]: string;
301
315
  } | undefined;
316
+ cytobands: import("../util").Feature[] | undefined;
302
317
  } & {
303
318
  getConf(arg: string): any;
304
319
  } & {
@@ -321,17 +336,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
321
336
  getRefNameColor(refName: string): string | undefined;
322
337
  isValidRefName(refName: string): boolean;
323
338
  } & {
324
- setLoaded({ regions, refNameAliases, cytobands, }: {
339
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
325
340
  regions: import("../util").Region[];
326
341
  refNameAliases: {
327
342
  [x: string]: string;
328
343
  };
344
+ lowerCaseRefNameAliases: {
345
+ [x: string]: string;
346
+ };
329
347
  cytobands: import("../util").Feature[];
330
348
  }): void;
331
349
  setError(e: unknown): void;
332
350
  setRegions(regions: import("../util").Region[]): void;
333
351
  setRefNameAliases(aliases: {
334
352
  [x: string]: string;
353
+ }, lowerCaseAliases: {
354
+ [x: string]: string;
335
355
  }): void;
336
356
  setCytobands(cytobands: import("../util").Feature[]): void;
337
357
  setLoadingP(p?: Promise<void>): void;
@@ -378,11 +398,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
378
398
  refNameAliases: {
379
399
  [x: string]: string;
380
400
  } | undefined;
381
- cytobands: import("../util").Feature[] | undefined;
382
- } & {
383
- readonly lowerCaseRefNameAliases: {
384
- [k: string]: string;
401
+ lowerCaseRefNameAliases: {
402
+ [x: string]: string;
385
403
  } | undefined;
404
+ cytobands: import("../util").Feature[] | undefined;
386
405
  } & {
387
406
  getConf(arg: string): any;
388
407
  } & {
@@ -405,17 +424,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
405
424
  getRefNameColor(refName: string): string | undefined;
406
425
  isValidRefName(refName: string): boolean;
407
426
  } & {
408
- setLoaded({ regions, refNameAliases, cytobands, }: {
427
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
409
428
  regions: import("../util").Region[];
410
429
  refNameAliases: {
411
430
  [x: string]: string;
412
431
  };
432
+ lowerCaseRefNameAliases: {
433
+ [x: string]: string;
434
+ };
413
435
  cytobands: import("../util").Feature[];
414
436
  }): void;
415
437
  setError(e: unknown): void;
416
438
  setRegions(regions: import("../util").Region[]): void;
417
439
  setRefNameAliases(aliases: {
418
440
  [x: string]: string;
441
+ }, lowerCaseAliases: {
442
+ [x: string]: string;
419
443
  }): void;
420
444
  setCytobands(cytobands: import("../util").Feature[]): void;
421
445
  setLoadingP(p?: Promise<void>): void;
@@ -444,11 +468,10 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
444
468
  refNameAliases: {
445
469
  [x: string]: string;
446
470
  } | undefined;
447
- cytobands: import("../util").Feature[] | undefined;
448
- } & {
449
- readonly lowerCaseRefNameAliases: {
450
- [k: string]: string;
471
+ lowerCaseRefNameAliases: {
472
+ [x: string]: string;
451
473
  } | undefined;
474
+ cytobands: import("../util").Feature[] | undefined;
452
475
  } & {
453
476
  getConf(arg: string): any;
454
477
  } & {
@@ -471,17 +494,22 @@ declare function assemblyManagerFactory(conf: IAnyType, pm: PluginManager): impo
471
494
  getRefNameColor(refName: string): string | undefined;
472
495
  isValidRefName(refName: string): boolean;
473
496
  } & {
474
- setLoaded({ regions, refNameAliases, cytobands, }: {
497
+ setLoaded({ regions, refNameAliases, lowerCaseRefNameAliases, cytobands, }: {
475
498
  regions: import("../util").Region[];
476
499
  refNameAliases: {
477
500
  [x: string]: string;
478
501
  };
502
+ lowerCaseRefNameAliases: {
503
+ [x: string]: string;
504
+ };
479
505
  cytobands: import("../util").Feature[];
480
506
  }): void;
481
507
  setError(e: unknown): void;
482
508
  setRegions(regions: import("../util").Region[]): void;
483
509
  setRefNameAliases(aliases: {
484
510
  [x: string]: string;
511
+ }, lowerCaseAliases: {
512
+ [x: string]: string;
485
513
  }): void;
486
514
  setCytobands(cytobands: import("../util").Feature[]): void;
487
515
  setLoadingP(p?: Promise<void>): void;
@@ -40,12 +40,7 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
40
40
  // callbacks, etc
41
41
  const adapterConfig = dataAdapterType.configSchema.create(adapterConfigSnapshot, { pluginManager });
42
42
  const getSubAdapter = getAdapter.bind(null, pluginManager, sessionId);
43
- // instantiate the adapter itself with its config schema, and a bound
44
- // func that it can use to get any inner adapters
45
- // (such as sequence adapters or wrapped subadapters) that it needs
46
- //
47
- const { AdapterClass, getAdapterClass } = dataAdapterType;
48
- const CLASS = AdapterClass || (await getAdapterClass());
43
+ const CLASS = await dataAdapterType.getAdapterClass();
49
44
  const dataAdapter = new CLASS(adapterConfig, getSubAdapter, pluginManager);
50
45
  // store it in our cache
51
46
  adapterCache[cacheKey] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/core",
3
- "version": "2.15.0",
3
+ "version": "2.15.2",
4
4
  "description": "JBrowse 2 core libraries used by plugins",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -73,5 +73,5 @@
73
73
  "access": "public",
74
74
  "directory": "dist"
75
75
  },
76
- "gitHead": "87eeb1fbf8311dbf88d5e75b5a265f03beffdda8"
76
+ "gitHead": "8a58cefbfe39af4c97bcb6ead354d72c9fef9224"
77
77
  }
@@ -7,7 +7,6 @@ export interface AdapterMetadata {
7
7
  description?: string;
8
8
  }
9
9
  export default class AdapterType extends PluggableElementBase {
10
- AdapterClass?: AnyAdapter;
11
10
  getAdapterClass: () => Promise<AnyAdapter>;
12
11
  configSchema: AnyConfigurationSchemaType;
13
12
  adapterCapabilities: string[];
@@ -7,16 +7,10 @@ const PluggableElementBase_1 = __importDefault(require("./PluggableElementBase")
7
7
  class AdapterType extends PluggableElementBase_1.default {
8
8
  constructor(stuff) {
9
9
  super(stuff);
10
- if ('AdapterClass' in stuff) {
11
- this.AdapterClass = stuff.AdapterClass;
12
- this.getAdapterClass = async () => stuff.AdapterClass;
13
- }
14
- else if ('getAdapterClass' in stuff) {
15
- this.getAdapterClass = stuff.getAdapterClass;
16
- }
17
- else {
18
- throw new Error(`no AdapterClass or getAdapterClass is defined for adapter type ${this.name}`);
19
- }
10
+ this.getAdapterClass =
11
+ 'AdapterClass' in stuff
12
+ ? async () => stuff.AdapterClass
13
+ : stuff.getAdapterClass;
20
14
  this.configSchema = stuff.configSchema;
21
15
  this.adapterCapabilities = stuff.adapterCapabilities || [];
22
16
  this.adapterMetadata = stuff.adapterMetadata;
@@ -10,7 +10,10 @@ export default class DisplayType extends PluggableElementBase {
10
10
  * The track type the display is associated with
11
11
  */
12
12
  trackType: string;
13
- subDisplay?: unknown;
13
+ subDisplay?: {
14
+ type: string;
15
+ [key: string]: unknown;
16
+ };
14
17
  /**
15
18
  * The view type the display is associated with
16
19
  */
@@ -21,7 +24,10 @@ export default class DisplayType extends PluggableElementBase {
21
24
  trackType: string;
22
25
  viewType: string;
23
26
  displayName?: string;
24
- subDisplay?: unknown;
27
+ subDisplay?: {
28
+ type: string;
29
+ [key: string]: unknown;
30
+ };
25
31
  configSchema: AnyConfigurationSchemaType;
26
32
  ReactComponent: AnyReactComponentType;
27
33
  });
@@ -2,7 +2,7 @@ import PluggableElementBase from './PluggableElementBase';
2
2
  import { AnyConfigurationSchemaType } from '../configuration';
3
3
  import { AnyAdapter } from '../data_adapters/BaseAdapter';
4
4
  export default class TextSearchAdapterType extends PluggableElementBase {
5
- AdapterClass: AnyAdapter;
5
+ getAdapterClass: () => Promise<AnyAdapter>;
6
6
  configSchema: AnyConfigurationSchemaType;
7
7
  description?: string;
8
8
  constructor(stuff: {
@@ -10,6 +10,9 @@ export default class TextSearchAdapterType extends PluggableElementBase {
10
10
  displayName?: string;
11
11
  description?: string;
12
12
  configSchema: AnyConfigurationSchemaType;
13
+ } & ({
13
14
  AdapterClass: AnyAdapter;
14
- });
15
+ } | {
16
+ getAdapterClass: () => Promise<AnyAdapter>;
17
+ }));
15
18
  }
@@ -9,7 +9,10 @@ class TextSearchAdapterType extends PluggableElementBase_1.default {
9
9
  super(stuff);
10
10
  this.description = stuff.description;
11
11
  this.configSchema = stuff.configSchema;
12
- this.AdapterClass = stuff.AdapterClass;
12
+ this.getAdapterClass =
13
+ 'getAdapterClass' in stuff
14
+ ? stuff.getAdapterClass
15
+ : async () => stuff.AdapterClass;
13
16
  }
14
17
  }
15
18
  exports.default = TextSearchAdapterType;
@@ -79,6 +79,7 @@ export declare function createBaseTrackModel(pm: PluginManager, trackType: strin
79
79
  trackMenuItems(): (import("../../ui").MenuDivider | import("../../ui").MenuSubHeader | import("../../ui").NormalMenuItem | import("../../ui").CheckboxMenuItem | import("../../ui").RadioMenuItem | import("../../ui").SubMenuItem | {
80
80
  type: string;
81
81
  label: string;
82
+ priority: number;
82
83
  subMenu: {
83
84
  type: string;
84
85
  label: string;
@@ -172,6 +172,7 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
172
172
  {
173
173
  type: 'subMenu',
174
174
  label: 'Display types',
175
+ priority: -1000,
175
176
  subMenu: compatDisp.map(d => ({
176
177
  type: 'radio',
177
178
  label: pm.getDisplayType(d.type).displayName,