import { TaskProperty as GenericTaskProperty, TaskGroupProperty as GenericTaskGroupProperty } from 'ember-concurrency'; export { default as lastValue } from './last-value'; declare type TaskProperty = GenericTaskProperty; declare type TaskGroupProperty = GenericTaskGroupProperty; declare type OptionsFor = { [K in OptionKeysFor]?: OptionTypeFor; }; declare type OptionKeysFor = { [K in keyof T]: OptionKeyFor; }[keyof T]; declare type OptionKeyFor = F extends (...args: any[]) => T ? K : never; declare type OptionTypeFor = F extends (...args: infer Args) => T ? Args[0] extends undefined ? true : Args[0] : never; declare type MethodOrPropertyDecoratorWithParams = MethodDecorator & PropertyDecorator & ((...params: Params) => MethodDecorator & PropertyDecorator); /** * Turns the decorated generator function into a task. * * Optionally takes a hash of options that will be applied as modifiers to the * task. For instance `maxConcurrency`, `on`, `group` or `keepLatest`. * * ```js * import EmberObject from '@ember/object'; * import { task } from 'ember-concurrency-decorators'; * * class extends EmberObject { * @task * *plainTask() {} * * @task({ maxConcurrency: 5, keepLatest: true, cancelOn: 'click' }) * *taskWithModifiers() {} * } * ``` * * @function * @param {object?} [options={}] * @return {TaskProperty} */ export declare const task: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated generator function into a task and applies the * `restartable` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task. * * @function * @param {object?} [options={}] * @return {TaskProperty} */ export declare const restartableTask: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated generator function into a task and applies the * `drop` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task. * * @function * @param {object?} [options={}] * @return {TaskProperty} */ export declare const dropTask: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated generator function into a task and applies the * `keepLatest` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task. * * @function * @param {object?} [options={}] * @return {TaskProperty} */ export declare const keepLatestTask: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated generator function into a task and applies the * `enqueue` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task. * * @function * @param {object?} [options={}] * @return {TaskProperty} */ export declare const enqueueTask: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated property into a task group. * * Optionally takes a hash of options that will be applied as modifiers to the * task group. For instance `maxConcurrency` or `keepLatest`. * * ```js * import EmberObject from '@ember/object'; * import { task taskGroup } from 'ember-concurrency-decorators'; * * class extends EmberObject { * @taskGroup({ maxConcurrency: 5 }) someTaskGroup; * * @task({ group: 'someTaskGroup' }) * *someTask() {} * * @task({ group: 'someTaskGroup' }) * *anotherTask() {} * } * ``` * * @function * @param {object?} [options={}] * @return {TaskGroupProperty} */ export declare const taskGroup: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated property into a task group and applies the * `restartable` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task group. * * @function * @param {object?} [options={}] * @return {TaskGroupProperty} */ export declare const restartableTaskGroup: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated property into a task group and applies the * `drop` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task group. * * @function * @param {object?} [options={}] * @return {TaskGroupProperty} */ export declare const dropTaskGroup: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated property into a task group and applies the * `keepLatest` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task group. * * @function * @param {object?} [options={}] * @return {TaskGroupProperty} */ export declare const keepLatestTaskGroup: MethodOrPropertyDecoratorWithParams<[OptionsFor]>; /** * Turns the decorated property into a task group and applies the * `enqueue` modifier. * * Optionally takes a hash of further options that will be applied as modifiers * to the task group. * * @function * @param {object?} [options={}] * @return {TaskGroupProperty} */ export declare const enqueueTaskGroup: MethodOrPropertyDecoratorWithParams<[OptionsFor]>;