1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import * as express from 'express';
|
9 |
|
10 | declare global {
|
11 | namespace Express {
|
12 |
|
13 | interface Request {
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | secret?: string;
|
20 | }
|
21 | }
|
22 | }
|
23 |
|
24 | declare function cookieParser(secret?: string | string[], options?: cookieParser.CookieParseOptions): express.RequestHandler;
|
25 |
|
26 | declare namespace cookieParser {
|
27 | interface CookieParseOptions {
|
28 | decode?(val: string): string;
|
29 | }
|
30 |
|
31 | function JSONCookie(jsonCookie: string): object | undefined;
|
32 |
|
33 | function JSONCookies<T extends { [key: string]: string }>(jsonCookies: T): { [P in keyof T]: object | undefined };
|
34 |
|
35 | function signedCookie(cookie: string, secret: string | string[]): string | false;
|
36 |
|
37 | function signedCookies<T extends { [key: string]: string }>(cookies: T, secret: string | string[]): { [P in keyof T]?: string | false};
|
38 | }
|
39 |
|
40 | export = cookieParser;
|