mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-22 17:58:05 +00:00
Co-authored-by: Mikael Finstad <finstaden@gmail.com> Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com> Co-authored-by: Murderlon <merlijn@soverin.net> Co-authored-by: Artur Paikin <artur@arturpaikin.com>
18 lines
565 B
TypeScript
18 lines
565 B
TypeScript
interface FileProgressBase {
|
|
progress: number
|
|
uploadComplete: boolean
|
|
percentage: number
|
|
bytesTotal: number
|
|
}
|
|
|
|
// FileProgress is either started or not started. We want to make sure TS doesn't
|
|
// let us mix the two cases, and for that effect, we have one type for each case:
|
|
export type FileProgressStarted = FileProgressBase & {
|
|
uploadStarted: number
|
|
bytesUploaded: number
|
|
}
|
|
export type FileProgressNotStarted = FileProgressBase & {
|
|
uploadStarted: null
|
|
bytesUploaded: false
|
|
}
|
|
export type FileProgress = FileProgressStarted | FileProgressNotStarted
|