forked from y-scope/yscope-log-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifications.ts
38 lines (30 loc) · 869 Bytes
/
notifications.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
import {ButtonProps} from "@mui/joy";
import {LOG_LEVEL} from "./logs";
/**
* Contents of pop-up messages and its associated auto dismiss timeout.
*/
interface PopUpMessage {
level: LOG_LEVEL,
message: string,
timeoutMillis: number,
title: string,
primaryAction?: ButtonProps,
}
/**
* A value that indicates that a pop-up message should not be automatically dismissed.
*/
const DO_NOT_TIMEOUT_VALUE = 0;
/**
* The default duration in milliseconds after which an automatic dismissal will occur.
*/
const DEFAULT_AUTO_DISMISS_TIMEOUT_MILLIS = 10_000;
/**
* A longer duration in milliseconds after which an automatic dismissal will occur.
*/
const LONG_AUTO_DISMISS_TIMEOUT_MILLIS = 20_000;
export type {PopUpMessage};
export {
DEFAULT_AUTO_DISMISS_TIMEOUT_MILLIS,
DO_NOT_TIMEOUT_VALUE,
LONG_AUTO_DISMISS_TIMEOUT_MILLIS,
};