import * as Generator from '@postxl/generator';
import * as Actions from '../backend-actions';
import { WithBackend } from '../backend-core';
import { WithRepositories } from '../backend-repositories';
import { WithView } from '../backend-view';
import { WithBase } from '../base';
import { WithTypes } from '../types';
import { StandardAction } from './update-actions.decoders';
type ContextRequirements = WithView<WithRepositories<Actions.WithActions<WithTypes<WithBackend<WithBase<Generator.Context>>>>>>;
export type ContextResult = WithUpdates<ContextRequirements>;
export type ModelContextResult = Generator.InferModelContext<ContextResult>;
export type WithUpdates<Context> = Generator.ExtendContextAndModel<Context, {
    update: UpdateContext;
}, {
    update: UpdateModelContext;
}>;
type UpdateActions = Record<string, Actions.ActionProviderTypes>;
export type UpdateContext = Actions.ActionProvider<UpdateActions> & {
    bulk: {
        /**
         * The service that provides the bulk operations
         */
        service: Generator.ImportableClass & {
            /**
             * Name of the exposed method to execute a single bulk operation
             */
            executeSingleStepMethodName: Generator.FunctionName;
            /**
             * Name of the exposed method to execute multiple bulk operations
             */
            executeMultipleStepsMethodName: Generator.FunctionName;
        };
        /**
         * The type of the overall, individual bulk operation (e.g. `BulkMutation<User>`)
         */
        type: Generator.ImportableType;
        /**
         * The type of the generic BulkMutation type for a model
         */
        modelType: Generator.ImportableType;
    };
};
export type NarrowUpdateModelResult<Context extends {
    update: UpdateModelContext;
}, NarrowedUpdate> = Omit<Context, 'update'> & {
    update: NarrowedUpdate;
};
export type UpdateModelResult_Exists<Context extends {
    update: UpdateModelContext;
} = ModelContextResult> = NarrowUpdateModelResult<Context, Extract<Context['update'], {
    kind: 'exists';
}>>;
export declare function isUpdateModelResult_Exists(model: ModelContextResult): model is UpdateModelResult_Exists<typeof model>;
export type UpdateModelResult_Skipped<Context extends {
    update: UpdateModelContext;
} = ModelContextResult> = NarrowUpdateModelResult<Context, Extract<Context['update'], {
    kind: 'skipped';
}>>;
export type UpdateModelContext = UpdateModelContext_Skipped | UpdateModelContext_Exists;
export type UpdateModelContext_Skipped = {
    kind: 'skipped';
};
export type UpdateModelContext_Exists = Readonly<{
    kind: 'exists';
    /**
     * The update service for the model
     */
    service: Generator.ImportableClass & {
        /**
         * The name of the model's update service in other services
         */
        variableName: Generator.VariableName;
    };
    /**
     * Settings for actions exposed by the model
     */
    action: {
        /**
         * Name of the action type the combines all actions for the model (e.g. `UserAction`)
         */
        type: Generator.ImportableType;
        resultTypeMap: Generator.ImportableType;
        /**
         * Name of the action scope, ie the model's name
         */
        scope: Actions.ScopeName;
        /**
         * Convenience access to standard actions
         *
         * Note: These actions are also included in the `actions` array!
         */
        standardActions: StandardActions;
        /**
         * Detailed configuration for each action
         */
        actions: UpdateAction[];
    };
    /**
     * Name of the models field in the bulk mutation type
     */
    bulkMutationFieldName: Generator.VariableName;
}>;
export type StandardActions = Record<StandardAction, UpdateAction_Standard | undefined>;
export type UpdateAction = UpdateAction_Standard | UpdateAction_Custom;
export type UpdateAction_Standard = {
    kind: 'standard';
    name: StandardAction;
} & UpdateAction_Shared;
export type UpdateAction_Custom = {
    kind: 'custom';
    name: string;
} & UpdateAction_Shared;
export type UpdateAction_Shared = {
    /**
     * The type of the action
     */
    type: Generator.ImportableType;
    description: string;
    payload: {
        /**
         * The type of the actions payload
         */
        type: Generator.ImportableType;
        /**
         * The decoder function for the payload
         */
        decoder: Generator.ImportableFunction;
    };
    /**
     * The type of the action's result
     */
    result: Generator.ImportableType & {
        definition: string | undefined;
    };
};
export declare const generatorId: string & import("zod").$brand<"PXL.GeneratorInterfaceId">;
export declare const generator: Generator.GeneratorInterface;
export {};
