File tree 3 files changed +20
-6
lines changed
3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export const noop = () => <any> undefined;
24
24
25
25
export type Mapper < X , T > = ( x : X , key ?: ( string | number ) ) => T ;
26
26
export interface TypedMap < T > { [ key : string ] : T ; }
27
- export type Predicate < X > = ( x : X ) => boolean ;
27
+ export type Predicate < X > = ( x ? : X ) => boolean ;
28
28
export type IInjectable = ( Function | any [ ] ) ;
29
29
30
30
export interface Obj extends Object {
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ import {ParamType} from "./type";
5
5
* Parameter values
6
6
*
7
7
* An object containing state parameter key/value pairs
8
+ *
9
+ * #### Example:
10
+ * ```js
11
+ * {
12
+ * userId: 353474,
13
+ * folderId: 'inbox'
14
+ * }
15
+ * ```
8
16
*/
9
17
export interface RawParams {
10
18
[ key : string ] : any ;
Original file line number Diff line number Diff line change 1
1
/** @module state */ /** for typedoc */
2
- import { ParamDeclaration } from "../params/interface" ;
2
+ import { ParamDeclaration , RawParams } from "../params/interface" ;
3
3
4
4
import { State } from "./stateObject" ;
5
5
import { ViewContext } from "../view/interface" ;
@@ -66,6 +66,15 @@ export interface _ViewDeclaration {
66
66
$context ?: ViewContext ;
67
67
}
68
68
69
+ /**
70
+ * The return value of a [[redirectTo]] function
71
+ *
72
+ * - string: a state name
73
+ * - TargetState: a target state, parameters, and options
74
+ * - object: an object with a state name and parameters
75
+ */
76
+ export type RedirectToResult = string | TargetState | { state ?: string , params ?: RawParams } ;
77
+
69
78
/**
70
79
* The StateDeclaration object is used to define a state or nested state.
71
80
*
@@ -431,10 +440,7 @@ export interface StateDeclaration {
431
440
* })
432
441
* ```
433
442
*/
434
- redirectTo ?: ( string |
435
- ( ( $transition$ : Transition ) => TargetState ) |
436
- { state : ( string | StateDeclaration ) , params : { [ key : string ] : any } }
437
- )
443
+ redirectTo ?: RedirectToResult | Promise < RedirectToResult >
438
444
439
445
/**
440
446
* A Transition Hook called with the state is being entered. See: [[IHookRegistry.onEnter]]
You can’t perform that action at this time.
0 commit comments