Skip to content

Commit ae0e29b

Browse files
committed
fix: renterd-js objectUpload support more data types
1 parent a9321f0 commit ae0e29b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.changeset/gentle-onions-report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@siafoundation/renterd-types': patch
3+
---
4+
5+
Fixed an issue where objectUpload only supported the browser File data type. Closes https://github.com/SiaFoundation/web/issues/591

libs/renterd-types/src/worker.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ export type ObjectDownloadPayload = void
1919
export type ObjectDownloadResponse = Blob
2020

2121
export type ObjectUploadParams = { key: string; bucket: string }
22-
export type ObjectUploadPayload = File
22+
export type ObjectUploadPayload =
23+
| File
24+
| Blob
25+
| Buffer
26+
| ArrayBuffer
27+
| string
28+
| Record<string, unknown>
2329
export type ObjectUploadResponse = void
2430

2531
export type MultipartUploadPartParams = {
@@ -32,7 +38,7 @@ export type MultipartUploadPartParams = {
3238
minshards?: number
3339
totalshards?: number
3440
}
35-
export type MultipartUploadPartPayload = Blob
41+
export type MultipartUploadPartPayload = Blob | Buffer | ArrayBuffer | string
3642
export type MultipartUploadPartResponse = void
3743

3844
export type RhpScanParams = void

0 commit comments

Comments
 (0)