From ca4d2fcbba55c00581e2f6f48e10ece99aea1c0e Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 16 May 2024 23:26:37 -0700 Subject: [PATCH] A couple fixes to TypeScript types --- packages/bun-types/bun.d.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/bun-types/bun.d.ts b/packages/bun-types/bun.d.ts index fd6da8828e..0ca4cce2a7 100644 --- a/packages/bun-types/bun.d.ts +++ b/packages/bun-types/bun.d.ts @@ -2452,7 +2452,7 @@ declare module "bun" { extends WebSocketServeOptions, TLSOptions { unix?: never; - tls?: TLSOptions | Array; + tls?: TLSOptions | TLSOptions[]; } interface UnixTLSWebSocketServeOptions extends UnixWebSocketServeOptions, @@ -2462,7 +2462,7 @@ declare module "bun" { * (Cannot be used with hostname+port) */ unix: string; - tls?: TLSOptions | Array; + 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; + tls?: TLSOptions | TLSOptions[]; } interface UnixTLSServeOptions extends UnixServeOptions, TLSOptions { - tls?: TLSOptions | Array; + 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. *