@tramvai/state 2.149.1 → 2.150.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.
Files changed (49) hide show
  1. package/lib/connect/Provider.d.ts +1 -0
  2. package/lib/connect/Subscription.d.ts +1 -0
  3. package/lib/connect/connectAdvanced.d.ts +1 -0
  4. package/lib/connect/context.d.ts +1 -0
  5. package/lib/connect/hooks/index.d.ts +1 -0
  6. package/lib/connect/hooks/useActions.d.ts +1 -0
  7. package/lib/connect/hooks/useActions.test-types.d.ts +1 -0
  8. package/lib/connect/hooks/useConsumerContext.d.ts +1 -0
  9. package/lib/connect/hooks/useEvents.d.ts +1 -0
  10. package/lib/connect/hooks/useEvents.test-types.d.ts +1 -0
  11. package/lib/connect/hooks/useIsomorphicLayoutEffect.d.ts +1 -0
  12. package/lib/connect/hooks/useSelector.d.ts +1 -0
  13. package/lib/connect/hooks/useSelector.test-types.d.ts +1 -0
  14. package/lib/connect/hooks/useStore.d.ts +1 -0
  15. package/lib/connect/hooks/useStore.test-types.d.ts +1 -0
  16. package/lib/connect/hooks/useStoreSelector.d.ts +1 -0
  17. package/lib/connect/hooks/useStoreSelector.test-types.d.ts +1 -0
  18. package/lib/connect/index.d.ts +1 -0
  19. package/lib/connect/scheduling.d.ts +1 -0
  20. package/lib/connect/selectorFactory.d.ts +1 -0
  21. package/lib/connect/toProps/mapContextToProps.d.ts +1 -0
  22. package/lib/connect/toProps/mapStateToProps.d.ts +1 -0
  23. package/lib/connect/toProps/mergeProps.d.ts +3 -2
  24. package/lib/connect/toProps/types.d.ts +1 -0
  25. package/lib/connect/toProps/wrapMapToProps.d.ts +1 -0
  26. package/lib/connect/types.d.ts +1 -0
  27. package/lib/connect/utils/verifyFunction.d.ts +1 -0
  28. package/lib/connect/utils/verifyMapToProps.d.ts +1 -0
  29. package/lib/connect/utils/verifyPlainObject.d.ts +1 -0
  30. package/lib/createEvent/createEvent.d.ts +2 -1
  31. package/lib/createEvent/createEvent.h.d.ts +1 -0
  32. package/lib/createReducer/createReducer.d.ts +1 -0
  33. package/lib/createReducer/createReducer.h.d.ts +1 -0
  34. package/lib/createReducer/createReducer.test-types.d.ts +1 -0
  35. package/lib/devTools/constants.d.ts +1 -0
  36. package/lib/devTools/devTools.d.ts +1 -0
  37. package/lib/devTools/index.d.ts +1 -0
  38. package/lib/devTools/middleware.d.ts +1 -0
  39. package/lib/dispatcher/childDispatcherContext.d.ts +1 -0
  40. package/lib/dispatcher/dispatcher.d.ts +1 -0
  41. package/lib/dispatcher/dispatcher.h.d.ts +1 -0
  42. package/lib/dispatcher/dispatcherContext.d.ts +1 -0
  43. package/lib/dispatcher/storeSubscribe.d.ts +1 -0
  44. package/lib/index.d.ts +1 -0
  45. package/lib/logger.d.ts +1 -0
  46. package/lib/stores/BaseStore.d.ts +1 -0
  47. package/lib/stores/SimpleEmitter.d.ts +1 -0
  48. package/lib/typings.d.ts +1 -0
  49. package/package.json +3 -3
@@ -5,3 +5,4 @@ export declare const Provider: ({ context, children, serverState, }: {
5
5
  children: ReactElement;
6
6
  serverState?: ServerState;
7
7
  }) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=Provider.d.ts.map
@@ -12,3 +12,4 @@ export declare class Subscription {
12
12
  trySubscribe(): void;
13
13
  tryUnsubscribe(): void;
14
14
  }
15
+ //# sourceMappingURL=Subscription.d.ts.map
@@ -12,3 +12,4 @@ export declare function connectAdvanced(selectorFactory: (context: ConsumerConte
12
12
  schedule?: ((fn: Function) => any) | undefined;
13
13
  pure?: boolean | undefined;
14
14
  }): <T extends React.ComponentType<{}>>(WrappedComponent: T) => T;
15
+ //# sourceMappingURL=connectAdvanced.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import type { ConsumerContext } from './types';
2
2
  export declare const ConnectContext: import("react").Context<ConsumerContext>;
3
3
  export declare const ServerStateContext: import("react").Context<any>;
