From 71b7de4581a587c199d08ff544641fa927e1443e Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Mon, 16 Jun 2025 19:04:18 +1000 Subject: [PATCH] fix(core): align `defineFn()` with previous definition (#3043) https://github.com/denoland/fresh/blob/990357629e50ef123e5b5ee2b80c250be867534f/src/server/defines.ts#L13-L16 Closes #3042 --- src/compat.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compat.ts b/src/compat.ts index f6c3887c..f85ea088 100644 --- a/src/compat.ts +++ b/src/compat.ts @@ -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> = HandlerFn< function defineFn( fn: ( ctx: FreshContext, - ) => Response | VNode | null | Promise, + ) => + | ComponentChildren + | Response + | Promise, ): ( ctx: FreshContext, -) => Response | VNode | null | Promise { +) => + | ComponentChildren + | Response + | Promise { return fn; }