@formatjs/ecma402-abstract
Advanced tools
Comparing version 1.0.3 to 1.1.0
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/1009/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-base | ||
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/714/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-base | ||
// composite: false | ||
@@ -4,0 +4,0 @@ // declaration: true |
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/1008/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-esm | ||
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/716/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/ecma402-abstract:dist-esm | ||
// composite: false | ||
@@ -4,0 +4,0 @@ // declaration: true |
@@ -0,16 +1,47 @@ | ||
export * from './src/CanonicalizeLocaleList'; | ||
export * from './src/CanonicalizeTimeZoneName'; | ||
export * from './src/DateTimeFormat/BasicFormatMatcher'; | ||
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher'; | ||
export * from './src/DateTimeFormat/DateTimeStyleFormat'; | ||
export * from './src/DateTimeFormat/FormatDateTime'; | ||
export * from './src/DateTimeFormat/FormatDateTimeToParts'; | ||
export * from './src/DateTimeFormat/InitializeDateTimeFormat'; | ||
export * from './src/DateTimeFormat/PartitionDateTimePattern'; | ||
export * from './src/DateTimeFormat/ToDateTimeOptions'; | ||
export * from './src/GetNumberOption'; | ||
export * from './src/GetOption'; | ||
export * from './src/IsSanctionedSimpleUnitIdentifier'; | ||
export * from './src/IsValidTimeZoneName'; | ||
export * from './src/IsWellFormedCurrencyCode'; | ||
export * from './src/IsWellFormedUnitIdentifier'; | ||
export * from './src/NumberFormat/ComputeExponent'; | ||
export * from './src/NumberFormat/ComputeExponentForMagnitude'; | ||
export * from './src/NumberFormat/CurrencyDigits'; | ||
export * from './src/NumberFormat/FormatNumericToParts'; | ||
export * from './src/NumberFormat/FormatNumericToString'; | ||
export * from './src/NumberFormat/InitializeNumberFormat'; | ||
export * from './src/NumberFormat/PartitionNumberPattern'; | ||
export * from './src/NumberFormat/SetNumberFormatDigitOptions'; | ||
export * from './src/NumberFormat/SetNumberFormatUnitOptions'; | ||
export * from './src/NumberFormat/ToRawFixed'; | ||
export * from './src/NumberFormat/ToRawPrecision'; | ||
export * from './src/PartitionPattern'; | ||
export * from './src/PluralRules/GetOperands'; | ||
export * from './src/PluralRules/InitializePluralRules'; | ||
export * from './src/PluralRules/ResolvePlural'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTime'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts'; | ||
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat'; | ||
export * from './src/RelativeTimeFormat/MakePartsList'; | ||
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern'; | ||
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit'; | ||
export * from './src/ResolveLocale'; | ||
export * from './src/SupportedLocales'; | ||
export { default as _formatToParts } from './src/NumberFormat/format_to_parts'; | ||
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils'; | ||
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, LiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils'; | ||
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data'; | ||
export * from './types/relative-time'; | ||
export * from './types/date-time'; | ||
export * from './types/list'; | ||
@@ -22,2 +53,3 @@ export * from './types/plural-rules'; | ||
export { LocaleData } from './types/core'; | ||
export * from './262'; | ||
//# sourceMappingURL=index.d.ts.map |
56
index.js
@@ -13,22 +13,56 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./src/CanonicalizeLocaleList"), exports); | ||
__exportStar(require("./src/CanonicalizeTimeZoneName"), exports); | ||
__exportStar(require("./src/DateTimeFormat/BasicFormatMatcher"), exports); | ||
var BestFitFormatMatcher_1 = require("./src/DateTimeFormat/BestFitFormatMatcher"); | ||
Object.defineProperty(exports, "BestFitFormatMatcher", { enumerable: true, get: function () { return BestFitFormatMatcher_1.BestFitFormatMatcher; } }); | ||
__exportStar(require("./src/DateTimeFormat/DateTimeStyleFormat"), exports); | ||
__exportStar(require("./src/DateTimeFormat/FormatDateTime"), exports); | ||
__exportStar(require("./src/DateTimeFormat/FormatDateTimeToParts"), exports); | ||
__exportStar(require("./src/DateTimeFormat/InitializeDateTimeFormat"), exports); | ||
__exportStar(require("./src/DateTimeFormat/PartitionDateTimePattern"), exports); | ||
__exportStar(require("./src/DateTimeFormat/ToDateTimeOptions"), exports); | ||
__exportStar(require("./src/GetNumberOption"), exports); | ||
__exportStar(require("./src/GetOption"), exports); | ||
__exportStar(require("./src/IsSanctionedSimpleUnitIdentifier"), exports); | ||
__exportStar(require("./src/IsValidTimeZoneName"), exports); | ||
__exportStar(require("./src/IsWellFormedCurrencyCode"), exports); | ||
__exportStar(require("./src/IsWellFormedUnitIdentifier"), exports); | ||
__exportStar(require("./src/NumberFormat/ComputeExponent"), exports); | ||
__exportStar(require("./src/NumberFormat/ComputeExponentForMagnitude"), exports); | ||
__exportStar(require("./src/NumberFormat/CurrencyDigits"), exports); | ||
__exportStar(require("./src/NumberFormat/FormatNumericToParts"), exports); | ||
__exportStar(require("./src/NumberFormat/FormatNumericToString"), exports); | ||
__exportStar(require("./src/NumberFormat/InitializeNumberFormat"), exports); | ||
__exportStar(require("./src/NumberFormat/PartitionNumberPattern"), exports); | ||
__exportStar(require("./src/NumberFormat/SetNumberFormatDigitOptions"), exports); | ||
__exportStar(require("./src/NumberFormat/SetNumberFormatUnitOptions"), exports); | ||
__exportStar(require("./src/NumberFormat/ToRawFixed"), exports); | ||
__exportStar(require("./src/NumberFormat/ToRawPrecision"), exports); | ||
__exportStar(require("./src/PartitionPattern"), exports); | ||
__exportStar(require("./src/PluralRules/GetOperands"), exports); | ||
__exportStar(require("./src/PluralRules/InitializePluralRules"), exports); | ||
__exportStar(require("./src/PluralRules/ResolvePlural"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/FormatRelativeTime"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/FormatRelativeTimeToParts"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/InitializeRelativeTimeFormat"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/MakePartsList"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/PartitionRelativeTimePattern"), exports); | ||
__exportStar(require("./src/RelativeTimeFormat/SingularRelativeTimeUnit"), exports); | ||
__exportStar(require("./src/ResolveLocale"), exports); | ||
__exportStar(require("./src/SupportedLocales"), exports); | ||
var utils_1 = require("./src/utils"); | ||
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_1.getInternalSlot; } }); | ||
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_1.getMultiInternalSlots; } }); | ||
Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_1.isLiteralPart; } }); | ||
Object.defineProperty(exports, "setInternalSlot", { enumerable: true, get: function () { return utils_1.setInternalSlot; } }); | ||
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_1.setMultiInternalSlots; } }); | ||
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_1.getMagnitude; } }); | ||
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } }); | ||
var format_to_parts_1 = require("./src/NumberFormat/format_to_parts"); | ||
Object.defineProperty(exports, "_formatToParts", { enumerable: true, get: function () { return format_to_parts_1.default; } }); | ||
var utils_1 = require("./src/DateTimeFormat/utils"); | ||
Object.defineProperty(exports, "DATE_TIME_PROPS", { enumerable: true, get: function () { return utils_1.DATE_TIME_PROPS; } }); | ||
var skeleton_1 = require("./src/DateTimeFormat/skeleton"); | ||
Object.defineProperty(exports, "parseDateTimeSkeleton", { enumerable: true, get: function () { return skeleton_1.parseDateTimeSkeleton; } }); | ||
var utils_2 = require("./src/utils"); | ||
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_2.getInternalSlot; } }); | ||
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_2.getMultiInternalSlots; } }); | ||
Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_2.isLiteralPart; } }); | ||
Object.defineProperty(exports, "setInternalSlot", { enumerable: true, get: function () { return utils_2.setInternalSlot; } }); | ||
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_2.setMultiInternalSlots; } }); | ||
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_2.getMagnitude; } }); | ||
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_2.defineProperty; } }); | ||
var data_1 = require("./src/data"); | ||
@@ -39,2 +73,3 @@ Object.defineProperty(exports, "getLocaleHierarchy", { enumerable: true, get: function () { return data_1.getLocaleHierarchy; } }); | ||
__exportStar(require("./types/relative-time"), exports); | ||
__exportStar(require("./types/date-time"), exports); | ||
__exportStar(require("./types/list"), exports); | ||
@@ -44,3 +79,4 @@ __exportStar(require("./types/plural-rules"), exports); | ||
__exportStar(require("./types/displaynames"), exports); | ||
var utils_2 = require("./src/utils"); | ||
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_2.invariant; } }); | ||
var utils_3 = require("./src/utils"); | ||
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_3.invariant; } }); | ||
__exportStar(require("./262"), exports); |
@@ -0,16 +1,47 @@ | ||
export * from './src/CanonicalizeLocaleList'; | ||
export * from './src/CanonicalizeTimeZoneName'; | ||
export * from './src/DateTimeFormat/BasicFormatMatcher'; | ||
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher'; | ||
export * from './src/DateTimeFormat/DateTimeStyleFormat'; | ||
export * from './src/DateTimeFormat/FormatDateTime'; | ||
export * from './src/DateTimeFormat/FormatDateTimeToParts'; | ||
export * from './src/DateTimeFormat/InitializeDateTimeFormat'; | ||
export * from './src/DateTimeFormat/PartitionDateTimePattern'; | ||
export * from './src/DateTimeFormat/ToDateTimeOptions'; | ||
export * from './src/GetNumberOption'; | ||
export * from './src/GetOption'; | ||
export * from './src/IsSanctionedSimpleUnitIdentifier'; | ||
export * from './src/IsValidTimeZoneName'; | ||
export * from './src/IsWellFormedCurrencyCode'; | ||
export * from './src/IsWellFormedUnitIdentifier'; | ||
export * from './src/NumberFormat/ComputeExponent'; | ||
export * from './src/NumberFormat/ComputeExponentForMagnitude'; | ||
export * from './src/NumberFormat/CurrencyDigits'; | ||
export * from './src/NumberFormat/FormatNumericToParts'; | ||
export * from './src/NumberFormat/FormatNumericToString'; | ||
export * from './src/NumberFormat/InitializeNumberFormat'; | ||
export * from './src/NumberFormat/PartitionNumberPattern'; | ||
export * from './src/NumberFormat/SetNumberFormatDigitOptions'; | ||
export * from './src/NumberFormat/SetNumberFormatUnitOptions'; | ||
export * from './src/NumberFormat/ToRawFixed'; | ||
export * from './src/NumberFormat/ToRawPrecision'; | ||
export * from './src/PartitionPattern'; | ||
export * from './src/PluralRules/GetOperands'; | ||
export * from './src/PluralRules/InitializePluralRules'; | ||
export * from './src/PluralRules/ResolvePlural'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTime'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts'; | ||
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat'; | ||
export * from './src/RelativeTimeFormat/MakePartsList'; | ||
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern'; | ||
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit'; | ||
export * from './src/ResolveLocale'; | ||
export * from './src/SupportedLocales'; | ||
export { default as _formatToParts } from './src/NumberFormat/format_to_parts'; | ||
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils'; | ||
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, LiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils'; | ||
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data'; | ||
export * from './types/relative-time'; | ||
export * from './types/date-time'; | ||
export * from './types/list'; | ||
@@ -22,2 +53,3 @@ export * from './types/plural-rules'; | ||
export { LocaleData } from './types/core'; | ||
export * from './262'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,16 +1,47 @@ | ||
export * from './src/CanonicalizeLocaleList'; | ||
export * from './src/CanonicalizeTimeZoneName'; | ||
export * from './src/DateTimeFormat/BasicFormatMatcher'; | ||
export { BestFitFormatMatcher } from './src/DateTimeFormat/BestFitFormatMatcher'; | ||
export * from './src/DateTimeFormat/DateTimeStyleFormat'; | ||
export * from './src/DateTimeFormat/FormatDateTime'; | ||
export * from './src/DateTimeFormat/FormatDateTimeToParts'; | ||
export * from './src/DateTimeFormat/InitializeDateTimeFormat'; | ||
export * from './src/DateTimeFormat/PartitionDateTimePattern'; | ||
export * from './src/DateTimeFormat/ToDateTimeOptions'; | ||
export * from './src/GetNumberOption'; | ||
export * from './src/GetOption'; | ||
export * from './src/IsSanctionedSimpleUnitIdentifier'; | ||
export * from './src/IsValidTimeZoneName'; | ||
export * from './src/IsWellFormedCurrencyCode'; | ||
export * from './src/IsWellFormedUnitIdentifier'; | ||
export * from './src/NumberFormat/ComputeExponent'; | ||
export * from './src/NumberFormat/ComputeExponentForMagnitude'; | ||
export * from './src/NumberFormat/CurrencyDigits'; | ||
export * from './src/NumberFormat/FormatNumericToParts'; | ||
export * from './src/NumberFormat/FormatNumericToString'; | ||
export * from './src/NumberFormat/InitializeNumberFormat'; | ||
export * from './src/NumberFormat/PartitionNumberPattern'; | ||
export * from './src/NumberFormat/SetNumberFormatDigitOptions'; | ||
export * from './src/NumberFormat/SetNumberFormatUnitOptions'; | ||
export * from './src/NumberFormat/ToRawFixed'; | ||
export * from './src/NumberFormat/ToRawPrecision'; | ||
export * from './src/PartitionPattern'; | ||
export * from './src/PluralRules/GetOperands'; | ||
export * from './src/PluralRules/InitializePluralRules'; | ||
export * from './src/PluralRules/ResolvePlural'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTime'; | ||
export * from './src/RelativeTimeFormat/FormatRelativeTimeToParts'; | ||
export * from './src/RelativeTimeFormat/InitializeRelativeTimeFormat'; | ||
export * from './src/RelativeTimeFormat/MakePartsList'; | ||
export * from './src/RelativeTimeFormat/PartitionRelativeTimePattern'; | ||
export * from './src/RelativeTimeFormat/SingularRelativeTimeUnit'; | ||
export * from './src/ResolveLocale'; | ||
export * from './src/SupportedLocales'; | ||
export { default as _formatToParts } from './src/NumberFormat/format_to_parts'; | ||
export { DATE_TIME_PROPS } from './src/DateTimeFormat/utils'; | ||
export { parseDateTimeSkeleton } from './src/DateTimeFormat/skeleton'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './src/utils'; | ||
export { getLocaleHierarchy, unpackData, isMissingLocaleDataError, } from './src/data'; | ||
export * from './types/relative-time'; | ||
export * from './types/date-time'; | ||
export * from './types/list'; | ||
@@ -21,1 +52,2 @@ export * from './types/plural-rules'; | ||
export { invariant } from './src/utils'; | ||
export * from './262'; |
@@ -1,2 +0,2 @@ | ||
import ToString from 'es-abstract/2019/ToString'; | ||
import { ToString } from '../262'; | ||
/** | ||
@@ -3,0 +3,0 @@ * https://tc39.es/ecma402/#sec-getoption |
@@ -1,2 +0,2 @@ | ||
import SameValue from 'es-abstract/5/SameValue'; | ||
import { SameValue } from '../../262'; | ||
import { ToRawPrecision } from './ToRawPrecision'; | ||
@@ -3,0 +3,0 @@ import { repeat } from '../utils'; |
@@ -1,2 +0,2 @@ | ||
import ToObject from 'es-abstract/2019/ToObject'; | ||
import { ToObject } from '../262'; | ||
import { GetOption } from './GetOption'; | ||
@@ -3,0 +3,0 @@ import { LookupSupportedLocales } from './LookupSupportedLocales'; |
@@ -101,2 +101,46 @@ import { LDMLPluralRule } from './plural-rules'; | ||
} | ||
export declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit'; | ||
export declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit'; | ||
export declare type NumberFormatOptionsCompactDisplay = 'short' | 'long'; | ||
export declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol'; | ||
export declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting'; | ||
export declare type NumberFormatOptionsNotation = NumberFormatNotation; | ||
export declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero'; | ||
export declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow'; | ||
export interface NumberFormatInternal extends NumberFormatDigitInternalSlots { | ||
locale: string; | ||
dataLocale: string; | ||
style: NumberFormatOptionsStyle; | ||
currency?: string; | ||
currencyDisplay: NumberFormatOptionsCurrencyDisplay; | ||
unit?: string; | ||
unitDisplay: NumberFormatOptionsUnitDisplay; | ||
currencySign: NumberFormatOptionsCurrencySign; | ||
notation: NumberFormatOptionsNotation; | ||
compactDisplay: NumberFormatOptionsCompactDisplay; | ||
signDisplay: NumberFormatOptionsSignDisplay; | ||
useGrouping: boolean; | ||
pl: Intl.PluralRules; | ||
boundFormat?: Intl.NumberFormat['format']; | ||
numberingSystem: string; | ||
dataLocaleData: NumberFormatLocaleInternalData; | ||
} | ||
export declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & { | ||
localeMatcher?: NumberFormatOptionsLocaleMatcher; | ||
style?: NumberFormatOptionsStyle; | ||
compactDisplay?: NumberFormatOptionsCompactDisplay; | ||
currencyDisplay?: NumberFormatOptionsCurrencyDisplay; | ||
currencySign?: NumberFormatOptionsCurrencySign; | ||
notation?: NumberFormatOptionsNotation; | ||
signDisplay?: NumberFormatOptionsSignDisplay; | ||
unit?: string; | ||
unitDisplay?: NumberFormatOptionsUnitDisplay; | ||
numberingSystem?: string; | ||
}; | ||
export declare type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick<NumberFormatInternal, 'currencySign' | 'unit' | 'unitDisplay' | 'notation' | 'compactDisplay' | 'signDisplay'>; | ||
export declare type NumberFormatPartTypes = Intl.NumberFormatPartTypes | 'exponentSeparator' | 'exponentMinusSign' | 'exponentInteger' | 'compact' | 'unit' | 'literal'; | ||
export interface NumberFormatPart { | ||
type: NumberFormatPartTypes; | ||
value: string; | ||
} | ||
//# sourceMappingURL=number.d.ts.map |
import { LocaleData } from './core'; | ||
import { NumberFormatDigitInternalSlots } from './number'; | ||
export declare type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; | ||
@@ -11,2 +12,7 @@ export interface PluralRulesData { | ||
export declare type PluralRulesLocaleData = LocaleData<PluralRulesData>; | ||
export interface PluralRulesInternal extends NumberFormatDigitInternalSlots { | ||
initializedPluralRules: boolean; | ||
locale: string; | ||
type: 'cardinal' | 'ordinal'; | ||
} | ||
//# sourceMappingURL=plural-rules.d.ts.map |
import { LocaleData } from './core'; | ||
import { LDMLPluralRule } from './plural-rules'; | ||
import { LiteralPart } from '../src/utils'; | ||
export interface FieldData { | ||
@@ -29,3 +30,65 @@ '0'?: string; | ||
export declare type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>; | ||
export declare type RelativeTimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; | ||
export declare type RelativeTimeUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; | ||
export declare type RelativeTimeFormattableUnit = RelativeTimeUnit | RelativeTimeUnits; | ||
export declare type RelativeTimePart = LiteralPart | RelativeTimeFormatNumberPart; | ||
export interface RelativeTimeFormatNumberPart extends Intl.NumberFormatPart { | ||
unit: RelativeTimeUnit; | ||
} | ||
export interface IntlRelativeTimeFormatOptions { | ||
/** | ||
* The locale matching algorithm to use. | ||
* Possible values are "lookup" and "best fit"; the default is "best fit". | ||
* For information about this option, see | ||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation. | ||
*/ | ||
localeMatcher?: 'best fit' | 'lookup'; | ||
/** | ||
* The format of output message. Possible values are: | ||
* - "always" (default, e.g., 1 day ago), | ||
* - or "auto" (e.g., yesterday). | ||
* The "auto" value allows to not always have to | ||
* use numeric values in the output. | ||
*/ | ||
numeric?: 'always' | 'auto'; | ||
/** | ||
* The length of the internationalized message. Possible values are: | ||
* - "long" (default, e.g., in 1 month) | ||
* - "short" (e.g., in 1 mo.), | ||
* - or "narrow" (e.g., in 1 mo.). | ||
* The narrow style could be similar to the short style for some locales. | ||
*/ | ||
style?: 'long' | 'short' | 'narrow'; | ||
} | ||
export interface ResolvedIntlRelativeTimeFormatOptions extends Pick<IntlRelativeTimeFormatOptions, 'style' | 'numeric'> { | ||
/** | ||
* The BCP 47 language tag for the locale actually used. | ||
* If any Unicode extension values were requested in the | ||
* input BCP 47 language tag that led to this locale, | ||
* the key-value pairs that were requested and are | ||
* supported for this locale are included in locale. | ||
*/ | ||
locale: string; | ||
/** | ||
* The value requested using the Unicode | ||
* extension key "nu" or filled in as a default. | ||
*/ | ||
numberingSystem: string; | ||
} | ||
export interface RelativeTimeFormat { | ||
format(value: number, unit: RelativeTimeFormattableUnit): string; | ||
formatToParts(value: number, unit: RelativeTimeFormattableUnit): RelativeTimePart[]; | ||
resolvedOptions(): ResolvedIntlRelativeTimeFormatOptions; | ||
} | ||
export interface RelativeTimeFormatInternal { | ||
numberFormat: Intl.NumberFormat; | ||
pluralRules: Intl.PluralRules; | ||
locale: string; | ||
fields: LocaleFieldsData; | ||
style: IntlRelativeTimeFormatOptions['style']; | ||
numeric: IntlRelativeTimeFormatOptions['numeric']; | ||
numberingSystem: string; | ||
initializedRelativeTimeFormat: boolean; | ||
} | ||
export {}; | ||
//# sourceMappingURL=relative-time.d.ts.map |
{ | ||
"name": "@formatjs/ecma402-abstract", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "A collection of implementation for ECMAScript abstract operations", | ||
@@ -30,7 +30,3 @@ "keywords": [ | ||
"license": "MIT", | ||
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c", | ||
"dependencies": { | ||
"@types/es-abstract": "^1.17.1", | ||
"es-abstract": "^1.17.6" | ||
} | ||
"gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c" | ||
} |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GetOption = void 0; | ||
var ToString_1 = __importDefault(require("es-abstract/2019/ToString")); | ||
var _262_1 = require("../262"); | ||
/** | ||
@@ -27,3 +24,3 @@ * https://tc39.es/ecma402/#sec-getoption | ||
if (type === 'string') { | ||
value = ToString_1.default(value); | ||
value = _262_1.ToString(value); | ||
} | ||
@@ -30,0 +27,0 @@ if (values !== undefined && !values.filter(function (val) { return val == value; }).length) { |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FormatNumericToString = void 0; | ||
var SameValue_1 = __importDefault(require("es-abstract/5/SameValue")); | ||
var _262_1 = require("../../262"); | ||
var ToRawPrecision_1 = require("./ToRawPrecision"); | ||
@@ -15,3 +12,3 @@ var utils_1 = require("../utils"); | ||
function FormatNumericToString(intlObject, x) { | ||
var isNegative = x < 0 || SameValue_1.default(x, -0); | ||
var isNegative = x < 0 || _262_1.SameValue(x, -0); | ||
if (isNegative) { | ||
@@ -18,0 +15,0 @@ x = -x; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SupportedLocales = void 0; | ||
var ToObject_1 = __importDefault(require("es-abstract/2019/ToObject")); | ||
var _262_1 = require("../262"); | ||
var GetOption_1 = require("./GetOption"); | ||
@@ -19,3 +16,3 @@ var LookupSupportedLocales_1 = require("./LookupSupportedLocales"); | ||
if (options !== undefined) { | ||
options = ToObject_1.default(options); | ||
options = _262_1.ToObject(options); | ||
matcher = GetOption_1.GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit'); | ||
@@ -22,0 +19,0 @@ } |
@@ -101,2 +101,46 @@ import { LDMLPluralRule } from './plural-rules'; | ||
} | ||
export declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit'; | ||
export declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit'; | ||
export declare type NumberFormatOptionsCompactDisplay = 'short' | 'long'; | ||
export declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol'; | ||
export declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting'; | ||
export declare type NumberFormatOptionsNotation = NumberFormatNotation; | ||
export declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero'; | ||
export declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow'; | ||
export interface NumberFormatInternal extends NumberFormatDigitInternalSlots { | ||
locale: string; | ||
dataLocale: string; | ||
style: NumberFormatOptionsStyle; | ||
currency?: string; | ||
currencyDisplay: NumberFormatOptionsCurrencyDisplay; | ||
unit?: string; | ||
unitDisplay: NumberFormatOptionsUnitDisplay; | ||
currencySign: NumberFormatOptionsCurrencySign; | ||
notation: NumberFormatOptionsNotation; | ||
compactDisplay: NumberFormatOptionsCompactDisplay; | ||
signDisplay: NumberFormatOptionsSignDisplay; | ||
useGrouping: boolean; | ||
pl: Intl.PluralRules; | ||
boundFormat?: Intl.NumberFormat['format']; | ||
numberingSystem: string; | ||
dataLocaleData: NumberFormatLocaleInternalData; | ||
} | ||
export declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & { | ||
localeMatcher?: NumberFormatOptionsLocaleMatcher; | ||
style?: NumberFormatOptionsStyle; | ||
compactDisplay?: NumberFormatOptionsCompactDisplay; | ||
currencyDisplay?: NumberFormatOptionsCurrencyDisplay; | ||
currencySign?: NumberFormatOptionsCurrencySign; | ||
notation?: NumberFormatOptionsNotation; | ||
signDisplay?: NumberFormatOptionsSignDisplay; | ||
unit?: string; | ||
unitDisplay?: NumberFormatOptionsUnitDisplay; | ||
numberingSystem?: string; | ||
}; | ||
export declare type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick<NumberFormatInternal, 'currencySign' | 'unit' | 'unitDisplay' | 'notation' | 'compactDisplay' | 'signDisplay'>; | ||
export declare type NumberFormatPartTypes = Intl.NumberFormatPartTypes | 'exponentSeparator' | 'exponentMinusSign' | 'exponentInteger' | 'compact' | 'unit' | 'literal'; | ||
export interface NumberFormatPart { | ||
type: NumberFormatPartTypes; | ||
value: string; | ||
} | ||
//# sourceMappingURL=number.d.ts.map |
import { LocaleData } from './core'; | ||
import { NumberFormatDigitInternalSlots } from './number'; | ||
export declare type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; | ||
@@ -11,2 +12,7 @@ export interface PluralRulesData { | ||
export declare type PluralRulesLocaleData = LocaleData<PluralRulesData>; | ||
export interface PluralRulesInternal extends NumberFormatDigitInternalSlots { | ||
initializedPluralRules: boolean; | ||
locale: string; | ||
type: 'cardinal' | 'ordinal'; | ||
} | ||
//# sourceMappingURL=plural-rules.d.ts.map |
import { LocaleData } from './core'; | ||
import { LDMLPluralRule } from './plural-rules'; | ||
import { LiteralPart } from '../src/utils'; | ||
export interface FieldData { | ||
@@ -29,3 +30,65 @@ '0'?: string; | ||
export declare type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>; | ||
export declare type RelativeTimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year'; | ||
export declare type RelativeTimeUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years'; | ||
export declare type RelativeTimeFormattableUnit = RelativeTimeUnit | RelativeTimeUnits; | ||
export declare type RelativeTimePart = LiteralPart | RelativeTimeFormatNumberPart; | ||
export interface RelativeTimeFormatNumberPart extends Intl.NumberFormatPart { | ||
unit: RelativeTimeUnit; | ||
} | ||
export interface IntlRelativeTimeFormatOptions { | ||
/** | ||
* The locale matching algorithm to use. | ||
* Possible values are "lookup" and "best fit"; the default is "best fit". | ||
* For information about this option, see | ||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation. | ||
*/ | ||
localeMatcher?: 'best fit' | 'lookup'; | ||
/** | ||
* The format of output message. Possible values are: | ||
* - "always" (default, e.g., 1 day ago), | ||
* - or "auto" (e.g., yesterday). | ||
* The "auto" value allows to not always have to | ||
* use numeric values in the output. | ||
*/ | ||
numeric?: 'always' | 'auto'; | ||
/** | ||
* The length of the internationalized message. Possible values are: | ||
* - "long" (default, e.g., in 1 month) | ||
* - "short" (e.g., in 1 mo.), | ||
* - or "narrow" (e.g., in 1 mo.). | ||
* The narrow style could be similar to the short style for some locales. | ||
*/ | ||
style?: 'long' | 'short' | 'narrow'; | ||
} | ||
export interface ResolvedIntlRelativeTimeFormatOptions extends Pick<IntlRelativeTimeFormatOptions, 'style' | 'numeric'> { | ||
/** | ||
* The BCP 47 language tag for the locale actually used. | ||
* If any Unicode extension values were requested in the | ||
* input BCP 47 language tag that led to this locale, | ||
* the key-value pairs that were requested and are | ||
* supported for this locale are included in locale. | ||
*/ | ||
locale: string; | ||
/** | ||
* The value requested using the Unicode | ||
* extension key "nu" or filled in as a default. | ||
*/ | ||
numberingSystem: string; | ||
} | ||
export interface RelativeTimeFormat { | ||
format(value: number, unit: RelativeTimeFormattableUnit): string; | ||
formatToParts(value: number, unit: RelativeTimeFormattableUnit): RelativeTimePart[]; | ||
resolvedOptions(): ResolvedIntlRelativeTimeFormatOptions; | ||
} | ||
export interface RelativeTimeFormatInternal { | ||
numberFormat: Intl.NumberFormat; | ||
pluralRules: Intl.PluralRules; | ||
locale: string; | ||
fields: LocaleFieldsData; | ||
style: IntlRelativeTimeFormatOptions['style']; | ||
numeric: IntlRelativeTimeFormatOptions['numeric']; | ||
numberingSystem: string; | ||
initializedRelativeTimeFormat: boolean; | ||
} | ||
export {}; | ||
//# sourceMappingURL=relative-time.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
438452
0
373
8608
- Removed@types/es-abstract@^1.17.1
- Removedes-abstract@^1.17.6
- Removed@types/es-abstract@1.17.8(transitive)
- Removed@types/es-to-primitive@1.2.7(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-abstract@1.23.3(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.2(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)