import * as bull from '@midwayjs/bull';
import { ILogger } from '@midwayjs/core';
import { Job, JobOptions } from 'bull';
import { Resource } from '../entity';
import { MagicResourceService } from './core';
import { MagicDefinition } from './magic.provide';
export declare class MagicAsyncTask implements MagicDefinition {
    type: string;
    bullFramework: bull.Framework;
    magicResourceService: MagicResourceService;
    logger: ILogger;
    bullConfig: any;
    private idInMappingPath;
    init(reInit?: boolean): Promise<void>;
    /**
     * 添加异步任务
     * @param resource
     */
    add(resource: Resource): Promise<void>;
    /**
     * 删除异步任务
     * @param id
     */
    removeById(id: string): Promise<void>;
    /**
     * 执行任务
     * @param mappingPath 路径
     * @param data 执行参数
     * @param options 任务选项
     */
    execute(mappingPath: string, data?: Record<string, any>, options?: JobOptions): Promise<Job>;
    /**
     * 停止任务
     * @param mappingPath 路径
     * @param jobId 任务id
     */
    removeTask(mappingPath: string, jobId: string): Promise<void>;
    /**
     * 获取任务
     * @param mappingPath 路径
     * @param id 任务id
     */
    getTask(mappingPath: string, id: string): Promise<Job | undefined>;
}
