@umijs/bundler-webpack 3.5.20 → 4.0.0-beta.4

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 (333) hide show
  1. package/README.md +2 -0
  2. package/bin/bundler-webpack.js +1 -2
  3. package/client/client/client.js +202 -0
  4. package/client/constants.js +12 -0
  5. package/client/utils/formatWebpackMessages.js +92 -0
  6. package/compiled/@svgr/webpack/.svgo.yml +75 -0
  7. package/compiled/@svgr/webpack/LICENSE +7 -0
  8. package/compiled/@svgr/webpack/index.js +343 -0
  9. package/compiled/@svgr/webpack/package.json +1 -0
  10. package/compiled/autoprefixer/LICENSE +20 -0
  11. package/compiled/autoprefixer/browserslist/index.d.ts +172 -0
  12. package/compiled/autoprefixer/index.js +9 -0
  13. package/compiled/autoprefixer/lib/autoprefixer.d.ts +95 -0
  14. package/compiled/autoprefixer/package.json +1 -0
  15. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +106 -0
  16. package/compiled/autoprefixer/postcss/lib/comment.d.ts +56 -0
  17. package/compiled/autoprefixer/postcss/lib/container.d.ts +442 -0
  18. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +192 -0
  19. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +124 -0
  20. package/compiled/autoprefixer/postcss/lib/document.d.ts +57 -0
  21. package/compiled/autoprefixer/postcss/lib/input.d.ts +130 -0
  22. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +175 -0
  23. package/compiled/autoprefixer/postcss/lib/list.d.ts +51 -0
  24. package/compiled/autoprefixer/postcss/lib/node.d.ts +444 -0
  25. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +472 -0
  26. package/compiled/autoprefixer/postcss/lib/previous-map.d.ts +72 -0
  27. package/compiled/autoprefixer/postcss/lib/processor.d.ts +101 -0
  28. package/compiled/autoprefixer/postcss/lib/result.d.ts +195 -0
  29. package/compiled/autoprefixer/postcss/lib/root.d.ts +73 -0
  30. package/compiled/autoprefixer/postcss/lib/rule.d.ts +104 -0
  31. package/compiled/autoprefixer/postcss/lib/warning.d.ts +104 -0
  32. package/compiled/autoprefixer/source-map-js/source-map.d.ts +98 -0
  33. package/compiled/babel-loader/LICENSE +22 -0
  34. package/compiled/babel-loader/index.js +3 -0
  35. package/compiled/babel-loader/package.json +1 -0
  36. package/compiled/compression/LICENSE +23 -0
  37. package/compiled/compression/index.js +57 -0
  38. package/compiled/compression/package.json +1 -0
  39. package/compiled/connect-history-api-fallback/LICENSE +21 -0
  40. package/compiled/connect-history-api-fallback/index.js +1 -0
  41. package/compiled/connect-history-api-fallback/package.json +1 -0
  42. package/{lib/webpack/plugins/mini-css-extract-plugin → compiled/copy-webpack-plugin}/LICENSE +0 -0
  43. package/compiled/copy-webpack-plugin/index.js +46 -0
  44. package/compiled/copy-webpack-plugin/package.json +1 -0
  45. package/{lib/webpack/plugins/terser-webpack-plugin → compiled/css-loader}/LICENSE +0 -0
  46. package/compiled/css-loader/api.js +102 -0
  47. package/compiled/css-loader/getUrl.js +29 -0
  48. package/compiled/css-loader/index.js +2 -0
  49. package/compiled/css-loader/noSourceMaps.js +5 -0
  50. package/compiled/css-loader/package.json +1 -0
  51. package/compiled/css-loader/sourceMaps.js +22 -0
  52. package/compiled/css-minimizer-webpack-plugin/LICENSE +20 -0
  53. package/compiled/css-minimizer-webpack-plugin/index.js +3 -0
  54. package/compiled/css-minimizer-webpack-plugin/minify.js +72 -0
  55. package/compiled/css-minimizer-webpack-plugin/package.json +1 -0
  56. package/compiled/css-minimizer-webpack-plugin/utils.js +166 -0
  57. package/compiled/cssnano/index.js +192 -0
  58. package/compiled/cssnano/package.json +1 -0
  59. package/compiled/express/LICENSE +24 -0
  60. package/compiled/express/body-parser/index.d.ts +104 -0
  61. package/compiled/express/connect/index.d.ts +93 -0
  62. package/compiled/express/express-serve-static-core/index.d.ts +1252 -0
  63. package/compiled/express/index.d.ts +133 -0
  64. package/compiled/express/index.js +338 -0
  65. package/compiled/express/mime/index.d.ts +35 -0
  66. package/compiled/express/package.json +1 -0
  67. package/compiled/express/qs/index.d.ts +62 -0
  68. package/compiled/express/range-parser/index.d.ts +35 -0
  69. package/compiled/express/serve-static/index.d.ts +108 -0
  70. package/compiled/http-proxy-middleware/LICENSE +22 -0
  71. package/compiled/http-proxy-middleware/dist/index.d.ts +4 -0
  72. package/compiled/http-proxy-middleware/dist/types.d.ts +54 -0
  73. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +226 -0
  74. package/compiled/http-proxy-middleware/index.js +66 -0
  75. package/compiled/http-proxy-middleware/package.json +1 -0
  76. package/compiled/less/index.js +31 -0
  77. package/compiled/less/package.json +1 -0
  78. package/compiled/less-loader/LICENSE +20 -0
  79. package/compiled/less-loader/index.js +1 -0
  80. package/compiled/less-loader/package.json +1 -0
  81. package/compiled/mini-css-extract-plugin/LICENSE +20 -0
  82. package/{lib/webpack/plugins/mini-css-extract-plugin/src → compiled/mini-css-extract-plugin}/hmr/hotModuleReplacement.js +50 -52
  83. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +35 -0
  84. package/compiled/mini-css-extract-plugin/index.js +11606 -0
  85. package/compiled/mini-css-extract-plugin/loader-options.json +32 -0
  86. package/compiled/mini-css-extract-plugin/loader.js +315 -0
  87. package/compiled/mini-css-extract-plugin/package.json +1 -0
  88. package/compiled/mini-css-extract-plugin/utils.js +154 -0
  89. package/compiled/postcss-flexbugs-fixes/LICENSE +20 -0
  90. package/compiled/postcss-flexbugs-fixes/index.js +1 -0
  91. package/compiled/postcss-flexbugs-fixes/package.json +1 -0
  92. package/compiled/postcss-loader/LICENSE +20 -0
  93. package/compiled/postcss-loader/index.js +1 -0
  94. package/compiled/postcss-loader/package.json +1 -0
  95. package/compiled/purgecss-webpack-plugin/LICENSE +21 -0
  96. package/compiled/purgecss-webpack-plugin/index.js +7781 -0
  97. package/compiled/purgecss-webpack-plugin/package.json +1 -0
  98. package/compiled/react-refresh/index.js +19 -0
  99. package/compiled/sass-loader/LICENSE +20 -0
  100. package/compiled/sass-loader/index.js +1 -0
  101. package/compiled/sass-loader/package.json +1 -0
  102. package/compiled/schema-utils/LICENSE +20 -0
  103. package/compiled/schema-utils/ajv/lib/ajv.d.ts +397 -0
  104. package/compiled/schema-utils/declarations/ValidationError.d.ts +74 -0
  105. package/compiled/schema-utils/declarations/index.d.ts +3 -0
  106. package/compiled/schema-utils/declarations/validate.d.ts +37 -0
  107. package/compiled/schema-utils/index.js +3 -0
  108. package/compiled/schema-utils/json-schema/index.d.ts +751 -0
  109. package/compiled/schema-utils/package.json +1 -0
  110. package/compiled/speed-measure-webpack-plugin/LICENSE +21 -0
  111. package/compiled/speed-measure-webpack-plugin/index.js +1 -0
  112. package/compiled/speed-measure-webpack-plugin/package.json +1 -0
  113. package/compiled/style-loader/LICENSE +20 -0
  114. package/compiled/style-loader/index.js +1 -0
  115. package/compiled/style-loader/package.json +1 -0
  116. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  117. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +104 -0
  118. package/compiled/style-loader/runtime/insertBySelector.js +39 -0
  119. package/compiled/style-loader/runtime/insertStyleElement.js +11 -0
  120. package/compiled/style-loader/runtime/isEqualLocals.js +35 -0
  121. package/compiled/style-loader/runtime/isOldIE.js +19 -0
  122. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +16 -0
  123. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +10 -0
  124. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +12 -0
  125. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +93 -0
  126. package/compiled/style-loader/runtime/styleDomAPI.js +70 -0
  127. package/compiled/style-loader/runtime/styleTagTransform.js +16 -0
  128. package/compiled/svgo-loader/LICENSE +22 -0
  129. package/compiled/svgo-loader/index.js +4 -0
  130. package/compiled/svgo-loader/package.json +1 -0
  131. package/compiled/swc-loader/LICENSE +25 -0
  132. package/compiled/swc-loader/index.js +1 -0
  133. package/compiled/swc-loader/package.json +1 -0
  134. package/compiled/tapable/LICENSE +21 -0
  135. package/compiled/tapable/index.js +1 -0
  136. package/compiled/tapable/package.json +1 -0
  137. package/compiled/tapable/tapable.d.ts +116 -0
  138. package/compiled/terser/LICENSE +29 -0
  139. package/compiled/terser/index.js +1 -0
  140. package/compiled/terser/mappings.wasm +0 -0
  141. package/compiled/terser/package.json +1 -0
  142. package/compiled/terser/source-map/source-map.d.ts +369 -0
  143. package/compiled/terser/tools/terser.d.ts +207 -0
  144. package/compiled/terser-webpack-plugin/LICENSE +20 -0
  145. package/compiled/terser-webpack-plugin/ajv/lib/ajv.d.ts +397 -0
  146. package/compiled/terser-webpack-plugin/index.js +15142 -0
  147. package/compiled/terser-webpack-plugin/jest-worker/build/index.d.ts +49 -0
  148. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +142 -0
  149. package/compiled/terser-webpack-plugin/json-schema/index.d.ts +751 -0
  150. package/compiled/terser-webpack-plugin/minify.js +43 -0
  151. package/compiled/terser-webpack-plugin/package.json +1 -0
  152. package/compiled/terser-webpack-plugin/schema-utils/declarations/ValidationError.d.ts +74 -0
  153. package/compiled/terser-webpack-plugin/schema-utils/declarations/index.d.ts +3 -0
  154. package/compiled/terser-webpack-plugin/schema-utils/declarations/validate.d.ts +37 -0
  155. package/compiled/terser-webpack-plugin/source-map/source-map.d.ts +98 -0
  156. package/compiled/terser-webpack-plugin/types/cjs.d.ts +3 -0
  157. package/compiled/terser-webpack-plugin/types/index.d.ts +295 -0
  158. package/compiled/terser-webpack-plugin/types/utils.d.ts +105 -0
  159. package/compiled/terser-webpack-plugin/utils.js +594 -0
  160. package/compiled/url-loader/LICENSE +20 -0
  161. package/compiled/url-loader/index.js +15 -0
  162. package/compiled/url-loader/package.json +1 -0
  163. package/compiled/webpack/Chunk.js +1 -0
  164. package/compiled/webpack/Compilation.js +1 -0
  165. package/compiled/webpack/HotModuleReplacement.runtime.js +394 -0
  166. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +462 -0
  167. package/compiled/webpack/LICENSE +20 -0
  168. package/compiled/webpack/LibraryTemplatePlugin.js +1 -0
  169. package/compiled/webpack/LoaderTargetPlugin.js +1 -0
  170. package/compiled/webpack/ModuleFilenameHelpers.js +1 -0
  171. package/compiled/webpack/NormalModule.js +1 -0
  172. package/compiled/webpack/RuntimeGlobals.js +1 -0
  173. package/compiled/webpack/RuntimeModule.js +1 -0
  174. package/compiled/webpack/SingleEntryPlugin.js +1 -0
  175. package/compiled/webpack/Template.js +1 -0
  176. package/compiled/webpack/ajv/lib/ajv.d.ts +397 -0
  177. package/compiled/webpack/deepImports.json +12 -0
  178. package/compiled/webpack/index.js +162861 -0
  179. package/compiled/webpack/json-schema/index.d.ts +751 -0
  180. package/compiled/webpack/lazy-compilation-node.js +40 -0
  181. package/compiled/webpack/lazy-compilation-web.js +74 -0
  182. package/compiled/webpack/package.json +5 -0
  183. package/compiled/webpack/schema-utils/declarations/ValidationError.d.ts +74 -0
  184. package/compiled/webpack/schema-utils/declarations/index.d.ts +3 -0
  185. package/compiled/webpack/schema-utils/declarations/validate.d.ts +37 -0
  186. package/compiled/webpack/types.d.ts +12664 -0
  187. package/compiled/webpack-5-chain/LICENSE +373 -0
  188. package/compiled/webpack-5-chain/index.js +1 -0
  189. package/compiled/webpack-5-chain/package.json +1 -0
  190. package/compiled/webpack-5-chain/types/index.d.ts +543 -0
  191. package/compiled/webpack-bundle-analyzer/LICENSE +20 -0
  192. package/compiled/webpack-bundle-analyzer/index.js +30 -0
  193. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  194. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  195. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  196. package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -0
  197. package/compiled/webpack-dev-middleware/LICENSE +20 -0
  198. package/compiled/webpack-dev-middleware/index.js +21 -0
  199. package/compiled/webpack-dev-middleware/package.json +1 -0
  200. package/compiled/webpack-sources/LICENSE +21 -0
  201. package/compiled/webpack-sources/index.d.ts +20 -0
  202. package/compiled/webpack-sources/index.js +1 -0
  203. package/compiled/webpack-sources/lib/CachedSource.d.ts +18 -0
  204. package/compiled/webpack-sources/lib/CompatSource.d.ts +9 -0
  205. package/compiled/webpack-sources/lib/ConcatSource.d.ts +22 -0
  206. package/compiled/webpack-sources/lib/OriginalSource.d.ts +18 -0
  207. package/compiled/webpack-sources/lib/PrefixSource.d.ts +12 -0
  208. package/compiled/webpack-sources/lib/RawSource.d.ts +13 -0
  209. package/compiled/webpack-sources/lib/ReplaceSource.d.ts +35 -0
  210. package/compiled/webpack-sources/lib/SizeOnlySource.d.ts +7 -0
  211. package/compiled/webpack-sources/lib/Source.d.ts +45 -0
  212. package/compiled/webpack-sources/lib/SourceMapSource.d.ts +22 -0
  213. package/compiled/webpack-sources/lib/index.d.ts +60 -0
  214. package/compiled/webpack-sources/package.json +1 -0
  215. package/compiled/webpack-sources/source-list-map/index.d.ts +91 -0
  216. package/compiled/webpack-sources/source-map/source-map.d.ts +369 -0
  217. package/compiled/ws/LICENSE +19 -0
  218. package/compiled/ws/index.d.ts +359 -0
  219. package/compiled/ws/index.js +1 -0
  220. package/compiled/ws/package.json +1 -0
  221. package/dist/build.d.ts +16 -0
  222. package/dist/build.js +71 -0
  223. package/{lib → dist}/cli.d.ts +0 -0
  224. package/dist/cli.js +113 -0
  225. package/{lib/webpackHotDevClient/webpackHotDevClient.d.ts → dist/client/client.d.ts} +0 -0
  226. package/dist/client/client.js +239 -0
  227. package/dist/config/_sampleFeature.d.ts +10 -0
  228. package/dist/config/_sampleFeature.js +22 -0
  229. package/dist/config/assetRules.d.ts +11 -0
  230. package/dist/config/assetRules.js +57 -0
  231. package/dist/config/bundleAnalyzerPlugin.d.ts +10 -0
  232. package/dist/config/bundleAnalyzerPlugin.js +30 -0
  233. package/dist/config/compressPlugin.d.ts +10 -0
  234. package/dist/config/compressPlugin.js +77 -0
  235. package/dist/config/config.d.ts +19 -0
  236. package/dist/config/config.js +171 -0
  237. package/dist/config/copyPlugin.d.ts +10 -0
  238. package/dist/config/copyPlugin.js +49 -0
  239. package/dist/config/cssRules.d.ts +11 -0
  240. package/dist/config/cssRules.js +98 -0
  241. package/dist/config/definePlugin.d.ts +15 -0
  242. package/dist/config/definePlugin.js +45 -0
  243. package/dist/config/fastRefreshPlugin.d.ts +12 -0
  244. package/dist/config/fastRefreshPlugin.js +34 -0
  245. package/dist/config/ignorePlugin.d.ts +10 -0
  246. package/dist/config/ignorePlugin.js +27 -0
  247. package/dist/config/javaScriptRules.d.ts +14 -0
  248. package/dist/config/javaScriptRules.js +150 -0
  249. package/dist/config/miniCSSExtractPlugin.d.ts +10 -0
  250. package/dist/config/miniCSSExtractPlugin.js +34 -0
  251. package/dist/config/nodePolyfill.d.ts +10 -0
  252. package/dist/config/nodePolyfill.js +34 -0
  253. package/dist/config/progressPlugin.d.ts +11 -0
  254. package/dist/config/progressPlugin.js +27 -0
  255. package/dist/config/purgecssWebpackPlugin.d.ts +10 -0
  256. package/dist/config/purgecssWebpackPlugin.js +32 -0
  257. package/dist/config/speedMeasureWebpackPlugin.d.ts +6 -0
  258. package/dist/config/speedMeasureWebpackPlugin.js +34 -0
  259. package/dist/config/svgRules.d.ts +11 -0
  260. package/dist/config/svgRules.js +56 -0
  261. package/dist/constants.d.ts +11 -0
  262. package/dist/constants.js +15 -0
  263. package/dist/dev.d.ts +18 -0
  264. package/dist/dev.js +80 -0
  265. package/dist/index.d.ts +5 -0
  266. package/dist/index.js +16 -0
  267. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +11 -0
  268. package/dist/plugins/ESBuildCSSMinifyPlugin.js +65 -0
  269. package/dist/plugins/ProgressPlugin.d.ts +15 -0
  270. package/dist/plugins/ProgressPlugin.js +44 -0
  271. package/dist/plugins/_SamplePlugin.d.ts +9 -0
  272. package/dist/plugins/_SamplePlugin.js +14 -0
  273. package/dist/requireHook.d.ts +1 -0
  274. package/dist/requireHook.js +31 -0
  275. package/dist/schema.d.ts +3 -0
  276. package/dist/schema.js +68 -0
  277. package/dist/server/server.d.ts +16 -0
  278. package/dist/server/server.js +157 -0
  279. package/dist/server/ws.d.ts +8 -0
  280. package/dist/server/ws.js +42 -0
  281. package/dist/types.d.ts +97 -0
  282. package/dist/types.js +29 -0
  283. package/dist/utils/browsersList.d.ts +5 -0
  284. package/dist/utils/browsersList.js +10 -0
  285. package/dist/utils/depMatch.d.ts +6 -0
  286. package/dist/utils/depMatch.js +46 -0
  287. package/dist/utils/formatWebpackMessages.d.ts +12 -0
  288. package/dist/utils/formatWebpackMessages.js +100 -0
  289. package/package.json +163 -35
  290. package/bundled/css/hotModuleReplacement.js +0 -1203
  291. package/bundled/js/webpackHotDevClient.js +0 -13386
  292. package/lib/DevCompileDonePlugin.d.ts +0 -10
  293. package/lib/DevCompileDonePlugin.js +0 -53
  294. package/lib/cli.js +0 -184
  295. package/lib/getConfig/css.d.ts +0 -22
  296. package/lib/getConfig/css.js +0 -186
  297. package/lib/getConfig/getConfig.d.ts +0 -26
  298. package/lib/getConfig/getConfig.js +0 -578
  299. package/lib/getConfig/nodeModulesTransform.d.ts +0 -13
  300. package/lib/getConfig/nodeModulesTransform.js +0 -141
  301. package/lib/getConfig/pkgMatch.d.ts +0 -2
  302. package/lib/getConfig/pkgMatch.js +0 -58
  303. package/lib/getConfig/resolveDefine.d.ts +0 -5
  304. package/lib/getConfig/resolveDefine.js +0 -53
  305. package/lib/getConfig/runtimePublicPathEntry.d.ts +0 -1
  306. package/lib/getConfig/runtimePublicPathEntry.js +0 -3
  307. package/lib/getConfig/terserOptions.d.ts +0 -41
  308. package/lib/getConfig/terserOptions.js +0 -64
  309. package/lib/index.d.ts +0 -34
  310. package/lib/index.js +0 -314
  311. package/lib/requireHook.d.ts +0 -3
  312. package/lib/requireHook.js +0 -51
  313. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependency.js +0 -94
  314. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependencyTemplate.js +0 -26
  315. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssLoadingRuntimeModule.js +0 -93
  316. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModule.js +0 -164
  317. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModuleFactory.js +0 -32
  318. package/lib/webpack/plugins/mini-css-extract-plugin/src/cjs.js +0 -15
  319. package/lib/webpack/plugins/mini-css-extract-plugin/src/index.js +0 -542
  320. package/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js +0 -319
  321. package/lib/webpack/plugins/mini-css-extract-plugin/src/utils.js +0 -97
  322. package/lib/webpack/plugins/mini-css-extract-plugin.d.ts +0 -1
  323. package/lib/webpack/plugins/mini-css-extract-plugin.js +0 -15
  324. package/lib/webpack/plugins/terser-webpack-plugin/package.json +0 -3
  325. package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack4Cache.js +0 -187
  326. package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack5Cache.js +0 -61
  327. package/lib/webpack/plugins/terser-webpack-plugin/src/index.js +0 -683
  328. package/lib/webpack/plugins/terser-webpack-plugin/src/minify.js +0 -197
  329. package/lib/webpack/plugins/terser-webpack-plugin.d.ts +0 -1
  330. package/lib/webpack/plugins/terser-webpack-plugin.js +0 -15
  331. package/lib/webpackHotDevClient/formatWebpackMessages.d.ts +0 -11
  332. package/lib/webpackHotDevClient/formatWebpackMessages.js +0 -127
  333. package/lib/webpackHotDevClient/webpackHotDevClient.js +0 -311
