valtio-define 1.1.4 → 1.1.5
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.
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as GettersReturnType, c as PluginContext, d as StoreDefine, f as StoreDefineOptions, h as SubscribeKey, i as Getters, l as Signal, m as Subscribe, n as ActionsOmitThisParameter, o as Patch, p as StoreOptions, r as ActionsTree, s as Plugin, t as Actions, u as Store } from "./types-
|
|
1
|
+
import { a as GettersReturnType, c as PluginContext, d as StoreDefine, f as StoreDefineOptions, h as SubscribeKey, i as Getters, l as Signal, m as Subscribe, n as ActionsOmitThisParameter, o as Patch, p as StoreOptions, r as ActionsTree, s as Plugin, t as Actions, u as Store } from "./types-BW_uQuTb.mjs";
|
|
2
2
|
import { Snapshot } from "valtio";
|
|
3
3
|
import { Dispatch, SetStateAction } from "react";
|
|
4
4
|
|
|
@@ -35,7 +35,7 @@ declare function use(plugin: Plugin): void;
|
|
|
35
35
|
*
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
declare function defineStore<S extends object, A extends Actions<S
|
|
38
|
+
declare function defineStore<S extends object = {}, A extends Actions<S> = {}, G extends Getters<S> = {}>(define: StoreDefine<S, A, G>): Store<S, A, G>;
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/hooks.d.ts
|
|
41
41
|
interface UseStoreOptions {
|
|
@@ -27,7 +27,7 @@ interface Patch<S, G extends Getters<S>> {
|
|
|
27
27
|
(patch: Partial<S> | ((state: S & GettersReturnType<G>) => void)): void;
|
|
28
28
|
}
|
|
29
29
|
interface StoreOptions {}
|
|
30
|
-
type Store<S, A extends Actions<S
|
|
30
|
+
type Store<S, A extends Actions<S>, G extends Getters<S>> = {
|
|
31
31
|
$subscribe: Subscribe<S, G>;
|
|
32
32
|
$subscribeKey: SubscribeKey<S, G>;
|
|
33
33
|
$patch: Patch<S, G>;
|
package/package.json
CHANGED