@lomray/react-mobx-manager 2.1.2-beta.2 → 2.1.2-beta.3
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/lib/context.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/manager.d.ts +6 -8
- package/lib/on-change-listener.d.ts +1 -1
- package/lib/storages/async-storage.d.ts +1 -1
- package/lib/storages/local-storage.d.ts +1 -1
- package/lib/suspense-query.d.ts +1 -1
- package/lib/{types-1245f290.d.ts → types-a4b71460.d.ts} +4 -4
- package/lib/wakeup.d.ts +1 -1
- package/lib/with-stores.d.ts +1 -1
- package/package.json +1 -1
package/lib/context.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FC, ReactElement } from "react";
|
|
4
4
|
import Manager from "./manager.js";
|
|
5
|
-
import { TStores } from "./types-
|
|
5
|
+
import { TStores } from "./types-a4b71460.js";
|
|
6
6
|
interface IStoreManagerProvider {
|
|
7
7
|
storeManager: Manager;
|
|
8
8
|
shouldInit?: boolean;
|
package/lib/index.d.ts
CHANGED
package/lib/manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StoreStatus from "./store-status.js";
|
|
2
|
-
import { IConstructableStore, IManagerOptions, IManagerParams, IStorage, IStoreParams, TInitStore, TStoreDefinition, TStores
|
|
2
|
+
import { IConstructableStore, IManagerOptions, IManagerParams, IStorage, IStoreParams, TAnyStore, TInitStore, TStoreDefinition, TStores } from "./types-a4b71460.js";
|
|
3
3
|
/**
|
|
4
4
|
* Mobx stores manager
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ declare class Manager {
|
|
|
11
11
|
/**
|
|
12
12
|
* Created stores
|
|
13
13
|
*/
|
|
14
|
-
protected readonly stores: Map<string, TInitStore<import("./types-
|
|
14
|
+
protected readonly stores: Map<string, TInitStore<import("./types-a4b71460.js").IStore>>;
|
|
15
15
|
/**
|
|
16
16
|
* Relations between stores
|
|
17
17
|
* @protected
|
|
@@ -123,14 +123,14 @@ declare class Manager {
|
|
|
123
123
|
/**
|
|
124
124
|
* Get exist store
|
|
125
125
|
*/
|
|
126
|
-
getStore<T
|
|
126
|
+
getStore<T>(store: IConstructableStore<T>, params?: IStoreParams): T | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* Lookup store
|
|
129
129
|
*/
|
|
130
130
|
/**
|
|
131
131
|
* Lookup store
|
|
132
132
|
*/
|
|
133
|
-
protected lookupStore
|
|
133
|
+
protected lookupStore(id: string, params: IStoreParams): TInitStore<TAnyStore> | undefined;
|
|
134
134
|
/**
|
|
135
135
|
* Create new store instance
|
|
136
136
|
* @protected
|
|
@@ -139,7 +139,7 @@ declare class Manager {
|
|
|
139
139
|
* Create new store instance
|
|
140
140
|
* @protected
|
|
141
141
|
*/
|
|
142
|
-
protected createStore<T
|
|
142
|
+
protected createStore<T>(store: IConstructableStore<T>, params: Omit<Required<IStoreParams>, 'key'>): T;
|
|
143
143
|
/**
|
|
144
144
|
* Create stores for component
|
|
145
145
|
*/
|
|
@@ -198,11 +198,9 @@ declare class Manager {
|
|
|
198
198
|
toPersistedJSON(): Record<string, any>;
|
|
199
199
|
/**
|
|
200
200
|
* Get observable store props (fields)
|
|
201
|
-
* @private
|
|
202
201
|
*/
|
|
203
202
|
/**
|
|
204
203
|
* Get observable store props (fields)
|
|
205
|
-
* @private
|
|
206
204
|
*/
|
|
207
205
|
static getObservableProps(store: TAnyStore): Record<string, any>;
|
|
208
206
|
/**
|
|
@@ -211,6 +209,6 @@ declare class Manager {
|
|
|
211
209
|
/**
|
|
212
210
|
* Persist store
|
|
213
211
|
*/
|
|
214
|
-
static persistStore<TSt
|
|
212
|
+
static persistStore<TSt>(store: IConstructableStore<TSt>, id: string): IConstructableStore<TSt>;
|
|
215
213
|
}
|
|
216
214
|
export { Manager as default };
|
package/lib/suspense-query.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare global {
|
|
|
12
12
|
}
|
|
13
13
|
interface IConstructorParams<TProps = Record<string, any>> {
|
|
14
14
|
storeManager: Manager;
|
|
15
|
-
getStore: <T
|
|
15
|
+
getStore: <T>(store: IConstructableStore<T>, params?: Partial<IStoreParams>) => T | undefined;
|
|
16
16
|
componentProps: TProps;
|
|
17
17
|
}
|
|
18
18
|
interface IStoreLifecycle {
|
|
@@ -34,15 +34,15 @@ interface IStorePersisted extends IStore {
|
|
|
34
34
|
addOnChangeListener?: (store: IStorePersisted, manager: Manager) => (() => void) | undefined;
|
|
35
35
|
wakeup?: TWakeup;
|
|
36
36
|
}
|
|
37
|
-
type TInitStore<TSto
|
|
38
|
-
type IConstructableStore<TSto
|
|
37
|
+
type TInitStore<TSto = IStore> = TSto & TAnyStore;
|
|
38
|
+
type IConstructableStore<TSto = IStore> = (new (props: IConstructorParams) => TInitStore<TSto>) & Partial<IStorePersisted>;
|
|
39
39
|
/**
|
|
40
40
|
* Store params
|
|
41
41
|
*/
|
|
42
42
|
type IStoreConfig = {
|
|
43
43
|
id?: string;
|
|
44
44
|
};
|
|
45
|
-
type TStoreDefinition<TSto
|
|
45
|
+
type TStoreDefinition<TSto = TAnyStore> = IConstructableStore<TSto> | ({
|
|
46
46
|
store: IConstructableStore<TSto>;
|
|
47
47
|
} & IStoreConfig);
|
|
48
48
|
type TMapStores = Record<string, TStoreDefinition>;
|
package/lib/wakeup.d.ts
CHANGED
package/lib/with-stores.d.ts
CHANGED