4
+ //# sourceMappingURL=context.d.ts.map
@@ -5,3 +5,4 @@ export * from './useStore';
5
5
  export * from './useSelector';
6
6
  export * from './useStoreSelector';
7
7
  export * from './useIsomorphicLayoutEffect';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -13,3 +13,4 @@ export declare function useActions<A extends Action<any, any>[]>(actions: A): {
13
13
  export declare function useActions<A extends Readonly<Action<any, any>[]>>(actions: A): {
14
14
  [Key in keyof A]: A[Key] extends Action<infer P, infer R> ? (payload?: P) => Promise<R extends PromiseLike<infer U> ? U : R> : never;
15
15
  };
16
+ //# sourceMappingURL=useActions.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=useActions.test-types.d.ts.map
@@ -1,2 +1,3 @@
1
1
  import type { ConsumerContext } from '../types';
2
2
  export declare const useConsumerContext: () => ConsumerContext;
3
+ //# sourceMappingURL=useConsumerContext.d.ts.map
@@ -5,3 +5,4 @@ export declare function useEvents<Ev extends Readonly<EventCreatorN<any>[]>>(eve
5
5
  [key in keyof Ev]: ConvertEventToDispatch<Ev[key]>;
6
6
  };
7
7
  export {};
8
+ //# sourceMappingURL=useEvents.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=useEvents.test-types.d.ts.map
@@ -1 +1,2 @@
1
1
  export { useIsomorphicLayoutEffect } from '@tinkoff/react-hooks';
2
+ //# sourceMappingURL=useIsomorphicLayoutEffect.d.ts.map
@@ -36,3 +36,4 @@ type InferStoreNameFromLegacyStore<Store extends BaseStoreConstructor<any>> = St
36
36
  type InferStoreStateFromLegacyStore<Store extends BaseStoreConstructor<any>> = Store extends BaseStoreConstructor<infer State> ? State : DEFAULT_STORE_STATE;
37
37
  type InferStoreStateFromUnknownStore<Store> = Store extends string ? DEFAULT_STORE_STATE : Store extends OptionalStoreType ? InferStoreStateFromOptionalStore<Store> : Store extends Reducer<any> ? InferStoreStateFromReducer<Store> : Store extends BaseStoreConstructor<any> ? InferStoreStateFromLegacyStore<Store> : DEFAULT_STORE_STATE;
38
38
  export {};
39
+ //# sourceMappingURL=useSelector.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=useSelector.test-types.d.ts.map
@@ -1,2 +1,3 @@
1
1
  import type { Reducer } from '../../createReducer/createReducer.h';
2
2
  export declare function useStore<S>(reducer: Reducer<S>): S;
3
+ //# sourceMappingURL=useStore.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=useStore.test-types.d.ts.map
@@ -1,2 +1,3 @@
1
1
  import type { Reducer } from '../..';
2
2
  export declare const useStoreSelector: <TState, TPayload>(store: Reducer<TState, string, any>, selector: (state: TState) => TPayload) => TPayload;
3
+ //# sourceMappingURL=useStoreSelector.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=useStoreSelector.test-types.d.ts.map
@@ -43,3 +43,4 @@ export { Provider } from './Provider';
43
43
  export { Consumer };
44
44
  export { ConsumerContext } from './types';
45
45
  export * from './hooks';
46
+ //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare function scheduling(): any;
2
+ //# sourceMappingURL=scheduling.d.ts.map
@@ -3,3 +3,4 @@ import type { DependsOnOwnProps } from './toProps/types';
3
3
  export declare function impureFinalPropsSelectorFactory(mapStateToProps: Function, mapContextToProps: Function, mergeProps: Function, context: ConsumerContext): (state: any, ownProps: any) => any;
4
4
  export declare function pureFinalPropsSelectorFactory(mapStateToProps: DependsOnOwnProps<Function>, mapContextToProps: DependsOnOwnProps<Function>, mergeProps: DependsOnOwnProps<Function>, context: ConsumerContext, { areStatesEqual, areOwnPropsEqual, areStatePropsEqual, WrappedComponent: { defaultProps } }: any): (nextState: any, nextOwnProps: any) => any;
5
5
  export declare function finalPropsSelectorFactory(context: ConsumerContext, { initMapStateToProps, initMapContextToProps, initMergeProps, ...options }: any): (nextState: any, nextOwnProps: any) => any;
6
+ //# sourceMappingURL=selectorFactory.d.ts.map
@@ -3,3 +3,4 @@ export declare function whenMapContextToPropsIsFunction(mapContextToProps: MapCo
3
3
  export declare function whenMapContextToPropsIsMissing(mapContextToProps: MapContextToProps): ((context: import("@tramvai/types-actions-state-context").ConsumerContext, options: import("./wrapMapToProps").Options) => () => any) | undefined;
4
4
  export declare function whenMapContextToPropsIsObject(mapContextToProps: MapContextToProps): ((context: import("@tramvai/types-actions-state-context").ConsumerContext, options: import("./wrapMapToProps").Options) => () => any) | undefined;
5
5
  export declare const mapContextToPropsFactories: (typeof whenMapContextToPropsIsFunction)[];
6
+ //# sourceMappingURL=mapContextToProps.d.ts.map
@@ -2,3 +2,4 @@ import type { MapStateToProps } from './types';
2
2
  export declare function whenMapStateToPropsIsFunction(mapStateToProps: MapStateToProps): ((context: import("@tramvai/types-actions-state-context").ConsumerContext, { displayName }: import("./wrapMapToProps").Options) => any) | undefined;
3
3
  export declare function whenMapStateToPropsIsMissing(mapStateToProps: MapStateToProps): ((context: import("@tramvai/types-actions-state-context").ConsumerContext, options: import("./wrapMapToProps").Options) => () => any) | undefined;
4
4
  export declare const mapStateToPropsFactories: (typeof whenMapStateToPropsIsFunction)[];
5
+ //# sourceMappingURL=mapStateToProps.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { MergeProps } from './types';
2
- export declare function whenMergePropsIsFunction(mergeProps: MergeProps): MergeProps<any, any, any> | undefined;
3
- export declare function whenMergePropsIsOmitted(mergeProps: MergeProps): (() => MergeProps<any, any, any>) | undefined;
2
+ export declare function whenMergePropsIsFunction(mergeProps: MergeProps): MergeProps | undefined;
3
+ export declare function whenMergePropsIsOmitted(mergeProps: MergeProps): (() => MergeProps) | undefined;
4
4
  export declare const mergePropsFactories: (typeof whenMergePropsIsFunction)[];
5
+ //# sourceMappingURL=mergeProps.d.ts.map
@@ -5,3 +5,4 @@ export type DependsOnOwnProps<T> = T & {
5
5
  export type MapStateToProps<T = any> = (state: Record<string, any>, ownProps: T) => any;
6
6
  export type MapContextToProps<T = any> = ((context: ConsumerContext, ownProps: T) => any) | Record<string, Function>;
7
7
  export type MergeProps<P = any, T = any, R = any> = (stateProps: P, contextProps: T, ownProps: R) => any;
8
+ //# sourceMappingURL=types.d.ts.map
@@ -8,3 +8,4 @@ export declare function getDependsOnOwnProps(mapToProps: Function & {
8
8
  }): boolean;
9
9
  export declare function wrapMapToPropsFunc(mapToProps: Function, methodName: string): (context: ConsumerContext, { displayName }: Options) => any;
10
10
  export declare function wrapMapToPropsObject(actionsObject: any): (context: ConsumerContext, options: Options) => () => any;
11
+ //# sourceMappingURL=wrapMapToProps.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export { Action, ConsumerContext } from '@tramvai/types-actions-state-context';
2
2
  export type ServerState = any;
3
+ //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare function verifyFunction(value: any, displayName: string, methodName: string): void;
2
+ //# sourceMappingURL=verifyFunction.d.ts.map
@@ -1,2 +1,3 @@
1
1
  import type { MapStateToProps } from '../toProps/types';
2
2
  export declare const verifyMapToProps: (mapStateToProps: MapStateToProps, name: string) => (state: any, props: any) => any;
3
+ //# sourceMappingURL=verifyMapToProps.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare function verifyPlainObject(value: any, displayName: string, methodName: string): void;
2
+ //# sourceMappingURL=verifyPlainObject.d.ts.map
@@ -41,4 +41,5 @@ export declare function createEvent<A1, A2, Payload>(description: string, payloa
41
41
  */
42
42
  export declare function createEvent<A1, A2, A3, Payload>(description: string, payloadCreator: PayloadTransformer3<A1, A2, A3, Payload>): EventCreator3<A1, A2, A3, Payload>;
43
43
  export declare function createEvent<Payload>(description: string, payloadCreator: PayloadTransformerN<Payload>): EventCreatorN<Payload>;
44
- export declare const isEventCreator: (eventCreator: any) => eventCreator is AnyEventCreator<any>;
44
+ export declare const isEventCreator: (eventCreator: any) => eventCreator is AnyEventCreator;
45
+ //# sourceMappingURL=createEvent.d.ts.map
@@ -1 +1,2 @@
1
1
  export { Event, BaseEventCreator, EmptyEventCreator, EventCreator0, EventCreator1, EventCreator2, EventCreator3, EventCreatorN, PayloadTransformer0, PayloadTransformer1, PayloadTransformer2, PayloadTransformer3, PayloadTransformerN, AnyEventCreator, AnyPayloadTransformer, EventCreators, } from '@tramvai/types-actions-state-context';
2
+ //# sourceMappingURL=createEvent.h.d.ts.map
@@ -8,3 +8,4 @@ interface Options<Name extends string, State, Events extends Record<string, Even
8
8
  export declare function createReducer<State, Name extends string, Events extends Record<string, EventHandler<State, any>> = Record<string, EventHandler<State, any>>>(options: Options<Name, State, Events>): Reducer<State, Name, EventHandlersToEventCreators<State, Events>>;
9
9
  export declare function createReducer<State = {}, Name extends string = string>(name: Name, initialState: State): Reducer<State, Name, never>;
10
10
  export {};
11
+ //# sourceMappingURL=createReducer.d.ts.map
@@ -1 +1,2 @@
1
1
  export { EventHandler, ReduceBaseStore, Reducer } from '@tramvai/types-actions-state-context';
2
+ //# sourceMappingURL=createReducer.h.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=createReducer.test-types.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare const DISPATCH = "DISPATCH";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -5,3 +5,4 @@ declare let devTools: {
5
5
  error: import("@tinkoff/utils/typings/types").Func<void>;
6
6
  };
7
7
  export { devTools };
8
+ //# sourceMappingURL=devTools.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import type { middleware as realMiddleware } from './middleware';
2
2
  declare let middleware: typeof realMiddleware;
3
3
  export { middleware };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -4,3 +4,4 @@ interface Options {
4
4
  }
5
5
  export declare const middleware: ({ pickState }?: Options) => Middleware;
6
6
  export {};
7
+ //# sourceMappingURL=middleware.d.ts.map
@@ -29,3 +29,4 @@ export declare class ChildDispatcherContext<TContext> extends DispatcherContext<
29
29
  }): InstanceType<T> | null;
30
30
  }
