mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2238 from borisyankov/def/node-http
feat(nodejs) added stronger typing for http status codes
This commit is contained in:
@@ -100,3 +100,13 @@ var request = http.request('http://0.0.0.0');
|
||||
request.once('error', function () {});
|
||||
request.setNoDelay(true);
|
||||
request.abort();
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// Http tests : http://nodejs.org/api/http.html
|
||||
////////////////////////////////////////////////////
|
||||
module http_tests {
|
||||
// Status codes
|
||||
var code = 100;
|
||||
var codeMessage = http.STATUS_CODES['400'];
|
||||
var codeMessage = http.STATUS_CODES[400];
|
||||
}
|
||||
Vendored
+4
-1
@@ -348,7 +348,10 @@ declare module "http" {
|
||||
}
|
||||
export interface Agent { maxSockets: number; sockets: any; requests: any; }
|
||||
|
||||
export var STATUS_CODES: any;
|
||||
export var STATUS_CODES: {
|
||||
[errorCode: number]: string;
|
||||
[errorCode: string]: string;
|
||||
};
|
||||
export function createServer(requestListener?: (request: ServerRequest, response: ServerResponse) =>void ): Server;
|
||||
export function createClient(port?: number, host?: string): any;
|
||||
export function request(options: any, callback?: Function): ClientRequest;
|
||||
|
||||
Reference in New Issue
Block a user