import { AbstractDynamicSnippetsGeneratorContext, FernGeneratorExec, Options, AbstractDynamicSnippetsGenerator, AbstractAstNode } from '@fern-api/browser-compatible-base-generator';
import { FernIr } from '@fern-api/dynamic-ir-sdk';
import { WithGeneration, ast, Generation } from '@fern-api/csharp-codegen';

interface Config {
    fullStyleClassName?: string;
}

declare namespace DynamicLiteralMapper {
    interface Args {
        typeReference: FernIr.dynamic.TypeReference;
        value: unknown;
        as?: ConvertedAs;
        fallbackToDefault?: string;
    }
    type ConvertedAs = "key";
}
declare class DynamicLiteralMapper extends WithGeneration {
    private context;
    constructor({ context }: {
        context: DynamicSnippetsGeneratorContext;
    });
    convert(args: DynamicLiteralMapper.Args): ast.Literal;
    private convertList;
    private convertLiteral;
    private convertSet;
    private convertMap;
    private convertNamed;
    private convertDiscriminatedUnion;
    private getBaseProperties;
    private instantiateUnionWithBaseProperties;
    private getEnumValue;
    private convertObject;
    private convertUndiscriminatedUnion;
    private findMatchingUndiscriminatedUnionType;
    private convertUnknown;
    private convertPrimitive;
    private getValueAsNumber;
    private getValueAsBoolean;
}

declare namespace DynamicTypeMapper {
    interface Args {
        typeReference: FernIr.dynamic.TypeReference;
        unboxOptionals?: boolean;
    }
}
declare class DynamicTypeMapper extends WithGeneration {
    private context;
    constructor({ context }: {
        context: DynamicSnippetsGeneratorContext;
    });
    convert(args: DynamicTypeMapper.Args): ast.Type;
    convertToClassReference(named: FernIr.dynamic.NamedType): ast.ClassReference;
    private convertNamed;
    private convertLiteral;
    private convertUnknown;
    private convertPrimitive;
}

interface FilePropertyInfo {
    fileFields: ast.ConstructorField[];
    bodyPropertyFields: ast.ConstructorField[];
}
declare class FilePropertyMapper extends WithGeneration {
    private context;
    constructor({ context }: {
        context: DynamicSnippetsGeneratorContext;
    });
    getFilePropertyInfo({ body, value }: {
        body: FernIr.dynamic.FileUploadRequestBody;
        value: unknown;
    }): FilePropertyInfo;
    private getSingleFileProperty;
    private getArrayFileProperty;
    private getBodyProperty;
}

declare class DynamicSnippetsGeneratorContext extends AbstractDynamicSnippetsGeneratorContext {
    ir: FernIr.dynamic.DynamicIntermediateRepresentation;
    dynamicTypeMapper: DynamicTypeMapper;
    dynamicLiteralMapper: DynamicLiteralMapper;
    filePropertyMapper: FilePropertyMapper;
    readonly generation: Generation;
    get namespaces(): Generation["namespaces"];
    get registry(): Generation["registry"];
    get settings(): Generation["settings"];
    get constants(): Generation["constants"];
    get names(): Generation["names"];
    get model(): Generation["model"];
    get format(): Generation["format"];
    get csharp(): Generation["csharp"];
    get Types(): Generation["Types"];
    get System(): Generation["extern"]["System"];
    get NUnit(): Generation["extern"]["NUnit"];
    get OneOf(): Generation["extern"]["OneOf"];
    get Google(): Generation["extern"]["Google"];
    get WireMock(): Generation["extern"]["WireMock"];
    get Primitive(): Generation["Primitive"];
    get Value(): Generation["Value"];
    get Collection(): Generation["Collection"];
    constructor({ ir, config, options, generation }: {
        ir: FernIr.dynamic.DynamicIntermediateRepresentation;
        config: FernGeneratorExec.GeneratorConfig;
        options?: Options;
        generation?: Generation;
    });
    clone(): DynamicSnippetsGeneratorContext;
    getFileParameterForString(str: string): ast.Literal;
    getMemoryStreamForString(str: string): ast.ClassInstantiation;
    getClassName(name: FernIr.Name): string;
    getParameterName(name: FernIr.Name): string;
    getPropertyName(name: FernIr.Name): string;
    getMethodName(name: FernIr.Name): string;
    getNamespace(fernFilepath: FernIr.dynamic.FernFilepath, suffix?: string): string;
    getEnvironmentTypeReferenceFromID(environmentID: string): ast.ClassReference | undefined;
    private getEnvironmentClassReferenceForEnumName;
    private getNamespaceSegments;
    precalculate(requests: Partial<FernIr.dynamic.EndpointSnippetRequest>[]): void;
}

