import { Observable } from 'rxjs';
import { IContributions, Evaluated, Raw, IContributionScope, IContributionUnsubscribable, IViewerService, IModelService, IContributionRegistry, IContributionsItem, IContributionsEntry } from '@adminide-stack/extension-api';
import { IContext, IContextKeyService } from '@adminide-stack/core';
/** Manages and executes contributions from all extensions. */
export declare class ContributionRegistry implements IContributionRegistry {
    private viewerService;
    private modelService;
    private contextKeyService;
    /** All entries, including entries that are not enabled in the current context. */
    private _entries;
    constructor(viewerService: Pick<IViewerService, 'activeViewerUpdates'>, modelService: Pick<IModelService, 'getPartialModel'>, contextKeyService: IContextKeyService);
    /**
     * Register contributions and return an unsubscribable that deregisters the contributions.
     * Any expressions in the contributions need to be already parsed for fast re-evaluation.
     */
    registerContributions(entryToRegister: IContributionsEntry): IContributionUnsubscribable;
    deregisterContributions(entryToDeregister: IContributionsEntry): boolean;
    /**
     * Atomically deregister the previous contributions and register the next contributions. The registry's observable
     * emits only one time after both operations are complete (instead of also emitting after the deregistration
     * and before the registration).
     */
    replaceContributions(previous: IContributionUnsubscribable, next: IContributionsItem): IContributionUnsubscribable;
    /**
     * Returns an observable that emits all contributions (merged) evaluated in the current model
     * (with the optional scope). It emits whenever there is any change.
     *
     * @template T Extra allowed property value types for the {@link Context} value. See
     * {@link Context}'s `T` type parameter for more information.
     * @param scope The scope in which contributions are fetched. A scope can be a sub-component of
     * the UI that defines its own context keys, such as the hover, which stores useful loading and
     * definition/reference state in its scoped context keys.
     * @param extraContext Extra context values to use when computing the contributions. Properties
     * in this object shadow (take precedence over) properties in the global context for this
     * computation.
     */
    getContributions<T>(scope?: IContributionScope | undefined): Observable<Evaluated<IContributions>>;
    /**
     * @template T Extra allowed property value types for the {@link Context} value. See {@link Context}'s `T` type
     * parameter for more information.
     */
    protected getContributionsFromEntries<T>(entries: Observable<IContributionsEntry[]>, scope: IContributionScope | undefined, logWarning?: (...args: any[]) => void): Observable<Evaluated<IContributions>>;
    /**
     * All contribution entries, emitted whenever the set of registered contributions changes.
     *
     * Most callers should use ContributionsRegistry#getContributions. Only use #entries if the
     * caller needs information that is discarded when the contributions are merged (such as the
     * extension that registered each set of contributions).
     */
    readonly entries: Observable<IContributionsEntry[]> & {
        value: IContributionsEntry[];
    };
}
/**
 * Merges the contributions.
 *
 * Most callers should use ContributionRegistry#getContributions, which merges all registered
 * contributions.
 */
export declare function mergeContributions(contributions: Evaluated<IContributions>[]): Evaluated<IContributions>;
/**
 * Filters the contributions to only those that are enabled in the current context.
 */
export declare function filterContributions(contributions: Evaluated<IContributions>): Evaluated<IContributions>;
/**
 * Evaluates expressions in contribution definitions against the given context.
 *
 * @todo could walk object recursively
 */
export declare function evaluateContributions<T>(context: IContext, contributions: IContributions): Evaluated<IContributions>;
/**
 * Evaluates expressions in contribution definitions against the given context.
 */
export declare function parseContributionExpressions(contributions: Raw<IContributions>): IContributions;
