@tramvai/types-actions-state-context 2.24.3 → 2.26.0
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/actions.d.ts +2 -1
- package/lib/state.d.ts +4 -4
- package/package.json +3 -3
package/lib/actions.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AbortController, AbortSignal } from 'node-abort-controller';
|
|
1
2
|
import type { ProvideDepsIterator } from '@tinkoff/dippy';
|
|
2
3
|
import type { ConsumerContext, Dispatch, GetState } from './state';
|
|
3
4
|
export declare type ActionContext = ConsumerContext;
|
|
@@ -26,7 +27,7 @@ export declare type Action<Payload = any, Result = any, Deps = any> = ActionPara
|
|
|
26
27
|
/**
|
|
27
28
|
* @deprecated
|
|
28
29
|
*/
|
|
29
|
-
export interface PlatformAction<Payload
|
|
30
|
+
export interface PlatformAction<Payload = any, Result = any, Context extends ActionContext = ActionContext> {
|
|
30
31
|
(context: Context, payload?: Payload): Promise<Result>;
|
|
31
32
|
priority?: 3 | 5 | 7 | 10;
|
|
32
33
|
name?: string;
|
package/lib/state.d.ts
CHANGED
|
@@ -45,9 +45,9 @@ export interface GetState {
|
|
|
45
45
|
export declare type Dispatch = <Payload>(event: Event<Payload>) => Payload;
|
|
46
46
|
export interface ConsumerContext {
|
|
47
47
|
executeAction<Params extends any[], Result, Deps>(action: TramvaiAction<Params, Result, Deps>, ...params: Params): Result extends Promise<any> ? Result : Promise<Result>;
|
|
48
|
-
executeAction<Payload
|
|
49
|
-
dispatch: <Payload
|
|
50
|
-
dispatchWith: <CreateActionOrType extends (...args: unknown[]) => Event | Event = (...args: unknown[]) => Event | Event, Options extends Record<string, any> = Record<string, any>>(createActionOrType: CreateActionOrType, options?: Options) => <Result
|
|
48
|
+
executeAction<Payload = any, Result = any, Deps extends Record<string, any> = any>(action: AnyAction<Payload, Result, Deps>, payload?: Payload): Promise<Result extends PromiseLike<infer U> ? U : Result>;
|
|
49
|
+
dispatch: <Payload = any>(actionOrNameEvent: string | Event<Payload>, payload?: Payload) => Promise<Payload>;
|
|
50
|
+
dispatchWith: <CreateActionOrType extends (...args: unknown[]) => Event | Event = (...args: unknown[]) => Event | Event, Options extends Record<string, any> = Record<string, any>>(createActionOrType: CreateActionOrType, options?: Options) => <Result = any>(...args: any[]) => Promise<Result>;
|
|
51
51
|
getState: GetState;
|
|
52
52
|
/**
|
|
53
53
|
* @deprecated используйте метод `context.getState(reducer)`
|
|
@@ -55,7 +55,7 @@ export interface ConsumerContext {
|
|
|
55
55
|
getStore<Store extends Reducer<State> | BaseStoreConstructor<State> | string | {
|
|
56
56
|
store: Reducer<State> | BaseStoreConstructor<State> | string;
|
|
57
57
|
optional: true;
|
|
58
|
-
}, State
|
|
58
|
+
}, State = any>(store: Store): Store extends Reducer<State> | BaseStoreConstructor<State> ? InstanceType<Store> : {
|
|
59
59
|
getState: () => State;
|
|
60
60
|
setState: (state: State) => void;
|
|
61
61
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/types-actions-state-context",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"build-for-publish": "true"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"tslib": "^2.0
|
|
21
|
+
"tslib": "^2.4.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@tinkoff/dippy": "0.8.
|
|
24
|
+
"@tinkoff/dippy": "0.8.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {},
|
|
27
27
|
"license": "Apache-2.0",
|