forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cookiejs.d.ts
50 lines (48 loc) · 1.34 KB
/
cookiejs.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
// Type definitions for cookie.js v1.0.0
// Project: https://github.com/js-coder/cookie.js
// Definitions by: Boltmade <https://github.com/Boltmade>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Shortcut for cookie.get()
*/
declare function cookie(key : string, fallback?: string) : string;
declare function cookie(keys : string[], fallback?: string) : string;
declare namespace cookie {
/**
* Create a cookie. The value will automatically be escaped.
*/
export function set(key : string, value : string, options? : any) : void;
/**
* Set several cookies at once
*/
export function set(obj : any, options? : any) : void;
/**
* Remove cookies
*/
export function remove(key : string) : void;
export function remove(keys : string[]) : void;
export function remove(...args : string[]) : void;
/**
* Remove all cookies
*/
export function empty() : void;
/**
* Retrieve the value of the cookie
*/
export function get(key : string, fallback?: string) : string;
/**
* Retrieve values of several cookies
*/
export function get(keys : string[], fallback?: string) : any;
/**
* Get all currently saved cookies
*/
export function all() : any;
/**
* Test if cookies are enabled
*/
export function enabled() : boolean;
}
declare module "cookiejs" {
export = cookie;
}