import { Observable, Observer, Subject, Subscription } from 'rxjs'; import { Args, RemeshDomain, RemeshDomainAction, RemeshDomainContext, RemeshDomainDefinition, RemeshDomainPreloadOptions, RemeshEffect, RemeshAction, RemeshEvent, RemeshExtern, RemeshExternImpl, RemeshQuery, RemeshQueryAction, RemeshState, RemeshStateItem, RemeshSubscribeOnlyEvent, Serializable, VerifiedRemeshDomainDefinition, DefaultStateValue } from './remesh'; export type PreloadedState = Record; export type RemeshStore = ReturnType; export type RemeshStateStorage = { id: number; type: 'RemeshStateStorage'; State: RemeshState; stateItem: RemeshStateItem; currentState: DefaultStateValue | T; downstreamSet: Set>; }; export type RemeshQueryStorage, U> = { id: number; type: 'RemeshQueryStorage'; Query: RemeshQuery; arg: T[0]; key: string; currentValue: U; upstreamSet: Set | RemeshStateStorage>; downstreamSet: Set>; subject: Subject; innerRefCount: number; outerRefCount: number; status: 'default' | 'wip' | 'updated'; wipUpstreamSet: Set | RemeshStateStorage>; }; export type RemeshEventStorage = { id: number; type: 'RemeshEventStorage'; Event: RemeshEvent; subject: Subject; observable: Observable; innerRefCount: number; outerRefCount: number; }; export type RemeshDomainStorage> = { id: number; type: 'RemeshDomainStorage'; Domain: RemeshDomain; key: string; arg: U[0]; domain: VerifiedRemeshDomainDefinition; domainContext: RemeshDomainContext; domainAction: RemeshDomainAction; upstreamSet: Set>; downstreamSet: Set>; preloadOptionsList: RemeshDomainPreloadOptions[]; preloadedPromise?: Promise; preloadedState: PreloadedState; effectList: RemeshEffect[]; effectMap: Map; stateMap: Map, RemeshStateStorage>; queryMap: Map>; eventMap: Map, RemeshEventStorage>; refCount: number; ignited: boolean; hasBeenPreloaded: boolean; isDiscarding: boolean; }; export type RemeshExternStorage = { id: number; type: 'RemeshExternStorage'; Extern: RemeshExtern; currentValue: T; }; export type RemeshStoreInspector = typeof RemeshStore; export type RemeshStoreOptions = { name?: string; externs?: RemeshExternImpl[]; inspectors?: (RemeshStoreInspector | false | undefined | null)[]; preloadedState?: PreloadedState; }; export declare const RemeshStore: (options?: RemeshStoreOptions) => { name: string | undefined; getDomain: , U extends Args>(domainAction: RemeshDomainAction) => VerifiedRemeshDomainDefinition; igniteDomain: , U_1 extends Args>(domainAction: RemeshDomainAction) => void; discardDomain: , U_2 extends Args>(domainAction: RemeshDomainAction) => void; query: , U_3>(queryAction: RemeshQueryAction) => U_3; send: (output: RemeshAction) => void; discard: () => void; preload: , U_4 extends Args>(domainAction: RemeshDomainAction) => Promise; getPreloadedState: () => PreloadedState; getDomainPreloadedState: , U_5 extends Args>(domainAction: RemeshDomainAction) => PreloadedState; subscribeDomain: , U_6 extends Args>(domainAction: RemeshDomainAction) => Subscription; subscribeQuery: , U_7>(queryAction: RemeshQueryAction, subscriber: Partial> | ((data: U_7) => unknown)) => Subscription; subscribeEvent: (Event: RemeshEvent | RemeshSubscribeOnlyEvent, subscriber: (event: U_8) => unknown) => Subscription; getKey: , U_9>(input: RemeshQueryAction | RemeshDomainAction, any>) => string; };