hono 3.7.4 → 3.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ __export(context_exports, {
21
21
  Context: () => Context
22
22
  });
23
23
  module.exports = __toCommonJS(context_exports);
24
+ var import_types = require("./types");
24
25
  var import_cookie = require("./utils/cookie");
25
26
  var import_stream = require("./utils/stream");
26
27
  const TEXT_PLAIN = "text/plain; charset=UTF-8";
@@ -199,7 +200,7 @@ class Context {
199
200
  }
200
201
  }
201
202
  get event() {
202
- if (this._exCtx instanceof FetchEvent) {
203
+ if (this._exCtx instanceof import_types.FetchEvent) {
203
204
  return this._exCtx;
204
205
  } else {
205
206
  throw Error("This context has no FetchEvent");
package/dist/cjs/types.js CHANGED
@@ -18,12 +18,16 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var types_exports = {};
20
20
  __export(types_exports, {
21
+ FetchEvent: () => FetchEvent,
21
22
  FetchEventLike: () => FetchEventLike
22
23
  });
23
24
  module.exports = __toCommonJS(types_exports);
24
25
  class FetchEventLike {
25
26
  }
27
+ class FetchEvent extends FetchEventLike {
28
+ }
26
29
  // Annotate the CommonJS export names for ESM import in node:
27
30
  0 && (module.exports = {
31
+ FetchEvent,
28
32
  FetchEventLike
29
33
  });
package/dist/context.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/context.ts
2
+ import { FetchEvent } from "./types.js";
2
3
  import { serialize } from "./utils/cookie.js";
3
4
  import { StreamingApi } from "./utils/stream.js";
4
5
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
@@ -1,2 +1,3 @@
1
1
  import type { Hono } from '../../hono';
2
+ import type { FetchEvent } from '../../types';
2
3
  export declare const handle: (app: Hono<any, any, any>) => (req: Request, requestContext: FetchEvent) => Response | Promise<Response>;
@@ -1,7 +1,6 @@
1
- /// <reference lib="es2022" />
2
- /// <reference lib="webworker" />
3
1
  import type { HonoRequest } from './request';
4
2
  import type { Env, NotFoundHandler, Input, TypedResponse } from './types';
3
+ import { FetchEvent } from './types';
5
4
  import type { CookieOptions } from './utils/cookie';
6
5
  import type { StatusCode } from './utils/http-status';
7
6
  import { StreamingApi } from './utils/stream';
@@ -10,11 +10,11 @@ interface RouterRoute {
10
10
  }
11
11
  declare const Hono_base: new <E_1 extends Env = Env, S_1 extends Schema = {}, BasePath_1 extends string = "/">() => {
12
12
  all: HandlerInterface<E_1, "all", S_1, BasePath_1>;
13
+ options: HandlerInterface<E_1, "options", S_1, BasePath_1>;
13
14
  get: HandlerInterface<E_1, "get", S_1, BasePath_1>;
14
15
  post: HandlerInterface<E_1, "post", S_1, BasePath_1>;
15
16
  put: HandlerInterface<E_1, "put", S_1, BasePath_1>;
16
17
  delete: HandlerInterface<E_1, "delete", S_1, BasePath_1>;
17
- options: HandlerInterface<E_1, "options", S_1, BasePath_1>;
18
18
  patch: HandlerInterface<E_1, "patch", S_1, BasePath_1>;
19
19
  } & {
20
20
  on: OnHandlerInterface<E_1, S_1, BasePath_1>;
@@ -146,4 +146,6 @@ export declare abstract class FetchEventLike {
146
146
  abstract passThroughOnException(): void;
147
147
  abstract waitUntil(promise: Promise<void>): void;
148
148
  }
149
+ export declare abstract class FetchEvent extends FetchEventLike {
150
+ }
149
151
  export {};
package/dist/types.js CHANGED
@@ -1,6 +1,9 @@
1
1
  // src/types.ts
2
2
  var FetchEventLike = class {
3
3
  };
4
+ var FetchEvent = class extends FetchEventLike {
5
+ };
4
6
  export {
7
+ FetchEvent,
5
8
  FetchEventLike
6
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "description": "Ultrafast web framework for the Edges",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",