summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared/notifications/notification.ts
blob: 570bf2f12ba1914489697ab84d1eaddbdc343372 (plain)
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
41
42
43
44
45
46
47
48
export type NotificationAction = {
  type: 'open-url';
  url: string;
  text?: string;
  withAuth?: boolean;
};

export type InAppNotificationIndicatorType = 'success' | 'warning' | 'error';

interface NotificationProvider {
  mayDisplay(): boolean;
}

export interface SystemNotification {
  message: string;
  critical: boolean;
  presentOnce?: { value: boolean; name: string };
  suppressInDevelopment?: boolean;
  action?: NotificationAction;
}

export interface InAppNotification {
  indicator?: InAppNotificationIndicatorType;
  title: string;
  subtitle?: string;
  action?: NotificationAction;
}

export interface SystemNotificationProvider extends NotificationProvider {
  getSystemNotification(): SystemNotification | undefined;
}

export interface InAppNotificationProvider extends NotificationProvider {
  getInAppNotification(): InAppNotification | undefined;
}

export * from './account-expired';
export * from './close-to-account-expiry';
export * from './block-when-disconnected';
export * from './connected';
export * from './connecting';
export * from './disconnected';
export * from './error';
export * from './no-valid-key';
export * from './inconsistent-version';
export * from './reconnecting';
export * from './unsupported-version';
export * from './update-available';