From d1a0986ba4a1f0d89994df3cc0d86f1ba7674922 Mon Sep 17 00:00:00 2001 From: Zaytsev Kirill Date: Tue, 20 Oct 2020 17:41:28 +0300 Subject: [PATCH] fix: Typehint fixes --- .gitignore | 2 ++ src/Formulario.ts | 4 ++-- src/FormularioForm.vue | 2 ++ src/FormularioInput.vue | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2e3ecc4..5ec4ea2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ coverage .vscode *.sublime-project *.sublime-workspace +*.dev.tale.vue +*.dev.stories.js diff --git a/src/Formulario.ts b/src/Formulario.ts index c7681be..df5224d 100644 --- a/src/Formulario.ts +++ b/src/Formulario.ts @@ -167,7 +167,7 @@ export default class Formulario { * Given an array, this function will attempt to make sense of the given error * and hydrate a form with the resulting errors. */ - handle (error: any, formName: string, skip: boolean = false) { + handle (error: any, formName: string, skip = false) { // @ts-ignore const e = skip ? error : this.options.errorHandler(error, formName) if (formName && this.registry.has(formName)) { @@ -184,7 +184,7 @@ export default class Formulario { /** * Reset a form. */ - reset (formName: string, initialValue: Object = {}) { + reset (formName: string, initialValue: Record = {}) { this.resetValidation(formName) this.setValues(formName, initialValue) } diff --git a/src/FormularioForm.vue b/src/FormularioForm.vue index 7b25d4b..f4b2ad6 100644 --- a/src/FormularioForm.vue +++ b/src/FormularioForm.vue @@ -18,6 +18,8 @@ import Registry from '@/libs/registry' import FormSubmission from '@/FormSubmission' import FormularioInput from '@/FormularioInput.vue' +import { ErrorObserver } from '@/validation/types' + @Component({ name: 'FormularioForm' }) export default class FormularioForm extends Vue { @Provide() formularioFieldValidation (errorObject): void { diff --git a/src/FormularioInput.vue b/src/FormularioInput.vue index c6782c1..61245ce 100644 --- a/src/FormularioInput.vue +++ b/src/FormularioInput.vue @@ -63,7 +63,7 @@ export default class FormularioInput extends Vue { @Prop({ type: [String, Boolean, Array], default: false, - }) validation + }) validation!: string|any[]|boolean @Prop({ type: [String, Boolean],