From eb9d4314872a8532da993220b7a388e673f910b0 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Fri, 19 Oct 2018 15:06:08 +0100 Subject: [PATCH] docs: common with `@publicApi` tags (#26595) PR Close #26595 --- packages/common/http/src/backend.ts | 4 +- packages/common/http/src/client.ts | 2 +- packages/common/http/src/headers.ts | 1 + packages/common/http/src/interceptor.ts | 4 +- packages/common/http/src/jsonp.ts | 4 +- packages/common/http/src/module.ts | 6 +-- packages/common/http/src/params.ts | 6 +-- packages/common/http/src/request.ts | 2 +- packages/common/http/src/response.ts | 20 ++++----- packages/common/http/src/xhr.ts | 4 +- packages/common/http/src/xsrf.ts | 2 +- packages/common/http/testing/src/api.ts | 4 +- packages/common/http/testing/src/module.ts | 2 +- packages/common/http/testing/src/request.ts | 2 +- packages/common/src/common_module.ts | 2 + packages/common/src/directives/ng_class.ts | 2 +- packages/common/src/directives/ng_for_of.ts | 4 ++ packages/common/src/directives/ng_if.ts | 4 ++ packages/common/src/directives/ng_style.ts | 2 +- packages/common/src/directives/ng_switch.ts | 6 +-- .../src/directives/ng_template_outlet.ts | 1 + packages/common/src/dom_tokens.ts | 2 +- packages/common/src/i18n/format_date.ts | 2 + packages/common/src/i18n/format_number.ts | 6 +-- .../src/location/hash_location_strategy.ts | 2 +- packages/common/src/location/location.ts | 1 + .../common/src/location/location_strategy.ts | 4 +- .../src/location/path_location_strategy.ts | 2 +- .../common/src/location/platform_location.ts | 6 ++- packages/common/src/pipes/async_pipe.ts | 1 + .../common/src/pipes/case_conversion_pipes.ts | 3 ++ packages/common/src/pipes/date_pipe.ts | 1 + .../common/src/pipes/deprecated/date_pipe.ts | 2 +- .../src/pipes/deprecated/number_pipe.ts | 5 ++- packages/common/src/pipes/json_pipe.ts | 1 + packages/common/src/pipes/keyvalue_pipe.ts | 4 ++ packages/common/src/pipes/number_pipe.ts | 5 ++- packages/common/src/pipes/slice_pipe.ts | 2 +- packages/common/src/version.ts | 3 ++ packages/common/src/viewport_scroller.ts | 2 + .../testing/src/mock_location_strategy.ts | 2 +- tools/public_api_guard/common/common.d.ts | 43 ------------------- tools/public_api_guard/common/testing.d.ts | 1 - 43 files changed, 87 insertions(+), 97 deletions(-) diff --git a/packages/common/http/src/backend.ts b/packages/common/http/src/backend.ts index 1c0c84cf5f..0146b7dfbd 100644 --- a/packages/common/http/src/backend.ts +++ b/packages/common/http/src/backend.ts @@ -20,7 +20,7 @@ import {HttpEvent} from './response'; * * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain. * - * + * @publicApi */ export abstract class HttpHandler { abstract handle(req: HttpRequest): Observable>; @@ -34,7 +34,7 @@ export abstract class HttpHandler { * When injected, `HttpBackend` dispatches requests directly to the backend, without going * through the interceptor chain. * - * + * @publicApi */ export abstract class HttpBackend implements HttpHandler { abstract handle(req: HttpRequest): Observable>; diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index 5b604d5433..258da773a3 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -51,7 +51,7 @@ export type HttpObserve = 'body' | 'events' | 'response'; * Each request method has multiple signatures, and the return type varies according to which * signature is called (mainly the values of `observe` and `responseType`). * - * + * @publicApi */ @Injectable() export class HttpClient { diff --git a/packages/common/http/src/headers.ts b/packages/common/http/src/headers.ts index a4c39e4f21..d909cd1f95 100755 --- a/packages/common/http/src/headers.ts +++ b/packages/common/http/src/headers.ts @@ -15,6 +15,7 @@ interface Update { /** * Immutable set of Http headers, with lazy parsing. * + * @publicApi */ export class HttpHeaders { /** diff --git a/packages/common/http/src/interceptor.ts b/packages/common/http/src/interceptor.ts index cb1f8990fc..3851eabea2 100644 --- a/packages/common/http/src/interceptor.ts +++ b/packages/common/http/src/interceptor.ts @@ -22,7 +22,7 @@ import {HttpEvent} from './response'; * In rare cases, interceptors may wish to completely handle a request themselves, * and not delegate to the remainder of the chain. This behavior is allowed. * - * + * @publicApi */ export interface HttpInterceptor { /** @@ -61,7 +61,7 @@ export class HttpInterceptorHandler implements HttpHandler { * A multi-provider token which represents the array of `HttpInterceptor`s that * are registered. * - * + * @publicApi */ export const HTTP_INTERCEPTORS = new InjectionToken('HTTP_INTERCEPTORS'); diff --git a/packages/common/http/src/jsonp.ts b/packages/common/http/src/jsonp.ts index b002675047..5134f8dcb4 100644 --- a/packages/common/http/src/jsonp.ts +++ b/packages/common/http/src/jsonp.ts @@ -42,7 +42,7 @@ export abstract class JsonpCallbackContext { [key: string]: (data: any) => void; * `HttpBackend` that only processes `HttpRequest` with the JSONP method, * by performing JSONP style requests. * - * + * @publicApi */ @Injectable() export class JsonpClientBackend implements HttpBackend { @@ -206,7 +206,7 @@ export class JsonpClientBackend implements HttpBackend { * An `HttpInterceptor` which identifies requests with the method JSONP and * shifts them to the `JsonpClientBackend`. * - * + * @publicApi */ @Injectable() export class JsonpInterceptor { diff --git a/packages/common/http/src/module.ts b/packages/common/http/src/module.ts index ff06059d2f..9225814ac6 100644 --- a/packages/common/http/src/module.ts +++ b/packages/common/http/src/module.ts @@ -85,7 +85,7 @@ export function jsonpCallbackContext(): Object { * If no names are supplied, the default cookie name is `XSRF-TOKEN` * and the default header name is `X-XSRF-TOKEN`. * - * + * @publicApi */ @NgModule({ providers: [ @@ -138,7 +138,7 @@ export class HttpClientXsrfModule { * You can add interceptors to the chain behind `HttpClient` by binding them to the * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. * - * + * @publicApi */ @NgModule({ /** @@ -175,7 +175,7 @@ export class HttpClientModule { * You can add interceptors to the chain behind `HttpClient` by binding them to the * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. * - * + * @publicApi */ @NgModule({ providers: [ diff --git a/packages/common/http/src/params.ts b/packages/common/http/src/params.ts index 09c9cf4239..4daba56ab5 100755 --- a/packages/common/http/src/params.ts +++ b/packages/common/http/src/params.ts @@ -11,7 +11,7 @@ * * Used by `HttpParams`. * - * + * @publicApi **/ export interface HttpParameterCodec { encodeKey(key: string): string; @@ -25,7 +25,7 @@ export interface HttpParameterCodec { * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to * serialize and parse URL parameter keys and values. * - * + * @publicApi */ export class HttpUrlEncodingCodec implements HttpParameterCodec { encodeKey(key: string): string { return standardEncoding(key); } @@ -94,7 +94,7 @@ export interface HttpParamsOptions { * * This class is immutable - all mutation operations return a new instance. * - * + * @publicApi */ export class HttpParams { private map: Map|null; diff --git a/packages/common/http/src/request.ts b/packages/common/http/src/request.ts index 30413cb8da..b641daad9b 100644 --- a/packages/common/http/src/request.ts +++ b/packages/common/http/src/request.ts @@ -73,7 +73,7 @@ function isFormData(value: any): value is FormData { * assumed to be immutable. To modify a `HttpRequest`, the `clone` * method should be used. * - * + * @publicApi */ export class HttpRequest { /** diff --git a/packages/common/http/src/response.ts b/packages/common/http/src/response.ts index 9a72499030..d8acc33ca4 100644 --- a/packages/common/http/src/response.ts +++ b/packages/common/http/src/response.ts @@ -11,7 +11,7 @@ import {HttpHeaders} from './headers'; /** * Type enumeration for the different kinds of `HttpEvent`. * - * + * @publicApi */ export enum HttpEventType { /** @@ -48,7 +48,7 @@ export enum HttpEventType { /** * Base interface for progress events. * - * + * @publicApi */ export interface HttpProgressEvent { /** @@ -71,7 +71,7 @@ export interface HttpProgressEvent { /** * A download progress event. * - * + * @publicApi */ export interface HttpDownloadProgressEvent extends HttpProgressEvent { type: HttpEventType.DownloadProgress; @@ -98,7 +98,7 @@ export interface HttpUploadProgressEvent extends HttpProgressEvent { * when a request may be retried multiple times, to distinguish between * retries on the final event stream. * - * + * @publicApi */ export interface HttpSentEvent { type: HttpEventType.Sent; } @@ -108,7 +108,7 @@ export interface HttpSentEvent { type: HttpEventType.Sent; } * Grouping all custom events under this type ensures they will be handled * and forwarded by all implementations of interceptors. * - * + * @publicApi */ export interface HttpUserEvent { type: HttpEventType.User; } @@ -130,7 +130,7 @@ export interface HttpJsonParseError { * * Typed according to the expected type of the response. * - * + * @publicApi */ export type HttpEvent = HttpSentEvent | HttpHeaderResponse | HttpResponse| HttpProgressEvent | HttpUserEvent; @@ -138,7 +138,7 @@ export type HttpEvent = /** * Base class for both `HttpResponse` and `HttpHeaderResponse`. * - * + * @publicApi */ export abstract class HttpResponseBase { /** @@ -207,7 +207,7 @@ export abstract class HttpResponseBase { * `HttpHeaderResponse` is a `HttpEvent` available on the response * event stream, only when progress events are requested. * - * + * @publicApi */ export class HttpHeaderResponse extends HttpResponseBase { /** @@ -248,7 +248,7 @@ export class HttpHeaderResponse extends HttpResponseBase { * `HttpResponse` is a `HttpEvent` available on the response event * stream. * - * + * @publicApi */ export class HttpResponse extends HttpResponseBase { /** @@ -298,7 +298,7 @@ export class HttpResponse extends HttpResponseBase { * will contain either a wrapped Error object or the error response returned * from the server. * - * + * @publicApi */ export class HttpErrorResponse extends HttpResponseBase implements Error { readonly name = 'HttpErrorResponse'; diff --git a/packages/common/http/src/xhr.ts b/packages/common/http/src/xhr.ts index d47942a3b1..c0a388dc94 100644 --- a/packages/common/http/src/xhr.ts +++ b/packages/common/http/src/xhr.ts @@ -33,7 +33,7 @@ function getResponseUrl(xhr: any): string|null { /** * A wrapper around the `XMLHttpRequest` constructor. * - * + * @publicApi */ export abstract class XhrFactory { abstract build(): XMLHttpRequest; } @@ -62,7 +62,7 @@ interface PartialResponse { * An `HttpBackend` which uses the XMLHttpRequest API to send * requests to a backend server. * - * + * @publicApi */ @Injectable() export class HttpXhrBackend implements HttpBackend { diff --git a/packages/common/http/src/xsrf.ts b/packages/common/http/src/xsrf.ts index 98089874ae..ba5779d0c0 100644 --- a/packages/common/http/src/xsrf.ts +++ b/packages/common/http/src/xsrf.ts @@ -21,7 +21,7 @@ export const XSRF_HEADER_NAME = new InjectionToken('XSRF_HEADER_NAME'); /** * Retrieves the current XSRF token to use with the next outgoing request. * - * + * @publicApi */ export abstract class HttpXsrfTokenExtractor { /** diff --git a/packages/common/http/testing/src/api.ts b/packages/common/http/testing/src/api.ts index c5a4afdb71..7efb0e4c6f 100644 --- a/packages/common/http/testing/src/api.ts +++ b/packages/common/http/testing/src/api.ts @@ -13,7 +13,7 @@ import {TestRequest} from './request'; /** * Defines a matcher for requests based on URL, method, or both. * - * + * @publicApi */ export interface RequestMatch { method?: string; @@ -24,7 +24,7 @@ export interface RequestMatch { * Controller to be injected into tests, that allows for mocking and flushing * of requests. * - * + * @publicApi */ export abstract class HttpTestingController { /** diff --git a/packages/common/http/testing/src/module.ts b/packages/common/http/testing/src/module.ts index 68c8fb0ae0..4fc93e929e 100644 --- a/packages/common/http/testing/src/module.ts +++ b/packages/common/http/testing/src/module.ts @@ -18,7 +18,7 @@ import {HttpClientTestingBackend} from './backend'; * * Inject `HttpTestingController` to expect and flush requests in your tests. * - * + * @publicApi */ @NgModule({ imports: [ diff --git a/packages/common/http/testing/src/request.ts b/packages/common/http/testing/src/request.ts index 37fa3ff9cb..59a18749ed 100644 --- a/packages/common/http/testing/src/request.ts +++ b/packages/common/http/testing/src/request.ts @@ -15,7 +15,7 @@ import {Observer} from 'rxjs'; * This interface allows access to the underlying `HttpRequest`, and allows * responding with `HttpEvent`s or `HttpErrorResponse`s. * - * + * @publicApi */ export class TestRequest { /** diff --git a/packages/common/src/common_module.ts b/packages/common/src/common_module.ts index 4dda41c007..eba73b1b5d 100644 --- a/packages/common/src/common_module.ts +++ b/packages/common/src/common_module.ts @@ -26,6 +26,7 @@ import {COMMON_PIPES} from './pipes/index'; * * The `exports` options make the declared directives and pipes available for import * by other NgModules. * + * @publicApi */ @NgModule({ declarations: [COMMON_DIRECTIVES, COMMON_PIPES], @@ -41,6 +42,7 @@ export class CommonModule { * A module that contains the deprecated i18n pipes. * * @deprecated from v5 + * @publicApi */ @NgModule({ declarations: [COMMON_DEPRECATED_I18N_PIPES], diff --git a/packages/common/src/directives/ng_class.ts b/packages/common/src/directives/ng_class.ts index 3c1e38a188..8e0bb039b5 100644 --- a/packages/common/src/directives/ng_class.ts +++ b/packages/common/src/directives/ng_class.ts @@ -34,7 +34,7 @@ import {Directive, DoCheck, ElementRef, Input, IterableChanges, IterableDiffer, * - `Object` - keys are CSS classes that get added when the expression given in the value * evaluates to a truthy value, otherwise they are removed. * - * + * @publicApi */ @Directive({selector: '[ngClass]'}) export class NgClass implements DoCheck { diff --git a/packages/common/src/directives/ng_for_of.ts b/packages/common/src/directives/ng_for_of.ts index 1e21ac18f0..6e484a979c 100644 --- a/packages/common/src/directives/ng_for_of.ts +++ b/packages/common/src/directives/ng_for_of.ts @@ -8,6 +8,9 @@ import {ChangeDetectorRef, Directive, DoCheck, EmbeddedViewRef, Input, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDiffers, NgIterable, TemplateRef, TrackByFunction, ViewContainerRef, forwardRef, isDevMode} from '@angular/core'; +/** + * @publicApi + */ export class NgForOfContext { constructor( public $implicit: T, public ngForOf: NgIterable, public index: number, @@ -93,6 +96,7 @@ export class NgForOfContext { * example. * * @ngModule CommonModule + * @publicApi */ @Directive({selector: '[ngFor][ngForOf]'}) export class NgForOf implements DoCheck { diff --git a/packages/common/src/directives/ng_if.ts b/packages/common/src/directives/ng_if.ts index 3de5098c55..6597507760 100644 --- a/packages/common/src/directives/ng_if.ts +++ b/packages/common/src/directives/ng_if.ts @@ -100,6 +100,7 @@ import {Directive, EmbeddedViewRef, Input, TemplateRef, ViewContainerRef, ɵstri * ``` * * @ngModule CommonModule + * @publicApi */ @Directive({selector: '[ngIf]'}) export class NgIf { @@ -171,6 +172,9 @@ export class NgIf { static ngTemplateGuard_ngIf(dir: NgIf, expr: E): expr is NonNullable { return true; } } +/** + * @publicApi + */ export class NgIfContext { public $implicit: any = null; public ngIf: any = null; diff --git a/packages/common/src/directives/ng_style.ts b/packages/common/src/directives/ng_style.ts index 612bb358a0..659d90606a 100644 --- a/packages/common/src/directives/ng_style.ts +++ b/packages/common/src/directives/ng_style.ts @@ -28,7 +28,7 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer, * - keys are style names with an optional `.` suffix (ie 'top.px', 'font-style.em'), * - values are the values assigned to those properties (expressed in the given unit). * - * + * @publicApi */ @Directive({selector: '[ngStyle]'}) export class NgStyle implements DoCheck { diff --git a/packages/common/src/directives/ng_switch.ts b/packages/common/src/directives/ng_switch.ts index 3f3ca39180..68b392179b 100644 --- a/packages/common/src/directives/ng_switch.ts +++ b/packages/common/src/directives/ng_switch.ts @@ -71,7 +71,7 @@ export class SwitchView { * When no matching expression is found on a `ngSwitchCase` view, the `ngSwitchDefault` view is * stamped out. * - * + * @publicApi */ @Directive({selector: '[ngSwitch]'}) export class NgSwitch { @@ -148,7 +148,7 @@ export class NgSwitch { * * See {@link NgSwitch} for more details and example. * - * + * @publicApi */ @Directive({selector: '[ngSwitchCase]'}) export class NgSwitchCase implements DoCheck { @@ -187,7 +187,7 @@ export class NgSwitchCase implements DoCheck { * * See {@link NgSwitch} for more details and example. * - * + * @publicApi */ @Directive({selector: '[ngSwitchDefault]'}) export class NgSwitchDefault { diff --git a/packages/common/src/directives/ng_template_outlet.ts b/packages/common/src/directives/ng_template_outlet.ts index 2ff09b3807..0500caf36c 100644 --- a/packages/common/src/directives/ng_template_outlet.ts +++ b/packages/common/src/directives/ng_template_outlet.ts @@ -30,6 +30,7 @@ import {Directive, EmbeddedViewRef, Input, OnChanges, SimpleChange, SimpleChange * * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'} * + * @publicApi */ @Directive({selector: '[ngTemplateOutlet]'}) export class NgTemplateOutlet implements OnChanges { diff --git a/packages/common/src/dom_tokens.ts b/packages/common/src/dom_tokens.ts index 3952de8f54..8a00cbfe53 100644 --- a/packages/common/src/dom_tokens.ts +++ b/packages/common/src/dom_tokens.ts @@ -14,6 +14,6 @@ import {InjectionToken} from '@angular/core'; * Note: Document might not be available in the Application Context when Application and Rendering * Contexts are not the same (e.g. when running the application into a Web Worker). * - * + * @publicApi */ export const DOCUMENT = new InjectionToken('DocumentToken'); diff --git a/packages/common/src/i18n/format_date.ts b/packages/common/src/i18n/format_date.ts index 54c41ecf0e..92eb14572a 100644 --- a/packages/common/src/i18n/format_date.ts +++ b/packages/common/src/i18n/format_date.ts @@ -57,6 +57,8 @@ enum TranslationType { * If not specified, host system settings are used. * * See {@link DatePipe} for more details. + * + * @publicApi */ export function formatDate( value: string | number | Date, format: string, locale: string, timezone?: string): string { diff --git a/packages/common/src/i18n/format_number.ts b/packages/common/src/i18n/format_number.ts index b528e5f4c3..9f66142c20 100644 --- a/packages/common/src/i18n/format_number.ts +++ b/packages/common/src/i18n/format_number.ts @@ -138,7 +138,7 @@ function formatNumberToLocaleString( * as `USD` for the US dollar and `EUR` for the euro. * - `digitInfo` See {@link DecimalPipe} for more details. * - * + * @publicApi */ export function formatCurrency( value: number, locale: string, currency: string, currencyCode?: string, @@ -168,7 +168,7 @@ export function formatCurrency( * - `locale` is a `string` defining the locale to use. * - `digitInfo` See {@link DecimalPipe} for more details. * - * + * @publicApi */ export function formatPercent(value: number, locale: string, digitsInfo?: string): string { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent); @@ -191,7 +191,7 @@ export function formatPercent(value: number, locale: string, digitsInfo?: string * - `locale` is a `string` defining the locale to use. * - `digitInfo` See {@link DecimalPipe} for more details. * - * + * @publicApi */ export function formatNumber(value: number, locale: string, digitsInfo?: string): string { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal); diff --git a/packages/common/src/location/hash_location_strategy.ts b/packages/common/src/location/hash_location_strategy.ts index d52c4c7610..c182f244c2 100644 --- a/packages/common/src/location/hash_location_strategy.ts +++ b/packages/common/src/location/hash_location_strategy.ts @@ -31,7 +31,7 @@ import {LocationChangeListener, PlatformLocation} from './platform_location'; * * {@example common/location/ts/hash_location_component.ts region='LocationComponent'} * - * + * @publicApi */ @Injectable() export class HashLocationStrategy extends LocationStrategy { diff --git a/packages/common/src/location/location.ts b/packages/common/src/location/location.ts index c4af23a877..041d6fdac8 100644 --- a/packages/common/src/location/location.ts +++ b/packages/common/src/location/location.ts @@ -44,6 +44,7 @@ export interface PopStateEvent { * * {@example common/location/ts/path_location_component.ts region='LocationComponent'} * + * @publicApi */ @Injectable() export class Location { diff --git a/packages/common/src/location/location_strategy.ts b/packages/common/src/location/location_strategy.ts index d40e0e2452..f608180acd 100644 --- a/packages/common/src/location/location_strategy.ts +++ b/packages/common/src/location/location_strategy.ts @@ -25,7 +25,7 @@ import {LocationChangeListener} from './platform_location'; * * See these two classes for more. * - * + * @publicApi */ export abstract class LocationStrategy { abstract path(includeHash?: boolean): string; @@ -61,6 +61,6 @@ export abstract class LocationStrategy { * class AppModule {} * ``` * - * + * @publicApi */ export const APP_BASE_HREF = new InjectionToken('appBaseHref'); diff --git a/packages/common/src/location/path_location_strategy.ts b/packages/common/src/location/path_location_strategy.ts index e47932568c..e518978e4d 100644 --- a/packages/common/src/location/path_location_strategy.ts +++ b/packages/common/src/location/path_location_strategy.ts @@ -40,7 +40,7 @@ import {LocationChangeListener, PlatformLocation} from './platform_location'; * * {@example common/location/ts/path_location_component.ts region='LocationComponent'} * - * + * @publicApi */ @Injectable() export class PathLocationStrategy extends LocationStrategy { diff --git a/packages/common/src/location/platform_location.ts b/packages/common/src/location/platform_location.ts index 45d8bb1757..d21ab94ee0 100644 --- a/packages/common/src/location/platform_location.ts +++ b/packages/common/src/location/platform_location.ts @@ -27,7 +27,7 @@ import {InjectionToken} from '@angular/core'; * {@link Location} / {@link LocationStrategy} and DOM apis flow through the `PlatformLocation` * class they are all platform independent. * - * + * @publicApi */ export abstract class PlatformLocation { abstract getBaseHrefFromDOM(): string; @@ -48,7 +48,9 @@ export abstract class PlatformLocation { } /** - * @description Indicates when a location is initialized. + * @description + * Indicates when a location is initialized. + * * @publicApi */ export const LOCATION_INITIALIZED = new InjectionToken>('Location Initialized'); diff --git a/packages/common/src/pipes/async_pipe.ts b/packages/common/src/pipes/async_pipe.ts index 244f5b8d7e..8ef9fba56e 100644 --- a/packages/common/src/pipes/async_pipe.ts +++ b/packages/common/src/pipes/async_pipe.ts @@ -65,6 +65,7 @@ const _observableStrategy = new ObservableStrategy(); * * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'} * + * @publicApi */ @Pipe({name: 'async', pure: false}) export class AsyncPipe implements OnDestroy, PipeTransform { diff --git a/packages/common/src/pipes/case_conversion_pipes.ts b/packages/common/src/pipes/case_conversion_pipes.ts index 385ec5039a..3f60d852e5 100644 --- a/packages/common/src/pipes/case_conversion_pipes.ts +++ b/packages/common/src/pipes/case_conversion_pipes.ts @@ -22,6 +22,7 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * * * @ngModule CommonModule + * @publicApi */ @Pipe({name: 'lowercase'}) export class LowerCasePipe implements PipeTransform { @@ -64,6 +65,7 @@ const unicodeWordMatch = * * * @ngModule CommonModule + * @publicApi */ @Pipe({name: 'titlecase'}) export class TitleCasePipe implements PipeTransform { @@ -87,6 +89,7 @@ export class TitleCasePipe implements PipeTransform { * @see `TitleCasePipe` * * @ngModule CommonModule + * @publicApi */ @Pipe({name: 'uppercase'}) export class UpperCasePipe implements PipeTransform { diff --git a/packages/common/src/pipes/date_pipe.ts b/packages/common/src/pipes/date_pipe.ts index c0365c42b5..b6653663c7 100644 --- a/packages/common/src/pipes/date_pipe.ts +++ b/packages/common/src/pipes/date_pipe.ts @@ -147,6 +147,7 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * } * ``` * + * @publicApi */ // clang-format on @Pipe({name: 'date', pure: true}) diff --git a/packages/common/src/pipes/deprecated/date_pipe.ts b/packages/common/src/pipes/deprecated/date_pipe.ts index c4379fb667..68dd55f70f 100644 --- a/packages/common/src/pipes/deprecated/date_pipe.ts +++ b/packages/common/src/pipes/deprecated/date_pipe.ts @@ -73,7 +73,7 @@ import {DateFormatter} from './intl'; * * {@example common/pipes/ts/date_pipe.ts region='DeprecatedDatePipe'} * - * + * @publicApi */ @Pipe({name: 'date', pure: true}) export class DeprecatedDatePipe implements PipeTransform { diff --git a/packages/common/src/pipes/deprecated/number_pipe.ts b/packages/common/src/pipes/deprecated/number_pipe.ts index c53dc61a7e..121eb95896 100644 --- a/packages/common/src/pipes/deprecated/number_pipe.ts +++ b/packages/common/src/pipes/deprecated/number_pipe.ts @@ -83,6 +83,7 @@ function formatNumber( * {@example common/pipes/ts/number_pipe.ts region='DeprecatedNumberPipe'} * * @ngModule CommonModule + * @publicApi */ @Pipe({name: 'number'}) export class DeprecatedDecimalPipe implements PipeTransform { @@ -112,7 +113,7 @@ export class DeprecatedDecimalPipe implements PipeTransform { * * {@example common/pipes/ts/percent_pipe.ts region='DeprecatedPercentPipe'} * - * + * @publicApi */ @Pipe({name: 'percent'}) export class DeprecatedPercentPipe implements PipeTransform { @@ -148,7 +149,7 @@ export class DeprecatedPercentPipe implements PipeTransform { * * {@example common/pipes/ts/currency_pipe.ts region='DeprecatedCurrencyPipe'} * - * + * @publicApi */ @Pipe({name: 'currency'}) export class DeprecatedCurrencyPipe implements PipeTransform { diff --git a/packages/common/src/pipes/json_pipe.ts b/packages/common/src/pipes/json_pipe.ts index 9603b59991..7ecbdddbe3 100644 --- a/packages/common/src/pipes/json_pipe.ts +++ b/packages/common/src/pipes/json_pipe.ts @@ -21,6 +21,7 @@ import {Pipe, PipeTransform} from '@angular/core'; * * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'} * + * @publicApi */ @Pipe({name: 'json', pure: false}) export class JsonPipe implements PipeTransform { diff --git a/packages/common/src/pipes/keyvalue_pipe.ts b/packages/common/src/pipes/keyvalue_pipe.ts index 8c1158b177..cc4cb6f5e9 100644 --- a/packages/common/src/pipes/keyvalue_pipe.ts +++ b/packages/common/src/pipes/keyvalue_pipe.ts @@ -15,6 +15,8 @@ function makeKeyValuePair(key: K, value: V): KeyValue { /** * A key value pair. * Usually used to represent the key value pairs from a Map or Object. + * + * @publicApi */ export interface KeyValue { key: K; @@ -38,6 +40,8 @@ export interface KeyValue { * pipe. * * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'} + * + * @publicApi */ @Pipe({name: 'keyvalue', pure: false}) export class KeyValuePipe implements PipeTransform { diff --git a/packages/common/src/pipes/number_pipe.ts b/packages/common/src/pipes/number_pipe.ts index 8a30a84446..ee9a9574df 100644 --- a/packages/common/src/pipes/number_pipe.ts +++ b/packages/common/src/pipes/number_pipe.ts @@ -44,6 +44,7 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * * * + * @publicApi */ @Pipe({name: 'number'}) export class DecimalPipe implements PipeTransform { @@ -96,7 +97,7 @@ export class DecimalPipe implements PipeTransform { * * * - * + * @publicApi */ @Pipe({name: 'percent'}) export class PercentPipe implements PipeTransform { @@ -150,7 +151,7 @@ export class PercentPipe implements PipeTransform { * * * - * + * @publicApi */ @Pipe({name: 'currency'}) export class CurrencyPipe implements PipeTransform { diff --git a/packages/common/src/pipes/slice_pipe.ts b/packages/common/src/pipes/slice_pipe.ts index 60fed51fe1..662b3926c8 100644 --- a/packages/common/src/pipes/slice_pipe.ts +++ b/packages/common/src/pipes/slice_pipe.ts @@ -42,8 +42,8 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'} * + * @publicApi */ - @Pipe({name: 'slice', pure: false}) export class SlicePipe implements PipeTransform { /** diff --git a/packages/common/src/version.ts b/packages/common/src/version.ts index af66f0fa27..9469ebe5e5 100644 --- a/packages/common/src/version.ts +++ b/packages/common/src/version.ts @@ -14,4 +14,7 @@ import {Version} from '@angular/core'; +/** + * @publicApi + */ export const VERSION = new Version('0.0.0-PLACEHOLDER'); diff --git a/packages/common/src/viewport_scroller.ts b/packages/common/src/viewport_scroller.ts index 25effd0ec1..88a5114d94 100644 --- a/packages/common/src/viewport_scroller.ts +++ b/packages/common/src/viewport_scroller.ts @@ -12,6 +12,8 @@ import {DOCUMENT} from './dom_tokens'; /** * Manages the scroll position. + * + * @publicApi */ export abstract class ViewportScroller { // De-sugared tree-shakable injection diff --git a/packages/common/testing/src/mock_location_strategy.ts b/packages/common/testing/src/mock_location_strategy.ts index 6c3c663624..c75fb8042e 100644 --- a/packages/common/testing/src/mock_location_strategy.ts +++ b/packages/common/testing/src/mock_location_strategy.ts @@ -15,7 +15,7 @@ import {EventEmitter, Injectable} from '@angular/core'; * A mock implementation of {@link LocationStrategy} that allows tests to fire simulated * location events. * - * + * @publicApi */ @Injectable() export class MockLocationStrategy extends LocationStrategy { diff --git a/tools/public_api_guard/common/common.d.ts b/tools/public_api_guard/common/common.d.ts index 54709d66f5..58fbcfd538 100644 --- a/tools/public_api_guard/common/common.d.ts +++ b/tools/public_api_guard/common/common.d.ts @@ -61,7 +61,6 @@ export declare function formatNumber(value: number, locale: string, digitsInfo?: export declare function formatPercent(value: number, locale: string, digitsInfo?: string): string; -/** @experimental */ export declare enum FormatWidth { Short = 0, Medium = 1, @@ -69,67 +68,47 @@ export declare enum FormatWidth { Full = 3 } -/** @experimental */ export declare enum FormStyle { Format = 0, Standalone = 1 } -/** @experimental */ export declare function getCurrencySymbol(code: string, format: 'wide' | 'narrow', locale?: string): string; -/** @experimental */ export declare function getLocaleCurrencyName(locale: string): string | null; -/** @experimental */ export declare function getLocaleCurrencySymbol(locale: string): string | null; -/** @experimental */ export declare function getLocaleDateFormat(locale: string, width: FormatWidth): string; -/** @experimental */ export declare function getLocaleDateTimeFormat(locale: string, width: FormatWidth): string; -/** @experimental */ export declare function getLocaleDayNames(locale: string, formStyle: FormStyle, width: TranslationWidth): string[]; -/** @experimental */ export declare function getLocaleDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth): [string, string]; -/** @experimental */ export declare function getLocaleEraNames(locale: string, width: TranslationWidth): [string, string]; -/** @experimental */ export declare function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])[]; -/** @experimental */ export declare function getLocaleExtraDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth): string[]; -/** @experimental */ export declare function getLocaleFirstDayOfWeek(locale: string): WeekDay; -/** @experimental */ export declare function getLocaleId(locale: string): string; -/** @experimental */ export declare function getLocaleMonthNames(locale: string, formStyle: FormStyle, width: TranslationWidth): string[]; -/** @experimental */ export declare function getLocaleNumberFormat(locale: string, type: NumberFormatStyle): string; -/** @experimental */ export declare function getLocaleNumberSymbol(locale: string, symbol: NumberSymbol): string; -/** @experimental */ export declare function getLocalePluralCase(locale: string): (value: number) => Plural; -/** @experimental */ export declare function getLocaleTimeFormat(locale: string, width: FormatWidth): string; -/** @experimental */ export declare function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay]; -/** @experimental */ export declare function getNumberOfCurrencyDigits(code: string): number; export declare class HashLocationStrategy extends LocationStrategy { @@ -144,7 +123,6 @@ export declare class HashLocationStrategy extends LocationStrategy { replaceState(state: any, title: string, path: string, queryParams: string): void; } -/** @experimental */ export declare class I18nPluralPipe implements PipeTransform { constructor(_localization: NgLocalization); transform(value: number, pluralMap: { @@ -152,23 +130,18 @@ export declare class I18nPluralPipe implements PipeTransform { }, locale?: string): string; } -/** @experimental */ export declare class I18nSelectPipe implements PipeTransform { transform(value: string | null | undefined, mapping: { [key: string]: string; }): string; } -/** @experimental */ export declare function isPlatformBrowser(platformId: Object): boolean; -/** @experimental */ export declare function isPlatformServer(platformId: Object): boolean; -/** @experimental */ export declare function isPlatformWorkerApp(platformId: Object): boolean; -/** @experimental */ export declare function isPlatformWorkerUi(platformId: Object): boolean; export declare class JsonPipe implements PipeTransform { @@ -208,16 +181,13 @@ export declare class Location { static stripTrailingSlash(url: string): string; } -/** @experimental */ export declare const LOCATION_INITIALIZED: InjectionToken>; -/** @experimental */ export interface LocationChangeEvent { state: any; type: string; } -/** @experimental */ export interface LocationChangeListener { (event: LocationChangeEvent): any; } @@ -246,7 +216,6 @@ export declare class NgClass implements DoCheck { ngDoCheck(): void; } -/** @experimental */ export declare class NgComponentOutlet implements OnChanges, OnDestroy { ngComponentOutlet: Type; ngComponentOutletContent: any[][]; @@ -291,7 +260,6 @@ export declare class NgIfContext { ngIf: any; } -/** @experimental */ export declare class NgLocaleLocalization extends NgLocalization { /** @deprecated */ protected deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined; protected locale: string; @@ -300,19 +268,16 @@ export declare class NgLocaleLocalization extends NgLocalization { getPluralCategory(value: any, locale?: string): string; } -/** @experimental */ export declare abstract class NgLocalization { abstract getPluralCategory(value: any, locale?: string): string; } -/** @experimental */ export declare class NgPlural { ngPlural: number; constructor(_localization: NgLocalization); addCase(value: string, switchView: SwitchView): void; } -/** @experimental */ export declare class NgPluralCase { value: string; constructor(value: string, template: TemplateRef, viewContainer: ViewContainerRef, ngPlural: NgPlural); @@ -347,7 +312,6 @@ export declare class NgTemplateOutlet implements OnChanges { ngOnChanges(changes: SimpleChanges): void; } -/** @experimental */ export declare enum NumberFormatStyle { Decimal = 0, Percent = 1, @@ -355,7 +319,6 @@ export declare enum NumberFormatStyle { Scientific = 3 } -/** @experimental */ export declare enum NumberSymbol { Decimal = 0, Group = 1, @@ -403,7 +366,6 @@ export declare abstract class PlatformLocation { abstract replaceState(state: any, title: string, url: string): void; } -/** @experimental */ export declare enum Plural { Zero = 0, One = 1, @@ -413,7 +375,6 @@ export declare enum Plural { Other = 5 } -/** @experimental */ export interface PopStateEvent { pop?: boolean; state?: any; @@ -421,14 +382,12 @@ export interface PopStateEvent { url?: string; } -/** @experimental */ export declare function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void; export declare class SlicePipe implements PipeTransform { transform(value: any, start: number, end?: number): any; } -/** @experimental */ export declare type Time = { hours: number; minutes: number; @@ -438,7 +397,6 @@ export declare class TitleCasePipe implements PipeTransform { transform(value: string): string; } -/** @experimental */ export declare enum TranslationWidth { Narrow = 0, Abbreviated = 1, @@ -461,7 +419,6 @@ export declare abstract class ViewportScroller { static ngInjectableDef: never; } -/** @experimental */ export declare enum WeekDay { Sunday = 0, Monday = 1, diff --git a/tools/public_api_guard/common/testing.d.ts b/tools/public_api_guard/common/testing.d.ts index 187fbd044b..2bd1077ead 100644 --- a/tools/public_api_guard/common/testing.d.ts +++ b/tools/public_api_guard/common/testing.d.ts @@ -15,7 +15,6 @@ export declare class MockLocationStrategy extends LocationStrategy { simulatePopState(url: string): void; } -/** @experimental */ export declare class SpyLocation implements Location { urlChanges: string[]; back(): void;