1 | import { ReadonlyContext } from './context';
|
2 | export interface Request {
|
3 | [k: string]: any;
|
4 | body?: any;
|
5 | cookies?: Record<string, any>;
|
6 | headers?: Record<string, any>;
|
7 | params?: Record<string, any>;
|
8 | query?: Record<string, any>;
|
9 | }
|
10 | export declare type Middleware = (req: Request, res: any, next: (err?: any) => void) => void;
|
11 | export declare type Location = 'body' | 'cookies' | 'headers' | 'params' | 'query';
|
12 | export declare type Meta = {
|
13 | req: Request;
|
14 | location: Location;
|
15 | path: string;
|
16 | };
|
17 | export declare type CustomValidator = (input: any, meta: Meta) => any;
|
18 | export declare type StandardValidator = (input: string, ...options: any[]) => boolean;
|
19 | export declare type CustomSanitizer = (input: any, meta: Meta) => any;
|
20 | export declare type StandardSanitizer = (input: string, ...options: any[]) => any;
|
21 | export declare type DynamicMessageCreator = (value: any, meta: Meta) => any;
|
22 | export interface FieldInstance {
|
23 | path: string;
|
24 | originalPath: string;
|
25 | location: Location;
|
26 | value: any;
|
27 | originalValue: any;
|
28 | }
|
29 | export declare type ValidationError = {
|
30 | param: '_error';
|
31 | msg: any;
|
32 | nestedErrors: ValidationError[];
|
33 | location?: undefined;
|
34 | value?: undefined;
|
35 | } | {
|
36 | location: Location;
|
37 | param: string;
|
38 | value: any;
|
39 | msg: any;
|
40 | nestedErrors?: unknown[];
|
41 | };
|
42 | export declare const contextsKey = "express-validator#contexts";
|
43 | export interface InternalRequest extends Request {
|
44 | [contextsKey]?: ReadonlyContext[];
|
45 | }
|
46 | export declare class ValidationHalt extends Error {
|
47 | }
|