import type { Redis, Cluster } from 'ioredis'; import type { JobStatus, JobStatusClean, QueueJobsCounts as JobCounts } from './typings/gql'; import { QueueProvider } from './typings/gql'; import type { Maybe } from './typings/utils'; export type { JobStatus, JobStatusClean, JobCounts }; export { QueueProvider }; export declare type RedisClient = Redis | Cluster; export declare type JobId = string; export declare type JobOptions = any; export declare type GlobalJobCompletionCb = (jobId: JobId) => void; export interface JobLogs { logs: string[]; count: number; } export declare type QueueConfig = { readonly?: boolean; }; export declare abstract class Job { abstract get queue(): Queue; abstract get id(): JobId; abstract get name(): string; abstract get data(): any; abstract get returnvalue(): unknown; abstract get progress(): string; abstract get attemptsMade(): number; abstract get failedReason(): Maybe; abstract get stacktrace(): string[]; abstract get opts(): any; abstract get processedOn(): Maybe; abstract get finishedOn(): Maybe; abstract get timestamp(): Maybe; abstract get rawJob(): any; abstract getState(): Promise; abstract moveToCompleted(returnValue?: unknown): Promise; abstract moveToFailed(reason: unknown): Promise; abstract promote(): Promise; abstract discard(): Promise; abstract update(data: any): Promise; abstract retry(): Promise; abstract remove(): Promise; abstract log(row: string): Promise; } export declare abstract class Queue { protected _config?: QueueConfig | undefined; constructor(_queue: any, _config?: QueueConfig | undefined); get readonly(): boolean; abstract get provider(): QueueProvider; abstract get client(): Promise; abstract get id(): string; abstract get name(): string; abstract get token(): string; abstract set onGlobalJobCompletion(callback: GlobalJobCompletionCb | null); abstract toKey(queueType: string): string; abstract count(): Promise; abstract add(name: string, data: any, opts?: any): Promise; abstract pause(isLocal?: boolean, doNotWaitActive?: boolean): Promise; abstract resume(isLocal?: boolean): Promise; abstract clean(grace: number, status?: JobStatusClean, limit?: number): Promise; abstract empty(): Promise; abstract isPaused(): Promise; abstract getJob(id: JobId): Promise>; abstract jobFromJSON(json: any, jobId: JobId): Job; abstract getJobs(types: JobStatus | JobStatus[], start?: number, end?: number, asc?: boolean): Promise; abstract getJobCounts(): Promise; abstract getActiveCount(): Promise; abstract getCompletedCount(): Promise; abstract getFailedCount(): Promise; abstract getDelayedCount(): Promise; abstract getWaitingCount(): Promise; abstract getPausedCount(): Promise; abstract removeJobs(pattern: string): Promise; abstract getJobLogs(jobId: JobId): Promise; abstract close(doNotWaitJobs?: boolean): Promise; }