import * as Generator from '@postxl/generator';
import { ActionProvider, ActionProviderTypes, ScopeName, WithActions } from '../backend-actions';
import { WithBackend } from '../backend-core';
import { WithRepositories } from '../backend-repositories';
import { WithUpdates } from '../backend-update';
import { WithBase } from '../base';
import { WithDecoders } from '../decoders';
import { WithTypes } from '../types';
type ContextRequirements = WithDecoders<WithUpdates<WithActions<WithTypes<WithRepositories<WithBackend<WithBase<Generator.Context>>>>>>>;
export type ContextResult = WithBackendImport<ContextRequirements>;
export type WithBackendImport<Context> = Generator.ExtendContextAndModel<Context, {
    import: BackendImportContext;
}, {
    import: BackendImportModelContext;
}>;
export type ModelResult = Generator.InferModelContext<ContextResult>;
type ImportActions = {
    excel: ActionProviderTypes;
    excelSeed: ActionProviderTypes;
    data: ActionProviderTypes;
    dataSeed: ActionProviderTypes;
};
export type BackendImportContext = ActionProvider<ImportActions> & {
    actionScope: ScopeName;
    detectDelta: {
        /**
         * Function that detects the delta for all models.
         */
        allModels: Generator.ImportableFunction & {
            type: Generator.ImportableType;
            /**
             * Name of the type that for each model type maps newly provided Ids to the items/models
             */
            idMapType: Generator.ImportableType;
            /**
             * Function that returns a map of model with their errors
             */
            extractErrors: Generator.ImportableFunction;
            /**
             * Function that converts the extracted errors into a meaningful error message
             */
            summarizeErrors: Generator.ImportableFunction;
        };
        /** Shared functions, used by detectDelta model functions */
        _utils: {
            detectModelDelta: Generator.ImportableFunction;
            validation: {
                params: Generator.ImportableType;
                referenceField: Generator.ImportableFunction;
                requiredFields: Generator.ImportableFunction;
                requiredDependency: Generator.ImportableFunction;
                uniqueField: Generator.ImportableFunction;
                int: Generator.ImportableFunction;
            };
            getDelta: Generator.ImportableFunction;
            keepErrors: Generator.ImportableFunction;
        };
        types: {
            generic: {
                /**
                 * Generic type that represents the delta of a model.
                 */
                modelType: Generator.ImportableType;
                create: {
                    /**
                     * The type that represents the items of a model that should be created.
                     */
                    type: Generator.ImportableType;
                    /**
                     * The discriminant for the delta of a model that should be created.
                     */
                    discriminant: Generator.DiscriminantValue;
                    /**
                     * The type guard function that checks if a delta item is a create delta.
                     */
                    typeGuard: Generator.ImportableFunction;
                };
                update: {
                    /**
                     * The type that represents the delta of existing model items that should be updated.
                     */
                    type: Generator.ImportableType;
                    /**
                     * The discriminant for the delta of existing model items that should be updated.
                     */
                    discriminant: Generator.DiscriminantValue;
                    /**
                     * The type guard function that checks if a delta item is an update delta.
                     */
                    typeGuard: Generator.ImportableFunction;
                };
                delete: {
                    /**
                     * The type that represents the items of a model that should be deleted.
                     */
                    type: Generator.ImportableType;
                    /**
                     * The discriminant for the delta of a model that should be deleted.
                     */
                    discriminant: Generator.DiscriminantValue;
                    /**
                     * The type that represents the items of a model that should be deleted.
                     */
                    typeGuard: Generator.ImportableFunction;
                };
                unchanged: {
                    /**
                     * The type that represents unchanged items of model.
                     */
                    type: Generator.ImportableType;
                    /**
                     * The discriminant for unchanged items of a model.
                     */
                    discriminant: Generator.DiscriminantValue;
                    /**
                     * The type that represents unchanged items of a model.
                     */
                    typeGuard: Generator.ImportableFunction;
                };
                errors: {
                    /**
                     * The type that represents the items of a model that contain errors.
                     */
                    type: Generator.ImportableType;
                    /**
                     * The discriminant for the items of a model that contain errors.
                     */
                    discriminant: Generator.DiscriminantValue;
                    /**
                     * The type guard function that checks if a delta item is an error.
                     */
                    typeGuard: Generator.ImportableFunction;
                    /**
                     * Meta data for the model error type for a missing field.
                     */
                    missingField: {
                        /**
                         * The type that represents the error of missing fields.
                         */
                        type: Generator.ImportableType;
                        /**
                         * The discriminant for the error of missing fields.
                         */
                        discriminant: Generator.DiscriminantValue;
                    };
                    /**
                     * Meta data for the model error type for an invalid reference.
                     */
                    invalidReference: {
                        /**
                         * The type that represents the error of invalid references.
                         */
                        type: Generator.ImportableType;
                        /**
                         * The discriminant for the error of invalid references.
                         */
                        discriminant: Generator.DiscriminantValue;
                    };
                    /**
                     * Meta data for the model error type for non-unique fields.
                     */
                    nonUnique: {
                        /**
                         * The type that represents the error of non-unique fields.
                         */
                        type: Generator.ImportableType;
                        /**
                         * The discriminant for the error of non-unique fields.
                         */
                        discriminant: Generator.DiscriminantValue;
                    };
                    /**
                     * Meta data for the model error type for invalid types.
                     */
                    invalidType: {
                        /**
                         * The type that represents the error of invalid types.
                         */
                        type: Generator.ImportableType;
                        /**
                         * The discriminant for the error of invalid types.
                         */
                        discriminant: Generator.DiscriminantValue;
                    };
                    /**
                     * Meta data for the model error type where the item is a required dependency of another item.
                     */
                    isRequiredDependency: {
                        /**
                         * The type that represents an item to be deleted that is a required dependency of another item.
                         */
                        type: Generator.ImportableType;
                        /**
                         * The discriminant for the error of missing required dependencies.
                         */
                        discriminant: Generator.DiscriminantValue;
                    };
                };
                /**
                 * The name presenting modified fields of a model.
                 */
                delta_Fields: Generator.ImportableType;
            };
        };
    };
    /**
     * Meta data for functions that handle the import of Excel data.
     */
    converterFunctions: {
        /**
         * Name of the function that convert import data to BulkMutations.
         */
        importedDataToBulkMutations: Generator.ImportableFunction;
        /**
         * Name of the function that converts a delta to BulkMutations.
         */
        deltaToBulkMutations: Generator.ImportableFunction;
    };
};
export type BackendImportModelContext = {
    delta: {
        errors: Generator.ImportableType;
        detect: Generator.ImportableFunction;
    };
};
export declare const generatorId: string & import("zod").BRAND<"PXL.GeneratorInterfaceId">;
export declare const generator: Generator.GeneratorInterface;
export {};
