/** * A utility for emitting abd subscribing to changes to a value. * * @param initialState - The initial value of the subject. */ export declare function subject(initialState: T): Subject; export declare function pureSubject(initialValue: T, areEqual?: (current: T, next: T) => boolean): Subject; export declare type Subject = { /** * Emit a new state. * * @param state - The new state */ setState(state: T): void; /** * Get the current state. */ getState(): T; /** * Observe changes to the state. * * @param observer - A callback that is invoked when the value changes */ observe(observer: Observer): () => void; /** * Remove a observer from the list of observers * * @param observer - A callback that is invoked when the value changes */ unobserve(observer: Observer): void; }; export declare type Observer = { (state: T): void; };