@@ -0,0 +1,35 @@
1
+ // Type definitions for mime 1.3
2
+ // Project: https://github.com/broofa/node-mime
3
+ // Definitions by: Jeff Goddard <https://github.com/jedigo>
4
+ // Daniel Hritzkiv <https://github.com/dhritzkiv>
5
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
+
7
+ // Originally imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts
8
+
9
+ export as namespace mime;
10
+
11
+ export interface TypeMap { [key: string]: string[]; }
12
+
13
+ /**
14
+ * Look up a mime type based on extension.
15
+ *
16
+ * If not found, uses the fallback argument if provided, and otherwise
17
+ * uses `default_type`.
18
+ */
19
+ export function lookup(path: string, fallback?: string): string;
20
+ /**
21
+ * Return a file extensions associated with a mime type.
22
+ */
23
+ export function extension(mime: string): string | undefined;
24
+ /**
25
+ * Load an Apache2-style ".types" file.
26
+ */
27
+ export function load(filepath: string): void;
28
+ export function define(mimes: TypeMap): void;
29
+
30
+ export interface Charsets {
31
+ lookup(mime: string, fallback: string): string;
32
+ }
33
+
34
+ export const charsets: Charsets;
35
+ export const default_type: string;
@@ -0,0 +1 @@
1
+ {"name":"express","author":"TJ Holowaychuk <tj@vision-media.ca>","license":"MIT"}
@@ -0,0 +1,62 @@
1
+ // Type definitions for qs 6.9
2
+ // Project: https://github.com/ljharb/qs
3
+ // Definitions by: Roman Korneev <https://github.com/RWander>
4
+ // Leon Yu <https://github.com/leonyu>
5
+ // Belinda Teh <https://github.com/tehbelinda>
6
+ // Melvin Lee <https://github.com/zyml>
7
+ // Arturs Vonda <https://github.com/artursvonda>
8
+ // Carlos Bonetti <https://github.com/CarlosBonetti>
9
+ // Dan Smith <https://github.com/dpsmith3>
10
+ // Hunter Perrin <https://github.com/hperrin>
11
+ // Jordan Harband <https://github.com/ljharb>
12
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
13
+ export = QueryString;
14
+ export as namespace qs;
15
+
16
+ declare namespace QueryString {
17
+ type defaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string;
18
+ type defaultDecoder = (str: string, decoder?: any, charset?: string) => string;
19
+
20
+ interface IStringifyOptions {
21
+ delimiter?: string | undefined;
22
+ strictNullHandling?: boolean | undefined;
23
+ skipNulls?: boolean | undefined;
24
+ encode?: boolean | undefined;
25
+ encoder?: ((str: any, defaultEncoder: defaultEncoder, charset: string, type: 'key' | 'value') => string) | undefined;
26
+ filter?: Array<string | number> | ((prefix: string, value: any) => any) | undefined;
27
+ arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma' | undefined;
28
+ indices?: boolean | undefined;
29
+ sort?: ((a: any, b: any) => number) | undefined;
30
+ serializeDate?: ((d: Date) => string) | undefined;
31
+ format?: 'RFC1738' | 'RFC3986' | undefined;
32
+ encodeValuesOnly?: boolean | undefined;
33
+ addQueryPrefix?: boolean | undefined;
34
+ allowDots?: boolean | undefined;
35
+ charset?: 'utf-8' | 'iso-8859-1' | undefined;
36
+ charsetSentinel?: boolean | undefined;
37
+ }
38
+
39
+ interface IParseOptions {
40
+ comma?: boolean | undefined;
41
+ delimiter?: string | RegExp | undefined;
42
+ depth?: number | false | undefined;
43
+ decoder?: ((str: string, defaultDecoder: defaultDecoder, charset: string, type: 'key' | 'value') => any) | undefined;
44
+ arrayLimit?: number | undefined;
45
+ parseArrays?: boolean | undefined;
46
+ allowDots?: boolean | undefined;
47
+ plainObjects?: boolean | undefined;
48
+ allowPrototypes?: boolean | undefined;
49
+ parameterLimit?: number | undefined;
50
+ strictNullHandling?: boolean | undefined;
51
+ ignoreQueryPrefix?: boolean | undefined;
52
+ charset?: 'utf-8' | 'iso-8859-1' | undefined;
53
+ charsetSentinel?: boolean | undefined;
54
+ interpretNumericEntities?: boolean | undefined;
55
+ }
56
+
57
+ interface ParsedQs { [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[] }
58
+
59
+ function stringify(obj: any, options?: IStringifyOptions): string;
60
+ function parse(str: string, options?: IParseOptions & { decoder?: never | undefined }): ParsedQs;
61
+ function parse(str: string | Record<string, string>, options?: IParseOptions): { [key: string]: unknown };
62
+ }
@@ -0,0 +1,35 @@
1
+ // Type definitions for range-parser 1.2
2
+ // Project: https://github.com/jshttp/range-parser
3
+ // Definitions by: Tomek Łaziuk <https://github.com/tlaziuk>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+
6
+ /**
7
+ * When ranges are returned, the array has a "type" property which is the type of
8
+ * range that is required (most commonly, "bytes"). Each array element is an object
9
+ * with a "start" and "end" property for the portion of the range.
10
+ *
11
+ * @returns `-1` when unsatisfiable and `-2` when syntactically invalid, ranges otherwise.
12
+ */
13
+ declare function RangeParser(size: number, str: string, options?: RangeParser.Options): RangeParser.Result | RangeParser.Ranges;
14
+
15
+ declare namespace RangeParser {
16
+ interface Ranges extends Array<Range> {
17
+ type: string;
18
+ }
19
+ interface Range {
20
+ start: number;
21
+ end: number;
22
+ }
23
+ interface Options {
24
+ /**
25
+ * The "combine" option can be set to `true` and overlapping & adjacent ranges
26
+ * will be combined into a single range.
27
+ */
28
+ combine?: boolean | undefined;
29
+ }
30
+ type ResultUnsatisfiable = -1;
31
+ type ResultInvalid = -2;
32
+ type Result = ResultUnsatisfiable | ResultInvalid;
33
+ }
34
+
35
+ export = RangeParser;
@@ -0,0 +1,108 @@
1
+ // Type definitions for serve-static 1.13
2
+ // Project: https://github.com/expressjs/serve-static
3
+ // Definitions by: Uros Smolnik <https://github.com/urossmolnik>
4
+ // Linus Unnebäck <https://github.com/LinusU>
5
+ // Devansh Jethmalani <https://github.com/devanshj>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.3
8
+
9
+ /// <reference types="node" />
10
+ import * as m from '../mime';
11
+ import * as http from 'http';
12
+
13
+ /**
14
+ * Create a new middleware function to serve files from within a given root directory.
15
+ * The file to serve will be determined by combining req.url with the provided root directory.
16
+ * When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs.
17
+ */
18
+ declare function serveStatic<R extends http.ServerResponse>(
19
+ root: string,
20
+ options?: serveStatic.ServeStaticOptions<R>
21
+ ): serveStatic.RequestHandler<R>;
22
+
23
+ declare namespace serveStatic {
24
+ var mime: typeof m;
25
+ interface ServeStaticOptions<R extends http.ServerResponse = http.ServerResponse> {
26
+ /**
27
+ * Enable or disable setting Cache-Control response header, defaults to true.
28
+ * Disabling this will ignore the immutable and maxAge options.
29
+ */
30
+ cacheControl?: boolean | undefined;
31
+
32
+ /**
33
+ * Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
34
+ * Note this check is done on the path itself without checking if the path actually exists on the disk.
35
+ * If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
36
+ * The default value is 'ignore'.
37
+ * 'allow' No special treatment for dotfiles
38
+ * 'deny' Send a 403 for any request for a dotfile
39
+ * 'ignore' Pretend like the dotfile does not exist and call next()
40
+ */
41
+ dotfiles?: string | undefined;
42
+
43
+ /**
44
+ * Enable or disable etag generation, defaults to true.
45
+ */
46
+ etag?: boolean | undefined;
47
+
48
+ /**
49
+ * Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
50
+ * The first that exists will be served. Example: ['html', 'htm'].
51
+ * The default value is false.
52
+ */
53
+ extensions?: string[] | false | undefined;
54
+
55
+ /**
56
+ * Let client errors fall-through as unhandled requests, otherwise forward a client error.
57
+ * The default value is true.
58
+ */
59
+ fallthrough?: boolean | undefined;
60
+
61
+ /**
62
+ * Enable or disable the immutable directive in the Cache-Control response header.
63
+ * If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
64
+ */
65
+ immutable?: boolean | undefined;
66
+
67
+ /**
68
+ * By default this module will send "index.html" files in response to a request on a directory.
69
+ * To disable this set false or to supply a new index pass a string or an array in preferred order.
70
+ */
71
+ index?: boolean | string | string[] | undefined;
72
+
73
+ /**
74
+ * Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
75
+ */
76
+ lastModified?: boolean | undefined;
77
+
78
+ /**
79
+ * Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
80
+ */
81
+ maxAge?: number | string | undefined;
82
+
83
+ /**
84
+ * Redirect to trailing "/" when the pathname is a dir. Defaults to true.
85
+ */
86
+ redirect?: boolean | undefined;
87
+
88
+ /**
89
+ * Function to set custom headers on response. Alterations to the headers need to occur synchronously.
90
+ * The function is called as fn(res, path, stat), where the arguments are:
91
+ * res the response object
92
+ * path the file path that is being sent
93
+ * stat the stat object of the file that is being sent
94
+ */
95
+ setHeaders?: ((res: R, path: string, stat: any) => any) | undefined;
96
+ }
97
+
98
+ interface RequestHandler<R extends http.ServerResponse> {
99
+ (request: http.IncomingMessage, response: R, next: () => void): any;
100
+ }
101
+
102
+ interface RequestHandlerConstructor<R extends http.ServerResponse> {
103
+ (root: string, options?: ServeStaticOptions<R>): RequestHandler<R>;
104
+ mime: typeof m;
105
+ }
106
+ }
107
+
108
+ export = serveStatic;
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Steven Chim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,4 @@
1
+ import { Filter, Options } from './types';
2
+ export declare function createProxyMiddleware(context: Filter | Options, options?: Options): import('./types').RequestHandler;
3
+ export * from './handlers';
4
+ export { Filter, Options, RequestHandler } from './types';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Based on definition by DefinitelyTyped:
3
+ * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/6f529c6c67a447190f86bfbf894d1061e41e07b7/types/http-proxy-middleware/index.d.ts
4
+ */
5
+ /// <reference types="node" />
6
+ import type * as express from '../../express';
7
+ import type * as http from 'http';
8
+ import type * as httpProxy from '../http-proxy';
9
+ import type * as net from 'net';
10
+ import type * as url from 'url';
11
+ export interface Request extends express.Request {
12
+ }
13
+ export interface Response extends express.Response {
14
+ }
15
+ export interface RequestHandler extends express.RequestHandler {
16
+ upgrade?: (req: Request, socket: net.Socket, head: any) => void;
17
+ }
18
+ export declare type Filter = string | string[] | ((pathname: string, req: Request) => boolean);
19
+ export interface Options extends httpProxy.ServerOptions {
20
+ pathRewrite?: {
21
+ [regexp: string]: string;
22
+ } | ((path: string, req: Request) => string) | ((path: string, req: Request) => Promise<string>);
23
+ router?: {
24
+ [hostOrPath: string]: httpProxy.ServerOptions['target'];
25
+ } | ((req: Request) => httpProxy.ServerOptions['target']) | ((req: Request) => Promise<httpProxy.ServerOptions['target']>);
26
+ logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent';
27
+ logProvider?: LogProviderCallback;
28
+ onError?: OnErrorCallback;
29
+ onProxyRes?: OnProxyResCallback;
30
+ onProxyReq?: OnProxyReqCallback;
31
+ onProxyReqWs?: OnProxyReqWsCallback;
32
+ onOpen?: OnOpenCallback;
33
+ onClose?: OnCloseCallback;
34
+ }
35
+ interface LogProvider {
36
+ log: Logger;
37
+ debug?: Logger;
38
+ info?: Logger;
39
+ warn?: Logger;
40
+ error?: Logger;
41
+ }
42
+ declare type Logger = (...args: any[]) => void;
43
+ export declare type LogProviderCallback = (provider: LogProvider) => LogProvider;
44
+ /**
45
+ * Use types based on the events listeners from http-proxy
46
+ * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/51504fd999031b7f025220fab279f1b2155cbaff/types/http-proxy/index.d.ts
47
+ */
48
+ export declare type OnErrorCallback = (err: Error, req: http.IncomingMessage, res: http.ServerResponse, target?: string | Partial<url.Url>) => void;
49
+ export declare type OnProxyResCallback = (proxyRes: http.IncomingMessage, req: http.IncomingMessage, res: http.ServerResponse) => void;
50
+ export declare type OnProxyReqCallback = (proxyReq: http.ClientRequest, req: http.IncomingMessage, res: http.ServerResponse, options: httpProxy.ServerOptions) => void;
51
+ export declare type OnProxyReqWsCallback = (proxyReq: http.ClientRequest, req: http.IncomingMessage, socket: net.Socket, options: httpProxy.ServerOptions, head: any) => void;
52
+ export declare type OnCloseCallback = (proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void;
53
+ export declare type OnOpenCallback = (proxySocket: net.Socket) => void;
54
+ export {};
@@ -0,0 +1,226 @@
1
+ // Type definitions for node-http-proxy 1.17
2
+ // Project: https://github.com/nodejitsu/node-http-proxy
3
+ // Definitions by: Maxime LUCE <https://github.com/SomaticIT>
4
+ // Florian Oellerich <https://github.com/Raigen>
5
+ // Daniel Schmidt <https://github.com/DanielMSchmidt>
6
+ // Jordan Abreu <https://github.com/jabreu610>
7
+ // Samuel Bodin <https://github.com/bodinsamuel>
8
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
+ // TypeScript Version: 2.1
10
+
11
+ /// <reference types="node" />
12
+
13
+ import * as net from 'net';
14
+ import * as http from 'http';
15
+ import * as https from 'https';
16
+ import * as events from 'events';
17
+ import * as url from 'url';
18
+ import * as stream from 'stream';
19
+
20
+ interface ProxyTargetDetailed {
21
+ host: string;
22
+ port: number;
23
+ protocol?: string | undefined;
24
+ hostname?: string | undefined;
25
+ socketPath?: string | undefined;
26
+ key?: string | undefined;
27
+ passphrase?: string | undefined;
28
+ pfx?: Buffer | string | undefined;
29
+ cert?: string | undefined;
30
+ ca?: string | undefined;
31
+ ciphers?: string | undefined;
32
+ secureProtocol?: string | undefined;
33
+ }
34
+
35
+ declare class Server extends events.EventEmitter {
36
+ /**
37
+ * Creates the proxy server with specified options.
38
+ * @param options - Config object passed to the proxy
39
+ */
40
+ constructor(options?: Server.ServerOptions);
41
+
42
+ /**
43
+ * Used for proxying regular HTTP(S) requests
44
+ * @param req - Client request.
45
+ * @param res - Client response.
46
+ * @param options - Additionnal options.
47
+ */
48
+ web(
49
+ req: http.IncomingMessage,
50
+ res: http.ServerResponse,
51
+ options?: Server.ServerOptions,
52
+ callback?: Server.ErrorCallback,
53
+ ): void;
54
+
55
+ /**
56
+ * Used for proxying regular HTTP(S) requests
57
+ * @param req - Client request.
58
+ * @param socket - Client socket.
59
+ * @param head - Client head.
60
+ * @param options - Additionnal options.
61
+ */
62
+ ws(
63
+ req: http.IncomingMessage,
64
+ socket: any,
65
+ head: any,
66
+ options?: Server.ServerOptions,
67
+ callback?: Server.ErrorCallback,
68
+ ): void;
69
+
70
+ /**
71
+ * A function that wraps the object in a webserver, for your convenience
72
+ * @param port - Port to listen on
73
+ */
74
+ listen(port: number): Server;
75
+
76
+ /**
77
+ * A function that closes the inner webserver and stops listening on given port
78
+ */
79
+ close(callback?: () => void): void;
80
+
81
+ /**
82
+ * Creates the proxy server with specified options.
83
+ * @param options Config object passed to the proxy
84
+ * @returns Proxy object with handlers for `ws` and `web` requests
85
+ */
86
+ static createProxyServer(options?: Server.ServerOptions): Server;
87
+
88
+ /**
89
+ * Creates the proxy server with specified options.
90
+ * @param options Config object passed to the proxy
91
+ * @returns Proxy object with handlers for `ws` and `web` requests
92
+ */
93
+ static createServer(options?: Server.ServerOptions): Server;
94
+
95
+ /**
96
+ * Creates the proxy server with specified options.
97
+ * @param options Config object passed to the proxy
98
+ * @returns Proxy object with handlers for `ws` and `web` requests
99
+ */
100
+ static createProxy(options?: Server.ServerOptions): Server;
101
+
102
+ addListener(event: string, listener: () => void): this;
103
+ on(event: string, listener: () => void): this;
104
+ on(event: "error", listener: Server.ErrorCallback): this;
105
+ on(event: "start", listener: Server.StartCallback): this;
106
+ on(event: "proxyReq", listener: Server.ProxyReqCallback): this;
107
+ on(event: "proxyRes", listener: Server.ProxyResCallback): this;
108
+ on(event: "proxyReqWs", listener: Server.ProxyReqWsCallback): this;
109
+ on(event: "econnreset", listener: Server.EconnresetCallback): this;
110
+ on(event: "end", listener: Server.EndCallback): this;
111
+ on(event: "open", listener: Server.OpenCallback): this;
112
+ on(event: "close", listener: Server.CloseCallback): this;
113
+
114
+ once(event: string, listener: () => void): this;
115
+ once(event: "error", listener: Server.ErrorCallback): this;
116
+ once(event: "start", listener: Server.StartCallback): this;
117
+ once(event: "proxyReq", listener: Server.ProxyReqCallback): this;
118
+ once(event: "proxyRes", listener: Server.ProxyResCallback): this;
119
+ once(event: "proxyReqWs", listener: Server.ProxyReqWsCallback): this;
120
+ once(event: "econnreset", listener: Server.EconnresetCallback): this;
121
+ once(event: "end", listener: Server.EndCallback): this;
122
+ once(event: "open", listener: Server.OpenCallback): this;
123
+ once(event: "close", listener: Server.CloseCallback): this;
124
+ removeListener(event: string, listener: () => void): this;
125
+ removeAllListeners(event?: string): this;
126
+ getMaxListeners(): number;
127
+ setMaxListeners(n: number): this;
128
+ listeners(event: string): Array<() => void>;
129
+ emit(event: string, ...args: any[]): boolean;
130
+ listenerCount(type: string): number;
131
+ }
132
+
133
+ declare namespace Server {
134
+ type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
135
+ type ProxyTargetUrl = string | Partial<url.Url>;
136
+
137
+ interface ServerOptions {
138
+ /** URL string to be parsed with the url module. */
139
+ target?: ProxyTarget | undefined;
140
+ /** URL string to be parsed with the url module. */
141
+ forward?: ProxyTargetUrl | undefined;
142
+ /** Object to be passed to http(s).request. */
143
+ agent?: any;
144
+ /** Object to be passed to https.createServer(). */
145
+ ssl?: any;
146
+ /** If you want to proxy websockets. */
147
+ ws?: boolean | undefined;
148
+ /** Adds x- forward headers. */
149
+ xfwd?: boolean | undefined;
150
+ /** Verify SSL certificate. */
151
+ secure?: boolean | undefined;
152
+ /** Explicitly specify if we are proxying to another proxy. */
153
+ toProxy?: boolean | undefined;
154
+ /** Specify whether you want to prepend the target's path to the proxy path. */
155
+ prependPath?: boolean | undefined;
156
+ /** Specify whether you want to ignore the proxy path of the incoming request. */
157
+ ignorePath?: boolean | undefined;
158
+ /** Local interface string to bind for outgoing connections. */
159
+ localAddress?: string | undefined;
160
+ /** Changes the origin of the host header to the target URL. */
161
+ changeOrigin?: boolean | undefined;
162
+ /** specify whether you want to keep letter case of response header key */
163
+ preserveHeaderKeyCase?: boolean | undefined;
164
+ /** Basic authentication i.e. 'user:password' to compute an Authorization header. */
165
+ auth?: string | undefined;
166
+ /** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
167
+ hostRewrite?: string | undefined;
168
+ /** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
169
+ autoRewrite?: boolean | undefined;
170
+ /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
171
+ protocolRewrite?: string | undefined;
172
+ /** rewrites domain of set-cookie headers. */
173
+ cookieDomainRewrite?: false | string | { [oldDomain: string]: string } | undefined;
174
+ /** rewrites path of set-cookie headers. Default: false */
175
+ cookiePathRewrite?: false | string | { [oldPath: string]: string } | undefined;
176
+ /** object with extra headers to be added to target requests. */
177
+ headers?: { [header: string]: string } | undefined;
178
+ /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
179
+ proxyTimeout?: number | undefined;
180
+ /** Timeout (in milliseconds) for incoming requests */
181
+ timeout?: number | undefined;
182
+ /** Specify whether you want to follow redirects. Default: false */
183
+ followRedirects?: boolean | undefined;
184
+ /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
185
+ selfHandleResponse?: boolean | undefined;
186
+ /** Buffer */
187
+ buffer?: stream.Stream | undefined;
188
+ }
189
+
190
+ type StartCallback = (req: http.IncomingMessage, res: http.ServerResponse, target: ProxyTargetUrl) => void;
191
+ type ProxyReqCallback = (
192
+ proxyReq: http.ClientRequest,
193
+ req: http.IncomingMessage,
194
+ res: http.ServerResponse,
195
+ options: ServerOptions,
196
+ ) => void;
197
+ type ProxyResCallback = (
198
+ proxyRes: http.IncomingMessage,
199
+ req: http.IncomingMessage,
200
+ res: http.ServerResponse,
201
+ ) => void;
202
+ type ProxyReqWsCallback = (
203
+ proxyReq: http.ClientRequest,
204
+ req: http.IncomingMessage,
205
+ socket: net.Socket,
206
+ options: ServerOptions,
207
+ head: any,
208
+ ) => void;
209
+ type EconnresetCallback = (
210
+ err: Error,
211
+ req: http.IncomingMessage,
212
+ res: http.ServerResponse,
213
+ target: ProxyTargetUrl,
214
+ ) => void;
215
+ type EndCallback = (req: http.IncomingMessage, res: http.ServerResponse, proxyRes: http.IncomingMessage) => void;
216
+ type OpenCallback = (proxySocket: net.Socket) => void;
217
+ type CloseCallback = (proxyRes: http.IncomingMessage, proxySocket: net.Socket, proxyHead: any) => void;
218
+ type ErrorCallback = (
219
+ err: Error,
220
+ req: http.IncomingMessage,
221
+ res: http.ServerResponse,
222
+ target?: ProxyTargetUrl,
223
+ ) => void;
224
+ }
225
+
226
+ export = Server;