UNPKG

@tsed/common

Version:
46 lines (45 loc) 972 B
/** * An object instance is valid against `maxProperties` if its number of properties is less than, or equal to, the value of this keyword. * * ::: warning * The value of this keyword MUST be a non-negative integer. * ::: * * ::: warning * This decorator will be removed in v7. * For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/common. * ::: * * ## Example * ### On prop * ```typescript * class Model { * @Any() * @MaxProperties(10) * property: any; * } * ``` * * Will produce: * * ```json * { * "type": "object", * "properties": { * "property": { * "type": "any", * "maxProperties": 10 * } * } * } * ``` * * @param {number} maxProperties * @validation * @swagger * @schema * @collections * @ignore * @deprecated Since v6. Use @MaxProperties decorator from @tsed/schema instead of. */ export declare function MaxProperties(maxProperties: number): (...args: any[]) => any;