import { EventEmitter } from 'node:events'; import { Logger } from '@terascope/core-utils'; import { OperationLoader } from '../operation-loader/index.js'; import { ExecutionConfig, Context, OperationLifeCycle } from '../interfaces/index.js'; import { ExecutionContextConfig } from './interfaces.js'; import { ExecutionContextAPI } from './api.js'; /** * A base class for an Execution Context */ export default class BaseExecutionContext { readonly config: ExecutionConfig; readonly context: Context; readonly assetIds: string[]; readonly exId: string; readonly jobId: string; /** The terafoundation EventEmitter */ readonly events: EventEmitter; readonly logger: Logger; protected readonly _loader: OperationLoader; protected readonly _operations: Set; protected _methodRegistry: Map>; private readonly _handlers; constructor(config: ExecutionContextConfig, loggerName: string); /** * Called to initialize all of the registered operations */ initialize(initConfig?: unknown): Promise; /** * Called to cleanup all of the registered operations */ shutdown(): Promise; get api(): ExecutionContextAPI; /** * Returns a list of any registered Operation that has been * initialized. */ getOperations(): T[]; /** Add an operation to the lifecycle queue */ protected addOperation(op: T): void; /** Run an async method on the operation lifecycle */ protected _runMethodAsync(method: keyof T, ...args: any[]): Promise; /** Run an method */ protected _runMethod(method: keyof T, ...args: any[]): void; protected _resetMethodRegistry(): void; private _getMethodSet; } //# sourceMappingURL=base.d.ts.map