@sidequest/core
Version:
@sidequest/core is the core package of SideQuest, a distributed background job queue for Node.js and TypeScript applications.
26 lines (23 loc) • 741 B
TypeScript
import { JobData } from '../schema/job-data.js';
/**
* Configuration for a uniqueness strategy.
*/
interface UniquenessConfig {
/** The type of uniqueness strategy. */
type: string;
}
/**
* Interface for uniqueness strategies.
* @template Config The configuration type for the uniqueness strategy.
*/
interface Uniqueness<Config = UniquenessConfig> {
/** The configuration for the uniqueness strategy. */
config: Config;
/**
* Computes a digest (hash) for the given job data, or null if not applicable.
* @param jobData The job data to compute the digest for.
* @returns The digest string or null.
*/
digest(jobData: JobData): string | null;
}
export type { Uniqueness, UniquenessConfig };