@rspack/dev-server 2.0.2 → 2.0.3

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 (43) hide show
  1. package/client/clients/WebSocketClient.d.ts +17 -0
  2. package/client/clients/WebSocketClient.js +32 -0
  3. package/client/index.d.ts +17 -0
  4. package/client/index.js +356 -0
  5. package/client/modules/logger/Logger.d.ts +39 -0
  6. package/client/modules/logger/Logger.js +121 -0
  7. package/client/modules/logger/createConsoleLogger.d.ts +12 -0
  8. package/client/modules/logger/createConsoleLogger.js +119 -0
  9. package/client/modules/logger/index.d.ts +26 -0
  10. package/client/modules/logger/index.js +32 -0
  11. package/client/modules/types.d.ts +45 -0
  12. package/client/modules/types.js +17 -0
  13. package/client/overlay.d.ts +47 -0
  14. package/client/overlay.js +454 -0
  15. package/client/progress.d.ts +11 -0
  16. package/client/progress.js +197 -0
  17. package/client/socket.d.ts +15 -0
  18. package/client/socket.js +34 -0
  19. package/client/type.d.ts +15 -0
  20. package/client/type.js +1 -0
  21. package/client/utils/ansiHTML.d.ts +30 -0
  22. package/client/utils/ansiHTML.js +195 -0
  23. package/client/utils/log.d.ts +13 -0
  24. package/client/utils/log.js +11 -0
  25. package/client/utils/sendMessage.d.ts +11 -0
  26. package/client/utils/sendMessage.js +8 -0
  27. package/dist/0~chokidar.js +1477 -0
  28. package/dist/0~chokidar.js.LICENSE.txt +1 -0
  29. package/dist/0~connect-history-api-fallback.js +76 -0
  30. package/dist/0~connect-next.js +1245 -0
  31. package/dist/0~connect-next.js.LICENSE.txt +57 -0
  32. package/dist/0~debug.js +621 -0
  33. package/dist/0~http-proxy-middleware.js +3817 -0
  34. package/dist/0~http-proxy-middleware.js.LICENSE.txt +34 -0
  35. package/dist/0~launch-editor.js +601 -0
  36. package/dist/0~open.js +555 -0
  37. package/dist/0~p-retry.js +161 -0
  38. package/dist/0~serve-static.js +1595 -0
  39. package/dist/0~serve-static.js.LICENSE.txt +108 -0
  40. package/dist/465.js +5192 -0
  41. package/dist/index.d.ts +1008 -0
  42. package/dist/index.js +1 -0
  43. package/package.json +1 -1
