Installation
npm install --save @types/redux-localstorage
Summary
This package contains type definitions for redux-localstorage (https://github.com/elgerlambert/redux-localstorage).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-localstorage.
import * as Redux from "redux";
export interface ActionTypes {
INIT: string;
}
export type AdapterCallback = <A>(err?: any, result?: A) => void;
export interface StorageAdapter<A> {
0: A;
put(key: string, value: any, callback: AdapterCallback): void;
get(key: string, callback: AdapterCallback): void;
del(key: string, callback: AdapterCallback): void;
}
export type StorageAdapterCreator<A> = (storage: A) => StorageAdapter<A>;
export interface StorageAdapterEnhancer {}
export function mergePersistedState(
merge?: <A1, A2>(initialState: A1, persistentState: A2) => A1 & A2,
): <A>(next: Redux.Reducer<A>) => Redux.Reducer<A>;
export default function persistState<A>(
storage?: StorageAdapter<A>,
key?: string,
callback?: Function,
): Redux.GenericStoreEnhancer;
export function transformState<A1, A2>(
down: ((state: A1) => A2) | Array<(state: any) => any>,
up: ((state: A2) => A1) | Array<(state: any) => any>,
): (storage: StorageAdapter<A1>) => A2;
export const actionTypes: ActionTypes;
Additional Details
- Last updated: Wed, 18 Oct 2023 11:45:06 GMT
- Dependencies: redux
Credits
These definitions were written by Karol Janyst.