Changeset View
Changeset View
Standalone View
Standalone View
lib/types/history-types.js
// @flow | // @flow | ||||
import t, { type TInterface } from 'tcomb'; | |||||
import { tID, tShape } from '../utils/validation-utils.js'; | |||||
export type HistoryMode = 'day' | 'entry'; | export type HistoryMode = 'day' | 'entry'; | ||||
export type HistoryRevisionInfo = { | export type HistoryRevisionInfo = { | ||||
+id: string, | +id: string, | ||||
+entryID: string, | +entryID: string, | ||||
+authorID: string, | +authorID: string, | ||||
+text: string, | +text: string, | ||||
+lastUpdate: number, | +lastUpdate: number, | ||||
+deleted: boolean, | +deleted: boolean, | ||||
+threadID: string, | +threadID: string, | ||||
}; | }; | ||||
export const historyRevisionInfoValidator: TInterface<HistoryRevisionInfo> = | |||||
tShape<HistoryRevisionInfo>({ | |||||
id: tID, | |||||
entryID: tID, | |||||
authorID: t.String, | |||||
text: t.String, | |||||
lastUpdate: t.Number, | |||||
deleted: t.Boolean, | |||||
threadID: tID, | |||||
}); | |||||
export type FetchEntryRevisionInfosRequest = { | export type FetchEntryRevisionInfosRequest = { | ||||
+id: string, | +id: string, | ||||
}; | }; | ||||
export type FetchEntryRevisionInfosResult = { | export type FetchEntryRevisionInfosResult = { | ||||
+result: $ReadOnlyArray<HistoryRevisionInfo>, | +result: $ReadOnlyArray<HistoryRevisionInfo>, | ||||
}; | }; |