mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
node: Split to 0.12.x and 4.x. Added http.RequestOptions.
This commit is contained in:
Vendored
+20
-12
@@ -1,11 +1,11 @@
|
||||
// Type definitions for Node.js v0.12.0
|
||||
// Type definitions for Node.js v4.x
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
* Node.js v0.12.0 API *
|
||||
* Node.js v4.x API *
|
||||
* *
|
||||
************************************************/
|
||||
|
||||
@@ -430,6 +430,21 @@ declare module "http" {
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
|
||||
export interface RequestOptions {
|
||||
protocol?: string;
|
||||
host?: string;
|
||||
hostname?: string;
|
||||
family?: number;
|
||||
port?: number
|
||||
localAddress?: string;
|
||||
socketPath?: string;
|
||||
method?: string;
|
||||
path?: string;
|
||||
headers?: { [key: string]: any };
|
||||
auth?: string;
|
||||
agent?: Agent;
|
||||
}
|
||||
|
||||
export interface Server extends events.EventEmitter {
|
||||
listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server;
|
||||
@@ -568,7 +583,7 @@ declare module "http" {
|
||||
};
|
||||
export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server;
|
||||
export function createClient(port?: number, host?: string): any;
|
||||
export function request(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
export var globalAgent: Agent;
|
||||
}
|
||||
@@ -718,15 +733,7 @@ declare module "https" {
|
||||
SNICallback?: (servername: string) => any;
|
||||
}
|
||||
|
||||
export interface RequestOptions {
|
||||
host?: string;
|
||||
hostname?: string;
|
||||
port?: number;
|
||||
path?: string;
|
||||
method?: string;
|
||||
headers?: any;
|
||||
auth?: string;
|
||||
agent?: any;
|
||||
export interface RequestOptions extends http.RequestOptions{
|
||||
pfx?: any;
|
||||
key?: any;
|
||||
passphrase?: string;
|
||||
@@ -734,6 +741,7 @@ declare module "https" {
|
||||
ca?: any;
|
||||
ciphers?: string;
|
||||
rejectUnauthorized?: boolean;
|
||||
secureProtocol?: string;
|
||||
}
|
||||
|
||||
export interface Agent {
|
||||
|
||||
Reference in New Issue
Block a user