You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
931 B
24 lines
931 B
4 years ago
|
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 {};
|