type Validators = Record; interface AttributeValidation { messages: string[]; isValid: boolean; } type AttrsType = { [P in keyof T]: AttributeValidation; }; export interface ValidationState { isValid: boolean; attrs: AttrsType; } export function validate(validatorName: any, context: any, model?: any, attribute?: string): any; export default function validationState( validators: Validators | ((ctx: any) => Validators) ): (target: T, key: keyof T) => void;