@@ -3,7 +3,7 @@ import { PartialProps } from "$fresh/src/runtime/Partial.tsx";
3
3
import { ComponentType } from "preact" ;
4
4
import { HttpContext } from "../blocks/handler.ts" ;
5
5
import { PropsLoader , propsLoader } from "../blocks/propsLoader.ts" ;
6
- import { fnContextFromHttpContext , RequestState } from "../blocks/utils.tsx" ;
6
+ import { RequestState , fnContextFromHttpContext } from "../blocks/utils.tsx" ;
7
7
import StubSection , { Empty } from "../components/StubSection.tsx" ;
8
8
import { withSection } from "../components/section.tsx" ;
9
9
import { Context } from "../deco.ts" ;
@@ -44,9 +44,13 @@ export const isSection = <
44
44
return ( s as Section ) ?. metadata ?. component === section ;
45
45
} ;
46
46
47
- export type SectionProps < T > = T extends PropsLoader < any , infer Props > ? Props
47
+ type ReturnProps < TFunc > = TFunc extends PropsLoader < any , infer Props > ? Props
48
48
: unknown ;
49
49
50
+ export type SectionProps < LoaderFunc , ActionFunc = LoaderFunc > =
51
+ | ReturnProps < LoaderFunc >
52
+ | ReturnProps < ActionFunc > ;
53
+
50
54
export interface ErrorBoundaryParams < TProps > {
51
55
error : any ;
52
56
props : TProps ;
@@ -59,7 +63,7 @@ export interface SectionModule<
59
63
TConfig = any ,
60
64
TProps = any ,
61
65
TLoaderProps = TProps ,
62
- TActionProps = TProps ,
66
+ TActionProps = TLoaderProps ,
63
67
> extends
64
68
BlockModule <
65
69
ComponentFunc < TLoaderProps | TActionProps > ,
0 commit comments