Skip to content

Commit

Permalink
@uppy/aws-s3: fix JSDoc type error (#3785)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored May 30, 2022
1 parent 6b8a16b commit bad2fa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/@uppy/aws-s3/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default class AwsS3 extends BasePlugin {
* keep track of `getUploadParameters()` responses
* so we can cancel the calls individually using just a file ID
*
* @type {object.<string, Promise>}
* @type {Record<string, import('@uppy/utils/lib/RateLimitedQueue').AbortablePromise<unknown>>}
*/
const paramsPromises = Object.create(null)

Expand Down
8 changes: 5 additions & 3 deletions packages/@uppy/utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ declare module '@uppy/utils/lib/ProgressTimeout' {
declare module '@uppy/utils/lib/RateLimitedQueue' {
namespace RateLimitedQueue {
export type AbortFunction = () => void
export type PromiseFunction = (...args: any[]) => Promise<any>
export interface AbortablePromise<T> extends Promise<T> {
abort(): void
}
export type QueueEntry = {
abort: () => void,
done: () => void,
Expand All @@ -72,9 +74,9 @@ declare module '@uppy/utils/lib/RateLimitedQueue' {
): RateLimitedQueue.QueueEntry

wrapPromiseFunction(
fn: () => RateLimitedQueue.PromiseFunction,
fn: () => (...args: any[]) => Promise<any>,
queueOptions?: RateLimitedQueue.QueueOptions
): RateLimitedQueue.PromiseFunction
): (...args: any[]) => RateLimitedQueue.AbortablePromise<any>
}

export const internalRateLimitedQueue: symbol
Expand Down

0 comments on commit bad2fa7

Please sign in to comment.