diff --git a/types/vuelidate/lib/validators.d.ts b/types/vuelidate/lib/validators.d.ts index f335c4da3b..3f8ea48797 100644 --- a/types/vuelidate/lib/validators.d.ts +++ b/types/vuelidate/lib/validators.d.ts @@ -14,6 +14,7 @@ export interface ValidationParams { // const ValidationRule export interface ValidationRule { + (...params: any[]): boolean $params(): ValidationParams $pending(): boolean } diff --git a/types/vuelidate/vuelidate-tests.ts b/types/vuelidate/vuelidate-tests.ts index 794c2473fe..556d816ae6 100644 --- a/types/vuelidate/vuelidate-tests.ts +++ b/types/vuelidate/vuelidate-tests.ts @@ -19,9 +19,11 @@ const contains = (param: string): CustomRule => const mustBeCool3 = helpers.withParams( { type: 'mustBeCool3' }, - (value) => !helpers.req(value) || value.indexOf('cool') >= 0 + (value: any) => !helpers.req(value) || value.indexOf('cool') >= 0 ) +const mustBeCool3Result: boolean = mustBeCool3(50) + const mustBeCool4 = helpers.regex('mustBeCool4', /^.*cool.*$/) const mustBeSame = (reference: string) => helpers.withParams(