Changeset View
Changeset View
Standalone View
Standalone View
lib/types/report-types.js
// @flow | // @flow | ||||
import invariant from 'invariant'; | import invariant from 'invariant'; | ||||
import t, { type TInterface } from 'tcomb'; | |||||
import { type PlatformDetails } from './device-types.js'; | import { type PlatformDetails } from './device-types.js'; | ||||
import { type RawEntryInfo, type CalendarQuery } from './entry-types.js'; | import { type RawEntryInfo, type CalendarQuery } from './entry-types.js'; | ||||
import { type MediaMission } from './media-types.js'; | import { type MediaMission } from './media-types.js'; | ||||
import type { AppState, BaseAction } from './redux-types.js'; | import type { AppState, BaseAction } from './redux-types.js'; | ||||
import { type RawThreadInfo } from './thread-types.js'; | import { type RawThreadInfo } from './thread-types.js'; | ||||
import type { UserInfo, UserInfos } from './user-types.js'; | import type { UserInfo, UserInfos } from './user-types.js'; | ||||
import { tPlatformDetails, tShape } from '../utils/validation-utils.js'; | |||||
export type EnabledReports = { | export type EnabledReports = { | ||||
+crashReports: boolean, | +crashReports: boolean, | ||||
+inconsistencyReports: boolean, | +inconsistencyReports: boolean, | ||||
+mediaReports: boolean, | +mediaReports: boolean, | ||||
}; | }; | ||||
export type SupportedReports = $Keys<EnabledReports>; | export type SupportedReports = $Keys<EnabledReports>; | ||||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
type ReportInfo = { | type ReportInfo = { | ||||
+id: string, | +id: string, | ||||
+viewerID: string, | +viewerID: string, | ||||
+platformDetails: PlatformDetails, | +platformDetails: PlatformDetails, | ||||
+creationTime: number, | +creationTime: number, | ||||
}; | }; | ||||
export const reportInfoValidator: TInterface<ReportInfo> = tShape<ReportInfo>({ | |||||
id: t.String, | |||||
viewerID: t.String, | |||||
platformDetails: tPlatformDetails, | |||||
creationTime: t.Number, | |||||
}); | |||||
export type FetchErrorReportInfosRequest = { | export type FetchErrorReportInfosRequest = { | ||||
+cursor: ?string, | +cursor: ?string, | ||||
}; | }; | ||||
export type FetchErrorReportInfosResponse = { | export type FetchErrorReportInfosResponse = { | ||||
+reports: $ReadOnlyArray<ReportInfo>, | +reports: $ReadOnlyArray<ReportInfo>, | ||||
+userInfos: $ReadOnlyArray<UserInfo>, | +userInfos: $ReadOnlyArray<UserInfo>, | ||||
}; | }; | ||||
export type ReduxToolsImport = { | export type ReduxToolsImport = { | ||||
+preloadedState: AppState, | +preloadedState: AppState, | ||||
+payload: $ReadOnlyArray<BaseAction>, | +payload: $ReadOnlyArray<BaseAction>, | ||||
}; | }; |