Changeset View
Changeset View
Standalone View
Standalone View
lib/types/notif-types.js
// @flow | // @flow | ||||
import t, { type TInterface } from 'tcomb'; | |||||
import type { EntityText, ThreadEntity } from '../utils/entity-text.js'; | import type { EntityText, ThreadEntity } from '../utils/entity-text.js'; | ||||
import { tShape } from '../utils/validation-utils.js'; | |||||
export type NotifTexts = { | export type NotifTexts = { | ||||
+merged: string | EntityText, | +merged: string | EntityText, | ||||
+body: string | EntityText, | +body: string | EntityText, | ||||
+title: string | ThreadEntity, | +title: string | ThreadEntity, | ||||
+prefix?: string | EntityText, | +prefix?: string | EntityText, | ||||
}; | }; | ||||
export type ResolvedNotifTexts = { | export type ResolvedNotifTexts = { | ||||
+merged: string, | +merged: string, | ||||
+body: string, | +body: string, | ||||
+title: string, | +title: string, | ||||
+prefix?: string, | +prefix?: string, | ||||
}; | }; | ||||
export const resolvedNotifTextsValidator: TInterface<ResolvedNotifTexts> = | |||||
tShape<ResolvedNotifTexts>({ | |||||
merged: t.String, | |||||
body: t.String, | |||||
title: t.String, | |||||
prefix: t.maybe(t.String), | |||||
}); | |||||
export type WebNotification = { | export type WebNotification = { | ||||
+body: string, | +body: string, | ||||
+prefix?: string, | +prefix?: string, | ||||
+title: string, | +title: string, | ||||
+unreadCount: number, | +unreadCount: number, | ||||
+id: string, | +id: string, | ||||
+threadID: string, | +threadID: string, | ||||
Show All 9 Lines |