Sha256: a8e31ff6a19cc135ae833fe24f43023ea1d3f7e920b0535a3ca8df4318a59d85

Contents?: true

Size: 1.36 KB

Versions: 43

Compression:

Stored size: 1.36 KB

Contents

declare function fastq<C, T = any, R = any>(context: C, worker: fastq.worker<C, T, R>, concurrency: number): fastq.queue<T, R>
declare function fastq<C, T = any, R = any>(worker: fastq.worker<C, T, R>, concurrency: number): fastq.queue<T, R>

declare namespace fastq {
  type worker<C, T = any, R = any> = (this: C, task: T, cb: fastq.done<R>) => void
  type asyncWorker<C, T = any, R = any> = (this: C, task: T) => Promise<R>
  type done<R = any> = (err: Error | null, result?: R) => void
  type errorHandler<T = any> = (err: Error, task: T) => void

  interface queue<T = any, R = any> {
    push(task: T, done?: done<R>): void
    unshift(task: T, done?: done<R>): void
    pause(): any
    resume(): any
    idle(): boolean
    length(): number
    getQueue(): T[]
    kill(): any
    killAndDrain(): any
    error(handler: errorHandler<T>): void
    concurrency: number
    drain(): any
    empty: () => void
    saturated: () => void
  }

  interface queueAsPromised<T = any, R = any> extends queue<T, R> {
    push(task: T): Promise<R>
    unshift(task: T): Promise<R>
    drained(): Promise<void>
  }

  function promise<C, T = any, R = any>(context: C, worker: fastq.asyncWorker<C, T, R>, concurrency: number): fastq.queueAsPromised<T, R>
  function promise<C, T = any, R = any>(worker: fastq.asyncWorker<C, T, R>, concurrency: number): fastq.queueAsPromised<T, R>
}

export = fastq

Version data entries

43 entries across 43 versions & 3 rubygems

Version Path
immosquare-cleaner-0.1.28 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.27 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.26 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.25 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.24 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.23 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.22 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.21 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.20 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.19 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.18 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.17 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.16 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.14 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.13 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.12 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.11 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.10 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.9 node_modules/fastq/index.d.ts
immosquare-cleaner-0.1.8 node_modules/fastq/index.d.ts