import { SudoSubscriber, ChangeType, ConnectionState } from './sudo-subscriber'; import { Sudo } from './sudo'; import Observable from 'zen-observable'; export type SubscriptionResult = { data: T; }; export declare class SubscriptionManager { subscribers: Record; subscription: ZenObservable.Subscription | undefined; watcher: Observable> | undefined; /** * Adds or replaces a subscriber with the specified ID. * * @param id subscriber ID. * @param subscriber subscriber to subscribe. */ replaceSubscriber(id: string, subscriber: SudoSubscriber): void; /** * Removes the subscriber with the specified ID. * and the subscription for that same ID * @param id subscriber ID. */ removeSubscriber(id: string): void; /** * Removes all subscribers and subscriptions */ removeAllSubscribers(): void; /** * Notifies subscribers of a new, updated or deleted Sudo. * * @param changeType change type. Please refer to [SudoSubscriber.ChangeType]. * @param sudo new, updated or deleted Sudo. */ sudoChanged(changeType: ChangeType, sudo: Sudo): void; /** * Processes AppSync subscription connection status change. * * @param state connection state. */ connectionStatusChanged(state: ConnectionState): void; }