1 | import { EventEmitter } from 'events';
|
2 |
|
3 | import { Bulk, BulkOptions } from './bulk';
|
4 | import { Batch, BatchInfo } from './batch';
|
5 |
|
6 | export interface JobInfo {
|
7 | id: string;
|
8 | object: string;
|
9 | operation: string;
|
10 | state: string;
|
11 | }
|
12 |
|
13 | export class Job extends EventEmitter {
|
14 | constructor(bulk: Bulk, type?: string, operation?: string, options?: BulkOptions, jobId?: string);
|
15 |
|
16 | abort(callback?: (err: Error, jobInfo: JobInfo) => void): Promise<any>;
|
17 | batch(batchId: string): Batch;
|
18 | check(callback?: (err: Error, jobInfo: JobInfo) => void): Promise<JobInfo>;
|
19 | close(callback?: (err: Error, jobInfo: JobInfo) => void): Promise<JobInfo>;
|
20 | createBatch(): Batch;
|
21 | info(callback?: (err: Error, jobInfo: JobInfo) => void): Promise<JobInfo>;
|
22 | list(callback?: (err: Error, jobInfo: BatchInfo) => void): Promise<BatchInfo[]>;
|
23 | open(callback?: (err: Error, jobInfo: JobInfo) => void): Promise<JobInfo>;
|
24 | }
|