whycq
2024-03-28 e17108966ccfcaee2bef8d981601c79c8716e304
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Store, MutationPayload } from "vuex";
interface Storage {
    getItem: (key: string) => any;
    setItem: (key: string, value: any) => void;
    removeItem: (key: string) => void;
}
interface Options<State> {
    key?: string;
    paths?: string[];
    reducer?: (state: State, paths: string[]) => object;
    subscriber?: (store: Store<State>) => (handler: (mutation: any, state: State) => void) => void;
    storage?: Storage;
    getState?: (key: string, storage: Storage) => any;
    setState?: (key: string, state: any, storage: Storage) => void;
    filter?: (mutation: MutationPayload) => boolean;
    arrayMerger?: (state: any[], saved: any[]) => any;
    rehydrated?: (store: Store<State>) => void;
    fetchBeforeUse?: boolean;
    overwrite?: boolean;
    assertStorage?: (storage: Storage) => void | Error;
}
export default function <State>(options?: Options<State>): (store: Store<State>) => void;
export {};