@whatwg-node/server 0.4.16 → 0.4.17-alpha-20221122093142-b2f9767

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.
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
- /// <reference lib="webworker" />
3
2
  import type { RequestListener, ServerResponse } from 'node:http';
4
3
  import { NodeRequest } from './utils';
4
+ import { FetchEvent } from './types';
5
5
  export interface ServerAdapterBaseObject<TServerContext, THandleRequest extends ServerAdapterRequestHandler<TServerContext> = ServerAdapterRequestHandler<TServerContext>> {
6
6
  /**
7
7
  * An async function that takes `Request` and the server context and returns a `Response`.
package/index.js CHANGED
@@ -178,7 +178,6 @@ function isRequestInit(val) {
178
178
  'window' in val));
179
179
  }
180
180
 
181
- /// <reference lib="webworker" />
182
181
  async function handleWaitUntils(waitUntilPromises) {
183
182
  const waitUntils = await Promise.allSettled(waitUntilPromises);
184
183
  waitUntils.forEach(waitUntil => {
package/index.mjs CHANGED
@@ -174,7 +174,6 @@ function isRequestInit(val) {
174
174
  'window' in val));
175
175
  }
176
176
 
177
- /// <reference lib="webworker" />
178
177
  async function handleWaitUntils(waitUntilPromises) {
179
178
  const waitUntils = await Promise.allSettled(waitUntilPromises);
180
179
  waitUntils.forEach(waitUntil => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/server",
3
- "version": "0.4.16",
3
+ "version": "0.4.17-alpha-20221122093142-b2f9767",
4
4
  "description": "Fetch API compliant HTTP Server adapter",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
package/types.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export interface FetchEvent extends Event {
2
+ waitUntil(f: Promise<any>): void;
3
+ request: Request;
4
+ respondWith(r: Response | PromiseLike<Response>): void;
5
+ }
package/utils.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  import type { IncomingMessage, ServerResponse } from 'node:http';
5
5
  import type { Socket } from 'node:net';
6
6
  import type { Readable } from 'node:stream';
7
+ import { FetchEvent } from './types';
7
8
  export interface NodeRequest {
8
9
  protocol?: string;
9
10
  hostname?: string;