@whatwg-node/server 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/index.d.ts +5 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  /// <reference lib="webworker" />
3
3
  import type { RequestListener, ServerResponse } from 'node:http';
4
4
  import { NodeRequest } from './utils';
5
- import { fetch } from '@whatwg-node/fetch';
6
5
  export interface CreateServerAdapterOptions<TServerContext, TBaseObject> {
7
6
  /**
8
7
  * WHATWG Fetch spec compliant `Request` constructor.
@@ -26,7 +25,11 @@ export interface ServerAdapterObject<TServerContext> extends EventListenerObject
26
25
  /**
27
26
  * WHATWG Fetch spec compliant `fetch` function that can be used for testing purposes.
28
27
  */
29
- fetch: typeof fetch | ((request: Request, ...ctx: any[]) => Promise<Response>);
28
+ fetch(request: Request, ...ctx: any[]): Promise<Response>;
29
+ fetch(urlStr: string, ...ctx: any[]): Promise<Response>;
30
+ fetch(urlStr: string, init: RequestInit, ...ctx: any[]): Promise<Response>;
31
+ fetch(url: URL, ...ctx: any[]): Promise<Response>;
32
+ fetch(url: URL, init: RequestInit, ...ctx: any[]): Promise<Response>;
30
33
  /**
31
34
  * This function takes Node's request object and returns a WHATWG Fetch spec compliant `Response` object.
32
35
  **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/server",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Fetch API compliant HTTP Server adapter",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {