/** * ## Object Decorator * * Property decorator that validates a property value is a plain object. * This is a fundamental object validation decorator that ensures the value * is actually a plain object before applying other object-specific validations. * * ### Usage * ```typescript * class UserProfile { * @IsObject() * metadata: Record; * } * ``` * * ### Validation Behavior * - **Passes**: When value is a plain object (including empty objects) * - **Fails**: When value is not a plain object (null, undefined, array, string, number, class instances, etc.) * * ### Error Messages * - Default: `"[PropertyName]: Must be an object"` * - I18n key: `"validator.object"` * * ### Related Decorators * - Often used as prerequisite for: `@ValidateNested`, `@ObjectKeys`, `@ObjectValues`, etc. * * @returns A property decorator function * @public */ export declare const IsObject: () => PropertyDecorator; declare module '../types' { interface ValidatorRuleParamTypes { /** * ## Object Rule Parameters * * Validates that a value is a plain object. * This rule takes no parameters and checks if the input value is a plain JavaScript object. * * ### Type Definition * ```typescript * Object: []; * ``` * * ### Usage * ```typescript * // As a decorator * class MyClass { * @IsObject() * config: Record; * } * * // As a validation rule * const result = await Validator.validate({ * value: { key: 'value' }, * rules: ['Object'] * }); * ``` * * ### Validation Behavior * - **Valid objects**: `{}`, `{key: 'value'}`, `Object.create(null)` * - **Invalid values**: `null`, `undefined`, `[]`, `'string'`, `42`, class instances * * ### Error Messages * - I18n key: `"validator.object"` * - Default: `"This field must be an object"` * * @public */ Object: []; } }