node-web-mvc
Version:
node spring mvc
31 lines (30 loc) • 1 kB
TypeScript
import ValidationContext from '../ValidationContext';
import Constraints from './Constraints';
declare class Max extends Constraints {
message?: string;
/**
* 设定能赋值的最大值
*/
value: number;
getSize(value: any, context: ValidationContext): any;
isValid(content: any, context: ValidationContext): boolean;
}
/**
* 验证标注元素的值必须小于等于配置的最大值
*
* 支持的数据类型:
* - `Number`
* - `String`
*
* `null` 或者 `undefined` 则不做验证
*/
declare const _default: {
(options: number | import("../../servlets/annotations/Target").CreateOptions<typeof Max>): (target: Object, name: string, p?: number) => any;
(target: {
[x: string]: any;
}, propertyKey: string): any;
(target: {
[x: string]: any;
}, propertyKey: string, parameterIndex: number): any;
} & import("../../servlets/annotations/annotation/type").LinkAnnotationType<typeof Max> & typeof Max;
export default _default;