UNPKG

@solfacil/girassol

Version:
36 lines (35 loc) 1.25 kB
import type { FunctionalComponent, SVGAttributes } from "vue"; import type { ParentValidation, ValidateFieldReturn } from "../../composables/use-validate-field/types"; export type FileUploadModel = File[] | null; export type DownloadMenu = 'download' | 'preview' | 'delete'; export type ParentValidate = ParentValidation<FileUploadModel>; export type ValidateReturn = ValidateFieldReturn<FileUploadModel>; export interface Download { id: string; downloadSrc?: string; downloadMenu: DownloadMenu[]; fileIcon: (file: string) => FunctionalComponent<SVGAttributes>; fileName?: string; } export interface Upload { id: string; name?: string; modelValue?: FileUploadModel; accept?: string; loading?: boolean; multiple?: boolean; placeholder?: string; hasError?: boolean; fileIcon: (file: string) => FunctionalComponent<SVGAttributes>; } export interface FileUpload extends Omit<Upload, 'fileIcon' | 'hasError'>, Omit<Download, 'fileIcon'> { id: string; label?: string; helperText?: string; error?: string | null; } export interface VeeValidateIntegration { useField?: ParentValidate['useFieldParent']; rules?: ParentValidate['rules']; opts?: ParentValidate['opts']; }