declare module 'ember-concurrency' { export function timeout(delay: number): Promise; import ComputedProperty from '@ember/object/computed'; import RSVP from 'rsvp'; export enum TaskInstanceState { Dropped = 'dropped', Canceled = 'canceled', Finished = 'finished', Running = 'running', Waiting = 'waiting' } export interface TaskProperty extends ComputedProperty { cancelOn(eventNames: string): this; debug(): this; drop(): this; enqueue(): this; group(groupPath: string): this; keepLatest(): this; maxConcurrency(n: number): this; on(eventNames: string): this; restartable(): this; } export interface TaskInstance extends PromiseLike { readonly error?: any; readonly hasStarted: ComputedProperty; readonly isCanceled: ComputedProperty; readonly isDropped: ComputedProperty; readonly isError: ComputedProperty; readonly isFinished: ComputedProperty; readonly isRunning: ComputedProperty; readonly isSuccessful: ComputedProperty; readonly state: ComputedProperty; readonly value?: T; cancel(): void; catch(): RSVP.Promise; finally(): RSVP.Promise; then( onfulfilled?: ((value: T) => TResult1 | RSVP.Promise) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null ): RSVP.Promise; } export enum TaskState { Running = 'running', Queued = 'queued', Idle = 'idle' } type Task = TaskProperty & { perform: P; readonly isIdle: boolean; readonly isQueued: boolean; readonly isRunning: boolean; readonly last?: TaskInstance; readonly lastCanceled?: TaskInstance; readonly lastComplete?: TaskInstance; readonly lastErrored?: TaskInstance; readonly lastIncomplete?: TaskInstance; readonly lastPerformed?: TaskInstance; readonly lastRunning?: TaskInstance; readonly lastSuccessful?: TaskInstance; readonly performCount: number; readonly state: TaskState; cancelAll(): void; }; export function task(generatorFn: (a: A) => Iterator): Task TaskInstance>; export function task( generatorFn: (a1: A1, a2: A2) => Iterator ): Task TaskInstance>; export function task( generatorFn: (a1: A1, a2: A2, a3: A3) => Iterator ): Task TaskInstance>; export function task( generatorFn: (a1: A1, a2: A2, a3: A3, a4: A4) => Iterator ): Task TaskInstance>; export function task( generatorFn: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Iterator ): Task TaskInstance>; export function task( generatorFn: (a1: A1, a2: A2, a3: A3, a4: A4, a6: A6) => Iterator ): Task TaskInstance>; }