feat: Allow passing props to renderNotFound method (#1310)
This commit is contained in:
+9
-2
@@ -91,7 +91,7 @@ export interface HandlerContext<Data = unknown, State = Record<string, unknown>>
|
||||
data?: Data,
|
||||
options?: RenderOptions,
|
||||
) => Response | Promise<Response>;
|
||||
renderNotFound: () => Response | Promise<Response>;
|
||||
renderNotFound: (data?: Data) => Response | Promise<Response>;
|
||||
state: State;
|
||||
}
|
||||
|
||||
@@ -135,13 +135,20 @@ export interface AppModule {
|
||||
|
||||
// --- UNKNOWN PAGE ---
|
||||
|
||||
export interface UnknownPageProps {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export interface UnknownPageProps<T = any> {
|
||||
/** The URL of the request that resulted in this page being rendered. */
|
||||
url: URL;
|
||||
|
||||
/** The route matcher (e.g. /blog/:id) that the request matched for this page
|
||||
* to be rendered. */
|
||||
route: string;
|
||||
|
||||
/**
|
||||
* Additional data passed into `HandlerContext.renderNotFound`. Defaults to
|
||||
* `undefined`.
|
||||
*/
|
||||
data: T;
|
||||
}
|
||||
|
||||
export interface UnknownHandlerContext<State = Record<string, unknown>>
|
||||
|
||||
Reference in New Issue
Block a user