@@ -44,14 +44,65 @@ const {
4444} = require ( '_http_server' ) ;
4545let maxHeaderSize ;
4646
47+ /**
48+ * Returns a new instance of `http.Server`.
49+ * @param {{
50+ * IncomingMessage?: IncomingMessage;
51+ * ServerResponse?: ServerResponse;
52+ * insecureHTTPParser?: boolean;
53+ * maxHeaderSize?: number;
54+ * }} [opts]
55+ * @param {Function } [requestListener]
56+ * @returns {Server }
57+ */
4758function createServer ( opts , requestListener ) {
4859 return new Server ( opts , requestListener ) ;
4960}
5061
62+ /**
63+ * @typedef {Object } HTTPRequestOptions
64+ * @property {httpAgent.Agent | boolean } [agent]
65+ * @property {string } [auth]
66+ * @property {Function } [createConnection]
67+ * @property {number } [defaultPort]
68+ * @property {number } [family]
69+ * @property {Object } [headers]
70+ * @property {number } [hints]
71+ * @property {string } [host]
72+ * @property {string } [hostname]
73+ * @property {boolean } [insecureHTTPParser]
74+ * @property {string } [localAddress]
75+ * @property {number } [localPort]
76+ * @property {Function } [lookup]
77+ * @property {number } [maxHeaderSize]
78+ * @property {string } [method]
79+ * @property {string } [path]
80+ * @property {number } [port]
81+ * @property {string } [protocol]
82+ * @property {boolean } [setHost]
83+ * @property {string } [socketPath]
84+ * @property {number } [timeout]
85+ * @property {AbortSignal } [signal]
86+ */
87+
88+ /**
89+ * Makes an HTTP request.
90+ * @param {string | URL } url
91+ * @param {HTTPRequestOptions } [options]
92+ * @param {Function } [cb]
93+ * @returns {ClientRequest }
94+ */
5195function request ( url , options , cb ) {
5296 return new ClientRequest ( url , options , cb ) ;
5397}
5498
99+ /**
100+ * Makes a `GET` HTTP request.
101+ * @param {string | URL } url
102+ * @param {HTTPRequestOptions } [options]
103+ * @param {Function } [cb]
104+ * @returns {ClientRequest }
105+ */
55106function get ( url , options , cb ) {
56107 const req = request ( url , options , cb ) ;
57108 req . end ( ) ;
0 commit comments