File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,13 @@ export * from "./router";
40
40
41
41
export type {
42
42
ActionFunction ,
43
+ ActionFunctionArgs ,
43
44
DataRouteObject ,
44
45
FormEncType ,
45
46
FormMethod ,
46
47
JsonFunction ,
47
48
LoaderFunction ,
49
+ LoaderFunctionArgs ,
48
50
ParamParseKey ,
49
51
Params ,
50
52
PathMatch ,
Original file line number Diff line number Diff line change @@ -18,26 +18,38 @@ export interface Submission {
18
18
}
19
19
20
20
/**
21
- * Arguments passed to route loader/action functions
21
+ * @private
22
+ * Arguments passed to route loader/action functions. Same for now but we keep
23
+ * this as a private implementation detail in case they diverge in the future.
22
24
*/
23
- export interface DataFunctionArgs {
25
+ interface DataFunctionArgs {
24
26
request : Request ;
25
27
params : Params ;
26
28
signal : AbortSignal ;
27
29
}
28
30
31
+ /**
32
+ * Arguments passed to loader functions
33
+ */
34
+ export interface LoaderFunctionArgs extends DataFunctionArgs { }
35
+
36
+ /**
37
+ * Arguments passed to action functions
38
+ */
39
+ export interface ActionFunctionArgs extends DataFunctionArgs { }
40
+
29
41
/**
30
42
* Route loader function signature
31
43
*/
32
44
export interface LoaderFunction {
33
- ( args : DataFunctionArgs ) : Promise < Response > | Response | Promise < any > | any ;
45
+ ( args : LoaderFunctionArgs ) : Promise < Response > | Response | Promise < any > | any ;
34
46
}
35
47
36
48
/**
37
49
* Route action function signature
38
50
*/
39
51
export interface ActionFunction {
40
- ( args : DataFunctionArgs ) : Promise < Response > | Response | Promise < any > | any ;
52
+ ( args : ActionFunctionArgs ) : Promise < Response > | Response | Promise < any > | any ;
41
53
}
42
54
43
55
/**
You can’t perform that action at this time.
0 commit comments