import { ParameterType } from "./decorators"; import { Logger } from "./logger"; import { RouteError } from "./error"; import { BadWordsFilter } from "./utils/bad-words"; export declare let badWordsFilter: BadWordsFilter; export declare function validateInput(val: any, role: ParameterType | undefined, logger: Logger): boolean; export type PropertyValidateType = { /** Regular expression matching */ is?: RegExp | Array; /** Whether it is an email address */ isEmail?: boolean; /** Whether it is a phone number */ isPhone?: boolean; /** Whether to allow only letters */ isAlpha?: boolean; /** Allow letters and numbers */ isAlphanumeric?: boolean; /** Numeric value */ isNumeric?: boolean; /** Integer value */ isInt?: boolean; /** Whether it is a URL */ isUrl?: boolean; /** Character containment */ contains?: string; /** Whether the value is within an array */ isIn?: Array; /** Length restriction */ len?: [number, number] | { max?: number; min?: number; }; /** Size restriction, generally used for file size judgment (KB) */ fileSize?: [number, number] | { max?: number; min?: number; }; /** Number of files, default is up to 1 file */ fileCount?: number; /** Allowed file formats */ fileMimeType?: string | string[]; /** Maximum numerical value */ max?: number; /** Minimum numerical value */ min?: number; /** Custom validation function */ customValidate?: (val: any) => boolean; /** Bad word detection: true will block access, "clean" will automatically filter */ badWords?: boolean | "clean"; }; export declare class InputContentValidateError extends RouteError { code: string; nonSystemException: boolean; clearStack: boolean; }