UNPKG

923 BTypeScriptView Raw
1import { EventEmitter } from 'events';
2
3import { Bulk, BulkOptions } from './bulk';
4import { Batch, BatchInfo } from './batch';
5
6export interface JobInfo {
7 id: string;
8 object: string;
9 operation: string;
10 state: string;
11}
12
13export 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}