core-native
Version:
A lightweight framework based on React Native + Redux + Redux Saga, in strict TypeScript.
31 lines (30 loc) • 1.69 kB
TypeScript
import { ActionHandler } from "../module";
import { Module } from "../platform/Module";
import { State } from "../reducer";
import { Logger } from "../Logger";
import { SagaGenerator } from "../typed-saga";
export { Interval } from "./Interval";
export { Loading } from "./Loading";
export { Log } from "./Log";
export { Mutex } from "./Mutex";
export { RetryOnNetworkConnectionError } from "./RetryOnNetworkConnectionError";
export { SilentOnNetworkConnectionError } from "./SilentOnNetworkConnectionError";
/**
* Decorator type declaration, required by TypeScript.
*/
declare type HandlerDecorator = (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<ActionHandler>) => TypedPropertyDescriptor<ActionHandler>;
declare type VoidFunctionDecorator = (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => void>) => TypedPropertyDescriptor<(...args: any[]) => void>;
declare type ActionHandlerWithMetaData = ActionHandler & {
actionName: string;
maskedParams: string;
};
declare type HandlerInterceptor<RootState extends State = State> = (handler: ActionHandlerWithMetaData, thisModule: Module<RootState, any>) => SagaGenerator;
declare type FunctionInterceptor<S> = (handler: () => void, rootState: Readonly<S>, logger: Logger) => void;
/**
* A helper for ActionHandler functions (Saga).
*/
export declare function createActionHandlerDecorator<RootState extends State = State>(interceptor: HandlerInterceptor<RootState>): HandlerDecorator;
/**
* A helper for regular functions.
*/
export declare function createRegularDecorator<S extends State = State>(interceptor: FunctionInterceptor<S>): VoidFunctionDecorator;