mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 19:23:55 +00:00
* FileProgress.ts - convert to typescript * Buttons.tsx - convert to typescript Buttons.tsx - convert to typescript (partial) Buttons.tsx - convert to typescript (partial) Buttons.tsx - convert to typescript * everywhere - remove `ComponentChild` * FileItem.tsx - convert to typescript * FileList.jsx - fix the comments, they got a bit shuffled some time ago * FileList.tsx - convert to typscript * Dashboard.tsx - add back missing props * FileInfo.tsx - convert to typescript FileInfo.tsx - convert to typescript (partial) FileInfo.tsx - convert to typescript * everywhere - remove excessive props
34 lines
995 B
TypeScript
34 lines
995 B
TypeScript
export interface DeterminateFileProcessing {
|
|
mode: 'determinate'
|
|
message: string
|
|
value: number
|
|
}
|
|
export interface IndeterminateFileProcessing {
|
|
mode: 'indeterminate'
|
|
message?: string
|
|
value?: 0
|
|
}
|
|
export type FileProcessingInfo =
|
|
| IndeterminateFileProcessing
|
|
| DeterminateFileProcessing
|
|
|
|
// TODO explore whether all of these properties need to be optional
|
|
interface FileProgressBase {
|
|
uploadComplete?: boolean
|
|
percentage?: number
|
|
bytesTotal: number | null
|
|
preprocess?: FileProcessingInfo
|
|
postprocess?: FileProcessingInfo
|
|
}
|
|
|
|
// 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
|