@lomray/react-mobx-manager 2.1.2-beta.2 → 2.1.2-beta.4

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 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-1245f290.js";
5
+ import { TStores } from "./types-70019566.js";
6
6
  interface IStoreManagerProvider {
7
7
  storeManager: Manager;
8
8
  shouldInit?: boolean;
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./types-1245f290.js";
1
+ export * from "./types-70019566.js";
2
2
  export * from "./context.js";
3
3
  export { default as Manager } from "./manager.js";
4
4
  export { default as onChangeListener } from "./on-change-listener.js";
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, TAnyStore } from "./types-1245f290.js";
2
+ import { IConstructableStore, IManagerOptions, IManagerParams, IStorage, IStoreParams, TAnyStore, TInitStore, TStoreDefinition, TStores } from "./types-70019566.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-1245f290.js").IStore>>;
14
+ protected readonly stores: Map<string, TInitStore<import("./types-70019566.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 extends TAnyStore>(store: IConstructableStore<T>, params?: IStoreParams): T | undefined;
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<T extends TAnyStore>(id: string, params: IStoreParams): TInitStore<T> | undefined;
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 extends TAnyStore>(store: IConstructableStore<T>, params: Omit<Required<IStoreParams>, 'key'>): 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 extends TAnyStore>(store: IConstructableStore<TSt>, id: string): IConstructableStore<TSt>;
212
+ static persistStore<TSt>(store: IConstructableStore<TSt>, id: string): IConstructableStore<TSt>;
215
213
  }
216
214
  export { Manager as default };
@@ -1,4 +1,4 @@
1
- import { IStorePersisted } from "./types-1245f290.js";
1
+ import { IStorePersisted } from "./types-70019566.js";
2
2
  /**
3
3
  * Listen persist store changes
4
4
  */
@@ -1,4 +1,4 @@
1
- import { IStorage } from "../types-1245f290.js";
1
+ import { IStorage } from "../types-70019566.js";
2
2
  interface IAsyncStorage {
3
3
  getItem: (key: string) => Promise<string | null>;
4
4
  setItem: (key: string, value: string) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { IStorage } from "../types-1245f290.js";
1
+ import { IStorage } from "../types-70019566.js";
2
2
  /**
3
3
  * Local storage for mobx store manager
4
4
  */
@@ -1,4 +1,4 @@
1
- import { TInitStore } from "./types-1245f290.js";
1
+ import { TInitStore } from "./types-70019566.js";
2
2
  interface IPromise<TReturn> extends Promise<TReturn> {
3
3
  status?: 'fulfilled' | 'pending' | 'rejected';
4
4
  value?: TReturn;
@@ -12,7 +12,7 @@ declare global {
12
12
  }
13
13
  interface IConstructorParams<TProps = Record<string, any>> {
14
14
  storeManager: Manager;
15
- getStore: <T extends TAnyStore>(store: IConstructableStore<T>, params?: Partial<IStoreParams>) => T | undefined;
15
+ getStore: <T>(store: IConstructableStore<T>, params?: Partial<IStoreParams>) => T | undefined;
16
16
  componentProps: TProps;
17
17
  }
18
18
  interface IStoreLifecycle {
@@ -34,8 +34,8 @@ interface IStorePersisted extends IStore {
34
34
  addOnChangeListener?: (store: IStorePersisted, manager: Manager) => (() => void) | undefined;
35
35
  wakeup?: TWakeup;
36
36
  }
37
- type TInitStore<TSto extends TAnyStore = IStore> = TSto & (IStorePersisted | IStore);
38
- type IConstructableStore<TSto extends IStore = IStore> = (new (props: IConstructorParams) => TInitStore<TSto>) & Partial<IStorePersisted>;
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
  */
package/lib/wakeup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { TStores, TWakeup } from "./types-1245f290.js";
1
+ import { TStores, TWakeup } from "./types-70019566.js";
2
2
  /**
3
3
  * Restore persisted store state
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { TMapStores, IWithStoreOptions } from "./types-1245f290.js";
2
+ import { TMapStores, IWithStoreOptions } from "./types-70019566.js";
3
3
  /**
4
4
  * Make component observable and pass stores as props
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/react-mobx-manager",
3
- "version": "2.1.2-beta.2",
3
+ "version": "2.1.2-beta.4",
4
4
  "description": "This package provides Mobx stores manager for react.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",