@sidequest/core
Version:
@sidequest/core is the core package of SideQuest, a distributed background job queue for Node.js and TypeScript applications.
23 lines (20 loc) • 686 B
TypeScript
import { JobData } from '../schema/job-data.js';
/**
* Abstract base class for job state transitions.
*/
declare abstract class JobTransition {
/**
* Applies the transition to the given job.
* @param job The job data to update.
* @returns The updated job data.
*/
abstract apply(job: JobData): JobData;
/**
* Determines if the transition should be applied to the job.
* This can be used to check conditions like job state or other criteria.
* @param job The job data to check.
* @returns True if the transition should be applied, false otherwise.
*/
abstract shouldRun(job: JobData): boolean;
}
export { JobTransition };