import { DefinitionInfo } from "../../templates/schema/definition-info.js"; import { TemplateContext } from "../../templates/template-context.js"; import { BasicExpressionToken, TemplateToken } from "../../templates/tokens/index.js"; /** * Ensures a condition expression contains a status function call. * If the condition doesn't contain success(), failure(), cancelled(), or always(), * wraps it in `success() && (condition)`. * * Parses the expression to accurately detect status functions, avoiding false positives * from string literals or property access. If parsing fails (e.g., partially typed expression), * returns the original condition unchanged to allow validation to report the actual error. * * @param condition The condition expression to check * @param definitionInfo Schema definition containing allowed contexts for parsing * @returns The condition with status function guaranteed, or original on parse error */ export declare function ensureStatusFunction(condition: string, definitionInfo: DefinitionInfo | undefined): string; /** * Converts an if condition token to a BasicExpressionToken. * Treats the value as a string and parses it as an expression. * Wraps the condition in success() && (...) if it doesn't already contain a status function. * This allows both 'if: success()' and 'if: ${{ success() }}' to work correctly. * * Reads the allowed context directly from the schema definition attached to the token, * ensuring consistency with the schema. * * @param context The template context for error reporting * @param token The token containing the if condition * @returns A BasicExpressionToken with the processed condition, or undefined on error */ export declare function convertToIfCondition(context: TemplateContext, token: TemplateToken): BasicExpressionToken | undefined; /** * Validates a pre-if or post-if condition string. * Unlike step if conditions, pre-if and post-if are evaluated as-is by the runner * (they default to always() only when the field is missing entirely). * This function validates the expression and reports errors through the context. * * @param context The template context for error reporting * @param token The token containing the condition * @param condition The condition string to validate * @returns The validated condition string, or undefined on error */ export declare function validateRunsIfCondition(context: TemplateContext, token: TemplateToken, condition: string): string | undefined; //# sourceMappingURL=if-condition.d.ts.map