From 5547cb5b872814f96e27a9075db3559809fee64c Mon Sep 17 00:00:00 2001 From: Zaytsev Kirill Date: Sat, 22 May 2021 15:26:52 +0300 Subject: [PATCH] chore: Improved typehinting --- src/FormularioInput.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/FormularioInput.vue b/src/FormularioInput.vue index f9f9e06..c272a67 100644 --- a/src/FormularioInput.vue +++ b/src/FormularioInput.vue @@ -1,5 +1,8 @@ @@ -28,6 +31,15 @@ const VALIDATION_BEHAVIOR = { SUBMIT: 'submit', } +type Context = { + model: U; + name: string; + runValidation(): Promise; + violations: Violation[]; + errors: string[]; + allErrors: string[]; +} + interface ModelGetConverter { (value: U|Empty): U|T|Empty; } @@ -99,7 +111,7 @@ export default class FormularioInput extends Vue { } } - get context (): Record { + get context (): Context { return Object.defineProperty({ name: this.fullQualifiedName, runValidation: this.runValidation.bind(this),