import { Emitter } from "../../emitter";
import { type Environment, type Variable } from "../../env";
import { type Expr } from "../../expr";
import type { FunctionValue, FuncValueId } from "../../function-value";
import type { TargetInfo } from "../../target";
import type { DynType, EnumType, FunctionType, IsoType, StructType, Type, TypeField, TypeId } from "../../types/definitions";
import { type TraitValue } from "../../value";
export interface CodeGenContext {
    types: Record<TypeId, {
        type: Type;
        cName: string;
    }>;
    functions: Record<FuncValueId, {
        value: FunctionValue;
        cName: string;
        effectStateMachineInfo?: unknown;
    }>;
    externFunctions: Record<TypeId, {
        type: FunctionType;
        cName: string;
        cInclude?: string;
    }>;
    arrayStructTypes: Map<string, {
        childType: string;
        length: number;
    }>;
    isoTypes?: Map<string, {
        childTypeCName: string;
        isoType: IsoType;
        optionTypeCName?: string;
        structGenerated?: boolean;
        createGenerated?: boolean;
        extractGenerated?: boolean;
        disposeGenerated?: boolean;
    }>;
    spawnedFunctionSignatures: Map<string, {
        parameterTypes: Type[];
        returnType: Type;
    }>;
    spawnedClosureSignatures: Map<string, {
        closureType: Type;
    }>;
    tempVarAsyncStructNames?: Map<string, string>;
    closureCaptureMap: Map<string, {
        closureType: FunctionType;
        closureCName: string;
        captureType: StructType;
        captureCName: string;
    }>;
    implClosureCallMap: Map<TypeId, {
        functionCName: string;
        callTypeId: TypeId;
        callType?: FunctionType;
        consumedCaptures?: string[];
    }>;
    currentFunctionName: string;
    cIncludes: Set<string>;
    emitter: Emitter;
    debugGc: boolean;
    debugParallelism: boolean;
    debugAsyncAwait: boolean;
    targetInfo: TargetInfo;
    allocator: "mimalloc" | "libc";
    dynImpls: Map<string, {
        dynType: DynType;
        concreteType: Type;
        dataType: Type;
        traitValues: TraitValue[];
    }>;
    currentLoopLabel?: string;
    currentContinueLabel?: string;
    insideMatch?: boolean;
    typeIdStatics?: Map<string, string>;
    needsCycleGC?: boolean;
    disposeTypeIds?: Map<string, number>;
    nextDisposeTypeId?: number;
    isLibrary?: boolean;
    needsIntelAsmSyntax?: boolean;
    moduleLevelInitExprs?: Expr[];
    currentModuleId?: string;
    exportedFunctionLabels?: Map<FuncValueId, string>;
}
export declare function isComptimeOnlyStructField(field: TypeField, _ownerType: StructType): boolean;
export declare function getRuntimeStructFields(structType: StructType): TypeField[];
export declare function sanitizeForCIdentifier(str: string, isExternC?: boolean): string;
export declare function shouldAvoidConst(type: Type): boolean;
export declare function getTypeString(type: Type | undefined, context: CodeGenContext): string;
export declare function getVariableTypeString(type: Type, varName: string, context: CodeGenContext): string;
export declare function getEnumVariantCName(enumType: EnumType, variantName: string, context: CodeGenContext): string;
export declare function isComptimeFunction(functionValue: FunctionValue): boolean;
export declare function isFunctionValueWithOnlyBuiltinYoInlineFunctionCall(functionValue: FunctionValue): string | null;
export declare function canOptimizeAsNullablePointer(enumType: EnumType): Type | null;
export declare function canOptimizeAsSimpleEnum(enumType: EnumType): boolean;
export declare function getVariableNameForCodegen(variableName: string, env: Environment | undefined): string;
export declare function getDeferredDupTargetAtomName(dupExpr: Expr): string | undefined;
export declare function getDeferredDropTargetAtomName(dropExpr: Expr): string | undefined;
export declare function getDeferredDropTargetVariable(dropExpr: Expr): Variable | undefined;
export declare function isDeferredDropForClosureCapture(dropExpr: Expr, currentClosureCaptures: readonly string[] | undefined): boolean;
export declare function findReturnedAsyncBlock(expr: Expr | undefined): Expr | undefined;
