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: 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: readonly FileValidationError<CustomError>[]

{@inheritDoc FileUploadState.errors}

onChange: ChangeEventHandler<HTMLInputElement>
onDrop: DragEventHandler<E>
stats: readonly Readonly<FileUploadStats>[]

A list of all the FileUploadStats.

see

getSplitFileUploads for separating by status

totalBytes: number

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

totalFiles: number

The total number of files in the stats list.

Methods

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

Generated using TypeDoc