import { RuntimeContext } from '../types/index.js';
import { ComponentCompiler } from '../compiler/index.js';
import { ComponentRegistry } from '../registry/index.js';
import { ComponentSpec, ComponentStyles } from '@memberjunction/interactive-component-types';
import { UserInfo } from '@memberjunction/core';
import { MJComponentLibraryEntity } from '@memberjunction/core-entities';
export interface HierarchyRegistrationResult {
    success: boolean;
    registeredComponents: string[];
    errors: ComponentRegistrationError[];
    warnings: string[];
    resolvedSpec?: ComponentSpec;
}
export interface ComponentRegistrationError {
    componentName: string;
    error: string;
    phase: 'compilation' | 'registration' | 'validation';
}
export interface HierarchyRegistrationOptions {
    styles?: ComponentStyles;
    namespace?: string;
    version?: string;
    continueOnError?: boolean;
    allowOverride?: boolean;
    allLibraries: MJComponentLibraryEntity[];
    debug?: boolean;
    contextUser?: UserInfo;
}
export declare class ComponentHierarchyRegistrar {
    private compiler;
    private registry;
    private runtimeContext;
    constructor(compiler: ComponentCompiler, registry: ComponentRegistry, runtimeContext: RuntimeContext);
    private fetchExternalComponent;
    registerHierarchy(rootSpec: ComponentSpec, options: HierarchyRegistrationOptions): Promise<HierarchyRegistrationResult>;
    registerSingleComponent(spec: ComponentSpec, options: {
        styles?: ComponentStyles;
        namespace?: string;
        version?: string;
        allowOverride?: boolean;
        allLibraries: MJComponentLibraryEntity[];
    }): Promise<{
        success: boolean;
        error?: ComponentRegistrationError;
    }>;
    private registerChildComponents;
}
export declare function registerComponentHierarchy(rootSpec: ComponentSpec, compiler: ComponentCompiler, registry: ComponentRegistry, runtimeContext: RuntimeContext, options: HierarchyRegistrationOptions): Promise<HierarchyRegistrationResult>;
export declare function validateComponentSpec(spec: ComponentSpec): string[];
export declare function flattenComponentHierarchy(rootSpec: ComponentSpec): ComponentSpec[];
export declare function countComponentsInHierarchy(rootSpec: ComponentSpec, includeEmpty?: boolean): number;
//# sourceMappingURL=component-hierarchy.d.ts.map