@idlebox/stripe-node-types 24.0.14-patch.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.
- package/LICENSE +22 -0
- package/README.md +16 -0
- package/assert/strict.d.ts +5 -0
- package/assert.d.ts +1053 -0
- package/async_hooks.d.ts +621 -0
- package/buffer.buffer.d.ts +464 -0
- package/buffer.d.ts +1928 -0
- package/child_process.d.ts +1547 -0
- package/cluster.d.ts +576 -0
- package/compatibility/iterators.d.ts +22 -0
- package/console.d.ts +449 -0
- package/constants.d.ts +18 -0
- package/crypto.d.ts +4514 -0
- package/dgram.d.ts +597 -0
- package/diagnostics_channel.d.ts +576 -0
- package/dns/promises.d.ts +501 -0
- package/dns.d.ts +916 -0
- package/dom-events.d.ts +100 -0
- package/domain.d.ts +168 -0
- package/events.d.ts +927 -0
- package/fs/promises.d.ts +1278 -0
- package/fs.d.ts +4444 -0
- package/globals.d.ts +368 -0
- package/globals.typedarray.d.ts +23 -0
- package/http.d.ts +2044 -0
- package/http2.d.ts +2626 -0
- package/https.d.ts +543 -0
- package/index.d.ts +96 -0
- package/inspector.d.ts +3993 -0
- package/module.d.ts +866 -0
- package/my-shim.d.ts +57 -0
- package/net.d.ts +1030 -0
- package/os.d.ts +494 -0
- package/package.json +158 -0
- package/path.d.ts +189 -0
- package/perf_hooks.d.ts +968 -0
- package/process.d.ts +2016 -0
- package/punycode.d.ts +115 -0
- package/querystring.d.ts +150 -0
- package/readline/promises.d.ts +159 -0
- package/readline.d.ts +592 -0
- package/repl.d.ts +426 -0
- package/sea.d.ts +154 -0
- package/sqlite.d.ts +689 -0
- package/stream/consumers.d.ts +36 -0
- package/stream/promises.d.ts +88 -0
- package/stream/web.d.ts +616 -0
- package/stream.d.ts +1654 -0
- package/string_decoder.d.ts +65 -0
- package/test.d.ts +2216 -0
- package/timers/promises.d.ts +106 -0
- package/timers.d.ts +285 -0
- package/tls.d.ts +1211 -0
- package/trace_events.d.ts +195 -0
- package/ts5.1/compatibility/disposable.d.ts +13 -0
- package/ts5.1/index.d.ts +100 -0
- package/ts5.6/buffer.buffer.d.ts +461 -0
- package/ts5.6/compatibility/float16array.d.ts +72 -0
- package/ts5.6/globals.typedarray.d.ts +21 -0
- package/ts5.6/index.d.ts +98 -0
- package/ts5.7/compatibility/float16array.d.ts +73 -0
- package/ts5.7/index.d.ts +98 -0
- package/tty.d.ts +206 -0
- package/undici-types/LICENSE +22 -0
- package/undici-types/README.md +7 -0
- package/undici-types/agent.d.ts +32 -0
- package/undici-types/api.d.ts +44 -0
- package/undici-types/balanced-pool.d.ts +30 -0
- package/undici-types/cache-interceptor.d.ts +173 -0
- package/undici-types/cache.d.ts +37 -0
- package/undici-types/client.d.ts +108 -0
- package/undici-types/connector.d.ts +35 -0
- package/undici-types/content-type.d.ts +22 -0
- package/undici-types/cookies.d.ts +31 -0
- package/undici-types/diagnostics-channel.d.ts +67 -0
- package/undici-types/dispatcher.d.ts +282 -0
- package/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/undici-types/errors.d.ts +172 -0
- package/undici-types/eventsource.d.ts +62 -0
- package/undici-types/fetch.d.ts +211 -0
- package/undici-types/formdata.d.ts +109 -0
- package/undici-types/global-dispatcher.d.ts +10 -0
- package/undici-types/global-origin.d.ts +8 -0
- package/undici-types/h2c-client.d.ts +76 -0
- package/undici-types/handlers.d.ts +16 -0
- package/undici-types/header.d.ts +161 -0
- package/undici-types/index.d.ts +76 -0
- package/undici-types/interceptors.d.ts +35 -0
- package/undici-types/mock-agent.d.ts +66 -0
- package/undici-types/mock-call-history.d.ts +112 -0
- package/undici-types/mock-client.d.ts +26 -0
- package/undici-types/mock-errors.d.ts +13 -0
- package/undici-types/mock-interceptor.d.ts +94 -0
- package/undici-types/mock-pool.d.ts +26 -0
- package/undici-types/package.json +55 -0
- package/undici-types/patch.d.ts +30 -0
- package/undici-types/pool-stats.d.ts +20 -0
- package/undici-types/pool.d.ts +40 -0
- package/undici-types/proxy-agent.d.ts +29 -0
- package/undici-types/readable.d.ts +69 -0
- package/undici-types/retry-agent.d.ts +9 -0
- package/undici-types/retry-handler.d.ts +117 -0
- package/undici-types/util.d.ts +19 -0
- package/undici-types/utility.d.ts +8 -0
- package/undici-types/webidl.d.ts +267 -0
- package/undici-types/websocket.d.ts +185 -0
- package/url.d.ts +1012 -0
- package/util.d.ts +2300 -0
- package/v8.d.ts +917 -0
- package/vm.d.ts +1034 -0
- package/wasi.d.ts +179 -0
- package/worker_threads.d.ts +773 -0
- package/zlib.d.ts +666 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Interface declaration for Float16Array, required in @types/node v24+.
|
|
2
|
+
// These definitions are specific to TS 5.7.
|
|
3
|
+
|
|
4
|
+
// This needs all of the "common" properties/methods of the TypedArrays,
|
|
5
|
+
// otherwise the type unions `TypedArray` and `ArrayBufferView` will be
|
|
6
|
+
// empty objects.
|
|
7
|
+
interface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
|
|
8
|
+
readonly BYTES_PER_ELEMENT: number;
|
|
9
|
+
readonly buffer: TArrayBuffer;
|
|
10
|
+
readonly byteLength: number;
|
|
11
|
+
readonly byteOffset: number;
|
|
12
|
+
readonly length: number;
|
|
13
|
+
readonly [Symbol.toStringTag]: "Float16Array";
|
|
14
|
+
at(index: number): number | undefined;
|
|
15
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
16
|
+
entries(): ArrayIterator<[number, number]>;
|
|
17
|
+
every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
|
|
18
|
+
fill(value: number, start?: number, end?: number): this;
|
|
19
|
+
filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;
|
|
20
|
+
find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
|
|
21
|
+
findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
|
|
22
|
+
findLast<S extends number>(
|
|
23
|
+
predicate: (value: number, index: number, array: this) => value is S,
|
|
24
|
+
thisArg?: any,
|
|
25
|
+
): S | undefined;
|
|
26
|
+
findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined;
|
|
27
|
+
findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number;
|
|
28
|
+
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
|
|
29
|
+
includes(searchElement: number, fromIndex?: number): boolean;
|
|
30
|
+
indexOf(searchElement: number, fromIndex?: number): number;
|
|
31
|
+
join(separator?: string): string;
|
|
32
|
+
keys(): ArrayIterator<number>;
|
|
33
|
+
lastIndexOf(searchElement: number, fromIndex?: number): number;
|
|
34
|
+
map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;
|
|
35
|
+
reduce(
|
|
36
|
+
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
|
|
37
|
+
): number;
|
|
38
|
+
reduce(
|
|
39
|
+
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
|
|
40
|
+
initialValue: number,
|
|
41
|
+
): number;
|
|
42
|
+
reduce<U>(
|
|
43
|
+
callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
|
|
44
|
+
initialValue: U,
|
|
45
|
+
): U;
|
|
46
|
+
reduceRight(
|
|
47
|
+
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
|
|
48
|
+
): number;
|
|
49
|
+
reduceRight(
|
|
50
|
+
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
|
|
51
|
+
initialValue: number,
|
|
52
|
+
): number;
|
|
53
|
+
reduceRight<U>(
|
|
54
|
+
callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
|
|
55
|
+
initialValue: U,
|
|
56
|
+
): U;
|
|
57
|
+
reverse(): this;
|
|
58
|
+
set(array: ArrayLike<number>, offset?: number): void;
|
|
59
|
+
slice(start?: number, end?: number): Float16Array<ArrayBuffer>;
|
|
60
|
+
some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
|
|
61
|
+
sort(compareFn?: (a: number, b: number) => number): this;
|
|
62
|
+
subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;
|
|
63
|
+
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
|
|
64
|
+
toReversed(): Float16Array<ArrayBuffer>;
|
|
65
|
+
toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;
|
|
66
|
+
toString(): string;
|
|
67
|
+
valueOf(): this;
|
|
68
|
+
values(): ArrayIterator<number>;
|
|
69
|
+
with(index: number, value: number): Float16Array<ArrayBuffer>;
|
|
70
|
+
[Symbol.iterator](): ArrayIterator<number>;
|
|
71
|
+
[index: number]: number;
|
|
72
|
+
}
|
|
73
|
+
|
package/ts5.7/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License for programmatically and manually incorporated
|
|
3
|
+
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
|
|
4
|
+
*
|
|
5
|
+
* Copyright Node.js contributors. All rights reserved.
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to
|
|
8
|
+
* deal in the Software without restriction, including without limitation the
|
|
9
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
10
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
|
14
|
+
* all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
22
|
+
* IN THE SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// NOTE: These definitions support Node.js and TypeScript 5.7.
|
|
26
|
+
|
|
27
|
+
// Reference required TypeScript libraries:
|
|
28
|
+
/// <reference lib="es2020" />
|
|
29
|
+
/// <reference lib="esnext.disposable" />
|
|
30
|
+
|
|
31
|
+
// TypeScript library polyfills required for TypeScript 5.7:
|
|
32
|
+
/// <reference path="./compatibility/float16array.d.ts" />
|
|
33
|
+
|
|
34
|
+
// Iterator definitions required for compatibility with TypeScript <5.6:
|
|
35
|
+
/// <reference path="../compatibility/iterators.d.ts" />
|
|
36
|
+
|
|
37
|
+
// Definitions for Node.js modules specific to TypeScript 5.7+:
|
|
38
|
+
/// <reference path="../globals.typedarray.d.ts" />
|
|
39
|
+
/// <reference path="../buffer.buffer.d.ts" />
|
|
40
|
+
|
|
41
|
+
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
42
|
+
/// <reference path="../globals.d.ts" />
|
|
43
|
+
/// <reference path="../assert.d.ts" />
|
|
44
|
+
/// <reference path="../assert/strict.d.ts" />
|
|
45
|
+
/// <reference path="../async_hooks.d.ts" />
|
|
46
|
+
/// <reference path="../buffer.d.ts" />
|
|
47
|
+
/// <reference path="../child_process.d.ts" />
|
|
48
|
+
/// <reference path="../cluster.d.ts" />
|
|
49
|
+
/// <reference path="../console.d.ts" />
|
|
50
|
+
/// <reference path="../constants.d.ts" />
|
|
51
|
+
/// <reference path="../crypto.d.ts" />
|
|
52
|
+
/// <reference path="../dgram.d.ts" />
|
|
53
|
+
/// <reference path="../diagnostics_channel.d.ts" />
|
|
54
|
+
/// <reference path="../dns.d.ts" />
|
|
55
|
+
/// <reference path="../dns/promises.d.ts" />
|
|
56
|
+
/// <reference path="../dns/promises.d.ts" />
|
|
57
|
+
/// <reference path="../domain.d.ts" />
|
|
58
|
+
/// <reference path="../dom-events.d.ts" />
|
|
59
|
+
/// <reference path="../events.d.ts" />
|
|
60
|
+
/// <reference path="../fs.d.ts" />
|
|
61
|
+
/// <reference path="../fs/promises.d.ts" />
|
|
62
|
+
/// <reference path="../http.d.ts" />
|
|
63
|
+
/// <reference path="../http2.d.ts" />
|
|
64
|
+
/// <reference path="../https.d.ts" />
|
|
65
|
+
/// <reference path="../inspector.d.ts" />
|
|
66
|
+
/// <reference path="../module.d.ts" />
|
|
67
|
+
/// <reference path="../net.d.ts" />
|
|
68
|
+
/// <reference path="../os.d.ts" />
|
|
69
|
+
/// <reference path="../path.d.ts" />
|
|
70
|
+
/// <reference path="../perf_hooks.d.ts" />
|
|
71
|
+
/// <reference path="../process.d.ts" />
|
|
72
|
+
/// <reference path="../punycode.d.ts" />
|
|
73
|
+
/// <reference path="../querystring.d.ts" />
|
|
74
|
+
/// <reference path="../readline.d.ts" />
|
|
75
|
+
/// <reference path="../readline/promises.d.ts" />
|
|
76
|
+
/// <reference path="../repl.d.ts" />
|
|
77
|
+
/// <reference path="../sea.d.ts" />
|
|
78
|
+
/// <reference path="../sqlite.d.ts" />
|
|
79
|
+
/// <reference path="../stream.d.ts" />
|
|
80
|
+
/// <reference path="../stream/promises.d.ts" />
|
|
81
|
+
/// <reference path="../stream/consumers.d.ts" />
|
|
82
|
+
/// <reference path="../stream/web.d.ts" />
|
|
83
|
+
/// <reference path="../string_decoder.d.ts" />
|
|
84
|
+
/// <reference path="../test.d.ts" />
|
|
85
|
+
/// <reference path="../timers.d.ts" />
|
|
86
|
+
/// <reference path="../timers/promises.d.ts" />
|
|
87
|
+
/// <reference path="../tls.d.ts" />
|
|
88
|
+
/// <reference path="../trace_events.d.ts" />
|
|
89
|
+
/// <reference path="../tty.d.ts" />
|
|
90
|
+
/// <reference path="../url.d.ts" />
|
|
91
|
+
/// <reference path="../util.d.ts" />
|
|
92
|
+
/// <reference path="../v8.d.ts" />
|
|
93
|
+
/// <reference path="../vm.d.ts" />
|
|
94
|
+
/// <reference path="../wasi.d.ts" />
|
|
95
|
+
/// <reference path="../worker_threads.d.ts" />
|
|
96
|
+
/// <reference path="../zlib.d.ts" />
|
|
97
|
+
|
|
98
|
+
/// <reference path="../my-shim.d.ts" />
|
package/tty.d.ts
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module
|
|
3
|
+
* directly. However, it can be accessed using:
|
|
4
|
+
*
|
|
5
|
+
* ```js
|
|
6
|
+
* import tty from 'node:tty';
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* When Node.js detects that it is being run with a text terminal ("TTY")
|
|
10
|
+
* attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
|
|
11
|
+
* default, be instances of `tty.WriteStream`. The preferred method of determining
|
|
12
|
+
* whether Node.js is being run within a TTY context is to check that the value of
|
|
13
|
+
* the `process.stdout.isTTY` property is `true`:
|
|
14
|
+
*
|
|
15
|
+
* ```console
|
|
16
|
+
* $ node -p -e "Boolean(process.stdout.isTTY)"
|
|
17
|
+
* true
|
|
18
|
+
* $ node -p -e "Boolean(process.stdout.isTTY)" | cat
|
|
19
|
+
* false
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* In most cases, there should be little to no reason for an application to
|
|
23
|
+
* manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
|
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tty.js)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
declare module "node:tty" {
|
|
28
|
+
import * as net from 'node:net';
|
|
29
|
+
/**
|
|
30
|
+
* The `tty.isatty()` method returns `true` if the given `fd` is associated with
|
|
31
|
+
* a TTY and `false` if it is not, including whenever `fd` is not a non-negative
|
|
32
|
+
* integer.
|
|
33
|
+
* @since v0.5.8
|
|
34
|
+
* @param fd A numeric file descriptor
|
|
35
|
+
*/
|
|
36
|
+
function isatty(fd: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
|
|
39
|
+
* process and there should be no reason to create additional instances.
|
|
40
|
+
* @since v0.5.8
|
|
41
|
+
*/
|
|
42
|
+
class ReadStream extends net.Socket {
|
|
43
|
+
constructor(fd: number, options?: net.SocketConstructorOpts);
|
|
44
|
+
/**
|
|
45
|
+
* A `boolean` that is `true` if the TTY is currently configured to operate as a
|
|
46
|
+
* raw device.
|
|
47
|
+
*
|
|
48
|
+
* This flag is always `false` when a process starts, even if the terminal is
|
|
49
|
+
* operating in raw mode. Its value will change with subsequent calls to `setRawMode`.
|
|
50
|
+
* @since v0.7.7
|
|
51
|
+
*/
|
|
52
|
+
isRaw: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Allows configuration of `tty.ReadStream` so that it operates as a raw device.
|
|
55
|
+
*
|
|
56
|
+
* When in raw mode, input is always available character-by-character, not
|
|
57
|
+
* including modifiers. Additionally, all special processing of characters by the
|
|
58
|
+
* terminal is disabled, including echoing input
|
|
59
|
+
* characters. Ctrl+C will no longer cause a `SIGINT` when
|
|
60
|
+
* in this mode.
|
|
61
|
+
* @since v0.7.7
|
|
62
|
+
* @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw`
|
|
63
|
+
* property will be set to the resulting mode.
|
|
64
|
+
* @return The read stream instance.
|
|
65
|
+
*/
|
|
66
|
+
setRawMode(mode: boolean): this;
|
|
67
|
+
/**
|
|
68
|
+
* A `boolean` that is always `true` for `tty.ReadStream` instances.
|
|
69
|
+
* @since v0.5.8
|
|
70
|
+
*/
|
|
71
|
+
isTTY: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* -1 - to the left from cursor
|
|
75
|
+
* 0 - the entire line
|
|
76
|
+
* 1 - to the right from cursor
|
|
77
|
+
*/
|
|
78
|
+
type Direction = -1 | 0 | 1;
|
|
79
|
+
/**
|
|
80
|
+
* Represents the writable side of a TTY. In normal circumstances, `process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
|
|
81
|
+
* should be no reason to create additional instances.
|
|
82
|
+
* @since v0.5.8
|
|
83
|
+
*/
|
|
84
|
+
class WriteStream extends net.Socket {
|
|
85
|
+
constructor(fd: number);
|
|
86
|
+
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
87
|
+
addListener(event: "resize", listener: () => void): this;
|
|
88
|
+
emit(event: string | symbol, ...args: any[]): boolean;
|
|
89
|
+
emit(event: "resize"): boolean;
|
|
90
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
91
|
+
on(event: "resize", listener: () => void): this;
|
|
92
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
93
|
+
once(event: "resize", listener: () => void): this;
|
|
94
|
+
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
95
|
+
prependListener(event: "resize", listener: () => void): this;
|
|
96
|
+
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
97
|
+
prependOnceListener(event: "resize", listener: () => void): this;
|
|
98
|
+
/**
|
|
99
|
+
* `writeStream.clearLine()` clears the current line of this `WriteStream` in a
|
|
100
|
+
* direction identified by `dir`.
|
|
101
|
+
* @since v0.7.7
|
|
102
|
+
* @param callback Invoked once the operation completes.
|
|
103
|
+
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
104
|
+
*/
|
|
105
|
+
clearLine(dir: Direction, callback?: () => void): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* `writeStream.clearScreenDown()` clears this `WriteStream` from the current
|
|
108
|
+
* cursor down.
|
|
109
|
+
* @since v0.7.7
|
|
110
|
+
* @param callback Invoked once the operation completes.
|
|
111
|
+
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
112
|
+
*/
|
|
113
|
+
clearScreenDown(callback?: () => void): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified
|
|
116
|
+
* position.
|
|
117
|
+
* @since v0.7.7
|
|
118
|
+
* @param callback Invoked once the operation completes.
|
|
119
|
+
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
120
|
+
*/
|
|
121
|
+
cursorTo(x: number, y?: number, callback?: () => void): boolean;
|
|
122
|
+
cursorTo(x: number, callback: () => void): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its
|
|
125
|
+
* current position.
|
|
126
|
+
* @since v0.7.7
|
|
127
|
+
* @param callback Invoked once the operation completes.
|
|
128
|
+
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
|
129
|
+
*/
|
|
130
|
+
moveCursor(dx: number, dy: number, callback?: () => void): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Returns:
|
|
133
|
+
*
|
|
134
|
+
* * `1` for 2,
|
|
135
|
+
* * `4` for 16,
|
|
136
|
+
* * `8` for 256,
|
|
137
|
+
* * `24` for 16,777,216 colors supported.
|
|
138
|
+
*
|
|
139
|
+
* Use this to determine what colors the terminal supports. Due to the nature of
|
|
140
|
+
* colors in terminals it is possible to either have false positives or false
|
|
141
|
+
* negatives. It depends on process information and the environment variables that
|
|
142
|
+
* may lie about what terminal is used.
|
|
143
|
+
* It is possible to pass in an `env` object to simulate the usage of a specific
|
|
144
|
+
* terminal. This can be useful to check how specific environment settings behave.
|
|
145
|
+
*
|
|
146
|
+
* To enforce a specific color support, use one of the below environment settings.
|
|
147
|
+
*
|
|
148
|
+
* * 2 colors: `FORCE_COLOR = 0` (Disables colors)
|
|
149
|
+
* * 16 colors: `FORCE_COLOR = 1`
|
|
150
|
+
* * 256 colors: `FORCE_COLOR = 2`
|
|
151
|
+
* * 16,777,216 colors: `FORCE_COLOR = 3`
|
|
152
|
+
*
|
|
153
|
+
* Disabling color support is also possible by using the `NO_COLOR` and `NODE_DISABLE_COLORS` environment variables.
|
|
154
|
+
* @since v9.9.0
|
|
155
|
+
* @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
|
|
156
|
+
*/
|
|
157
|
+
getColorDepth(env?: object): number;
|
|
158
|
+
/**
|
|
159
|
+
* Returns `true` if the `writeStream` supports at least as many colors as provided
|
|
160
|
+
* in `count`. Minimum support is 2 (black and white).
|
|
161
|
+
*
|
|
162
|
+
* This has the same false positives and negatives as described in `writeStream.getColorDepth()`.
|
|
163
|
+
*
|
|
164
|
+
* ```js
|
|
165
|
+
* process.stdout.hasColors();
|
|
166
|
+
* // Returns true or false depending on if `stdout` supports at least 16 colors.
|
|
167
|
+
* process.stdout.hasColors(256);
|
|
168
|
+
* // Returns true or false depending on if `stdout` supports at least 256 colors.
|
|
169
|
+
* process.stdout.hasColors({ TMUX: '1' });
|
|
170
|
+
* // Returns true.
|
|
171
|
+
* process.stdout.hasColors(2 ** 24, { TMUX: '1' });
|
|
172
|
+
* // Returns false (the environment setting pretends to support 2 ** 8 colors).
|
|
173
|
+
* ```
|
|
174
|
+
* @since v11.13.0, v10.16.0
|
|
175
|
+
* @param [count=16] The number of colors that are requested (minimum 2).
|
|
176
|
+
* @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
|
|
177
|
+
*/
|
|
178
|
+
hasColors(count?: number): boolean;
|
|
179
|
+
hasColors(env?: object): boolean;
|
|
180
|
+
hasColors(count: number, env?: object): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* `writeStream.getWindowSize()` returns the size of the TTY
|
|
183
|
+
* corresponding to this `WriteStream`. The array is of the type `[numColumns, numRows]` where `numColumns` and `numRows` represent the number
|
|
184
|
+
* of columns and rows in the corresponding TTY.
|
|
185
|
+
* @since v0.7.7
|
|
186
|
+
*/
|
|
187
|
+
getWindowSize(): [number, number];
|
|
188
|
+
/**
|
|
189
|
+
* A `number` specifying the number of columns the TTY currently has. This property
|
|
190
|
+
* is updated whenever the `'resize'` event is emitted.
|
|
191
|
+
* @since v0.7.7
|
|
192
|
+
*/
|
|
193
|
+
columns: number;
|
|
194
|
+
/**
|
|
195
|
+
* A `number` specifying the number of rows the TTY currently has. This property
|
|
196
|
+
* is updated whenever the `'resize'` event is emitted.
|
|
197
|
+
* @since v0.7.7
|
|
198
|
+
*/
|
|
199
|
+
rows: number;
|
|
200
|
+
/**
|
|
201
|
+
* A `boolean` that is always `true`.
|
|
202
|
+
* @since v0.5.8
|
|
203
|
+
*/
|
|
204
|
+
isTTY: boolean;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Matteo Collina and Undici contributors
|
|
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,7 @@
|
|
|
1
|
+
# undici-types
|
|
2
|
+
|
|
3
|
+
This package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version.
|
|
4
|
+
|
|
5
|
+
- [GitHub nodejs/undici](https://github.com/nodejs/undici)
|
|
6
|
+
- [Undici Documentation](https://undici.nodejs.org/#/)
|
|
7
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { URL } from 'node:url'
|
|
2
|
+
import Pool from './pool'
|
|
3
|
+
import Dispatcher from './dispatcher'
|
|
4
|
+
|
|
5
|
+
export default Agent
|
|
6
|
+
|
|
7
|
+
declare class Agent extends Dispatcher {
|
|
8
|
+
constructor (opts?: Agent.Options)
|
|
9
|
+
/** `true` after `dispatcher.close()` has been called. */
|
|
10
|
+
closed: boolean
|
|
11
|
+
/** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
|
|
12
|
+
destroyed: boolean
|
|
13
|
+
/** Dispatches a request. */
|
|
14
|
+
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare namespace Agent {
|
|
18
|
+
export interface Options extends Pool.Options {
|
|
19
|
+
/** Default: `(origin, opts) => new Pool(origin, opts)`. */
|
|
20
|
+
factory?(origin: string | URL, opts: Object): Dispatcher;
|
|
21
|
+
/** Integer. Default: `0` */
|
|
22
|
+
maxRedirections?: number;
|
|
23
|
+
|
|
24
|
+
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DispatchOptions extends Dispatcher.DispatchOptions {
|
|
28
|
+
/** Integer. */
|
|
29
|
+
maxRedirections?: number;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { URL, UrlObject } from 'node:url'
|
|
2
|
+
import { Duplex } from 'node:stream'
|
|
3
|
+
import Dispatcher from './dispatcher'
|
|
4
|
+
|
|
5
|
+
/** Performs an HTTP request. */
|
|
6
|
+
declare function request<TOpaque = null> (
|
|
7
|
+
url: string | URL | UrlObject,
|
|
8
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>,
|
|
9
|
+
): Promise<Dispatcher.ResponseData<TOpaque>>
|
|
10
|
+
|
|
11
|
+
/** A faster version of `request`. */
|
|
12
|
+
declare function stream<TOpaque = null> (
|
|
13
|
+
url: string | URL | UrlObject,
|
|
14
|
+
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.RequestOptions<TOpaque>, 'origin' | 'path'>,
|
|
15
|
+
factory: Dispatcher.StreamFactory<TOpaque>
|
|
16
|
+
): Promise<Dispatcher.StreamData<TOpaque>>
|
|
17
|
+
|
|
18
|
+
/** For easy use with `stream.pipeline`. */
|
|
19
|
+
declare function pipeline<TOpaque = null> (
|
|
20
|
+
url: string | URL | UrlObject,
|
|
21
|
+
options: { dispatcher?: Dispatcher } & Omit<Dispatcher.PipelineOptions<TOpaque>, 'origin' | 'path'>,
|
|
22
|
+
handler: Dispatcher.PipelineHandler<TOpaque>
|
|
23
|
+
): Duplex
|
|
24
|
+
|
|
25
|
+
/** Starts two-way communications with the requested resource. */
|
|
26
|
+
declare function connect<TOpaque = null> (
|
|
27
|
+
url: string | URL | UrlObject,
|
|
28
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.ConnectOptions<TOpaque>, 'origin' | 'path'>
|
|
29
|
+
): Promise<Dispatcher.ConnectData<TOpaque>>
|
|
30
|
+
|
|
31
|
+
/** Upgrade to a different protocol. */
|
|
32
|
+
declare function upgrade (
|
|
33
|
+
url: string | URL | UrlObject,
|
|
34
|
+
options?: { dispatcher?: Dispatcher } & Omit<Dispatcher.UpgradeOptions, 'origin' | 'path'>
|
|
35
|
+
): Promise<Dispatcher.UpgradeData>
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
request,
|
|
39
|
+
stream,
|
|
40
|
+
pipeline,
|
|
41
|
+
connect,
|
|
42
|
+
upgrade
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Pool from './pool'
|
|
2
|
+
import Dispatcher from './dispatcher'
|
|
3
|
+
import { URL } from 'node:url'
|
|
4
|
+
|
|
5
|
+
export default BalancedPool
|
|
6
|
+
|
|
7
|
+
type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
|
|
8
|
+
|
|
9
|
+
declare class BalancedPool extends Dispatcher {
|
|
10
|
+
constructor (url: string | string[] | URL | URL[], options?: Pool.Options)
|
|
11
|
+
|
|
12
|
+
addUpstream (upstream: string | URL): BalancedPool
|
|
13
|
+
removeUpstream (upstream: string | URL): BalancedPool
|
|
14
|
+
upstreams: Array<string>
|
|
15
|
+
|
|
16
|
+
/** `true` after `pool.close()` has been called. */
|
|
17
|
+
closed: boolean
|
|
18
|
+
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
|
|
19
|
+
destroyed: boolean
|
|
20
|
+
|
|
21
|
+
// Override dispatcher APIs.
|
|
22
|
+
override connect (
|
|
23
|
+
options: BalancedPoolConnectOptions
|
|
24
|
+
): Promise<Dispatcher.ConnectData>
|
|
25
|
+
override connect (
|
|
26
|
+
options: BalancedPoolConnectOptions,
|
|
27
|
+
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
|
|
28
|
+
): void
|
|
29
|
+
}
|
|
30
|
+
|