Browse Source

Fix Uppy.cancelAll and Uppy.close types (#4128)

Sven Grunewaldt 2 years ago
parent
commit
930645ecde
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/@uppy/core/types/index.d.ts

+ 4 - 2
packages/@uppy/core/types/index.d.ts

@@ -32,6 +32,8 @@ type LocaleStrings<TNames extends string> = {
 
 type LogLevel = 'info' | 'warning' | 'error'
 
+type CancelOptions = { reason: 'user' | 'unmount' }
+
 export type Store = UppyUtils.Store
 
 export type InternalMetadata = UppyUtils.InternalMetadata
@@ -352,7 +354,7 @@ export class Uppy {
     UploadResult<TMeta>
   >
 
-  cancelAll(): void
+  cancelAll(options: CancelOptions): void
 
   retryUpload<TMeta extends IndexedObject<any> = Record<string, unknown>>(
     fileID: string
@@ -371,7 +373,7 @@ export class Uppy {
 
   removePlugin(instance: UIPlugin | BasePlugin): void
 
-  close(): void
+  close(options: CancelOptions): void
 
   logout(): void