-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathindex.d.ts
38 lines (31 loc) · 896 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
35
36
37
38
// Type definitions for react-use-cookie
// Project: useCookie
// Definitions by: Tyler Wolff <https://github.com/tylerwolff>
// Stefan Natter <https://github.com/natterstefan>
declare module 'react-use-cookie' {
interface cookieOptions {
days?: number;
path?: string;
domain?: string;
SameSite?: 'None' | 'Lax' | 'Strict';
Secure?: boolean;
HttpOnly?: boolean;
}
export interface updateItem {
(value: string, options?: cookieOptions): void;
}
export interface removeItem {
(): void;
}
export function setCookie(
name: string,
value: string,
options?: cookieOptions
): void;
export function getCookie(name: string, initialValue?: string): string;
export function removeCookie(name: string): void;
export default function (
key: string,
initialValue?: string
): [string, updateItem, removeItem];
}