import SeriesModel from '../model/Series.js'; import { Pipeline } from './Scheduler.js'; import { Payload } from '../util/types.js'; import SeriesData from '../data/SeriesData.js'; export interface TaskContext { outputData?: SeriesData; data?: SeriesData; payload?: Payload; model?: SeriesModel; } export declare type TaskResetCallback = (this: Task, context: Ctx) => TaskResetCallbackReturn; export declare type TaskResetCallbackReturn = void | (TaskProgressCallback | TaskProgressCallback[]) | { forceFirstProgress?: boolean; progress: TaskProgressCallback | TaskProgressCallback[]; }; export declare type TaskProgressCallback = (this: Task, params: TaskProgressParams, context: Ctx) => void; export declare type TaskProgressParams = { start: number; end: number; count: number; next?: TaskDataIteratorNext; }; export declare type TaskPlanCallback = (this: Task, context: Ctx) => TaskPlanCallbackReturn; export declare type TaskPlanCallbackReturn = 'reset' | false | null | undefined; export declare type TaskCountCallback = (this: Task, context: Ctx) => number; export declare type TaskOnDirtyCallback = (this: Task, context: Ctx) => void; declare type TaskDataIteratorNext = () => number; declare type TaskDefineParam = { reset?: TaskResetCallback; plan?: TaskPlanCallback; count?: TaskCountCallback; onDirty?: TaskOnDirtyCallback; }; export declare type PerformArgs = { step?: number; skip?: boolean; modBy?: number; modDataCount?: number; }; /** * @param {Object} define * @return See the return of `createTask`. */ export declare function createTask(define: TaskDefineParam): Task; export declare class Task { private _reset; private _plan; private _count; private _onDirty; private _progress; private _callingProgress; private _dirty; private _modBy; private _modDataCount; private _upstream; private _downstream; private _dueEnd; private _outputDueEnd; private _settedOutputEnd; private _dueIndex; private _disposed; __pipeline: Pipeline; __idxInPipeline: number; __block: boolean; context: Ctx; constructor(define: TaskDefineParam); /** * @param step Specified step. * @param skip Skip customer perform call. * @param modBy Sampling window size. * @param modDataCount Sampling count. * @return whether unfinished. */ perform(performArgs?: PerformArgs): boolean; dirty(): void; private _doProgress; private _doReset; unfinished(): boolean; /** * @param downTask The downstream task. * @return The downstream task. */ pipe(downTask: Task): void; dispose(): void; getUpstream(): Task; getDownstream(): Task; setOutputEnd(end: number): void; } export {};