forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcookie.d.ts
28 lines (24 loc) · 782 Bytes
/
cookie.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
// Type definitions for cookie v0.1.2
// Project: https://github.com/jshttp/cookie
// Definitions by: Pine Mizune <https://github.com/pine613>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface CookieSerializeOptions {
encode?: (val: string) => string;
path?: string;
expires?: Date;
maxAge?: number;
domain?: string;
secure?: boolean;
httpOnly?: boolean;
}
interface CookieParseOptions {
decode?: (val: string) => string;
}
interface CookieStatic {
serialize(name: string, val: string, options?: CookieSerializeOptions): string;
parse(str: string, options?: CookieParseOptions): { [key: string]: string };
}
declare module "cookie" {
var cookie: CookieStatic;
export = cookie;
}