BREAKING(dts): improve types for Deno.serve (#25369)

This significantly simplifies the types for `Deno.serve`.

The following types become generic over the address type:
- ServeHandlerInfo
- ServeHandler
- ServeOptions
- ServeInit

The following types are removed entirely:
- ServeTlsOptions
- ServeUnixOptions
- ServeUnixHandlerInfo
- ServeUnixHandler
This commit is contained in:
Luca Casonato 2024-09-03 11:09:40 +02:00 committed by GitHub
parent 1a82b0f808
commit 90338eff8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 47 additions and 209 deletions

View file

@ -10,18 +10,6 @@
declare namespace Deno {
export {}; // stop default export type behavior
/** Information for a HTTP request.
*
* @category HTTP Server
* @experimental
*/
export interface ServeHandlerInfo {
/** The remote address of the connection. */
remoteAddr: Deno.NetAddr;
/** The completion promise */
completed: Promise<void>;
}
/** **UNSTABLE**: New API, yet to be vetted.
*
* Retrieve the process umask. If `mask` is provided, sets the process umask.