Add UploadOptions for Puter.js types (#1832)

* Add UploadOptions

* Add name option
This commit is contained in:
Reynaldi Chernando
2025-10-27 18:15:27 -07:00
committed by GitHub
parent d1ae2bfe80
commit 117f8e393d
+7 -1
View File
@@ -227,7 +227,7 @@ interface FileSystem {
rename(path: string, newName: string): Promise<FSItem>;
space(): Promise<SpaceInfo>;
stat(path: string): Promise<FSItem>;
upload(items: FileList | File[] | Blob[], dirPath?: string, options?: object): Promise<FSItem[]>;
upload(items: FileList | File[] | Blob[], dirPath?: string, options?: UploadOptions): Promise<FSItem[]>;
write(path: string, data?: string | File | Blob, options?: WriteOptions): Promise<FSItem>;
}
@@ -268,6 +268,12 @@ interface WriteOptions {
createMissingParents?: boolean;
}
interface UploadOptions {
overwrite?: boolean;
dedupeName?: boolean;
name?: string;
}
interface SpaceInfo {
capacity: number;
used: number;