import { ComponentSpec, ComponentObject } from '@memberjunction/interactive-component-types';
import { ComponentCompiler } from '../compiler/index.js';
import { RuntimeContext } from '../types/index.js';
import { ComponentDependencyInfo, DependencyTree } from './registry-provider.js';
import { UserInfo, IMetadataProvider } from '@memberjunction/core';
export interface IComponentRegistryClient {
    GetRegistryComponent(params: {
        registryName: string;
        namespace: string;
        name: string;
        version?: string;
        hash?: string;
    }): Promise<ComponentSpec | null>;
}
export declare class ComponentRegistryService {
    private static instance;
    private compiledComponentCache;
    private componentReferences;
    private compiler;
    private runtimeContext;
    private componentEngine;
    private registryProviders;
    private debug;
    private graphQLClient?;
    private _provider;
    get Provider(): IMetadataProvider;
    set Provider(value: IMetadataProvider | null);
    private constructor();
    static getInstance(compiler: ComponentCompiler, context: RuntimeContext, debug?: boolean, graphQLClient?: IComponentRegistryClient): ComponentRegistryService;
    setGraphQLClient(client: IComponentRegistryClient): void;
    private cachedProviderClient;
    private getGraphQLClient;
    initialize(contextUser?: UserInfo): Promise<void>;
    private calculateSpecHash;
    getCompiledComponent(componentId: string, referenceId?: string, contextUser?: UserInfo): Promise<ComponentObject>;
    getCompiledComponentFromRegistry(registryName: string, namespace: string, name: string, version: string, referenceId?: string, contextUser?: UserInfo): Promise<any>;
    getComponentSpec(componentId: string, contextUser?: UserInfo): Promise<ComponentSpec>;
    private fetchFromExternalRegistry;
    private cacheExternalComponent;
    loadDependencies(componentId: string, contextUser?: UserInfo): Promise<ComponentDependencyInfo[]>;
    resolveDependencyTree(componentId: string, contextUser?: UserInfo, visited?: Set<string>): Promise<DependencyTree>;
    getComponentsToLoad(rootComponentId: string, contextUser?: UserInfo): Promise<string[]>;
    private addComponentReference;
    removeComponentReference(componentKey: string, referenceId: string): void;
    private considerCacheEviction;
    private getRegistryApiKey;
    getCacheStats(): {
        compiledComponents: number;
        totalUseCount: number;
        memoryEstimate: string;
    };
    clearCache(): void;
    forceClearAll(): void;
    static reset(): void;
    private getComponentKey;
}
//# sourceMappingURL=component-registry-service.d.ts.map