docs(common): improve deprecation notices to be parsed by tslint
Closes: #24237 Closes: #24249
This commit is contained in:
parent
5794506c64
commit
069062236c
|
@ -13,7 +13,7 @@ import {Injectable} from '@angular/core';
|
|||
*
|
||||
* Take care not to evaluate this in non-browser contexts.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class BrowserXhr {
|
||||
|
|
|
@ -23,7 +23,7 @@ const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use GET request method.';
|
|||
/**
|
||||
* Base class for an in-flight JSONP request.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class JSONPConnection implements Connection {
|
||||
private _id: string;
|
||||
|
@ -136,7 +136,7 @@ export class JSONPConnection implements Connection {
|
|||
/**
|
||||
* A {@link ConnectionBackend} that uses the JSONP strategy of making requests.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class JSONPBackend extends ConnectionBackend {
|
||||
|
|
|
@ -28,7 +28,7 @@ const XSSI_PREFIX = /^\)\]\}',?\n/;
|
|||
* This class would typically not be created or interacted with directly inside applications, though
|
||||
* the {@link MockConnection} may be interacted with in tests.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class XHRConnection implements Connection {
|
||||
request: Request;
|
||||
|
@ -187,7 +187,7 @@ export class XHRConnection implements Connection {
|
|||
* with different `cookieName` and `headerName` values. See the main HTTP documentation for more
|
||||
* details.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class CookieXSRFStrategy implements XSRFStrategy {
|
||||
constructor(
|
||||
|
@ -225,7 +225,7 @@ export class CookieXSRFStrategy implements XSRFStrategy {
|
|||
* }
|
||||
* }
|
||||
* ```
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class XHRBackend implements ConnectionBackend {
|
||||
|
|
|
@ -37,7 +37,7 @@ import {URLSearchParams} from './url_search_params';
|
|||
* console.log('options.url:', options.url); // https://google.com
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class RequestOptions {
|
||||
/**
|
||||
|
@ -200,7 +200,7 @@ export class RequestOptions {
|
|||
* console.log('req.url:', req.url); // https://google.com
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class BaseRequestOptions extends RequestOptions {
|
||||
|
|
|
@ -39,7 +39,7 @@ import {ResponseOptionsArgs} from './interfaces';
|
|||
* console.log('res.json():', res.json()); // Object {name: "Jeff"}
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class ResponseOptions {
|
||||
// TODO: FormData | Blob
|
||||
|
@ -156,7 +156,7 @@ export class ResponseOptions {
|
|||
* console.log('res.text():', res.text()); // Angular;
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class BaseResponseOptions extends ResponseOptions {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
/**
|
||||
* Supported http methods.
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export enum RequestMethod {
|
||||
Get,
|
||||
|
@ -24,7 +24,7 @@ export enum RequestMethod {
|
|||
* All possible states in which a connection can be, based on
|
||||
* [States](http://www.w3.org/TR/XMLHttpRequest/#states) from the `XMLHttpRequest` spec, but with an
|
||||
* additional "CANCELLED" state.
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export enum ReadyState {
|
||||
Unsent,
|
||||
|
@ -38,7 +38,7 @@ export enum ReadyState {
|
|||
/**
|
||||
* Acceptable response types to be associated with a {@link Response}, based on
|
||||
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec.
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export enum ResponseType {
|
||||
Basic,
|
||||
|
@ -50,7 +50,7 @@ export enum ResponseType {
|
|||
|
||||
/**
|
||||
* Supported content type to be automatically associated with a {@link Request}.
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export enum ContentType {
|
||||
NONE,
|
||||
|
@ -64,7 +64,7 @@ export enum ContentType {
|
|||
|
||||
/**
|
||||
* Define which buffer to use to store the response
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export enum ResponseContentType {
|
||||
Text,
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
* console.log(thirdHeaders.get('X-My-Custom-Header')); //'Angular'
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class Headers {
|
||||
/** @internal header names are lower case */
|
||||
|
|
|
@ -99,7 +99,7 @@ function mergeOptions(
|
|||
* http.get('request-from-mock-backend.json').subscribe((res:Response) => doSomething(res));
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class Http {
|
||||
|
@ -187,7 +187,7 @@ export class Http {
|
|||
|
||||
|
||||
/**
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class Jsonp extends Http {
|
||||
|
|
|
@ -40,7 +40,7 @@ export function jsonpFactory(jsonpBackend: JSONPBackend, requestOptions: Request
|
|||
/**
|
||||
* The module that includes http's providers
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@NgModule({
|
||||
providers: [
|
||||
|
@ -60,7 +60,7 @@ export class HttpModule {
|
|||
/**
|
||||
* The module that includes jsonp's providers
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@NgModule({
|
||||
providers: [
|
||||
|
|
|
@ -17,14 +17,14 @@ import {URLSearchParams} from './url_search_params';
|
|||
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
|
||||
* {@link Request}.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export abstract class ConnectionBackend { abstract createConnection(request: any): Connection; }
|
||||
|
||||
/**
|
||||
* Abstract class from which real connections are derived.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export abstract class Connection {
|
||||
readyState: ReadyState;
|
||||
|
@ -35,7 +35,7 @@ export abstract class Connection {
|
|||
/**
|
||||
* An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export abstract class XSRFStrategy { abstract configureRequest(req: Request): void; }
|
||||
|
||||
|
@ -43,7 +43,7 @@ export abstract class XSRFStrategy { abstract configureRequest(req: Request): vo
|
|||
* Interface for options to construct a RequestOptions, based on
|
||||
* [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export interface RequestOptionsArgs {
|
||||
url?: string|null;
|
||||
|
@ -66,7 +66,7 @@ export interface RequestArgs extends RequestOptionsArgs { url: string|null; }
|
|||
* Interface for options to construct a Response, based on
|
||||
* [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export interface ResponseOptionsArgs {
|
||||
body?: string|Object|FormData|ArrayBuffer|Blob|null;
|
||||
|
|
|
@ -52,7 +52,7 @@ import {URLSearchParams} from './url_search_params';
|
|||
* });
|
||||
* ```
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class Request extends Body {
|
||||
/**
|
||||
|
|
|
@ -32,7 +32,7 @@ import {Headers} from './headers';
|
|||
* can be accessed many times. There are other differences in the implementation, but this is the
|
||||
* most significant.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class Response extends Body {
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@ function paramParser(rawParams: string = ''): Map<string, string[]> {
|
|||
return map;
|
||||
}
|
||||
/**
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
**/
|
||||
export class QueryEncoder {
|
||||
encodeKey(k: string): string { return standardEncoding(k); }
|
||||
|
@ -76,7 +76,7 @@ function standardEncoding(v: string): string {
|
|||
*
|
||||
* let params = new URLSearchParams('', new MyQueryEncoder());
|
||||
* ```
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class URLSearchParams {
|
||||
paramsMap: Map<string, string[]>;
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
import {Version} from '@angular/core';
|
||||
/**
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export const VERSION = new Version('0.0.0-PLACEHOLDER');
|
||||
|
|
|
@ -16,7 +16,7 @@ import {take} from 'rxjs/operators';
|
|||
*
|
||||
* Mock Connection to represent a {@link Connection} for tests.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
export class MockConnection implements Connection {
|
||||
// TODO: Name `readyState` should change to be more generic, and states could be made to be more
|
||||
|
@ -189,7 +189,7 @@ export class MockConnection implements Connection {
|
|||
*
|
||||
* This method only exists in the mock implementation, not in real Backends.
|
||||
*
|
||||
* @deprecated use @angular/common/http instead
|
||||
* @deprecated see https://angular.io/guide/http
|
||||
*/
|
||||
@Injectable()
|
||||
export class MockBackend implements ConnectionBackend {
|
||||
|
|
Loading…
Reference in New Issue