import * as i0 from '@angular/core';
import { InjectionToken, EnvironmentProviders, Type } from '@angular/core';
import * as i1 from '@acorex/platform/runtime';
import { AXPExpression, AXPValidationRules, AXPOptionsData, AXPMetaData } from '@acorex/platform/core';

declare const AXP_ENTITY_CRUD_SETUP: InjectionToken<void>;
declare function provideEntity(entityKeys: string[]): EnvironmentProviders;

declare class AXPDomainModule {
    private _commandSetup;
    /**
     * Injection token for schema setup initialization.
     *
     * Used during application bootstrap to register global middleware
     * that applies to all schema resolutions. This enables centralized
     * schema processing logic.
     */
    private _schemaSetup;
    private _schemaMiddlewareSetup;
    private _schemaLoaderSetup;
    /**
     * Injection token for domain loader setup initialization.
     *
     * Used during application bootstrap to register domain loaders
     * that can provide domain definitions on-demand when they're not found in
     * the registry.
     */
    private _domainLoaderSetup;
    private _domainMiddlewareSetup;
    private _domainSetup;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXPDomainModule, never, [typeof i1.AXPRuntimeModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXPDomainModule>;
}

/**
 * Interface for defining actions
 */
interface AXPDomainAction {
    event: string;
    side: 'client' | 'server' | 'both';
    condition?: AXPExpression;
    expression: AXPExpression;
}
declare enum AXPEntityCommandScope {
    TypeLevel = "typeLevel",
    Selected = "selected",
    Individual = "individual",
    Section = "section"
}

declare enum AXPEntityType {
    Entity = 0,
    AggregateRoot = 1,
    ValueObject = 2
}
interface AXPEntityDefinition {
    name: string;
    title: string;
    fields: AXPEntityFieldDefinition[];
    type: AXPEntityType;
}
interface AXPEntityFieldFeatures {
    nullable: boolean;
    readOnly: boolean;
}
interface AXPEntityFieldDefinition {
    name: string;
    title: string;
    description?: string;
    validations?: AXPValidationRules;
    actions?: AXPDomainAction[];
    features?: AXPEntityFieldFeatures;
    defaultValue?: any;
    schema: string;
}

declare enum AXPRelationshipKind {
    Association = 0,
    Composition = 1,
    Aggregation = 2
}
declare enum AXPRelationshipCardinality {
    OneToOne = 0,
    OneToMany = 1,
    ManyToMany = 2
}
/**
 * Interface for defining relationships between aggregates
 */
interface AXPAggregateRelationDefinition {
    type: AXPRelationshipCardinality;
    kind: AXPRelationshipKind;
    target: {
        aggregate: string;
        entity: string;
        key: string;
    };
    source: {
        entity: string;
        key: string;
    };
    isRequired: boolean;
}

type AXPAggregateEntityList = {
    [key: string]: () => Promise<AXPEntityDefinition>;
};
interface AXPAggregateDefinition {
    name: string;
    title: string;
    entities: AXPEntityDefinition[] | AXPAggregateEntityList | Record<string, string>;
    relations: AXPAggregateRelationDefinition[];
    validations: AXPValidationRules;
    actions: AXPDomainAction[];
}

interface AXPModuleDefinition {
    name: string;
    title: string;
    aggregates: AXPAggregateDefinition[];
}

type AXPSchemaDataType = 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array' | 'blob';
interface AXPSchemaInterface {
    widget: string;
    options?: AXPOptionsData;
    disabled?: boolean;
}
interface AXPSchemaFeatures {
    searchable?: {
        enabled: boolean;
        fullText: boolean;
    };
    filterable?: {
        enabled: boolean;
        inline: boolean;
    };
    sortable?: {
        enabled: boolean;
    };
    auditable?: {
        enabled: boolean;
    };
}
interface AXPSchemaDefinition {
    name: string;
    dataType: AXPSchemaDataType;
    interface: AXPSchemaInterface;
    validations?: AXPValidationRules;
    features?: AXPSchemaFeatures;
    metadata?: AXPMetaData;
}

/**
 * Runtime model for relation definitions with parent references and helper methods
 */
declare class AXPRelationModel {
    readonly type: AXPRelationshipCardinality;
    readonly kind: AXPRelationshipKind;
    readonly target: {
        aggregate: string;
        entity: string;
        key: string;
    };
    readonly source: {
        entity: string;
        key: string;
    };
    readonly isRequired: boolean;
    readonly parent: any;
    constructor(definition: AXPAggregateRelationDefinition, parent: any);
    /**
     * Check if relation is one-to-one
     */
    isOneToOne(): boolean;
    /**
     * Check if relation is one-to-many
     */
    isOneToMany(): boolean;
    /**
     * Check if relation is many-to-many
     */
    isManyToMany(): boolean;
    /**
     * Check if relation is association
     */
    isAssociation(): boolean;
    /**
     * Check if relation is composition
     */
    isComposition(): boolean;
    /**
     * Check if relation is aggregation
     */
    isAggregation(): boolean;
    /**
     * Get parent aggregate
     */
    getAggregate(): any;
    /**
     * Get parent module
     */
    getModule(): any;
    /**
     * Get full path (module.aggregate.relation)
     */
    getPath(): string;
    /**
     * Get relation description
     */
    getDescription(): string;
    /**
     * Get cardinality description
     */
    getCardinalityDescription(): string;
    /**
     * Get kind description
     */
    getKindDescription(): string;
    /**
     * Get relation summary
     */
    getSummary(): string;
    /**
     * Validate the relation structure
     */
    validate(): string[];
    /**
     * Get relation characteristics
     */
    getCharacteristics(): {
        type: string;
        kind: string;
        required: boolean;
        isOwning: boolean;
        isNavigable: boolean;
    };
    /**
     * Check if relation involves entity
     */
    involvesEntity(entityName: string): boolean;
    /**
     * Check if relation targets aggregate
     */
    targetsAggregate(aggregateName: string): boolean;
    /**
     * Get the other entity in the relation
     */
    getOtherEntity(entityName: string): string | null;
    /**
     * Convert back to interface definition
     */
    toDefinition(): AXPAggregateRelationDefinition;
}

/**
 * Simple runtime model for aggregate definitions with parent references and navigation helpers.
 *
 * This model is a pure data structure that provides:
 * - Access to aggregate properties and metadata
 * - Navigation helpers for finding relations and entity references
 * - Parent module reference for hierarchy navigation
 *
 * All loading and resolution logic has been moved to AXPDomainRegistry.
 */
declare class AXPAggregateModel {
    readonly name: string;
    readonly title: string;
    readonly relations: AXPRelationModel[];
    readonly validations: AXPValidationRules;
    readonly actions: AXPDomainAction[];
    readonly parent: any;
    readonly entityReferences: Record<string, string>;
    constructor(definition: AXPAggregateDefinition, parent: any);
    /**
     * Extract entity references from various entity definition formats
     * and convert to simple string map
     */
    private extractEntityReferences;
    /**
     * Get entity reference by name
     *
     * @param entityName Name of the entity
     * @returns Entity reference string or undefined if not found
     */
    getEntityReference(entityName: string): string | undefined;
    /**
     * Get full path for an entity in this aggregate
     *
     * @param entityName Name of the entity
     * @returns Full entity path
     */
    getEntityPath(entityName: string): string;
    /**
     * Get all available entity names
     *
     * @returns Array of entity names
     */
    getEntityNames(): string[];
    /**
     * Check if entity exists in this aggregate
     *
     * @param entityName Name of the entity
     * @returns True if entity exists
     */
    hasEntity(entityName: string): boolean;
    /**
     * Find relation by source and target entities
     *
     * @param sourceEntity Source entity name
     * @param targetEntity Target entity name
     * @returns Relation model or undefined if not found
     */
    findRelation(sourceEntity: string, targetEntity: string): AXPRelationModel | undefined;
    /**
     * Get all relations for a specific entity
     *
     * @param entityName Entity name
     * @returns Array of relations involving the entity
     */
    getEntityRelations(entityName: string): AXPRelationModel[];
    /**
     * Get parent module
     *
     * @returns Parent module model
     */
    getModule(): any;
    /**
     * Get full aggregate path (module.aggregate)
     *
     * @returns Full path string
     */
    getPath(): string;
    /**
     * Get aggregate statistics
     *
     * @returns Statistics object
     */
    getStatistics(): {
        entityCount: number;
        relationCount: number;
        actionCount: number;
        validationCount: number;
    };
    /**
     * Convert back to interface definition
     *
     * @returns Aggregate definition
     */
    toDefinition(): AXPAggregateDefinition;
    /**
     * Validate the aggregate structure (synchronous validation only)
     *
     * @returns Array of validation errors
     */
    validate(): string[];
}

/**
 * Simple runtime model for module definitions with navigation helpers.
 *
 * This model is a pure data structure that provides:
 * - Access to module properties and metadata
 * - Navigation helpers for finding aggregates
 * - Hierarchy navigation and path generation
 *
 * All loading and resolution logic has been moved to AXPDomainRegistry.
 */
declare class AXPModuleModel {
    readonly name: string;
    readonly title: string;
    readonly aggregates: AXPAggregateModel[];
    constructor(definition: AXPModuleDefinition);
    /**
     * Find aggregate by name
     *
     * @param name Aggregate name
     * @returns Aggregate model or undefined if not found
     */
    findAggregate(name: string): AXPAggregateModel | undefined;
    /**
     * Get all aggregates
     *
     * @returns Array of all aggregate models
     */
    getAllAggregates(): AXPAggregateModel[];
    /**
     * Check if aggregate exists in this module
     *
     * @param name Aggregate name
     * @returns True if aggregate exists
     */
    hasAggregate(name: string): boolean;
    /**
     * Get all aggregate names
     *
     * @returns Array of aggregate names
     */
    getAggregateNames(): string[];
    /**
     * Find entity reference across all aggregates
     *
     * @param entityName Entity name to search for
     * @returns Object with aggregate and entity reference, or undefined if not found
     */
    findEntityReference(entityName: string): {
        aggregate: AXPAggregateModel;
        entityReference: string;
    } | undefined;
    /**
     * Get entity path for a specific entity in a specific aggregate
     *
     * @param aggregateName Aggregate name
     * @param entityName Entity name
     * @returns Full entity path
     */
    getEntityPath(aggregateName: string, entityName: string): string;
    /**
     * Get aggregate path
     *
     * @param aggregateName Aggregate name
     * @returns Full aggregate path
     */
    getAggregatePath(aggregateName: string): string;
    /**
     * Get all entity references across all aggregates
     *
     * @returns Map of entity name to full path
     */
    getAllEntityReferences(): Record<string, string>;
    /**
     * Get all relations across all aggregates
     *
     * @returns Array of all relation models
     */
    getAllRelations(): Array<{
        aggregate: AXPAggregateModel;
        relation: any;
    }>;
    /**
     * Validate the module structure (synchronous validation only)
     *
     * @returns Array of validation errors
     */
    validate(): string[];
    /**
     * Get module statistics
     *
     * @returns Statistics object
     */
    getStatistics(): {
        aggregateCount: number;
        entityCount: number;
        relationCount: number;
        actionCount: number;
        validationCount: number;
    };
    /**
     * Convert back to interface definition
     *
     * @returns Module definition
     */
    toDefinition(): AXPModuleDefinition;
}

/**
 * Runtime model for schema definitions with helper methods
 */
declare class AXPSchemaModel {
    readonly name: string;
    readonly dataType: AXPSchemaDataType;
    readonly interface: AXPSchemaInterface;
    readonly validations: AXPValidationRules;
    readonly features: AXPSchemaFeatures;
    readonly metadata?: AXPMetaData;
    constructor(definition: AXPSchemaDefinition);
    /**
     * Check if schema is for string data
     */
    isString(): boolean;
    /**
     * Check if schema is for number data
     */
    isNumber(): boolean;
    /**
     * Check if schema is for boolean data
     */
    isBoolean(): boolean;
    /**
     * Check if schema is for date data
     */
    isDate(): boolean;
    /**
     * Check if schema is for object data
     */
    isObject(): boolean;
    /**
     * Check if schema is for array data
     */
    isArray(): boolean;
    /**
     * Check if schema is for blob data
     */
    isBlob(): boolean;
    /**
     * Get widget type
     */
    getWidgetType(): string;
    /**
     * Get widget options
     */
    getWidgetOptions(): AXPOptionsData | undefined;
    /**
     * Check if interface is disabled
     */
    isDisabled(): boolean;
    /**
     * Check if searchable
     */
    isSearchable(): boolean;
    /**
     * Check if full text searchable
     */
    isFullTextSearchable(): boolean;
    /**
     * Check if filterable
     */
    isFilterable(): boolean;
    /**
     * Check if inline filterable
     */
    isInlineFilterable(): boolean;
    /**
     * Check if sortable
     */
    isSortable(): boolean;
    /**
     * Check if auditable
     */
    isAuditable(): boolean;
    /**
     * Validate the schema structure
     */
    validate(): Promise<string[]>;
    /**
     * Get schema capabilities
     */
    getCapabilities(): {
        searchable: boolean;
        fullTextSearchable: boolean;
        filterable: boolean;
        inlineFilterable: boolean;
        sortable: boolean;
        auditable: boolean;
        disabled: boolean;
    };
    /**
     * Get schema summary
     */
    getSummary(): {
        dataType: AXPSchemaDataType;
        widget: string;
        hasOptions: boolean;
        hasMetadata: boolean;
        hasValidations: boolean;
        capabilityCount: number;
    };
    /**
     * Convert back to interface definition
     */
    toDefinition(): AXPSchemaDefinition;
}

/**
 * Interface for schema loaders that can provide schemas on-demand
 */
interface AXPSchemaLoader {
    /**
     * Optional priority for loader ordering. Higher numbers = higher priority.
     * If not specified, uses registration order.
     */
    readonly priority?: number;
    /**
     * Determines if this loader can handle the given schema name
     * @param schemaName The name of the schema to load
     * @returns true if this loader can load the schema
     */
    canLoad(schemaName: string): boolean;
    /**
     * Loads the schema definition for the given name
     * @param schemaName The name of the schema to load
     * @returns Promise that resolves to the schema definition or null if not found
     */
    load(schemaName: string): Promise<AXPSchemaDefinition | null>;
}

/**
 * Context class for schema middleware operations providing a fluent API for schema manipulation.
 *
 * This class serves as the interface between middleware functions and schema definitions,
 * offering methods to modify various aspects of a schema including:
 * - Widget configuration and options
 * - Validation rules
 * - Feature flags (searchable, filterable, sortable)
 * - Metadata and custom properties
 * - UI behavior (visibility, readonly state)
 *
 * All methods return `this` to enable fluent method chaining.
 *
 * @example
 * ```typescript
 * // Example middleware using the context
 * (context) => {
 *   context
 *     .addValidation({ rule: 'required' })
 *     .searchable(true)
 *     .withDefaultValue('default text')
 *     .readonly(false);
 * }
 * ```
 */
declare class AXPSchemaMiddlewareContext {
    private _schema;
    constructor(schema: AXPSchemaDefinition);
    /**
     * Get the current schema definition (readonly access)
     */
    get schema(): Readonly<AXPSchemaDefinition>;
    /**
     * Get the schema name for conditional logic
     */
    get name(): string;
    /**
     * Set a default value for the widget
     * @param defaultValue The default value to set
     */
    withDefaultValue(defaultValue: any): this;
    /**
     * Remove the default value from the widget
     */
    removeDefaultValue(): this;
    /**
     * Add multiple validation rules to the schema
     * @param rules Array of validation rules to add
     */
    withValidation(rules: any[]): this;
    /**
     * Add a single validation rule to the schema
     * @param rule The validation rule to add
     */
    addValidation(rule: any): this;
    /**
     * Add a single validation rule (alias for addValidation for backward compatibility)
     * @param rule The validation rule to add
     */
    withValidationRule(rule: any): this;
    /**
     * Remove all validation rules from the schema
     */
    clearValidations(): this;
    /**
     * Remove a specific validation rule by its rule name
     * @param ruleName The name of the rule to remove (e.g., 'required', 'email')
     */
    removeValidation(ruleName: string): this;
    /**
     * Set or merge widget options
     * @param options Object containing widget-specific options to merge
     */
    withWidgetOptions(options: any): this;
    /**
     * Remove a specific widget option by key
     * @param optionKey The key of the option to remove
     */
    removeWidgetOption(optionKey: string): this;
    /**
     * Change the widget type for this schema
     * @param widgetType The new widget type identifier
     */
    withWidgetType(widgetType: string): this;
    /**
     * Configure general features using an object
     * @param features Object containing feature configurations to merge
     */
    withFeatures(features: Partial<any>): this;
    /**
     * Configure searchable feature with fine-grained control
     * @param enabled Whether searching is enabled
     * @param fullText Whether full-text search is enabled
     */
    searchable(enabled?: boolean, fullText?: boolean): this;
    /**
     * Configure filterable feature with inline filter support
     * @param enabled Whether filtering is enabled
     * @param inline Whether inline filtering is supported
     */
    filterable(enabled?: boolean, inline?: boolean): this;
    /**
     * Configure sortable feature
     * @param enabled Whether sorting is enabled
     */
    sortable(enabled?: boolean): this;
    /**
     * Add or merge metadata to the schema
     * @param metadata Object containing metadata to merge
     */
    withMetadata(metadata: any): this;
    /**
     * Remove a specific metadata property by key
     * @param key The metadata key to remove
     */
    removeMetadata(key: string): this;
    /**
     * Set the data type for this schema
     * @param dataType The new data type (string, number, boolean, etc.)
     */
    withDataType(dataType: AXPSchemaDataType): this;
    /**
     * Set the disabled state of the widget
     * @param isDisabled Whether the widget should be disabled
     */
    disabled(isDisabled?: boolean): this;
    /**
     * Set the visibility of the widget
     * @param visible Whether the widget should be visible
     */
    withVisibility(visible: boolean): this;
    /**
     * Set the readonly state of the widget
     * @param isReadonly Whether the widget should be readonly
     */
    readonly(isReadonly?: boolean): this;
}

/**
 * Middleware function that can transform schema definitions
 * @param context - Schema middleware context providing schema info and configuration methods
 */
type AXPSchemaMiddleware = (context: AXPSchemaMiddlewareContext) => void | Promise<void>;

/**
 * Options for registering a schema with additional metadata and middleware
 */
interface AXPSchemaRegistrationOptions {
    /** Optional description for documentation purposes */
    description?: string;
    /** Tags for categorizing and finding schemas */
    tags?: string[];
    /** Version information for schema evolution */
    version?: string;
    /** Schema-specific middleware that applies only to this schema */
    middleware?: AXPSchemaMiddleware[];
}
/**
 * Internal representation of a registered schema with metadata
 */
interface AXPRegisteredSchema {
    /** Unique identifier for the schema */
    name: string;
    /** The actual schema definition */
    definition: AXPSchemaDefinition;
    /** Registration options and metadata */
    options: AXPSchemaRegistrationOptions;
    /** Timestamp when the schema was registered */
    registeredAt: Date;
}
/**
 * Central registry for managing schema definitions, middleware, and dynamic loading.
 *
 * Provides:
 * - Schema registration and retrieval
 * - Middleware processing pipeline
 * - On-demand schema loading
 * - Caching and performance optimization
 */
declare class AXPSchemaRegistry {
    private readonly _schemas;
    private readonly _globalMiddleware;
    private readonly _modelCache;
    private _loaders;
    constructor();
    /**
     * Register a schema definition with optional metadata and middleware
     */
    register(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): void;
    /**
     * Register multiple schemas at once for batch operations
     */
    registerBatch(schemas: {
        name: string;
        definition: AXPSchemaDefinition;
        options?: AXPSchemaRegistrationOptions;
    }[]): void;
    /**
     * Remove a schema from the registry
     */
    unregister(name: string): boolean;
    /**
     * Check if a schema is currently registered
     */
    isRegistered(name: string): boolean;
    /**
     * Resolve a schema by name with full middleware processing and caching.
     * Supports on-demand loading if schema is not registered.
     */
    resolve(name: string): Promise<AXPSchemaModel>;
    /**
     * Synchronous resolution without middleware processing.
     * Use only when middleware is not needed for performance.
     */
    resolveSync(name: string): AXPSchemaModel;
    /**
     * Add global middleware that applies to all schema resolutions
     */
    addGlobalMiddleware(middleware: AXPSchemaMiddleware): void;
    /**
     * Remove specific global middleware
     */
    removeGlobalMiddleware(middleware: AXPSchemaMiddleware): boolean;
    /**
     * Clear all global middleware
     */
    clearGlobalMiddleware(): void;
    /**
     * Add a schema loader for on-demand loading
     */
    addLoader(loader: Type<AXPSchemaLoader>): void;
    /**
     * Get all registered schema names
     */
    getRegisteredNames(): string[];
    /**
     * Get detailed registration information for a schema
     */
    getSchemaInfo(name: string): AXPRegisteredSchema | undefined;
    /**
     * Get all registered schemas with their metadata
     */
    getAllSchemas(): AXPRegisteredSchema[];
    /**
     * Find schemas by tag for categorization
     */
    findByTag(tag: string): AXPRegisteredSchema[];
    /**
     * Find schemas by widget type for widget-specific operations
     */
    findByWidget(widgetType: string): AXPRegisteredSchema[];
    /**
     * Get comprehensive registry statistics
     */
    getStatistics(): {
        schemaCount: number;
        globalMiddlewareCount: number;
        schemasByWidget: {
            [widget: string]: number;
        };
        schemasByTag: {
            [tag: string]: number;
        };
    };
    /**
     * Clear all cached models (useful when schemas need to be reloaded)
     */
    clearCache(): void;
    /**
     * Invalidate cache for a specific schema
     */
    invalidateCache(name: string): void;
    /**
     * Clear all registered schemas, middleware, and cached models
     */
    clear(): void;
    /**
     * Attempt to load schema from registered loaders
     */
    private loadFromLoaders;
    /**
     * Get loaders sorted by priority (lazy initialization)
     */
    private getLoaders;
    /**
     * Create a deep clone of a schema definition to prevent mutations
     */
    private cloneDefinition;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPSchemaRegistry, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPSchemaRegistry>;
}

/**
 * High-level facade service for schema operations.
 *
 * Provides a simplified interface to the schema registry with additional
 * business logic and convenience methods for common operations.
 */
declare class AXPSchemaService {
    private readonly registry;
    /**
     * Register a schema with optional configuration
     */
    register(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): void;
    /**
     * Register multiple schemas at once
     */
    registerBatch(schemas: {
        name: string;
        definition: AXPSchemaDefinition;
        options?: AXPSchemaRegistrationOptions;
    }[]): void;
    /**
     * Remove a schema from the registry
     */
    unregister(name: string): boolean;
    /**
     * Check if a schema is registered
     */
    isRegistered(name: string): boolean;
    /**
     * Get all registered schema names
     */
    getRegisteredNames(): string[];
    /**
     * Clear all schemas and reset the registry
     */
    clear(): void;
    /**
     * Resolve a schema with full middleware processing
     */
    resolve(name: string): Promise<AXPSchemaModel>;
    /**
     * Resolve schema synchronously without middleware (for performance)
     */
    resolveSync(name: string): AXPSchemaModel;
    /**
     * Resolve multiple schemas for form building and batch operations
     */
    resolveMultiple(fieldConfigs: {
        name: string;
        schemaName: string;
    }[]): Promise<{
        name: string;
        schema: AXPSchemaModel;
    }[]>;
    /**
     * Add global middleware that applies to all schema resolutions
     */
    addGlobalMiddleware(middleware: AXPSchemaMiddleware): void;
    /**
     * Remove specific global middleware
     */
    removeGlobalMiddleware(middleware: AXPSchemaMiddleware): boolean;
    /**
     * Clear all global middleware
     */
    clearGlobalMiddleware(): void;
    /**
     * Get detailed information about a registered schema
     */
    getSchemaInfo(name: string): AXPRegisteredSchema | undefined;
    /**
     * Get all registered schemas with their metadata
     */
    getAllSchemas(): AXPRegisteredSchema[];
    /**
     * Find schemas by tag for categorization and grouping
     */
    findByTag(tag: string): AXPRegisteredSchema[];
    /**
     * Find schemas by widget type for widget-specific operations
     */
    findByWidget(widgetType: string): AXPRegisteredSchema[];
    /**
     * Get comprehensive registry statistics and analytics
     */
    getStatistics(): {
        mostUsedWidgets: string[];
        mostUsedTags: string[];
        schemaCount: number;
        globalMiddlewareCount: number;
        schemasByWidget: {
            [widget: string]: number;
        };
        schemasByTag: {
            [tag: string]: number;
        };
    };
    /**
     * Validate that all referenced schemas exist in the registry
     */
    validateSchemaReferences(schemaNames: string[]): {
        valid: boolean;
        missingSchemas: string[];
    };
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPSchemaService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPSchemaService>;
}

/**
 * Configuration for a schema loader with optional priority setting
 */
interface AXPSchemaLoaderConfig {
    /** The loader class to instantiate */
    loader: Type<AXPSchemaLoader>;
    /** Optional priority for loader ordering (higher = higher priority) */
    priority?: number;
}
/**
 * Provide schema loaders for on-demand schema loading.
 *
 * Schema loaders enable the registry to load schemas that are not registered
 * at build time. This is useful for:
 * - Loading schemas from external APIs
 * - Dynamic schema generation
 * - Lazy loading of large schema sets
 * - Development-time schema hot-reloading
 *
 * @param loaders Array of loader classes or loader configurations
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * // Simple loader registration
 * provideSchemaLoaders([
 *   HttpSchemaLoader,
 *   FileSystemSchemaLoader
 * ])
 *
 * // With priority configuration
 * provideSchemaLoaders([
 *   { loader: HttpSchemaLoader, priority: 10 },
 *   { loader: FileSystemSchemaLoader, priority: 5 }
 * ])
 * ```
 */
declare function provideSchemaLoaders(loaders: Array<Type<AXPSchemaLoader> | AXPSchemaLoaderConfig>): EnvironmentProviders;

/**
 * Schema entry for registration containing definition and optional metadata
 */
interface AXPSchemaEntry {
    /** The schema definition to register */
    definition: AXPSchemaDefinition;
    /** Optional registration options and metadata */
    options?: AXPSchemaRegistrationOptions;
}
/**
 * Provide schema setups for registration during application bootstrap.
 *
 * This is the primary way to register schemas that are known at build time.
 * Schemas registered this way are immediately available in the registry.
 *
 * @param schemas Array of schema entries to register
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideSchemaSetups([
 *   {
 *     definition: emailSchema,
 *     options: {
 *       tags: ['user', 'contact'],
 *       description: 'Email field schema'
 *     }
 *   },
 *   {
 *     definition: phoneSchema,
 *     options: { tags: ['contact'] }
 *   }
 * ])
 * ```
 */
declare function provideSchemaSetups(schemas: AXPSchemaEntry[]): EnvironmentProviders;
/**
 * Convenience function to provide a single schema setup.
 *
 * Useful when you need to register just one schema or want to keep
 * schema registrations separate for organizational purposes.
 *
 * @param definition The schema definition to register
 * @param options Optional registration options and metadata
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideSchema(emailSchema, {
 *   tags: ['user', 'contact'],
 *   description: 'User email field'
 * })
 * ```
 */
declare function provideSchema(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): EnvironmentProviders;
/**
 * Provide schema setups from a factory function for dynamic registration.
 *
 * Useful when schemas need to be generated at runtime, loaded from external
 * sources, or depend on configuration that's not available at build time.
 *
 * @param schemaFactory Factory function that returns schema entries
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideSchemasFromFactory(async () => {
 *   const config = await loadConfiguration();
 *   return config.schemas.map(schema => ({
 *     definition: schema,
 *     options: { tags: ['dynamic'] }
 *   }));
 * })
 * ```
 */
declare function provideSchemasFromFactory(schemaFactory: () => AXPSchemaEntry[] | Promise<AXPSchemaEntry[]>): EnvironmentProviders;

/**
 * Middleware entry for registration - can be either a simple function or targeted middleware
 */
type AXPSchemaMiddlewareEntry = AXPSchemaMiddleware | {
    target: string | RegExp;
    middleware: AXPSchemaMiddleware;
};
/**
 * Provide schema middleware for registration in the application.
 *
 * Supports both global middleware (applies to all schemas) and targeted middleware
 * (applies only to schemas matching specific patterns).
 *
 * @param middleware Array of middleware entries to register
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * // Global middleware
 * provideSchemaMiddleware([
 *   (context) => {
 *     if (context.schema.dataType === 'string') {
 *       context.searchable(true);
 *     }
 *   }
 * ])
 *
 * // Targeted middleware
 * provideSchemaMiddleware([
 *   {
 *     target: /^user_/,
 *     middleware: (context) => context.withMetadata({ category: 'user' })
 *   }
 * ])
 * ```
 */
declare function provideSchemaMiddleware(middleware: AXPSchemaMiddlewareEntry[]): EnvironmentProviders;

/**
 * Injection token for schema-specific middleware extensions.
 *
 * Used for targeted middleware that applies only to schemas matching
 * specific patterns (name or regex). This enables fine-grained control
 * over which schemas receive which middleware.
 */
declare const AXP_SCHEMA_EXTENSION: InjectionToken<{
    target: string | RegExp;
    middleware: AXPSchemaMiddleware;
}>;
/**
 * Injection token for schema setup initialization.
 *
 * Used during application bootstrap to register schemas that are
 * known at build time. Multiple providers can use this token to
 * contribute schemas to the registry.
 */
declare const AXP_SCHEMA_SETUP: InjectionToken<void>;
/**
 * Injection token for schema middleware setup initialization.
 *
 * Used during application bootstrap to register global middleware
 * that applies to all schema resolutions. This enables centralized
 * schema processing logic.
 */
declare const AXP_SCHEMA_MIDDLEWARE_SETUP: InjectionToken<void>;
/**
 * Injection token for schema loader setup initialization.
 *
 * Used during application bootstrap to register schema loaders
 * that can provide schemas on-demand when they're not found in
 * the registry.
 */
declare const AXP_SCHEMA_LOADER_SETUP: InjectionToken<void>;

/**
 * Runtime model for entity field definitions with parent references and helper methods
 */
declare class AXPEntityFieldModel {
    readonly name: string;
    readonly title: string;
    readonly description?: string;
    readonly validations?: AXPValidationRules;
    readonly actions?: AXPDomainAction[];
    readonly features?: AXPEntityFieldFeatures;
    readonly defaultValue?: any;
    readonly schema: AXPSchemaModel;
    readonly schemaName: string;
    readonly parent: any;
    readonly schemaService: AXPSchemaService;
    constructor(definition: AXPEntityFieldDefinition, parent: any, schemaService: AXPSchemaService);
    /**
     * Check if field is nullable
     */
    isNullable(): boolean;
    /**
     * Check if field is readonly
     */
    isReadonly(): boolean;
    /**
     * Check if field is required (has required validation)
     */
    isRequired(): boolean;
    /**
     * Check if field is searchable
     */
    isSearchable(): boolean;
    /**
     * Check if field supports full text search
     */
    isFullTextSearchable(): boolean;
    /**
     * Check if field is filterable
     */
    isFilterable(): boolean;
    /**
     * Check if field has inline filtering
     */
    hasInlineFiltering(): boolean;
    /**
     * Check if field is sortable
     */
    isSortable(): boolean;
    /**
     * Check if field is auditable
     */
    isAuditable(): boolean;
    /**
     * Get the schema name
     */
    getSchemaName(): string;
    /**
     * Get schema info from registry
     */
    getSchemaInfo(): any;
    /**
     * Re-resolve schema from registry (useful after schema updates)
     */
    refreshSchema(): void;
    /**
     * Get parent entity
     */
    getEntity(): any;
    /**
     * Get parent aggregate
     */
    getAggregate(): any;
    /**
     * Get parent module
     */
    getModule(): any;
    /**
     * Get full path (module.aggregate.entity.field)
     */
    getPath(): string;
    /**
     * Validate the field structure
     */
    validate(): Promise<string[]>;
    /**
     * Get field statistics
     */
    getStatistics(): {
        hasValidations: boolean;
        hasActions: boolean;
        hasFeatures: boolean;
        hasDefaultValue: boolean;
        validationCount: number;
        actionCount: number;
    };
    /**
     * Get field capabilities
     */
    getCapabilities(): {
        searchable: boolean;
        filterable: boolean;
        sortable: boolean;
        auditable: boolean;
        nullable: boolean;
        readonly: boolean;
        required: boolean;
    };
    /**
     * Convert back to interface definition
     */
    toDefinition(): AXPEntityFieldDefinition;
}

/**
 * Runtime model for entity definitions with parent references and helper methods
 */
declare class AXPEntityModel {
    readonly name: string;
    readonly title: string;
    readonly fields: AXPEntityFieldModel[];
    readonly type: AXPEntityType;
    readonly parent: any;
    readonly schemaService: AXPSchemaService;
    constructor(definition: AXPEntityDefinition, parent: any, schemaService: AXPSchemaService);
    /**
     * Find field by name
     */
    findField(name: string): AXPEntityFieldModel | undefined;
    /**
     * Get all fields
     */
    getAllFields(): AXPEntityFieldModel[];
    /**
     * Get fields by data type
     */
    getFieldsByType(dataType: string): AXPEntityFieldModel[];
    /**
     * Get required fields
     */
    getRequiredFields(): AXPEntityFieldModel[];
    /**
     * Get readonly fields
     */
    getReadonlyFields(): AXPEntityFieldModel[];
    /**
     * Get searchable fields
     */
    getSearchableFields(): AXPEntityFieldModel[];
    /**
     * Get filterable fields
     */
    getFilterableFields(): AXPEntityFieldModel[];
    /**
     * Get sortable fields
     */
    getSortableFields(): AXPEntityFieldModel[];
    /**
     * Check if this entity is an aggregate root
     */
    isAggregateRoot(): boolean;
    /**
     * Check if this entity is a regular entity
     */
    isEntity(): boolean;
    /**
     * Check if this entity is a value object
     */
    isValueObject(): boolean;
    /**
     * Get parent aggregate
     */
    getAggregate(): any;
    /**
     * Get parent module
     */
    getModule(): any;
    /**
     * Get full path (module.aggregate.entity)
     */
    getPath(): string;
    /**
     * Validate the entity structure
     */
    validate(): Promise<string[]>;
    /**
     * Get entity statistics
     */
    getStatistics(): {
        fieldCount: number;
        requiredFieldCount: number;
        readonlyFieldCount: number;
        searchableFieldCount: number;
        filterableFieldCount: number;
        sortableFieldCount: number;
    };
    /**
     * Convert back to interface definition
     */
    toDefinition(): AXPEntityDefinition;
}

/**
 * Helper utility class for working with module models
 *
 * @deprecated This helper class is deprecated and will be updated to work with the new domain registry system.
 * Use AXPDomainService for domain operations instead.
 *
 * TODO: Update this helper to work with the new simplified models and domain registry system.
 */
declare class AXPModuleHelper {
    /**
     * @deprecated Use AXPDomainService.findEntitiesByName() instead
     */
    static findEntitiesByName(module: AXPModuleModel, name: string): AXPEntityModel[];
    /**
     * @deprecated Use AXPDomainService with entity field queries instead
     */
    static findFieldsByName(module: AXPModuleModel, fieldName: string): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with entity type queries instead
     */
    static findEntitiesByType(module: AXPModuleModel, type: AXPEntityType): AXPEntityModel[];
    /**
     * @deprecated Use AXPDomainService with field validation queries instead
     */
    static findFieldsWithValidation(module: AXPModuleModel, validationRule: string): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with field queries instead
     */
    static findFieldsByDataType(module: AXPModuleModel, dataType: string): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with required field queries instead
     */
    static findRequiredFields(module: AXPModuleModel): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with nullable field queries instead
     */
    static findNullableFields(module: AXPModuleModel): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with default value queries instead
     */
    static findFieldsWithDefaultValues(module: AXPModuleModel): AXPEntityFieldModel[];
    /**
     * @deprecated Use AXPDomainService with field schema queries instead
     */
    static findFieldsBySchema(module: AXPModuleModel, schemaName: string): AXPEntityFieldModel[];
    /**
     * @deprecated Use module.validate() method instead
     */
    static validateModule(module: AXPModuleModel): string[];
    /**
     * @deprecated Use aggregate relation queries instead
     */
    static findRelationsByType(module: AXPModuleModel, relationType: string): any[];
    /**
     * @deprecated Use AXPDomainService with entity dependency queries instead
     */
    static findEntityDependencies(module: AXPModuleModel, entityName: string): any[];
    /**
     * @deprecated Use module.getStatistics() method instead
     */
    static getModuleStatistics(module: AXPModuleModel): any;
    /**
     * @deprecated Use AXPDomainService with entity queries instead
     */
    static getAllEntities(module: AXPModuleModel): AXPEntityModel[];
    /**
     * @deprecated Use AXPDomainService with field queries instead
     */
    static getAllFields(module: AXPModuleModel): AXPEntityFieldModel[];
}

/**
 * Union type for all domain definition types
 */
type AXPDomainDefinition = AXPModuleDefinition | AXPAggregateDefinition | AXPEntityDefinition;
/**
 * Domain path information parsed from path string
 */
interface AXPDomainPathInfo {
    module: string;
    aggregate?: string;
    entity?: string;
    type: 'module' | 'aggregate' | 'entity';
    fullPath: string;
}
/**
 * Interface for domain loaders that can provide domain definitions on-demand
 */
interface AXPDomainLoader {
    /**
     * Optional priority for loader ordering. Higher numbers = higher priority.
     * If not specified, uses registration order.
     */
    readonly priority?: number;
    /**
     * Determines if this loader can handle the given domain path
     * @param path The domain path to load (e.g., "user-management.user-aggregate.user")
     * @param type The type of domain object being requested
     * @returns true if this loader can load the domain definition
     */
    canLoad(path: string, type: 'module' | 'aggregate' | 'entity'): boolean;
    /**
     * Loads the domain definition for the given path
     * @param path The domain path to load
     * @param type The type of domain object being requested
     * @returns Promise that resolves to the domain definition or null if not found
     */
    load(path: string, type: 'module' | 'aggregate' | 'entity'): Promise<AXPDomainDefinition | null>;
}

/**
 * Context class for domain middleware operations providing a fluent API for domain definition manipulation.
 *
 * This class serves as the interface between middleware functions and domain definitions,
 * offering methods to modify various aspects of a domain definition including:
 * - Metadata and custom properties
 * - Validation rules
 * - Feature flags and configuration
 * - Transformations and augmentations
 *
 * All methods return `this` to enable fluent method chaining.
 */
declare class AXPDomainMiddlewareContext {
    private _definition;
    private _type;
    constructor(definition: AXPDomainDefinition, type: 'module' | 'aggregate' | 'entity');
    /**
     * Get the current definition (read-only access)
     */
    get definition(): AXPDomainDefinition;
    /**
     * Get the type of domain object being processed
     */
    get type(): 'module' | 'aggregate' | 'entity';
    /**
     * Set metadata for the domain definition
     */
    setMetadata(key: string, value: any): this;
    /**
     * Get metadata value
     */
    getMetadata(key: string): any;
    /**
     * Add validation rule to the definition (for entities and aggregates)
     */
    addValidation(rule: any): this;
    /**
     * Transform fields (for entities)
     */
    transformFields(transformer: (field: any) => any): this;
    /**
     * Add field to entity definition
     */
    addField(field: any): this;
    /**
     * Set title with transformation
     */
    setTitle(title: string): this;
    /**
     * Apply conditional logic
     */
    when(condition: boolean, callback: (context: this) => void): this;
    /**
     * Replace the entire definition
     */
    replaceDefinition(newDefinition: AXPDomainDefinition): this;
}
/**
 * Middleware function that can transform domain definitions
 * @param context - Domain middleware context providing definition info and configuration methods
 */
type AXPDomainMiddleware = (context: AXPDomainMiddlewareContext) => void | Promise<void>;

/**
 * Central registry for managing domain definitions, middleware, and dynamic loading.
 *
 * Provides:
 * - Path-based domain resolution (module.aggregate.entity)
 * - Definition-level caching with fresh model creation
 * - Type-specific middleware processing
 * - On-demand domain loading with first-wins strategy
 * - Model creation and dependency injection
 */
declare class AXPDomainRegistry {
    private readonly _definitionCache;
    private readonly _moduleMiddleware;
    private readonly _aggregateMiddleware;
    private readonly _entityMiddleware;
    private _loaders;
    private readonly schemaService;
    /**
     * Resolve a domain object by path with full middleware processing.
     * Supports definition-level caching with fresh model creation.
     *
     * @param path Domain path (e.g., "user-management.user-aggregate.user")
     * @returns Promise that resolves to the domain model
     */
    resolve<T>(path: string): Promise<T>;
    /**
     * Parse domain path string into structured information
     *
     * @param path Domain path to parse
     * @returns Parsed path information
     */
    private parsePath;
    /**
     * Register a domain loader for on-demand loading
     *
     * @param loader The loader instance to register
     */
    addLoader(loader: AXPDomainLoader): void;
    /**
     * Load definition from registered loaders using first-wins strategy
     *
     * @param path Domain path to load
     * @param type Type of domain object
     * @returns Promise that resolves to definition or undefined
     */
    private loadFromLoaders;
    /**
     * Add middleware for module processing
     */
    addModuleMiddleware(middleware: AXPDomainMiddleware): void;
    /**
     * Add middleware for aggregate processing
     */
    addAggregateMiddleware(middleware: AXPDomainMiddleware): void;
    /**
     * Add middleware for entity processing
     */
    addEntityMiddleware(middleware: AXPDomainMiddleware): void;
    /**
     * Apply type-specific middleware to definition
     *
     * @param definition Raw definition from cache or loader
     * @param type Type of domain object
     * @param path Original path for context
     * @returns Processed definition
     */
    private applyTypeMiddleware;
    /**
     * Get middleware collection for specific type
     *
     * @param type Domain object type
     * @returns Array of middleware functions
     */
    private getMiddlewareForType;
    /**
 * Create domain model from processed definition
 *
 * @param definition Processed definition (after middleware)
 * @param pathInfo Parsed path information
 * @returns Created domain model
 */
    private createModel;
    /**
     * Clear definition cache for a specific path
     *
     * @param path Path to clear from cache
     */
    invalidateCache(path: string): void;
    /**
     * Clear all cached definitions
     */
    clearCache(): void;
    /**
     * Get cache statistics
     */
    getCacheStats(): {
        size: number;
        paths: string[];
    };
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainRegistry, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainRegistry>;
}

/**
 * High-level facade service for domain operations.
 *
 * Provides simplified interfaces to the domain registry with additional
 * business logic and convenience methods for common operations.
 *
 * This service acts as the main entry point for domain model resolution
 * and provides a clean API for consuming applications.
 */
declare class AXPDomainService {
    private readonly registry;
    /**
     * Get module by name
     *
     * @param name Module name
     * @returns Promise that resolves to module model
     */
    getModule(name: string): Promise<AXPModuleModel>;
    /**
     * Check if module exists
     *
     * @param name Module name
     * @returns Promise that resolves to boolean
     */
    moduleExists(name: string): Promise<boolean>;
    /**
     * Get aggregate by module and aggregate names
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @returns Promise that resolves to aggregate model
     */
    getAggregate(moduleName: string, aggregateName: string): Promise<AXPAggregateModel>;
    /**
     * Get aggregate by path
     *
     * @param path Aggregate path (module.aggregate)
     * @returns Promise that resolves to aggregate model
     */
    getAggregateByPath(path: string): Promise<AXPAggregateModel>;
    /**
     * Check if aggregate exists
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @returns Promise that resolves to boolean
     */
    aggregateExists(moduleName: string, aggregateName: string): Promise<boolean>;
    /**
     * Get entity by full path
     *
     * @param path Full entity path (module.aggregate.entity)
     * @returns Promise that resolves to entity model
     */
    getEntity(path: string): Promise<AXPEntityModel>;
    /**
     * Get entity by component parts
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @param entityName Entity name
     * @returns Promise that resolves to entity model
     */
    getEntityByParts(moduleName: string, aggregateName: string, entityName: string): Promise<AXPEntityModel>;
    /**
     * Check if entity exists
     *
     * @param path Full entity path
     * @returns Promise that resolves to boolean
     */
    entityExists(path: string): Promise<boolean>;
    /**
     * Get multiple modules in parallel
     *
     * @param moduleNames Array of module names
     * @returns Promise that resolves to array of module models
     */
    getModules(moduleNames: string[]): Promise<AXPModuleModel[]>;
    /**
     * Get multiple aggregates in parallel
     *
     * @param aggregatePaths Array of aggregate paths
     * @returns Promise that resolves to array of aggregate models
     */
    getAggregates(aggregatePaths: string[]): Promise<AXPAggregateModel[]>;
    /**
     * Get multiple entities in parallel
     *
     * @param entityPaths Array of entity paths
     * @returns Promise that resolves to array of entity models
     */
    getEntities(entityPaths: string[]): Promise<AXPEntityModel[]>;
    /**
     * Find entities by name across all loaded modules
     *
     * @param entityName Entity name to search for
     * @returns Promise that resolves to array of matching entity paths
     */
    findEntitiesByName(entityName: string): Promise<string[]>;
    /**
     * Get all aggregates for a module
     *
     * @param moduleName Module name
     * @returns Promise that resolves to array of aggregate models
     */
    getModuleAggregates(moduleName: string): Promise<AXPAggregateModel[]>;
    /**
     * Get all entity references for an aggregate
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @returns Promise that resolves to entity references map
     */
    getAggregateEntityReferences(moduleName: string, aggregateName: string): Promise<Record<string, string>>;
    /**
     * Validate module and all its components
     *
     * @param moduleName Module name
     * @returns Promise that resolves to validation errors array
     */
    validateModule(moduleName: string): Promise<string[]>;
    /**
     * Validate aggregate and its components
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @returns Promise that resolves to validation errors array
     */
    validateAggregate(moduleName: string, aggregateName: string): Promise<string[]>;
    /**
     * Get statistics for a module
     *
     * @param moduleName Module name
     * @returns Promise that resolves to module statistics
     */
    getModuleStatistics(moduleName: string): Promise<any>;
    /**
     * Get statistics for an aggregate
     *
     * @param moduleName Module name
     * @param aggregateName Aggregate name
     * @returns Promise that resolves to aggregate statistics
     */
    getAggregateStatistics(moduleName: string, aggregateName: string): Promise<any>;
    /**
     * Clear registry cache
     */
    clearCache(): void;
    /**
     * Get cache statistics
     *
     * @returns Cache statistics object
     */
    getCacheStatistics(): {
        size: number;
        paths: string[];
    };
    /**
     * Invalidate cache for specific path
     *
     * @param path Domain path to invalidate
     */
    invalidateCache(path: string): void;
    /**
     * Parse domain path into components
     *
     * @param path Domain path to parse
     * @returns Parsed path components
     */
    parsePath(path: string): {
        module: string;
        aggregate?: string;
        entity?: string;
        type: string;
    };
    /**
     * Build path from components
     *
     * @param module Module name
     * @param aggregate Aggregate name (optional)
     * @param entity Entity name (optional)
     * @returns Built path string
     */
    buildPath(module: string, aggregate?: string, entity?: string): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainService>;
}

/**
 * Configuration for a domain loader with optional priority setting
 */
interface AXPDomainLoaderConfig {
    /** The loader class or instance to register */
    loader: Type<AXPDomainLoader> | AXPDomainLoader;
    /** Optional priority for loader ordering (higher = higher priority) */
    priority?: number;
}
/**
 * Provide domain loaders for on-demand domain loading.
 *
 * Domain loaders enable the registry to load domain definitions that are not registered
 * at build time. This is useful for:
 * - Loading domain definitions from external APIs
 * - Dynamic domain generation
 * - Lazy loading of large domain sets
 * - Development-time domain hot-reloading
 *
 * @param loaders Array of loader classes, instances, or loader configurations
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * // Simple loader registration
 * provideDomainLoaders([
 *   HttpDomainLoader,
 *   FileSystemDomainLoader,
 *   new MemoryDomainLoader()
 * ])
 *
 * // With priority configuration
 * provideDomainLoaders([
 *   { loader: HttpDomainLoader, priority: 10 },
 *   { loader: FileSystemDomainLoader, priority: 5 },
 *   { loader: new MemoryDomainLoader(), priority: 15 }
 * ])
 * ```
 */
declare function provideDomainLoaders(loaders: Array<Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig>): EnvironmentProviders;
/**
 * Provide a single domain loader for convenience
 *
 * @param loader Loader class, instance, or configuration
 * @returns Environment providers for dependency injection
 */
declare function provideDomainLoader(loader: Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig): EnvironmentProviders;

/**
 * Injection tokens for type-specific middleware setup
 */
declare const AXP_MODULE_MIDDLEWARE_SETUP = "AXP_MODULE_MIDDLEWARE_SETUP";
declare const AXP_AGGREGATE_MIDDLEWARE_SETUP = "AXP_AGGREGATE_MIDDLEWARE_SETUP";
declare const AXP_ENTITY_MIDDLEWARE_SETUP = "AXP_ENTITY_MIDDLEWARE_SETUP";
/**
 * Provide middleware for module processing.
 *
 * Module middleware is applied when resolving module definitions and can:
 * - Add metadata and custom properties
 * - Validate module structure
 * - Transform module definitions
 * - Add computed properties
 *
 * @param middleware Array of middleware functions to register
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideModuleMiddleware([
 *   (context) => {
 *     // Add common module metadata
 *     context.setMetadata('loadedAt', new Date());
 *     context.setMetadata('version', '1.0.0');
 *   },
 *   (context) => {
 *     // Add namespace prefix if not present
 *     if (!context.definition.name.includes('.')) {
 *       context.definition.name = `app.${context.definition.name}`;
 *     }
 *   }
 * ])
 * ```
 */
declare function provideModuleMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
/**
 * Provide middleware for aggregate processing.
 *
 * Aggregate middleware is applied when resolving aggregate definitions and can:
 * - Add metadata and custom properties
 * - Validate aggregate structure
 * - Transform entity references
 * - Add computed relations
 *
 * @param middleware Array of middleware functions to register
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideAggregateMiddleware([
 *   (context) => {
 *     // Add aggregate metadata
 *     context.setMetadata('type', 'business-aggregate');
 *   },
 *   (context) => {
 *     // Validate entity references
 *     const entities = context.definition.entities;
 *     if (Object.keys(entities).length === 0) {
 *       throw new Error('Aggregate must have at least one entity');
 *     }
 *   }
 * ])
 * ```
 */
declare function provideAggregateMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
/**
 * Provide middleware for entity processing.
 *
 * Entity middleware is applied when resolving entity definitions and can:
 * - Add auto-generated fields (id, timestamps)
 * - Apply field transformations
 * - Add validation rules
 * - Set default values
 *
 * @param middleware Array of middleware functions to register
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideEntityMiddleware([
 *   (context) => {
 *     // Add auto-generated ID field if not present
 *     if (!context.definition.fields.some(f => f.name === 'id')) {
 *       context.addField({
 *         name: 'id',
 *         type: 'uuid',
 *         required: true,
 *         generated: true
 *       });
 *     }
 *   },
 *   (context) => {
 *     // Add timestamp fields
 *     context.addField({
 *       name: 'createdAt',
 *       type: 'datetime',
 *       required: true,
 *       generated: true
 *     });
 *     context.addField({
 *       name: 'updatedAt',
 *       type: 'datetime',
 *       required: true,
 *       generated: true
 *     });
 *   }
 * ])
 * ```
 */
declare function provideEntityMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
/**
 * Provide combined middleware for all domain types.
 *
 * This is a convenience function that allows registering middleware for multiple
 * domain types in a single call.
 *
 * @param config Configuration object with middleware for each type
 * @returns Environment providers for dependency injection
 *
 * @example
 * ```typescript
 * provideDomainMiddleware({
 *   modules: [
 *     (context) => context.setMetadata('loadedAt', new Date())
 *   ],
 *   aggregates: [
 *     (context) => context.setMetadata('type', 'business-aggregate')
 *   ],
 *   entities: [
 *     (context) => {
 *       if (!context.definition.fields.some(f => f.name === 'id')) {
 *         context.addField({ name: 'id', type: 'uuid', required: true });
 *       }
 *     }
 *   ]
 * })
 * ```
 */
declare function provideDomainMiddleware(config: {
    modules?: AXPDomainMiddleware[];
    aggregates?: AXPDomainMiddleware[];
    entities?: AXPDomainMiddleware[];
}): EnvironmentProviders;

export { AXPAggregateModel, AXPDomainMiddlewareContext, AXPDomainModule, AXPDomainRegistry, AXPDomainService, AXPEntityCommandScope, AXPEntityFieldModel, AXPEntityModel, AXPEntityType, AXPModuleHelper, AXPModuleModel, AXPRelationModel, AXPRelationshipCardinality, AXPRelationshipKind, AXPSchemaMiddlewareContext, AXPSchemaModel, AXPSchemaRegistry, AXPSchemaService, AXP_AGGREGATE_MIDDLEWARE_SETUP, AXP_ENTITY_CRUD_SETUP, AXP_ENTITY_MIDDLEWARE_SETUP, AXP_MODULE_MIDDLEWARE_SETUP, AXP_SCHEMA_EXTENSION, AXP_SCHEMA_LOADER_SETUP, AXP_SCHEMA_MIDDLEWARE_SETUP, AXP_SCHEMA_SETUP, provideAggregateMiddleware, provideDomainLoader, provideDomainLoaders, provideDomainMiddleware, provideEntity, provideEntityMiddleware, provideModuleMiddleware, provideSchema, provideSchemaLoaders, provideSchemaMiddleware, provideSchemaSetups, provideSchemasFromFactory };
export type { AXPAggregateDefinition, AXPAggregateEntityList, AXPAggregateRelationDefinition, AXPDomainAction, AXPDomainDefinition, AXPDomainLoader, AXPDomainLoaderConfig, AXPDomainMiddleware, AXPDomainPathInfo, AXPEntityDefinition, AXPEntityFieldDefinition, AXPEntityFieldFeatures, AXPModuleDefinition, AXPRegisteredSchema, AXPSchemaDataType, AXPSchemaDefinition, AXPSchemaEntry, AXPSchemaFeatures, AXPSchemaInterface, AXPSchemaLoader, AXPSchemaLoaderConfig, AXPSchemaMiddleware, AXPSchemaMiddlewareEntry, AXPSchemaRegistrationOptions };
