/** * Shared type-checking helpers for operator emitters */ import { IrExpression, IrType } from "@tsonic/frontend"; import type { EmitterContext } from "../../types.js"; /** * Check if an expression has proven Int32 type from the numeric proof pass. * Mirrors the same check in access.ts for consistency. */ export declare const hasInt32Proof: (expr: IrExpression) => boolean; /** * Get operator precedence for proper parenthesization */ export declare const getPrecedence: (operator: string) => number; /** * Check if an expression has char type (either from string indexer or a variable typed as char). * In C#, string[int] returns char, not string like in TypeScript. * The IR now correctly sets inferredType to char for string indexer access. */ export declare const isCharTyped: (expr: IrExpression) => boolean; export declare const isCharType: (type: IrType | undefined) => boolean; export declare const stripNullishFromType: (type: IrType | undefined) => IrType | undefined; export declare const isStringTyped: (expr: IrExpression) => boolean; /** * Check if an expression is a single-character string literal. * Returns the character if so, undefined otherwise. */ export declare const getSingleCharLiteral: (expr: IrExpression) => string | undefined; /** * Escape a character for use in a C# char literal. * Handles special characters like quotes, backslash, newline, etc. */ export declare const escapeCharLiteral: (char: string) => string; export declare const isNullishLiteral: (e: IrExpression) => boolean; type DictionaryComputedAccessExpression = Extract & { readonly isComputed: true; readonly property: IrExpression; }; export declare const getDictionaryComputedAccess: (expr: IrExpression, context: EmitterContext) => DictionaryComputedAccessExpression | undefined; /** * Check if an IR type is boolean */ export declare const isBooleanType: (type: IrExpression["inferredType"]) => boolean; export {}; //# sourceMappingURL=helpers.d.ts.map