Skip to content

Commit c832410

Browse files
authored
Add cookieOptions to types (#239)
1 parent 386bc3d commit c832410

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

index.d.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import * as i18next from 'i18next';
22

3+
interface CookieOptions {
4+
maxAge?: number;
5+
expires?: Date;
6+
httpOnly?: boolean;
7+
path?: string;
8+
domain?: string;
9+
secure?: boolean;
10+
sameSite?: boolean | 'lax' | 'strict' | 'none';
11+
}
12+
313
interface DetectorOptions {
414
/**
515
* order and from where user language should be detected
@@ -29,12 +39,21 @@ interface DetectorOptions {
2939
excludeCacheFor?: string[];
3040

3141
/**
32-
* optional expire and domain for set cookie
42+
* optional expire for set cookie
3343
* @default 10
3444
*/
3545
cookieMinutes?: number;
46+
47+
/**
48+
* optional domain for set cookie
49+
*/
3650
cookieDomain?: string;
3751

52+
/**
53+
* optional cookie options
54+
*/
55+
cookieOptions?: CookieOptions
56+
3857
/**
3958
* optional htmlTag with lang attribute
4059
* @default document.documentElement

0 commit comments

Comments
 (0)