import type { ObservableStore } from "../store/ObservableStore";
import type { State } from "../reducers";
import type { ActionFactory, ActionFactoryConstructor, ActionFn, ActionMessage, ActionOptions, ActionRegistration, DispatchState, GetStoreState } from "./ActionTypes";
import { InternalState } from "../internal/InternalState";
export interface ActionInterceptorNext {
(): any;
}
export interface ActionInterceptor {
(reg: ActionRegistration, next: ActionInterceptorNext, ...args: any[]): any;
}
/**
* Create a fully qualified action type
*
* @param leaf
* @param type
*
* @returns {string}
*/
export declare function createLeafActionType(leaf: string, type: string): string;
export declare function createActionRegistration = ActionFactoryConstructor, K extends string | A["leaf"] = A["leaf"]>(actionFactoryCtor: F, leaf: string | K, type: string, action: ActionFn, options?: ActionOptions): ActionRegistration;
export declare const getGlobalStore: () => ObservableStore;
export declare const getGlobalStoreState: () => any;
/**
* Get the current store state get
* function - usually set when a new state is created
*
* @returns {GetStoreState}
*/
export declare function getGlobalStateProvider(): GetStoreState;
/**
* Get the current store
* dispatch function
*
* @returns {DispatchState}
*/
export declare function getGlobalDispatchProvider(): DispatchState;
/**
* Get the stores internal state
*
* @returns {GetStoreState|any}
*/
export declare function getGlobalStoreInternalState(): InternalState;
/**
* Set the global store provider
*
* @param newStore
*/
export declare function setGlobalStore(newStore: Store): void;
export declare class ActionContainer {
store: ObservableStore;
registeredActions: {
[actionType: string]: ActionRegistration;
};
actionInterceptors: ActionInterceptor[];
constructor(store: ObservableStore);
/**
* Add an interceptor
*
* @param interceptor
* @returns {()=>undefined}
*/
addActionInterceptor(interceptor: ActionInterceptor): () => void;
/**
* Execute an interceptor at a specific index
*
* @param index
* @param reg
* @param actionId
* @param action
* @param args
* @returns {any}
*/
executeActionInterceptor(index: number, reg: ActionRegistration, actionId: string, action: Function, args: any[]): any;
/**
* Execute a given action chain
*
* @param reg
* @param actionFn
* @param args
* @returns {any|any}
*/
executeActionChain(reg: ActionRegistration, actionFn: Function, ...args: any[]): any;
/**
* Register an action from a decoration usually
*
* @param reg
* @return {ActionRegistration}
*/
registerAction = ActionFactoryConstructor, K extends A["leaf"] = A["leaf"]>(reg: ActionRegistration): ActionRegistration;
/**
* Retrieve a registered leaf action
*
* @param leaf
* @param type
* @returns {ActionRegistration}
*/
getAction(leaf: string, type: string): ActionRegistration;
getAllActions(): {
[actionType: string]: ActionRegistration, ActionFactory, ActionMessage>, any>, ActionFn>;
};
}