|
1 | 1 | import { EventEmitter } from 'betsy' |
2 | 2 | import isPlainObject from 'is-plain-obj' |
3 | 3 | import { |
| 4 | + IFlushCallback, |
| 5 | + IMutation, |
| 6 | + IMutationCallback, |
4 | 7 | IS_PROXY, |
5 | 8 | ProxyStateTree, |
6 | 9 | TTree, |
7 | | - IMutation, |
8 | 10 | VALUE, |
9 | | - IMutationCallback, |
10 | | - IFlushCallback, |
11 | 11 | } from 'proxy-state-tree' |
12 | 12 | import { Derived } from './derived' |
13 | 13 | import { Devtools, Message, safeValue, safeValues } from './Devtools' |
14 | 14 | import { |
15 | 15 | Events, |
16 | 16 | EventType, |
| 17 | + Execution, |
| 18 | + NestedPartial, |
17 | 19 | Options, |
18 | 20 | ResolveActions, |
19 | | - ResolveState, |
20 | | - Execution, |
21 | 21 | ResolveMockActions, |
22 | | - NestedPartial, |
| 22 | + ResolveState, |
23 | 23 | } from './internalTypes' |
24 | 24 | import { proxifyEffects } from './proxyfyEffects' |
25 | 25 | import { |
26 | | - IConfiguration, |
| 26 | + AContext, |
27 | 27 | IAction, |
| 28 | + IConfiguration, |
28 | 29 | IDerive, |
29 | 30 | IOperator, |
30 | | - IContext, |
31 | | - TOnInitialize, |
32 | 31 | IState, |
| 32 | + TOnInitialize, |
33 | 33 | } from './types' |
34 | 34 |
|
35 | 35 | export * from './types' |
@@ -843,7 +843,7 @@ function createNextPath(next) { |
843 | 843 | } |
844 | 844 |
|
845 | 845 | export function map<Input, Output, ThisConfig extends IConfiguration = Config>( |
846 | | - operation: (context: IContext<ThisConfig, Input>, value: Input) => Output |
| 846 | + operation: (context: AContext<ThisConfig, Input>, value: Input) => Output |
847 | 847 | ): IOperator<ThisConfig, Input, Output extends Promise<infer U> ? U : Output> { |
848 | 848 | const instance = (err, context, next) => { |
849 | 849 | if (err) next(err) |
@@ -961,7 +961,7 @@ export function parallel<Input, ThisConfig extends IConfiguration = Config>( |
961 | 961 | } |
962 | 962 |
|
963 | 963 | export function filter<Input, ThisConfig extends IConfiguration = Config>( |
964 | | - operation: (context: IContext<ThisConfig, Input>, value: Input) => boolean |
| 964 | + operation: (context: AContext<ThisConfig, Input>, value: Input) => boolean |
965 | 965 | ): IOperator<ThisConfig, Input, Input> { |
966 | 966 | const instance = (err, context, next, final) => { |
967 | 967 | if (err) next(err) |
@@ -995,7 +995,7 @@ export function filter<Input, ThisConfig extends IConfiguration = Config>( |
995 | 995 | } |
996 | 996 |
|
997 | 997 | export function action<Input, ThisConfig extends IConfiguration = Config>( |
998 | | - operation: (context: IContext<ThisConfig, Input>, value: Input) => void |
| 998 | + operation: (context: AContext<ThisConfig, Input>, value: Input) => void |
999 | 999 | ): IOperator<ThisConfig, Input, Input> { |
1000 | 1000 | const instance = (err, context, next) => { |
1001 | 1001 | if (err) next(err) |
@@ -1066,7 +1066,7 @@ export function fork< |
1066 | 1066 | ThisConfig extends IConfiguration = Config |
1067 | 1067 | >( |
1068 | 1068 | operation: ( |
1069 | | - context: IContext<ThisConfig, Input>, |
| 1069 | + context: AContext<ThisConfig, Input>, |
1070 | 1070 | value: Input |
1071 | 1071 | ) => keyof Paths, |
1072 | 1072 | paths: Paths |
@@ -1103,7 +1103,7 @@ export function when< |
1103 | 1103 | OutputB, |
1104 | 1104 | ThisConfig extends IConfiguration = Config |
1105 | 1105 | >( |
1106 | | - operation: (context: IContext<ThisConfig, Input>, value: Input) => boolean, |
| 1106 | + operation: (context: AContext<ThisConfig, Input>, value: Input) => boolean, |
1107 | 1107 | paths: { |
1108 | 1108 | true: IOperator<ThisConfig, Input, OutputA> |
1109 | 1109 | false: IOperator<ThisConfig, Input, OutputB> |
|
0 commit comments