diff options
Diffstat (limited to 'packages/shared/src/stores/SharedStore.ts')
-rw-r--r-- | packages/shared/src/stores/SharedStore.ts | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/packages/shared/src/stores/SharedStore.ts b/packages/shared/src/stores/SharedStore.ts index f301b9d..0cac3a5 100644 --- a/packages/shared/src/stores/SharedStore.ts +++ b/packages/shared/src/stores/SharedStore.ts | |||
@@ -26,26 +26,32 @@ import { | |||
26 | SnapshotOut, | 26 | SnapshotOut, |
27 | } from 'mobx-state-tree'; | 27 | } from 'mobx-state-tree'; |
28 | 28 | ||
29 | import { globalSettings } from './GlobalSettings'; | 29 | import GlobalSettings from './GlobalSettings'; |
30 | import { profile } from './Profile'; | 30 | import Profile from './Profile'; |
31 | import { service } from './Service'; | 31 | import Service from './Service'; |
32 | 32 | ||
33 | export const sharedStore = types.model('SharedStore', { | 33 | const SharedStore = types.model('SharedStore', { |
34 | settings: types.optional(globalSettings, {}), | 34 | settings: types.optional(GlobalSettings, {}), |
35 | profilesById: types.map(profile), | 35 | profilesById: types.map(Profile), |
36 | profiles: types.array(types.reference(profile)), | 36 | profiles: types.array(types.reference(Profile)), |
37 | servicesById: types.map(service), | 37 | servicesById: types.map(Service), |
38 | services: types.array(types.reference(service)), | 38 | services: types.array(types.reference(Service)), |
39 | selectedService: types.safeReference(service), | 39 | selectedService: types.safeReference(Service), |
40 | shouldUseDarkColors: false, | 40 | shouldUseDarkColors: false, |
41 | }); | 41 | }); |
42 | 42 | ||
43 | export interface SharedStore extends Instance<typeof sharedStore> {} | 43 | /* |
44 | eslint-disable-next-line @typescript-eslint/no-redeclare -- | ||
45 | Intentionally naming the type the same as the store definition. | ||
46 | */ | ||
47 | interface SharedStore extends Instance<typeof SharedStore> {} | ||
48 | |||
49 | export default SharedStore; | ||
44 | 50 | ||
45 | export interface SharedStoreSnapshotIn extends SnapshotIn<typeof sharedStore> {} | 51 | export interface SharedStoreSnapshotIn extends SnapshotIn<typeof SharedStore> {} |
46 | 52 | ||
47 | export interface SharedStoreSnapshotOut | 53 | export interface SharedStoreSnapshotOut |
48 | extends SnapshotOut<typeof sharedStore> {} | 54 | extends SnapshotOut<typeof SharedStore> {} |
49 | 55 | ||
50 | export interface SharedStoreListener { | 56 | export interface SharedStoreListener { |
51 | onSnapshot(snapshot: SharedStoreSnapshotIn): void; | 57 | onSnapshot(snapshot: SharedStoreSnapshotIn): void; |