Skip to content

Commit

Permalink
@uppy/utils: improve preprocess and postprocess types (#4841)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Dec 28, 2023
1 parent aa6eb0a commit f76d76b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/@uppy/utils/src/FileProgress.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
export interface DeterminateFileProcessing {
mode: 'determinate'
message: string
value: number
}
export interface IndeterminateFileProcessing {
mode: 'indeterminate'
message?: undefined
value?: 0
}
export type FileProcessingInfo =
| IndeterminateFileProcessing
| DeterminateFileProcessing

interface FileProgressBase {
progress?: number
uploadComplete: boolean
percentage: number
bytesTotal: number
preprocess?: { mode: string; message?: string; value?: number }
postprocess?: { mode: string; message?: string; value?: number }
preprocess?: FileProcessingInfo
postprocess?: FileProcessingInfo
}

// FileProgress is either started or not started. We want to make sure TS doesn't
Expand Down

0 comments on commit f76d76b

Please sign in to comment.