-/*! *****************************************************************************
-Copyright (c) Microsoft Corporation. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-this file except in compliance with the License. You may obtain a copy of the
-License at http://www.apache.org/licenses/LICENSE-2.0
-
-THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-MERCHANTABLITY OR NON-INFRINGEMENT.
-
-See the Apache Version 2.0 License for specific language governing permissions
-and limitations under the License.
-***************************************************************************** */
-
-
-
-/// <reference no-default-lib="true"/>\r
-
-
-declare namespace Intl {\r
-\r
- /**\r
- * [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).\r
- *\r
- * [Wikipedia](https://en.wikipedia.org/wiki/IETF_language_tag).\r
- */\r
- type BCP47LanguageTag = string;\r
-\r
- /**\r
- * Unit to use in the relative time internationalized message.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format#Parameters).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-singularrelativetimeunit).\r
- */\r
- type RelativeTimeFormatUnit =\r
- | "year" | "years"\r
- | "quarter" | "quarters"\r
- | "month" | "months"\r
- | "week" | "weeks"\r
- | "day" | "days"\r
- | "hour" | "hours"\r
- | "minute" | "minutes"\r
- | "second" | "seconds"\r
- ;\r
-\r
- /**\r
- * The locale matching algorithm to use.\r
- *\r
- * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\r
- */\r
- type RelativeTimeFormatLocaleMatcher = "lookup" | "best fit";\r
-\r
- /**\r
- * The format of output message.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\r
- */\r
- type RelativeTimeFormatNumeric = "always" | "auto";\r
-\r
- /**\r
- * The length of the internationalized message.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\r
- */\r
- type RelativeTimeFormatStyle = "long" | "short" | "narrow";\r
-\r
- /**\r
- * An object with some or all of properties of `options` parameter\r
- * of `Intl.RelativeTimeFormat` constructor.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-InitializeRelativeTimeFormat).\r
- */\r
- interface RelativeTimeFormatOptions {\r
- localeMatcher?: RelativeTimeFormatLocaleMatcher;\r
- numeric?: RelativeTimeFormatNumeric;\r
- style?: RelativeTimeFormatStyle;\r
- }\r
-\r
- /**\r
- * An object with properties reflecting the locale\r
- * and formatting options computed during initialization\r
- * of the `Intel.RelativeTimeFormat` object\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions#Description).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#table-relativetimeformat-resolvedoptions-properties)\r
- */\r
- interface ResolvedRelativeTimeFormatOptions {\r
- locale: BCP47LanguageTag;\r
- style: RelativeTimeFormatStyle;\r
- numeric: RelativeTimeFormatNumeric;\r
- numberingSystem: string;\r
- }\r
-\r
- /**\r
- * An object representing the relative time format in parts\r
- * that can be used for custom locale-aware formatting.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-FormatRelativeTimeToParts).\r
- */\r
- interface RelativeTimeFormatPart {\r
- type: string;\r
- value: string;\r
- unit?: RelativeTimeFormatUnit;\r
- }\r
-\r
- interface RelativeTimeFormat {\r
- /**\r
- * Formats a value and a unit according to the locale\r
- * and formatting options of the given\r
- * [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\r
- * object.\r
- *\r
- * While this method automatically provides the correct plural forms,\r
- * the grammatical form is otherwise as neutral as possible.\r
- * It is the caller's responsibility to handle cut-off logic\r
- * such as deciding between displaying "in 7 days" or "in 1 week".\r
- * This API does not support relative dates involving compound units.\r
- * e.g "in 5 days and 4 hours".\r
- *\r
- * @param value - Numeric value to use in the internationalized relative time message\r
- *\r
- * @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit)\r
- * to use in the relative time internationalized message.\r
- * Possible values are: `"year"`, `"quarter"`, `"month"`, `"week"`,\r
- * `"day"`, `"hour"`, `"minute"`, `"second"`.\r
- * Plural forms are also permitted.\r
- *\r
- * @throws `RangeError` if `unit` was given something other than `unit` possible values\r
- *\r
- * @returns Internationalized relative time message as string\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype.format).\r
- */\r
- format(\r
- value: number,\r
- unit: RelativeTimeFormatUnit,\r
- ): string;\r
-\r
- /**\r
- * A version of the format method which it returns an array of objects\r
- * which represent "parts" of the object,\r
- * separating the formatted number into its constituent parts\r
- * and separating it from other surrounding text.\r
- * These objects have two properties:\r
- * `type` a NumberFormat formatToParts type, and `value`,\r
- * which is the String which is the component of the output.\r
- * If a "part" came from NumberFormat,\r
- * it will have a unit property which indicates the `unit` being formatted;\r
- * literals which are part of the larger frame will not have this property.\r
- *\r
- * @param value - Numeric value to use in the internationalized relative time message\r
- *\r
- * @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit)\r
- * to use in the relative time internationalized message.\r
- * Possible values are: `"year"`, `"quarter"`, `"month"`, `"week"`,\r
- * `"day"`, `"hour"`, `"minute"`, `"second"`.\r
- * Plural forms are also permitted.\r
- *\r
- * @throws `RangeError` if `unit` was given something other than `unit` possible values\r
- *\r
- * @returns Array of [FormatRelativeTimeToParts](https://tc39.es/ecma402/#sec-FormatRelativeTimeToParts)\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.prototype.formatToParts).\r
- */\r
- formatToParts(\r
- value: number,\r
- unit: RelativeTimeFormatUnit,\r
- ): RelativeTimeFormatPart[];\r
-\r
- /**\r
- * Provides access to the locale and options computed during initialization of this `Intl.RelativeTimeFormat` object.\r
- *\r
- * @returns A new object with properties reflecting the locale\r
- * and formatting options computed during initialization\r
- * of the `Intel.RelativeTimeFormat` object.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-intl.relativetimeformat.prototype.resolvedoptions)\r
- */\r
- resolvedOptions(): ResolvedRelativeTimeFormatOptions;\r
- }\r
-\r
- /**\r
- * The [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\r
- * object is a constructor for objects that enable language-sensitive relative time formatting.\r
- *\r
- * Part of [Intl object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\r
- * namespace and the [ECMAScript Internationalization API](https://www.ecma-international.org/publications/standards/Ecma-402.htm).\r
- *\r
- * [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat#Browser_compatibility).\r
- *\r
- * [Polyfills](https://github.com/tc39/proposal-intl-relative-time#polyfills).\r
- */\r
- const RelativeTimeFormat: {\r
- /**\r
- * Constructor creates [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)\r
- * objects\r
- *\r
- * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.\r
- * For the general form and interpretation of the locales argument,\r
- * see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\r
- *\r
- * @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)\r
- * with some or all of options of the formatting.\r
- * An object with some or all of the following properties:\r
- * - `localeMatcher` - The locale matching algorithm to use.\r
- * Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.\r
- * For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\r
- * - `numeric` - The format of output message.\r
- * Possible values are: `"always"` (default, e.g., `1 day ago`) or `"auto"` (e.g., `yesterday`).\r
- * The `"auto"` value allows to not always have to use numeric values in the output.\r
- * - `style` - The length of the internationalized message. Possible values are:\r
- * `"long"` (default, e.g., in 1 month),\r
- * `"short"` (e.g., in 1 mo.)\r
- * or `"narrow"` (e.g., in 1 mo.). The narrow style could be similar to the short style for some locales.\r
- *\r
- * @returns [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-intl-relativetimeformat-constructor).\r
- */\r
- new(\r
- locales?: BCP47LanguageTag | BCP47LanguageTag[],\r
- options?: RelativeTimeFormatOptions,\r
- ): RelativeTimeFormat;\r
-\r
- /**\r
- * Returns an array containing those of the provided locales\r
- * that are supported in date and time formatting\r
- * without having to fall back to the runtime's default locale.\r
- *\r
- * @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.\r
- * For the general form and interpretation of the locales argument,\r
- * see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\r
- *\r
- * @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)\r
- * with some or all of options of the formatting.\r
- * An object with some or all of the following properties:\r
- * - `localeMatcher` - The locale matching algorithm to use.\r
- * Possible values are `"lookup"` and `"best fit"`; the default is `"best fit"`.\r
- * For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).\r
- * - `numeric` - The format of output message.\r
- * Possible values are: `"always"` (default, e.g., `1 day ago`) or `"auto"` (e.g., `yesterday`).\r
- * The `"auto"` value allows to not always have to use numeric values in the output.\r
- * - `style` - The length of the internationalized message. Possible values are:\r
- * `"long"` (default, e.g., in 1 month),\r
- * `"short"` (e.g., in 1 mo.)\r
- * or `"narrow"` (e.g., in 1 mo.). The narrow style could be similar to the short style for some locales.\r
- *\r
- * @returns An array containing those of the provided locales\r
- * that are supported in date and time formatting\r
- * without having to fall back to the runtime's default locale.\r
- *\r
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).\r
- *\r
- * [Specification](https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.supportedLocalesOf).\r
- */\r
- supportedLocalesOf(\r
- locales: BCP47LanguageTag | BCP47LanguageTag[],\r
- options?: RelativeTimeFormatOptions,\r
- ): BCP47LanguageTag[];\r
- };\r
-\r
- interface NumberFormatOptions {\r
- compactDisplay?: string;\r
- notation?: string;\r
- signDisplay?: string;\r
- unit?: string;\r
- unitDisplay?: string;\r
- }\r
-\r
- interface ResolvedNumberFormatOptions {\r
- compactDisplay?: string;\r
- notation?: string;\r
- signDisplay?: string;\r
- unit?: string;\r
- unitDisplay?: string;\r
- }\r
-}\r