mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
add get job callback definition
https://github.com/Automattic/kue/blob/master/lib/queue/job.js#L161
This commit is contained in:
Vendored
+2
-1
@@ -58,6 +58,7 @@ interface Priorities {
|
||||
}
|
||||
|
||||
export type DoneCallback = (err?: any, result?: any) => void;
|
||||
export type JobCallback = (err?: any, job?: Job) => void;
|
||||
|
||||
export declare class Job extends events.EventEmitter {
|
||||
public id: number;
|
||||
@@ -73,7 +74,7 @@ export declare class Job extends events.EventEmitter {
|
||||
static priorities: Priorities;
|
||||
static disableSearch: boolean;
|
||||
static jobEvents: boolean;
|
||||
static get(id: number, fn: Function): void;
|
||||
static get(id: number, type: string | JobCallback, fn?: JobCallback): void;
|
||||
static remove(id: number, fn?: Function): void;
|
||||
static removeBadJob(id: number): void;
|
||||
static log(id: number, fn: Function): void;
|
||||
|
||||
@@ -39,6 +39,13 @@ function create() {
|
||||
|
||||
job.save();
|
||||
|
||||
kue.Job.get(job.id, function (err: any, _job: kue.Job) {
|
||||
console.log('get job', _job);
|
||||
});
|
||||
kue.Job.get(job.id, 'video conversion', function (err: any, _job: kue.Job) {
|
||||
console.log('get job', _job);
|
||||
});
|
||||
|
||||
setTimeout( create, Math.random() * 2000 | 0 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user