@eang/core
Version:
eang - model driven enterprise event processing
43 lines (42 loc) • 1.41 kB
TypeScript
import { EntityEvent, ICnx, IObj } from './entity.js';
import { ErrorEventInstanceObj, EventInstanceObj } from './objects.js';
import { Prettify } from './types.js';
export type IFunctionStartContext = Prettify<{
rootObjectId?: string;
entities?: (IObj | ICnx)[];
data?: Record<string, unknown>;
inIds?: string[];
outIds?: string[];
}>;
export declare class FunctionStartContext implements IFunctionStartContext {
rootObjectId?: string;
entities?: (IObj | ICnx)[];
data?: Record<string, unknown>;
inIds?: string[];
outIds?: string[];
functionInputMapping?: {
[key: string]: string[];
};
inEventInstances: EventInstanceObj[];
constructor(contextOpts: IFunctionStartContext);
/**
* Gets the root object that owns this context
* @returns The root object or undefined if not found
*/
getRootObject(): IObj | ICnx | undefined;
}
export interface IFunctionStopContext<T extends object = any> {
data?: T;
err?: Error;
entityEvents?: EntityEvent[];
events?: EventInstanceObj[];
errEvents?: ErrorEventInstanceObj[];
}
export declare class FunctionStopContext<T extends object = any> implements IFunctionStopContext<T> {
data?: T;
err?: Error;
entityEvents?: EntityEvent[];
events?: EventInstanceObj[];
errEvents?: ErrorEventInstanceObj[];
constructor(contextOpts: IFunctionStopContext<T>);
}