@jbrowse/product-core 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/RootModel/BaseRootModel.d.ts +607 -0
- package/dist/RootModel/BaseRootModel.js +101 -0
- package/dist/RootModel/InternetAccounts.d.ts +31 -0
- package/dist/RootModel/InternetAccounts.js +99 -0
- package/dist/RootModel/index.d.ts +2 -0
- package/dist/RootModel/index.js +18 -0
- package/dist/Session/BaseSession.d.ts +99 -0
- package/dist/Session/BaseSession.js +112 -0
- package/dist/Session/Connections.d.ts +174 -0
- package/dist/Session/Connections.js +113 -0
- package/dist/Session/DialogQueue.d.ts +34 -0
- package/dist/Session/DialogQueue.js +55 -0
- package/dist/Session/DrawerWidgets.d.ts +88 -0
- package/dist/Session/DrawerWidgets.js +167 -0
- package/dist/Session/MultipleViews.d.ts +1798 -0
- package/dist/Session/MultipleViews.js +105 -0
- package/dist/Session/ReferenceManagement.d.ts +34 -0
- package/dist/Session/ReferenceManagement.js +91 -0
- package/dist/Session/SessionTracks.d.ts +1866 -0
- package/dist/Session/SessionTracks.js +75 -0
- package/dist/Session/Themes.d.ts +38 -0
- package/dist/Session/Themes.js +64 -0
- package/dist/Session/Tracks.d.ts +1821 -0
- package/dist/Session/Tracks.js +51 -0
- package/dist/Session/index.d.ts +10 -0
- package/dist/Session/index.js +26 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/ui/AboutDialog.d.ts +6 -0
- package/dist/ui/AboutDialog.js +20 -0
- package/dist/ui/AboutDialogContents.d.ts +5 -0
- package/dist/ui/AboutDialogContents.js +70 -0
- package/dist/ui/FileInfoPanel.d.ts +5 -0
- package/dist/ui/FileInfoPanel.js +76 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +17 -0
- package/esm/RootModel/BaseRootModel.d.ts +607 -0
- package/esm/RootModel/BaseRootModel.js +93 -0
- package/esm/RootModel/InternetAccounts.d.ts +31 -0
- package/esm/RootModel/InternetAccounts.js +95 -0
- package/esm/RootModel/index.d.ts +2 -0
- package/esm/RootModel/index.js +2 -0
- package/esm/Session/BaseSession.d.ts +99 -0
- package/esm/Session/BaseSession.js +103 -0
- package/esm/Session/Connections.d.ts +174 -0
- package/esm/Session/Connections.js +108 -0
- package/esm/Session/DialogQueue.d.ts +34 -0
- package/esm/Session/DialogQueue.js +50 -0
- package/esm/Session/DrawerWidgets.d.ts +88 -0
- package/esm/Session/DrawerWidgets.js +162 -0
- package/esm/Session/MultipleViews.d.ts +1798 -0
- package/esm/Session/MultipleViews.js +100 -0
- package/esm/Session/ReferenceManagement.d.ts +34 -0
- package/esm/Session/ReferenceManagement.js +86 -0
- package/esm/Session/SessionTracks.d.ts +1866 -0
- package/esm/Session/SessionTracks.js +70 -0
- package/esm/Session/Themes.d.ts +38 -0
- package/esm/Session/Themes.js +59 -0
- package/esm/Session/Tracks.d.ts +1821 -0
- package/esm/Session/Tracks.js +46 -0
- package/esm/Session/index.d.ts +10 -0
- package/esm/Session/index.js +10 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/ui/AboutDialog.d.ts +6 -0
- package/esm/ui/AboutDialog.js +13 -0
- package/esm/ui/AboutDialogContents.d.ts +5 -0
- package/esm/ui/AboutDialogContents.js +41 -0
- package/esm/ui/FileInfoPanel.d.ts +5 -0
- package/esm/ui/FileInfoPanel.js +47 -0
- package/esm/ui/index.d.ts +1 -0
- package/esm/ui/index.js +1 -0
- package/package.json +66 -0
- package/src/RootModel/BaseRootModel.ts +131 -0
- package/src/RootModel/InternetAccounts.ts +126 -0
- package/src/RootModel/index.ts +2 -0
- package/src/Session/BaseSession.ts +129 -0
- package/src/Session/Connections.ts +145 -0
- package/src/Session/DialogQueue.ts +63 -0
- package/src/Session/DrawerWidgets.ts +222 -0
- package/src/Session/MultipleViews.ts +151 -0
- package/src/Session/ReferenceManagement.ts +134 -0
- package/src/Session/SessionTracks.ts +98 -0
- package/src/Session/Themes.ts +85 -0
- package/src/Session/Tracks.ts +72 -0
- package/src/Session/index.ts +10 -0
- package/src/index.ts +3 -0
- package/src/ui/AboutDialog.tsx +31 -0
- package/src/ui/AboutDialogContents.tsx +88 -0
- package/src/ui/FileInfoPanel.tsx +75 -0
- package/src/ui/index.ts +1 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import assemblyManagerFactory from '@jbrowse/core/assemblyManager';
|
|
2
|
+
import RpcManager from '@jbrowse/core/rpc/RpcManager';
|
|
3
|
+
import { cast, getSnapshot, isStateTreeNode, types, } from 'mobx-state-tree';
|
|
4
|
+
import TextSearchManager from '@jbrowse/core/TextSearch/TextSearchManager';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel BaseRootModel
|
|
7
|
+
* #category root
|
|
8
|
+
* factory function for the Base-level root model shared by all products
|
|
9
|
+
*/
|
|
10
|
+
export function BaseRootModelFactory({ pluginManager, jbrowseModelType, sessionModelType, assemblyConfigSchema, }) {
|
|
11
|
+
return types
|
|
12
|
+
.model('BaseRootModel', {
|
|
13
|
+
/**
|
|
14
|
+
* #property
|
|
15
|
+
* `jbrowse` is a mapping of the config.json into the in-memory state
|
|
16
|
+
* tree
|
|
17
|
+
*/
|
|
18
|
+
jbrowse: jbrowseModelType,
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
* `session` encompasses the currently active state of the app, including
|
|
22
|
+
* views open, tracks open in those views, etc.
|
|
23
|
+
*/
|
|
24
|
+
session: types.maybe(sessionModelType),
|
|
25
|
+
/**
|
|
26
|
+
* #property
|
|
27
|
+
*/
|
|
28
|
+
sessionPath: types.optional(types.string, ''),
|
|
29
|
+
/**
|
|
30
|
+
* #property
|
|
31
|
+
*/
|
|
32
|
+
assemblyManager: types.optional(assemblyManagerFactory(assemblyConfigSchema, pluginManager), {}),
|
|
33
|
+
})
|
|
34
|
+
.volatile(self => ({
|
|
35
|
+
rpcManager: new RpcManager(pluginManager, self.jbrowse.configuration.rpc, {
|
|
36
|
+
MainThreadRpcDriver: {},
|
|
37
|
+
}),
|
|
38
|
+
adminMode: false,
|
|
39
|
+
isAssemblyEditing: false,
|
|
40
|
+
error: undefined,
|
|
41
|
+
textSearchManager: new TextSearchManager(pluginManager),
|
|
42
|
+
pluginManager,
|
|
43
|
+
}))
|
|
44
|
+
.actions(self => ({
|
|
45
|
+
/**
|
|
46
|
+
* #action
|
|
47
|
+
*/
|
|
48
|
+
setError(error) {
|
|
49
|
+
self.error = error;
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* #action
|
|
53
|
+
*/
|
|
54
|
+
setSession(sessionSnapshot) {
|
|
55
|
+
self.session = cast(sessionSnapshot);
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* #action
|
|
59
|
+
*/
|
|
60
|
+
setDefaultSession() {
|
|
61
|
+
this.setSession(self.jbrowse.defaultSession);
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* #action
|
|
65
|
+
*/
|
|
66
|
+
setSessionPath(path) {
|
|
67
|
+
self.sessionPath = path;
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* #action
|
|
71
|
+
*/
|
|
72
|
+
renameCurrentSession(newName) {
|
|
73
|
+
if (self.session) {
|
|
74
|
+
const snapshot = JSON.parse(JSON.stringify(getSnapshot(self.session)));
|
|
75
|
+
snapshot.name = newName;
|
|
76
|
+
this.setSession(snapshot);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* #action
|
|
81
|
+
*/
|
|
82
|
+
setAssemblyEditing(flag) {
|
|
83
|
+
self.isAssemblyEditing = flag;
|
|
84
|
+
},
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
/** Type guard for checking if something is a JB root model */
|
|
88
|
+
export function isRootModel(thing) {
|
|
89
|
+
return (isStateTreeNode(thing) &&
|
|
90
|
+
'session' in thing &&
|
|
91
|
+
'jbrowse' in thing &&
|
|
92
|
+
'assemblyManager' in thing);
|
|
93
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import { UriLocation } from '@jbrowse/core/util';
|
|
4
|
+
import { Instance } from 'mobx-state-tree';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel InternetAccountsMixin
|
|
7
|
+
* #category root
|
|
8
|
+
*/
|
|
9
|
+
export declare function InternetAccountsRootModelMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
10
|
+
/**
|
|
11
|
+
* #property
|
|
12
|
+
*/
|
|
13
|
+
internetAccounts: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
14
|
+
}, {
|
|
15
|
+
/**
|
|
16
|
+
* #action
|
|
17
|
+
*/
|
|
18
|
+
initializeInternetAccount(internetAccountConfig: AnyConfigurationModel, initialSnapshot?: {}): any;
|
|
19
|
+
/**
|
|
20
|
+
* #action
|
|
21
|
+
*/
|
|
22
|
+
createEphemeralInternetAccount(internetAccountId: string, initialSnapshot: {} | undefined, url: string): any;
|
|
23
|
+
/**
|
|
24
|
+
* #action
|
|
25
|
+
*/
|
|
26
|
+
findAppropriateInternetAccount(location: UriLocation): any;
|
|
27
|
+
} & {
|
|
28
|
+
afterCreate(): void;
|
|
29
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
30
|
+
export type RootModelWithInternetAccountsType = ReturnType<typeof InternetAccountsRootModelMixin>;
|
|
31
|
+
export type RootModelWithInternetAccounts = Instance<RootModelWithInternetAccountsType>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { autorun } from 'mobx';
|
|
2
|
+
import { addDisposer, types } from 'mobx-state-tree';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel InternetAccountsMixin
|
|
5
|
+
* #category root
|
|
6
|
+
*/
|
|
7
|
+
export function InternetAccountsRootModelMixin(pluginManager) {
|
|
8
|
+
return types
|
|
9
|
+
.model({
|
|
10
|
+
/**
|
|
11
|
+
* #property
|
|
12
|
+
*/
|
|
13
|
+
internetAccounts: types.array(pluginManager.pluggableMstType('internet account', 'stateModel')),
|
|
14
|
+
})
|
|
15
|
+
.actions(self => ({
|
|
16
|
+
/**
|
|
17
|
+
* #action
|
|
18
|
+
*/
|
|
19
|
+
initializeInternetAccount(internetAccountConfig, initialSnapshot = {}) {
|
|
20
|
+
const internetAccountType = pluginManager.getInternetAccountType(internetAccountConfig.type);
|
|
21
|
+
if (!internetAccountType) {
|
|
22
|
+
throw new Error(`unknown internet account type ${internetAccountConfig.type}`);
|
|
23
|
+
}
|
|
24
|
+
const length = self.internetAccounts.push({
|
|
25
|
+
...initialSnapshot,
|
|
26
|
+
type: internetAccountConfig.type,
|
|
27
|
+
configuration: internetAccountConfig,
|
|
28
|
+
});
|
|
29
|
+
return self.internetAccounts[length - 1];
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* #action
|
|
33
|
+
*/
|
|
34
|
+
createEphemeralInternetAccount(internetAccountId, initialSnapshot = {}, url) {
|
|
35
|
+
let hostUri;
|
|
36
|
+
try {
|
|
37
|
+
hostUri = new URL(url).origin;
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
// ignore
|
|
41
|
+
}
|
|
42
|
+
// id of a custom new internaccount is `${type}-${name}`
|
|
43
|
+
const internetAccountSplit = internetAccountId.split('-');
|
|
44
|
+
const configuration = {
|
|
45
|
+
type: internetAccountSplit[0],
|
|
46
|
+
internetAccountId: internetAccountId,
|
|
47
|
+
name: internetAccountSplit.slice(1).join('-'),
|
|
48
|
+
description: '',
|
|
49
|
+
domains: hostUri ? [hostUri] : [],
|
|
50
|
+
};
|
|
51
|
+
const type = pluginManager.getInternetAccountType(configuration.type);
|
|
52
|
+
const internetAccount = type.stateModel.create({
|
|
53
|
+
...initialSnapshot,
|
|
54
|
+
type: configuration.type,
|
|
55
|
+
configuration,
|
|
56
|
+
});
|
|
57
|
+
self.internetAccounts.push(internetAccount);
|
|
58
|
+
return internetAccount;
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* #action
|
|
62
|
+
*/
|
|
63
|
+
findAppropriateInternetAccount(location) {
|
|
64
|
+
// find the existing account selected from menu
|
|
65
|
+
const selectedId = location.internetAccountId;
|
|
66
|
+
if (selectedId) {
|
|
67
|
+
const selectedAccount = self.internetAccounts.find(account => {
|
|
68
|
+
return account.internetAccountId === selectedId;
|
|
69
|
+
});
|
|
70
|
+
if (selectedAccount) {
|
|
71
|
+
return selectedAccount;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// if no existing account or not found, try to find working account
|
|
75
|
+
for (const account of self.internetAccounts) {
|
|
76
|
+
const handleResult = account.handlesLocation(location);
|
|
77
|
+
if (handleResult) {
|
|
78
|
+
return account;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// if still no existing account, create ephemeral config to use
|
|
82
|
+
return selectedId
|
|
83
|
+
? this.createEphemeralInternetAccount(selectedId, {}, location.uri)
|
|
84
|
+
: null;
|
|
85
|
+
},
|
|
86
|
+
}))
|
|
87
|
+
.actions(self => ({
|
|
88
|
+
afterCreate() {
|
|
89
|
+
addDisposer(self, autorun(() => {
|
|
90
|
+
const { jbrowse } = self;
|
|
91
|
+
jbrowse.internetAccounts.forEach(self.initializeInternetAccount);
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
3
|
+
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
4
|
+
import type { BaseRootModelType } from '../RootModel/BaseRootModel';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel BaseSessionModel
|
|
7
|
+
* base session shared by **all** JBrowse products. Be careful what you include
|
|
8
|
+
* here, everything will use it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function BaseSessionModel<ROOT_MODEL_TYPE extends BaseRootModelType, JB_CONFIG_SCHEMA extends AnyConfigurationSchemaType>(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
11
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
12
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
13
|
+
margin: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
14
|
+
}, {
|
|
15
|
+
/**
|
|
16
|
+
* #volatile
|
|
17
|
+
* this is the globally "selected" object. can be anything. code that
|
|
18
|
+
* wants to deal with this should examine it to see what kind of thing it
|
|
19
|
+
* is.
|
|
20
|
+
*/
|
|
21
|
+
selection: unknown;
|
|
22
|
+
} & {
|
|
23
|
+
readonly root: import("mobx-state-tree").TypeOrStateTreeNodeToStateTreeNode<ROOT_MODEL_TYPE>;
|
|
24
|
+
} & {
|
|
25
|
+
/**
|
|
26
|
+
* #getter
|
|
27
|
+
*/
|
|
28
|
+
readonly jbrowse: any;
|
|
29
|
+
/**
|
|
30
|
+
* #getter
|
|
31
|
+
*/
|
|
32
|
+
readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
33
|
+
/**
|
|
34
|
+
* #getter
|
|
35
|
+
*/
|
|
36
|
+
readonly configuration: Instance<JB_CONFIG_SCHEMA>;
|
|
37
|
+
/**
|
|
38
|
+
* #getter
|
|
39
|
+
*/
|
|
40
|
+
readonly adminMode: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* #getter
|
|
43
|
+
*/
|
|
44
|
+
readonly textSearchManager: import("@jbrowse/core/util").TextSearchManager;
|
|
45
|
+
} & {
|
|
46
|
+
/**
|
|
47
|
+
* #getter
|
|
48
|
+
*/
|
|
49
|
+
readonly assemblies: ({
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
52
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
53
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
54
|
+
aliases: {
|
|
55
|
+
type: string;
|
|
56
|
+
defaultValue: never[];
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
sequence: AnyConfigurationSchemaType;
|
|
60
|
+
refNameColors: {
|
|
61
|
+
type: string;
|
|
62
|
+
defaultValue: never[];
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
refNameAliases: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
66
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
67
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
68
|
+
cytobands: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
69
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
70
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
71
|
+
displayName: {
|
|
72
|
+
type: string;
|
|
73
|
+
defaultValue: string;
|
|
74
|
+
description: string; /**
|
|
75
|
+
* #getter
|
|
76
|
+
*/
|
|
77
|
+
};
|
|
78
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>>)[];
|
|
79
|
+
} & {
|
|
80
|
+
/**
|
|
81
|
+
* #action
|
|
82
|
+
* set the global selection, i.e. the globally-selected object. can be a
|
|
83
|
+
* feature, a view, just about anything
|
|
84
|
+
*/
|
|
85
|
+
setSelection(thing: unknown): void;
|
|
86
|
+
/**
|
|
87
|
+
* #action
|
|
88
|
+
* clears the global selection
|
|
89
|
+
*/
|
|
90
|
+
clearSelection(): void;
|
|
91
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
92
|
+
/** Session mixin MST type for the most basic session */
|
|
93
|
+
export type BaseSessionType = ReturnType<typeof BaseSessionModel>;
|
|
94
|
+
/** Instance of the most basic possible session */
|
|
95
|
+
export type BaseSession = Instance<BaseSessionType>;
|
|
96
|
+
/** Type guard for BaseSession */
|
|
97
|
+
export declare function isBaseSession(thing: IAnyStateTreeNode): thing is BaseSession;
|
|
98
|
+
/** Type guard for whether a thing is JBrowse session */
|
|
99
|
+
export declare function isSession(thing: unknown): thing is BaseSession;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import shortid from 'shortid';
|
|
2
|
+
import { getParent, isStateTreeNode, types, } from 'mobx-state-tree';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel BaseSessionModel
|
|
5
|
+
* base session shared by **all** JBrowse products. Be careful what you include
|
|
6
|
+
* here, everything will use it.
|
|
7
|
+
*/
|
|
8
|
+
export function BaseSessionModel(pluginManager) {
|
|
9
|
+
return types
|
|
10
|
+
.model({
|
|
11
|
+
/**
|
|
12
|
+
* #property
|
|
13
|
+
*/
|
|
14
|
+
id: types.optional(types.identifier, shortid()),
|
|
15
|
+
/**
|
|
16
|
+
* #property
|
|
17
|
+
*/
|
|
18
|
+
name: types.string,
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
22
|
+
margin: 0,
|
|
23
|
+
})
|
|
24
|
+
.volatile(() => ({
|
|
25
|
+
/**
|
|
26
|
+
* #volatile
|
|
27
|
+
* this is the globally "selected" object. can be anything. code that
|
|
28
|
+
* wants to deal with this should examine it to see what kind of thing it
|
|
29
|
+
* is.
|
|
30
|
+
*/
|
|
31
|
+
selection: undefined,
|
|
32
|
+
}))
|
|
33
|
+
.views(self => ({
|
|
34
|
+
get root() {
|
|
35
|
+
return getParent(self);
|
|
36
|
+
},
|
|
37
|
+
}))
|
|
38
|
+
.views(self => ({
|
|
39
|
+
/**
|
|
40
|
+
* #getter
|
|
41
|
+
*/
|
|
42
|
+
get jbrowse() {
|
|
43
|
+
return self.root.jbrowse;
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* #getter
|
|
47
|
+
*/
|
|
48
|
+
get rpcManager() {
|
|
49
|
+
return self.root.rpcManager;
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* #getter
|
|
53
|
+
*/
|
|
54
|
+
get configuration() {
|
|
55
|
+
return this.jbrowse.configuration;
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* #getter
|
|
59
|
+
*/
|
|
60
|
+
get adminMode() {
|
|
61
|
+
return self.root.adminMode;
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* #getter
|
|
65
|
+
*/
|
|
66
|
+
get textSearchManager() {
|
|
67
|
+
return self.root.textSearchManager;
|
|
68
|
+
},
|
|
69
|
+
}))
|
|
70
|
+
.views(self => ({
|
|
71
|
+
/**
|
|
72
|
+
* #getter
|
|
73
|
+
*/
|
|
74
|
+
get assemblies() {
|
|
75
|
+
return self.jbrowse.assemblies;
|
|
76
|
+
},
|
|
77
|
+
}))
|
|
78
|
+
.actions(self => ({
|
|
79
|
+
/**
|
|
80
|
+
* #action
|
|
81
|
+
* set the global selection, i.e. the globally-selected object. can be a
|
|
82
|
+
* feature, a view, just about anything
|
|
83
|
+
*/
|
|
84
|
+
setSelection(thing) {
|
|
85
|
+
self.selection = thing;
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* #action
|
|
89
|
+
* clears the global selection
|
|
90
|
+
*/
|
|
91
|
+
clearSelection() {
|
|
92
|
+
self.selection = undefined;
|
|
93
|
+
},
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
/** Type guard for BaseSession */
|
|
97
|
+
export function isBaseSession(thing) {
|
|
98
|
+
return 'id' in thing && 'name' in thing && 'root' in thing;
|
|
99
|
+
}
|
|
100
|
+
/** Type guard for whether a thing is JBrowse session */
|
|
101
|
+
export function isSession(thing) {
|
|
102
|
+
return isStateTreeNode(thing) && isBaseSession(thing);
|
|
103
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import { IAnyStateTreeNode, Instance } from 'mobx-state-tree';
|
|
4
|
+
import { BaseConnectionConfigModel } from '@jbrowse/core/pluggableElementTypes/models/baseConnectionConfig';
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel ConnectionManagementSessionMixin
|
|
7
|
+
*/
|
|
8
|
+
export declare function ConnectionManagementSessionMixin(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
12
|
+
connectionInstances: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
13
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
14
|
+
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
15
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
16
|
+
name: {
|
|
17
|
+
type: string;
|
|
18
|
+
defaultValue: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
assemblyNames: {
|
|
22
|
+
type: string; /**
|
|
23
|
+
* #property
|
|
24
|
+
*/
|
|
25
|
+
defaultValue: never[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
29
|
+
}, {
|
|
30
|
+
afterAttach(): void;
|
|
31
|
+
addTrackConf(trackConf: {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
34
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
35
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>): any;
|
|
36
|
+
addTrackConfs(trackConfs: ({
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
39
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
40
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): any[];
|
|
41
|
+
setTrackConfs(trackConfs: ({
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
44
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
45
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
46
|
+
clear(): void;
|
|
47
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
48
|
+
}, {
|
|
49
|
+
/**
|
|
50
|
+
* #getter
|
|
51
|
+
*/
|
|
52
|
+
readonly connections: ({
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
55
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
56
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
57
|
+
name: {
|
|
58
|
+
type: string;
|
|
59
|
+
defaultValue: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
assemblyNames: {
|
|
63
|
+
type: string;
|
|
64
|
+
defaultValue: never[];
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>>)[];
|
|
68
|
+
} & {
|
|
69
|
+
/**
|
|
70
|
+
* #action
|
|
71
|
+
*/
|
|
72
|
+
makeConnection(configuration: AnyConfigurationModel, initialSnapshot?: {}): {
|
|
73
|
+
name: string;
|
|
74
|
+
tracks: import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
75
|
+
configuration: {
|
|
76
|
+
[x: string]: any;
|
|
77
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
78
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
79
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
80
|
+
name: {
|
|
81
|
+
type: string;
|
|
82
|
+
defaultValue: string;
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
assemblyNames: {
|
|
86
|
+
type: string; /**
|
|
87
|
+
* #property
|
|
88
|
+
*/
|
|
89
|
+
defaultValue: never[];
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>>;
|
|
93
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
94
|
+
afterAttach(): void;
|
|
95
|
+
addTrackConf(trackConf: {
|
|
96
|
+
[x: string]: any;
|
|
97
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
98
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
99
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>): any;
|
|
100
|
+
addTrackConfs(trackConfs: ({
|
|
101
|
+
[x: string]: any;
|
|
102
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
103
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
104
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): any[];
|
|
105
|
+
setTrackConfs(trackConfs: ({
|
|
106
|
+
[x: string]: any;
|
|
107
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
108
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
109
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
110
|
+
clear(): void;
|
|
111
|
+
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
112
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
113
|
+
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
114
|
+
configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
115
|
+
name: {
|
|
116
|
+
type: string;
|
|
117
|
+
defaultValue: string;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
assemblyNames: {
|
|
121
|
+
type: string; /**
|
|
122
|
+
* #property
|
|
123
|
+
*/
|
|
124
|
+
defaultValue: never[];
|
|
125
|
+
description: string;
|
|
126
|
+
};
|
|
127
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "connectionId">>;
|
|
128
|
+
}, {
|
|
129
|
+
afterAttach(): void;
|
|
130
|
+
addTrackConf(trackConf: {
|
|
131
|
+
[x: string]: any;
|
|
132
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
133
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
134
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>): any;
|
|
135
|
+
addTrackConfs(trackConfs: ({
|
|
136
|
+
[x: string]: any;
|
|
137
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
138
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
139
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): any[];
|
|
140
|
+
setTrackConfs(trackConfs: ({
|
|
141
|
+
[x: string]: any;
|
|
142
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
143
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
144
|
+
} & import("mobx-state-tree").IStateTreeNode<import("@jbrowse/core/configuration").AnyConfigurationSchemaType>)[]): import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
145
|
+
clear(): void;
|
|
146
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
147
|
+
/**
|
|
148
|
+
* #action
|
|
149
|
+
*/
|
|
150
|
+
prepareToBreakConnection(configuration: AnyConfigurationModel): (Record<string, number> | (() => void))[] | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* #action
|
|
153
|
+
*/
|
|
154
|
+
breakConnection(configuration: AnyConfigurationModel): void;
|
|
155
|
+
/**
|
|
156
|
+
* #action
|
|
157
|
+
*/
|
|
158
|
+
deleteConnection(configuration: AnyConfigurationModel): any;
|
|
159
|
+
/**
|
|
160
|
+
* #action
|
|
161
|
+
*/
|
|
162
|
+
addConnectionConf(connectionConf: BaseConnectionConfigModel): any;
|
|
163
|
+
/**
|
|
164
|
+
* #action
|
|
165
|
+
*/
|
|
166
|
+
clearConnections(): void;
|
|
167
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
168
|
+
/** Session mixin MST type for a session that has connections */
|
|
169
|
+
export type SessionWithConnectionsType = ReturnType<typeof ConnectionManagementSessionMixin>;
|
|
170
|
+
/** Instance of a session that has connections: `connectionInstances`,
|
|
171
|
+
* `makeConnection()`, etc. */
|
|
172
|
+
export type SessionWithConnections = Instance<SessionWithConnectionsType>;
|
|
173
|
+
/** Type guard for SessionWithConnections */
|
|
174
|
+
export declare function isSessionWithConnections(session: IAnyStateTreeNode): session is SessionWithConnections;
|