import { FanOut } from './fanout'; /** React.js synchronous state interface. */ export interface SyncStore { subscribe: SyncStoreSubscribe; getSnapshot: () => T; } export type SyncStoreSubscribe = (callback: () => void) => SyncStoreUnsubscribe; export type SyncStoreUnsubscribe = () => void; export type SyncDep = SyncValue & SyncStore & FanOut; export type WrapListInSyncDep = { [K in keyof T]: SyncDep; }; export interface Disposable { dispose(): void; } export interface SyncValue { value: T; } export declare class Value extends FanOut implements SyncStore, SyncValue { constructor(value: V); next(value: V, force?: boolean): void; /** ----------------------------------------------------- {@link SyncValue} */ value: V; /** ----------------------------------------------------- {@link SyncStore} */ readonly subscribe: SyncStoreSubscribe; readonly getSnapshot: () => V; } export declare class Computed extends FanOut implements SyncValue, SyncStore, Disposable { protected readonly deps: WrapListInSyncDep; protected readonly compute: (args: V) => N; private cache; private subs; constructor(deps: WrapListInSyncDep, compute: (args: V) => N); private _comp; /** ----------------------------------------------------- {@link SyncValue} */ get value(): N; /** ----------------------------------------------------- {@link SyncStore} */ readonly subscribe: SyncStoreSubscribe; readonly getSnapshot: () => N; /** ---------------------------------------------------- {@link Disposable} */ dispose(): void; } export declare const val: (initial: V) => Value; export declare const comp: (deps: WrapListInSyncDep, compute: (args: V) => N) => Computed;