Skip to content

Commit

Permalink
add definition for addFiles method (#3556)
Browse files Browse the repository at this point in the history
* add definition for addFiles method

* Add basic doc entry for addFiles

Co-authored-by: Artur Paikin <[email protected]>
  • Loading branch information
mrbatista and arturi authored May 13, 2022
1 parent 6a1cf72 commit 0788552
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@uppy/core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ export class Uppy {
file: AddFileOptions<TMeta>
): string

addFiles<TMeta extends IndexedObject<any> = Record<string, unknown>>(
files: AddFileOptions<TMeta>[]
): void

removeFile(fileID: string, reason?: FileRemoveReason): void

pauseResume(fileID: string): boolean
Expand Down
4 changes: 4 additions & 0 deletions website/src/docs/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ If `uppy.opts.autoProceed === true`, Uppy will begin uploading automatically whe
>
> Sometimes you might need to mark some files as “already uploaded”, so that the user sees them, but they won’t actually be uploaded by Uppy. This can be achieved by [looping through files and setting `uploadComplete: true, uploadStarted: true` on them](https://github.com/transloadit/uppy/issues/1112#issuecomment-432339569)
### `uppy.addFiles(fileObjectArray)`

Add many new files to Uppy’s internal state at once. Like `uppy.addFile`, but mostly intended for UI plugins, to speed up the UIs. See `uppy.addFile` for the example of the file object shape.

### `uppy.removeFile(fileID)`

Remove a file from Uppy.
Expand Down

0 comments on commit 0788552

Please sign in to comment.