diff --git a/keyserver/src/responders/redux-state-responders.js b/keyserver/src/responders/redux-state-responders.js --- a/keyserver/src/responders/redux-state-responders.js +++ b/keyserver/src/responders/redux-state-responders.js @@ -28,6 +28,10 @@ type MessageStore, } from 'lib/types/message-types.js'; import { webNavInfoValidator } from 'lib/types/nav-types.js'; +import type { + WebInitialKeyserverInfo, + WebInitialReduxStateResponse, +} from 'lib/types/redux-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type ThreadStore } from 'lib/types/thread-types.js'; @@ -42,8 +46,6 @@ import { urlInfoValidator } from 'lib/utils/url-utils.js'; import { tShape, ashoatKeyserverID, tID } from 'lib/utils/validation-utils.js'; import type { - WebInitialReduxStateResponse, - WebInitialKeyserverInfo, InitialReduxStateRequest, ExcludedData, } from 'web/types/redux-types.js'; diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -78,7 +78,7 @@ } from './message-types.js'; import type { RawReactionMessageInfo } from './messages/reaction.js'; import type { RawTextMessageInfo } from './messages/text.js'; -import type { BaseNavInfo } from './nav-types.js'; +import type { BaseNavInfo, WebNavInfo } from './nav-types.js'; import { type ForcePolicyAcknowledgmentPayload, type PolicyAcknowledgmentPayload, @@ -119,11 +119,12 @@ NewThreadResult, ThreadJoinPayload, ToggleMessagePinResult, + LegacyThreadStore, RoleModificationPayload, RoleDeletionPayload, } from './thread-types.js'; import type { ClientUpdatesResultWithUserInfos } from './update-types.js'; -import type { CurrentUserInfo, UserStore } from './user-types.js'; +import type { CurrentUserInfo, UserInfos, UserStore } from './user-types.js'; import type { SetDeviceTokenActionPayload } from '../actions/device-actions.js'; import type { NotifPermissionAlertInfo } from '../utils/push-alerts.js'; @@ -164,6 +165,23 @@ }; export type AppState = NativeAppState | WebAppState; +export type WebInitialReduxStateResponse = { + +navInfo: WebNavInfo, + +currentUserInfo: CurrentUserInfo, + +entryStore: EntryStore, + +threadStore: LegacyThreadStore, + +userInfos: UserInfos, + +messageStore: MessageStore, + +pushApiPublicKey: ?string, + +commServicesAccessToken: null, + +inviteLinksStore: InviteLinksStore, + +keyserverInfo: WebInitialKeyserverInfo, +}; +export type WebInitialKeyserverInfo = { + +sessionID: ?string, + +updatesCurrentAsOf: number, +}; + export type BaseAction = | { +type: '@@redux/INIT', diff --git a/web/redux/action-types.js b/web/redux/action-types.js --- a/web/redux/action-types.js +++ b/web/redux/action-types.js @@ -3,6 +3,10 @@ import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js'; import type { CallKeyserverEndpoint } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { defaultCalendarFilters } from 'lib/types/filter-types.js'; +import type { + WebInitialKeyserverInfo, + WebInitialReduxStateResponse, +} from 'lib/types/redux-types.js'; import { useKeyserverCall } from 'lib/utils/keyserver-call.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; @@ -10,8 +14,6 @@ import type { ExcludedData, InitialReduxState, - WebInitialReduxStateResponse, - WebInitialKeyserverInfo, InitialReduxStateRequest, } from '../types/redux-types.js'; diff --git a/web/types/redux-types.js b/web/types/redux-types.js --- a/web/types/redux-types.js +++ b/web/types/redux-types.js @@ -4,23 +4,11 @@ import type { InviteLinksStore } from 'lib/types/link-types.js'; import type { MessageStore } from 'lib/types/message-types.js'; import type { WebNavInfo } from 'lib/types/nav-types.js'; -import type { LegacyThreadStore, ThreadStore } from 'lib/types/thread-types.js'; +import type { WebInitialKeyserverInfo } from 'lib/types/redux-types.js'; +import type { ThreadStore } from 'lib/types/thread-types.js'; import type { CurrentUserInfo, UserInfos } from 'lib/types/user-types.js'; import type { URLInfo } from 'lib/utils/url-utils.js'; -export type WebInitialReduxStateResponse = { - +navInfo: WebNavInfo, - +currentUserInfo: CurrentUserInfo, - +entryStore: EntryStore, - +threadStore: LegacyThreadStore, - +userInfos: UserInfos, - +messageStore: MessageStore, - +pushApiPublicKey: ?string, - +commServicesAccessToken: null, - +inviteLinksStore: InviteLinksStore, - +keyserverInfo: WebInitialKeyserverInfo, -}; - export type InitialReduxState = { +navInfo: WebNavInfo, +currentUserInfo: CurrentUserInfo, @@ -36,11 +24,6 @@ +keyserverInfos: { +[keyserverID: string]: WebInitialKeyserverInfo }, }; -export type WebInitialKeyserverInfo = { - +sessionID: ?string, - +updatesCurrentAsOf: number, -}; - export type ExcludedData = { +threadStore?: boolean, };