|
1 | 1 | /// <reference types="node" /> |
2 | 2 |
|
3 | | -import type { Socket } from 'net'; |
| 3 | +import { Socket } from 'net'; |
4 | 4 |
|
5 | 5 | export declare const allKeyUsages: readonly ["digitalSignature", "nonRepudiation", "keyEncipherment", "dataEncipherment", "keyAgreement", "keyCertSign", "cRLSign", "encipherOnly", "decipherOnly"]; |
6 | 6 |
|
@@ -37,6 +37,7 @@ export declare class Bytes { |
37 | 37 | * * If data is a `function`, this function is called to retrieve data when required |
38 | 38 | */ |
39 | 39 | constructor(data?: Uint8Array | number | ((bytes: number) => Promise<Uint8Array | undefined>), indent?: number); |
| 40 | + changeIndent(indentDelta: number): void; |
40 | 41 | readRemaining(): number; |
41 | 42 | resizeTo(newSize: number): void; |
42 | 43 | ensureReadAvailable(bytes: number): Promise<void>; |
@@ -185,11 +186,11 @@ export declare function getRootCertsDatabase(): Promise<{ |
185 | 186 |
|
186 | 187 | export declare function hexFromU8(u8: Uint8Array | number[], spacer?: string): string; |
187 | 188 |
|
188 | | -export declare function https(urlStr: string, method: string, transportFactory: typeof wsTransport | typeof tcpTransport, rootCertsPromise: ReturnType<typeof getRootCertsDatabase>, { headers, httpVersion, socketOptions, }?: HTTPSOptions): Promise<string>; |
| 189 | +export declare function https(urlStr: string, method: string, transportFactory: typeof wsTransport | typeof tcpTransport, rootCertsPromise: ReturnType<typeof getRootCertsDatabase>, { headers, protocols, socketOptions, }?: HTTPSOptions): Promise<string>; |
189 | 190 |
|
190 | 191 | export declare interface HTTPSOptions { |
191 | 192 | headers?: Record<string, string>; |
192 | | - httpVersion?: string; |
| 193 | + protocols?: string[]; |
193 | 194 | socketOptions?: SocketOptions | WebSocketOptions; |
194 | 195 | } |
195 | 196 |
|
@@ -258,15 +259,18 @@ export declare function startTls(host: string, rootCertsDatabase: RootCertsDatab |
258 | 259 | }): Promise<{ |
259 | 260 | readonly read: () => Promise<Uint8Array<ArrayBufferLike> | undefined>; |
260 | 261 | readonly write: (data: Uint8Array) => Promise<void>; |
| 262 | + readonly end: () => Promise<void>; |
261 | 263 | readonly userCert: Cert; |
| 264 | + readonly protocolFromALPN: string | undefined; |
262 | 265 | }>; |
263 | 266 |
|
264 | | -export declare function tcpTransport(host: string, port: string | number, { close, timeout, error }: SocketOptions): Promise<{ |
| 267 | +export declare function tcpTransport(host: string, port: string | number, opts: SocketOptions): Promise<{ |
265 | 268 | read: (bytes: number, readMode?: ReadMode) => Promise<Uint8Array<ArrayBufferLike> | undefined>; |
266 | 269 | write: { |
267 | 270 | (buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; |
268 | 271 | (str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; |
269 | 272 | }; |
| 273 | + end: () => Socket; |
270 | 274 | stats: { |
271 | 275 | read: number; |
272 | 276 | written: number; |
@@ -305,9 +309,10 @@ export declare class WebSocketReadQueue extends ReadQueue { |
305 | 309 | moreDataMayFollow(): boolean; |
306 | 310 | } |
307 | 311 |
|
308 | | -export declare function wsTransport(host: string, port: string | number, { close }: WebSocketOptions): Promise<{ |
| 312 | +export declare function wsTransport(host: string, port: string | number, opts: WebSocketOptions): Promise<{ |
309 | 313 | read: (bytes: number, readMode?: ReadMode) => Promise<Uint8Array<ArrayBufferLike> | undefined>; |
310 | 314 | write: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void; |
| 315 | + end: (code?: number, reason?: string) => void; |
311 | 316 | stats: { |
312 | 317 | read: number; |
313 | 318 | written: number; |
|
0 commit comments