|
8 | 8 |
|
9 | 9 | import { Duplex } from 'stream';
|
10 | 10 | import { DuplexOptions } from 'stream';
|
| 11 | +import { Socket } from 'net'; |
11 | 12 | import { default as WebSocket_2 } from 'ws';
|
12 | 13 |
|
13 | 14 | // @public
|
@@ -144,225 +145,26 @@ export interface INodeBuffer extends Uint8Array {
|
144 | 145 | writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
145 | 146 | }
|
146 | 147 |
|
| 148 | +// @public |
| 149 | +export interface INodeDuplex extends Duplex { |
| 150 | + // (undocumented) |
| 151 | + on(event: string | symbol, listener: (...args: any[]) => void): this; |
| 152 | + // (undocumented) |
| 153 | + on(event: 'data', listener: (chunk: INodeBuffer) => void): this; |
| 154 | +} |
| 155 | + |
147 | 156 | // @public
|
148 | 157 | export interface INodeIncomingMessage {
|
149 | 158 | headers?: any;
|
150 | 159 | method?: any;
|
151 | 160 | }
|
152 | 161 |
|
153 | 162 | // @public
|
154 |
| -export interface INodeSocket { |
155 |
| - // (undocumented) |
156 |
| - [Symbol.asyncIterator](): AsyncIterableIterator<any>; |
157 |
| - // (undocumented) |
158 |
| - addListener(event: 'close', listener: () => void): this; |
159 |
| - // (undocumented) |
160 |
| - addListener(event: 'data', listener: (chunk: any) => void): this; |
161 |
| - // (undocumented) |
162 |
| - addListener(event: 'end', listener: () => void): this; |
163 |
| - // (undocumented) |
164 |
| - addListener(event: 'readable', listener: () => void): this; |
165 |
| - // (undocumented) |
166 |
| - addListener(event: 'error', listener: (err: Error) => void): this; |
167 |
| - // (undocumented) |
168 |
| - addListener(event: string | symbol, listener: (...args: any[]) => void): this; |
169 |
| - // Warning: (ae-forgotten-export) The symbol "AddressInfo" needs to be exported by the entry point index.d.ts |
170 |
| - // |
171 |
| - // (undocumented) |
172 |
| - address(): AddressInfo | string; |
173 |
| - // (undocumented) |
174 |
| - readonly bufferSize: number; |
175 |
| - // (undocumented) |
176 |
| - readonly bytesRead: number; |
177 |
| - // (undocumented) |
178 |
| - readonly bytesWritten: number; |
179 |
| - // (undocumented) |
180 |
| - connect(options: any, connectionListener?: () => void): any; |
181 |
| - // (undocumented) |
182 |
| - connect(port: number, host: string, connectionListener?: () => void): any; |
183 |
| - // (undocumented) |
184 |
| - connect(port: number, connectionListener?: () => void): any; |
185 |
| - // (undocumented) |
186 |
| - connect(path: string, connectionListener?: () => void): any; |
187 |
| - // (undocumented) |
188 |
| - connecting: boolean; |
189 |
| - // (undocumented) |
190 |
| - cork(): void; |
191 |
| - // (undocumented) |
192 |
| - destroy(error?: Error): void; |
193 |
| - // (undocumented) |
194 |
| - _destroy(error: Error | null, callback: (error: Error | null) => void): void; |
195 |
| - // (undocumented) |
196 |
| - destroyed: boolean; |
197 |
| - // (undocumented) |
198 |
| - emit(event: 'close'): boolean; |
199 |
| - // (undocumented) |
200 |
| - emit(event: 'data', chunk: any): boolean; |
201 |
| - // (undocumented) |
202 |
| - emit(event: 'end'): boolean; |
203 |
| - // (undocumented) |
204 |
| - emit(event: 'readable'): boolean; |
205 |
| - // (undocumented) |
206 |
| - emit(event: 'error', err: Error): boolean; |
207 |
| - // (undocumented) |
208 |
| - emit(event: string | symbol, ...args: any[]): boolean; |
209 |
| - // (undocumented) |
210 |
| - end(cb?: () => void): void; |
211 |
| - // (undocumented) |
212 |
| - end(chunk: any, cb?: () => void): void; |
213 |
| - // (undocumented) |
214 |
| - end(chunk: any, encoding?: string, cb?: () => void): void; |
215 |
| - // (undocumented) |
216 |
| - eventNames(): Array<string | symbol>; |
217 |
| - // (undocumented) |
218 |
| - _final(callback: (error?: Error | null) => void): void; |
219 |
| - // (undocumented) |
220 |
| - getMaxListeners(): number; |
221 |
| - // (undocumented) |
222 |
| - isPaused(): boolean; |
223 |
| - // (undocumented) |
224 |
| - listenerCount(type: string | symbol): number; |
225 |
| - // (undocumented) |
226 |
| - listeners(event: string | symbol): Function[]; |
227 |
| - // (undocumented) |
228 |
| - readonly localAddress: string; |
229 |
| - // (undocumented) |
230 |
| - readonly localPort: number; |
231 |
| - // (undocumented) |
232 |
| - off(event: string | symbol, listener: (...args: any[]) => void): this; |
| 163 | +export interface INodeSocket extends Socket { |
233 | 164 | // (undocumented)
|
234 | 165 | on(event: string, listener: (...args: any[]) => void): this;
|
235 | 166 | // (undocumented)
|
236 |
| - on(event: 'close', listener: (had_error: boolean) => void): this; |
237 |
| - // (undocumented) |
238 |
| - on(event: 'connect', listener: () => void): this; |
239 |
| - // (undocumented) |
240 | 167 | on(event: 'data', listener: (data: INodeBuffer) => void): this;
|
241 |
| - // (undocumented) |
242 |
| - on(event: 'end', listener: () => void): this; |
243 |
| - // (undocumented) |
244 |
| - on(event: 'error', listener: (err: Error) => void): this; |
245 |
| - // (undocumented) |
246 |
| - once(event: 'close', listener: () => void): this; |
247 |
| - // (undocumented) |
248 |
| - once(event: 'data', listener: (chunk: any) => void): this; |
249 |
| - // (undocumented) |
250 |
| - once(event: 'end', listener: () => void): this; |
251 |
| - // (undocumented) |
252 |
| - once(event: 'readable', listener: () => void): this; |
253 |
| - // (undocumented) |
254 |
| - once(event: 'error', listener: (err: Error) => void): this; |
255 |
| - // (undocumented) |
256 |
| - once(event: string | symbol, listener: (...args: any[]) => void): this; |
257 |
| - // (undocumented) |
258 |
| - pause(): this; |
259 |
| - // Warning: (ae-forgotten-export) The symbol "WritableStream_2" needs to be exported by the entry point index.d.ts |
260 |
| - // |
261 |
| - // (undocumented) |
262 |
| - pipe<T extends WritableStream_2>(destination: T, options?: { |
263 |
| - end?: boolean; |
264 |
| - }): T; |
265 |
| - // (undocumented) |
266 |
| - prependListener(event: 'close', listener: () => void): this; |
267 |
| - // (undocumented) |
268 |
| - prependListener(event: 'data', listener: (chunk: any) => void): this; |
269 |
| - // (undocumented) |
270 |
| - prependListener(event: 'end', listener: () => void): this; |
271 |
| - // (undocumented) |
272 |
| - prependListener(event: 'readable', listener: () => void): this; |
273 |
| - // (undocumented) |
274 |
| - prependListener(event: 'error', listener: (err: Error) => void): this; |
275 |
| - // (undocumented) |
276 |
| - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; |
277 |
| - // (undocumented) |
278 |
| - prependOnceListener(event: 'close', listener: () => void): this; |
279 |
| - // (undocumented) |
280 |
| - prependOnceListener(event: 'data', listener: (chunk: any) => void): this; |
281 |
| - // (undocumented) |
282 |
| - prependOnceListener(event: 'end', listener: () => void): this; |
283 |
| - // (undocumented) |
284 |
| - prependOnceListener(event: 'readable', listener: () => void): this; |
285 |
| - // (undocumented) |
286 |
| - prependOnceListener(event: 'error', listener: (err: Error) => void): this; |
287 |
| - // (undocumented) |
288 |
| - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; |
289 |
| - // (undocumented) |
290 |
| - push(chunk: any, encoding?: string): boolean; |
291 |
| - // (undocumented) |
292 |
| - rawListeners(event: string | symbol): Function[]; |
293 |
| - // (undocumented) |
294 |
| - read(size?: number): any; |
295 |
| - // (undocumented) |
296 |
| - _read(size: number): void; |
297 |
| - // (undocumented) |
298 |
| - readable: boolean; |
299 |
| - // (undocumented) |
300 |
| - readonly readableFlowing: boolean | null; |
301 |
| - // (undocumented) |
302 |
| - readonly readableHighWaterMark: number; |
303 |
| - // (undocumented) |
304 |
| - readonly readableLength: number; |
305 |
| - // (undocumented) |
306 |
| - ref(): any; |
307 |
| - // (undocumented) |
308 |
| - removeAllListeners(event?: string | symbol): this; |
309 |
| - // (undocumented) |
310 |
| - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; |
311 |
| - // (undocumented) |
312 |
| - resume(): this; |
313 |
| - // (undocumented) |
314 |
| - setDefaultEncoding(encoding: string): this; |
315 |
| - // (undocumented) |
316 |
| - setEncoding(encoding: string): this; |
317 |
| - // (undocumented) |
318 |
| - setKeepAlive(enable?: boolean, initialDelay?: number): this; |
319 |
| - // (undocumented) |
320 |
| - setMaxListeners(n: number): this; |
321 |
| - // (undocumented) |
322 |
| - setNoDelay(noDelay?: boolean): this; |
323 |
| - // (undocumented) |
324 |
| - setTimeout(timeout: number, callback?: () => void): this; |
325 |
| - // (undocumented) |
326 |
| - uncork(): void; |
327 |
| - // (undocumented) |
328 |
| - unpipe(destination?: any): this; |
329 |
| - // (undocumented) |
330 |
| - unref(): any; |
331 |
| - // (undocumented) |
332 |
| - unshift(chunk: any): void; |
333 |
| - // (undocumented) |
334 |
| - wrap(oldStream: any): this; |
335 |
| - // (undocumented) |
336 |
| - writable: boolean; |
337 |
| - // (undocumented) |
338 |
| - readonly writableHighWaterMark: number; |
339 |
| - // (undocumented) |
340 |
| - readonly writableLength: number; |
341 |
| - // Warning: (ae-forgotten-export) The symbol "ValidBuffer" needs to be exported by the entry point index.d.ts |
342 |
| - // |
343 |
| - // (undocumented) |
344 |
| - write(buffer: ValidBuffer, cb?: (err?: Error) => void): boolean; |
345 |
| - // (undocumented) |
346 |
| - write(str: string, encoding?: string, cb?: Function): boolean; |
347 |
| - // (undocumented) |
348 |
| - write(buffer: ValidBuffer): boolean; |
349 |
| - // (undocumented) |
350 |
| - write(str: string, cb?: Function): boolean; |
351 |
| - // (undocumented) |
352 |
| - write(str: string, encoding?: string, fd?: string): boolean; |
353 |
| - // (undocumented) |
354 |
| - write(data: any, encoding?: string, callback?: Function): void; |
355 |
| - // (undocumented) |
356 |
| - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; |
357 |
| - // (undocumented) |
358 |
| - write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean; |
359 |
| - // (undocumented) |
360 |
| - _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void; |
361 |
| - // (undocumented) |
362 |
| - _writev?(chunks: Array<{ |
363 |
| - chunk: any; |
364 |
| - encoding: string; |
365 |
| - }>, callback: (error?: Error | null) => void): void; |
366 | 168 | }
|
367 | 169 |
|
368 | 170 | // @public
|
|
0 commit comments