@@ -136,7 +136,7 @@ declare class Server {
136
136
* @property {string} [username]
137
137
*/
138
138
/**
139
- * @typedef {boolean | ((error: unknown ) => void)} OverlayMessageOptions
139
+ * @typedef {boolean | ((error: Error ) => void)} OverlayMessageOptions
140
140
*/
141
141
/**
142
142
* @typedef {Object} ClientConfiguration
@@ -316,7 +316,7 @@ declare class Server {
316
316
* @property {string} [username]
317
317
*/
318
318
/**
319
- * @typedef {boolean | ((error: unknown ) => void)} OverlayMessageOptions
319
+ * @typedef {boolean | ((error: Error ) => void)} OverlayMessageOptions
320
320
*/
321
321
/**
322
322
* @typedef {Object} ClientConfiguration
@@ -445,7 +445,7 @@ declare class Server {
445
445
* @property {string} [username]
446
446
*/
447
447
/**
448
- * @typedef {boolean | ((error: unknown ) => void)} OverlayMessageOptions
448
+ * @typedef {boolean | ((error: Error ) => void)} OverlayMessageOptions
449
449
*/
450
450
/**
451
451
* @typedef {Object} ClientConfiguration
@@ -516,6 +516,41 @@ declare class Server {
516
516
type: string;
517
517
multiple: boolean;
518
518
description: string;
519
+ /**
520
+ * @typedef {Array<{ key: string; value: string }> | Record<string, string | string[]>} Headers
521
+ */
522
+ /**
523
+ * @typedef {{ name?: string, path?: string, middleware: ExpressRequestHandler | ExpressErrorRequestHandler } | ExpressRequestHandler | ExpressErrorRequestHandler} Middleware
524
+ */
525
+ /**
526
+ * @typedef {Object} Configuration
527
+ * @property {boolean | string} [ipc]
528
+ * @property {Host} [host]
529
+ * @property {Port} [port]
530
+ * @property {boolean | "only"} [hot]
531
+ * @property {boolean} [liveReload]
532
+ * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
533
+ * @property {boolean} [compress]
534
+ * @property {boolean} [magicHtml]
535
+ * @property {"auto" | "all" | string | string[]} [allowedHosts]
536
+ * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
537
+ * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
538
+ * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
539
+ * @property {boolean | string | Static | Array<string | Static>} [static]
540
+ * @property {boolean | ServerOptions} [https]
541
+ * @property {boolean} [http2]
542
+ * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
543
+ * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
544
+ * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
545
+ * @property {boolean | string | Open | Array<string | Open>} [open]
546
+ * @property {boolean} [setupExitSignals]
547
+ * @property {boolean | ClientConfiguration} [client]
548
+ * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
549
+ * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
550
+ * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
551
+ * @property {(devServer: Server) => void} [onListening]
552
+ * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
553
+ */
519
554
negatedDescription: string;
520
555
path: string;
521
556
}
@@ -623,10 +658,6 @@ declare class Server {
623
658
)[];
624
659
description: string;
625
660
multiple: boolean;
626
- /**
627
- * @param {string} URL
628
- * @returns {boolean}
629
- */
630
661
simpleType: string;
631
662
};
632
663
"client-web-socket-url-username": {
@@ -684,6 +715,11 @@ declare class Server {
684
715
simpleType: string;
685
716
multiple: boolean;
686
717
};
718
+ /**
719
+ * @param {Port} port
720
+ * @param {string} host
721
+ * @returns {Promise<number | string>}
722
+ */
687
723
hot: {
688
724
configs: (
689
725
| {
@@ -785,7 +821,6 @@ declare class Server {
785
821
multiple: boolean;
786
822
};
787
823
"https-cert-reset": {
788
- /** @type {string} */
789
824
configs: {
790
825
description: string;
791
826
multiple: boolean;
@@ -981,6 +1016,10 @@ declare class Server {
981
1016
description: string;
982
1017
simpleType: string;
983
1018
multiple: boolean;
1019
+ /**
1020
+ * @private
1021
+ * @returns {Promise<void>}
1022
+ */
984
1023
};
985
1024
"open-reset": {
986
1025
configs: {
@@ -1225,7 +1264,7 @@ declare class Server {
1225
1264
"static-directory": {
1226
1265
configs: {
1227
1266
type: string;
1228
- /** @type {Array<keyof ServerOptions>} */ multiple: boolean;
1267
+ multiple: boolean;
1229
1268
description: string;
1230
1269
path: string;
1231
1270
}[];
@@ -1556,7 +1595,7 @@ declare class Server {
1556
1595
* @property {string} [username]
1557
1596
*/
1558
1597
/**
1559
- * @typedef {boolean | ((error: unknown ) => void)} OverlayMessageOptions
1598
+ * @typedef {boolean | ((error: Error ) => void)} OverlayMessageOptions
1560
1599
*/
1561
1600
/**
1562
1601
* @typedef {Object} ClientConfiguration
@@ -1716,7 +1755,7 @@ declare class Server {
1716
1755
* @property {string} [username]
1717
1756
*/
1718
1757
/**
1719
- * @typedef {boolean | ((error: unknown ) => void)} OverlayMessageOptions
1758
+ * @typedef {boolean | ((error: Error ) => void)} OverlayMessageOptions
1720
1759
*/
1721
1760
/**
1722
1761
* @typedef {Object} ClientConfiguration
@@ -1819,6 +1858,35 @@ declare class Server {
1819
1858
description: string;
1820
1859
link: string;
1821
1860
};
1861
+ /**
1862
+ * @typedef {Object} Configuration
1863
+ * @property {boolean | string} [ipc]
1864
+ * @property {Host} [host]
1865
+ * @property {Port} [port]
1866
+ * @property {boolean | "only"} [hot]
1867
+ * @property {boolean} [liveReload]
1868
+ * @property {DevMiddlewareOptions<Request, Response>} [devMiddleware]
1869
+ * @property {boolean} [compress]
1870
+ * @property {boolean} [magicHtml]
1871
+ * @property {"auto" | "all" | string | string[]} [allowedHosts]
1872
+ * @property {boolean | ConnectHistoryApiFallbackOptions} [historyApiFallback]
1873
+ * @property {boolean | Record<string, never> | BonjourOptions} [bonjour]
1874
+ * @property {string | string[] | WatchFiles | Array<string | WatchFiles>} [watchFiles]
1875
+ * @property {boolean | string | Static | Array<string | Static>} [static]
1876
+ * @property {boolean | ServerOptions} [https]
1877
+ * @property {boolean} [http2]
1878
+ * @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
1879
+ * @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
1880
+ * @property {ProxyConfigMap | ProxyConfigArrayItem | ProxyConfigArray} [proxy]
1881
+ * @property {boolean | string | Open | Array<string | Open>} [open]
1882
+ * @property {boolean} [setupExitSignals]
1883
+ * @property {boolean | ClientConfiguration} [client]
1884
+ * @property {Headers | ((req: Request, res: Response, context: DevMiddlewareContext<Request, Response>) => Headers)} [headers]
1885
+ * @property {(devServer: Server) => void} [onAfterSetupMiddleware]
1886
+ * @property {(devServer: Server) => void} [onBeforeSetupMiddleware]
1887
+ * @property {(devServer: Server) => void} [onListening]
1888
+ * @property {(middlewares: Middleware[], devServer: Server) => Middleware[]} [setupMiddlewares]
1889
+ */
1822
1890
ClientWebSocketTransportEnum: {
1823
1891
enum: string[];
1824
1892
};
@@ -1940,6 +2008,10 @@ declare class Server {
1940
2008
ca: {
1941
2009
anyOf: (
1942
2010
| {
2011
+ /**
2012
+ * @param {string} URL
2013
+ * @returns {boolean}
2014
+ */
1943
2015
type: string;
1944
2016
items: {
1945
2017
anyOf: (
@@ -2158,6 +2230,7 @@ declare class Server {
2158
2230
};
2159
2231
};
2160
2232
cli: {
2233
+ /** @type {ClientConfiguration} */
2161
2234
exclude: boolean;
2162
2235
};
2163
2236
};
@@ -2511,6 +2584,10 @@ declare class Server {
2511
2584
type?: undefined;
2512
2585
}
2513
2586
)[];
2587
+ /**
2588
+ * @private
2589
+ * @returns {Promise<void>}
2590
+ */
2514
2591
};
2515
2592
instanceof?: undefined;
2516
2593
}
@@ -2901,7 +2978,7 @@ declare class Server {
2901
2978
}
2902
2979
)[];
2903
2980
cli: {
2904
- description: string;
2981
+ description: string /** @type {Array<keyof ServerOptions>} */ ;
2905
2982
} /** @type {Array<keyof ServerOptions>} */;
2906
2983
};
2907
2984
WebSocketServerFunction: {
@@ -3592,7 +3669,7 @@ type WebSocketURL = {
3592
3669
protocol?: string | undefined;
3593
3670
username?: string | undefined;
3594
3671
};
3595
- type OverlayMessageOptions = boolean | ((error: unknown ) => void);
3672
+ type OverlayMessageOptions = boolean | ((error: Error ) => void);
3596
3673
type ClientConfiguration = {
3597
3674
logging?: "none" | "error" | "warn" | "info" | "log" | "verbose" | undefined;
3598
3675
overlay?:
0 commit comments