@types/request
Advanced tools
Comparing version 2.0.13 to 2.47.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for request 2.0 | ||
// Type definitions for request 2.47 | ||
// Project: https://github.com/request/request | ||
@@ -17,2 +17,3 @@ // Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>, | ||
import caseless = require('caseless'); | ||
import stream = require('stream'); | ||
@@ -23,2 +24,3 @@ import http = require('http'); | ||
import FormData = require('form-data'); | ||
import net = require('net'); | ||
import tough = require('tough-cookie'); | ||
@@ -118,3 +120,3 @@ import { Url } from 'url'; | ||
baseUrl?: string; | ||
callback?: (error: any, response: RequestResponse, body: any) => void; | ||
callback?: RequestCallback; | ||
jar?: CookieJar | boolean; | ||
@@ -183,29 +185,4 @@ formData?: { [key: string]: any }; | ||
type RequestCallback = (error: any, response: RequestResponse, body: any) => void; | ||
type RequestCallback = (error: any, response: Response, body: any) => void; | ||
type ResponseRequest = CoreOptions & { | ||
uri: Url; | ||
}; | ||
interface RequestResponse extends http.IncomingMessage { | ||
request: ResponseRequest; | ||
body: any; | ||
timingStart?: number; | ||
timings?: { | ||
socket: number; | ||
lookup: number; | ||
connect: number; | ||
response: number; | ||
end: number; | ||
}; | ||
timingPhases?: { | ||
wait: number; | ||
dns: number; | ||
tcp: number; | ||
firstByte: number; | ||
download: number; | ||
total: number; | ||
}; | ||
} | ||
interface HttpArchiveRequest { | ||
@@ -239,12 +216,9 @@ url?: string; | ||
interface Request extends stream.Stream { | ||
interface Request extends caseless.Httpified, stream.Stream { | ||
readable: boolean; | ||
writable: boolean; | ||
explicitMethod?: true; | ||
getAgent(): http.Agent; | ||
// start(): void; | ||
// abort(): void; | ||
debug(...args: any[]): void; | ||
pipeDest(dest: any): void; | ||
setHeader(name: string, value: string, clobber?: boolean): Request; | ||
setHeaders(headers: Headers): Request; | ||
qs(q: object, clobber?: boolean): Request; | ||
@@ -256,2 +230,3 @@ form(): FormData; | ||
aws(opts: AWSOptions, now?: boolean): Request; | ||
hawk(opts: HawkOptions): void; | ||
auth(username: string, password: string, sendImmediately?: boolean, bearer?: string): Request; | ||
@@ -263,6 +238,8 @@ oauth(oauth: OAuthOptions): Request; | ||
on(event: 'request', listener: (req: http.ClientRequest) => void): this; | ||
on(event: 'response', listener: (resp: http.IncomingMessage) => void): this; | ||
on(event: 'response', listener: (resp: Response) => void): this; | ||
on(event: 'data', listener: (data: Buffer | string) => void): this; | ||
on(event: 'error', listener: (e: Error) => void): this; | ||
on(event: 'complete', listener: (resp: http.IncomingMessage, body?: string | Buffer) => void): this; | ||
on(event: 'complete', listener: (resp: Response, body?: string | Buffer) => void): this; | ||
on(event: 'pipe', listener: (src: stream.Readable) => void): this; | ||
on(event: 'socket', listener: (src: net.Socket) => void): this; | ||
@@ -279,5 +256,91 @@ write(buffer: Buffer | string, cb?: (err?: Error) => void): boolean; | ||
destroy(): void; | ||
toJSON(): object; | ||
toJSON(): RequestAsJSON; | ||
// several of the CoreOptions are copied onto the request instance | ||
host?: string; | ||
port?: number; | ||
followAllRedirects?: boolean; | ||
followOriginalHttpMethod?: boolean; | ||
maxRedirects?: number; | ||
removeRefererHeader?: boolean; | ||
encoding?: string | null; | ||
timeout?: number; | ||
localAddress?: string; | ||
strictSSL?: boolean; | ||
rejectUnauthorized?: boolean; | ||
time?: boolean; | ||
gzip?: boolean; | ||
preambleCRLF?: boolean; | ||
postambleCRLF?: boolean; | ||
withCredentials?: boolean; | ||
key?: Buffer; | ||
cert?: Buffer; | ||
passphrase?: string; | ||
ca?: string | Buffer | string[] | Buffer[]; | ||
har?: HttpArchiveRequest; | ||
// set in `Request.prototype.init` | ||
headers: Headers; | ||
method: string; | ||
pool: false | { [key: string]: http.Agent | https.Agent }; | ||
dests: stream.Readable[]; | ||
callback?: RequestCallback; | ||
uri: Url & { href: string, pathname: string }; | ||
proxy: null | string | Url; | ||
tunnel: boolean; | ||
setHost: boolean; | ||
path: string; | ||
agent: false | http.Agent | https.Agent; | ||
body: Buffer | Buffer[] | string | string[] | stream.Readable; | ||
timing?: boolean; | ||
src?: stream.Readable; | ||
// set in `Request.prototype.start` | ||
href: string; | ||
startTime?: number; | ||
startTimeNow?: number; | ||
timings?: { | ||
socket: number; | ||
lookup: number; | ||
connect: number; | ||
response: number; | ||
end: number; | ||
}; | ||
// set in `Request.prototype.onRequestResponse` | ||
elapsedTime?: number; | ||
response?: Response; | ||
} | ||
interface Response extends http.IncomingMessage { | ||
statusCode: number; | ||
statusMessage: string; | ||
request: Request; | ||
body: any; // Buffer, string, stream.Readable, or a plain object if `json` was truthy | ||
caseless: caseless.Caseless; // case-insensitive access to headers | ||
toJSON(): ResponseAsJSON; | ||
timingStart?: number; | ||
elapsedTime?: number; | ||
timings?: { | ||
socket: number; | ||
lookup: number; | ||
connect: number; | ||
response: number; | ||
end: number; | ||
}; | ||
timingPhases?: { | ||
wait: number; | ||
dns: number; | ||
tcp: number; | ||
firstByte: number; | ||
download: number; | ||
total: number; | ||
}; | ||
} | ||
// aliases for backwards compatibility | ||
type ResponseRequest = Request; | ||
type RequestResponse = Response; | ||
interface Headers { | ||
@@ -316,2 +379,15 @@ [key: string]: any; | ||
interface RequestAsJSON { | ||
uri: Url; | ||
method: string; | ||
headers: Headers; | ||
} | ||
interface ResponseAsJSON { | ||
statusCode: number; | ||
body: any; | ||
headers: Headers; | ||
request: RequestAsJSON; | ||
} | ||
type Cookie = tough.Cookie; | ||
@@ -318,0 +394,0 @@ |
{ | ||
"name": "@types/request", | ||
"version": "2.0.13", | ||
"version": "2.47.0", | ||
"description": "TypeScript definitions for request", | ||
@@ -50,2 +50,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/caseless": "*", | ||
"@types/form-data": "*", | ||
@@ -55,4 +56,4 @@ "@types/tough-cookie": "*", | ||
}, | ||
"typesPublisherContentHash": "6c14182e2b40e1c53511609ee86e40c677d399a0e5bc93a12e6e594c71e9e80e", | ||
"typesPublisherContentHash": "750b780560eb1be29e6e484378fef2393e335e0110c9559aa16aca00f687009a", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 22 Jan 2018 19:06:28 GMT | ||
* Dependencies: stream, http, https, fs, form-data, tough-cookie, url, node | ||
* Last updated: Mon, 29 Jan 2018 21:19:40 GMT | ||
* Dependencies: caseless, stream, http, https, fs, form-data, net, tough-cookie, url, node | ||
* Global values: none | ||
@@ -15,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18149
340
4
+ Added@types/caseless@*
+ Added@types/caseless@0.12.5(transitive)