diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-23 17:12:47 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-02-08 21:43:17 +0100 |
commit | 044b2de8c7861504704468ba441d4a6a37eed8f7 (patch) | |
tree | 940d2b7946d07a0c69b5e3ad46c25c599cf2aca7 /packages/shared/src/index.ts | |
parent | feat: Add selected service field to SharedStore (diff) | |
download | sophie-044b2de8c7861504704468ba441d4a6a37eed8f7.tar.gz sophie-044b2de8c7861504704468ba441d4a6a37eed8f7.tar.zst sophie-044b2de8c7861504704468ba441d4a6a37eed8f7.zip |
refactor: Move runtime state into shared models
Now the runtime state lives inside the model (instead of being
associated to the static settings via a map), which simplifies state
management. Static settings are now located inside the runtime models,
so we must create tests to make sure that the settings are being
persisted correctly. The contents of the config file are now generated
as a view of store (instead of a snapshot), which adds flexibility.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/shared/src/index.ts')
-rw-r--r-- | packages/shared/src/index.ts | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index df02854..55cf5ce 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts | |||
@@ -18,7 +18,7 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | export type { SophieRenderer } from './contextBridge/SophieRenderer'; | 21 | export type { default as SophieRenderer } from './contextBridge/SophieRenderer'; |
22 | 22 | ||
23 | export { MainToRendererIpcMessage, RendererToMainIpcMessage } from './ipc'; | 23 | export { MainToRendererIpcMessage, RendererToMainIpcMessage } from './ipc'; |
24 | 24 | ||
@@ -26,34 +26,33 @@ export type { Action, BrowserViewBounds, ThemeSource } from './schemas'; | |||
26 | export { action, browserViewBounds, themeSource } from './schemas'; | 26 | export { action, browserViewBounds, themeSource } from './schemas'; |
27 | 27 | ||
28 | export type { | 28 | export type { |
29 | Config, | 29 | GlobalSettings, |
30 | ConfigSnapshotIn, | 30 | GlobalSettingsSnapshotIn, |
31 | ConfigSnapshotOut, | 31 | GlobalSettingsSnapshotOut, |
32 | } from './stores/Config'; | 32 | } from './stores/GlobalSettings'; |
33 | export { config } from './stores/Config'; | 33 | export { globalSettings } from './stores/GlobalSettings'; |
34 | 34 | ||
35 | export type { | 35 | export type { Profile } from './stores/Profile'; |
36 | Profile, | ||
37 | ProfileSnapshotIn, | ||
38 | ProfileSnapshotOut, | ||
39 | } from './stores/Profile'; | ||
40 | export { profile } from './stores/Profile'; | 36 | export { profile } from './stores/Profile'; |
41 | 37 | ||
42 | export type { | 38 | export type { |
43 | RuntimeService, | 39 | ProfileSettings, |
44 | RuntimeServiceSnapshotIn, | 40 | ProfileSettingsSnapshotIn, |
45 | RuntimeServiceSnapshotOut, | 41 | ProfileSettingsSnapshotOut, |
46 | } from './stores/RuntimeService'; | 42 | } from './stores/ProfileSettings'; |
47 | export { runtimeService } from './stores/RuntimeService'; | 43 | export { profileSettings } from './stores/ProfileSettings'; |
48 | 44 | ||
49 | export type { | 45 | export type { Service } from './stores/Service'; |
50 | Service, | ||
51 | ServiceSnapshotIn, | ||
52 | ServiceSnapshotOut, | ||
53 | } from './stores/Service'; | ||
54 | export { service } from './stores/Service'; | 46 | export { service } from './stores/Service'; |
55 | 47 | ||
56 | export type { | 48 | export type { |
49 | ServiceSettings, | ||
50 | ServiceSettingsSnapshotIn, | ||
51 | ServiceSettingsSnapshotOut, | ||
52 | } from './stores/ServiceSettings'; | ||
53 | export { serviceSettings } from './stores/ServiceSettings'; | ||
54 | |||
55 | export type { | ||
57 | SharedStore, | 56 | SharedStore, |
58 | SharedStoreListener, | 57 | SharedStoreListener, |
59 | SharedStoreSnapshotIn, | 58 | SharedStoreSnapshotIn, |