import { DictionaryLike, ReadonlyObjectMapLike } from "../collections.js"; import { CacheLike, DeferredObservableLike, PureDeferredObservableLike, PureRunnableLike, SchedulerLike, StreamLike, StreamableLike } from "../concurrent.js"; import { EventSourceLike } from "../events.js"; import { Equality, Factory, Function1, Function2, Optional, Reducer, Updater } from "../functions.js"; import { BackpressureStrategy } from "../utils.js"; /** * @noInheritDoc */ export interface StreamableModule { actionReducer(reducer: Reducer, initialState: Factory, options?: { readonly equality?: Equality; }): StreamableLike; animationGroup(animationGroup: ReadonlyObjectMapLike> | PureRunnableLike>, options?: { readonly mode: "switching"; readonly scheduler?: SchedulerLike; } | { readonly mode: "blocking"; readonly scheduler?: SchedulerLike; } | { readonly mode: "queueing"; readonly scheduler?: SchedulerLike; readonly backpressureStrategy?: BackpressureStrategy; readonly capacity?: number; }): StreamableLike & DictionaryLike>>; create(op: Function1, DeferredObservableLike>): StreamableLike>; eventHandler(op: Function1, options?: { readonly mode: "switching"; } | { readonly mode: "blocking"; } | { readonly mode: "queueing"; readonly backpressureStrategy?: BackpressureStrategy; readonly capacity?: number; }): StreamableLike; identity(): StreamableLike>; inMemoryCache(options?: { readonly capacity?: number; readonly cleanupScheduler?: SchedulerLike; }): StreamableLike, Optional>>, never, CacheLike>; persistentCache(persistentStore: { load(keys: ReadonlySet): DeferredObservableLike>>>; store(updates: Readonly>): DeferredObservableLike; }, options?: { readonly capacity?: number; readonly cleanupScheduler?: SchedulerLike; }): StreamableLike, Optional>>, never, CacheLike>; /** * Returns a new `StateStoreLike` instance that stores state which can * be updated by notifying the instance with a `StateUpdater` that computes a * new state based upon the previous state. * * @param initialState - The initial accumulation value. * @param equals - Optional equality function that is used to compare * if a state value is distinct from the previous one. * */ stateStore(initialState: Factory, options?: { readonly equality?: Equality; }): StreamableLike, T>; syncState(onInit: Function1>>, onChange: Function2>>, options?: { readonly throttleDuration?: number; }): Function1, T>, StreamableLike, T>>; } export type Signature = StreamableModule; export declare const create: Signature["create"]; export declare const actionReducer: Signature["actionReducer"]; export declare const animationGroup: Signature["animationGroup"]; export declare const eventHandler: Signature["eventHandler"]; export declare const identity: Signature["identity"]; export declare const inMemoryCache: Signature["inMemoryCache"]; export declare const persistentCache: Signature["persistentCache"]; export declare const stateStore: Signature["stateStore"]; export declare const syncState: Signature["syncState"];