|
@@ -147,17 +147,17 @@ declare module Uppy {
|
|
|
|
|
|
type UploadHandler = (fileIDs: string[]) => Promise<void>
|
|
|
|
|
|
+ type UploadSuccessCallback<T> = (file: UppyFile<T>, body: any, uploadURL: string) => void
|
|
|
+ type UploadCompleteCallback<T> = (result: UploadResult<T>) => void
|
|
|
+
|
|
|
class Uppy<TUseStrictTypes extends TypeChecking = TypeChecking> {
|
|
|
constructor(opts?: UppyOptions)
|
|
|
- on<TMeta extends IndexedObject<any> = {}>(
|
|
|
- event: 'upload-success',
|
|
|
- callback: (file: UppyFile<TMeta>, body: any, uploadURL: string) => void
|
|
|
- ): this
|
|
|
- on<TMeta extends IndexedObject<any> = {}>(
|
|
|
- event: 'complete',
|
|
|
- callback: (result: UploadResult<TMeta>) => void
|
|
|
- ): this
|
|
|
+ on<TMeta extends IndexedObject<any> = {}>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
|
|
|
+ on<TMeta extends IndexedObject<any> = {}>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
|
|
|
on(event: Event, callback: (...args: any[]) => void): this
|
|
|
+ once<TMeta extends IndexedObject<any> = {}>(event: 'upload-success', callback: UploadSuccessCallback<TMeta>): this
|
|
|
+ once<TMeta extends IndexedObject<any> = {}>(event: 'complete', callback: UploadCompleteCallback<TMeta>): this
|
|
|
+ once(event: Event, callback: (...args: any[]) => void): this
|
|
|
off(event: Event, callback: (...args: any[]) => void): this
|
|
|
/**
|
|
|
* For use by plugins only.
|