-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
57 lines (42 loc) · 1.08 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import * as Bull from 'bull';
import { Application, Context } from 'egg';
import { ProcessPromiseFunction } from 'bull';
import { JobOptions } from 'bull';
export class BaseQueue extends Bull {
app: Application;
ctx: Context;
handle<T>(handle: ProcessPromiseFunction<T>, name: string, data: any, options?: JobOptions): any;
}
export function Completed();
export function Method();
export function GlobalCompleted();
export function Progress();
export function GlobalProgress();
export function AutoClean();
export function Process(options?: { name?: string; concurrency?: number });
interface ICleanOption {
type?: 'completed' | 'failed' | 'any',
period?: number;
}
export interface RedisConfig {
host?: string;
port?: number;
db?: number;
}
export interface BullConfig {
baseDir?: string;
redis?: RedisConfig;
}
declare module 'egg' {
interface IQueue extends PlainObject {}
interface EggAppConfig {
bull: BullConfig;
}
interface Application {
// definition: {
// [key: string]: BullDefinition;
// },
queue: IQueue;
Bull: Bull;
}
}