/** * Nullish stripping, value-type classification, array-like element extraction, * and type-alias resolution. Foundational leaf utilities consumed by all other * type-resolution sub-modules. * * Type-argument substitution lives in: * - type-substitution.ts */ import type { IrType } from "@tsonic/frontend"; import { type EmitterContext } from "../../types.js"; export declare const stripNullish: (type: IrType) => IrType; export declare const isRuntimeNullishMember: (type: IrType) => boolean; /** * Runtime-absence members in TypeScript unions. * * `void` is a type-level way of saying "the runtime value is undefined". * For C# emission we must treat `void` exactly like `undefined` / `null` * when deciding whether a union can be represented as a nullable type. */ export declare const isRuntimeNullishType: (type: IrType) => boolean; /** * Split a union into runtime-nullish members and non-nullish members. * * Returns `undefined` for non-union types. */ export declare const splitRuntimeNullishUnionMembers: (type: IrType) => { readonly hasRuntimeNullish: boolean; readonly nonNullishMembers: readonly IrType[]; } | undefined; /** * Check if a type is definitely a C# value type. * * Value types require `default` instead of `null` in object initializers * because `null` cannot be assigned to non-nullable value types. * * @param type - The type to check (should be non-nullish, use stripNullish first) * @returns true if the type is a known value type */ export declare const isDefinitelyValueType: (type: IrType) => boolean; /** * Resolve the element type of an array-like IR type after alias/nullish expansion. * * This is used by emission paths that need the element contract of rest parameters * or contextual array expressions even when the surface type is spelled through * local aliases or ReadonlyArray-style wrappers. */ export declare const getArrayLikeElementType: (type: IrType | undefined, context: EmitterContext) => IrType | undefined; export declare const resolveArrayLikeReceiverType: (type: IrType | undefined, context: EmitterContext) => Extract | undefined; /** * Resolve a type alias to its underlying type. * * If the type is a reference type that points to a type alias, * returns the underlying type with type arguments substituted. * * @param type - The type to resolve * @param context - Emitter context with localTypes map * @returns The resolved underlying type, or the original type if not an alias */ export declare const resolveTypeAlias: (type: IrType, context: EmitterContext, options?: { readonly preserveObjectTypeAliases?: boolean; }) => IrType; //# sourceMappingURL=nullish-value-helpers.d.ts.map