Changeset View
Changeset View
Standalone View
Standalone View
native/redux/action-types.js
// @flow | // @flow | ||||
import type { Orientations } from 'react-native-orientation-locker'; | import type { Orientations } from 'react-native-orientation-locker'; | ||||
import { saveMessagesActionType } from 'lib/actions/message-actions.js'; | import { saveMessagesActionType } from 'lib/actions/message-actions.js'; | ||||
import type { MessageID } from 'lib/types/db-ops-types'; | |||||
import type { BaseAction } from 'lib/types/redux-types.js'; | import type { BaseAction } from 'lib/types/redux-types.js'; | ||||
import type { DimensionsInfo } from './dimensions-updater.react.js'; | import type { DimensionsInfo } from './dimensions-updater.react.js'; | ||||
import type { AppState } from './state-types.js'; | import type { AppState } from './state-types.js'; | ||||
import type { DeviceCameraInfo } from '../types/camera.js'; | import type { DeviceCameraInfo } from '../types/camera.js'; | ||||
import type { ConnectivityInfo } from '../types/connectivity.js'; | import type { ConnectivityInfo } from '../types/connectivity.js'; | ||||
import type { LocalSettings } from '../types/local-settings-types.js'; | import type { LocalSettings } from '../types/local-settings-types.js'; | ||||
export const updateDimensionsActiveType = 'UPDATE_DIMENSIONS'; | export const updateDimensionsActiveType = 'UPDATE_DIMENSIONS'; | ||||
export const updateConnectivityActiveType = 'UPDATE_CONNECTIVITY'; | export const updateConnectivityActiveType = 'UPDATE_CONNECTIVITY'; | ||||
export const updateDeviceCameraInfoActionType = 'UPDATE_DEVICE_CAMERA_INFO'; | export const updateDeviceCameraInfoActionType = 'UPDATE_DEVICE_CAMERA_INFO'; | ||||
export const updateDeviceOrientationActionType = 'UPDATE_DEVICE_ORIENTATION'; | export const updateDeviceOrientationActionType = 'UPDATE_DEVICE_ORIENTATION'; | ||||
export const setStoreLoadedActionType = 'SET_STORE_LOADED'; | export const setStoreLoadedActionType = 'SET_STORE_LOADED'; | ||||
export const setReduxStateActionType = 'SET_REDUX_STATE'; | export const setReduxStateActionType = 'SET_REDUX_STATE'; | ||||
export const setLocalSettingsActionType = 'SET_LOCAL_SETTINGS'; | export const setLocalSettingsActionType = 'SET_LOCAL_SETTINGS'; | ||||
export const backgroundActionTypes: Set<string> = new Set([ | export const backgroundActionTypes: Set<string> = new Set([ | ||||
saveMessagesActionType, | saveMessagesActionType, | ||||
]); | ]); | ||||
export type Action = | export type Action = $ReadOnly< | ||||
| BaseAction | | BaseAction | ||||
| { | | { | ||||
+messageID?: MessageID, | |||||
... | |||||
| { | |||||
+type: 'SET_REDUX_STATE', | +type: 'SET_REDUX_STATE', | ||||
+payload: { +state: AppState, +hideFromMonitor: boolean }, | +payload: { +state: AppState, +hideFromMonitor: boolean }, | ||||
} | } | ||||
| { | | { | ||||
+type: 'UPDATE_DIMENSIONS', | +type: 'UPDATE_DIMENSIONS', | ||||
+payload: Partial<DimensionsInfo>, | +payload: Partial<DimensionsInfo>, | ||||
} | } | ||||
| { | | { | ||||
+type: 'UPDATE_CONNECTIVITY', | +type: 'UPDATE_CONNECTIVITY', | ||||
+payload: ConnectivityInfo, | +payload: ConnectivityInfo, | ||||
} | } | ||||
| { | | { | ||||
+type: 'UPDATE_DEVICE_CAMERA_INFO', | +type: 'UPDATE_DEVICE_CAMERA_INFO', | ||||
+payload: Partial<DeviceCameraInfo>, | +payload: Partial<DeviceCameraInfo>, | ||||
} | } | ||||
| { | | { | ||||
+type: 'UPDATE_DEVICE_ORIENTATION', | +type: 'UPDATE_DEVICE_ORIENTATION', | ||||
+payload: Orientations, | +payload: Orientations, | ||||
} | } | ||||
| { | | { | ||||
+type: 'UPDATE_THREAD_LAST_NAVIGATED', | +type: 'UPDATE_THREAD_LAST_NAVIGATED', | ||||
+payload: { +threadID: string, +time: number }, | +payload: { +threadID: string, +time: number }, | ||||
} | } | ||||
| { | | { | ||||
+type: 'SET_STORE_LOADED', | +type: 'SET_STORE_LOADED', | ||||
} | } | ||||
| { +type: 'SET_LOCAL_SETTINGS', +payload: LocalSettings }; | | { +type: 'SET_LOCAL_SETTINGS', +payload: LocalSettings }, | ||||
}, | |||||
>; |