fix: async route typing (#1510)
This commit is contained in:
+7
-5
@@ -135,13 +135,15 @@ export interface RouteModule {
|
|||||||
config?: RouteConfig;
|
config?: RouteConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AsyncRoute<T> = (
|
// deno-lint-ignore no-explicit-any
|
||||||
|
export type AsyncRoute<T = any, S = Record<string, unknown>> = (
|
||||||
req: Request,
|
req: Request,
|
||||||
ctx: RouteContext<T>,
|
ctx: RouteContext<T, S>,
|
||||||
) => Promise<ComponentChildren | Response>;
|
) => Promise<ComponentChildren | Response>;
|
||||||
export type PageComponent<T> =
|
// deno-lint-ignore no-explicit-any
|
||||||
| ComponentType<PageProps<T>>
|
export type PageComponent<T = any, S = Record<string, unknown>> =
|
||||||
| AsyncRoute<T>
|
| ComponentType<PageProps<T, S>>
|
||||||
|
| AsyncRoute<T, S>
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
| ((props: any) => VNode<any> | ComponentChildren);
|
| ((props: any) => VNode<any> | ComponentChildren);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user