Skip to content

Commit

Permalink
chore: reduce redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao committed Dec 19, 2024
1 parent 5b5fa7e commit 1f63b75
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions packages/auto-drive/src/api/models/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,22 @@ export type CompleteUploadResponse = {
cid: string
}

export type UploadFileStatus =
type ObjectUploadStatus<Type extends 'file' | 'folder'> =
| {
completed: true
type: 'file'
type: Type
progress: number
cid: AutoCID
cid: string
}
| {
completed: false
type: 'file'
type: Type
progress: number
cid: null
}

export type UploadFolderStatus =
| {
completed: true
type: 'folder'
progress: number
cid: AutoCID
}
| {
completed: false
type: 'folder'
progress: number
cid: null
}
export type UploadFileStatus = ObjectUploadStatus<'file'>
export type UploadFolderStatus = ObjectUploadStatus<'folder'>

export type UploadChunksStatus = {
uploadBytes: number
Expand Down

0 comments on commit 1f63b75

Please sign in to comment.