import * as Generator from '@postxl/generator';
import { Discriminator, FieldDiscriminatedUnion, FieldName } from '@postxl/schema';
import { WithBackend } from '../backend-core';
import { WithBase } from '../base';
import { WithFrontend } from '../frontend-core';
type ContextRequirements = WithFrontend<WithBackend<WithBase<Generator.Context>>>;
export type ContextResult = WithTypes<ContextRequirements>;
export type ModelContextResult = Generator.InferModelContext<ContextResult>;
export type EnumContextResult = Generator.InferEnumContext<ContextResult>;
/**
 * All meta data for generated types
 */
export type WithTypes<Context> = Generator.ExtendContextAndModelAndEnum<Context, {
    /**
     * Overall types information
     */
    types: ContextTypes;
}, {
    /**
     * Model specific types information
     */
    types: ModelContextTypes;
}, {
    /**
     * Enum specific types information
     */
    types: EnumContextTypes;
}>;
export type ContextTypes = {
    /**
     * Location of the types module (e.g. `@types`)
     *
     * Note: We do not provide a NestJS module for types - instead, all types are exposed directly as index.ts exports.
     */
    location: Generator.BackendModuleLocation;
    /**
     * Union type of model name literals
     */
    modelNames: Generator.ImportableType;
    /**
     * Type names for Data Transfer Objects (DTOs)
     */
    dto: {
        create: Generator.ImportableType;
        update: Generator.ImportableType;
        upsert: Generator.ImportableType;
        genericModel: Generator.ImportableType;
        idType: Generator.ImportableType;
    };
    /**
     * The type for the User model. Centrally exposed as it is used in many places.
     */
    user: Generator.ImportableType & {
        /**
         * `UserId` and related functions
         */
        id: ModelTypesIdContext;
    };
};
export type ModelResult = Generator.InferModelContext<ContextResult>;
/**
 * All meta data for generated types for a single model
 */
export type ModelContextTypes = {
    id: ModelTypesIdContext;
    /**
     * Location where type can be imported from (e.g. `./aggregation.types`)
     */
    location: Generator.BackendModuleLocation;
    /**
     * The name of the type that represents a fully typed, flat object (e.g. `Aggregation`.)
     * This type only refers to related types by their branded Id.
     */
    name: Generator.TypeName;
    /**
     * Type names for Data Transfer Objects (DTOs) that are used to create, update, upsert,
     * and clone instances of the model.
     */
    dto: {
        create: Generator.ImportableType;
        update: Generator.ImportableType;
        upsert: Generator.ImportableType;
        clone: Generator.ImportableType;
    };
    /**
     * Name of the model to be used a "Scope", e.g. when logging actions
     */
    scopeName: Generator.ConstantValue;
    discriminatedUnions: Map<FieldName, DiscriminatedUnionType>;
    /**
     * Local path for imports (e.g. `./aggregation.types`)
     *
     * Should only be used internally. For external imports, use `types.location`!
     *
     * @internal
     */
    _filePath: Generator.FilePath;
};
export type ModelTypesIdContext = {
    /**
     * The name of the type that represents a branded Id (e.g. `AggregationId`.)
     */
    name: Generator.TypeName;
    /**
     * Location where type can be imported from (e.g. `@types`)
     */
    location: Generator.BackendModuleLocation;
    /**
     * The underlying, unbranded type of the Id (e.g. `string`.)
     */
    unbrandedType: Generator.TypeName;
    /**
     * Function that may be used to convert a scalar value to a branded Id type,
     * e.g. `toAggregationId`.
     */
    toBranded: Generator.ImportableFunction;
    /**
     * Function that decodes a scalar value to a branded Id type (e.g. `zAggregationId`.)
     */
    decoder: Generator.ImportableFunction;
};
export type DiscriminatedUnionType = {
    /**
     * The type that represents the full discriminated union type (e.g. `Author`)
     */
    type: Generator.ImportableType & {
        _filePath: Generator.FilePath;
    };
    /**
     * The underlying field. Mainly used for convenience.
     */
    field: FieldDiscriminatedUnion;
    /**
     * The literal type for the discriminator field (e.g. `'user' | 'anonymous' | 'guest'`)
     */
    discriminatorType: Generator.ImportableType;
    /**
     * The name of the type that represents the member of the discriminated union (e.g. `Author_User`)
     */
    memberTypes: Map<Discriminator, Generator.ImportableType>;
};
export type EnumWithTypes<EnumContext extends Generator.EnumContext> = EnumContext & {
    types: EnumContextTypes;
};
/**
 * All meta data for generated types for a single enum
 */
export type EnumContextTypes = {
    /**
     * The enum types (i.e. the string literals of the enum,
     * e.g. `type ActionStatus = 'Started' | 'Success' | 'Error'`
     */
    name: Generator.TypeName;
    /**
     * Location where type can be imported from (e.g. `./aggregation.types`)
     */
    location: Generator.BackendModuleLocation;
    /**
     * The name of the const that exposes all enum members as properties
     * e.g. `const ActionStatus = { Started: 'Started', Success: 'Success', Error: 'Error' }`
     */
    constName: Generator.VariableName;
    /**
     * The name of the const that exposes all enum members as an array
     * e.g. `const actionStatusMembers = ['Started', 'Success', 'Error']`
     */
    memberArrayName: Generator.VariableName;
    /**
     * Local path for imports (e.g. `./aggregation.types`)
     *
     * Should only be used internally. For external imports, use `types.packageName`!
     *
     * @internal
     */
    _filePath: Generator.FilePath;
};
export declare const generatorId: string & import("zod").BRAND<"PXL.GeneratorInterfaceId">;
export declare const generator: Generator.GeneratorInterface;
export {};
