forked from WorldBrain/Memex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
40 lines (36 loc) · 1.15 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
export interface ActionDefinition {
/** Type of the button the button, it can be go-to-url etc. */
type: string
/** Url of the button if the button is to open a new link */
url?: string
/** It is used for open the new tab or self tab {new-tab|self} */
context?: 'new-tab' | 'self'
/** Key when we need to use the variable of the local storage */
key?: string
}
export interface ButtonDefinition {
action?: ActionDefinition
label: string
}
export interface OneNotifDef {
/** Title of the notifications - Do not support html tags */
title: string
/** Message in the text - It supports html tags (for example h1, i, b) */
message: string
/** Buttons that will be present in the notifications
* It can be any action button or link button
*/
buttons?: ButtonDefinition[]
}
export interface NotifDefinition {
/** Should be unique (feature_name + notification + incNumber) */
id: string
sentTime?: number
deliveredTime?: number
overview?: OneNotifDef
search?: OneNotifDef
system?: OneNotifDef
}
export interface Notification extends NotifDefinition {
isRead?: boolean
}