-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
vue3-mq.d.ts
104 lines (99 loc) · 1.96 KB
/
vue3-mq.d.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// https://github.com/craigrileyuk/vue3-mq/issues/4#issuecomment-1130365130
declare module 'vue3-mq' {
import type { DefineComponent } from 'vue'
type Preset =
| 'bootstrap5'
| 'bootstrap4'
| 'bootstrap3'
| 'vuetify'
| 'tailwind'
| 'devices'
| 'wordpress'
interface Breakpoints {
xs: number
sm: number
md: number
lg: number
xl: number
xxl: number
}
interface MqState {
current: keyof Breakpoints
xs: boolean
sm: boolean
smMinus: boolean
smPlus: boolean
md: boolean
mdMinus: boolean
mdPlus: boolean
lg: boolean
lgMinus: boolean
lgPlus: boolean
xl: boolean
xlMinus: boolean
xlPlus: boolean
xxl: boolean
orientation: 'landscape' | 'portrait'
isLandscape: boolean
isPortrait: boolean
theme: 'light' | 'dark'
isLight: boolean
isDark: boolean
}
export function useMq(): MqState
export function updateBreakpoints({
breakpoints,
preset,
}: {
breakpoints: Breakpoints
preset: Preset
}): void
export const availableBreakpoints: Breakpoints
export const Vue3Mq: {
install: <T>(
app: T,
{
preset,
breakpoints,
defaultBreakpoint,
defaultOrientation,
defaultMotion,
defaultTheme,
}: {
preset?: Preset
breakpoints: Breakpoints
defaultBreakpoint?: keyof Breakpoints
defaultOrientation?: MqState['orientation']
defaultMotion?: string
defaultTheme?: MqState['theme']
}
) => void
}
type Target =
| 'xs'
| 'sm'
| 'sm-'
| 'sm+'
| 'md'
| 'md-'
| 'md+'
| 'lg'
| 'lg-'
| 'lg+'
| 'xl'
| 'xl+'
| 'xl-'
| 'xxl'
export const MqResponsive: DefineComponent<{
target?: Target
landscape?: boolean
portrait?: boolean
dark?: boolean
light?: boolean
inert?: boolean
motion?: boolean
tag?: string
listTag?: string
group?: boolean
}>
}