Skip to content

Commit

Permalink
don't declare ExecutionContext in global
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed May 12, 2024
1 parent b902590 commit cf020c6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion deno_dist/middleware/method-override/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams } from 'node:url'
import type { Context } from '../../context.ts'
import type { Context, ExecutionContext } from '../../context.ts'
import type { Hono } from '../../hono.ts'
import type { MiddlewareHandler } from '../../types.ts'
import { parseBody } from '../../utils/body.ts'
Expand Down
7 changes: 0 additions & 7 deletions deno_dist/mod.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { Hono } from './hono.ts'

declare global {
interface ExecutionContext {
waitUntil(promise: Promise<void>): void
passThroughOnException(): void
}
}

export type {
Env,
ErrorHandler,
Expand Down
2 changes: 1 addition & 1 deletion src/hono.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { expectTypeOf } from 'vitest'
import { hc } from './client'
import type { Context } from './context'
import type { Context, ExecutionContext } from './context'
import { Hono } from './hono'
import { HTTPException } from './http-exception'
import { logger } from './middleware/logger'
Expand Down
1 change: 1 addition & 0 deletions src/middleware/cache/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ExecutionContext } from '../../context'
import { Hono } from '../../hono'
import { cache } from '.'

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/method-override/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { URLSearchParams } from 'url'
import type { Context } from '../../context'
import type { Context, ExecutionContext } from '../../context'
import type { Hono } from '../../hono'
import type { MiddlewareHandler } from '../../types'
import { parseBody } from '../../utils/body'
Expand Down
7 changes: 0 additions & 7 deletions src/mod.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { Hono } from './hono'

declare global {
interface ExecutionContext {
waitUntil(promise: Promise<void>): void
passThroughOnException(): void
}
}

export type {
Env,
ErrorHandler,
Expand Down

0 comments on commit cf020c6

Please sign in to comment.