import { IContext } from '../interfaces'; import { IMetadata } from '../interfaces/IMetadata'; import { IDelegatedParameters } from '../interfaces/IDelegatedParameters'; export declare class ActionSnapshot { source: string; idOrAlias: string; metadata: IMetadata; wd: string; idx: number; parameters: IDelegatedParameters; previousContextState: IContext; createdAt: Date; completedAt: Date; steps: IActionStep[]; successful: boolean; errorCode: any; childFailure: boolean; ignoreChildFailure: boolean; duration: number; constructor(source: string, idOrAlias: string, metadata: IMetadata, wd: string, idx: number, parameters: IDelegatedParameters); /** * Get human readable duration * @return {string} */ getHumanReadableDuration(): string; /** * Register log message * @param {string} message * @param {boolean} [error] indicated that log message is error * @param {boolean} [silent] if provided LogService will not be invoked */ log(message: string, error?: boolean, silent?: boolean): void; /** * Set ID of the action handler * @param {string} id */ setActionHandlerId(id: string): void; /** * Record start of the processing */ start(): void; /** * Record when validation passed */ validated(): void; /** * Record successful execution state */ success(): void; /** * Record when skipped execution */ skipped(): void; /** * Record when execution failed with error * @param error */ failure(error: any): void; /** * Register child ActionSnapshot * @param {ActionSnapshot} snapshot */ registerChildActionSnapshot(snapshot: ActionSnapshot): void; /** * Get all the recorded steps * @return {IActionStep[]} */ getSteps(): IActionStep[]; /** * Set initial context state before applying any actions * @param {IContext} context */ setInitialContextState(context: IContext): void; /** * Register step. Use this method only when other methods do not suite your needs. * @param {string} type * @param payload */ registerStep(type: string, payload?: any): void; /** * Register context * @param context */ setContext(context: IContext): void; /** * Register options * @param options */ setOptions(options: any): void; } export declare class EnabledActionSnapshot extends ActionSnapshot { constructor(source: string, idOrAlias: string, metadata: IMetadata, wd: string, idx: number, parameters: IDelegatedParameters); /** * @inheritdoc */ setInitialContextState(context: IContext): void; /** * Register context * @inheritdoc */ setContext(context: IContext): void; /** * @inheritdoc */ setOptions(options: any): void; /** * @inheritdoc */ registerStep(type: string, payload?: any): void; } export interface IActionStep { type: string; createdAt: Date; payload?: any; }