-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathtoaster.ts
More file actions
46 lines (40 loc) · 1.03 KB
/
toaster.ts
File metadata and controls
46 lines (40 loc) · 1.03 KB
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
export type ToasterAppearance = 'info' | 'success' | 'danger' | 'warning' | 'system'
export interface Toast {
/** Unique identifier of toaster */
key?: string
/** Title of toaster */
title?: string
/** Text to display in toaster */
message?: string
appearance?: ToasterAppearance
timeoutMilliseconds?: number
timer?: number
}
export type ToasterAppearancesRecord = Record<ToasterAppearance, ToasterAppearance>
export const ToasterAppearances: ToasterAppearancesRecord = {
info: 'info',
success: 'success',
danger: 'danger',
warning: 'warning',
system: 'system',
}
export interface ToasterOptions {
zIndex?: number
}
export interface ToasterProps {
/**
* The toaster state.
* @default []
*/
toasterState: Array<Toast & { key: string }>
/**
* @deprecated zIndex provided through ToasterOptions is set on the shared container on initialization. This prop is no longer used.
*/
zIndex?: number
}
export interface ToasterEmits {
/**
* Emitted when a toaster is closed.
*/
close: [val: string]
}