-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.ts
64 lines (57 loc) · 1.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { Component } from 'vue'
export enum Events {
Open = 'open',
Opened = 'opened',
Close = 'close',
Closed = 'closed'
}
export type AnimationType = 'slideDown' | 'slideUp' | 'slideLeft' | 'slideRight' | 'fade' | 'none'
export type ModalStyle = {
padding?: string
align?: 'top' | 'center'
'z-index'?: number
}
export type OverlayStyle = {
'background-color'?: string
'backdrop-filter'?: string
'z-index'?: number
}
export type Options = {
transitionTime?: number
animationType?: AnimationType
modalStyle?: ModalStyle
overlayStyle?: OverlayStyle
}
export type OpenModalOptions = {
group?: 'default' | string
force?: boolean
modalStyle?: ModalStyle
}
export interface ModalItem {
id: number
component: Component
props?: { [key: string]: any }
options: OpenModalOptions
}
export type CloseEventData<T = any> = {
forceCloseAll?: boolean
} & (
| {
success: true
data: T
}
| {
success: false
}
)
export type ClosedEventData<T = any> = {
id: ModalItem['id']
} & (
| {
success: true
data: T
}
| {
success: false
}
)