feat: support async layout functions (#1597)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
co-authored by
Asher Gomez
parent
11077227b5
commit
8325225a0d
+7
-1
@@ -176,9 +176,15 @@ export interface LayoutProps<T = any, S = Record<string, unknown>>
|
||||
extends PageProps<T, S> {
|
||||
Component: ComponentType<Record<never, never>>;
|
||||
}
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export type AsyncLayout<T = any, S = Record<string, unknown>> = (
|
||||
req: Request,
|
||||
ctx: RouteContext<T, S>,
|
||||
props: LayoutProps,
|
||||
) => Promise<ComponentChildren | Response>;
|
||||
|
||||
export interface LayoutModule {
|
||||
default: ComponentType<LayoutProps>;
|
||||
default: ComponentType<LayoutProps> | AsyncLayout;
|
||||
}
|
||||
|
||||
export interface LayoutRoute {
|
||||
|
||||
Reference in New Issue
Block a user