1
- import { Location as Page , MaybePromise , InferValue , Index } from './helper' ;
1
+ import { InferValue , Location as Page , MaybePromise , Rec } from './helper' ;
2
2
3
3
export interface LoadInput <
4
- PageParams extends Index < string > = Index < string > ,
5
- Context extends Index = Index ,
4
+ PageParams extends Rec < string > = Rec < string > ,
5
+ Context extends Rec = Rec ,
6
6
Session = any
7
7
> {
8
8
page : Page < PageParams > ;
@@ -12,15 +12,15 @@ export interface LoadInput<
12
12
}
13
13
14
14
export interface ErrorLoadInput <
15
- PageParams extends Index < string > = Index < string > ,
16
- Context extends Index = Index ,
15
+ PageParams extends Rec < string > = Rec < string > ,
16
+ Context extends Rec = Rec ,
17
17
Session = any
18
18
> extends LoadInput < PageParams , Context , Session > {
19
19
status ?: number ;
20
20
error ?: Error ;
21
21
}
22
22
23
- export interface LoadOutput < Props extends Index = Index , Context extends Index = Index > {
23
+ export interface LoadOutput < Props extends Rec = Rec , Context extends Rec = Rec > {
24
24
status ?: number ;
25
25
error ?: string | Error ;
26
26
redirect ?: string ;
@@ -30,14 +30,14 @@ export interface LoadOutput<Props extends Index = Index, Context extends Index =
30
30
}
31
31
32
32
interface LoadInputExtends {
33
- context ?: Index ;
34
- pageParams ?: Index < string > ;
33
+ context ?: Rec ;
34
+ pageParams ?: Rec < string > ;
35
35
session ?: any ;
36
36
}
37
37
38
38
interface LoadOutputExtends {
39
- context ?: Index ;
40
- props ?: Index ;
39
+ context ?: Rec ;
40
+ props ?: Rec ;
41
41
}
42
42
43
43
export interface Load <
@@ -46,13 +46,13 @@ export interface Load<
46
46
> {
47
47
(
48
48
input : LoadInput <
49
- InferValue < Input , 'pageParams' , Index < string > > ,
50
- InferValue < Input , 'context' , Index > ,
49
+ InferValue < Input , 'pageParams' , Rec < string > > ,
50
+ InferValue < Input , 'context' , Rec > ,
51
51
InferValue < Input , 'session' , any >
52
52
>
53
53
) : MaybePromise < void | LoadOutput <
54
- InferValue < Output , 'props' , Index > ,
55
- InferValue < Output , 'context' , Index >
54
+ InferValue < Output , 'props' , Rec > ,
55
+ InferValue < Output , 'context' , Rec >
56
56
> > ;
57
57
}
58
58
@@ -62,13 +62,11 @@ export interface ErrorLoad<
62
62
> {
63
63
(
64
64
input : ErrorLoadInput <
65
- InferValue < Input , 'pageParams' , Index < string > > ,
66
- InferValue < Input , 'context' , Index > ,
65
+ InferValue < Input , 'pageParams' , Rec < string > > ,
66
+ InferValue < Input , 'context' , Rec > ,
67
67
InferValue < Input , 'session' , any >
68
68
>
69
- ) : MaybePromise <
70
- LoadOutput < InferValue < Output , 'props' , Index > , InferValue < Output , 'context' , Index > >
71
- > ;
69
+ ) : MaybePromise < LoadOutput < InferValue < Output , 'props' , Rec > , InferValue < Output , 'context' , Rec > > > ;
72
70
}
73
71
74
72
export { Page } ;
0 commit comments