import { ProviderChangeListener, ProviderChangeSubscription } from '@eclipse-emfcloud/model-accessor-bus';
import { ModelAccessorBusClient, ModelAccessorBusProtocol, ProviderChangeSubscriptionToken } from '../common';
export declare const FrontendModelAccessorBusSubscriber: unique symbol;
/**
 * An injectable service for creation of subscriptions to receive
 * notifications of changes in model state in the {@link ModelAccessorBusProtocol}.
 * Most clients will not need to use this directly because it is more
 * convenient to use the {@link _FrontendModelAccessorBus | FrontendModelAccessorBus} API, instead.
 */
export interface FrontendModelAccessorBusSubscriber {
    /**
     * Subscribe to model accessor bus notifications.
     *
     * @param context the model hub context in which to subscribe to provider and accessors
     * @param accessorId the accessor ID to which to subscribe, or * to subscribe to all providers/accessors
     */
    subscribe(context: string, accessorId: string, onAccessorChanged: (id: string) => void): Promise<ProviderChangeSubscriptionToken>;
    /**
     * Unsubscribe to a model accessor bus subscription.
     *
     * @param subscriptionId A number identifying a unique subscription to close
     */
    unsubscribe(subscriptionId: number): void;
}
/**
 * A subscription registered on the subscriber is
 * augmented by the providerId/accessorIds that it watches.
 */
type MabProviderSubscription = ProviderChangeSubscription & {
    id: number;
    accessorId: string;
    onAccessorChanged: (id: string) => void;
    close: () => boolean;
};
export declare class FrontendModelAccessorBusSubscriberImpl implements FrontendModelAccessorBusSubscriber {
    readonly client: ModelAccessorBusClient;
    protected delegate: ModelAccessorBusProtocol;
    setModelAccessorBus(modelAccessorBus: ModelAccessorBusProtocol): void;
    /**
     * List of internal subscriptions.
     */
    protected readonly subscriptions: MabProviderSubscription[];
    getSubscriptions: () => MabProviderSubscription[];
    subscribe(context: string, accessorId: string, onAccessorChanged: ProviderChangeListener): Promise<ProviderChangeSubscriptionToken>;
    unsubscribe(subscriptionId: number): void;
}
export {};
//# sourceMappingURL=frontend-model-accessor-bus-subscriber.d.ts.map