Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 8604091

Browse files
Added typescript declarations. Closes #91
1 parent 9fcb3fe commit 8604091

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Store, MutationPayload } from 'vuex';
2+
3+
interface Options {
4+
key?: string;
5+
paths?: string[];
6+
reducer?: (state: any, paths: string[]) => object;
7+
subscriber?: (store: typeof Store) => (handler: () => void) => void;
8+
storage?: Storage;
9+
getState?: (key: string, storage: Storage) => any;
10+
setState?: (key: string, state: typeof Store, storage: Storage) => void;
11+
filter?: (mutation: MutationPayload) => boolean;
12+
}
13+
14+
export default function createPersistedState(options?: Options): any;

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
"module": "dist/vuex-persistedstate.es.js",
1919
"jsnext:main": "dist/vuex-persistedstate.es.js",
2020
"umd:main": "dist/vuex-persistedstate.umd.js",
21+
"typings": "./vuex-persistedstate.d.ts",
2122
"files": [
22-
"dist"
23+
"dist",
24+
"index.d.ts",
25+
"index.js"
2326
],
2427
"scripts": {
2528
"build": "rimraf dist && microbundle --external all --name createPersistedState index.js",

0 commit comments

Comments
 (0)