# JBrowseDesktopRootModel

Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the [developer guide](https://jbrowse.org/jb2/docs/developer_guide/) for concepts. [View source](https://github.com/GMOD/jbrowse-components/blob/main/products/jbrowse-desktop/src/rootModel/rootModel.ts).

Holds JBrowse Desktop's top-level state: the loaded config, the session,
internet accounts, undo history, the app menus and the text-indexing jobs.

Many properties of the root model are available through the session, and
we generally prefer using the session model (via e.g. `getSession`) over the
root model (via e.g. `getRoot`) in plugin code.

Each section ends with the members a composed model contributes, linked to the page that documents them.

## Properties

| Member | Description |
| --- | --- |
| **jobsManager**<br><code>types.optional(JobsManager, {})</code> |  |

6 inherited properties from 3 models:

From [HistoryManagementMixin](../historymanagementmixin): [`history`](../historymanagementmixin#property-history)

From [InternetAccountsMixin](../internetaccountsmixin): [`internetAccounts`](../internetaccountsmixin#property-internetaccounts)

From [BaseRootModel](../baserootmodel): [`jbrowse`](../baserootmodel#property-jbrowse), [`session`](../baserootmodel#property-session), [`sessionPath`](../baserootmodel#property-sessionpath), [`assemblyManager`](../baserootmodel#property-assemblymanager)


## Volatiles

| Member | Description |
| --- | --- |
| **version**<br><code>string</code> |  |
| **adminMode**<br><code>boolean</code> |  |
| **openNewSessionCallback**<br><code>(_path: string) =&gt; Promise&lt;void&gt;</code> |  |
| **openLinkCallback**<br><code>(_link: string) =&gt; Promise&lt;void&gt;</code> |  |
| **returnToStartScreenCallback**<br><code>() =&gt; void</code> |  |

7 inherited volatiles from 3 models:

From [PluginsUpdatedMixin](../pluginsupdatedmixin): [`pluginsUpdated`](../pluginsupdatedmixin#volatile-pluginsupdated)

From [RootAppMenuMixin](../rootappmenumixin): [`mutableMenuActions`](../rootappmenumixin#volatile-mutablemenuactions)

From [BaseRootModel](../baserootmodel): [`rpcManager`](../baserootmodel#volatile-rpcmanager), [`error`](../baserootmodel#volatile-error), [`textSearchManager`](../baserootmodel#volatile-textsearchmanager), [`pluginManager`](../baserootmodel#volatile-pluginmanager), [`detachDisposers`](../baserootmodel#volatile-detachdisposers)


## Methods

| Member | Description |
| --- | --- |
| **menus**<br><code>() =&gt; Menu[]</code> |  |

## Actions

| Member | Description |
| --- | --- |
| **setOpenNewSessionCallback**<br><code>(cb: (arg: string) =&gt; Promise&lt;void&gt;) =&gt; void</code> |  |
| **setOpenLinkCallback**<br><code>(cb: (arg: string) =&gt; Promise&lt;void&gt;) =&gt; void</code> | Wired by the Loader to open a JBrowse Web link as a new session (the Loader owns plugin-manager lifecycle, as with openNewSessionCallback). |
| **setReturnToStartScreenCallback**<br><code>(cb: () =&gt; void) =&gt; void</code> | Wired by the Loader to tear down this plugin manager and show the start screen (the Loader owns plugin-manager lifecycle). |
| **saveSession**<br><code>(val: SessionSnap, sessionPath?: string) =&gt; Promise&lt;void&gt;</code> |  |
| **updateTrackBase**<br><code>(trackConf: { [key: string]: unknown; trackId: string; }) =&gt; void</code> | Replace a track's base config: its sessionTracks entry when the session owns the track, otherwise its jbrowse.tracks entry. |
| **reloadPlugins**<br><code>() =&gt; Promise&lt;void&gt;</code> | Persist the session, then rebuild the plugin manager from disk so the changed plugin set takes effect. Run by `onPluginsUpdated`, which reports a failure on the session it leaves open |
| **flushSession**<br><code>() =&gt; Promise&lt;void&gt;</code> | Save now rather than waiting out the autosave's 1s throttle. Every path that tears the session down has to call this first. |

17 inherited actions from 4 models:

From [PluginsUpdatedMixin](../pluginsupdatedmixin): [`setPluginsUpdated`](../pluginsupdatedmixin#action-setpluginsupdated)

From [RootAppMenuMixin](../rootappmenumixin): [`appendMenu`](../rootappmenumixin#action-appendmenu), [`insertMenu`](../rootappmenumixin#action-insertmenu), [`appendToMenu`](../rootappmenumixin#action-appendtomenu), [`insertInMenu`](../rootappmenumixin#action-insertinmenu), [`appendToSubMenu`](../rootappmenumixin#action-appendtosubmenu), [`insertInSubMenu`](../rootappmenumixin#action-insertinsubmenu)

From [InternetAccountsMixin](../internetaccountsmixin): [`initializeInternetAccount`](../internetaccountsmixin#action-initializeinternetaccount), [`createEphemeralInternetAccount`](../internetaccountsmixin#action-createephemeralinternetaccount), [`findAppropriateInternetAccount`](../internetaccountsmixin#action-findappropriateinternetaccount)

From [BaseRootModel](../baserootmodel): [`setError`](../baserootmodel#action-seterror), [`addDetachDisposer`](../baserootmodel#action-adddetachdisposer), [`detach`](../baserootmodel#action-detach), [`setSession`](../baserootmodel#action-setsession), [`setDefaultSession`](../baserootmodel#action-setdefaultsession), [`setSessionPath`](../baserootmodel#action-setsessionpath), [`renameCurrentSession`](../baserootmodel#action-renamecurrentsession)


