import { BehaviorSubject, Observable } from 'rxjs'; /** * State of an observable in the given moment. */ export declare enum SnapshotState { /** * Waiting for the first emission */ WAITING = "WAITING", /** * Observable has already emitted */ EMITTING = "EMITTING", /** * Observable has successfully completed emitting (there will be no more emissions) */ COMPLETED = "COMPLETED", /** * Observable threw an error */ FAILED = "FAILED" } /** * A tuple of latest emission, state of an observable and eventual error thrown by the observable. * * * value - latest emission of the observable or `null` if it hasn't started emitting yet and no default value was provided * * state - determines whether the observable already started emitting, whether it completed or failed (see [[SnapshotState]]) * * error - eventual error thrown by the observable * * @typeParam T type of the emitted value * @typeParam S `null` determines that state is nullable, the only only other acceptable type is `never` */ export declare type Snapshot = [T, SnapshotState | S, Error | any | null]; export declare function useSnapshot(observable: BehaviorSubject): Snapshot; export declare function useSnapshot(observable: Observable): Snapshot; export declare function useSnapshot(observable: Observable, defaultValue: T): Snapshot; export declare function useSnapshot(observable: BehaviorSubject | undefined | null): Snapshot; export declare function useSnapshot(observable: Observable | undefined | null): Snapshot; export declare function useSnapshot(observable: Observable | undefined | null, defaultValue: T): Snapshot; //# sourceMappingURL=use-snapshot.d.ts.map