declare class EndpointSnippetGenerator extends WithGeneration {
    private context;
    constructor({ context }: {
        context: DynamicSnippetsGeneratorContext;
    });
    generateSnippet({ endpoint, request, options }: {
        endpoint: FernIr.dynamic.Endpoint;
        request: FernIr.dynamic.EndpointSnippetRequest;
        options: Options;
    }): Promise<string>;
    generateSnippetSync({ endpoint, request, options }: {
        endpoint: FernIr.dynamic.Endpoint;
        request: FernIr.dynamic.EndpointSnippetRequest;
        options: Options;
    }): string;
    generateSnippetAst({ endpoint, request, options }: {
        endpoint: FernIr.dynamic.Endpoint;
        request: FernIr.dynamic.EndpointSnippetRequest;
        options?: Options;
    }): Promise<ast.AstNode>;
    private buildCodeBlock;
    private buildFullCodeBlock;
    private constructClient;
    private callMethod;
    private getConstructorArgs;
    private getConstructorBaseUrlArgs;
    private getBaseUrlArg;
    private getConstructorAuthArgs;
    private addError;
    private addWarning;
    private getConstructorBasicAuthArg;
    private getConstructorBearerAuthArgs;
    private getConstructorHeaderAuthArgs;
    private getConstructorOAuthArgs;
    private getConstructorInferredAuthArgs;
    private getConstructorHeaderArgs;
    private getConstructorHeaderArg;
    private getMethodArgs;
    private getMethodArgsForInlinedRequest;
    private getFilePropertyInfo;
    private getInlinedRequestArg;
    private getInlinedRequestBodyConstructorFields;
    private getInlinedRequestBodyPropertyConstructorFields;
    private getFileUploadRequestBodyConstructorFields;
    private getReferencedRequestBodyPropertyConstructorField;
    private getReferencedRequestBodyPropertyLiteral;
    private getMethodArgsForBodyRequest;
    private getBodyRequestArg;
    private getBytesBodyRequestArg;
    private getRootClientConstructorInvocation;
    private getPathParameters;
    private getMethod;
    private getBaseUrlOptionName;
    private getStyle;
    private getConfig;
}

declare class DynamicSnippetsGenerator extends AbstractDynamicSnippetsGenerator<DynamicSnippetsGeneratorContext, EndpointSnippetGenerator> {
    constructor({ ir, config, options }: {
        ir: FernIr.dynamic.DynamicIntermediateRepresentation;
        config: FernGeneratorExec.GeneratorConfig;
        options?: Options;
    });
    precalculate(requests: FernIr.dynamic.EndpointSnippetRequest[]): void;
    generate(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): Promise<FernIr.dynamic.EndpointSnippetResponse>;
    generateSync(request: FernIr.dynamic.EndpointSnippetRequest, options?: Options): FernIr.dynamic.EndpointSnippetResponse;
    generateSnippetAst(request: FernIr.dynamic.EndpointSnippetRequest): Promise<AbstractAstNode>;
    protected createSnippetGenerator(context: DynamicSnippetsGeneratorContext): EndpointSnippetGenerator;
}

export { type Config, DynamicSnippetsGenerator };
