import { Block } from '../core/index.ts'; import type { BlockOutput, IBaseBlockConfig, IRunContext } from '../types/index.ts'; /** * @public * * Configuration object for an assertion block */ export interface IAssertionConfig extends IBaseBlockConfig { /** * When this block is executed by an automation it should return a boolean * either as the direct return value, or as the 'result' property on an object. * * If that value is false, it will indicate to the execution engine that the automation * should finish */ readonly predicate: (context: IRunContext) => Promise | boolean | { result: boolean; output: TOutput; } | Promise<{ result: boolean; output: TOutput; }>; } export declare class Assertion extends Block { config: IAssertionConfig; constructor(config: IAssertionConfig); readonly name: string; type: string; run(context: IRunContext): Promise>; } /** * @public * * An assertion is a block which can decide whether or not * an automation should continue based on the result of a predicate */ export declare const assertion: (config: IAssertionConfig) => Block; //# sourceMappingURL=assertion.d.ts.map