/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ConfiguredModule, Injector } from '@alterior/di'; import { Observable } from 'rxjs'; import { HttpBackend, HttpHandler } from './backend'; import { HttpInterceptor } from './interceptor'; import { HttpRequest } from './request'; import { HttpEvent } from './response'; import { XhrFactory } from './xhr'; import { ServerXhr, zoneWrappedInterceptingHandler } from './server'; /** * An injectable `HttpHandler` that applies multiple interceptors * to a request before passing it to the given `HttpBackend`. * * The interceptors are loaded lazily from the injector, to allow * interceptors to themselves inject classes depending indirectly * on `HttpInterceptingHandler` itself. * @see `HttpInterceptor` */ export declare class HttpInterceptingHandler implements HttpHandler { private backend; private injector; private chain; constructor(backend: HttpBackend, injector: Injector); handle(req: HttpRequest): Observable>; } /** * Constructs an `HttpHandler` that applies interceptors * to a request before passing it to the given `HttpBackend`. * * Use as a factory function within `HttpClientModule`. * * */ export declare function interceptingHandler(backend: HttpBackend, interceptors?: HttpInterceptor[] | null): HttpHandler; /** * Factory function that determines where to store JSONP callbacks. * * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist * in test environments. In that case, callbacks are stored on an anonymous object instead. * * */ export declare function jsonpCallbackContext(): Object; /** * An NgModule that adds XSRF protection support to outgoing requests. * * For a server that supports a cookie-based XSRF protection system, * use directly to configure XSRF protection with the correct * cookie and header names. * * If no names are supplied, the default cookie name is `XSRF-TOKEN` * and the default header name is `X-XSRF-TOKEN`. * * */ export declare class HttpClientXsrfModule { /** * Disable the default XSRF protection. */ static disable(): ConfiguredModule; /** * Configure XSRF protection. * @param options An object that can specify either or both * cookie name or header name. * - Cookie name default is `XSRF-TOKEN`. * - Header name default is `X-XSRF-TOKEN`. * */ static withOptions(options?: { cookieName?: string; headerName?: string; }): ConfiguredModule; } /** * An NgModule that provides the `HttpClient` and associated services. * * Interceptors can be added to the chain behind `HttpClient` by binding them * to the multiprovider for `HTTP_INTERCEPTORS`. * * */ export declare class HttpClientModule { static forRoot(config?: HttpClientConfig): { $module: typeof HttpClientModule; providers: ({ provide: typeof XhrFactory; useClass: typeof ServerXhr; useFactory?: undefined; deps?: undefined; } | { provide: typeof HttpHandler; useFactory: typeof zoneWrappedInterceptingHandler; deps: (typeof HttpBackend | typeof Injector)[]; useClass?: undefined; })[]; }; } export interface HttpClientConfig { /** * Which HTTP client implementation should be used? * Use 'server' to use the `xhr2` NPM module. Use `browser` to * use the browser-side `XMLHttpRequest`, and set to `null` * to disable loading a built-in implementation (so you can * provide your own). */ platform?: 'server' | 'browser' | null; } //# sourceMappingURL=module.d.ts.map