import { MappedConverterChains } from "@odata2ts/converter-runtime";
import type { DigestionOptions } from "../FactoryFunctionModel.js";
import { PropertyGenerationOptions } from "../OptionModel.js";
import { DataModel } from "./DataModel.js";
import { ODataVersion, PropertyModel } from "./DataTypeModel.js";
import { ComplexType, EntityType, Property, Schema } from "./edmx/ODataEdmxModelBase.js";
import { SchemaV3 } from "./edmx/ODataEdmxModelV3.js";
import { SchemaV4 } from "./edmx/ODataEdmxModelV4.js";
import { NamingHelper } from "./NamingHelper.js";
import { ServiceConfigHelper } from "./ServiceConfigHelper.js";
import { NameValidator } from "./validation/NameValidator.js";
export interface TypeModel {
    outputType: string;
    qPath: string;
    qCollection: string;
    qParam: string | undefined;
}
export declare abstract class Digester<S extends Schema<ET, CT>, ET extends EntityType, CT extends ComplexType> {
    protected version: ODataVersion;
    protected schemas: Array<S>;
    protected options: DigestionOptions;
    protected namingHelper: NamingHelper;
    protected static EDM_PREFIX: string;
    protected readonly dataModel: DataModel;
    protected readonly serviceConfigHelper: ServiceConfigHelper;
    protected readonly nameValidator: NameValidator;
    /**
     * Reverse mapping from fqName to data type: EntityType, ComplexType, EnumType, or Primitive Type.
     */
    private model2Type;
    protected constructor(version: ODataVersion, schemas: Array<S>, options: DigestionOptions, namingHelper: NamingHelper, converters?: MappedConverterChains);
    private collectModelTypes;
    private addModel2Type;
    protected abstract getNavigationProps(entityType: ET | ComplexType): Array<Property>;
    protected abstract digestOperations(schema: SchemaV3 | SchemaV4): void;
    protected abstract digestEntityContainer(schema: SchemaV3 | SchemaV4): void;
    /**
     * Get essential infos about a given odata type from the version specific service variants.
     *
     * @param type
     * @return tuple of return type, query object, query collection object
     */
    protected abstract mapODataType(type: string): TypeModel;
    digest(): Promise<DataModel>;
    private digestEntityTypesAndOperations;
    private getBaseModel;
    private addTypeDefinition;
    private addEnum;
    private addComplexType;
    private addEntityType;
    /**
     * Check that models (ComplexType or EntityType) have been referenced in the API
     * as entry point or via navProp or by virtue of being a base type or subtype of those.
     * For these models one or two services are generated.
     *
     * In this way unnecessary service generation is prevented. For example, complex types that
     * are only referenced as response of an operation do not need a generated service.
     *
     * @param ec
     * @private
     */
    private analyzeModelUsage;
    /**
     * Check usage of model types within API.
     *
     * @param fqModelName
     * @private
     */
    private analyze;
    private postProcessModel;
    private postProcessKeys;
    private collectBaseClassPropsAndKeys;
    protected mapProp: (p: Property, entityPropConfig?: PropertyGenerationOptions | undefined) => PropertyModel;
    private addSubtypes;
}
