From fe1ba2ad6affeb6c0e97c73171d8fa3f31dde73e Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Thu, 14 Oct 2021 13:24:58 +0200 Subject: chore: convert files to TS (#2066) --- src/stores.types.ts | 378 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 378 insertions(+) create mode 100644 src/stores.types.ts (limited to 'src/stores.types.ts') diff --git a/src/stores.types.ts b/src/stores.types.ts new file mode 100644 index 000000000..66c8e9b85 --- /dev/null +++ b/src/stores.types.ts @@ -0,0 +1,378 @@ +export interface FerdiStores { + app: AppStore; + communityRecipes: CommunityRecipesStore; + features: FeaturesStore; + globalError: GlobalErrorStore; + news: NewsStore; + recipePreviews: RecipePreviewsStore; + recipes: RecipeStore; + requests: RequestsStore; + router: RouterStore; + services: ServicesStore; + settings: SettingsStore; + todos: TodosStore; + ui: UIStore; + user: UserStore; + workspaces: WorkspacesStore; +} + +interface Stores { + app: AppStore; + communityRecipes: CommunityRecipesStore; + features: FeaturesStore; + globalError: GlobalErrorStore; + news: NewsStore; + recipePreviews: RecipePreviewsStore; + recipes: RecipeStore; + requests: RequestsStore; + router: RouterStore; + services: ServicesStore; + settings: SettingsStore; + todos: TodosStore; + ui: UIStore; + user: UserStore; + workspaces: WorkspacesStore; +} + +interface Actions { + app: AppStore; + news: NewsStore; + recipePreviews: RecipePreviewsStore; + recipes: RecipeStore; + requests: RequestsStore; + services: ServicesStore; + settings: SettingsStore; + todos: TodosStore; + ui: UIStore; + user: UserStore; + workspaces: WorkspacesStore; +} + +interface Api { + app: AppStore; + features: FeaturesStore; + local: {}; + news: NewsStore; + recipePreviews: RecipePreviewsStore; + recipes: RecipeStore; + services: ServicesStore; + user: UserStore; +} + +interface AppStore { + actions: Actions; + accentColor: string; + api: Api; + authRequestFailed: () => void; + autoLaunchOnStart: () => void; + clearAppCacheRequest: () => void; + dictionaries: []; + fetchDataInterval: 4; + getAppCacheSizeRequest: () => void; + healthCheckRequest: () => void; + isClearingAllCache: () => void; + isFocused: () => void; + isFullScreen: () => void; + isOnline: () => void; + isSystemDarkModeEnabled: () => void; + isSystemMuteOverridden: () => void; + locale: () => void; + stores: Stores; + timeOfflineStart: () => void; + timeSuspensionStart: () => void; + updateStatus: () => void; + updateStatusTypes: { + CHECKING: 'CHECKING'; + AVAILABLE: 'AVAILABLE'; + NOT_AVAILABLE: 'NOT_AVAILABLE'; + DOWNLOADED: 'DOWNLOADED'; + FAILED: 'FAILED'; + }; + _reactions: any[]; + _status: () => void; + actionStatus: () => void; + cacheSize: () => void; + debugInfo: () => void; +} + +interface CommunityRecipesStore { + actions: Actions; + stores: Stores; + _actions: []; + _reactions: []; + communityRecipes: () => void; +} + +interface FeaturesStore { + actions: Actions; + api: Api; + defaultFeaturesRequest: () => void; + features: () => void; + featuresRequest: () => void; + stores: Stores; + _reactions: any[]; + _status: () => void; + _updateFeatures: () => void; + actionStatus: () => void; + anonymousFeatures: () => void; +} + +interface GlobalErrorStore { + actions: Actions; + api: Api; + error: () => void; + messages: () => void; + response: () => void; + stores: Stores; + _handleRequests: () => void; + _reactions: []; + _status: () => void; + actionStatus: () => void; +} + +interface NewsStore { + actions: Actions; + api: Api; + hideNewsRequest: () => void; + latestNewsRequest: () => void; + stores: Stores; + _reactions: []; + _status: () => void; + actionStatus: () => void; + latest: () => void; +} + +interface RecipePreviewsStore { + actions: Actions; + allRecipePreviewsRequest: () => void; + api: Api; + searchRecipePreviewsRequest: () => void; + stores: Stores; + _reactions: []; + _status: () => void; + actionStatus: () => void; + all: () => void; + dev: () => void; + searchResults: () => void; +} + +interface RecipeStore { + actions: Actions; + allRecipesRequest: () => void; + api: Api; + getRecipeUpdatesRequest: () => void; + installRecipeRequest: () => void; + stores: Stores; + _reactions: any[]; + _status: () => void; + actionStatus: () => void; + active: () => void; + all: () => void; + recipeIdForServices: () => void; +} + +interface RequestsStore { + actions: Actions; + api: Api; + localServerPort: () => void; + retries: number; + retryDelay: number; + servicesRequest: () => void; + showRequiredRequestsError: () => void; + stores: Stores; + userInfoRequest: () => void; + _reactions: any[]; + _status: () => void; + actionStatus: () => void; + areRequiredRequestsLoading: () => void; + areRequiredRequestsSuccessful: () => void; +} + +interface RouterStore { + go: () => void; + goBack: () => void; + goForward: () => void; + history: () => void; + location: () => void; + push: () => void; + replace: () => void; +} + +interface ServicesStore { + actions: Actions; + api: Api; + clearCacheRequest: () => void; + createServiceRequest: () => void; + deleteServiceRequest: () => void; + filterNeedle: () => void; + lastUsedServices: () => void; + reorderServicesRequest: () => void; + serviceMaintenanceTick: () => void; + stores: Stores; + updateServiceRequest: () => void; + _reactions: any[]; + _status: () => void; + actionStatus: () => void; + active: () => void; + activeSettings: () => void; + all: () => void; + allDisplayed: () => void; + allDisplayedUnordered: () => void; + enabled: () => void; + filtered: () => void; + isTodosServiceActive: () => void; + isTodosServiceAdded: () => void; +} + +interface SettingsStore { + actions: Actions; + api: Api; + fileSystemSettingsTypes: any[]; + startup: boolean; + stores: Stores; + updateAppSettingsRequest: () => void; + _fileSystemSettingsCache: () => void; + _reactions: []; + _status: () => void; + actionStatus: () => void; + all: () => void; + app: AppStore; + migration: () => void; + proxy: () => void; + service: ServicesStore; + stats: () => void; +} + +interface TodosStore { + actions: Actions; + api: Api; + isFeatureActive: () => void; + isFeatureEnabled: () => void; + isInitialized: true; + stores: Stores; + userAgentModel: () => void; + webview: () => void; + _actions: any[]; + _allReactions: any[]; + _firstLaunchReaction: () => void; + _goToService: () => void; + _handleNewWindowEvent: () => void; + _onTodosClientInitialized: () => void; + _openDevTools: () => void; + _reactions: any[]; + _reload: () => void; + _routeCheckReaction: () => void; + _setFeatureEnabledReaction: () => void; + _updateSettings: () => void; + _updateTodosConfig: () => void; + isFeatureEnabledByUser: () => void; + isTodoUrlValid: () => void; + isTodosPanelForceHidden: () => void; + isTodosPanelVisible: () => void; + isUsingPredefinedTodoServer: () => void; + settings: () => void; + todoRecipeId: () => void; + todoUrl: () => void; + userAgent: () => void; + width: () => void; + _handleClientMessage: () => void; + _handleHostMessage: () => void; + _resize: () => void; + _setTodosWebview: () => void; + _toggleTodosFeatureVisibility: () => void; + _toggleTodosPanel: () => void; +} + +interface UIStore { + actions: Actions; + api: Api; + isOsDarkThemeActive: () => void; + showServicesUpdatedInfoBar: () => void; + stores: Stores; + _reactions: []; + _status: () => void; + actionStatus: () => void; + isDarkThemeActive: () => void; + isSplitModeActive: () => void; + showMessageBadgesEvenWhenMuted: () => void; + theme: () => void; +} + +interface UserStore { + BASE_ROUTE: '/auth'; + CHANGE_SERVER_ROUTE: '/auth/server'; + IMPORT_ROUTE: '/auth/signup/import'; + INVITE_ROUTE: '/auth/signup/invite'; + LOGIN_ROUTE: '/auth/login'; + LOGOUT_ROUTE: '/auth/logout'; + PASSWORD_ROUTE: '/auth/password'; + SETUP_ROUTE: '/auth/signup/setup'; + SIGNUP_ROUTE: '/auth/signup'; + WELCOME_ROUTE: '/auth/welcome'; + accountType: () => void; + actionStatus: () => void; + actions: Actions; + api: Api; + authToken: () => void; + deleteAccountRequest: () => void; + fetchUserInfoInterval: null; + getLegacyServicesRequest: () => void; + getUserInfoRequest: () => void; + hasCompletedSignup: () => void; + id: () => void; + inviteRequest: () => void; + isImportLegacyServicesCompleted: () => void; + isImportLegacyServicesExecuting: () => void; + isLoggingOut: () => void; + loginRequest: () => void; + logoutReason: () => void; + logoutReasonTypes: { SERVER: 'SERVER' }; + passwordRequest: () => void; + signupRequest: () => void; + stores: Stores; + updateUserInfoRequest: () => void; + userData: () => void; + _reactions: any[]; + _requireAuthenticatedUser: () => void; + _status: () => void; + changeServerRoute: () => void; + data: () => void; + importRoute: () => void; + inviteRoute: () => void; + isLoggedIn: () => void; + isTokenExpired: () => void; + legacyServices: () => void; + loginRoute: () => void; + logoutRoute: () => void; + passwordRoute: () => void; + setupRoute: () => void; + signupRoute: () => void; + team: () => void; +} + +interface WorkspacesStore { + activeWorkspace: () => void; + filterServicesByActiveWorkspace: () => void; + isFeatureActive: () => void; + isFeatureEnabled: () => void; + isSettingsRouteActive: () => void; + isSwitchingWorkspace: () => void; + isWorkspaceDrawerOpen: () => void; + nextWorkspace: () => void; + stores: Stores; + workspaceBeingEdited: () => void; + _actions: any[]; + _activateLastUsedWorkspaceReaction: () => void; + _allActions: any[]; + _allReactions: any[]; + _cleanupInvalidServiceReferences: () => void; + _getWorkspaceById: () => void; + _openDrawerWithSettingsReaction: () => void; + _reactions: any[]; + _setActiveServiceOnWorkspaceSwitchReaction: () => void; + _setFeatureEnabledReaction: () => void; + _setWorkspaceBeingEditedReaction: () => void; + _toggleKeepAllWorkspacesLoadedSetting: () => void; + _updateSettings: () => void; + _wasDrawerOpenBeforeSettingsRoute: null; +} -- cgit v1.2.3-70-g09d2