/
interfaces.ts
56 lines (47 loc) · 1.49 KB
/
interfaces.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
import { DataEntity } from '@terascope/utils';
import {
Context,
ExecutionConfig,
Slice,
SliceAnalyticsData,
SlicerOperationLifeCycle,
WorkerOperationLifeCycle,
OpAPI,
} from '../interfaces';
import { APICore, OperationAPIType } from '../operations';
export interface ExecutionContextConfig {
context: Context;
executionConfig: ExecutionConfig;
terasliceOpPath?: string;
assetIds?: string[];
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SlicerOperations extends Set<SlicerOperationLifeCycle> {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface WorkerOperations extends Set<WorkerOperationLifeCycle> {}
/** event handlers that should be cleaned up */
export interface EventHandlers {
[eventName: string]: (...args: any[]) => void;
}
export interface JobAPIInstance {
instance: APICore;
opAPI?: OpAPI;
type: OperationAPIType;
}
export interface JobAPIInstances {
[name: string]: JobAPIInstance;
}
export type WorkerStatus = 'initializing' | 'idle' | 'flushing' | 'running' | 'shutdown';
export type SliceStatus = 'starting' | 'started' | 'completed' | 'failed' | 'flushed';
export interface RunSliceResult {
status: SliceStatus;
analytics?: SliceAnalyticsData;
results: DataEntity[];
}
export type WorkerSliceState = {
status: SliceStatus;
/** The current operation position */
position: number;
slice: Slice;
analytics?: SliceAnalyticsData;
};