UNPKG

894 BTypeScriptView Raw
1/// <reference types="node" />
2import http from 'http';
3import https from 'https';
4import { Readable } from 'stream';
5import { UrlWithStringQuery } from 'url';
6import { GetUriOptions } from '.';
7declare type HttpOrHttpsModule = typeof http | typeof https;
8export interface HttpReadableProps {
9 date?: number;
10 parsed?: UrlWithStringQuery;
11 redirects?: HttpReadable[];
12}
13export interface HttpReadable extends Readable, HttpReadableProps {
14}
15export interface HttpIncomingMessage extends http.IncomingMessage, HttpReadableProps {
16}
17export interface HttpOptions extends GetUriOptions, https.RequestOptions {
18 cache?: HttpReadable;
19 http?: HttpOrHttpsModule;
20 redirects?: HttpReadable[];
21 maxRedirects?: number;
22}
23/**
24 * Returns a Readable stream from an "http:" URI.
25 */
26export default function get(parsed: UrlWithStringQuery, opts: HttpOptions): Promise<Readable>;
27export {};