import { type Labels } from '@ariestools/sdk';
import type { Provider, ProviderMoniker } from '@xyo-network/xl1-protocol/protocol-lib';
import type { CreatableProviderContext } from '../model/index.js';
import type { CreatableProviderFactory, CreatableProviderInstance } from './CreatableProvider.js';
import { type CreatableProviderRegistry } from './CreatableProviderRegistry.js';
import type { ProviderFactoryGetInstanceOptions } from './GetInstanceOptions.js';
import { type LabeledCreatableProviderFactory } from './LabeledCreatableProviderFactory.js';
import type { ProviderFactoryLocatorInstance } from './ProviderFactoryLocatorInstance.js';
/**
 * A class which encapsulates the Service Locator Pattern for Provider Factories
 */
export declare class ProviderFactoryLocator<TContext extends CreatableProviderContext = CreatableProviderContext, TMonikers extends ProviderMoniker[] = ProviderMoniker[]> implements ProviderFactoryLocatorInstance<TContext> {
    protected readonly _context: TContext;
    protected readonly _registry: CreatableProviderRegistry<TMonikers>;
    private _frozen;
    private _parent?;
    private _validateDepsOnRegister;
    /** Creates an instance with the supplied configuration. */
    constructor(context: (Omit<TContext, 'locator'> & {
        locator?: TContext['locator'];
    }), registry?: CreatableProviderRegistry, validateDepsOnRegister?: boolean);
    /** Returns the context result exposed by this provider. */
    get context(): TContext;
    /** Returns the logger result exposed by this provider. */
    get logger(): import("@ariestools/sdk").Logger | undefined;
    /**
     * The current registry for the module factory
     */
    get registry(): Readonly<CreatableProviderRegistry>;
    protected get validateDepsOnRegister(): boolean;
    /** Returns the freeze result exposed by this provider. */
    freeze(): void;
    /** Returns instance. */
    getInstance<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker'], { start, labels }?: ProviderFactoryGetInstanceOptions): Promise<CreatableProviderInstance<TProvider>>;
    /** Returns the has result exposed by this provider. */
    has(moniker: TMonikers[number]): boolean;
    /**
     * Locates a provider factory that matches the supplied moniker and labels
     * @param moniker The config moniker for the provider
     * @param labels The labels for the provider factory
     * @returns A provider factory that matches the supplied moniker and labels or throws if one is not found
     */
    locate<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker'], labels?: Labels): CreatableProviderFactory<CreatableProviderInstance<TProvider>> | LabeledCreatableProviderFactory<CreatableProviderInstance<TProvider>>;
    /**
     * Registers a single module factory (with optional tags) with the locator
     * @param factory The factory to register
     * @param labels The labels for the module factory
     */
    register(factory: CreatableProviderFactory, labels?: Labels, primary?: boolean | ProviderMoniker | ProviderMoniker[]): this;
    /**
     * Registers multiple module factories with the locator
     * @param factories The factories to register
     */
    registerMany(factories: CreatableProviderFactory[]): this;
    /** Returns the registered result exposed by this provider. */
    registered(moniker: ProviderMoniker): boolean;
    /** Attempts to get instance and returns `undefined` when it cannot be resolved. */
    tryGetInstance<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker'], { start, labels }?: ProviderFactoryGetInstanceOptions): Promise<CreatableProviderInstance<TProvider> | undefined>;
    /**
     * Tries to locate a module factory that matches the supplied moniker and labels
     * @param moniker The config moniker for the module
     * @param labels The labels for the module factory
     * @returns A module factory that matches the supplied moniker and labels or undefined
     */
    tryLocate<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker'], labels?: Labels): CreatableProviderFactory<CreatableProviderInstance<TProvider>> | LabeledCreatableProviderFactory<CreatableProviderInstance<TProvider>> | undefined;
    /** Validates dependencies and returns the validation result. */
    validateDependencies(recursive?: boolean): void;
}
//# sourceMappingURL=ProviderFactoryLocator.d.ts.map