-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
68 lines (55 loc) · 1.49 KB
/
global.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
/// <reference types="vite/client" />
/// <reference types="urlpattern-polyfill" />
interface ImportMetaEnv {
readonly PUBLIC_ENV__MODE: 'MPA' | 'SPA' | 'ISOMORPHIC'
readonly PUBLIC_ENV__APP_SHELL: 'true' | 'false'
readonly PUBLIC_ENV__ANIMATIONS: 'true' | 'false'
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
interface Window {
cookieStore: CookieStore
}
interface Navigator {
virtualKeyboard: { overlaysContent: boolean }
}
interface CookieStore extends EventTarget {
get(name?: string): Promise<CookieListItem | null>
get(options?: CookieStoreGetOptions): Promise<CookieListItem | null>
getAll(name?: string): Promise<CookieList>
getAll(options?: CookieStoreGetOptions): Promise<CookieList>
set(name: string, value: string): Promise<void>
set(options: CookieInit): Promise<void>
delete(name: string): Promise<void>
delete(options: CookieStoreDeleteOptions): Promise<void>
}
interface CookieStoreGetOptions {
name?: string
url?: string
}
type CookieSameSite = 'strict' | 'lax' | 'none'
interface CookieInit {
name: string
value: string
expires?: number | Date | null
domain?: string | null
path?: string
sameSite?: CookieSameSite
httpOnly?: boolean
}
interface CookieStoreDeleteOptions {
name: string
domain?: string | null
path?: string
}
interface CookieListItem {
name: string
value: string
domain?: string | null
path?: string
expires?: Date | null
secure?: boolean
sameSite?: CookieSameSite
}
type CookieList = CookieListItem[]