/** Property-truthiness, discriminant-equality, and negated-predicate union-narrowing guard emission. */ import { IrStatement } from "@tsonic/frontend"; import { EmitterContext } from "../../../types.js"; import type { CSharpStatementAst } from "../../../core/format/backend-ast/types.js"; type IfStatement = Extract; type GuardResult = [readonly CSharpStatementAst[], EmitterContext] | undefined; /** Try to emit a property-truthiness guard for `if (result.success) { ... }`. */ export declare const tryEmitPropertyTruthinessGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; /** Try to emit a property-existence guard for `"error" in result`. */ export declare const tryEmitPropertyExistenceGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; /** * Try to emit a discriminant-equality guard narrowing for * `if (shape.kind === "circle") { ... }`. * Returns undefined if the condition is not a matching discriminant-equality guard. */ export declare const tryEmitDiscriminantEqualityGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; /** * Try to emit a negated predicate guard narrowing for * `if (!isUser(account)) { ... }`. * Returns undefined if the condition is not a matching negated predicate call. */ export declare const tryEmitNegatedPredicateGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; export {}; //# sourceMappingURL=if-emit-property-discriminant-guards.d.ts.map