@openclaw/slack 2026.10.5-beta.1 → 2026.10.5-beta.2

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 (108) hide show
  1. package/node_modules/@slack/bolt/node_modules/@slack/socket-mode/dist/package.json +4 -4
  2. package/node_modules/@slack/bolt/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.d.ts.map +1 -1
  3. package/node_modules/@slack/bolt/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js +9 -17
  4. package/node_modules/@slack/bolt/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js.map +1 -1
  5. package/node_modules/@slack/bolt/node_modules/@slack/socket-mode/package.json +4 -4
  6. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +2 -2
  7. package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +2 -2
  8. package/node_modules/@slack/bolt/node_modules/@types/node/dgram.d.ts +1 -1
  9. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -17
  10. package/node_modules/@slack/bolt/node_modules/@types/node/zlib.d.ts +6 -0
  11. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  12. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2 -2
  13. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +1 -1
  14. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  15. package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +6 -0
  16. package/package.json +4 -4
  17. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/LICENSE +0 -21
  18. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/README.md +0 -15
  19. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +0 -68
  20. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +0 -1077
  21. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +0 -711
  22. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +0 -471
  23. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +0 -1800
  24. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +0 -1361
  25. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +0 -432
  26. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +0 -93
  27. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +0 -14
  28. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +0 -3964
  29. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +0 -652
  30. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -794
  31. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +0 -497
  32. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +0 -876
  33. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +0 -150
  34. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +0 -1008
  35. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ffi.d.ts +0 -500
  36. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +0 -1477
  37. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +0 -4803
  38. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +0 -150
  39. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.typedarray.d.ts +0 -101
  40. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +0 -2218
  41. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +0 -2498
  42. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +0 -400
  43. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +0 -116
  44. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector/promises.d.ts +0 -35
  45. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +0 -265
  46. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +0 -4406
  47. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +0 -726
  48. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +0 -1074
  49. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +0 -498
  50. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/package.json +0 -155
  51. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/posix.d.ts +0 -8
  52. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/win32.d.ts +0 -8
  53. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +0 -178
  54. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +0 -617
  55. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +0 -2269
  56. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +0 -89
  57. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +0 -139
  58. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/quic.d.ts +0 -2191
  59. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +0 -158
  60. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +0 -508
  61. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +0 -420
  62. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +0 -47
  63. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +0 -1140
  64. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +0 -114
  65. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/iter.d.ts +0 -449
  66. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +0 -211
  67. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +0 -320
  68. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +0 -1806
  69. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +0 -27
  70. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test/reporters.d.ts +0 -60
  71. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +0 -2558
  72. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +0 -93
  73. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +0 -149
  74. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +0 -1232
  75. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +0 -103
  76. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -467
  77. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  78. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -36
  79. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +0 -118
  80. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  81. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +0 -118
  82. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +0 -226
  83. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +0 -556
  84. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util/types.d.ts +0 -558
  85. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +0 -1677
  86. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +0 -1059
  87. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vfs.d.ts +0 -211
  88. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +0 -1137
  89. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +0 -131
  90. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -59
  91. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  92. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/console.d.ts +0 -9
  93. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  94. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/domexception.d.ts +0 -83
  95. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  96. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/events.d.ts +0 -106
  97. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/fetch.d.ts +0 -69
  98. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  99. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  100. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/navigator.d.ts +0 -25
  101. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  102. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/storage.d.ts +0 -24
  103. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +0 -119
  104. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  105. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/url.d.ts +0 -24
  106. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +0 -672
  107. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib/iter.d.ts +0 -131
  108. package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +0 -606
