1 | import { NgZone, EventEmitter } from '@angular/core';
|
2 | import { Http, XHRConnection, ConnectionBackend, XHRBackend, ReadyState, Request, RequestOptions, Response, ResponseOptions, RequestOptionsArgs, BrowserXhr, XSRFStrategy, JSONPBackend } from '@angular/http';
|
3 | import { Observable } from 'rxjs/Observable';
|
4 | import 'rxjs/add/operator/map';
|
5 | export declare class PreloadHttp extends Http {
|
6 | protected _backend: ConnectionBackend;
|
7 | protected _defaultOptions: RequestOptions;
|
8 | _async: number;
|
9 | constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions);
|
10 | preload(_url: any, factory: any): EventEmitter<{}>;
|
11 | request(url: string | Request, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
12 | get(url: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
13 | post(url: string, body: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
14 | put(url: string, body: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
15 | delete(url: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
16 | patch(url: string, body: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
17 | head(url: string, options?: RequestOptionsArgs): Observable<Response> | EventEmitter<any>;
|
18 | }
|
19 | export declare class NodeConnection implements XHRConnection {
|
20 | readyState: ReadyState;
|
21 | request: Request;
|
22 | response: Observable<Response> | Observable<any>;
|
23 | constructor(req: Request, baseResponseOptions: ResponseOptions, originUrl?: string, baseUrl?: string);
|
24 | setDetectedContentType: (req: any, _xhr: any) => void;
|
25 | }
|
26 | export declare class NodeBackend extends XHRBackend {
|
27 | private baseResponseOptions;
|
28 | private _baseUrl;
|
29 | private _originUrl;
|
30 | constructor(baseResponseOptions: ResponseOptions, _browserXHR: BrowserXhr, _xsrfStrategy: XSRFStrategy, _ngZone: NgZone, _baseUrl: string, _originUrl: string);
|
31 | createConnection(request: Request): NodeConnection;
|
32 | }
|
33 | export declare class NodeJSONPConnection {
|
34 | readyState: ReadyState;
|
35 | request: Request;
|
36 | response: Observable<Response> | Observable<any>;
|
37 | constructor(req: Request, baseResponseOptions: ResponseOptions, ngZone: NgZone, originUrl?: string, baseUrl?: string);
|
38 | }
|
39 | export declare abstract class NodeJsonpBackend extends ConnectionBackend {
|
40 | }
|
41 | export declare class NodeJsonpBackend_ extends NodeJsonpBackend {
|
42 | private _baseResponseOptions;
|
43 | private _ngZone;
|
44 | private _baseUrl;
|
45 | private _originUrl;
|
46 | constructor(_baseResponseOptions: ResponseOptions, _ngZone: NgZone, _baseUrl: string, _originUrl: string);
|
47 | createConnection(request: Request): NodeJSONPConnection;
|
48 | }
|
49 | export declare function _noop(): void;
|
50 | export declare const NODE_HTTP_PROVIDERS_COMMON: Array<any>;
|
51 | export declare const NODE_HTTP_PROVIDERS: any[];
|
52 | export declare const NODE_JSONP_PROVIDERS: any[];
|
53 | export declare function httpFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions): PreloadHttp;
|
54 | export declare function jsonpFactory(jsonpBackend: JSONPBackend, requestOptions: RequestOptions): PreloadHttp;
|
55 | export declare class NodeHttpModule {
|
56 | static forRoot(config?: any): {
|
57 | ngModule: typeof NodeHttpModule;
|
58 | providers: any[];
|
59 | };
|
60 | static withConfig(config?: any): {
|
61 | ngModule: typeof NodeHttpModule;
|
62 | providers: any[];
|
63 | };
|
64 | }
|
65 | export declare class NodeJsonpModule {
|
66 | static forRoot(config?: any): {
|
67 | ngModule: typeof NodeJsonpModule;
|
68 | providers: any[];
|
69 | };
|
70 | static withConfig(config?: any): {
|
71 | ngModule: typeof NodeJsonpModule;
|
72 | providers: any[];
|
73 | };
|
74 | }
|