react-native-mmkv 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,63 +0,0 @@
1
- import React from 'react';
2
- import { MMKV, MMKVConfiguration } from './MMKV';
3
- export declare function useMMKV(configuration: MMKVConfiguration): React.RefObject<MMKV>;
4
- /**
5
- * Use the string value of the given `key` from the given MMKV storage instance.
6
- *
7
- * If no instance is provided, a shared default instance will be used.
8
- *
9
- * @example
10
- * ```ts
11
- * const [username, setUsername] = useMMKVString("user.name")
12
- * ```
13
- */
14
- export declare const useMMKVString: (key: string, instance?: MMKV | undefined) => [value: string | undefined, setValue: (value: string | ((current: string | undefined) => string | undefined) | undefined) => void];
15
- /**
16
- * Use the number value of the given `key` from the given MMKV storage instance.
17
- *
18
- * If no instance is provided, a shared default instance will be used.
19
- *
20
- * @example
21
- * ```ts
22
- * const [age, setAge] = useMMKVNumber("user.age")
23
- * ```
24
- */
25
- export declare const useMMKVNumber: (key: string, instance?: MMKV | undefined) => [value: number, setValue: (value: number | ((current: number) => number | undefined) | undefined) => void];
26
- /**
27
- * Use the boolean value of the given `key` from the given MMKV storage instance.
28
- *
29
- * If no instance is provided, a shared default instance will be used.
30
- *
31
- * @example
32
- * ```ts
33
- * const [isPremiumAccount, setIsPremiumAccount] = useMMKVBoolean("user.isPremium")
34
- * ```
35
- */
36
- export declare const useMMKVBoolean: (key: string, instance?: MMKV | undefined) => [value: boolean, setValue: (value: boolean | ((current: boolean) => boolean | undefined) | undefined) => void];
37
- /**
38
- * Use an object value of the given `key` from the given MMKV storage instance.
39
- *
40
- * If no instance is provided, a shared default instance will be used.
41
- *
42
- * The object will be serialized using `JSON`.
43
- *
44
- * @example
45
- * ```ts
46
- * const [user, setUser] = useMMKVObject<User>("user")
47
- * ```
48
- */
49
- export declare function useMMKVObject<T>(key: string, instance?: MMKV): [value: T | undefined, setValue: (value: T | undefined) => void];
50
- /**
51
- * Listen for changes in the given MMKV storage instance.
52
- * If no instance is passed, the default instance will be used.
53
- * @param valueChangedListener The function to call whenever a value inside the storage instance changes
54
- * @param instance The instance to listen to changes to (or the default instance)
55
- *
56
- * @example
57
- * ```ts
58
- * useMMKVListener((key) => {
59
- * console.log(`Value for "${key}" changed!`)
60
- * })
61
- * ```
62
- */
63
- export declare function useMMKVListener(valueChangedListener: (key: string) => void, instance?: MMKV): void;
@@ -1,2 +0,0 @@
1
- export * from './MMKV';
2
- export * from './hooks';