import { InteropObservable, Observable, ObservableInput, Subscribable, Unsubscribable } from 'rxjs'; /** * ObservableState is an Observable interface for state streams. * At its core, ObservableState multicasts a source Observable and makes the latest value available. * * You can start the stream by calling the {@link connect | connect()} method and destory it with {@link unsubscribe | unsubscribe()} * * The latest value of the state stream can be read synchronously by accessing * `.state` (as long as the inner subject isn't destroyed) */ export declare class ObservableState implements InteropObservable, Subscribable, Unsubscribable { private subject; private subscription?; private source$; name: string; subscribe: Observable['subscribe']; pipe: Observable['pipe']; /** * Create a new ObservableState. * * Will not consume `source$` until {@link connect} has been called. * * @param name The name to store for the ObservableState, used by the stateStreamRegistry and for dev tools * @param source$ The observable this ObservableState will get it's values from * @param initialState The initial value of `.state` until `source$` has emitted a value */ constructor(name: string, source$: ObservableInput, initialState: State); /** * @deprecated Only for use by RxJS */ [Symbol.observable](): Subscribable; /** * Start consuming the source observable. In effect, this "starts the work". */ connect: () => void; /** * Stop reducing this state stream and unsubscribe from the source observable. * * Accessing the `.state` property or subscribing after calling this method will throw an * exception. */ unsubscribe: () => void; get state(): State; get destroyed(): boolean; }