feat: Add NotFoundData generic to HandlerContext (#1747)
This commit is contained in:
+6
-3
@@ -127,14 +127,17 @@ export type ServeHandler = (
|
|||||||
info: ServeHandlerInfo,
|
info: ServeHandlerInfo,
|
||||||
) => Response | Promise<Response>;
|
) => Response | Promise<Response>;
|
||||||
|
|
||||||
export interface HandlerContext<Data = unknown, State = Record<string, unknown>>
|
export interface HandlerContext<
|
||||||
extends ServeHandlerInfo {
|
Data = unknown,
|
||||||
|
State = Record<string, unknown>,
|
||||||
|
NotFoundData = Data,
|
||||||
|
> extends ServeHandlerInfo {
|
||||||
params: Record<string, string>;
|
params: Record<string, string>;
|
||||||
render: (
|
render: (
|
||||||
data?: Data,
|
data?: Data,
|
||||||
options?: RenderOptions,
|
options?: RenderOptions,
|
||||||
) => Response | Promise<Response>;
|
) => Response | Promise<Response>;
|
||||||
renderNotFound: (data?: Data) => Response | Promise<Response>;
|
renderNotFound: (data?: NotFoundData) => Response | Promise<Response>;
|
||||||
state: State;
|
state: State;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user