File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/common/src/wizard Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { AnyObject } from "@data-driven-forms/react-form-renderer" ;
2
2
3
- export type NextStep = string | ( ( values : AnyObject ) => string ) | AnyObject & {
3
+ export type NextStepContext = {
4
+ values : AnyObject ;
5
+ }
6
+
7
+ export type NextStep = string | ( ( context : NextStepContext ) => string ) | ( ( context : NextStepContext ) => Promise < string > ) | AnyObject & {
4
8
stepMapper : {
5
9
[ key : string ] : string ;
6
10
[ key : number ] : string ;
7
11
} ;
8
12
when : string [ ] | string
9
13
}
10
14
11
- declare const selectNext : ( nextStep : NextStep , getState : ( ( ) => AnyObject & { values : AnyObject } ) ) => string ;
15
+ declare const selectNext : < T extends NextStep > ( nextStep : T , getState : ( ( ) => AnyObject & { values : AnyObject } ) ) => T extends ( ... args : any [ ] ) => infer U ? U : string ;
12
16
export default selectNext ;
You can’t perform that action at this time.
0 commit comments