-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
executable file
·40 lines (40 loc) · 1.45 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
declare module 'vue-local-storage-decorator' {
import Vue, { PluginFunction, WatchOptions } from 'vue'
module "vue/types/vue" {
interface Vue {
/**
* Get persist data by persist key
* @param key
*/
getPersistData<T>(key: string): T | null
/**
* Do not call it when multiple same name component with multiple dataset
*
* The data in local storage will like that: {component name: requested data key} and {requested data key: requested data}
*
* It will get the data from local storage and set the data in the component while created lifecycle
* @param {string} dataKey
* @memberof Vue
*/
persistData(dataKey: string): void
/**
* For normal persist the data by specify persist key and data key
*
* It will not retrieve the data automatically in the lifecycle
* @param key
* @param dataKey
*/
persistDataWithProvidedKey(key: string, dataKey: string): void
/**
* Persist the data by given key and value. If the value is object, it will convert to json automatically
*
* It will not retrieve the data automatically in the lifecycle
* @param key
* @param value
*/
persistDataByKeyValue(key:string, value: any): void
}
}
export function Persist(options?: WatchOptions): (target: Vue, key: string) => void;
export function install (): PluginFunction<any>
}