diff --git a/src/compat.ts b/src/compat.ts index f85ea088..f37f9c97 100644 --- a/src/compat.ts +++ b/src/compat.ts @@ -1,5 +1,5 @@ import type { ComponentChildren } from "preact"; -import type { FreshContext } from "./context.ts"; +import type { FreshContext, PageProps } from "./context.ts"; import type { HandlerFn, RouteHandler } from "./handlers.ts"; /** @@ -45,13 +45,13 @@ export type Handler> = HandlerFn< function defineFn( fn: ( - ctx: FreshContext, + ctx: PageProps, ) => | ComponentChildren | Response | Promise, ): ( - ctx: FreshContext, + ctx: PageProps, ) => | ComponentChildren | Response diff --git a/src/compat_test.tsx b/src/compat_test.tsx index 8480305c..fdf0f7d6 100644 --- a/src/compat_test.tsx +++ b/src/compat_test.tsx @@ -1,10 +1,10 @@ -import type { FreshContext } from "./context.ts"; +import type { PageProps } from "./context.ts"; import { assertType, type IsExact } from "@std/testing/types"; import { expect } from "@std/expect"; import { type defineApp, type defineLayout, defineRoute } from "./compat.ts"; Deno.test("compat - defineFn works", () => { - const ctx = {} as FreshContext; + const ctx = {} as PageProps; expect(defineRoute(() => new Response("test"))(ctx)).toBeInstanceOf(Response); expect(defineRoute(() => test)(ctx)).toBeInstanceOf(Object); expect(defineRoute(() => null)(ctx)).toEqual(null);