Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileUploadHookReturnValue<E, CustomError>

remarks

@since 2.9.0

Type parameters

  • E: HTMLElement = HTMLElement

    An optional HTMLElement type that is used for the FileUploadHandlers.

  • CustomError = never

    An optional error type that gets returned from the FilesValidator.

Hierarchy

Index

Properties

accept

accept: string

An accept string that can be passed to the FileInput component when the FileValidationOptions.extensions list has been provided to limit which files the OS will attempt to allow access to.

example

Simple example

const extensions = ['pdf', 'docx', 'ppt'];
const { accept } = useFileUpload({ extensions, ...others });

expect(accept).toBe("*.pdf,*.docx,*.ppt")
defaultvalue

"*"

errors

errors: readonly FileValidationError<CustomError>[]

{@inheritDoc FileUploadState.errors}

onChange

onChange: ChangeEventHandler<HTMLInputElement>

onDrop

onDrop: DragEventHandler<E>

stats

stats: readonly Readonly<FileUploadStats>[]

A list of all the FileUploadStats.

see

getSplitFileUploads for separating by status

totalBytes

totalBytes: number

The total number of bytes for all the files that exist in the stats list.

totalFiles

totalFiles: number

The total number of files in the stats list.

Methods

clearErrors

  • clearErrors(): void

remove

  • remove(keyOrKeys: string | readonly string[]): void

reset

  • reset(): void

Generated using TypeDoc