Преглед изворни кода

@uppy/utils: update typings for `RateLimitedQueue` (#4204)

Antoine du Hamel пре 2 година
родитељ
комит
5420829ade
1 измењених фајлова са 9 додато и 0 уклоњено
  1. 9 0
      packages/@uppy/utils/types/index.d.ts

+ 9 - 0
packages/@uppy/utils/types/index.d.ts

@@ -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