diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-22 16:21:23 +0200 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2022-06-23 17:50:07 +0530 |
commit | caf43fc8d64c27a1aad4a5d6507313c513c1a447 (patch) | |
tree | c0a7bcb950cdf555b3e8a33a57e2241e7051861d /src/stores.types.ts | |
parent | Workaroud for in-app Password Recovery (#342) (diff) | |
download | ferdium-app-caf43fc8d64c27a1aad4a5d6507313c513c1a447.tar.gz ferdium-app-caf43fc8d64c27a1aad4a5d6507313c513c1a447.tar.zst ferdium-app-caf43fc8d64c27a1aad4a5d6507313c513c1a447.zip |
chore: featureStore and GlobalErrorStore JS => TS
Diffstat (limited to 'src/stores.types.ts')
-rw-r--r-- | src/stores.types.ts | 113 |
1 files changed, 28 insertions, 85 deletions
diff --git a/src/stores.types.ts b/src/stores.types.ts index b0912c463..462d862d9 100644 --- a/src/stores.types.ts +++ b/src/stores.types.ts | |||
@@ -3,6 +3,7 @@ import Recipe from './models/Recipe'; | |||
3 | import Service from './models/Service'; | 3 | import Service from './models/Service'; |
4 | import User from './models/User'; | 4 | import User from './models/User'; |
5 | import { CachedRequest } from './stores/lib/CachedRequest'; | 5 | import { CachedRequest } from './stores/lib/CachedRequest'; |
6 | import Reaction from './stores/lib/Reaction'; | ||
6 | 7 | ||
7 | export interface FerdiumStores { | 8 | export interface FerdiumStores { |
8 | app: AppStore; | 9 | app: AppStore; |
@@ -61,11 +62,21 @@ interface Api { | |||
61 | user: UserStore; | 62 | user: UserStore; |
62 | } | 63 | } |
63 | 64 | ||
64 | interface AppStore { | 65 | interface TypedStore { |
65 | actions: Actions; | 66 | actions: Actions; |
67 | api: Api; | ||
68 | stores: Stores; | ||
69 | _reactions: Reaction[]; | ||
70 | _status: any; | ||
71 | actionStatus: () => void; | ||
72 | initialize: () => void; | ||
73 | tearDown: () => void; | ||
74 | resetStatus: () => void; | ||
75 | } | ||
76 | |||
77 | interface AppStore extends TypedStore { | ||
66 | accentColor: string; | 78 | accentColor: string; |
67 | progressbarAccentColor: string; | 79 | progressbarAccentColor: string; |
68 | api: Api; | ||
69 | authRequestFailed: () => void; | 80 | authRequestFailed: () => void; |
70 | autoLaunchOnStart: () => void; | 81 | autoLaunchOnStart: () => void; |
71 | automaticUpdates: boolean; | 82 | automaticUpdates: boolean; |
@@ -84,7 +95,6 @@ interface AppStore { | |||
84 | locale: () => void; | 95 | locale: () => void; |
85 | reloadAfterResume: boolean; | 96 | reloadAfterResume: boolean; |
86 | reloadAfterResumeTime: number; | 97 | reloadAfterResumeTime: number; |
87 | stores: Stores; | ||
88 | timeOfflineStart: () => void; | 98 | timeOfflineStart: () => void; |
89 | timeSuspensionStart: () => void; | 99 | timeSuspensionStart: () => void; |
90 | updateStatus: () => void; | 100 | updateStatus: () => void; |
@@ -95,91 +105,56 @@ interface AppStore { | |||
95 | DOWNLOADED: 'DOWNLOADED'; | 105 | DOWNLOADED: 'DOWNLOADED'; |
96 | FAILED: 'FAILED'; | 106 | FAILED: 'FAILED'; |
97 | }; | 107 | }; |
98 | _reactions: any[]; | ||
99 | _status: () => void; | ||
100 | actionStatus: () => void; | ||
101 | cacheSize: () => void; | 108 | cacheSize: () => void; |
102 | debugInfo: () => void; | 109 | debugInfo: () => void; |
103 | } | 110 | } |
104 | 111 | ||
105 | interface CommunityRecipesStore { | 112 | interface CommunityRecipesStore extends TypedStore { |
106 | actions: Actions; | ||
107 | stores: Stores; | ||
108 | _actions: any[]; | ||
109 | _reactions: any[]; | ||
110 | communityRecipes: () => void; | 113 | communityRecipes: () => void; |
111 | } | 114 | } |
112 | 115 | ||
113 | interface FeaturesStore { | 116 | interface FeaturesStore extends TypedStore { |
114 | actions: Actions; | 117 | anonymousFeatures: () => void; |
115 | api: Api; | ||
116 | defaultFeaturesRequest: () => void; | 118 | defaultFeaturesRequest: () => void; |
117 | features: () => void; | 119 | features: () => void; |
118 | featuresRequest: CachedRequest; | 120 | featuresRequest: CachedRequest; |
119 | stores: Stores; | 121 | _monitorLoginStatus: () => void; |
120 | _reactions: any[]; | ||
121 | _status: () => void; | ||
122 | _updateFeatures: () => void; | 122 | _updateFeatures: () => void; |
123 | actionStatus: () => void; | 123 | _setupFeatures: () => void; |
124 | anonymousFeatures: () => void; | ||
125 | } | 124 | } |
126 | 125 | ||
127 | interface GlobalErrorStore { | 126 | interface GlobalErrorStore extends TypedStore { |
128 | actions: Actions; | ||
129 | api: Api; | ||
130 | error: () => void; | 127 | error: () => void; |
131 | messages: () => void; | 128 | messages: () => void; |
132 | response: () => void; | 129 | response: () => void; |
133 | stores: Stores; | ||
134 | _handleRequests: () => void; | 130 | _handleRequests: () => void; |
135 | _reactions: []; | ||
136 | _status: () => void; | ||
137 | actionStatus: () => void; | ||
138 | } | 131 | } |
139 | 132 | ||
140 | interface RecipePreviewsStore { | 133 | interface RecipePreviewsStore extends TypedStore { |
141 | actions: Actions; | ||
142 | allRecipePreviewsRequest: () => void; | 134 | allRecipePreviewsRequest: () => void; |
143 | api: Api; | ||
144 | searchRecipePreviewsRequest: () => void; | 135 | searchRecipePreviewsRequest: () => void; |
145 | stores: Stores; | ||
146 | _reactions: []; | ||
147 | _status: () => void; | ||
148 | actionStatus: () => void; | ||
149 | all: Recipe[]; | 136 | all: Recipe[]; |
150 | dev: Recipe[]; | 137 | dev: Recipe[]; |
151 | searchResults: () => void; | 138 | searchResults: () => void; |
152 | } | 139 | } |
153 | 140 | ||
154 | interface RecipeStore { | 141 | interface RecipeStore extends TypedStore { |
155 | actions: Actions; | ||
156 | allRecipesRequest: () => void; | 142 | allRecipesRequest: () => void; |
157 | api: Api; | ||
158 | getRecipeUpdatesRequest: () => void; | 143 | getRecipeUpdatesRequest: () => void; |
159 | installRecipeRequest: () => void; | 144 | installRecipeRequest: () => void; |
160 | stores: Stores; | ||
161 | _reactions: any[]; | ||
162 | _status: () => void; | ||
163 | actionStatus: () => void; | ||
164 | isInstalled: (id: string) => boolean; | 145 | isInstalled: (id: string) => boolean; |
165 | active: () => void; | 146 | active: () => void; |
166 | all: Recipe[]; | 147 | all: Recipe[]; |
167 | recipeIdForServices: () => void; | 148 | recipeIdForServices: () => void; |
168 | } | 149 | } |
169 | 150 | ||
170 | interface RequestsStore { | 151 | interface RequestsStore extends TypedStore { |
171 | actions: Actions; | ||
172 | api: Api; | ||
173 | localServerPort: () => void; | 152 | localServerPort: () => void; |
174 | retries: number; | 153 | retries: number; |
175 | retryDelay: number; | 154 | retryDelay: number; |
176 | servicesRequest: () => void; | 155 | servicesRequest: () => void; |
177 | showRequiredRequestsError: () => void; | 156 | showRequiredRequestsError: () => void; |
178 | stores: Stores; | ||
179 | userInfoRequest: () => void; | 157 | userInfoRequest: () => void; |
180 | _reactions: any[]; | ||
181 | _status: () => void; | ||
182 | actionStatus: () => void; | ||
183 | areRequiredRequestsLoading: () => void; | 158 | areRequiredRequestsLoading: () => void; |
184 | areRequiredRequestsSuccessful: () => void; | 159 | areRequiredRequestsSuccessful: () => void; |
185 | } | 160 | } |
@@ -203,9 +178,7 @@ interface RouterStore { | |||
203 | replace: () => void; | 178 | replace: () => void; |
204 | } | 179 | } |
205 | 180 | ||
206 | export interface ServicesStore { | 181 | export interface ServicesStore extends TypedStore { |
207 | actions: Actions; | ||
208 | api: Api; | ||
209 | clearCacheRequest: () => void; | 182 | clearCacheRequest: () => void; |
210 | createServiceRequest: () => void; | 183 | createServiceRequest: () => void; |
211 | deleteServiceRequest: () => void; | 184 | deleteServiceRequest: () => void; |
@@ -214,11 +187,7 @@ export interface ServicesStore { | |||
214 | lastUsedServices: () => void; | 187 | lastUsedServices: () => void; |
215 | reorderServicesRequest: () => void; | 188 | reorderServicesRequest: () => void; |
216 | serviceMaintenanceTick: () => void; | 189 | serviceMaintenanceTick: () => void; |
217 | stores: Stores; | ||
218 | updateServiceRequest: () => void; | 190 | updateServiceRequest: () => void; |
219 | _reactions: any[]; | ||
220 | _status: () => void; | ||
221 | actionStatus: () => void; | ||
222 | active: () => void; | 191 | active: () => void; |
223 | activeSettings: () => void; | 192 | activeSettings: () => void; |
224 | all: Service[]; | 193 | all: Service[]; |
@@ -235,17 +204,11 @@ interface ISettings { | |||
235 | [key: string]: any; | 204 | [key: string]: any; |
236 | } | 205 | } |
237 | 206 | ||
238 | interface SettingsStore { | 207 | interface SettingsStore extends TypedStore { |
239 | actions: Actions; | ||
240 | api: Api; | ||
241 | fileSystemSettingsTypes: any[]; | 208 | fileSystemSettingsTypes: any[]; |
242 | loaded: boolean; | 209 | loaded: boolean; |
243 | stores: Stores; | ||
244 | updateAppSettingsRequest: () => void; | 210 | updateAppSettingsRequest: () => void; |
245 | _fileSystemSettingsCache: () => void; | 211 | _fileSystemSettingsCache: () => void; |
246 | _reactions: []; | ||
247 | _status: () => void; | ||
248 | actionStatus: () => void; | ||
249 | all: ISettings; | 212 | all: ISettings; |
250 | app: AppStore; | 213 | app: AppStore; |
251 | migration: () => void; | 214 | migration: () => void; |
@@ -254,22 +217,17 @@ interface SettingsStore { | |||
254 | stats: () => void; | 217 | stats: () => void; |
255 | } | 218 | } |
256 | 219 | ||
257 | interface TodosStore { | 220 | interface TodosStore extends TypedStore { |
258 | actions: Actions; | ||
259 | api: Api; | ||
260 | isFeatureActive: () => void; | 221 | isFeatureActive: () => void; |
261 | isInitialized: true; | 222 | isInitialized: true; |
262 | stores: Stores; | ||
263 | userAgentModel: () => void; | 223 | userAgentModel: () => void; |
264 | webview: () => void; | 224 | webview: () => void; |
265 | _actions: any[]; | ||
266 | _allReactions: any[]; | 225 | _allReactions: any[]; |
267 | _firstLaunchReaction: () => void; | 226 | _firstLaunchReaction: () => void; |
268 | _goToService: () => void; | 227 | _goToService: () => void; |
269 | _handleNewWindowEvent: () => void; | 228 | _handleNewWindowEvent: () => void; |
270 | _onTodosClientInitialized: () => void; | 229 | _onTodosClientInitialized: () => void; |
271 | _openDevTools: () => void; | 230 | _openDevTools: () => void; |
272 | _reactions: any[]; | ||
273 | _reload: () => void; | 231 | _reload: () => void; |
274 | _routeCheckReaction: () => void; | 232 | _routeCheckReaction: () => void; |
275 | _updateSettings: () => void; | 233 | _updateSettings: () => void; |
@@ -292,14 +250,8 @@ interface TodosStore { | |||
292 | _toggleTodosPanel: () => void; | 250 | _toggleTodosPanel: () => void; |
293 | } | 251 | } |
294 | 252 | ||
295 | interface UIStore { | 253 | interface UIStore extends TypedStore { |
296 | actions: Actions; | ||
297 | api: Api; | ||
298 | isOsDarkThemeActive: () => void; | 254 | isOsDarkThemeActive: () => void; |
299 | stores: Stores; | ||
300 | _reactions: []; | ||
301 | _status: () => void; | ||
302 | actionStatus: () => void; | ||
303 | showServicesUpdatedInfoBar: boolean; | 255 | showServicesUpdatedInfoBar: boolean; |
304 | isDarkThemeActive: () => void; | 256 | isDarkThemeActive: () => void; |
305 | isSplitModeActive: () => void; | 257 | isSplitModeActive: () => void; |
@@ -308,7 +260,7 @@ interface UIStore { | |||
308 | theme: () => void; | 260 | theme: () => void; |
309 | } | 261 | } |
310 | 262 | ||
311 | interface UserStore { | 263 | interface UserStore extends TypedStore { |
312 | BASE_ROUTE: '/auth'; | 264 | BASE_ROUTE: '/auth'; |
313 | CHANGE_SERVER_ROUTE: '/auth/server'; | 265 | CHANGE_SERVER_ROUTE: '/auth/server'; |
314 | IMPORT_ROUTE: '/auth/signup/import'; | 266 | IMPORT_ROUTE: '/auth/signup/import'; |
@@ -320,9 +272,6 @@ interface UserStore { | |||
320 | SIGNUP_ROUTE: '/auth/signup'; | 272 | SIGNUP_ROUTE: '/auth/signup'; |
321 | WELCOME_ROUTE: '/auth/welcome'; | 273 | WELCOME_ROUTE: '/auth/welcome'; |
322 | accountType: () => void; | 274 | accountType: () => void; |
323 | actionStatus: () => void; | ||
324 | actions: Actions; | ||
325 | api: Api; | ||
326 | authToken: () => void; | 275 | authToken: () => void; |
327 | deleteAccountRequest: () => void; | 276 | deleteAccountRequest: () => void; |
328 | fetchUserInfoInterval: null; | 277 | fetchUserInfoInterval: null; |
@@ -339,12 +288,9 @@ interface UserStore { | |||
339 | logoutReasonTypes: { SERVER: 'SERVER' }; | 288 | logoutReasonTypes: { SERVER: 'SERVER' }; |
340 | passwordRequest: () => void; | 289 | passwordRequest: () => void; |
341 | signupRequest: () => void; | 290 | signupRequest: () => void; |
342 | stores: Stores; | ||
343 | updateUserInfoRequest: () => void; | 291 | updateUserInfoRequest: () => void; |
344 | userData: () => void; | 292 | userData: () => void; |
345 | _reactions: any[]; | ||
346 | _requireAuthenticatedUser: () => void; | 293 | _requireAuthenticatedUser: () => void; |
347 | _status: () => void; | ||
348 | changeServerRoute: () => void; | 294 | changeServerRoute: () => void; |
349 | data: User; | 295 | data: User; |
350 | importRoute: () => void; | 296 | importRoute: () => void; |
@@ -360,7 +306,7 @@ interface UserStore { | |||
360 | team: () => void; | 306 | team: () => void; |
361 | } | 307 | } |
362 | 308 | ||
363 | export interface WorkspacesStore { | 309 | export interface WorkspacesStore extends TypedStore { |
364 | activeWorkspace: () => void; | 310 | activeWorkspace: () => void; |
365 | delete: ({ workspace }) => void; | 311 | delete: ({ workspace }) => void; |
366 | update: ({ workspace }) => void; | 312 | update: ({ workspace }) => void; |
@@ -373,17 +319,14 @@ export interface WorkspacesStore { | |||
373 | isSwitchingWorkspace: () => void; | 319 | isSwitchingWorkspace: () => void; |
374 | isWorkspaceDrawerOpen: () => void; | 320 | isWorkspaceDrawerOpen: () => void; |
375 | nextWorkspace: () => void; | 321 | nextWorkspace: () => void; |
376 | stores: Stores; | ||
377 | workspaces: Workspace[]; | 322 | workspaces: Workspace[]; |
378 | workspaceBeingEdited: () => void; | 323 | workspaceBeingEdited: () => void; |
379 | _actions: any[]; | ||
380 | _activateLastUsedWorkspaceReaction: () => void; | 324 | _activateLastUsedWorkspaceReaction: () => void; |
381 | _allActions: any[]; | 325 | _allActions: any[]; |
382 | _allReactions: any[]; | 326 | _allReactions: any[]; |
383 | _cleanupInvalidServiceReferences: () => void; | 327 | _cleanupInvalidServiceReferences: () => void; |
384 | _getWorkspaceById: () => void; | 328 | _getWorkspaceById: () => void; |
385 | _openDrawerWithSettingsReaction: () => void; | 329 | _openDrawerWithSettingsReaction: () => void; |
386 | _reactions: any[]; | ||
387 | _setActiveServiceOnWorkspaceSwitchReaction: () => void; | 330 | _setActiveServiceOnWorkspaceSwitchReaction: () => void; |
388 | _setWorkspaceBeingEditedReaction: () => void; | 331 | _setWorkspaceBeingEditedReaction: () => void; |
389 | _toggleKeepAllWorkspacesLoadedSetting: () => void; | 332 | _toggleKeepAllWorkspacesLoadedSetting: () => void; |