import { BehaviorSubject, Observable, Subject } from 'rxjs'; import { AnyAction, Reducer, Constants, Dispatch } from './utils'; export interface CreateStateRxOpts { name?: string; autoRun?: boolean; effects?: (srx: Api) => E; reducer?: (state: State, action: AnyAction) => State; } export interface CreateStateRxApi { name: string; state$: BehaviorSubject; action$: Observable>; get: () => S; set: (data: S | ((val: S) => S)) => { type: string; data: S; }; reset: () => { type: string; }; dispatch: (action: A) => A; _dispatchers$: Subject>>; } export interface CloneApi { clone: (initialState?: State) => Api & Effects; } declare type CreateReducer = (params: { constant: Constants; }) => Reducer; declare type CreateActions = (params: { constant: Constants; get: () => S; dispatch: Dispatch; }) => A; declare type CreateSelectors = (state$: BehaviorSubject) => R; export declare const createStateRx: >(initialState: State, options: CreateStateRxOpts, overrides: { state$: BehaviorSubject; constants: ConstantsArray; createReducer: CreateReducer; createActions: CreateActions; createSelectors?: CreateSelectors | undefined; }) => Api & CloneApi & Effects; export {};