feat: add status and headers overwrite for HandlerContext.render (#725)

This commit is contained in:
Leo Kettmeir
2023-05-31 10:09:53 +02:00
committed by GitHub
parent c172a70181
commit 060e2bb50d
5 changed files with 49 additions and 5 deletions
+7 -1
View File
@@ -72,10 +72,16 @@ export interface RouteConfig {
csp?: boolean;
}
// deno-lint-ignore no-empty-interface
export interface RenderOptions extends ResponseInit {}
export interface HandlerContext<Data = unknown, State = Record<string, unknown>>
extends ConnInfo {
params: Record<string, string>;
render: (data?: Data) => Response | Promise<Response>;
render: (
data?: Data,
options?: RenderOptions,
) => Response | Promise<Response>;
renderNotFound: () => Response | Promise<Response>;
state: State;
}