rahad-media-downloader 2.1.12 → 2.1.13
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/replit/modules/nodejs-20.res +1 -0
- package/.cache/replit/modules/replit.res +1 -0
- package/.cache/typescript/5.4/node_modules/.package-lock.json +185 -0
- package/.cache/typescript/5.4/node_modules/@types/caseless/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/caseless/README.md +48 -0
- package/.cache/typescript/5.4/node_modules/@types/caseless/index.d.ts +29 -0
- package/.cache/typescript/5.4/node_modules/@types/caseless/package.json +35 -0
- package/.cache/typescript/5.4/node_modules/@types/domhandler/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/domhandler/README.md +92 -0
- package/.cache/typescript/5.4/node_modules/@types/domhandler/index.d.ts +73 -0
- package/.cache/typescript/5.4/node_modules/@types/domhandler/package.json +25 -0
- package/.cache/typescript/5.4/node_modules/@types/domutils/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/domutils/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/domutils/index.d.ts +124 -0
- package/.cache/typescript/5.4/node_modules/@types/domutils/package.json +27 -0
- package/.cache/typescript/5.4/node_modules/@types/htmlparser2/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/htmlparser2/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/htmlparser2/index.d.ts +120 -0
- package/.cache/typescript/5.4/node_modules/@types/htmlparser2/package.json +45 -0
- package/.cache/typescript/5.4/node_modules/@types/node/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/node/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.4/node_modules/@types/node/assert.d.ts +1040 -0
- package/.cache/typescript/5.4/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/.cache/typescript/5.4/node_modules/@types/node/buffer.d.ts +2363 -0
- package/.cache/typescript/5.4/node_modules/@types/node/child_process.d.ts +1542 -0
- package/.cache/typescript/5.4/node_modules/@types/node/cluster.d.ts +578 -0
- package/.cache/typescript/5.4/node_modules/@types/node/console.d.ts +452 -0
- package/.cache/typescript/5.4/node_modules/@types/node/constants.d.ts +19 -0
- package/.cache/typescript/5.4/node_modules/@types/node/crypto.d.ts +4522 -0
- package/.cache/typescript/5.4/node_modules/@types/node/dgram.d.ts +596 -0
- package/.cache/typescript/5.4/node_modules/@types/node/diagnostics_channel.d.ts +545 -0
- package/.cache/typescript/5.4/node_modules/@types/node/dns/promises.d.ts +473 -0
- package/.cache/typescript/5.4/node_modules/@types/node/dns.d.ts +853 -0
- package/.cache/typescript/5.4/node_modules/@types/node/dom-events.d.ts +124 -0
- package/.cache/typescript/5.4/node_modules/@types/node/domain.d.ts +170 -0
- package/.cache/typescript/5.4/node_modules/@types/node/events.d.ts +884 -0
- package/.cache/typescript/5.4/node_modules/@types/node/fs/promises.d.ts +1245 -0
- package/.cache/typescript/5.4/node_modules/@types/node/fs.d.ts +4317 -0
- package/.cache/typescript/5.4/node_modules/@types/node/globals.d.ts +411 -0
- package/.cache/typescript/5.4/node_modules/@types/node/globals.global.d.ts +1 -0
- package/.cache/typescript/5.4/node_modules/@types/node/http.d.ts +1889 -0
- package/.cache/typescript/5.4/node_modules/@types/node/http2.d.ts +2418 -0
- package/.cache/typescript/5.4/node_modules/@types/node/https.d.ts +550 -0
- package/.cache/typescript/5.4/node_modules/@types/node/index.d.ts +89 -0
- package/.cache/typescript/5.4/node_modules/@types/node/inspector.d.ts +2746 -0
- package/.cache/typescript/5.4/node_modules/@types/node/module.d.ts +315 -0
- package/.cache/typescript/5.4/node_modules/@types/node/net.d.ts +996 -0
- package/.cache/typescript/5.4/node_modules/@types/node/os.d.ts +495 -0
- package/.cache/typescript/5.4/node_modules/@types/node/package.json +217 -0
- package/.cache/typescript/5.4/node_modules/@types/node/path.d.ts +191 -0
- package/.cache/typescript/5.4/node_modules/@types/node/perf_hooks.d.ts +645 -0
- package/.cache/typescript/5.4/node_modules/@types/node/process.d.ts +1747 -0
- package/.cache/typescript/5.4/node_modules/@types/node/punycode.d.ts +117 -0
- package/.cache/typescript/5.4/node_modules/@types/node/querystring.d.ts +153 -0
- package/.cache/typescript/5.4/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/.cache/typescript/5.4/node_modules/@types/node/readline.d.ts +540 -0
- package/.cache/typescript/5.4/node_modules/@types/node/repl.d.ts +430 -0
- package/.cache/typescript/5.4/node_modules/@types/node/sea.d.ts +153 -0
- package/.cache/typescript/5.4/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.4/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/.cache/typescript/5.4/node_modules/@types/node/stream/web.d.ts +367 -0
- package/.cache/typescript/5.4/node_modules/@types/node/stream.d.ts +1707 -0
- package/.cache/typescript/5.4/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.4/node_modules/@types/node/test.d.ts +1470 -0
- package/.cache/typescript/5.4/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/.cache/typescript/5.4/node_modules/@types/node/timers.d.ts +240 -0
- package/.cache/typescript/5.4/node_modules/@types/node/tls.d.ts +1217 -0
- package/.cache/typescript/5.4/node_modules/@types/node/trace_events.d.ts +197 -0
- package/.cache/typescript/5.4/node_modules/@types/node/tty.d.ts +208 -0
- package/.cache/typescript/5.4/node_modules/@types/node/url.d.ts +944 -0
- package/.cache/typescript/5.4/node_modules/@types/node/util.d.ts +2276 -0
- package/.cache/typescript/5.4/node_modules/@types/node/v8.d.ts +764 -0
- package/.cache/typescript/5.4/node_modules/@types/node/vm.d.ts +921 -0
- package/.cache/typescript/5.4/node_modules/@types/node/wasi.d.ts +181 -0
- package/.cache/typescript/5.4/node_modules/@types/node/worker_threads.d.ts +691 -0
- package/.cache/typescript/5.4/node_modules/@types/node/zlib.d.ts +530 -0
- package/.cache/typescript/5.4/node_modules/@types/node-fetch/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/node-fetch/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/node-fetch/externals.d.ts +32 -0
- package/.cache/typescript/5.4/node_modules/@types/node-fetch/index.d.ts +238 -0
- package/.cache/typescript/5.4/node_modules/@types/node-fetch/package.json +83 -0
- package/.cache/typescript/5.4/node_modules/@types/qs/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/qs/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/qs/index.d.ts +79 -0
- package/.cache/typescript/5.4/node_modules/@types/qs/package.json +65 -0
- package/.cache/typescript/5.4/node_modules/@types/request/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/request/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/request/index.d.ts +395 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/README.md +350 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/README.md.bak +350 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/index.d.ts +51 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/lib/form_data.js +483 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.4/node_modules/@types/request/node_modules/form-data/package.json +68 -0
- package/.cache/typescript/5.4/node_modules/@types/request/package.json +70 -0
- package/.cache/typescript/5.4/node_modules/@types/tough-cookie/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/@types/tough-cookie/README.md +15 -0
- package/.cache/typescript/5.4/node_modules/@types/tough-cookie/index.d.ts +321 -0
- package/.cache/typescript/5.4/node_modules/@types/tough-cookie/package.json +35 -0
- package/.cache/typescript/5.4/node_modules/asynckit/LICENSE +21 -0
- package/.cache/typescript/5.4/node_modules/asynckit/README.md +233 -0
- package/.cache/typescript/5.4/node_modules/asynckit/bench.js +76 -0
- package/.cache/typescript/5.4/node_modules/asynckit/index.js +6 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/abort.js +29 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/async.js +34 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/defer.js +26 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/iterate.js +75 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/state.js +37 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/streamify.js +141 -0
- package/.cache/typescript/5.4/node_modules/asynckit/lib/terminator.js +29 -0
- package/.cache/typescript/5.4/node_modules/asynckit/package.json +63 -0
- package/.cache/typescript/5.4/node_modules/asynckit/parallel.js +43 -0
- package/.cache/typescript/5.4/node_modules/asynckit/serial.js +17 -0
- package/.cache/typescript/5.4/node_modules/asynckit/serialOrdered.js +75 -0
- package/.cache/typescript/5.4/node_modules/asynckit/stream.js +21 -0
- package/.cache/typescript/5.4/node_modules/combined-stream/License +19 -0
- package/.cache/typescript/5.4/node_modules/combined-stream/Readme.md +138 -0
- package/.cache/typescript/5.4/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/.cache/typescript/5.4/node_modules/combined-stream/package.json +25 -0
- package/.cache/typescript/5.4/node_modules/combined-stream/yarn.lock +17 -0
- package/.cache/typescript/5.4/node_modules/delayed-stream/License +19 -0
- package/.cache/typescript/5.4/node_modules/delayed-stream/Makefile +7 -0
- package/.cache/typescript/5.4/node_modules/delayed-stream/Readme.md +141 -0
- package/.cache/typescript/5.4/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/.cache/typescript/5.4/node_modules/delayed-stream/package.json +27 -0
- package/.cache/typescript/5.4/node_modules/domelementtype/LICENSE +11 -0
- package/.cache/typescript/5.4/node_modules/domelementtype/index.js +15 -0
- package/.cache/typescript/5.4/node_modules/domelementtype/package.json +16 -0
- package/.cache/typescript/5.4/node_modules/domelementtype/readme.md +1 -0
- package/.cache/typescript/5.4/node_modules/domhandler/.travis.yml +6 -0
- package/.cache/typescript/5.4/node_modules/domhandler/LICENSE +11 -0
- package/.cache/typescript/5.4/node_modules/domhandler/index.js +217 -0
- package/.cache/typescript/5.4/node_modules/domhandler/lib/element.js +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/lib/node.js +44 -0
- package/.cache/typescript/5.4/node_modules/domhandler/package.json +41 -0
- package/.cache/typescript/5.4/node_modules/domhandler/readme.md +116 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/01-basic.json +57 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/12-text_only.json +11 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/23-dom-lvl1.json +131 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/24-with-start-indices.json +85 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/cases/25-with-end-indices.json +86 -0
- package/.cache/typescript/5.4/node_modules/domhandler/test/tests.js +60 -0
- package/.cache/typescript/5.4/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.4/node_modules/form-data/README.md.bak +358 -0
- package/.cache/typescript/5.4/node_modules/form-data/Readme.md +358 -0
- package/.cache/typescript/5.4/node_modules/form-data/index.d.ts +62 -0
- package/.cache/typescript/5.4/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.4/node_modules/form-data/lib/form_data.js +501 -0
- package/.cache/typescript/5.4/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.4/node_modules/form-data/package.json +68 -0
- package/.cache/typescript/5.4/node_modules/mime-db/HISTORY.md +507 -0
- package/.cache/typescript/5.4/node_modules/mime-db/LICENSE +23 -0
- package/.cache/typescript/5.4/node_modules/mime-db/README.md +100 -0
- package/.cache/typescript/5.4/node_modules/mime-db/db.json +8519 -0
- package/.cache/typescript/5.4/node_modules/mime-db/index.js +12 -0
- package/.cache/typescript/5.4/node_modules/mime-db/package.json +60 -0
- package/.cache/typescript/5.4/node_modules/mime-types/HISTORY.md +397 -0
- package/.cache/typescript/5.4/node_modules/mime-types/LICENSE +23 -0
- package/.cache/typescript/5.4/node_modules/mime-types/README.md +113 -0
- package/.cache/typescript/5.4/node_modules/mime-types/index.js +188 -0
- package/.cache/typescript/5.4/node_modules/mime-types/package.json +44 -0
- package/.cache/typescript/5.4/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.4/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.4/node_modules/types-registry/package.json +20 -0
- package/.cache/typescript/5.4/node_modules/undici-types/README.md +6 -0
- package/.cache/typescript/5.4/node_modules/undici-types/agent.d.ts +31 -0
- package/.cache/typescript/5.4/node_modules/undici-types/api.d.ts +43 -0
- package/.cache/typescript/5.4/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/.cache/typescript/5.4/node_modules/undici-types/cache.d.ts +36 -0
- package/.cache/typescript/5.4/node_modules/undici-types/client.d.ts +97 -0
- package/.cache/typescript/5.4/node_modules/undici-types/connector.d.ts +34 -0
- package/.cache/typescript/5.4/node_modules/undici-types/content-type.d.ts +21 -0
- package/.cache/typescript/5.4/node_modules/undici-types/cookies.d.ts +28 -0
- package/.cache/typescript/5.4/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/.cache/typescript/5.4/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/.cache/typescript/5.4/node_modules/undici-types/errors.d.ts +128 -0
- package/.cache/typescript/5.4/node_modules/undici-types/fetch.d.ts +209 -0
- package/.cache/typescript/5.4/node_modules/undici-types/file.d.ts +39 -0
- package/.cache/typescript/5.4/node_modules/undici-types/filereader.d.ts +54 -0
- package/.cache/typescript/5.4/node_modules/undici-types/formdata.d.ts +108 -0
- package/.cache/typescript/5.4/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/.cache/typescript/5.4/node_modules/undici-types/global-origin.d.ts +7 -0
- package/.cache/typescript/5.4/node_modules/undici-types/handlers.d.ts +9 -0
- package/.cache/typescript/5.4/node_modules/undici-types/header.d.ts +4 -0
- package/.cache/typescript/5.4/node_modules/undici-types/index.d.ts +63 -0
- package/.cache/typescript/5.4/node_modules/undici-types/interceptors.d.ts +5 -0
- package/.cache/typescript/5.4/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/.cache/typescript/5.4/node_modules/undici-types/mock-client.d.ts +25 -0
- package/.cache/typescript/5.4/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/.cache/typescript/5.4/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/.cache/typescript/5.4/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/.cache/typescript/5.4/node_modules/undici-types/package.json +55 -0
- package/.cache/typescript/5.4/node_modules/undici-types/patch.d.ts +71 -0
- package/.cache/typescript/5.4/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/.cache/typescript/5.4/node_modules/undici-types/pool.d.ts +28 -0
- package/.cache/typescript/5.4/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/.cache/typescript/5.4/node_modules/undici-types/readable.d.ts +61 -0
- package/.cache/typescript/5.4/node_modules/undici-types/webidl.d.ts +220 -0
- package/.cache/typescript/5.4/node_modules/undici-types/websocket.d.ts +131 -0
- package/.cache/typescript/5.4/package-lock.json +197 -0
- package/.cache/typescript/5.4/package.json +1 -0
- package/index.js +1 -1
- package/package.json +8 -2
- package/.cache/replit/modules/nodejs-20:v36-20240502-f4453db.res +0 -1
- package/.cache/replit/modules/replit:v9-20240429-0325cbb.res +0 -1
@@ -0,0 +1,128 @@
|
|
1
|
+
import { IncomingHttpHeaders } from "./header";
|
2
|
+
import Client from './client'
|
3
|
+
|
4
|
+
export default Errors
|
5
|
+
|
6
|
+
declare namespace Errors {
|
7
|
+
export class UndiciError extends Error {
|
8
|
+
name: string;
|
9
|
+
code: string;
|
10
|
+
}
|
11
|
+
|
12
|
+
/** Connect timeout error. */
|
13
|
+
export class ConnectTimeoutError extends UndiciError {
|
14
|
+
name: 'ConnectTimeoutError';
|
15
|
+
code: 'UND_ERR_CONNECT_TIMEOUT';
|
16
|
+
}
|
17
|
+
|
18
|
+
/** A header exceeds the `headersTimeout` option. */
|
19
|
+
export class HeadersTimeoutError extends UndiciError {
|
20
|
+
name: 'HeadersTimeoutError';
|
21
|
+
code: 'UND_ERR_HEADERS_TIMEOUT';
|
22
|
+
}
|
23
|
+
|
24
|
+
/** Headers overflow error. */
|
25
|
+
export class HeadersOverflowError extends UndiciError {
|
26
|
+
name: 'HeadersOverflowError'
|
27
|
+
code: 'UND_ERR_HEADERS_OVERFLOW'
|
28
|
+
}
|
29
|
+
|
30
|
+
/** A body exceeds the `bodyTimeout` option. */
|
31
|
+
export class BodyTimeoutError extends UndiciError {
|
32
|
+
name: 'BodyTimeoutError';
|
33
|
+
code: 'UND_ERR_BODY_TIMEOUT';
|
34
|
+
}
|
35
|
+
|
36
|
+
export class ResponseStatusCodeError extends UndiciError {
|
37
|
+
constructor (
|
38
|
+
message?: string,
|
39
|
+
statusCode?: number,
|
40
|
+
headers?: IncomingHttpHeaders | string[] | null,
|
41
|
+
body?: null | Record<string, any> | string
|
42
|
+
);
|
43
|
+
name: 'ResponseStatusCodeError';
|
44
|
+
code: 'UND_ERR_RESPONSE_STATUS_CODE';
|
45
|
+
body: null | Record<string, any> | string
|
46
|
+
status: number
|
47
|
+
statusCode: number
|
48
|
+
headers: IncomingHttpHeaders | string[] | null;
|
49
|
+
}
|
50
|
+
|
51
|
+
/** Passed an invalid argument. */
|
52
|
+
export class InvalidArgumentError extends UndiciError {
|
53
|
+
name: 'InvalidArgumentError';
|
54
|
+
code: 'UND_ERR_INVALID_ARG';
|
55
|
+
}
|
56
|
+
|
57
|
+
/** Returned an invalid value. */
|
58
|
+
export class InvalidReturnValueError extends UndiciError {
|
59
|
+
name: 'InvalidReturnValueError';
|
60
|
+
code: 'UND_ERR_INVALID_RETURN_VALUE';
|
61
|
+
}
|
62
|
+
|
63
|
+
/** The request has been aborted by the user. */
|
64
|
+
export class RequestAbortedError extends UndiciError {
|
65
|
+
name: 'AbortError';
|
66
|
+
code: 'UND_ERR_ABORTED';
|
67
|
+
}
|
68
|
+
|
69
|
+
/** Expected error with reason. */
|
70
|
+
export class InformationalError extends UndiciError {
|
71
|
+
name: 'InformationalError';
|
72
|
+
code: 'UND_ERR_INFO';
|
73
|
+
}
|
74
|
+
|
75
|
+
/** Request body length does not match content-length header. */
|
76
|
+
export class RequestContentLengthMismatchError extends UndiciError {
|
77
|
+
name: 'RequestContentLengthMismatchError';
|
78
|
+
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
|
79
|
+
}
|
80
|
+
|
81
|
+
/** Response body length does not match content-length header. */
|
82
|
+
export class ResponseContentLengthMismatchError extends UndiciError {
|
83
|
+
name: 'ResponseContentLengthMismatchError';
|
84
|
+
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
|
85
|
+
}
|
86
|
+
|
87
|
+
/** Trying to use a destroyed client. */
|
88
|
+
export class ClientDestroyedError extends UndiciError {
|
89
|
+
name: 'ClientDestroyedError';
|
90
|
+
code: 'UND_ERR_DESTROYED';
|
91
|
+
}
|
92
|
+
|
93
|
+
/** Trying to use a closed client. */
|
94
|
+
export class ClientClosedError extends UndiciError {
|
95
|
+
name: 'ClientClosedError';
|
96
|
+
code: 'UND_ERR_CLOSED';
|
97
|
+
}
|
98
|
+
|
99
|
+
/** There is an error with the socket. */
|
100
|
+
export class SocketError extends UndiciError {
|
101
|
+
name: 'SocketError';
|
102
|
+
code: 'UND_ERR_SOCKET';
|
103
|
+
socket: Client.SocketInfo | null
|
104
|
+
}
|
105
|
+
|
106
|
+
/** Encountered unsupported functionality. */
|
107
|
+
export class NotSupportedError extends UndiciError {
|
108
|
+
name: 'NotSupportedError';
|
109
|
+
code: 'UND_ERR_NOT_SUPPORTED';
|
110
|
+
}
|
111
|
+
|
112
|
+
/** No upstream has been added to the BalancedPool. */
|
113
|
+
export class BalancedPoolMissingUpstreamError extends UndiciError {
|
114
|
+
name: 'MissingUpstreamError';
|
115
|
+
code: 'UND_ERR_BPL_MISSING_UPSTREAM';
|
116
|
+
}
|
117
|
+
|
118
|
+
export class HTTPParserError extends UndiciError {
|
119
|
+
name: 'HTTPParserError';
|
120
|
+
code: string;
|
121
|
+
}
|
122
|
+
|
123
|
+
/** The response exceed the length allowed. */
|
124
|
+
export class ResponseExceededMaxSizeError extends UndiciError {
|
125
|
+
name: 'ResponseExceededMaxSizeError';
|
126
|
+
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
|
127
|
+
}
|
128
|
+
}
|
@@ -0,0 +1,209 @@
|
|
1
|
+
// based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license)
|
2
|
+
// and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license)
|
3
|
+
/// <reference types="node" />
|
4
|
+
|
5
|
+
import { Blob } from 'buffer'
|
6
|
+
import { URL, URLSearchParams } from 'url'
|
7
|
+
import { ReadableStream } from 'stream/web'
|
8
|
+
import { FormData } from './formdata'
|
9
|
+
|
10
|
+
import Dispatcher from './dispatcher'
|
11
|
+
|
12
|
+
export type RequestInfo = string | URL | Request
|
13
|
+
|
14
|
+
export declare function fetch (
|
15
|
+
input: RequestInfo,
|
16
|
+
init?: RequestInit
|
17
|
+
): Promise<Response>
|
18
|
+
|
19
|
+
export type BodyInit =
|
20
|
+
| ArrayBuffer
|
21
|
+
| AsyncIterable<Uint8Array>
|
22
|
+
| Blob
|
23
|
+
| FormData
|
24
|
+
| Iterable<Uint8Array>
|
25
|
+
| NodeJS.ArrayBufferView
|
26
|
+
| URLSearchParams
|
27
|
+
| null
|
28
|
+
| string
|
29
|
+
|
30
|
+
export interface BodyMixin {
|
31
|
+
readonly body: ReadableStream | null
|
32
|
+
readonly bodyUsed: boolean
|
33
|
+
|
34
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
35
|
+
readonly blob: () => Promise<Blob>
|
36
|
+
readonly formData: () => Promise<FormData>
|
37
|
+
readonly json: () => Promise<unknown>
|
38
|
+
readonly text: () => Promise<string>
|
39
|
+
}
|
40
|
+
|
41
|
+
export interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
42
|
+
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
43
|
+
}
|
44
|
+
|
45
|
+
export interface SpecIterableIterator<T> extends SpecIterator<T> {
|
46
|
+
[Symbol.iterator](): SpecIterableIterator<T>;
|
47
|
+
}
|
48
|
+
|
49
|
+
export interface SpecIterable<T> {
|
50
|
+
[Symbol.iterator](): SpecIterator<T>;
|
51
|
+
}
|
52
|
+
|
53
|
+
export type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers
|
54
|
+
|
55
|
+
export declare class Headers implements SpecIterable<[string, string]> {
|
56
|
+
constructor (init?: HeadersInit)
|
57
|
+
readonly append: (name: string, value: string) => void
|
58
|
+
readonly delete: (name: string) => void
|
59
|
+
readonly get: (name: string) => string | null
|
60
|
+
readonly has: (name: string) => boolean
|
61
|
+
readonly set: (name: string, value: string) => void
|
62
|
+
readonly getSetCookie: () => string[]
|
63
|
+
readonly forEach: (
|
64
|
+
callbackfn: (value: string, key: string, iterable: Headers) => void,
|
65
|
+
thisArg?: unknown
|
66
|
+
) => void
|
67
|
+
|
68
|
+
readonly keys: () => SpecIterableIterator<string>
|
69
|
+
readonly values: () => SpecIterableIterator<string>
|
70
|
+
readonly entries: () => SpecIterableIterator<[string, string]>
|
71
|
+
readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
|
72
|
+
}
|
73
|
+
|
74
|
+
export type RequestCache =
|
75
|
+
| 'default'
|
76
|
+
| 'force-cache'
|
77
|
+
| 'no-cache'
|
78
|
+
| 'no-store'
|
79
|
+
| 'only-if-cached'
|
80
|
+
| 'reload'
|
81
|
+
|
82
|
+
export type RequestCredentials = 'omit' | 'include' | 'same-origin'
|
83
|
+
|
84
|
+
type RequestDestination =
|
85
|
+
| ''
|
86
|
+
| 'audio'
|
87
|
+
| 'audioworklet'
|
88
|
+
| 'document'
|
89
|
+
| 'embed'
|
90
|
+
| 'font'
|
91
|
+
| 'image'
|
92
|
+
| 'manifest'
|
93
|
+
| 'object'
|
94
|
+
| 'paintworklet'
|
95
|
+
| 'report'
|
96
|
+
| 'script'
|
97
|
+
| 'sharedworker'
|
98
|
+
| 'style'
|
99
|
+
| 'track'
|
100
|
+
| 'video'
|
101
|
+
| 'worker'
|
102
|
+
| 'xslt'
|
103
|
+
|
104
|
+
export interface RequestInit {
|
105
|
+
method?: string
|
106
|
+
keepalive?: boolean
|
107
|
+
headers?: HeadersInit
|
108
|
+
body?: BodyInit
|
109
|
+
redirect?: RequestRedirect
|
110
|
+
integrity?: string
|
111
|
+
signal?: AbortSignal
|
112
|
+
credentials?: RequestCredentials
|
113
|
+
mode?: RequestMode
|
114
|
+
referrer?: string
|
115
|
+
referrerPolicy?: ReferrerPolicy
|
116
|
+
window?: null
|
117
|
+
dispatcher?: Dispatcher
|
118
|
+
duplex?: RequestDuplex
|
119
|
+
}
|
120
|
+
|
121
|
+
export type ReferrerPolicy =
|
122
|
+
| ''
|
123
|
+
| 'no-referrer'
|
124
|
+
| 'no-referrer-when-downgrade'
|
125
|
+
| 'origin'
|
126
|
+
| 'origin-when-cross-origin'
|
127
|
+
| 'same-origin'
|
128
|
+
| 'strict-origin'
|
129
|
+
| 'strict-origin-when-cross-origin'
|
130
|
+
| 'unsafe-url';
|
131
|
+
|
132
|
+
export type RequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin'
|
133
|
+
|
134
|
+
export type RequestRedirect = 'error' | 'follow' | 'manual'
|
135
|
+
|
136
|
+
export type RequestDuplex = 'half'
|
137
|
+
|
138
|
+
export declare class Request implements BodyMixin {
|
139
|
+
constructor (input: RequestInfo, init?: RequestInit)
|
140
|
+
|
141
|
+
readonly cache: RequestCache
|
142
|
+
readonly credentials: RequestCredentials
|
143
|
+
readonly destination: RequestDestination
|
144
|
+
readonly headers: Headers
|
145
|
+
readonly integrity: string
|
146
|
+
readonly method: string
|
147
|
+
readonly mode: RequestMode
|
148
|
+
readonly redirect: RequestRedirect
|
149
|
+
readonly referrerPolicy: string
|
150
|
+
readonly url: string
|
151
|
+
|
152
|
+
readonly keepalive: boolean
|
153
|
+
readonly signal: AbortSignal
|
154
|
+
readonly duplex: RequestDuplex
|
155
|
+
|
156
|
+
readonly body: ReadableStream | null
|
157
|
+
readonly bodyUsed: boolean
|
158
|
+
|
159
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
160
|
+
readonly blob: () => Promise<Blob>
|
161
|
+
readonly formData: () => Promise<FormData>
|
162
|
+
readonly json: () => Promise<unknown>
|
163
|
+
readonly text: () => Promise<string>
|
164
|
+
|
165
|
+
readonly clone: () => Request
|
166
|
+
}
|
167
|
+
|
168
|
+
export interface ResponseInit {
|
169
|
+
readonly status?: number
|
170
|
+
readonly statusText?: string
|
171
|
+
readonly headers?: HeadersInit
|
172
|
+
}
|
173
|
+
|
174
|
+
export type ResponseType =
|
175
|
+
| 'basic'
|
176
|
+
| 'cors'
|
177
|
+
| 'default'
|
178
|
+
| 'error'
|
179
|
+
| 'opaque'
|
180
|
+
| 'opaqueredirect'
|
181
|
+
|
182
|
+
export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
|
183
|
+
|
184
|
+
export declare class Response implements BodyMixin {
|
185
|
+
constructor (body?: BodyInit, init?: ResponseInit)
|
186
|
+
|
187
|
+
readonly headers: Headers
|
188
|
+
readonly ok: boolean
|
189
|
+
readonly status: number
|
190
|
+
readonly statusText: string
|
191
|
+
readonly type: ResponseType
|
192
|
+
readonly url: string
|
193
|
+
readonly redirected: boolean
|
194
|
+
|
195
|
+
readonly body: ReadableStream | null
|
196
|
+
readonly bodyUsed: boolean
|
197
|
+
|
198
|
+
readonly arrayBuffer: () => Promise<ArrayBuffer>
|
199
|
+
readonly blob: () => Promise<Blob>
|
200
|
+
readonly formData: () => Promise<FormData>
|
201
|
+
readonly json: () => Promise<unknown>
|
202
|
+
readonly text: () => Promise<string>
|
203
|
+
|
204
|
+
readonly clone: () => Response
|
205
|
+
|
206
|
+
static error (): Response
|
207
|
+
static json(data: any, init?: ResponseInit): Response
|
208
|
+
static redirect (url: string | URL, status: ResponseRedirectStatus): Response
|
209
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/File.ts (MIT)
|
2
|
+
/// <reference types="node" />
|
3
|
+
|
4
|
+
import { Blob } from 'buffer'
|
5
|
+
|
6
|
+
export interface BlobPropertyBag {
|
7
|
+
type?: string
|
8
|
+
endings?: 'native' | 'transparent'
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
12
|
+
/**
|
13
|
+
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
14
|
+
*/
|
15
|
+
lastModified?: number
|
16
|
+
}
|
17
|
+
|
18
|
+
export declare class File extends Blob {
|
19
|
+
/**
|
20
|
+
* Creates a new File instance.
|
21
|
+
*
|
22
|
+
* @param fileBits An `Array` strings, or [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer), [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView), [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) objects, or a mix of any of such objects, that will be put inside the [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File).
|
23
|
+
* @param fileName The name of the file.
|
24
|
+
* @param options An options object containing optional attributes for the file.
|
25
|
+
*/
|
26
|
+
constructor(fileBits: ReadonlyArray<string | NodeJS.ArrayBufferView | Blob>, fileName: string, options?: FilePropertyBag)
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Name of the file referenced by the File object.
|
30
|
+
*/
|
31
|
+
readonly name: string
|
32
|
+
|
33
|
+
/**
|
34
|
+
* The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
|
35
|
+
*/
|
36
|
+
readonly lastModified: number
|
37
|
+
|
38
|
+
readonly [Symbol.toStringTag]: string
|
39
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
|
3
|
+
import { Blob } from 'buffer'
|
4
|
+
import { DOMException, Event, EventInit, EventTarget } from './patch'
|
5
|
+
|
6
|
+
export declare class FileReader {
|
7
|
+
__proto__: EventTarget & FileReader
|
8
|
+
|
9
|
+
constructor ()
|
10
|
+
|
11
|
+
readAsArrayBuffer (blob: Blob): void
|
12
|
+
readAsBinaryString (blob: Blob): void
|
13
|
+
readAsText (blob: Blob, encoding?: string): void
|
14
|
+
readAsDataURL (blob: Blob): void
|
15
|
+
|
16
|
+
abort (): void
|
17
|
+
|
18
|
+
static readonly EMPTY = 0
|
19
|
+
static readonly LOADING = 1
|
20
|
+
static readonly DONE = 2
|
21
|
+
|
22
|
+
readonly EMPTY = 0
|
23
|
+
readonly LOADING = 1
|
24
|
+
readonly DONE = 2
|
25
|
+
|
26
|
+
readonly readyState: number
|
27
|
+
|
28
|
+
readonly result: string | ArrayBuffer | null
|
29
|
+
|
30
|
+
readonly error: DOMException | null
|
31
|
+
|
32
|
+
onloadstart: null | ((this: FileReader, event: ProgressEvent) => void)
|
33
|
+
onprogress: null | ((this: FileReader, event: ProgressEvent) => void)
|
34
|
+
onload: null | ((this: FileReader, event: ProgressEvent) => void)
|
35
|
+
onabort: null | ((this: FileReader, event: ProgressEvent) => void)
|
36
|
+
onerror: null | ((this: FileReader, event: ProgressEvent) => void)
|
37
|
+
onloadend: null | ((this: FileReader, event: ProgressEvent) => void)
|
38
|
+
}
|
39
|
+
|
40
|
+
export interface ProgressEventInit extends EventInit {
|
41
|
+
lengthComputable?: boolean
|
42
|
+
loaded?: number
|
43
|
+
total?: number
|
44
|
+
}
|
45
|
+
|
46
|
+
export declare class ProgressEvent {
|
47
|
+
__proto__: Event & ProgressEvent
|
48
|
+
|
49
|
+
constructor (type: string, eventInitDict?: ProgressEventInit)
|
50
|
+
|
51
|
+
readonly lengthComputable: boolean
|
52
|
+
readonly loaded: number
|
53
|
+
readonly total: number
|
54
|
+
}
|
@@ -0,0 +1,108 @@
|
|
1
|
+
// Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT)
|
2
|
+
/// <reference types="node" />
|
3
|
+
|
4
|
+
import { File } from './file'
|
5
|
+
import { SpecIterator, SpecIterableIterator } from './fetch'
|
6
|
+
|
7
|
+
/**
|
8
|
+
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
9
|
+
*/
|
10
|
+
declare type FormDataEntryValue = string | File
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
|
14
|
+
*/
|
15
|
+
export declare class FormData {
|
16
|
+
/**
|
17
|
+
* Appends a new value onto an existing key inside a FormData object,
|
18
|
+
* or adds the key if it does not already exist.
|
19
|
+
*
|
20
|
+
* The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
|
21
|
+
*
|
22
|
+
* @param name The name of the field whose data is contained in `value`.
|
23
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
24
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
25
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
26
|
+
*/
|
27
|
+
append(name: string, value: unknown, fileName?: string): void
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Set a new value for an existing key inside FormData,
|
31
|
+
* or add the new field if it does not already exist.
|
32
|
+
*
|
33
|
+
* @param name The name of the field whose data is contained in `value`.
|
34
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
35
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
36
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
37
|
+
*
|
38
|
+
*/
|
39
|
+
set(name: string, value: unknown, fileName?: string): void
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Returns the first value associated with a given key from within a `FormData` object.
|
43
|
+
* If you expect multiple values and want all of them, use the `getAll()` method instead.
|
44
|
+
*
|
45
|
+
* @param {string} name A name of the value you want to retrieve.
|
46
|
+
*
|
47
|
+
* @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
|
48
|
+
*/
|
49
|
+
get(name: string): FormDataEntryValue | null
|
50
|
+
|
51
|
+
/**
|
52
|
+
* Returns all the values associated with a given key from within a `FormData` object.
|
53
|
+
*
|
54
|
+
* @param {string} name A name of the value you want to retrieve.
|
55
|
+
*
|
56
|
+
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
|
57
|
+
*/
|
58
|
+
getAll(name: string): FormDataEntryValue[]
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Returns a boolean stating whether a `FormData` object contains a certain key.
|
62
|
+
*
|
63
|
+
* @param name A string representing the name of the key you want to test for.
|
64
|
+
*
|
65
|
+
* @return A boolean value.
|
66
|
+
*/
|
67
|
+
has(name: string): boolean
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Deletes a key and its value(s) from a `FormData` object.
|
71
|
+
*
|
72
|
+
* @param name The name of the key you want to delete.
|
73
|
+
*/
|
74
|
+
delete(name: string): void
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Executes given callback function for each field of the FormData instance
|
78
|
+
*/
|
79
|
+
forEach: (
|
80
|
+
callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void,
|
81
|
+
thisArg?: unknown
|
82
|
+
) => void
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object.
|
86
|
+
* Each key is a `string`.
|
87
|
+
*/
|
88
|
+
keys: () => SpecIterableIterator<string>
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object.
|
92
|
+
* Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
93
|
+
*/
|
94
|
+
values: () => SpecIterableIterator<FormDataEntryValue>
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
|
98
|
+
* The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
99
|
+
*/
|
100
|
+
entries: () => SpecIterableIterator<[string, FormDataEntryValue]>
|
101
|
+
|
102
|
+
/**
|
103
|
+
* An alias for FormData#entries()
|
104
|
+
*/
|
105
|
+
[Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]>
|
106
|
+
|
107
|
+
readonly [Symbol.toStringTag]: string
|
108
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import Dispatcher from "./dispatcher";
|
2
|
+
|
3
|
+
export {
|
4
|
+
getGlobalDispatcher,
|
5
|
+
setGlobalDispatcher
|
6
|
+
}
|
7
|
+
|
8
|
+
declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher>(dispatcher: DispatcherImplementation): void;
|
9
|
+
declare function getGlobalDispatcher(): Dispatcher;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import Dispatcher from "./dispatcher";
|
2
|
+
|
3
|
+
export declare class RedirectHandler implements Dispatcher.DispatchHandlers{
|
4
|
+
constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers)
|
5
|
+
}
|
6
|
+
|
7
|
+
export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{
|
8
|
+
constructor (handler: Dispatcher.DispatchHandlers)
|
9
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import Dispatcher from'./dispatcher'
|
2
|
+
import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
|
3
|
+
import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
|
4
|
+
import Pool from'./pool'
|
5
|
+
import { RedirectHandler, DecoratorHandler } from './handlers'
|
6
|
+
|
7
|
+
import BalancedPool from './balanced-pool'
|
8
|
+
import Client from'./client'
|
9
|
+
import buildConnector from'./connector'
|
10
|
+
import errors from'./errors'
|
11
|
+
import Agent from'./agent'
|
12
|
+
import MockClient from'./mock-client'
|
13
|
+
import MockPool from'./mock-pool'
|
14
|
+
import MockAgent from'./mock-agent'
|
15
|
+
import mockErrors from'./mock-errors'
|
16
|
+
import ProxyAgent from'./proxy-agent'
|
17
|
+
import { request, pipeline, stream, connect, upgrade } from './api'
|
18
|
+
|
19
|
+
export * from './cookies'
|
20
|
+
export * from './fetch'
|
21
|
+
export * from './file'
|
22
|
+
export * from './filereader'
|
23
|
+
export * from './formdata'
|
24
|
+
export * from './diagnostics-channel'
|
25
|
+
export * from './websocket'
|
26
|
+
export * from './content-type'
|
27
|
+
export * from './cache'
|
28
|
+
export { Interceptable } from './mock-interceptor'
|
29
|
+
|
30
|
+
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler }
|
31
|
+
export default Undici
|
32
|
+
|
33
|
+
declare namespace Undici {
|
34
|
+
var Dispatcher: typeof import('./dispatcher').default
|
35
|
+
var Pool: typeof import('./pool').default;
|
36
|
+
var RedirectHandler: typeof import ('./handlers').RedirectHandler
|
37
|
+
var DecoratorHandler: typeof import ('./handlers').DecoratorHandler
|
38
|
+
var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor
|
39
|
+
var BalancedPool: typeof import('./balanced-pool').default;
|
40
|
+
var Client: typeof import('./client').default;
|
41
|
+
var buildConnector: typeof import('./connector').default;
|
42
|
+
var errors: typeof import('./errors').default;
|
43
|
+
var Agent: typeof import('./agent').default;
|
44
|
+
var setGlobalDispatcher: typeof import('./global-dispatcher').setGlobalDispatcher;
|
45
|
+
var getGlobalDispatcher: typeof import('./global-dispatcher').getGlobalDispatcher;
|
46
|
+
var request: typeof import('./api').request;
|
47
|
+
var stream: typeof import('./api').stream;
|
48
|
+
var pipeline: typeof import('./api').pipeline;
|
49
|
+
var connect: typeof import('./api').connect;
|
50
|
+
var upgrade: typeof import('./api').upgrade;
|
51
|
+
var MockClient: typeof import('./mock-client').default;
|
52
|
+
var MockPool: typeof import('./mock-pool').default;
|
53
|
+
var MockAgent: typeof import('./mock-agent').default;
|
54
|
+
var mockErrors: typeof import('./mock-errors').default;
|
55
|
+
var fetch: typeof import('./fetch').fetch;
|
56
|
+
var Headers: typeof import('./fetch').Headers;
|
57
|
+
var Response: typeof import('./fetch').Response;
|
58
|
+
var Request: typeof import('./fetch').Request;
|
59
|
+
var FormData: typeof import('./formdata').FormData;
|
60
|
+
var File: typeof import('./file').File;
|
61
|
+
var FileReader: typeof import('./filereader').FileReader;
|
62
|
+
var caches: typeof import('./cache').caches;
|
63
|
+
}
|