From 0acebce0bb6e45937eb8c1afeb9d1e3b04881153 Mon Sep 17 00:00:00 2001 From: eryue0220 Date: Tue, 25 Nov 2025 16:43:51 +0800 Subject: [PATCH] fix: update type & imports (#3638) This pr is small fixed that update type declaration and import from codebase. --- packages/fresh/src/context.ts | 2 +- packages/fresh/src/fs_routes.ts | 3 +-- packages/fresh/src/jsonify/stringify.ts | 2 +- packages/fresh/src/router.ts | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/fresh/src/context.ts b/packages/fresh/src/context.ts index 3e1e59c1..abc94082 100644 --- a/packages/fresh/src/context.ts +++ b/packages/fresh/src/context.ts @@ -83,7 +83,7 @@ export class Context { data: unknown = undefined; /** Error value if an error was caught (Default: null) */ error: unknown | null = null; - readonly info: Deno.ServeHandlerInfo | Deno.ServeHandlerInfo; + readonly info: Deno.ServeHandlerInfo; /** * Whether the current Request is a partial request. * diff --git a/packages/fresh/src/fs_routes.ts b/packages/fresh/src/fs_routes.ts index b10cc58d..6d86eca5 100644 --- a/packages/fresh/src/fs_routes.ts +++ b/packages/fresh/src/fs_routes.ts @@ -2,9 +2,8 @@ import type { AnyComponent } from "preact"; import type { MaybeLazy, Route, RouteConfig } from "./types.ts"; import type { HandlerByMethod, RouteHandler } from "./handlers.ts"; import type { Middleware } from "./middlewares/mod.ts"; -import type { AsyncAnyComponent } from "./render.ts"; +import type { AsyncAnyComponent, PageProps } from "./render.ts"; import { type HandlerFn, isHandlerByMethod } from "./handlers.ts"; -import type { PageProps } from "./render.ts"; import { type Command, CommandType, diff --git a/packages/fresh/src/jsonify/stringify.ts b/packages/fresh/src/jsonify/stringify.ts index 05bb77cc..1179b5a3 100644 --- a/packages/fresh/src/jsonify/stringify.ts +++ b/packages/fresh/src/jsonify/stringify.ts @@ -1,4 +1,5 @@ import { + HOLE, INFINITY_NEG, INFINITY_POS, NAN, @@ -6,7 +7,6 @@ import { UNDEFINED, ZERO_NEG, } from "./constants.ts"; -import { HOLE } from "./constants.ts"; export type Stringifiers = Record< string, diff --git a/packages/fresh/src/router.ts b/packages/fresh/src/router.ts index 87ca99eb..b731f7b9 100644 --- a/packages/fresh/src/router.ts +++ b/packages/fresh/src/router.ts @@ -42,7 +42,7 @@ export interface RouteResult { export interface Router { add( - method: Method | "OPTIONS" | "ALL", + method: Method | "ALL", pathname: string, handlers: T[], ): void;