UNPKG

juliette

Version:
16 lines (15 loc) 739 B
declare type NullOrUndefined = null | undefined; export declare type Reducer<S = null, P = null, R = S extends NullOrUndefined ? null : P extends NullOrUndefined ? (state: S) => S : (state: S, payload: P) => S> = R; export interface Handler<S = null, P = null> { readonly metaKey?: string; readonly type: string; readonly featureKey?: string; readonly reducer: Reducer<S, P>; readonly payload: P; } export declare type HandlerCreator<S = null, P = null, HC = P extends NullOrUndefined ? () => Handler<S, P> : (payload: P) => Handler<S, P>> = HC & { type: string; }; export declare type Dispatch = (handler: Handler<any, any>) => void; export declare type Selector<S, R> = (state: S) => R; export {};