@@ -0,0 +1,1008 @@
1
+ /// <reference types="node" />
2
+
3
+ import { Agent } from 'http';
4
+ import { API } from '@rspack/dev-middleware';
5
+ import { Callback } from '@rspack/dev-middleware';
6
+ import { ClientRequest } from 'http';
7
+ import { ClientRequestArgs } from 'http';
8
+ import { Compiler } from '@rspack/core';
9
+ import { DevServer as Configuration } from '@rspack/core';
10
+ import { Context } from '@rspack/dev-middleware';
11
+ import { createConnection } from 'net';
12
+ import type { DevServerClient } from '@rspack/core';
13
+ import type { DevServerHeaders } from '@rspack/core';
14
+ import type { DevServerHost } from '@rspack/core';
15
+ import type { DevServerMiddlewareHandler } from '@rspack/core';
16
+ import type { DevServerOpenOptions } from '@rspack/core';
17
+ import type { DevServerProxyConfigArray } from '@rspack/core';
18
+ import type { DevServerStatic } from '@rspack/core';
19
+ import type { Dirent } from 'node:fs';
20
+ import { Duplex } from 'stream';
21
+ import { EventEmitter } from 'node:events';
22
+ import { EventEmitter as EventEmitter_2 } from 'events';
23
+ import * as http from 'node:http';
24
+ import type { IncomingMessage as IncomingMessage_2 } from 'node:http';
25
+ import { IncomingMessage as IncomingMessage_3 } from 'http';
26
+ import type { ListenOptions } from 'node:net';
27
+ import { MultiCompiler } from '@rspack/core';
28
+ import { MultiStats } from '@rspack/core';
29
+ import { Options } from '@rspack/dev-middleware';
30
+ import { OutgoingHttpHeaders } from 'http';
31
+ import { Readable } from 'node:stream';
32
+ import { SecureContextOptions } from 'tls';
33
+ import { Server as Server_2 } from 'node:net';
34
+ import { Server as Server_3 } from 'node:tls';
35
+ import type { Server as Server_4 } from 'node:http';
36
+ import { Server as Server_6 } from 'http';
37
+ import { Server as Server_7 } from 'https';
38
+ import type { ServerOptions } from 'node:https';
39
+ import type { ServerResponse } from 'node:http';
40
+ import { Socket } from 'node:net';
41
+ import { Stats } from 'node:fs';
42
+ import { Stats as Stats_2 } from '@rspack/core';
43
+ import { StatsOptions } from '@rspack/core';
44
+ import { URL as URL_2 } from 'url';
45
+ import type { WatchEventType } from 'node:fs';
46
+ import { ZlibOptions } from 'zlib';
47
+
48
+ declare type AWF = {
49
+ stabilityThreshold: number;
50
+ pollInterval: number;
51
+ };
52
+
53
+ declare type BasicApplication = {
54
+ use: UseFn;
55
+ };
56
+
57
+ declare type BasicOpts = {
58
+ persistent: boolean;
59
+ ignoreInitial: boolean;
60
+ followSymlinks: boolean;
61
+ cwd?: string;
62
+ usePolling: boolean;
63
+ interval: number;
64
+ binaryInterval: number;
65
+ alwaysStat?: boolean;
66
+ depth?: number;
67
+ ignorePermissionErrors: boolean;
68
+ atomic: boolean | number;
69
+ };
70
+
71
+ declare type BasicServer = Server_2 | Server_3;
72
+
73
+ declare type BufferLike =
74
+ | string
75
+ | Buffer
76
+ | DataView
77
+ | number
78
+ | ArrayBufferView
79
+ | Uint8Array
80
+ | ArrayBuffer
81
+ | SharedArrayBuffer
82
+ | Blob
83
+ | readonly any[]
84
+ | readonly number[]
85
+ | { valueOf(): ArrayBuffer }
86
+ | { valueOf(): SharedArrayBuffer }
87
+ | { valueOf(): Uint8Array }
88
+ | { valueOf(): readonly number[] }
89
+ | { valueOf(): string }
90
+ | { [Symbol.toPrimitive](hint: string): string };
91
+
92
+ declare type ChokidarOptions = Partial<BasicOpts & {
93
+ ignored: Matcher | Matcher[];
94
+ awaitWriteFinish: boolean | Partial<AWF>;
95
+ }>;
96
+
97
+ declare type ClientConnection = WebSocket_2 & {
98
+ isAlive?: boolean;
99
+ };
100
+
101
+ export { Configuration }
102
+
103
+ declare interface Configuration_2<A extends BasicApplication = Server, S extends BasicServer = Server_4> {
104
+ ipc?: boolean | string;
105
+ host?: DevServerHost;
106
+ port?: Port;
107
+ hot?: boolean | 'only';
108
+ liveReload?: boolean;
109
+ devMiddleware?: DevMiddlewareOptions<Request_2, Response_2>;
110
+ compress?: boolean;
111
+ allowedHosts?: LiteralUnion<'auto' | 'all', string> | string[];
112
+ historyApiFallback?: boolean | ConnectHistoryApiFallbackOptions;
113
+ watchFiles?: string | string[] | WatchFiles | Array<string | WatchFiles>;
114
+ static?: DevServerStatic;
115
+ server?: ServerType<A, S> | ServerConfiguration<A, S>;
116
+ app?: () => Promise<A>;
117
+ webSocketServer?: boolean | LiteralUnion<'ws', string> | WebSocketServerConfiguration;
118
+ proxy?: DevServerProxyConfigArray;
119
+ open?: boolean | string | Open | Array<string | Open>;
120
+ setupExitSignals?: boolean;
121
+ client?: boolean | DevServerClient;
122
+ headers?: DevServerHeaders | ((req: Request_2, res: Response_2, context: DevMiddlewareContext<Request_2, Response_2> | undefined) => DevServerHeaders);
123
+ onListening?: (devServer: RspackDevServer<A, S>) => void;
124
+ setupMiddlewares?: (middlewares: Middleware[], devServer: RspackDevServer<A, S>) => Middleware[];
125
+ }
126
+
127
+ declare type ConnectHistoryApiFallbackOptions = Exclude<NonNullable<Configuration['historyApiFallback']>, boolean>;
128
+
129
+ declare type DevMiddlewareContext<T extends Request_2, U extends Response_2> = Context<T, U>;
130
+
131
+ declare type DevMiddlewareOptions<T extends Request_2, U extends Response_2> = Options<T, U>;
132
+
133
+ /** Directory entry. Contains path, depth count, and files. */
134
+ declare interface DirEntry {
135
+ files: PathOrDirent[];
136
+ depth: number;
137
+ path: Path_2;
138
+ }
139
+
140
+ /**
141
+ * Directory entry.
142
+ */
143
+ declare class DirEntry_2 {
144
+ path: Path;
145
+ _removeWatcher: (dir: string, base: string) => void;
146
+ items: Set<Path>;
147
+ constructor(dir: Path, removeWatcher: (dir: string, base: string) => void);
148
+ add(item: string): void;
149
+ remove(item: string): Promise<void>;
150
+ has(item: string): boolean | undefined;
151
+ getChildren(): string[];
152
+ dispose(): void;
153
+ }
154
+
155
+ declare type EmitArgs = [path: Path, stats?: Stats];
156
+
157
+ declare type EmitArgsWithName = [event: EventName, ...EmitArgs];
158
+
159
+ /** Emitted entry. Contains relative & absolute path, basename, and either stats or dirent. */
160
+ declare interface EntryInfo {
161
+ path: string;
162
+ fullPath: string;
163
+ stats?: Stats;
164
+ dirent?: Dirent;
165
+ basename: string;
166
+ }
167
+
168
+ declare type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes];
169
+
170
+ declare const EntryTypes: {
171
+ readonly FILE_TYPE: "files";
172
+ readonly DIR_TYPE: "directories";
173
+ readonly FILE_DIR_TYPE: "files_directories";
174
+ readonly EVERYTHING_TYPE: "all";
175
+ };
176
+
177
+ declare type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
178
+
179
+ declare type EventName = (typeof EVENTS)[keyof typeof EVENTS];
180
+
181
+ declare const EVENTS: {
182
+ readonly ALL: "all";
183
+ readonly READY: "ready";
184
+ readonly ADD: "add";
185
+ readonly CHANGE: "change";
186
+ readonly ADD_DIR: "addDir";
187
+ readonly UNLINK: "unlink";
188
+ readonly UNLINK_DIR: "unlinkDir";
189
+ readonly RAW: "raw";
190
+ readonly ERROR: "error";
191
+ };
192
+
193
+ declare type EXPECTED_ANY = any;
194
+
195
+ /**
196
+ * Watches files & directories for changes. Emitted events:
197
+ * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error`
198
+ *
199
+ * new FSWatcher()
200
+ * .add(directories)
201
+ * .on('add', path => log('File', path, 'was added'))
202
+ */
203
+ declare class FSWatcher extends EventEmitter<FSWatcherEventMap> {
204
+ closed: boolean;
205
+ options: FSWInstanceOptions;
206
+ _closers: Map<string, Array<any>>;
207
+ _ignoredPaths: Set<Matcher>;
208
+ _throttled: Map<ThrottleType, Map<any, any>>;
209
+ _streams: Set<ReaddirpStream>;
210
+ _symlinkPaths: Map<Path, string | boolean>;
211
+ _watched: Map<string, DirEntry_2>;
212
+ _pendingWrites: Map<string, any>;
213
+ _pendingUnlinks: Map<string, EmitArgsWithName>;
214
+ _readyCount: number;
215
+ _emitReady: () => void;
216
+ _closePromise?: Promise<void>;
217
+ _userIgnored?: MatchFunction;
218
+ _readyEmitted: boolean;
219
+ _emitRaw: WatchHandlers['rawEmitter'];
220
+ _boundRemove: (dir: string, item: string) => void;
221
+ _nodeFsHandler: NodeFsHandler;
222
+ constructor(_opts?: ChokidarOptions);
223
+ _addIgnoredPath(matcher: Matcher): void;
224
+ _removeIgnoredPath(matcher: Matcher): void;
225
+ /**
226
+ * Adds paths to be watched on an existing FSWatcher instance.
227
+ * @param paths_ file or file list. Other arguments are unused
228
+ */
229
+ add(paths_: Path | Path[], _origAdd?: string, _internal?: boolean): FSWatcher;
230
+ /**
231
+ * Close watchers or start ignoring events from specified paths.
232
+ */
233
+ unwatch(paths_: Path | Path[]): FSWatcher;
234
+ /**
235
+ * Close watchers and remove all listeners from watched paths.
236
+ */
237
+ close(): Promise<void>;
238
+ /**
239
+ * Expose list of watched paths
240
+ * @returns for chaining
241
+ */
242
+ getWatched(): Record<string, string[]>;
243
+ emitWithAll(event: EventName, args: EmitArgs): void;
244
+ /**
245
+ * Normalize and emit events.
246
+ * Calling _emit DOES NOT MEAN emit() would be called!
247
+ * @param event Type of event
248
+ * @param path File or directory path
249
+ * @param stats arguments to be passed with event
250
+ * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
251
+ */
252
+ _emit(event: EventName, path: Path, stats?: Stats): Promise<this | undefined>;
253
+ /**
254
+ * Common handler for errors
255
+ * @returns The error if defined, otherwise the value of the FSWatcher instance's `closed` flag
256
+ */
257
+ _handleError(error: Error): Error | boolean;
258
+ /**
259
+ * Helper utility for throttling
260
+ * @param actionType type being throttled
261
+ * @param path being acted upon
262
+ * @param timeout duration of time to suppress duplicate actions
263
+ * @returns tracking object or false if action should be suppressed
264
+ */
265
+ _throttle(actionType: ThrottleType, path: Path, timeout: number): Throttler | false;
266
+ _incrReadyCount(): number;
267
+ /**
268
+ * Awaits write operation to finish.
269
+ * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback.
270
+ * @param path being acted upon
271
+ * @param threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished
272
+ * @param event
273
+ * @param awfEmit Callback to be called when ready for event to be emitted.
274
+ */
275
+ _awaitWriteFinish(path: Path, threshold: number, event: EventName, awfEmit: (err?: Error, stat?: Stats) => void): void;
276
+ /**
277
+ * Determines whether user has asked to ignore this path.
278
+ */
279
+ _isIgnored(path: Path, stats?: Stats): boolean;
280
+ _isntIgnored(path: Path, stat?: Stats): boolean;
281
+ /**
282
+ * Provides a set of common helpers and properties relating to symlink handling.
283
+ * @param path file or directory pattern being watched
284
+ */
285
+ _getWatchHelpers(path: Path): WatchHelper;
286
+ /**
287
+ * Provides directory tracking objects
288
+ * @param directory path of the directory
289
+ */
290
+ _getWatchedDir(directory: string): DirEntry_2;
291
+ /**
292
+ * Check for read permissions: https://stackoverflow.com/a/11781404/1358405
293
+ */
294
+ _hasReadPermissions(stats: Stats): boolean;
295
+ /**
296
+ * Handles emitting unlink events for
297
+ * files and directories, and via recursion, for
298
+ * files and directories within directories that are unlinked
299
+ * @param directory within which the following item is located
300
+ * @param item base path of item/directory
301
+ */
302
+ _remove(directory: string, item: string, isDirectory?: boolean): void;
303
+ /**
304
+ * Closes all watchers for a path
305
+ */
306
+ _closePath(path: Path): void;
307
+ /**
308
+ * Closes only file-specific watchers
309
+ */
310
+ _closeFile(path: Path): void;
311
+ _addPathCloser(path: Path, closer: () => void): void;
312
+ _readdirp(root: Path, opts?: Partial<ReaddirpOptions>): ReaddirpStream | undefined;
313
+ }
314
+
315
+ declare interface FSWatcherEventMap {
316
+ [EVENTS.READY]: [];
317
+ [EVENTS.RAW]: Parameters<WatchHandlers['rawEmitter']>;
318
+ [EVENTS.ERROR]: Parameters<WatchHandlers['errHandler']>;
319
+ [EVENTS.ALL]: [event: EventName, ...EmitArgs];
320
+ [EVENTS.ADD]: EmitArgs;
321
+ [EVENTS.CHANGE]: EmitArgs;
322
+ [EVENTS.ADD_DIR]: EmitArgs;
323
+ [EVENTS.UNLINK]: EmitArgs;
324
+ [EVENTS.UNLINK_DIR]: EmitArgs;
325
+ }
326
+
327
+ declare type FSWInstanceOptions = BasicOpts & {
328
+ ignored: Matcher[];
329
+ awaitWriteFinish: false | AWF;
330
+ };
331
+
332
+ declare type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
333
+
334
+ /**
335
+ * Public and internal Connect types.
336
+ */
337
+ declare interface IncomingMessage extends http.IncomingMessage {
338
+ originalUrl?: http.IncomingMessage['url'] | undefined;
339
+ }
340
+
341
+ /** https://github.com/microsoft/TypeScript/issues/29729 */
342
+ declare type LiteralUnion<T extends U, U> = T | (U & Record<never, never>);
343
+
344
+ declare type Matcher = string | RegExp | MatchFunction | MatcherObject;
345
+
346
+ declare interface MatcherObject {
347
+ path: string;
348
+ recursive?: boolean;
349
+ }
350
+
351
+ declare type MatchFunction = (val: string, stats?: Stats) => boolean;
352
+
353
+ declare type Middleware = MiddlewareObject | DevServerMiddlewareHandler | ErrorHandleFunction;
354
+
355
+ declare interface MiddlewareObject {
356
+ name?: string;
357
+ path?: string;
358
+ middleware: DevServerMiddlewareHandler | ErrorHandleFunction;
359
+ }
360
+
361
+ declare type NextFunction = (err?: any) => void;
362
+
363
+ declare type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
364
+
365
+ /**
366
+ * @mixin
367
+ */
368
+ declare class NodeFsHandler {
369
+ fsw: FSWatcher;
370
+ _boundHandleError: (error: unknown) => void;
371
+ constructor(fsW: FSWatcher);
372
+ /**
373
+ * Watch file for changes with fs_watchFile or fs_watch.
374
+ * @param path to file or dir
375
+ * @param listener on fs change
376
+ * @returns closer for the watcher instance
377
+ */
378
+ _watchWithNodeFs(path: string, listener: (path: string, newStats?: any) => void | Promise<void>): (() => void) | undefined;
379
+ /**
380
+ * Watch a file and emit add event if warranted.
381
+ * @returns closer for the watcher instance
382
+ */
383
+ _handleFile(file: Path, stats: Stats, initialAdd: boolean): (() => void) | undefined;
384
+ /**
385
+ * Handle symlinks encountered while reading a dir.
386
+ * @param entry returned by readdirp
387
+ * @param directory path of dir being read
388
+ * @param path of this item
389
+ * @param item basename of this item
390
+ * @returns true if no more processing is needed for this entry.
391
+ */
392
+ _handleSymlink(entry: EntryInfo, directory: string, path: Path, item: string): Promise<boolean | undefined>;
393
+ _handleRead(directory: string, initialAdd: boolean, wh: WatchHelper, target: Path | undefined, dir: Path, depth: number, throttler: Throttler): Promise<unknown> | undefined;
394
+ /**
395
+ * Read directory to add / remove files from `@watched` list and re-read it on change.
396
+ * @param dir fs path
397
+ * @param stats
398
+ * @param initialAdd
399
+ * @param depth relative to user-supplied path
400
+ * @param target child path targeted for watch
401
+ * @param wh Common watch helpers for this path
402
+ * @param realpath
403
+ * @returns closer for the watcher instance.
404
+ */
405
+ _handleDir(dir: string, stats: Stats, initialAdd: boolean, depth: number, target: string | undefined, wh: WatchHelper, realpath: string): Promise<(() => void) | undefined>;
406
+ /**
407
+ * Handle added file, directory, or glob pattern.
408
+ * Delegates call to _handleFile / _handleDir after checks.
409
+ * @param path to file or ir
410
+ * @param initialAdd was the file added at watch instantiation?
411
+ * @param priorWh depth relative to user-supplied path
412
+ * @param depth Child path actually targeted for watch
413
+ * @param target Child path actually targeted for watch
414
+ */
415
+ _addToNodeFs(path: string, initialAdd: boolean, priorWh: WatchHelper | undefined, depth: number, target?: string): Promise<string | false | undefined>;
416
+ }
417
+
418
+ declare type Open = DevServerOpenOptions & {
419
+ target?: string | string[];
420
+ };
421
+
422
+ declare type Path = string;
423
+
424
+ /** Path in file system. */
425
+ declare type Path_2 = string;
426
+
427
+ /** Path or dir entries (files) */
428
+ declare type PathOrDirent = Dirent | Path_2;
429
+
430
+ declare type Port = number | LiteralUnion<'auto', string>;
431
+
432
+ declare type Predicate = string[] | string | Tester;
433
+
434
+ /**
435
+ * Options for readdirp.
436
+ * * type: files, directories, or both
437
+ * * lstat: whether to use symlink-friendly stat
438
+ * * depth: max depth
439
+ * * alwaysStat: whether to use stat (more resources) or dirent
440
+ * * highWaterMark: streaming param, specifies max amount of resources per entry
441
+ */
442
+ declare type ReaddirpOptions = {
443
+ root: string;
444
+ fileFilter?: Predicate;
445
+ directoryFilter?: Predicate;
446
+ type?: EntryType;
447
+ lstat?: boolean;
448
+ depth?: number;
449
+ alwaysStat?: boolean;
450
+ highWaterMark?: number;
451
+ };
452
+
453
+ /** Readable readdir stream, emitting new files as they're being listed. */
454
+ declare class ReaddirpStream extends Readable {
455
+ parents: any[];
456
+ reading: boolean;
457
+ parent?: DirEntry;
458
+ _stat: Function;
459
+ _maxDepth: number;
460
+ _wantsDir: boolean;
461
+ _wantsFile: boolean;
462
+ _wantsEverything: boolean;
463
+ _root: Path_2;
464
+ _isDirent: boolean;
465
+ _statsProp: 'dirent' | 'stats';
466
+ _rdOptions: {
467
+ encoding: 'utf8';
468
+ withFileTypes: boolean;
469
+ };
470
+ _fileFilter: Tester;
471
+ _directoryFilter: Tester;
472
+ constructor(options?: Partial<ReaddirpOptions>);
473
+ _read(batch: number): Promise<void>;
474
+ _exploreDir(path: Path_2, depth: number): Promise<{
475
+ files: string[] | undefined;
476
+ depth: number;
477
+ path: string;
478
+ }>;
479
+ _formatEntry(dirent: PathOrDirent, path: Path_2): Promise<EntryInfo | undefined>;
480
+ _onError(err: Error): void;
481
+ _getEntryType(entry: EntryInfo): Promise<void | '' | 'file' | 'directory'>;
482
+ _includeAsFile(entry: EntryInfo): boolean | undefined;
483
+ }
484
+
485
+ declare type Request_2<T extends BasicApplication = Server> = T extends Server ? IncomingMessage : IncomingMessage_2;
486
+
487
+ declare type Response_2 = ServerResponse;
488
+
489
+ export declare class RspackDevServer<A extends BasicApplication = Server, S extends BasicServer = Server_4> {
490
+ #private;
491
+ compiler: Compiler | MultiCompiler;
492
+ logger: ReturnType<Compiler['getInfrastructureLogger']>;
493
+ options: Configuration_2<A, S>;
494
+ staticWatchers: FSWatcher[];
495
+ listeners: {
496
+ name: string | symbol;
497
+ listener: (...args: EXPECTED_ANY[]) => void;
498
+ }[];
499
+ webSocketProxies: NextHandleFunction[];
500
+ sockets: Socket[];
501
+ currentHash: string | undefined;
502
+ isTlsServer: boolean;
503
+ webSocketServer: WebSocketServerImplementation | null | undefined;
504
+ middleware: API<Request_2, Response_2> | undefined;
505
+ server: S | undefined;
506
+ app: A | undefined;
507
+ stats: Stats_2 | MultiStats | undefined;
508
+ constructor(options: Configuration, compiler: Compiler | MultiCompiler);
509
+ static get DEFAULT_STATS(): StatsOptions;
510
+ static isAbsoluteURL(URL: string): boolean;
511
+ static findIp(gatewayOrFamily: string, isInternal: boolean): string | undefined;
512
+ static getHostname(hostname: DevServerHost): Promise<string>;
513
+ static getFreePort(port: string, host: string): Promise<string | number>;
514
+ static findCacheDir(): string;
515
+ getClientEntry(): string;
516
+ getClientHotEntry(): string | undefined;
517
+ isValidHost(headers: Record<string, string | undefined>, headerToCheck: string, validateHost?: boolean): boolean;
518
+ sendMessage(clients: ClientConnection[], type: string, data?: EXPECTED_ANY, params?: EXPECTED_ANY): void;
519
+ watchFiles(watchPath: string | string[], watchOptions?: ChokidarOptions): Promise<void>;
520
+ invalidate(callback?: Callback): void;
521
+ start(): Promise<void>;
522
+ startCallback(callback?: (err?: Error) => void): void;
523
+ stop(): Promise<void>;
524
+ stopCallback(callback?: (err?: Error) => void): void;
525
+ }
526
+
527
+ declare interface Server extends EventEmitter {
528
+ (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
529
+ route: string;
530
+ stack: ServerStackItem[];
531
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
532
+ use(fn: NextHandleFunction): Server;
533
+ use(fn: HandleFunction): Server;
534
+ use(fn: http.Server): Server;
535
+ use(route: string, fn: NextHandleFunction): Server;
536
+ use(route: string, fn: HandleFunction): Server;
537
+ use(route: string, fn: http.Server): Server;
538
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
539
+ listen(port: number, hostname?: string, callback?: Function): http.Server;
540
+ listen(path: string, callback?: Function): http.Server;
541
+ listen(options: ListenOptions, callback?: Function): http.Server;
542
+ listen(handle: unknown, listeningListener?: Function): http.Server;
543
+ }
544
+
545
+ declare class Server_5<
546
+ T extends typeof WebSocket_2 = typeof WebSocket_2,
547
+ U extends typeof IncomingMessage_3 = typeof IncomingMessage_3,
548
+ > extends EventEmitter_2 {
549
+ options: WebSocket_2.ServerOptions<T, U>;
550
+ path: string;
551
+ clients: Set<InstanceType<T>>;
552
+
553
+ constructor(options?: WebSocket_2.ServerOptions<T, U>, callback?: () => void);
554
+
555
+ address(): WebSocket_2.AddressInfo | string | null;
556
+ close(cb?: (err?: Error) => void): void;
557
+ handleUpgrade(
558
+ request: InstanceType<U>,
559
+ socket: Duplex,
560
+ upgradeHead: Buffer,
561
+ callback: (client: InstanceType<T>, request: InstanceType<U>) => void,
562
+ ): void;
563
+ shouldHandle(request: InstanceType<U>): boolean | Promise<boolean>;
564
+
565
+ // Events
566
+ on(event: "connection", cb: (this: Server_5<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
567
+ on(event: "error", cb: (this: Server_5<T>, error: Error) => void): this;
568
+ on(event: "headers", cb: (this: Server_5<T>, headers: string[], request: InstanceType<U>) => void): this;
569
+ on(event: "close" | "listening", cb: (this: Server_5<T>) => void): this;
570
+ on(
571
+ event: "wsClientError",
572
+ cb: (this: Server_5<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
573
+ ): this;
574
+ on(event: string | symbol, listener: (this: Server_5<T>, ...args: any[]) => void): this;
575
+
576
+ once(
577
+ event: "connection",
578
+ cb: (this: Server_5<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void,
579
+ ): this;
580
+ once(event: "error", cb: (this: Server_5<T>, error: Error) => void): this;
581
+ once(event: "headers", cb: (this: Server_5<T>, headers: string[], request: InstanceType<U>) => void): this;
582
+ once(event: "close" | "listening", cb: (this: Server_5<T>) => void): this;
583
+ once(
584
+ event: "wsClientError",
585
+ cb: (this: Server_5<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
586
+ ): this;
587
+ once(event: string | symbol, listener: (this: Server_5<T>, ...args: any[]) => void): this;
588
+
589
+ off(event: "connection", cb: (this: Server_5<T>, websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
590
+ off(event: "error", cb: (this: Server_5<T>, error: Error) => void): this;
591
+ off(event: "headers", cb: (this: Server_5<T>, headers: string[], request: InstanceType<U>) => void): this;
592
+ off(event: "close" | "listening", cb: (this: Server_5<T>) => void): this;
593
+ off(
594
+ event: "wsClientError",
595
+ cb: (this: Server_5<T>, error: Error, socket: Duplex, request: InstanceType<U>) => void,
596
+ ): this;
597
+ off(event: string | symbol, listener: (this: Server_5<T>, ...args: any[]) => void): this;
598
+
599
+ addListener(event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
600
+ addListener(event: "error", cb: (error: Error) => void): this;
601
+ addListener(event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): this;
602
+ addListener(event: "close" | "listening", cb: () => void): this;
603
+ addListener(event: "wsClientError", cb: (error: Error, socket: Duplex, request: InstanceType<U>) => void): this;
604
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
605
+
606
+ removeListener(event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): this;
607
+ removeListener(event: "error", cb: (error: Error) => void): this;
608
+ removeListener(event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): this;
609
+ removeListener(event: "close" | "listening", cb: () => void): this;
610
+ removeListener(event: "wsClientError", cb: (error: Error, socket: Duplex, request: InstanceType<U>) => void): this;
611
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
612
+ }
613
+
614
+ declare interface ServerConfiguration<A extends BasicApplication = Server, S extends BasicServer = Server_4> {
615
+ type?: ServerType<A, S>;
616
+ options?: ServerOptions;
617
+ }
618
+
619
+ declare type ServerHandle = HandleFunction | http.Server;
620
+
621
+ declare interface ServerStackItem {
622
+ route: string;
623
+ handle: ServerHandle;
624
+ }
625
+
626
+ declare type ServerType<A extends BasicApplication, S extends BasicServer> = LiteralUnion<'http' | 'https' | 'http2', string> | ((serverOptions: ServerOptions, application: A) => S);
627
+
628
+ declare type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
629
+
630
+ /** Filterer for files */
631
+ declare type Tester = (entryInfo: EntryInfo) => boolean;
632
+
633
+ declare type Throttler = {
634
+ timeoutObject: NodeJS.Timeout;
635
+ clear: () => void;
636
+ count: number;
637
+ };
638
+
639
+ declare type ThrottleType = 'readdir' | 'watch' | 'add' | 'remove' | 'change';
640
+
641
+ declare type UseFn = {
642
+ (fn: NextHandleFunction): BasicApplication;
643
+ (fn: HandleFunction): BasicApplication;
644
+ (route: string, fn: NextHandleFunction): BasicApplication;
645
+ (route: string, fn: HandleFunction): BasicApplication;
646
+ };
647
+
648
+ declare interface WatchFiles {
649
+ paths: string | string[];
650
+ options?: ChokidarOptions & {
651
+ aggregateTimeout?: number;
652
+ poll?: number | boolean;
653
+ };
654
+ }
655
+
656
+ declare interface WatchHandlers {
657
+ listener: (path: string) => void;
658
+ errHandler: (err: unknown) => void;
659
+ rawEmitter: (ev: WatchEventType, path: string, opts: unknown) => void;
660
+ }
661
+
662
+ declare class WatchHelper {
663
+ fsw: FSWatcher;
664
+ path: string;
665
+ watchPath: string;
666
+ fullWatchPath: string;
667
+ dirParts: string[][];
668
+ followSymlinks: boolean;
669
+ statMethod: 'stat' | 'lstat';
670
+ constructor(path: string, follow: boolean, fsw: FSWatcher);
671
+ entryPath(entry: EntryInfo): Path;
672
+ filterPath(entry: EntryInfo): boolean;
673
+ filterDir(entry: EntryInfo): boolean;
674
+ }
675
+
676
+ declare class WebSocket_2 extends EventEmitter_2 {
677
+ /** The connection is not yet open. */
678
+ static readonly CONNECTING: 0;
679
+ /** The connection is open and ready to communicate. */
680
+ static readonly OPEN: 1;
681
+ /** The connection is in the process of closing. */
682
+ static readonly CLOSING: 2;
683
+ /** The connection is closed. */
684
+ static readonly CLOSED: 3;
685
+
686
+ binaryType: "nodebuffer" | "arraybuffer" | "fragments";
687
+ readonly bufferedAmount: number;
688
+ readonly extensions: string;
689
+ /** Indicates whether the websocket is paused */
690
+ readonly isPaused: boolean;
691
+ readonly protocol: string;
692
+ /** The current state of the connection */
693
+ readonly readyState:
694
+ | typeof WebSocket_2.CONNECTING
695
+ | typeof WebSocket_2.OPEN
696
+ | typeof WebSocket_2.CLOSING
697
+ | typeof WebSocket_2.CLOSED;
698
+ readonly url: string;
699
+
700
+ /** The connection is not yet open. */
701
+ readonly CONNECTING: 0;
702
+ /** The connection is open and ready to communicate. */
703
+ readonly OPEN: 1;
704
+ /** The connection is in the process of closing. */
705
+ readonly CLOSING: 2;
706
+ /** The connection is closed. */
707
+ readonly CLOSED: 3;
708
+
709
+ onopen: ((event: WebSocket_2.Event) => void) | null;
710
+ onerror: ((event: WebSocket_2.ErrorEvent) => void) | null;
711
+ onclose: ((event: WebSocket_2.CloseEvent) => void) | null;
712
+ onmessage: ((event: WebSocket_2.MessageEvent) => void) | null;
713
+
714
+ constructor(address: null);
715
+ constructor(address: string | URL_2, options?: WebSocket_2.ClientOptions | ClientRequestArgs);
716
+ constructor(
717
+ address: string | URL_2,
718
+ protocols?: string | string[],
719
+ options?: WebSocket_2.ClientOptions | ClientRequestArgs,
720
+ );
721
+
722
+ close(code?: number, data?: string | Buffer): void;
723
+ ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
724
+ pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
725
+ // https://github.com/websockets/ws/issues/2076#issuecomment-1250354722
726
+ send(data: BufferLike, cb?: (err?: Error) => void): void;
727
+ send(
728
+ data: BufferLike,
729
+ options: {
730
+ mask?: boolean | undefined;
731
+ binary?: boolean | undefined;
732
+ compress?: boolean | undefined;
733
+ fin?: boolean | undefined;
734
+ },
735
+ cb?: (err?: Error) => void,
736
+ ): void;
737
+ terminate(): void;
738
+
739
+ /**
740
+ * Pause the websocket causing it to stop emitting events. Some events can still be
741
+ * emitted after this is called, until all buffered data is consumed. This method
742
+ * is a noop if the ready state is `CONNECTING` or `CLOSED`.
743
+ */
744
+ pause(): void;
745
+ /**
746
+ * Make a paused socket resume emitting events. This method is a noop if the ready
747
+ * state is `CONNECTING` or `CLOSED`.
748
+ */
749
+ resume(): void;
750
+
751
+ // HTML5 WebSocket events
752
+ addEventListener<K extends keyof WebSocket_2.WebSocketEventMap>(
753
+ type: K,
754
+ listener:
755
+ | ((event: WebSocket_2.WebSocketEventMap[K]) => void)
756
+ | { handleEvent(event: WebSocket_2.WebSocketEventMap[K]): void },
757
+ options?: WebSocket_2.EventListenerOptions,
758
+ ): void;
759
+ removeEventListener<K extends keyof WebSocket_2.WebSocketEventMap>(
760
+ type: K,
761
+ listener:
762
+ | ((event: WebSocket_2.WebSocketEventMap[K]) => void)
763
+ | { handleEvent(event: WebSocket_2.WebSocketEventMap[K]): void },
764
+ ): void;
765
+
766
+ // Events
767
+ on(event: "close", listener: (this: WebSocket_2, code: number, reason: Buffer) => void): this;
768
+ on(event: "error", listener: (this: WebSocket_2, error: Error) => void): this;
769
+ on(event: "upgrade", listener: (this: WebSocket_2, request: IncomingMessage_3) => void): this;
770
+ on(event: "message", listener: (this: WebSocket_2, data: WebSocket_2.RawData, isBinary: boolean) => void): this;
771
+ on(event: "open", listener: (this: WebSocket_2) => void): this;
772
+ on(event: "ping" | "pong", listener: (this: WebSocket_2, data: Buffer) => void): this;
773
+ on(event: "redirect", listener: (this: WebSocket_2, url: string, request: ClientRequest) => void): this;
774
+ on(
775
+ event: "unexpected-response",
776
+ listener: (this: WebSocket_2, request: ClientRequest, response: IncomingMessage_3) => void,
777
+ ): this;
778
+ on(event: string | symbol, listener: (this: WebSocket_2, ...args: any[]) => void): this;
779
+
780
+ once(event: "close", listener: (this: WebSocket_2, code: number, reason: Buffer) => void): this;
781
+ once(event: "error", listener: (this: WebSocket_2, error: Error) => void): this;
782
+ once(event: "upgrade", listener: (this: WebSocket_2, request: IncomingMessage_3) => void): this;
783
+ once(event: "message", listener: (this: WebSocket_2, data: WebSocket_2.RawData, isBinary: boolean) => void): this;
784
+ once(event: "open", listener: (this: WebSocket_2) => void): this;
785
+ once(event: "ping" | "pong", listener: (this: WebSocket_2, data: Buffer) => void): this;
786
+ once(event: "redirect", listener: (this: WebSocket_2, url: string, request: ClientRequest) => void): this;
787
+ once(
788
+ event: "unexpected-response",
789
+ listener: (this: WebSocket_2, request: ClientRequest, response: IncomingMessage_3) => void,
790
+ ): this;
791
+ once(event: string | symbol, listener: (this: WebSocket_2, ...args: any[]) => void): this;
792
+
793
+ off(event: "close", listener: (this: WebSocket_2, code: number, reason: Buffer) => void): this;
794
+ off(event: "error", listener: (this: WebSocket_2, error: Error) => void): this;
795
+ off(event: "upgrade", listener: (this: WebSocket_2, request: IncomingMessage_3) => void): this;
796
+ off(event: "message", listener: (this: WebSocket_2, data: WebSocket_2.RawData, isBinary: boolean) => void): this;
797
+ off(event: "open", listener: (this: WebSocket_2) => void): this;
798
+ off(event: "ping" | "pong", listener: (this: WebSocket_2, data: Buffer) => void): this;
799
+ off(event: "redirect", listener: (this: WebSocket_2, url: string, request: ClientRequest) => void): this;
800
+ off(
801
+ event: "unexpected-response",
802
+ listener: (this: WebSocket_2, request: ClientRequest, response: IncomingMessage_3) => void,
803
+ ): this;
804
+ off(event: string | symbol, listener: (this: WebSocket_2, ...args: any[]) => void): this;
805
+
806
+ addListener(event: "close", listener: (code: number, reason: Buffer) => void): this;
807
+ addListener(event: "error", listener: (error: Error) => void): this;
808
+ addListener(event: "upgrade", listener: (request: IncomingMessage_3) => void): this;
809
+ addListener(event: "message", listener: (data: WebSocket_2.RawData, isBinary: boolean) => void): this;
810
+ addListener(event: "open", listener: () => void): this;
811
+ addListener(event: "ping" | "pong", listener: (data: Buffer) => void): this;
812
+ addListener(event: "redirect", listener: (url: string, request: ClientRequest) => void): this;
813
+ addListener(
814
+ event: "unexpected-response",
815
+ listener: (request: ClientRequest, response: IncomingMessage_3) => void,
816
+ ): this;
817
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
818
+
819
+ removeListener(event: "close", listener: (code: number, reason: Buffer) => void): this;
820
+ removeListener(event: "error", listener: (error: Error) => void): this;
821
+ removeListener(event: "upgrade", listener: (request: IncomingMessage_3) => void): this;
822
+ removeListener(event: "message", listener: (data: WebSocket_2.RawData, isBinary: boolean) => void): this;
823
+ removeListener(event: "open", listener: () => void): this;
824
+ removeListener(event: "ping" | "pong", listener: (data: Buffer) => void): this;
825
+ removeListener(event: "redirect", listener: (url: string, request: ClientRequest) => void): this;
826
+ removeListener(
827
+ event: "unexpected-response",
828
+ listener: (request: ClientRequest, response: IncomingMessage_3) => void,
829
+ ): this;
830
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
831
+ }
832
+
833
+ declare namespace WebSocket_2 {
834
+ /**
835
+ * Data represents the raw message payload received over the WebSocket.
836
+ */
837
+ type RawData = Buffer | ArrayBuffer | Buffer[];
838
+
839
+ /**
840
+ * Data represents the message payload received over the WebSocket.
841
+ */
842
+ type Data = string | Buffer | ArrayBuffer | Buffer[];
843
+
844
+ /**
845
+ * CertMeta represents the accepted types for certificate & key data.
846
+ */
847
+ type CertMeta = string | string[] | Buffer | Buffer[];
848
+
849
+ /**
850
+ * VerifyClientCallbackSync is a synchronous callback used to inspect the
851
+ * incoming message. The return value (boolean) of the function determines
852
+ * whether or not to accept the handshake.
853
+ */
854
+ type VerifyClientCallbackSync<Request extends IncomingMessage_3 = IncomingMessage_3> = (info: {
855
+ origin: string;
856
+ secure: boolean;
857
+ req: Request;
858
+ }) => boolean;
859
+
860
+ /**
861
+ * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
862
+ * incoming message. The return value (boolean) of the function determines
863
+ * whether or not to accept the handshake.
864
+ */
865
+ type VerifyClientCallbackAsync<Request extends IncomingMessage_3 = IncomingMessage_3> = (
866
+ info: { origin: string; secure: boolean; req: Request },
867
+ callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void,
868
+ ) => void;
869
+
870
+ /**
871
+ * FinishRequestCallback is a callback for last minute customization of the
872
+ * headers. If finishRequest is set, then it has the responsibility to call
873
+ * request.end() once it is done setting request headers.
874
+ */
875
+ type FinishRequestCallback = (request: ClientRequest, websocket: WebSocket_2) => void;
876
+
877
+ interface ClientOptions extends SecureContextOptions {
878
+ protocol?: string | undefined;
879
+ followRedirects?: boolean | undefined;
880
+ generateMask?(mask: Buffer): void;
881
+ handshakeTimeout?: number | undefined;
882
+ maxRedirects?: number | undefined;
883
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
884
+ localAddress?: string | undefined;
885
+ protocolVersion?: number | undefined;
886
+ headers?: { [key: string]: string } | undefined;
887
+ origin?: string | undefined;
888
+ agent?: Agent | undefined;
889
+ host?: string | undefined;
890
+ family?: number | undefined;
891
+ checkServerIdentity?(servername: string, cert: CertMeta): boolean;
892
+ rejectUnauthorized?: boolean | undefined;
893
+ allowSynchronousEvents?: boolean | undefined;
894
+ autoPong?: boolean | undefined;
895
+ maxPayload?: number | undefined;
896
+ skipUTF8Validation?: boolean | undefined;
897
+ createConnection?: typeof createConnection | undefined;
898
+ finishRequest?: FinishRequestCallback | undefined;
899
+ }
900
+
901
+ interface PerMessageDeflateOptions {
902
+ serverNoContextTakeover?: boolean | undefined;
903
+ clientNoContextTakeover?: boolean | undefined;
904
+ serverMaxWindowBits?: number | undefined;
905
+ clientMaxWindowBits?: number | undefined;
906
+ zlibDeflateOptions?:
907
+ | {
908
+ flush?: number | undefined;
909
+ finishFlush?: number | undefined;
910
+ chunkSize?: number | undefined;
911
+ windowBits?: number | undefined;
912
+ level?: number | undefined;
913
+ memLevel?: number | undefined;
914
+ strategy?: number | undefined;
915
+ dictionary?: Buffer | Buffer[] | DataView | undefined;
916
+ info?: boolean | undefined;
917
+ }
918
+ | undefined;
919
+ zlibInflateOptions?: ZlibOptions | undefined;
920
+ threshold?: number | undefined;
921
+ concurrencyLimit?: number | undefined;
922
+ }
923
+
924
+ interface Event {
925
+ type: string;
926
+ target: WebSocket_2;
927
+ }
928
+
929
+ interface ErrorEvent {
930
+ error: any;
931
+ message: string;
932
+ type: string;
933
+ target: WebSocket_2;
934
+ }
935
+
936
+ interface CloseEvent {
937
+ wasClean: boolean;
938
+ code: number;
939
+ reason: string;
940
+ type: string;
941
+ target: WebSocket_2;
942
+ }
943
+
944
+ interface MessageEvent {
945
+ data: Data;
946
+ type: string;
947
+ target: WebSocket_2;
948
+ }
949
+
950
+ interface WebSocketEventMap {
951
+ open: Event;
952
+ error: ErrorEvent;
953
+ close: CloseEvent;
954
+ message: MessageEvent;
955
+ }
956
+
957
+ interface EventListenerOptions {
958
+ once?: boolean | undefined;
959
+ }
960
+
961
+ interface ServerOptions<
962
+ U extends typeof WebSocket_2 = typeof WebSocket_2,
963
+ V extends typeof IncomingMessage_3 = typeof IncomingMessage_3,
964
+ > {
965
+ host?: string | undefined;
966
+ port?: number | undefined;
967
+ backlog?: number | undefined;
968
+ server?: Server_6<V> | Server_7<V> | undefined;
969
+ verifyClient?:
970
+ | VerifyClientCallbackAsync<InstanceType<V>>
971
+ | VerifyClientCallbackSync<InstanceType<V>>
972
+ | undefined;
973
+ handleProtocols?: (protocols: Set<string>, request: InstanceType<V>) => string | false;
974
+ path?: string | undefined;
975
+ noServer?: boolean | undefined;
976
+ allowSynchronousEvents?: boolean | undefined;
977
+ autoPong?: boolean | undefined;
978
+ clientTracking?: boolean | undefined;
979
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
980
+ maxPayload?: number | undefined;
981
+ skipUTF8Validation?: boolean | undefined;
982
+ WebSocket?: U | undefined;
983
+ }
984
+
985
+ interface AddressInfo {
986
+ address: string;
987
+ family: string;
988
+ port: number;
989
+ }
990
+ }
991
+
992
+ declare type WebSocketServer = WebSocketServer_2;
993
+
994
+ declare const WebSocketServer_2: typeof Server_5;
995
+
996
+ declare interface WebSocketServer_2 extends Server_5 {}
997
+
998
+ declare interface WebSocketServerConfiguration {
999
+ type?: LiteralUnion<'ws', string> | (() => WebSocketServerConfiguration);
1000
+ options?: Record<string, EXPECTED_ANY>;
1001
+ }
1002
+
1003
+ declare interface WebSocketServerImplementation {
1004
+ implementation: WebSocketServer;
1005
+ clients: ClientConnection[];
1006
+ }
1007
+
1008
+ export { }