diff --git a/src/context.ts b/src/context.ts index f0b9cd34..d409eca2 100644 --- a/src/context.ts +++ b/src/context.ts @@ -4,8 +4,7 @@ import { isAbsoluteURL } from './utils/url' type Headers = Record export type Data = string | ArrayBuffer | ReadableStream - -export type Env = Record +type Env = Record export class Context { req: Request diff --git a/src/hono.ts b/src/hono.ts index 3909268b..f6d1d2f3 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -1,12 +1,12 @@ import { compose } from './compose' import { Context } from './context' -import type { Env } from './context' import { extendRequestPrototype } from './request' import type { Router } from './router' import { METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE } from './router' import { TrieRouter } from './router/trie-router' // Default Router import { getPathFromURL, mergePath } from './utils/url' +type Env = Record export type Handler = ( c: Context, next: Next diff --git a/src/index.ts b/src/index.ts index d4879754..a9ad7002 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,6 @@ import { Hono } from './hono' export type { Handler, Next } from './hono' export { Context } from './context' -export type { Env } from './context' declare module './hono' { interface Hono { diff --git a/src/middleware/serve-static/serve-static.ts b/src/middleware/serve-static/serve-static.ts index 26999cb4..69244db0 100644 --- a/src/middleware/serve-static/serve-static.ts +++ b/src/middleware/serve-static/serve-static.ts @@ -1,4 +1,4 @@ -import type { Context, Env } from '../../context' +import type { Context } from '../../context' import type { Handler, Next } from '../../hono' import { getContentFromKVAsset } from '../../utils/cloudflare' import { getFilePath } from '../../utils/filepath' @@ -14,7 +14,7 @@ export type ServeStaticOptions = { const DEFAULT_DOCUMENT = 'index.html' // This middleware is available only on Cloudflare Workers. -export const serveStatic = (options: ServeStaticOptions = { root: '' }): Handler => { +export const serveStatic = (options: ServeStaticOptions = { root: '' }): Handler => { return async (c: Context, next: Next): Promise => { // Do nothing if Response is already set if (c.res && c.finalized) { diff --git a/src/mod.ts b/src/mod.ts index d3b83c30..f20c3c96 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -13,7 +13,6 @@ declare global { export type { Handler, Next } from './hono' export { Context } from './context' -export type { Env } from './context' export { Hono } // Router