/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { OnDestroy } from '@angular/core';
import { Observable, PartialObserver, Subscription } from 'rxjs';
import * as i0 from "@angular/core";
/**
 * An interface that knows how to subscribe and unsubscribe from observables.
 */
export interface ISubscriptionTracker {
    /**
     * Subscribes to the given {@param observable}. Passes along the given {@param observerOrNext}.
     * Will call the {@param complete} when complete, and {@param error} when errors happen.
     */
    subscribe<T>(observable: Observable<T>, observerOrNext?: PartialObserver<T> | ((value: T) => void), error?: (error: any) => void, complete?: () => void): Subscription;
    /**
     * Unsubscribes from the given {@param subscription}.
     */
    unsubscribe(subscription: Subscription): Subscription;
    /**
     * Unsubscribes from all subscriptions on this {@link Subscribable}.
     */
    unsubscribeAll(): void;
}
/**
 * Components can use this to have subscriptions automatically removed when the component is destroyed
 */
export declare class SubscriptionTracker implements ISubscriptionTracker, OnDestroy {
    private subscriptions;
    subscribe<T>(observable: Observable<T>, observerOrNext?: PartialObserver<T> | ((value: T) => void)): Subscription;
    unsubscribe(subscription: Subscription): Subscription;
    unsubscribeAll(): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionTracker, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SubscriptionTracker>;
}
