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