/**
 * Entity Queries
 *
 * Query functions for the Entity Registry.
 * These operate on the auto-generated ENTITY_REGISTRY data.
 *
 * Uses dynamic require to load the registry at runtime (not compile time)
 * because the registry is generated in the user's project, not in the core package.
 *
 * @module core/lib/entities/queries
 */
import type { EntityConfig, ChildEntityDefinition } from './types';
/**
 * Generic EntityRegistryEntry type (matches generated registry structure)
 * The actual EntityName type is project-specific and should be imported
 * directly from @nextsparkjs/registries/entity-registry when needed.
 */
export interface EntityRegistryEntry {
    name: string;
    config: EntityConfig | ChildEntityDefinition;
    parent: string | null;
    children: string[];
    depth: number;
    tableName: string;
    routePrefix?: string;
    pluginContext?: {
        pluginName: string;
        pluginDir?: string;
    } | null;
    themeContext?: {
        themeName: string;
        themeDir?: string;
    } | null;
    schema?: any;
    relations?: any;
    relativePath?: string;
    hasComponents?: boolean;
    hasHooks?: boolean;
    hasMigrations?: boolean;
    hasMessages?: boolean;
    hasAssets?: boolean;
    messagesPath?: string;
    isCore?: boolean;
    source?: 'core' | 'theme' | 'plugin';
}
export interface EntityRegistryMetadata {
    totalEntities: number;
    rootEntities?: number;
    maxDepth: number;
    generatedAt: string;
    entityNames?: string[];
    entities?: string[];
    pluginEntities?: number;
    themeEntities?: number;
    entitiesWithComponents?: number;
    entitiesWithHooks?: number;
    entitiesWithMigrations?: number;
    entitiesWithMessages?: number;
    entitiesWithAssets?: number;
}
export interface EntityOwner {
    type: 'plugin' | 'theme';
    name: string;
}
/**
 * Register the entity registry from the project
 * This should be called by the dashboard layout which imports the registry directly
 * (webpack resolves the @nextsparkjs/registries alias at compile time)
 */
export declare function setEntityRegistry(registry: Record<string, EntityRegistryEntry>, metadata?: EntityRegistryMetadata): void;
/**
 * Add a single entity to the registry
 * Used by EntityRegistry.register() for programmatic registration
 */
export declare function addEntityToRegistry(entry: EntityRegistryEntry): void;
/**
 * Remove an entity from the registry
 */
export declare function removeEntityFromRegistry(name: string): boolean;
/**
 * Clear the registry (for testing)
 */
export declare function clearEntityRegistry(): void;
/**
 * Check if registry is initialized
 */
export declare function isRegistryInitialized(): boolean;
/**
 * Get all registered entity configs
 */
export declare function getRegisteredEntities(): (EntityConfig | ChildEntityDefinition)[];
/**
 * Get entity config by name
 */
export declare function getEntity(name: string): EntityConfig | ChildEntityDefinition | undefined;
/**
 * Get entity with full metadata
 */
export declare function getEntityMetadata(name: string): EntityRegistryEntry | undefined;
/**
 * Get root entities (no parent)
 */
export declare function getRootEntities(): EntityRegistryEntry[];
/**
 * Get child entities of a parent
 */
export declare function getChildEntities(parentName: string): EntityRegistryEntry[];
export interface EntityTreeNode extends Omit<EntityRegistryEntry, 'children'> {
    childNodes: EntityTreeNode[];
}
/**
 * Get entity tree (hierarchical)
 */
export declare function getEntityTree(): EntityTreeNode[];
/**
 * Get entities by depth level
 */
export declare function getEntitiesByDepth(depth: number): EntityRegistryEntry[];
/**
 * Get table name for entity
 */
export declare function getEntityTableName(name: string): string | undefined;
/**
 * Get entity by table name (reverse lookup)
 */
export declare function getEntityByTableName(tableName: string): EntityRegistryEntry | undefined;
/**
 * Get entities from a specific plugin
 */
export declare function getPluginEntities(pluginName: string): EntityRegistryEntry[];
/**
 * Get entities from a specific theme
 */
export declare function getThemeEntities(themeName: string): EntityRegistryEntry[];
/**
 * Get entity owner (plugin or theme)
 */
export declare function getEntityOwner(entityName: string): EntityOwner | null;
/**
 * Get entity by slug
 */
export declare function getEntityBySlug(slug: string): EntityConfig | undefined;
/**
 * Get entity metadata (totals, counts, etc.)
 */
export declare function getEntityRegistryMetadata(): EntityRegistryMetadata | null;
/**
 * Get the raw registry object
 * Use this when you need direct access to the registry
 */
export declare function getEntityRegistry(): Record<string, EntityRegistryEntry>;
//# sourceMappingURL=queries.d.ts.map