import type { IDataObject, IRun, IRunExecutionData, ITaskData, ITaskStartedData, IWorkflowBase, Workflow } from 'n8n-workflow'; import type { Class } from '../types'; export type LifecycleHandlerClass = Class Promise | void>>; export type NodeExecuteBeforeContext = { type: 'nodeExecuteBefore'; workflow: IWorkflowBase; nodeName: string; taskData: ITaskStartedData; executionId: string; }; export type NodeExecuteAfterContext = { type: 'nodeExecuteAfter'; workflow: IWorkflowBase; nodeName: string; taskData: ITaskData; executionData: IRunExecutionData; executionId: string; }; export type WorkflowExecuteBeforeContext = { type: 'workflowExecuteBefore'; workflow: IWorkflowBase; workflowInstance: Workflow; executionData?: IRunExecutionData; executionId: string; }; export type WorkflowExecuteAfterContext = { type: 'workflowExecuteAfter'; workflow: IWorkflowBase; runData: IRun; newStaticData: IDataObject; executionId: string; retryOf?: string; }; export type WorkflowExecuteResumeContext = { type: 'workflowExecuteResume'; workflow: IWorkflowBase; workflowInstance: Workflow; executionData: IRunExecutionData; executionId: string; }; export type LifecycleContext = NodeExecuteBeforeContext | NodeExecuteAfterContext | WorkflowExecuteBeforeContext | WorkflowExecuteAfterContext | WorkflowExecuteResumeContext; type LifecycleHandler = { handlerClass: LifecycleHandlerClass; methodName: string; eventName: LifecycleEvent; }; export type LifecycleEvent = LifecycleContext['type']; export declare class LifecycleMetadata { private readonly handlers; register(handler: LifecycleHandler): void; getHandlers(): LifecycleHandler[]; } export {};