@@ -1,652 +0,0 @@
1
- declare module "node:dgram" {
2
- import { NonSharedBuffer } from "node:buffer";
3
- import * as dns from "node:dns";
4
- import { Abortable, EventEmitter, InternalEventEmitter } from "node:events";
5
- import { AddressInfo, BlockList } from "node:net";
6
- interface RemoteInfo {
7
- address: string;
8
- family: "IPv4" | "IPv6";
9
- port: number;
10
- size: number;
11
- }
12
- interface BindOptions {
13
- port?: number | undefined;
14
- address?: string | undefined;
15
- exclusive?: boolean | undefined;
16
- fd?: number | undefined;
17
- }
18
- interface BindSyncOptions {
19
- port?: number | undefined;
20
- address?: string | undefined;
21
- }
22
- type SocketType = "udp4" | "udp6";
23
- interface SocketOptions extends Abortable {
24
- type: SocketType;
25
- reuseAddr?: boolean | undefined;
26
- reusePort?: boolean | undefined;
27
- /**
28
- * @default false
29
- */
30
- ipv6Only?: boolean | undefined;
31
- recvBufferSize?: number | undefined;
32
- sendBufferSize?: number | undefined;
33
- lookup?:
34
- | ((
35
- hostname: string,
36
- options: dns.LookupOneOptions,
37
- callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
38
- ) => void)
39
- | undefined;
40
- receiveBlockList?: BlockList | undefined;
41
- sendBlockList?: BlockList | undefined;
42
- }
43
- /**
44
- * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
45
- * messages. When `address` and `port` are not passed to `socket.bind()` the
46
- * method will bind the socket to the "all interfaces" address on a random port
47
- * (it does the right thing for both `udp4` and `udp6` sockets). The bound address
48
- * and port can be retrieved using `socket.address().address` and `socket.address().port`.
49
- *
50
- * If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket:
51
- *
52
- * ```js
53
- * const controller = new AbortController();
54
- * const { signal } = controller;
55
- * const server = dgram.createSocket({ type: 'udp4', signal });
56
- * server.on('message', (msg, rinfo) => {
57
- * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
58
- * });
59
- * // Later, when you want to close the server.
60
- * controller.abort();
61
- * ```
62
- * @since v0.11.13
63
- * @param options Available options are:
64
- * @param callback Attached as a listener for `'message'` events. Optional.
65
- */
66
- function createSocket(type: SocketType, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
67
- function createSocket(options: SocketOptions, callback?: (msg: NonSharedBuffer, rinfo: RemoteInfo) => void): Socket;
68
- interface SocketEventMap {
69
- "close": [];
70
- "connect": [];
71
- "error": [err: Error];
72
- "listening": [];
73
- "message": [msg: NonSharedBuffer, rinfo: RemoteInfo];
74
- }
75
- /**
76
- * Encapsulates the datagram functionality.
77
- *
78
- * New instances of `dgram.Socket` are created using {@link createSocket}.
79
- * The `new` keyword is not to be used to create `dgram.Socket` instances.
80
- * @since v0.1.99
81
- */
82
- class Socket implements EventEmitter {
83
- /**
84
- * Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not
85
- * specified, the operating system will choose
86
- * one interface and will add membership to it. To add membership to every
87
- * available interface, call `addMembership` multiple times, once per interface.
88
- *
89
- * When called on an unbound socket, this method will implicitly bind to a random
90
- * port, listening on all interfaces.
91
- *
92
- * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur:
93
- *
94
- * ```js
95
- * import cluster from 'node:cluster';
96
- * import dgram from 'node:dgram';
97
- *
98
- * if (cluster.isPrimary) {
99
- * cluster.fork(); // Works ok.
100
- * cluster.fork(); // Fails with EADDRINUSE.
101
- * } else {
102
- * const s = dgram.createSocket('udp4');
103
- * s.bind(1234, () => {
104
- * s.addMembership('224.0.0.114');
105
- * });
106
- * }
107
- * ```
108
- * @since v0.6.9
109
- */
110
- addMembership(multicastAddress: string, multicastInterface?: string): void;
111
- /**
112
- * Returns an object containing the address information for a socket.
113
- * For UDP sockets, this object will contain `address`, `family`, and `port` properties.
114
- *
115
- * This method throws `EBADF` if called on an unbound socket.
116
- * @since v0.1.99
117
- */
118
- address(): AddressInfo;
119
- /**
120
- * For UDP sockets, causes the `dgram.Socket` to listen for datagram
121
- * messages on a named `port` and optional `address`. If `port` is not
122
- * specified or is `0`, the operating system will attempt to bind to a
123
- * random port. If `address` is not specified, the operating system will
124
- * attempt to listen on all addresses. Once binding is complete, a
125
- * `'listening'` event is emitted and the optional `callback` function is
126
- * called.
127
- *
128
- * Specifying both a `'listening'` event listener and passing a
129
- * `callback` to the `socket.bind()` method is not harmful but not very
130
- * useful.
131
- *
132
- * A bound datagram socket keeps the Node.js process running to receive
133
- * datagram messages.
134
- *
135
- * If binding fails, an `'error'` event is generated. In rare case (e.g.
136
- * attempting to bind with a closed socket), an `Error` may be thrown.
137
- *
138
- * Example of a UDP server listening on port 41234:
139
- *
140
- * ```js
141
- * import dgram from 'node:dgram';
142
- *
143
- * const server = dgram.createSocket('udp4');
144
- *
145
- * server.on('error', (err) => {
146
- * console.error(`server error:\n${err.stack}`);
147
- * server.close();
148
- * });
149
- *
150
- * server.on('message', (msg, rinfo) => {
151
- * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
152
- * });
153
- *
154
- * server.on('listening', () => {
155
- * const address = server.address();
156
- * console.log(`server listening ${address.address}:${address.port}`);
157
- * });
158
- *
159
- * server.bind(41234);
160
- * // Prints: server listening 0.0.0.0:41234
161
- * ```
162
- * @since v0.1.99
163
- * @param callback with no parameters. Called when binding is complete.
164
- */
165
- bind(port?: number, address?: string, callback?: () => void): this;
166
- bind(port: number, callback: () => void): this;
167
- bind(callback: () => void): this;
168
- /**
169
- * For UDP sockets, causes the `dgram.Socket` to listen for datagram
170
- * messages on a named `port` and optional `address` that are passed as
171
- * properties of an `options` object passed as the first argument. If
172
- * `port` is not specified or is `0`, the operating system will attempt
173
- * to bind to a random port. If `address` is not specified, the operating
174
- * system will attempt to listen on all addresses. Once binding is
175
- * complete, a `'listening'` event is emitted and the optional `callback`
176
- * function is called.
177
- *
178
- * The `options` object may contain a `fd` property. When a `fd` greater
179
- * than `0` is set, it will wrap around an existing socket with the given
180
- * file descriptor. In this case, the properties of `port` and `address`
181
- * will be ignored.
182
- *
183
- * Specifying both a `'listening'` event listener and passing a
184
- * `callback` to the `socket.bind()` method is not harmful but not very
185
- * useful.
186
- *
187
- * The `options` object may contain an additional `exclusive` property that is
188
- * used when using `dgram.Socket` objects with the [`cluster`](https://nodejs.org/docs/latest-v26.x/api/cluster.html) module. When
189
- * `exclusive` is set to `false` (the default), cluster workers will use the same
190
- * underlying socket handle allowing connection handling duties to be shared.
191
- * When `exclusive` is `true`, however, the handle is not shared and attempted
192
- * port sharing results in an error. Creating a `dgram.Socket` with the `reusePort`
193
- * option set to `true` causes `exclusive` to always be `true` when `socket.bind()`
194
- * is called.
195
- *
196
- * A bound datagram socket keeps the Node.js process running to receive
197
- * datagram messages.
198
- *
199
- * If binding fails, an `'error'` event is generated. In rare case (e.g.
200
- * attempting to bind with a closed socket), an `Error` may be thrown.
201
- *
202
- * An example socket listening on an exclusive port is shown below.
203
- *
204
- * ```js
205
- * socket.bind({
206
- * address: 'localhost',
207
- * port: 8000,
208
- * exclusive: true,
209
- * });
210
- * ```
211
- * @since v0.11.14
212
- * @param options Required. Supports the following properties:
213
- */
214
- bind(options: BindOptions, callback?: () => void): this;
215
- /**
216
- * The synchronous counterpart of `socket.bind()`. `bind(2)` is a local,
217
- * non-blocking system call, so the bind is performed inline and the resolved
218
- * address is returned immediately, including the operating-system-assigned
219
- * ephemeral port when `port` is `0`:
220
- *
221
- * ```js
222
- * const dgram = require('node:dgram');
223
- *
224
- * const socket = dgram.createSocket('udp4');
225
- * const address = socket.bindSync({ address: '0.0.0.0', port: 0 });
226
- * console.log(address); // e.g. { address: '0.0.0.0', family: 'IPv4', port: 53124 }
227
- * ```
228
- *
229
- * A bind failure such as `EADDRINUSE` is thrown synchronously rather than emitted
230
- * as an `'error'` event. After `bindSync()` returns, `socket.address()` is
231
- * valid synchronously and the `'listening'` event is emitted on the next tick.
232
- *
233
- * `address` must be a numeric IP literal; `bindSync()` never performs DNS
234
- * resolution (asynchronous name resolution being the only genuinely blocking part
235
- * of binding). Incoming datagrams continue to be delivered asynchronously via the
236
- * `'message'` event. `bindSync()` always binds the socket's own handle and
237
- * does not participate in [`cluster`](https://nodejs.org/docs/latest-v26.x/api/cluster.html) handle sharing.
238
- * @since v26.4.0
239
- * @returns The bound address as returned by `socket.address()`.
240
- */
241
- bindSync(options?: BindSyncOptions): AddressInfo;
242
- /**
243
- * Close the underlying socket and stop listening for data on it. If a callback is
244
- * provided, it is added as a listener for the `'close'` event.
245
- * @since v0.1.99
246
- * @param callback Called when the socket has been closed.
247
- */
248
- close(callback?: () => void): this;
249
- /**
250
- * Associates the `dgram.Socket` to a remote address and port. Every
251
- * message sent by this handle is automatically sent to that destination. Also,
252
- * the socket will only receive messages from that remote peer.
253
- * Trying to call `connect()` on an already connected socket will result
254
- * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not
255
- * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets)
256
- * will be used by default. Once the connection is complete, a `'connect'` event
257
- * is emitted and the optional `callback` function is called. In case of failure,
258
- * the `callback` is called or, failing this, an `'error'` event is emitted.
259
- * @since v12.0.0
260
- * @param callback Called when the connection is completed or on error.
261
- */
262
- connect(port: number, address?: string, callback?: () => void): void;
263
- connect(port: number, callback: () => void): void;
264
- /**
265
- * The synchronous counterpart of `socket.connect()`. For a UDP socket
266
- * `connect(2)` only records the default peer address and is a local, non-blocking
267
- * system call, so the association is performed inline. Any error raised by the
268
- * call itself (for example `EAFNOSUPPORT` for a mismatched address family) is
269
- * thrown synchronously rather than reported via the `'error'` event. Because
270
- * `connect(2)` does not probe reachability, errors such as `ECONNREFUSED` are
271
- * still surfaced asynchronously on a later send or receive, exactly as for
272
- * `socket.connect()`:
273
- *
274
- * ```js
275
- * const dgram = require('node:dgram');
276
- *
277
- * const socket = dgram.createSocket('udp4');
278
- * socket.connectSync(41234, '127.0.0.1');
279
- * console.log(socket.remoteAddress()); // { address: '127.0.0.1', family: 'IPv4', port: 41234 }
280
- * ```
281
- *
282
- * If the socket is still unbound it is bound synchronously first. After
283
- * `connectSync()` returns, `socket.remoteAddress()` is valid synchronously
284
- * and the `'connect'` event is emitted on the next tick. Trying to call
285
- * `connectSync()` on an already connected socket throws an
286
- * `ERR_SOCKET_DGRAM_IS_CONNECTED` exception, and calling it while an
287
- * asynchronous [`socket.bind()`][] is still in progress throws an
288
- * `ERR_SOCKET_ALREADY_BOUND` exception.
289
- *
290
- * `address` must be a numeric IP literal; `connectSync()` never performs DNS
291
- * resolution (asynchronous name resolution being the only genuinely blocking part
292
- * of connecting).
293
- * @since v26.4.0
294
- * @param address A numeric IP address to connect to. Unlike
295
- * `socket.connect()`, no DNS resolution is performed, so a host name is not
296
- * accepted. If omitted, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for
297
- * `udp6` sockets) is used.
298
- */
299
- connectSync(port: number, address?: string): void;
300
- /**
301
- * A synchronous function that disassociates a connected `dgram.Socket` from
302
- * its remote address. Trying to call `disconnect()` on an unbound or already
303
- * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception.
304
- * @since v12.0.0
305
- */
306
- disconnect(): void;
307
- /**
308
- * Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the
309
- * kernel when the socket is closed or the process terminates, so most apps will
310
- * never have reason to call this.
311
- *
312
- * If `multicastInterface` is not specified, the operating system will attempt to
313
- * drop membership on all valid interfaces.
314
- * @since v0.6.9
315
- */
316
- dropMembership(multicastAddress: string, multicastInterface?: string): void;
317
- /**
318
- * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
319
- * @since v8.7.0
320
- * @return the `SO_RCVBUF` socket receive buffer size in bytes.
321
- */
322
- getRecvBufferSize(): number;
323
- /**
324
- * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
325
- * @since v8.7.0
326
- * @return the `SO_SNDBUF` socket send buffer size in bytes.
327
- */
328
- getSendBufferSize(): number;
329
- /**
330
- * @since v18.8.0, v16.19.0
331
- * @return Number of bytes queued for sending.
332
- */
333
- getSendQueueSize(): number;
334
- /**
335
- * @since v18.8.0, v16.19.0
336
- * @return Number of send requests currently in the queue awaiting to be processed.
337
- */
338
- getSendQueueCount(): number;
339
- /**
340
- * By default, binding a socket will cause it to block the Node.js process from
341
- * exiting as long as the socket is open. The `socket.unref()` method can be used
342
- * to exclude the socket from the reference counting that keeps the Node.js
343
- * process active. The `socket.ref()` method adds the socket back to the reference
344
- * counting and restores the default behavior.
345
- *
346
- * Calling `socket.ref()` multiples times will have no additional effect.
347
- *
348
- * The `socket.ref()` method returns a reference to the socket so calls can be
349
- * chained.
350
- * @since v0.9.1
351
- */
352
- ref(): this;
353
- /**
354
- * Returns an object containing the `address`, `family`, and `port` of the remote
355
- * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception
356
- * if the socket is not connected.
357
- * @since v12.0.0
358
- */
359
- remoteAddress(): AddressInfo;
360
- /**
361
- * Broadcasts a datagram on the socket.
362
- * For connectionless sockets, the destination `port` and `address` must be
363
- * specified. Connected sockets, on the other hand, will use their associated
364
- * remote endpoint, so the `port` and `address` arguments must not be set.
365
- *
366
- * The `msg` argument contains the message to be sent.
367
- * Depending on its type, different behavior can apply. If `msg` is a `Buffer`,
368
- * any `TypedArray` or a `DataView`,
369
- * the `offset` and `length` specify the offset within the `Buffer` where the
370
- * message begins and the number of bytes in the message, respectively.
371
- * If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that
372
- * contain multi-byte characters, `offset` and `length` will be calculated with
373
- * respect to `byte length` and not the character position.
374
- * If `msg` is an array, `offset` and `length` must not be specified.
375
- *
376
- * The `address` argument is a string. If the value of `address` is a host name,
377
- * DNS will be used to resolve the address of the host. If `address` is not
378
- * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default.
379
- *
380
- * If the socket has not been previously bound with a call to `bind`, the socket
381
- * is assigned a random port number and is bound to the "all interfaces" address
382
- * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.)
383
- *
384
- * An optional `callback` function may be specified to as a way of reporting
385
- * DNS errors or for determining when it is safe to reuse the `buf` object.
386
- * DNS lookups delay the time to send for at least one tick of the
387
- * Node.js event loop.
388
- *
389
- * The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be
390
- * passed as the first argument to the `callback`. If a `callback` is not given,
391
- * the error is emitted as an `'error'` event on the `socket` object.
392
- *
393
- * Offset and length are optional but both _must_ be set if either are used.
394
- * They are supported only when the first argument is a `Buffer`, a `TypedArray`,
395
- * or a `DataView`.
396
- *
397
- * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket.
398
- *
399
- * Example of sending a UDP packet to a port on `localhost`;
400
- *
401
- * ```js
402
- * import dgram from 'node:dgram';
403
- * import { Buffer } from 'node:buffer';
404
- *
405
- * const message = Buffer.from('Some bytes');
406
- * const client = dgram.createSocket('udp4');
407
- * client.send(message, 41234, 'localhost', (err) => {
408
- * client.close();
409
- * });
410
- * ```
411
- *
412
- * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
413
- *
414
- * ```js
415
- * import dgram from 'node:dgram';
416
- * import { Buffer } from 'node:buffer';
417
- *
418
- * const buf1 = Buffer.from('Some ');
419
- * const buf2 = Buffer.from('bytes');
420
- * const client = dgram.createSocket('udp4');
421
- * client.send([buf1, buf2], 41234, (err) => {
422
- * client.close();
423
- * });
424
- * ```
425
- *
426
- * Sending multiple buffers might be faster or slower depending on the
427
- * application and operating system. Run benchmarks to
428
- * determine the optimal strategy on a case-by-case basis. Generally speaking,
429
- * however, sending multiple buffers is faster.
430
- *
431
- * Example of sending a UDP packet using a socket connected to a port on `localhost`:
432
- *
433
- * ```js
434
- * import dgram from 'node:dgram';
435
- * import { Buffer } from 'node:buffer';
436
- *
437
- * const message = Buffer.from('Some bytes');
438
- * const client = dgram.createSocket('udp4');
439
- * client.connect(41234, 'localhost', (err) => {
440
- * client.send(message, (err) => {
441
- * client.close();
442
- * });
443
- * });
444
- * ```
445
- * @since v0.1.99
446
- * @param msg Message to be sent.
447
- * @param offset Offset in the buffer where the message starts.
448
- * @param length Number of bytes in the message.
449
- * @param port Destination port.
450
- * @param address Destination host name or IP address.
451
- * @param callback Called when the message has been sent.
452
- */
453
- send(
454
- msg: string | NodeJS.ArrayBufferView | readonly any[],
455
- port?: number,
456
- address?: string,
457
- callback?: (error: Error | null, bytes: number) => void,
458
- ): void;
459
- send(
460
- msg: string | NodeJS.ArrayBufferView | readonly any[],
461
- port?: number,
462
- callback?: (error: Error | null, bytes: number) => void,
463
- ): void;
464
- send(
465
- msg: string | NodeJS.ArrayBufferView | readonly any[],
466
- callback?: (error: Error | null, bytes: number) => void,
467
- ): void;
468
- send(
469
- msg: string | NodeJS.ArrayBufferView,
470
- offset: number,
471
- length: number,
472
- port?: number,
473
- address?: string,
474
- callback?: (error: Error | null, bytes: number) => void,
475
- ): void;
476
- send(
477
- msg: string | NodeJS.ArrayBufferView,
478
- offset: number,
479
- length: number,
480
- port?: number,
481
- callback?: (error: Error | null, bytes: number) => void,
482
- ): void;
483
- send(
484
- msg: string | NodeJS.ArrayBufferView,
485
- offset: number,
486
- length: number,
487
- callback?: (error: Error | null, bytes: number) => void,
488
- ): void;
489
- /**
490
- * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
491
- * packets may be sent to a local interface's broadcast address.
492
- *
493
- * This method throws `EBADF` if called on an unbound socket.
494
- * @since v0.6.9
495
- */
496
- setBroadcast(flag: boolean): void;
497
- /**
498
- * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
499
- * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
500
- * _with a scope index is written as `'IP%scope'` where scope is an interface name_
501
- * _or interface number._
502
- *
503
- * Sets the default outgoing multicast interface of the socket to a chosen
504
- * interface or back to system interface selection. The `multicastInterface` must
505
- * be a valid string representation of an IP from the socket's family.
506
- *
507
- * For IPv4 sockets, this should be the IP configured for the desired physical
508
- * interface. All packets sent to multicast on the socket will be sent on the
509
- * interface determined by the most recent successful use of this call.
510
- *
511
- * For IPv6 sockets, `multicastInterface` should include a scope to indicate the
512
- * interface as in the examples that follow. In IPv6, individual `send` calls can
513
- * also use explicit scope in addresses, so only packets sent to a multicast
514
- * address without specifying an explicit scope are affected by the most recent
515
- * successful use of this call.
516
- *
517
- * This method throws `EBADF` if called on an unbound socket.
518
- *
519
- * #### Example: IPv6 outgoing multicast interface
520
- *
521
- * On most systems, where scope format uses the interface name:
522
- *
523
- * ```js
524
- * const socket = dgram.createSocket('udp6');
525
- *
526
- * socket.bind(1234, () => {
527
- * socket.setMulticastInterface('::%eth1');
528
- * });
529
- * ```
530
- *
531
- * On Windows, where scope format uses an interface number:
532
- *
533
- * ```js
534
- * const socket = dgram.createSocket('udp6');
535
- *
536
- * socket.bind(1234, () => {
537
- * socket.setMulticastInterface('::%2');
538
- * });
539
- * ```
540
- *
541
- * #### Example: IPv4 outgoing multicast interface
542
- *
543
- * All systems use an IP of the host on the desired physical interface:
544
- *
545
- * ```js
546
- * const socket = dgram.createSocket('udp4');
547
- *
548
- * socket.bind(1234, () => {
549
- * socket.setMulticastInterface('10.0.0.2');
550
- * });
551
- * ```
552
- * @since v8.6.0
553
- */
554
- setMulticastInterface(multicastInterface: string): void;
555
- /**
556
- * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`,
557
- * multicast packets will also be received on the local interface.
558
- *
559
- * This method throws `EBADF` if called on an unbound socket.
560
- * @since v0.3.8
561
- */
562
- setMulticastLoopback(flag: boolean): boolean;
563
- /**
564
- * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
565
- * "Time to Live", in this context it specifies the number of IP hops that a
566
- * packet is allowed to travel through, specifically for multicast traffic. Each
567
- * router or gateway that forwards a packet decrements the TTL. If the TTL is
568
- * decremented to 0 by a router, it will not be forwarded.
569
- *
570
- * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`.
571
- *
572
- * This method throws `EBADF` if called on an unbound socket.
573
- * @since v0.3.8
574
- */
575
- setMulticastTTL(ttl: number): number;
576
- /**
577
- * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer
578
- * in bytes.
579
- *
580
- * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
581
- * @since v8.7.0
582
- */
583
- setRecvBufferSize(size: number): void;
584
- /**
585
- * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer
586
- * in bytes.
587
- *
588
- * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
589
- * @since v8.7.0
590
- */
591
- setSendBufferSize(size: number): void;
592
- /**
593
- * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live",
594
- * in this context it specifies the number of IP hops that a packet is allowed to
595
- * travel through. Each router or gateway that forwards a packet decrements the
596
- * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
597
- * Changing TTL values is typically done for network probes or when multicasting.
598
- *
599
- * The `ttl` argument may be between 1 and 255\. The default on most systems
600
- * is 64.
601
- *
602
- * This method throws `EBADF` if called on an unbound socket.
603
- * @since v0.1.101
604
- */
605
- setTTL(ttl: number): number;
606
- /**
607
- * By default, binding a socket will cause it to block the Node.js process from
608
- * exiting as long as the socket is open. The `socket.unref()` method can be used
609
- * to exclude the socket from the reference counting that keeps the Node.js
610
- * process active, allowing the process to exit even if the socket is still
611
- * listening.
612
- *
613
- * Calling `socket.unref()` multiple times will have no additional effect.
614
- *
615
- * The `socket.unref()` method returns a reference to the socket so calls can be
616
- * chained.
617
- * @since v0.9.1
618
- */
619
- unref(): this;
620
- /**
621
- * Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket
622
- * option. If the `multicastInterface` argument
623
- * is not specified, the operating system will choose one interface and will add
624
- * membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface.
625
- *
626
- * When called on an unbound socket, this method will implicitly bind to a random
627
- * port, listening on all interfaces.
628
- * @since v13.1.0, v12.16.0
629
- */
630
- addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
631
- /**
632
- * Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is
633
- * automatically called by the kernel when the
634
- * socket is closed or the process terminates, so most apps will never have
635
- * reason to call this.
636
- *
637
- * If `multicastInterface` is not specified, the operating system will attempt to
638
- * drop membership on all valid interfaces.
639
- * @since v13.1.0, v12.16.0
640
- */
641
- dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
642
- /**
643
- * Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
644
- * @since v20.5.0
645
- */
646
- [Symbol.asyncDispose](): Promise<void>;
647
- }
648
- interface Socket extends InternalEventEmitter<SocketEventMap> {}
649
- }
650
- declare module "dgram" {
651
- export * from "node:dgram";
652
- }