mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
Add cookie
This commit is contained in:
Vendored
+28
@@ -0,0 +1,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;
|
||||
}
|
||||
Reference in New Issue
Block a user