31
31
  export {};
32
+ //# sourceMappingURL=childDispatcherContext.d.ts.map
@@ -45,3 +45,4 @@ export declare class Dispatcher {
45
45
  export declare function createDispatcher(options?: {
46
46
  stores?: StoreClass[];
47
47
  }): Dispatcher;
48
+ //# sourceMappingURL=dispatcher.d.ts.map
@@ -1 +1,2 @@
1
1
  export { Dispatch, MiddlewareApi, Middleware } from '@tramvai/types-actions-state-context';
2
+ //# sourceMappingURL=dispatcher.h.d.ts.map
@@ -82,3 +82,4 @@ export declare class DispatcherContext<TContext> extends SimpleEmitter {
82
82
  unregisterStore(store: Reducer<any>): void;
83
83
  }
84
84
  export {};
85
+ //# sourceMappingURL=dispatcherContext.d.ts.map
@@ -1,2 +1,3 @@
1
1
  import type { BaseStore } from '../stores/BaseStore';
2
2
  export declare const subscribe: <T>(store: BaseStore<T>, handler: () => void) => void;
3
+ //# sourceMappingURL=storeSubscribe.d.ts.map
package/lib/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from './connect/index';
13
13
  export { Subscription } from './connect/Subscription';
14
14
  export { scheduling } from './connect/scheduling';
15
15
  export { devTools };
16
+ //# sourceMappingURL=index.d.ts.map
package/lib/logger.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare const getLogger: () => Console;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -20,3 +20,4 @@ export declare abstract class BaseStore<State> extends SimpleEmitter implements
20
20
  protected replaceState(state: State): void;
21
21
  protected replaceStateSilently(state: State): void;
22
22
  }
23
+ //# sourceMappingURL=BaseStore.d.ts.map
@@ -8,3 +8,4 @@ export declare class SimpleEmitter {
8
8
  off(event: string, fn: Listener): void;
9
9
  }
10
10
  export {};
11
+ //# sourceMappingURL=SimpleEmitter.d.ts.map
package/lib/typings.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { StoreClass, StoreInstance } from '@tramvai/types-actions-state-context';
2
+ //# sourceMappingURL=typings.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/state",
3
- "version": "2.149.1",
3
+ "version": "2.150.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@tinkoff/react-hooks": "0.1.6",
21
21
  "@tinkoff/utils": "^2.1.2",
22
- "@tramvai/types-actions-state-context": "2.149.1",
22
+ "@tramvai/types-actions-state-context": "2.150.1",
23
23
  "@types/hoist-non-react-statics": "^3.3.1",
24
24
  "invariant": "^2.2.4",
25
25
  "react-is": ">=17",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@reatom/core": "^1.1.5",
37
- "@tramvai/core": "2.149.1",
37
+ "@tramvai/core": "2.150.1",
38
38
  "@types/invariant": "^2.2.31",
39
39
  "@types/react-is": "^17.0.0",
40
40
  "@types/use-sync-external-store": "^0.0.3",