From 117f8e393d93c50ea1a58669b9345ba25b319a0d Mon Sep 17 00:00:00 2001 From: Reynaldi Chernando <12949382+reynaldichernando@users.noreply.github.com> Date: Tue, 28 Oct 2025 08:15:27 +0700 Subject: [PATCH] Add `UploadOptions` for Puter.js types (#1832) * Add UploadOptions * Add name option --- src/puter-js/index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/puter-js/index.d.ts b/src/puter-js/index.d.ts index ea87fb11d..aaac57afa 100644 --- a/src/puter-js/index.d.ts +++ b/src/puter-js/index.d.ts @@ -227,7 +227,7 @@ interface FileSystem { rename(path: string, newName: string): Promise; space(): Promise; stat(path: string): Promise; - upload(items: FileList | File[] | Blob[], dirPath?: string, options?: object): Promise; + upload(items: FileList | File[] | Blob[], dirPath?: string, options?: UploadOptions): Promise; write(path: string, data?: string | File | Blob, options?: WriteOptions): Promise; } @@ -268,6 +268,12 @@ interface WriteOptions { createMissingParents?: boolean; } +interface UploadOptions { + overwrite?: boolean; + dedupeName?: boolean; + name?: string; +} + interface SpaceInfo { capacity: number; used: number;