msw 1.3.1 → 2.0.0

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 (169) hide show
  1. package/README.md +32 -29
  2. package/browser/package.json +5 -0
  3. package/cli/init.js +3 -3
  4. package/config/constants.js +1 -2
  5. package/lib/browser/index.d.ts +104 -0
  6. package/lib/browser/index.js +751 -0
  7. package/lib/browser/index.mjs +733 -0
  8. package/lib/core/GraphQLHandler-b42ca96f.d.ts +74 -0
  9. package/lib/core/HttpResponse.d.ts +2 -0
  10. package/lib/core/HttpResponse.js +94 -0
  11. package/lib/core/HttpResponse.mjs +77 -0
  12. package/lib/core/RequestHandler-1a5dbdc7.d.ts +172 -0
  13. package/lib/core/SetupApi.d.ts +26 -0
  14. package/lib/core/SetupApi.js +83 -0
  15. package/lib/core/SetupApi.mjs +63 -0
  16. package/lib/core/bypass.d.ts +16 -0
  17. package/lib/core/bypass.js +36 -0
  18. package/lib/core/bypass.mjs +16 -0
  19. package/lib/core/delay.d.ts +18 -0
  20. package/lib/core/delay.js +92 -0
  21. package/lib/core/delay.mjs +72 -0
  22. package/lib/core/graphql.d.ts +109 -0
  23. package/lib/core/graphql.js +112 -0
  24. package/lib/core/graphql.mjs +96 -0
  25. package/lib/core/handlers/GraphQLHandler.d.ts +5 -0
  26. package/lib/core/handlers/GraphQLHandler.js +145 -0
  27. package/lib/core/handlers/GraphQLHandler.mjs +130 -0
  28. package/lib/core/handlers/HttpHandler.d.ts +62 -0
  29. package/lib/core/handlers/HttpHandler.js +149 -0
  30. package/lib/core/handlers/HttpHandler.mjs +133 -0
  31. package/lib/core/handlers/RequestHandler.d.ts +2 -0
  32. package/lib/core/handlers/RequestHandler.js +180 -0
  33. package/lib/core/handlers/RequestHandler.mjs +162 -0
  34. package/lib/core/http.d.ts +26 -0
  35. package/lib/core/http.js +39 -0
  36. package/lib/core/http.mjs +22 -0
  37. package/lib/core/http.spec.d.ts +2 -0
  38. package/lib/core/http.spec.js +15 -0
  39. package/lib/core/http.spec.mjs +14 -0
  40. package/lib/core/index.d.ts +18 -0
  41. package/lib/core/index.js +49 -0
  42. package/lib/core/index.mjs +28 -0
  43. package/lib/core/passthrough.d.ts +17 -0
  44. package/lib/core/passthrough.js +32 -0
  45. package/lib/core/passthrough.mjs +12 -0
  46. package/lib/core/sharedOptions.d.ts +66 -0
  47. package/lib/core/sharedOptions.js +16 -0
  48. package/lib/core/sharedOptions.mjs +0 -0
  49. package/lib/core/typeUtils.d.ts +7 -0
  50. package/lib/core/typeUtils.js +16 -0
  51. package/lib/core/typeUtils.mjs +0 -0
  52. package/lib/core/utils/HttpResponse/decorators.d.ts +12 -0
  53. package/lib/core/utils/HttpResponse/decorators.js +80 -0
  54. package/lib/core/utils/HttpResponse/decorators.mjs +52 -0
  55. package/lib/core/utils/getResponse.d.ts +2 -0
  56. package/lib/core/utils/getResponse.js +64 -0
  57. package/lib/core/utils/getResponse.mjs +44 -0
  58. package/lib/core/utils/handleRequest.d.ts +30 -0
  59. package/lib/core/utils/handleRequest.js +102 -0
  60. package/lib/core/utils/handleRequest.mjs +82 -0
  61. package/lib/core/utils/internal/Disposable.d.ts +7 -0
  62. package/lib/core/utils/internal/Disposable.js +53 -0
  63. package/lib/core/utils/internal/Disposable.mjs +33 -0
  64. package/lib/core/utils/internal/checkGlobals.d.ts +3 -0
  65. package/lib/core/utils/internal/checkGlobals.js +33 -0
  66. package/lib/core/utils/internal/checkGlobals.mjs +13 -0
  67. package/lib/core/utils/internal/devUtils.d.ts +19 -0
  68. package/lib/core/utils/internal/devUtils.js +40 -0
  69. package/lib/core/utils/internal/devUtils.mjs +20 -0
  70. package/lib/core/utils/internal/getCallFrame.d.ts +6 -0
  71. package/lib/core/utils/internal/getCallFrame.js +40 -0
  72. package/lib/core/utils/internal/getCallFrame.mjs +20 -0
  73. package/lib/core/utils/internal/isIterable.d.ts +6 -0
  74. package/lib/core/utils/internal/isIterable.js +29 -0
  75. package/lib/core/utils/internal/isIterable.mjs +9 -0
  76. package/lib/core/utils/internal/isObject.d.ts +6 -0
  77. package/lib/core/utils/internal/isObject.js +26 -0
  78. package/lib/core/utils/internal/isObject.mjs +6 -0
  79. package/lib/core/utils/internal/isStringEqual.d.ts +6 -0
  80. package/lib/core/utils/internal/isStringEqual.js +26 -0
  81. package/lib/core/utils/internal/isStringEqual.mjs +6 -0
  82. package/lib/core/utils/internal/jsonParse.d.ts +7 -0
  83. package/lib/core/utils/internal/jsonParse.js +30 -0
  84. package/lib/core/utils/internal/jsonParse.mjs +10 -0
  85. package/lib/core/utils/internal/mergeRight.d.ts +7 -0
  86. package/lib/core/utils/internal/mergeRight.js +39 -0
  87. package/lib/core/utils/internal/mergeRight.mjs +19 -0
  88. package/lib/core/utils/internal/parseGraphQLRequest.d.ts +5 -0
  89. package/lib/core/utils/internal/parseGraphQLRequest.js +184 -0
  90. package/lib/core/utils/internal/parseGraphQLRequest.mjs +165 -0
  91. package/lib/core/utils/internal/parseMultipartData.d.ts +10 -0
  92. package/lib/core/utils/internal/parseMultipartData.js +81 -0
  93. package/lib/core/utils/internal/parseMultipartData.mjs +61 -0
  94. package/lib/core/utils/internal/pipeEvents.d.ts +8 -0
  95. package/lib/core/utils/internal/pipeEvents.js +34 -0
  96. package/lib/core/utils/internal/pipeEvents.mjs +14 -0
  97. package/lib/core/utils/internal/requestHandlerUtils.d.ts +8 -0
  98. package/lib/core/utils/internal/requestHandlerUtils.js +36 -0
  99. package/lib/core/utils/internal/requestHandlerUtils.mjs +16 -0
  100. package/lib/core/utils/internal/toReadonlyArray.d.ts +6 -0
  101. package/lib/core/utils/internal/toReadonlyArray.js +28 -0
  102. package/lib/core/utils/internal/toReadonlyArray.mjs +8 -0
  103. package/lib/core/utils/internal/tryCatch.d.ts +3 -0
  104. package/lib/core/utils/internal/tryCatch.js +31 -0
  105. package/lib/core/utils/internal/tryCatch.mjs +11 -0
  106. package/lib/core/utils/internal/uuidv4.d.ts +3 -0
  107. package/lib/core/utils/internal/uuidv4.js +26 -0
  108. package/lib/core/utils/internal/uuidv4.mjs +6 -0
  109. package/lib/core/utils/logging/getStatusCodeColor.d.ts +11 -0
  110. package/lib/core/utils/logging/getStatusCodeColor.js +39 -0
  111. package/lib/core/utils/logging/getStatusCodeColor.mjs +19 -0
  112. package/lib/core/utils/logging/getTimestamp.d.ts +6 -0
  113. package/lib/core/utils/logging/getTimestamp.js +27 -0
  114. package/lib/core/utils/logging/getTimestamp.mjs +7 -0
  115. package/lib/core/utils/logging/serializeRequest.d.ts +12 -0
  116. package/lib/core/utils/logging/serializeRequest.js +55 -0
  117. package/lib/core/utils/logging/serializeRequest.mjs +35 -0
  118. package/lib/core/utils/logging/serializeResponse.d.ts +9 -0
  119. package/lib/core/utils/logging/serializeResponse.js +69 -0
  120. package/lib/core/utils/logging/serializeResponse.mjs +39 -0
  121. package/lib/core/utils/matching/matchRequestUrl.d.ts +19 -0
  122. package/lib/core/utils/matching/matchRequestUrl.js +50 -0
  123. package/lib/core/utils/matching/matchRequestUrl.mjs +30 -0
  124. package/lib/core/utils/matching/normalizePath.d.ts +12 -0
  125. package/lib/core/utils/matching/normalizePath.js +32 -0
  126. package/lib/core/utils/matching/normalizePath.mjs +12 -0
  127. package/lib/core/utils/request/getPublicUrlFromRequest.d.ts +7 -0
  128. package/lib/core/utils/request/getPublicUrlFromRequest.js +30 -0
  129. package/lib/core/utils/request/getPublicUrlFromRequest.mjs +10 -0
  130. package/lib/core/utils/request/getRequestCookies.d.ts +8 -0
  131. package/lib/core/utils/request/getRequestCookies.js +88 -0
  132. package/lib/core/utils/request/getRequestCookies.mjs +60 -0
  133. package/lib/core/utils/request/onUnhandledRequest.d.ts +12 -0
  134. package/lib/core/utils/request/onUnhandledRequest.js +193 -0
  135. package/lib/core/utils/request/onUnhandledRequest.mjs +165 -0
  136. package/lib/core/utils/request/readResponseCookies.d.ts +3 -0
  137. package/lib/core/utils/request/readResponseCookies.js +45 -0
  138. package/lib/core/utils/request/readResponseCookies.mjs +27 -0
  139. package/lib/core/utils/toResponseInit.d.ts +3 -0
  140. package/lib/core/utils/toResponseInit.js +30 -0
  141. package/lib/core/utils/toResponseInit.mjs +10 -0
  142. package/lib/core/utils/url/cleanUrl.d.ts +7 -0
  143. package/lib/core/utils/url/cleanUrl.js +31 -0
  144. package/lib/core/utils/url/cleanUrl.mjs +11 -0
  145. package/lib/core/utils/url/getAbsoluteUrl.d.ts +6 -0
  146. package/lib/core/utils/url/getAbsoluteUrl.js +37 -0
  147. package/lib/core/utils/url/getAbsoluteUrl.mjs +17 -0
  148. package/lib/core/utils/url/isAbsoluteUrl.d.ts +6 -0
  149. package/lib/core/utils/url/isAbsoluteUrl.js +26 -0
  150. package/lib/core/utils/url/isAbsoluteUrl.mjs +6 -0
  151. package/lib/iife/index.js +6238 -12395
  152. package/lib/mockServiceWorker.js +82 -93
  153. package/lib/native/index.d.ts +67 -7
  154. package/lib/native/index.js +74 -1500
  155. package/lib/native/index.mjs +69 -1514
  156. package/lib/node/index.d.ts +68 -9
  157. package/lib/node/index.js +77 -1508
  158. package/lib/node/index.mjs +71 -1521
  159. package/native/package.json +2 -1
  160. package/node/package.json +2 -1
  161. package/package.json +55 -25
  162. package/lib/SetupServerApi-1855d9c6.d.ts +0 -20
  163. package/lib/glossary-de6278a9.d.ts +0 -385
  164. package/lib/iife/index.js.map +0 -1
  165. package/lib/index.d.ts +0 -365
  166. package/lib/index.js +0 -2295
  167. package/lib/index.js.map +0 -1
  168. package/lib/node/index.js.map +0 -1
  169. package/lib/node/index.mjs.map +0 -1
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ > [!IMPORTANT]\
2
+ > **MSW 2.0 is finally here! 🎉** Read the [Release notes](https://github.com/mswjs/msw/releases/tag/v2.0.0) and please follow the [**Migration guidelines**](https://mswjs.io/docs/migrations/1.x-to-2.x) to upgrade. If you're having any questions while upgrading, please reach out in our [Discord server](https://kettanaito.com/discord).
3
+
1
4
  <br />
2
5
 
3
6
  <p align="center">
@@ -25,7 +28,7 @@
25
28
 
26
29
  - **Seamless**. A dedicated layer of requests interception at your disposal. Keep your application's code and tests unaware of whether something is mocked or not.
27
30
  - **Deviation-free**. Request the same production resources and test the actual behavior of your app. Augment an existing API, or design it as you go when there is none.
28
- - **Familiar & Powerful**. Use [Express](https://github.com/expressjs/express)-like routing syntax to capture requests. Use parameters, wildcards, and regular expressions to match requests, and respond with necessary status codes, headers, cookies, delays, or completely custom resolvers.
31
+ - **Familiar & Powerful**. Use [Express](https://github.com/expressjs/express)-like routing syntax to intercept requests. Use parameters, wildcards, and regular expressions to match requests, and respond with necessary status codes, headers, cookies, delays, or completely custom resolvers.
29
32
 
30
33
  ---
31
34
 
@@ -38,8 +41,7 @@
38
41
  This README will give you a brief overview on the library but there's no better place to start with Mock Service Worker than its official documentation.
39
42
 
40
43
  - [Documentation](https://mswjs.io/docs)
41
- - [**Getting started**](https://mswjs.io/docs/getting-started/install)
42
- - [Recipes](https://mswjs.io/docs/recipes)
44
+ - [**Getting started**](https://mswjs.io/docs/getting-started)
43
45
  - [FAQ](https://mswjs.io/docs/faq)
44
46
 
45
47
  ## Examples
@@ -48,12 +50,12 @@ This README will give you a brief overview on the library but there's no better
48
50
 
49
51
  ## Browser
50
52
 
51
- - [Learn more about using MSW in a browser](https://mswjs.io/docs/getting-started/integrate/browser)
53
+ - [Learn more about using MSW in a browser](https://mswjs.io/docs/integrations/browser)
52
54
  - [`setupWorker` API](https://mswjs.io/docs/api/setup-worker)
53
55
 
54
56
  ### How does it work?
55
57
 
56
- In-browser usage is what sets Mock Service Worker apart from other tools. Utilizing the [Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API), which can intercept requests for the purpose of caching, Mock Service Worker responds to captured requests with your mock definition on the network level. This way your application knows nothing about the mocking.
58
+ In-browser usage is what sets Mock Service Worker apart from other tools. Utilizing the [Service Worker API](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API), which can intercept requests for the purpose of caching, Mock Service Worker responds to intercepted requests with your mock definition on the network level. This way your application knows nothing about the mocking.
57
59
 
58
60
  **Take a look at this quick presentation on how Mock Service Worker functions in a browser:**
59
61
 
@@ -71,17 +73,20 @@ In-browser usage is what sets Mock Service Worker apart from other tools. Utiliz
71
73
  ```js
72
74
  // src/mocks.js
73
75
  // 1. Import the library.
74
- import { setupWorker, rest } from 'msw'
76
+ import { http, HttpResponse } from 'msw'
77
+ import { setupWorker } from 'msw/browser'
75
78
 
76
79
  // 2. Describe network behavior with request handlers.
77
80
  const worker = setupWorker(
78
- rest.get('https://github.com/octocat', (req, res, ctx) => {
79
- return res(
80
- ctx.delay(1500),
81
- ctx.status(202, 'Mocked status'),
82
- ctx.json({
83
- message: 'Mocked response JSON body',
84
- }),
81
+ http.get('https://github.com/octocat', ({ request, params, cookies }) => {
82
+ return HttpResponse.json(
83
+ {
84
+ message: 'Mocked response',
85
+ },
86
+ {
87
+ status: 202,
88
+ statusText: 'Mocked status',
89
+ },
85
90
  )
86
91
  }),
87
92
  )
@@ -98,7 +103,7 @@ Performing a `GET https://github.com/octocat` request in your application will r
98
103
 
99
104
  ## Node.js
100
105
 
101
- - [Learn more about using MSW in Node.js](https://mswjs.io/docs/getting-started/integrate/node)
106
+ - [Learn more about using MSW in Node.js](https://mswjs.io/docs/integrations/node)
102
107
  - [`setupServer` API](https://mswjs.io/docs/api/setup-server)
103
108
 
104
109
  ### How does it work?
@@ -118,7 +123,7 @@ Take a look at the example of an integration test in Jest that uses [React Testi
118
123
  // test/Dashboard.test.js
119
124
 
120
125
  import React from 'react'
121
- import { rest } from 'msw'
126
+ import { http, HttpResponse } from 'msw'
122
127
  import { setupServer } from 'msw/node'
123
128
  import { render, screen, waitFor } from '@testing-library/react'
124
129
  import Dashboard from '../src/components/Dashboard'
@@ -127,19 +132,17 @@ const server = setupServer(
127
132
  // Describe network behavior with request handlers.
128
133
  // Tip: move the handlers into their own module and
129
134
  // import it across your browser and Node.js setups!
130
- rest.get('/posts', (req, res, ctx) => {
131
- return res(
132
- ctx.json([
133
- {
134
- id: 'f8dd058f-9006-4174-8d49-e3086bc39c21',
135
- title: `Avoid Nesting When You're Testing`,
136
- },
137
- {
138
- id: '8ac96078-6434-4959-80ed-cc834e7fef61',
139
- title: `How I Built A Modern Website In 2021`,
140
- },
141
- ]),
142
- )
135
+ http.get('/posts', ({ request, params, cookies }) => {
136
+ return HttpResponse.json([
137
+ {
138
+ id: 'f8dd058f-9006-4174-8d49-e3086bc39c21',
139
+ title: `Avoid Nesting When You're Testing`,
140
+ },
141
+ {
142
+ id: '8ac96078-6434-4959-80ed-cc834e7fef61',
143
+ title: `How I Built A Modern Website In 2021`,
144
+ },
145
+ ])
143
146
  }),
144
147
  )
145
148
 
@@ -174,7 +177,7 @@ it('displays the list of recent posts', async () => {
174
177
  })
175
178
  ```
176
179
 
177
- > Don't get overwhelmed! We've prepared a step-by-step [**Getting started**](https://mswjs.io/docs/getting-started/install) tutorial that you can follow to learn how to integrate Mock Service Worker into your project.
180
+ > Don't get overwhelmed! We've prepared a step-by-step [**Getting started**](https://mswjs.io/docs/getting-started) tutorial that you can follow to learn how to integrate Mock Service Worker into your project.
178
181
 
179
182
  Despite the API being called `setupServer`, there are no actual servers involved! The name was chosen for familiarity, and the API was designed to resemble operating with an actual server.
180
183
 
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../lib/browser/index.js",
3
+ "module": "../lib/browser/index.mjs",
4
+ "types": "../lib/browser/index.d.ts"
5
+ }
package/cli/init.js CHANGED
@@ -21,14 +21,14 @@ module.exports = async function init(args) {
21
21
 
22
22
  if (!dirExists) {
23
23
  // Try to create the directory if it doesn't exist
24
- const [createDirectoryError] = await until(() =>
24
+ const createDirectoryResult = await until(() =>
25
25
  fs.promises.mkdir(absolutePublicDir, { recursive: true }),
26
26
  )
27
27
  invariant(
28
- createDirectoryError == null,
28
+ createDirectoryResult.error == null,
29
29
  'Failed to create a Service Worker at "%s": directory does not exist and could not be created.\nMake sure to include a relative path to the root directory of your server.\n\nSee the original error below:\n%s',
30
30
  absolutePublicDir,
31
- createDirectoryError,
31
+ createDirectoryResult.error,
32
32
  )
33
33
  }
34
34
 
@@ -2,8 +2,7 @@ const path = require('path')
2
2
 
3
3
  const SERVICE_WORKER_SOURCE_PATH = path.resolve(
4
4
  __dirname,
5
- '../',
6
- 'src/mockServiceWorker.js',
5
+ '../src/mockServiceWorker.js',
7
6
  )
8
7
 
9
8
  const SERVICE_WORKER_BUILD_PATH = path.resolve(
@@ -0,0 +1,104 @@
1
+ import { SharedOptions, LifeCycleEventEmitter, LifeCycleEventsMap } from "../core/sharedOptions";
2
+ import { RequestHandler, RequestHandlerDefaultInfo } from "../core/handlers/RequestHandler";
3
+ import { SetupApi } from "../core/SetupApi";
4
+
5
+ type FindWorker = (scriptUrl: string, mockServiceWorkerUrl: string) => boolean;
6
+ interface StartOptions extends SharedOptions {
7
+ /**
8
+ * Service Worker registration options.
9
+ */
10
+ serviceWorker?: {
11
+ /**
12
+ * Custom url to the worker script.
13
+ * @default "/mockServiceWorker.js"
14
+ */
15
+ url?: string;
16
+ options?: RegistrationOptions;
17
+ };
18
+ /**
19
+ * Disables the logging of the intercepted requests
20
+ * into browser's console.
21
+ * @default false
22
+ */
23
+ quiet?: boolean;
24
+ /**
25
+ * Defers any network requests until the Service Worker
26
+ * instance is activated.
27
+ * @default true
28
+ */
29
+ waitUntilReady?: boolean;
30
+ /**
31
+ * A custom lookup function to find a Mock Service Worker in the list
32
+ * of all registered Service Workers on the page.
33
+ */
34
+ findWorker?: FindWorker;
35
+ }
36
+ type StartReturnType = Promise<ServiceWorkerRegistration | undefined>;
37
+ type StopHandler = () => void;
38
+ interface SetupWorker {
39
+ /**
40
+ * Registers and activates the mock Service Worker.
41
+ *
42
+ * @see {@link https://mswjs.io/docs/api/setup-worker/start `worker.start()` API reference}
43
+ */
44
+ start: (options?: StartOptions) => StartReturnType;
45
+ /**
46
+ * Stops requests interception for the current client.
47
+ *
48
+ * @see {@link https://mswjs.io/docs/api/setup-worker/stop `worker.stop()` API reference}
49
+ */
50
+ stop: StopHandler;
51
+ /**
52
+ * Prepends given request handlers to the list of existing handlers.
53
+ * @param {RequestHandler[]} handlers List of runtime request handlers.
54
+ *
55
+ * @see {@link https://mswjs.io/docs/api/setup-worker/use `worker.use()` API reference}
56
+ */
57
+ use: (...handlers: RequestHandler[]) => void;
58
+ /**
59
+ * Marks all request handlers that respond using `res.once()` as unused.
60
+ *
61
+ * @see {@link https://mswjs.io/docs/api/setup-worker/restore-handlers `worker.restoreHandlers()` API reference}
62
+ */
63
+ restoreHandlers: () => void;
64
+ /**
65
+ * Resets request handlers to the initial list given to the `setupWorker` call, or to the explicit next request handlers list, if given.
66
+ * @param {RequestHandler[]} nextHandlers List of the new initial request handlers.
67
+ *
68
+ * @see {@link https://mswjs.io/docs/api/setup-worker/reset-handlers `worker.resetHandlers()` API reference}
69
+ */
70
+ resetHandlers: (...nextHandlers: RequestHandler[]) => void;
71
+ /**
72
+ * Returns a readonly list of currently active request handlers.
73
+ *
74
+ * @see {@link https://mswjs.io/docs/api/setup-worker/list-handlers `worker.listHandlers()` API reference}
75
+ */
76
+ listHandlers(): ReadonlyArray<RequestHandler<RequestHandlerDefaultInfo, any>>;
77
+ /**
78
+ * Life-cycle events.
79
+ * Life-cycle events allow you to subscribe to the internal library events occurring during the request/response handling.
80
+ *
81
+ * @see {@link https://mswjs.io/docs/api/life-cycle-events Life-cycle Events API reference}
82
+ */
83
+ events: LifeCycleEventEmitter<LifeCycleEventsMap>;
84
+ }
85
+
86
+ declare class SetupWorkerApi extends SetupApi<LifeCycleEventsMap> implements SetupWorker {
87
+ private context;
88
+ private startHandler;
89
+ private stopHandler;
90
+ private listeners;
91
+ constructor(...handlers: Array<RequestHandler>);
92
+ private createWorkerContext;
93
+ start(options?: StartOptions): StartReturnType;
94
+ stop(): void;
95
+ }
96
+ /**
97
+ * Sets up a requests interception in the browser with the given request handlers.
98
+ * @param {RequestHandler[]} handlers List of request handlers.
99
+ *
100
+ * @see {@link https://mswjs.io/docs/api/setup-worker `setupWorker()` API reference}
101
+ */
102
+ declare function setupWorker(...handlers: Array<RequestHandler>): SetupWorker;
103
+
104
+ export { SetupWorker, SetupWorkerApi, StartOptions, setupWorker };