@angular/common
Version:
Angular - commonly needed directives and services
75 lines (74 loc) • 2.39 kB
TypeScript
/**
* @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 { ModuleWithProviders } from '@angular/core';
import { HttpBackend, HttpHandler } from './backend';
import { HttpInterceptor } from './interceptor';
/**
* Constructs an `HttpHandler` that applies a bunch of `HttpInterceptor`s
* to a request before passing it to the given `HttpBackend`.
*
* Meant to be used as a factory function within `HttpClientModule`.
*
* @stable
*/
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.
*
* @stable
*/
export declare function jsonpCallbackContext(): Object;
/**
* `NgModule` which adds XSRF protection support to outgoing requests.
*
* Provided the server supports a cookie-based XSRF protection system, this
* module can be used directly to configure XSRF protection with the correct
* cookie and header names.
*
* If no such names are provided, the default is to use `X-XSRF-TOKEN` for
* the header name and `XSRF-TOKEN` for the cookie name.
*
* @stable
*/
export declare class HttpClientXsrfModule {
/**
* Disable the default XSRF protection.
*/
static disable(): ModuleWithProviders;
/**
* Configure XSRF protection to use the given cookie name or header name,
* or the default names (as described above) if not provided.
*/
static withOptions(options?: {
cookieName?: string;
headerName?: string;
}): ModuleWithProviders;
}
/**
* `NgModule` which provides the `HttpClient` and associated services.
*
* Interceptors can be added to the chain behind `HttpClient` by binding them
* to the multiprovider for `HTTP_INTERCEPTORS`.
*
* @stable
*/
export declare class HttpClientModule {
}
/**
* `NgModule` which enables JSONP support in `HttpClient`.
*
* Without this module, Jsonp requests will reach the backend
* with method JSONP, where they'll be rejected.
*
* @stable
*/
export declare class HttpClientJsonpModule {
}