fix(core): align defineFn() with previous definition (#3043)

https://github.com/denoland/fresh/blob/990357629e50ef123e5b5ee2b80c250be867534f/src/server/defines.ts#L13-L16

Closes #3042
This commit is contained in:
Asher Gomez
2025-06-16 11:04:18 +02:00
committed by GitHub
parent 71bec59820
commit 71b7de4581
+9 -3
View File
@@ -1,4 +1,4 @@
import type { VNode } from "preact";
import type { ComponentChildren } from "preact";
import type { FreshContext } from "./context.ts";
import type { HandlerFn, RouteHandler } from "./handlers.ts";
@@ -46,10 +46,16 @@ export type Handler<T = any, State = Record<string, unknown>> = HandlerFn<
function defineFn<State>(
fn: (
ctx: FreshContext<State>,
) => Response | VNode | null | Promise<Response | VNode | null>,
) =>
| ComponentChildren
| Response
| Promise<Response | ComponentChildren>,
): (
ctx: FreshContext<State>,
) => Response | VNode | null | Promise<Response | VNode | null> {
) =>
| ComponentChildren
| Response
| Promise<Response | ComponentChildren> {
return fn;
}