feat: middleware can call renderNotFound (#1975)
This commit is contained in:
@@ -433,6 +433,15 @@ export interface UnknownPage {
|
||||
inheritLayouts: boolean;
|
||||
}
|
||||
|
||||
export type UnknownRenderFunction = (
|
||||
req: Request,
|
||||
params: Record<string, string>,
|
||||
// deno-lint-ignore no-explicit-any
|
||||
ctx?: any,
|
||||
data?: unknown,
|
||||
error?: unknown,
|
||||
) => Promise<Response>;
|
||||
|
||||
// --- ERROR PAGE ---
|
||||
|
||||
export interface ErrorPageProps {
|
||||
@@ -488,6 +497,7 @@ export interface ErrorPage {
|
||||
export interface MiddlewareHandlerContext<State = Record<string, unknown>>
|
||||
extends ServeHandlerInfo {
|
||||
next: () => Promise<Response>;
|
||||
renderNotFound: (state?: State) => Response | Promise<Response>;
|
||||
state: State;
|
||||
destination: router.DestinationKind;
|
||||
params: Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user