import cron from 'node-cron'; import { IRegister } from '../../../annotation'; import { ETaskService } from '../entity/ETaskService'; export declare abstract class ITaskRegister extends IRegister { configs: T[]; singletonConfigs: string[]; taskList: Map; serviceMap: Map; services: Map; protected scanService(): Promise; register(keys?: any[]): Promise; protected abstract registerTask(item: T): Promise; destroy(keys?: any[]): void; /** * 重载任务 * @param keys */ reload(keys?: any[]): Promise; /** * 获取所有调度任务配置 * * 重写该方法,实现动态获取任务配置 * 注意需要添加一个 `Id` 字段作为唯一标识 * 其他字段根据实际情况自行添加 * * 只要单例模式的可以重写返回空数组 return [] * * 基本:{`Id`: any, class: string, title: string, description: string, cron: string} */ protected abstract fetchConfigs(): Promise; }