import { Observable, ObservableInput, Unsubscribable } from 'rxjs';
import { Contributions } from '../protocol/contribution';
import { ComputedContext, evaluate } from '../context/expr/evaluator';
import { Environment } from '../environment';
import { TextDocumentItem } from '../types/textDocument';
export interface ContributionsEntry {
    contributions: Contributions | ObservableInput<Contributions | Contributions[]>;
}
export interface ContributionUnsubscribable extends Unsubscribable {
    entry: ContributionsEntry;
}
export declare class ContributionRegistry {
    private environment;
    private commands;
    private _entries;
    constructor(environment: Observable<Environment>, commands: any);
    registerContributions(entry: ContributionsEntry): ContributionUnsubscribable;
    replaceContributions(previous: ContributionUnsubscribable, next: ContributionsEntry): ContributionUnsubscribable;
    getContributions(scope?: TextDocumentItem): Observable<Contributions>;
    protected getContributionsFromEntries(entries: Observable<ContributionsEntry[]>, scope?: TextDocumentItem): Observable<Contributions>;
    readonly entries: Observable<ContributionsEntry[]> & {
        value: ContributionsEntry[];
    };
}
export declare function mergeContributions(contributions: Contributions[]): Contributions;
export declare function contextFilter<T extends {
    when?: string;
}>(context: ComputedContext, items: T[], evaluateExpr?: typeof evaluate): T[];
export declare function filterContributions(context: ComputedContext, contributions: Contributions, evaluateExpr?: typeof evaluate): Contributions;
export declare function evaluateContributions(context: ComputedContext, contributions: Contributions, { evaluateTemplate, needsEvaluation }?: {
    evaluateTemplate: (template: string, context: ComputedContext) => any;
    needsEvaluation: (template: string) => boolean;
}): Contributions;
