/** * Instanceof and nullable guard emission cases for if-statements. * Handles instanceof, negated-instanceof, and nullable guards. */ 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; /** * Case A2: if (x instanceof Foo) { ... } * C# pattern var narrowing -> if (x is Foo x__is_k) { ... } */ export declare const tryEmitInstanceofGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; /** * Case B2: if (!(x instanceof Foo)) { ... } else { ... } * Swap branches so ELSE runs under the narrowed pattern var. */ export declare const tryEmitNegatedInstanceofGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; /** * Case D: Nullable value type narrowing. * if (id !== null) { ... } -> id becomes id.Value in then-branch. */ export declare const tryEmitNullableGuard: (stmt: IfStatement, context: EmitterContext) => GuardResult; export {}; //# sourceMappingURL=if-emit-instanceof-guards.d.ts.map