import * as rx from 'rxjs'; import { Action, ActionFunctions, InferPayload, ActionMeta, ArrayOrTuple, ControllerCore, Dispatch, DispatchFor, CoreOptions } from './stream-core'; export * from './stream-core'; export type InferMapParam = [ActionMeta, ...InferPayload]; type DispatchAndObserveRes = (waitForAction$: rx.Observable>, ...params: InferPayload) => rx.Observable>; type DispatchForAndObserveRes = (waitForAction$: rx.Observable>, relateToActionMeta: ActionMeta | ArrayOrTuple | null, ...params: InferPayload) => rx.Observable>; export declare class RxController { opts?: (CoreOptions & { debugTableAction?: boolean | undefined; }) | undefined; core: ControllerCore; dispatcher: { [K in keyof I]: Dispatch; }; dispatcherFor: { [K in keyof I]: DispatchFor; }; /** abbrevation of property "dispatcher", exactly same instance of dispatcher */ dp: { [K in keyof I]: Dispatch; }; /** abbrevation of property "dispatcherFor", exactly same instance of dispatcherFor */ dpf: { [K in keyof I]: DispatchFor; }; dispatchAndObserveRes: { [K in keyof I]: DispatchAndObserveRes; }; /** abbrevation of property "dispatchAndObserveRes", exactly same instance of dispatchAndObserveRes */ do: { [K in keyof I]: DispatchAndObserveRes; }; dispatchForAndObserveRes: { [K in keyof I]: DispatchForAndObserveRes; }; /** abbrevation of dispatchForAndObserveRes */ dfo: { [K in keyof I]: DispatchForAndObserveRes; }; payloadByType: { [K in keyof I]: rx.Observable<[ActionMeta, ...InferPayload]>; }; /** abbrevation of payloadByType */ pt: { [K in keyof I]: rx.Observable<[ActionMeta, ...InferPayload]>; }; actionByType: { [K in keyof I]: rx.Observable>; }; /** abbrevation of actionByType */ at: { [K in keyof I]: rx.Observable>; }; updateInterceptor: ControllerCore['updateInterceptor']; constructor(opts?: (CoreOptions & { debugTableAction?: boolean | undefined; }) | undefined); /** change CoreOptions's "name" property which is displayed in actions log for developer to identify which stream the action log entry * belongs to */ setName(value: string): void; createAction(type: K, ...params: InferPayload): Action; /** This method internally uses [groupBy](https://rxjs.dev/api/index/function/groupBy#groupby) */ groupControllerBy(keySelector: (action: Action) => K, groupedCtlOptionsFn?: (key: K) => CoreOptions): rx.Observable<[newGroup: GroupedRxController, allGroups: Map>]>; /** * create a new RxController whose action$ is filtered for action types that is included in `actionTypes` */ subForTypes | ReadonlyArray>(actionTypes: KS, opts?: CoreOptions>): RxController>; /** * create a new RxController whose action$ is filtered for action types that is included in `actionTypes` */ subForExcludeTypes | ReadonlyArray>(excludeActionTypes: KS, opts?: CoreOptions>): RxController>; /** * Delegate to `this.core.action$.connect()` * "core.action$" is a `connectable` observable, under the hood, it is like `action$ = connectable(actionUpstream)`. * * By default `connect()` will be immediately invoked in constructor function, when "options.autoConnect" is * `undefined` or `true`, in that case you don't need to call this method manually. * * Refer to [connectable](https://rxjs.dev/api/index/function/connectable) */ connect(): void; } export declare class GroupedRxController extends RxController { key: K; constructor(key: K, opts?: CoreOptions); } /** * If we consider ActionTable a 2-dimentional data structure, this is the infer type of it. * Each row is latest action payload of an action type (or name), * each column is a element of payload content array. * * If you use ActionTable as a frontend UI state (like for a UI template), this infer type * defines exactly data structure of it. * */ export type ActionTableDataType> = { [P in KS[number]]: InferPayload | []; }; export declare class ActionTable> { #private; private streamCtl; actionNames: KS; latestPayloads: { [K in KS[number]]: rx.Observable<[ActionMeta, ...InferPayload]>; }; /** Abbrevation of "latestPayloads", pointing to exactly same instance of latestPayloads */ l: { [K in KS[number]]: rx.Observable<[ActionMeta, ...InferPayload]>; }; get dataChange$(): rx.Observable>; private data; actionSnapshot: Map]>; private actionNamesAdded$; constructor(streamCtl: RxController, actionNames: KS); getData(): ActionTableDataType; /** Add actions to be recoreded in table map, by create `ReplaySubject(1)` for each action payload stream respectively */ addActions>(...actionNames: M): ActionTable; private onAddActions; getLatestActionOf(actionName: K): InferMapParam | undefined; protected debugLogLatestActionOperator>(type: K): rx.OperatorFunction; } /** Rx operator function */ export declare function actionRelatedToAction>(actionOrMeta: { i: ActionMeta['i']; }): (up: rx.Observable) => rx.Observable; /** Rx operator function */ export declare function payloadRelatedToAction(actionOrMeta: { i: ActionMeta['i']; }): (up: rx.Observable) => rx.Observable; export declare function serializeAction(action: Action): { t: string; p: InferPayload; i: number; r?: number | number[] | undefined; }; /** * Create a new Action with same "p", "i" and "r" properties and dispatched to RxController, * but changed "t" property which comfort to target "toRxController" * @return that dispatched new action object */ export declare function deserializeAction(actionObj: any, toController: RxController): Action;