/
index.d.ts
30 lines (25 loc) · 937 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { PluginOptions, BasePlugin, UppyFile } from '@uppy/core'
import type { UploadOptions, HttpRequest } from 'tus-js-client'
type TusUploadOptions = Pick<UploadOptions, Exclude<keyof UploadOptions,
| 'fingerprint'
| 'metadata'
| 'onBeforeRequest'
| 'onProgress'
| 'onChunkComplete'
| 'onShouldRetry'
| 'onSuccess'
| 'onError'
| 'uploadUrl'
| 'uploadSize'
>>
type Next = (err: Error | undefined, retryAttempt?: number, options?: TusOptions) => boolean
export interface TusOptions extends PluginOptions, TusUploadOptions {
allowedMetaFields?: string[] | null
limit?: number
useFastRemoteRetry?: boolean
withCredentials?: boolean
onShouldRetry?: (err: Error | undefined, retryAttempt: number, options: TusOptions, next: Next) => boolean
onBeforeRequest?: (req: HttpRequest, file: UppyFile) => Promise<void>
}
declare class Tus extends BasePlugin<TusOptions> {}
export default Tus