docs: convert all @experimental
tags to @publicApi
tags (#26595)
PR Close #26595
This commit is contained in:

committed by
Alex Rickabaugh

parent
5e2bf292e5
commit
a8430db45d
@ -65,7 +65,7 @@ import {ComponentFactoryResolver, ComponentRef, Directive, Injector, Input, NgMo
|
||||
*
|
||||
* {@example common/ngComponentOutlet/ts/module.ts region='NgModuleFactoryExample'}
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
* @ngModule CommonModule
|
||||
*/
|
||||
@Directive({selector: '[ngComponentOutlet]'})
|
||||
|
@ -42,7 +42,7 @@ import {SwitchView} from './ng_switch';
|
||||
*
|
||||
* See http://cldr.unicode.org/index/cldr-spec/plural-rules
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[ngPlural]'})
|
||||
export class NgPlural {
|
||||
@ -100,7 +100,7 @@ export class NgPlural {
|
||||
*
|
||||
* See {@link NgPlural} for more details and example.
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Directive({selector: '[ngPluralCase]'})
|
||||
export class NgPluralCase {
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export const LOCALE_DATA: {[localeId: string]: any} = {};
|
||||
|
||||
@ -15,7 +15,7 @@ export const LOCALE_DATA: {[localeId: string]: any} = {};
|
||||
* Register global data to be used internally by Angular. See the
|
||||
* ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale data.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
// The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1
|
||||
export function registerLocaleData(data: any, localeId?: string | any, extraData?: any): void {
|
||||
|
@ -14,7 +14,7 @@ import {CURRENCIES_EN, CurrenciesSymbols} from './currencies';
|
||||
* The different format styles that can be used to represent numbers.
|
||||
* Used by the function {@link getLocaleNumberFormat}.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export enum NumberFormatStyle {
|
||||
Decimal,
|
||||
@ -23,7 +23,7 @@ export enum NumberFormatStyle {
|
||||
Scientific
|
||||
}
|
||||
|
||||
/** @experimental */
|
||||
/** @publicApi */
|
||||
export enum Plural {
|
||||
Zero = 0,
|
||||
One = 1,
|
||||
@ -40,7 +40,7 @@ export enum Plural {
|
||||
* the genitive.
|
||||
* See [the CLDR website](http://cldr.unicode.org/translation/date-time) for more information.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export enum FormStyle {
|
||||
Format,
|
||||
@ -57,7 +57,7 @@ export enum FormStyle {
|
||||
* - Abbreviated: `Sun`
|
||||
* - Wide: `Sunday`
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export enum TranslationWidth {
|
||||
Narrow,
|
||||
@ -77,7 +77,7 @@ export enum TranslationWidth {
|
||||
* - `'full'`: `'EEEE, MMMM d, y, h:mm:ss a zzzz'` (e.g. `Monday, June 15, 2015 at
|
||||
* 9:03:01 AM GMT+01:00`)
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export enum FormatWidth {
|
||||
Short,
|
||||
@ -106,7 +106,7 @@ export enum FormatWidth {
|
||||
* | currencyDecimal | $2,345`.`67 | decimal separator, fallback to "decimal" |
|
||||
* | currencyGroup | $2`,`345.67 | grouping separator, fallback to "group" |
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export enum NumberSymbol {
|
||||
Decimal,
|
||||
@ -128,7 +128,7 @@ export enum NumberSymbol {
|
||||
/**
|
||||
* The value for each day of the week, based on the en-US locale
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export enum WeekDay {
|
||||
Sunday = 0,
|
||||
@ -143,7 +143,7 @@ export enum WeekDay {
|
||||
/**
|
||||
* The locale id for the chosen locale (e.g `en-GB`).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleId(locale: string): string {
|
||||
return findLocaleData(locale)[LocaleDataIndex.LocaleId];
|
||||
@ -152,7 +152,7 @@ export function getLocaleId(locale: string): string {
|
||||
/**
|
||||
* Periods of the day (e.g. `[AM, PM]` for en-US).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleDayPeriods(
|
||||
locale: string, formStyle: FormStyle, width: TranslationWidth): [string, string] {
|
||||
@ -167,7 +167,7 @@ export function getLocaleDayPeriods(
|
||||
/**
|
||||
* Days of the week for the Gregorian calendar (e.g. `[Sunday, Monday, ... Saturday]` for en-US).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleDayNames(
|
||||
locale: string, formStyle: FormStyle, width: TranslationWidth): string[] {
|
||||
@ -181,7 +181,7 @@ export function getLocaleDayNames(
|
||||
/**
|
||||
* Months of the year for the Gregorian calendar (e.g. `[January, February, ...]` for en-US).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleMonthNames(
|
||||
locale: string, formStyle: FormStyle, width: TranslationWidth): string[] {
|
||||
@ -195,7 +195,7 @@ export function getLocaleMonthNames(
|
||||
/**
|
||||
* Eras for the Gregorian calendar (e.g. AD/BC).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleEraNames(locale: string, width: TranslationWidth): [string, string] {
|
||||
const data = findLocaleData(locale);
|
||||
@ -207,7 +207,7 @@ export function getLocaleEraNames(locale: string, width: TranslationWidth): [str
|
||||
* First day of the week for this locale, based on english days (Sunday = 0, Monday = 1, ...).
|
||||
* For example in french the value would be 1 because the first day of the week is Monday.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleFirstDayOfWeek(locale: string): WeekDay {
|
||||
const data = findLocaleData(locale);
|
||||
@ -219,7 +219,7 @@ export function getLocaleFirstDayOfWeek(locale: string): WeekDay {
|
||||
* (Sunday = 0, Monday = 1, ...).
|
||||
* For example in english the value would be [6,0] for Saturday to Sunday.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay] {
|
||||
const data = findLocaleData(locale);
|
||||
@ -249,7 +249,7 @@ export function getLocaleWeekEndRange(locale: string): [WeekDay, WeekDay] {
|
||||
*
|
||||
* For example, `M/d/yy`, corresponding to a date like "9/14/99".
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleDateFormat(locale: string, width: FormatWidth): string {
|
||||
const data = findLocaleData(locale);
|
||||
@ -274,7 +274,7 @@ export function getLocaleDateFormat(locale: string, width: FormatWidth): string
|
||||
* through 23 (midnight plus 1 minute is 0:01), or using k to mean a 24-hour clock cycle running
|
||||
* 1 through 24 (midnight plus 1 minute is 24:01).
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleTimeFormat(locale: string, width: FormatWidth): string {
|
||||
const data = findLocaleData(locale);
|
||||
@ -304,7 +304,7 @@ export function getLocaleTimeFormat(locale: string, width: FormatWidth): string
|
||||
* time. English uses `{1} 'at' {0}` for full and long styles, and `{1}, {0}` for medium and short
|
||||
* styles.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleDateTimeFormat(locale: string, width: FormatWidth): string {
|
||||
const data = findLocaleData(locale);
|
||||
@ -316,7 +316,7 @@ export function getLocaleDateTimeFormat(locale: string, width: FormatWidth): str
|
||||
* Number symbol that can be used to replace placeholders in number formats.
|
||||
* See {@link NumberSymbol} for more information.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleNumberSymbol(locale: string, symbol: NumberSymbol): string {
|
||||
const data = findLocaleData(locale);
|
||||
@ -360,7 +360,7 @@ export function getLocaleNumberSymbol(locale: string, symbol: NumberSymbol): str
|
||||
* You can find more information
|
||||
* [on the CLDR website](http://cldr.unicode.org/translation/number-patterns)
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleNumberFormat(locale: string, type: NumberFormatStyle): string {
|
||||
const data = findLocaleData(locale);
|
||||
@ -372,7 +372,7 @@ export function getLocaleNumberFormat(locale: string, type: NumberFormatStyle):
|
||||
* the locale en-US).
|
||||
* The symbol will be `null` if the main country cannot be determined.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleCurrencySymbol(locale: string): string|null {
|
||||
const data = findLocaleData(locale);
|
||||
@ -384,7 +384,7 @@ export function getLocaleCurrencySymbol(locale: string): string|null {
|
||||
* en-US).
|
||||
* The name will be `null` if the main country cannot be determined.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleCurrencyName(locale: string): string|null {
|
||||
const data = findLocaleData(locale);
|
||||
@ -403,7 +403,7 @@ function getLocaleCurrencies(locale: string): {[code: string]: CurrenciesSymbols
|
||||
* The locale plural function used by ICU expressions to determine the plural case to use.
|
||||
* See {@link NgPlural} for more information.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocalePluralCase(locale: string): (value: number) => Plural {
|
||||
const data = findLocaleData(locale);
|
||||
@ -430,7 +430,7 @@ function checkFullData(data: any) {
|
||||
* See the ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale
|
||||
* data.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])[] {
|
||||
const data = findLocaleData(locale);
|
||||
@ -455,7 +455,7 @@ export function getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Tim
|
||||
* See the ["I18n guide"](guide/i18n#i18n-pipes) to know how to import additional locale
|
||||
* data.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getLocaleExtraDayPeriods(
|
||||
locale: string, formStyle: FormStyle, width: TranslationWidth): string[] {
|
||||
@ -476,7 +476,7 @@ export function getLocaleExtraDayPeriods(
|
||||
* add the first one to the locale data arrays, the other ones are only defined when different.
|
||||
* We use this function to retrieve the first defined value.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
function getLastDefinedValue<T>(data: T[], index: number): T {
|
||||
for (let i = index; i > -1; i--) {
|
||||
@ -490,7 +490,7 @@ function getLastDefinedValue<T>(data: T[], index: number): T {
|
||||
/**
|
||||
* A representation of the time with hours and minutes
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export type Time = {
|
||||
hours: number,
|
||||
@ -508,7 +508,7 @@ function extractTime(time: string): Time {
|
||||
/**
|
||||
* Finds the locale data for a locale id
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function findLocaleData(locale: string): any {
|
||||
const normalizedLocale = locale.toLowerCase().replace(/_/g, '-');
|
||||
@ -538,7 +538,7 @@ export function findLocaleData(locale: string): any {
|
||||
* (e.g.: format narrow = $, format wide = US$, code = USD)
|
||||
* If no locale is provided, it uses the locale "en" by default
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getCurrencySymbol(code: string, format: 'wide' | 'narrow', locale = 'en'): string {
|
||||
const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
|
||||
@ -558,7 +558,7 @@ const DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
|
||||
* Returns the number of decimal digits for the given currency.
|
||||
* Its value depends upon the presence of cents in that particular currency.
|
||||
*
|
||||
* @experimental i18n support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function getNumberOfCurrencyDigits(code: string): number {
|
||||
let digits;
|
||||
|
@ -16,7 +16,7 @@ import {Plural, getLocalePluralCase} from './locale_data_api';
|
||||
export const DEPRECATED_PLURAL_FN = new InjectionToken<boolean>('UseV4Plurals');
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class NgLocalization {
|
||||
abstract getPluralCategory(value: any, locale?: string): string;
|
||||
@ -52,7 +52,7 @@ export function getPluralCategory(
|
||||
/**
|
||||
* Returns the plural case based on the locale
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Injectable()
|
||||
export class NgLocaleLocalization extends NgLocalization {
|
||||
@ -89,7 +89,7 @@ export class NgLocaleLocalization extends NgLocalization {
|
||||
* Returns the plural case based on the locale
|
||||
*
|
||||
* @deprecated from v5 the plural case function is in locale data files common/locales/*.ts
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export function getPluralCase(locale: string, nLike: number | string): Plural {
|
||||
// TODO(vicb): lazy compute
|
||||
|
@ -11,7 +11,7 @@ import {SubscriptionLike} from 'rxjs';
|
||||
|
||||
import {LocationStrategy} from './location_strategy';
|
||||
|
||||
/** @experimental */
|
||||
/** @publicApi */
|
||||
export interface PopStateEvent {
|
||||
pop?: boolean;
|
||||
state?: any;
|
||||
|
@ -49,7 +49,7 @@ export abstract class PlatformLocation {
|
||||
|
||||
/**
|
||||
* @description Indicates when a location is initialized.
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export const LOCATION_INITIALIZED = new InjectionToken<Promise<any>>('Location Initialized');
|
||||
|
||||
@ -57,7 +57,7 @@ export const LOCATION_INITIALIZED = new InjectionToken<Promise<any>>('Location I
|
||||
* @description
|
||||
* A serializable version of the event from `onPopState` or `onHashChange`
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export interface LocationChangeEvent {
|
||||
type: string;
|
||||
@ -65,6 +65,6 @@ export interface LocationChangeEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export interface LocationChangeListener { (event: LocationChangeEvent): any; }
|
||||
|
@ -24,7 +24,7 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
|
||||
*
|
||||
* {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Pipe({name: 'i18nPlural', pure: true})
|
||||
export class I18nPluralPipe implements PipeTransform {
|
||||
|
@ -24,7 +24,7 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error';
|
||||
*
|
||||
* {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Pipe({name: 'i18nSelect', pure: true})
|
||||
export class I18nSelectPipe implements PipeTransform {
|
||||
|
@ -13,7 +13,7 @@ export const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
|
||||
|
||||
/**
|
||||
* Returns whether a platform id represents a browser platform.
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export function isPlatformBrowser(platformId: Object): boolean {
|
||||
return platformId === PLATFORM_BROWSER_ID;
|
||||
@ -21,7 +21,7 @@ export function isPlatformBrowser(platformId: Object): boolean {
|
||||
|
||||
/**
|
||||
* Returns whether a platform id represents a server platform.
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export function isPlatformServer(platformId: Object): boolean {
|
||||
return platformId === PLATFORM_SERVER_ID;
|
||||
@ -29,7 +29,7 @@ export function isPlatformServer(platformId: Object): boolean {
|
||||
|
||||
/**
|
||||
* Returns whether a platform id represents a web worker app platform.
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export function isPlatformWorkerApp(platformId: Object): boolean {
|
||||
return platformId === PLATFORM_WORKER_APP_ID;
|
||||
@ -37,7 +37,7 @@ export function isPlatformWorkerApp(platformId: Object): boolean {
|
||||
|
||||
/**
|
||||
* Returns whether a platform id represents a web worker UI platform.
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export function isPlatformWorkerUi(platformId: Object): boolean {
|
||||
return platformId === PLATFORM_WORKER_UI_ID;
|
||||
|
@ -14,7 +14,7 @@ import {SubscriptionLike} from 'rxjs';
|
||||
/**
|
||||
* A spy for {@link Location} that allows tests to fire simulated location events.
|
||||
*
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Injectable()
|
||||
export class SpyLocation implements Location {
|
||||
|
Reference in New Issue
Block a user