-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.d.ts
19 lines (19 loc) · 988 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Action, AnyAction, Reducer, ReducersMapObject } from 'redux';
declare const REMEMBER_REHYDRATED = "@@REMEMBER_REHYDRATED";
declare const REMEMBER_PERSISTED = "@@REMEMBER_PERSISTED";
type SerializeFunction = (data: any, key: string) => any;
type UnserializeFunction = (data: any, key: string) => any;
type Driver = {
getItem: (key: string) => any;
setItem: (key: string, value: any) => any;
};
type Options = {
prefix: string;
serialize: SerializeFunction;
unserialize: UnserializeFunction;
persistThrottle: number;
persistWholeStore: boolean;
};
declare const rememberReducer: <S = any, A extends Action<any> = AnyAction>(reducer: Reducer<S, A> | ReducersMapObject<S, A>) => Reducer<S, A>;
declare const rememberEnhancer: (driver: Driver, rememberedKeys: string[], { prefix, serialize, unserialize, persistThrottle, persistWholeStore }?: Partial<Options>) => any;
export { rememberReducer, rememberEnhancer, REMEMBER_REHYDRATED, REMEMBER_PERSISTED };