-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
index.d.ts
34 lines (30 loc) · 898 Bytes
/
index.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
export interface CookieOptions {
expires?: number | Date | string;
path?: string;
domain?: string;
secure?: boolean;
sameSite?: 'None' | 'Strict' | 'Lax';
}
export interface CookieValues {
[key: string]: string;
}
export type CooiesAll = {
[key: string]: string;
}
export interface Cookie {
/**
* Get all cookie
*/
(): CooiesAll;
/**
* Create a cookie, valid across the entire site
*/
(name?: string | CookieValues, value?: string | null | CookieOptions, options?: CookieOptions | number): string;
get: (name: string) => string | boolean;
set: (name?: string | CookieValues, value?: string, options?: CookieOptions | number) => undefined;
remove: (names?: string | string[], ...ages: string[]) => string[];
clear: (names?: string | string[], ...ages: string[]) => string[];
all:() => CookieValues;
}
declare var cookie: Cookie
export default cookie;