|
@@ -55,6 +55,7 @@ declare module '@uppy/utils/lib/RateLimitedQueue' {
|
|
|
export type AbortFunction = () => void
|
|
|
export interface AbortablePromise<T> extends Promise<T> {
|
|
|
abort(): void
|
|
|
+ abortOn(signal: AbortSignal): this
|
|
|
}
|
|
|
export type QueueEntry = {
|
|
|
abort: () => void,
|
|
@@ -68,11 +69,19 @@ declare module '@uppy/utils/lib/RateLimitedQueue' {
|
|
|
export class RateLimitedQueue {
|
|
|
constructor(limit: number)
|
|
|
|
|
|
+ readonly isPaused: boolean
|
|
|
+
|
|
|
run(
|
|
|
fn: () => RateLimitedQueue.AbortFunction,
|
|
|
queueOptions?: RateLimitedQueue.QueueOptions
|
|
|
): RateLimitedQueue.QueueEntry
|
|
|
|
|
|
+ rateLimit(duration: number): void
|
|
|
+
|
|
|
+ pause(duration?: number): void
|
|
|
+
|
|
|
+ resume(): void
|
|
|
+
|
|
|
wrapPromiseFunction(
|
|
|
fn: () => (...args: any[]) => Promise<any>,
|
|
|
queueOptions?: RateLimitedQueue.QueueOptions
|