A couple fixes to TypeScript types

This commit is contained in:
Jarred Sumner
2024-05-16 23:26:37 -07:00
parent c7d7bc120a
commit ca4d2fcbba

View File

@@ -2452,7 +2452,7 @@ declare module "bun" {
extends WebSocketServeOptions<WebSocketDataType>,
TLSOptions {
unix?: never;
tls?: TLSOptions | Array<TLSOptions>;
tls?: TLSOptions | TLSOptions[];
}
interface UnixTLSWebSocketServeOptions<WebSocketDataType = undefined>
extends UnixWebSocketServeOptions<WebSocketDataType>,
@@ -2462,7 +2462,7 @@ declare module "bun" {
* (Cannot be used with hostname+port)
*/
unix: string;
tls?: TLSOptions | Array<TLSOptions>;
tls?: TLSOptions | TLSOptions[];
}
interface ErrorLike extends Error {
code?: string;
@@ -2493,6 +2493,19 @@ declare module "bun" {
*/
lowMemoryMode?: boolean;
/**
* If set to `false`, any certificate is accepted.
* Default is `$NODE_TLS_REJECT_UNAUTHORIZED` environment variable, or `true` if it is not set.
*/
rejectUnauthorized?: boolean;
/**
* If set to `true`, the server will request a client certificate.
*
* Default is `false`.
*/
requestCert?: boolean;
/**
* Optionally override the trusted CA certificates. Default is to trust
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
@@ -2531,11 +2544,11 @@ declare module "bun" {
}
interface TLSServeOptions extends ServeOptions, TLSOptions {
tls?: TLSOptions | Array<TLSOptions>;
tls?: TLSOptions | TLSOptions[];
}
interface UnixTLSServeOptions extends UnixServeOptions, TLSOptions {
tls?: TLSOptions | Array<TLSOptions>;
tls?: TLSOptions | TLSOptions[];
}
interface SocketAddress {
@@ -2564,7 +2577,7 @@ declare module "bun" {
*
* Powered by a fork of [uWebSockets](https://github.com/uNetworking/uWebSockets). Thank you @alexhultman.
*/
interface Server {
interface Server extends Disposable {
/**
* Stop listening to prevent new connections from being accepted.
*