@formatjs/ecma402-abstract 1.0.3 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/262.d.ts +79 -0
  2. package/262.d.ts.map +1 -0
  3. package/262.js +336 -0
  4. package/_validate_dist-base_options.optionsvalid.d.ts +2 -1
  5. package/_validate_dist-esm_options.optionsvalid.d.ts +2 -1
  6. package/index.d.ts +33 -0
  7. package/index.d.ts.map +1 -1
  8. package/index.js +52 -11
  9. package/lib/262.d.ts +79 -0
  10. package/lib/262.d.ts.map +1 -0
  11. package/lib/262.js +312 -0
  12. package/lib/index.d.ts +33 -0
  13. package/lib/index.d.ts.map +1 -1
  14. package/lib/index.js +33 -0
  15. package/lib/src/CanonicalizeLocaleList.d.ts +6 -0
  16. package/lib/src/CanonicalizeLocaleList.d.ts.map +1 -0
  17. package/lib/src/CanonicalizeLocaleList.js +8 -0
  18. package/lib/src/CanonicalizeTimeZoneName.d.ts +9 -0
  19. package/lib/src/CanonicalizeTimeZoneName.d.ts.map +1 -0
  20. package/lib/src/CanonicalizeTimeZoneName.js +17 -0
  21. package/lib/src/DateTimeFormat/BasicFormatMatcher.d.ts +8 -0
  22. package/lib/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
  23. package/lib/src/DateTimeFormat/BasicFormatMatcher.js +61 -0
  24. package/lib/src/DateTimeFormat/BestFitFormatMatcher.d.ts +17 -0
  25. package/lib/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
  26. package/lib/src/DateTimeFormat/BestFitFormatMatcher.js +119 -0
  27. package/lib/src/DateTimeFormat/DateTimeStyleFormat.d.ts +3 -0
  28. package/lib/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
  29. package/lib/src/DateTimeFormat/DateTimeStyleFormat.js +50 -0
  30. package/lib/src/DateTimeFormat/FormatDateTime.d.ts +8 -0
  31. package/lib/src/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
  32. package/lib/src/DateTimeFormat/FormatDateTime.js +15 -0
  33. package/lib/src/DateTimeFormat/FormatDateTimeToParts.d.ts +10 -0
  34. package/lib/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
  35. package/lib/src/DateTimeFormat/FormatDateTimeToParts.js +21 -0
  36. package/lib/src/DateTimeFormat/InitializeDateTimeFormat.d.ts +18 -0
  37. package/lib/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
  38. package/lib/src/DateTimeFormat/InitializeDateTimeFormat.js +163 -0
  39. package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts +13 -0
  40. package/lib/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
  41. package/lib/src/DateTimeFormat/PartitionDateTimePattern.js +176 -0
  42. package/lib/src/DateTimeFormat/ToDateTimeOptions.d.ts +9 -0
  43. package/lib/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
  44. package/lib/src/DateTimeFormat/ToDateTimeOptions.js +57 -0
  45. package/lib/src/DateTimeFormat/ToLocalTime.d.ts +24 -0
  46. package/lib/src/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
  47. package/lib/src/DateTimeFormat/ToLocalTime.js +49 -0
  48. package/lib/src/DateTimeFormat/skeleton.d.ts +9 -0
  49. package/lib/src/DateTimeFormat/skeleton.d.ts.map +1 -0
  50. package/lib/src/DateTimeFormat/skeleton.js +163 -0
  51. package/lib/src/DateTimeFormat/utils.d.ts +10 -0
  52. package/lib/src/DateTimeFormat/utils.d.ts.map +1 -0
  53. package/lib/src/DateTimeFormat/utils.js +18 -0
  54. package/lib/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts +2 -0
  55. package/lib/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
  56. package/lib/src/DisplayNames/CanonicalCodeForDisplayNames.js +33 -0
  57. package/lib/src/GetOption.js +1 -1
  58. package/lib/src/IsValidTimeZoneName.d.ts +10 -0
  59. package/lib/src/IsValidTimeZoneName.d.ts.map +1 -0
  60. package/lib/src/IsValidTimeZoneName.js +11 -0
  61. package/lib/src/NumberFormat/ComputeExponent.d.ts +12 -0
  62. package/lib/src/NumberFormat/ComputeExponent.d.ts.map +1 -0
  63. package/lib/src/NumberFormat/ComputeExponent.js +39 -0
  64. package/lib/src/NumberFormat/ComputeExponentForMagnitude.d.ts +10 -0
  65. package/lib/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  66. package/lib/src/NumberFormat/ComputeExponentForMagnitude.js +60 -0
  67. package/lib/src/NumberFormat/CurrencyDigits.d.ts +7 -0
  68. package/lib/src/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  69. package/lib/src/NumberFormat/CurrencyDigits.js +10 -0
  70. package/lib/src/NumberFormat/FormatNumericToParts.d.ts +5 -0
  71. package/lib/src/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  72. package/lib/src/NumberFormat/FormatNumericToParts.js +14 -0
  73. package/lib/src/NumberFormat/FormatNumericToString.js +1 -1
  74. package/lib/src/NumberFormat/InitializeNumberFormat.d.ts +13 -0
  75. package/lib/src/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  76. package/lib/src/NumberFormat/InitializeNumberFormat.js +71 -0
  77. package/lib/src/NumberFormat/PartitionNumberPattern.d.ts +8 -0
  78. package/lib/src/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  79. package/lib/src/NumberFormat/PartitionNumberPattern.js +74 -0
  80. package/lib/src/NumberFormat/SetNumberFormatUnitOptions.d.ts +8 -0
  81. package/lib/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  82. package/lib/src/NumberFormat/SetNumberFormatUnitOptions.js +39 -0
  83. package/lib/src/NumberFormat/digit-mapping.json +1 -0
  84. package/lib/src/NumberFormat/format_to_parts.d.ts +22 -0
  85. package/lib/src/NumberFormat/format_to_parts.d.ts.map +1 -0
  86. package/lib/src/NumberFormat/format_to_parts.js +421 -0
  87. package/lib/src/PluralRules/GetOperands.d.ts +32 -0
  88. package/lib/src/PluralRules/GetOperands.d.ts.map +1 -0
  89. package/lib/src/PluralRules/GetOperands.js +47 -0
  90. package/lib/src/PluralRules/InitializePluralRules.d.ts +9 -0
  91. package/lib/src/PluralRules/InitializePluralRules.d.ts.map +1 -0
  92. package/lib/src/PluralRules/InitializePluralRules.js +20 -0
  93. package/lib/src/PluralRules/ResolvePlural.d.ts +13 -0
  94. package/lib/src/PluralRules/ResolvePlural.d.ts.map +1 -0
  95. package/lib/src/PluralRules/ResolvePlural.js +25 -0
  96. package/lib/src/RelativeTimeFormat/FormatRelativeTime.d.ts +5 -0
  97. package/lib/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
  98. package/lib/src/RelativeTimeFormat/FormatRelativeTime.js +10 -0
  99. package/lib/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts +5 -0
  100. package/lib/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
  101. package/lib/src/RelativeTimeFormat/FormatRelativeTimeToParts.js +18 -0
  102. package/lib/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts +9 -0
  103. package/lib/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
  104. package/lib/src/RelativeTimeFormat/InitializeRelativeTimeFormat.js +32 -0
  105. package/lib/src/RelativeTimeFormat/MakePartsList.d.ts +3 -0
  106. package/lib/src/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
  107. package/lib/src/RelativeTimeFormat/MakePartsList.js +27 -0
  108. package/lib/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts +5 -0
  109. package/lib/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
  110. package/lib/src/RelativeTimeFormat/PartitionRelativeTimePattern.js +54 -0
  111. package/lib/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts +7 -0
  112. package/lib/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
  113. package/lib/src/RelativeTimeFormat/SingularRelativeTimeUnit.js +36 -0
  114. package/lib/src/SupportedLocales.js +1 -1
  115. package/lib/src/data.js +1 -1
  116. package/lib/types/core.js +1 -0
  117. package/lib/types/date-time.d.ts +112 -0
  118. package/lib/types/date-time.d.ts.map +1 -0
  119. package/lib/types/date-time.js +1 -0
  120. package/lib/types/displaynames.js +1 -0
  121. package/lib/types/list.js +1 -0
  122. package/lib/types/number.d.ts +44 -0
  123. package/lib/types/number.d.ts.map +1 -1
  124. package/lib/types/number.js +1 -0
  125. package/lib/types/plural-rules.d.ts +6 -0
  126. package/lib/types/plural-rules.d.ts.map +1 -1
  127. package/lib/types/plural-rules.js +1 -0
  128. package/lib/types/relative-time.d.ts +63 -0
  129. package/lib/types/relative-time.d.ts.map +1 -1
  130. package/lib/types/relative-time.js +1 -0
  131. package/package.json +2 -6
  132. package/src/CanonicalizeLocaleList.d.ts +6 -0
  133. package/src/CanonicalizeLocaleList.d.ts.map +1 -0
  134. package/src/CanonicalizeLocaleList.js +12 -0
  135. package/src/CanonicalizeTimeZoneName.d.ts +9 -0
  136. package/src/CanonicalizeTimeZoneName.d.ts.map +1 -0
  137. package/src/CanonicalizeTimeZoneName.js +21 -0
  138. package/src/DateTimeFormat/BasicFormatMatcher.d.ts +8 -0
  139. package/src/DateTimeFormat/BasicFormatMatcher.d.ts.map +1 -0
  140. package/src/DateTimeFormat/BasicFormatMatcher.js +65 -0
  141. package/src/DateTimeFormat/BestFitFormatMatcher.d.ts +17 -0
  142. package/src/DateTimeFormat/BestFitFormatMatcher.d.ts.map +1 -0
  143. package/src/DateTimeFormat/BestFitFormatMatcher.js +124 -0
  144. package/src/DateTimeFormat/DateTimeStyleFormat.d.ts +3 -0
  145. package/src/DateTimeFormat/DateTimeStyleFormat.d.ts.map +1 -0
  146. package/src/DateTimeFormat/DateTimeStyleFormat.js +54 -0
  147. package/src/DateTimeFormat/FormatDateTime.d.ts +8 -0
  148. package/src/DateTimeFormat/FormatDateTime.d.ts.map +1 -0
  149. package/src/DateTimeFormat/FormatDateTime.js +19 -0
  150. package/src/DateTimeFormat/FormatDateTimeToParts.d.ts +10 -0
  151. package/src/DateTimeFormat/FormatDateTimeToParts.d.ts.map +1 -0
  152. package/src/DateTimeFormat/FormatDateTimeToParts.js +25 -0
  153. package/src/DateTimeFormat/InitializeDateTimeFormat.d.ts +18 -0
  154. package/src/DateTimeFormat/InitializeDateTimeFormat.d.ts.map +1 -0
  155. package/src/DateTimeFormat/InitializeDateTimeFormat.js +167 -0
  156. package/src/DateTimeFormat/PartitionDateTimePattern.d.ts +13 -0
  157. package/src/DateTimeFormat/PartitionDateTimePattern.d.ts.map +1 -0
  158. package/src/DateTimeFormat/PartitionDateTimePattern.js +180 -0
  159. package/src/DateTimeFormat/ToDateTimeOptions.d.ts +9 -0
  160. package/src/DateTimeFormat/ToDateTimeOptions.d.ts.map +1 -0
  161. package/src/DateTimeFormat/ToDateTimeOptions.js +61 -0
  162. package/src/DateTimeFormat/ToLocalTime.d.ts +24 -0
  163. package/src/DateTimeFormat/ToLocalTime.d.ts.map +1 -0
  164. package/src/DateTimeFormat/ToLocalTime.js +53 -0
  165. package/src/DateTimeFormat/skeleton.d.ts +9 -0
  166. package/src/DateTimeFormat/skeleton.d.ts.map +1 -0
  167. package/src/DateTimeFormat/skeleton.js +167 -0
  168. package/src/DateTimeFormat/utils.d.ts +10 -0
  169. package/src/DateTimeFormat/utils.d.ts.map +1 -0
  170. package/src/DateTimeFormat/utils.js +21 -0
  171. package/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts +2 -0
  172. package/src/DisplayNames/CanonicalCodeForDisplayNames.d.ts.map +1 -0
  173. package/src/DisplayNames/CanonicalCodeForDisplayNames.js +37 -0
  174. package/src/GetOption.js +2 -5
  175. package/src/IsValidTimeZoneName.d.ts +10 -0
  176. package/src/IsValidTimeZoneName.d.ts.map +1 -0
  177. package/src/IsValidTimeZoneName.js +15 -0
  178. package/src/NumberFormat/ComputeExponent.d.ts +12 -0
  179. package/src/NumberFormat/ComputeExponent.d.ts.map +1 -0
  180. package/src/NumberFormat/ComputeExponent.js +43 -0
  181. package/src/NumberFormat/ComputeExponentForMagnitude.d.ts +10 -0
  182. package/src/NumberFormat/ComputeExponentForMagnitude.d.ts.map +1 -0
  183. package/src/NumberFormat/ComputeExponentForMagnitude.js +64 -0
  184. package/src/NumberFormat/CurrencyDigits.d.ts +7 -0
  185. package/src/NumberFormat/CurrencyDigits.d.ts.map +1 -0
  186. package/src/NumberFormat/CurrencyDigits.js +14 -0
  187. package/src/NumberFormat/FormatNumericToParts.d.ts +5 -0
  188. package/src/NumberFormat/FormatNumericToParts.d.ts.map +1 -0
  189. package/src/NumberFormat/FormatNumericToParts.js +18 -0
  190. package/src/NumberFormat/FormatNumericToString.js +2 -5
  191. package/src/NumberFormat/InitializeNumberFormat.d.ts +13 -0
  192. package/src/NumberFormat/InitializeNumberFormat.d.ts.map +1 -0
  193. package/src/NumberFormat/InitializeNumberFormat.js +75 -0
  194. package/src/NumberFormat/PartitionNumberPattern.d.ts +8 -0
  195. package/src/NumberFormat/PartitionNumberPattern.d.ts.map +1 -0
  196. package/src/NumberFormat/PartitionNumberPattern.js +81 -0
  197. package/src/NumberFormat/SetNumberFormatUnitOptions.d.ts +8 -0
  198. package/src/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +1 -0
  199. package/src/NumberFormat/SetNumberFormatUnitOptions.js +43 -0
  200. package/src/NumberFormat/digit-mapping.json +1 -0
  201. package/src/NumberFormat/format_to_parts.d.ts +22 -0
  202. package/src/NumberFormat/format_to_parts.d.ts.map +1 -0
  203. package/src/NumberFormat/format_to_parts.js +443 -0
  204. package/src/PluralRules/GetOperands.d.ts +32 -0
  205. package/src/PluralRules/GetOperands.d.ts.map +1 -0
  206. package/src/PluralRules/GetOperands.js +51 -0
  207. package/src/PluralRules/InitializePluralRules.d.ts +9 -0
  208. package/src/PluralRules/InitializePluralRules.d.ts.map +1 -0
  209. package/src/PluralRules/InitializePluralRules.js +24 -0
  210. package/src/PluralRules/ResolvePlural.d.ts +13 -0
  211. package/src/PluralRules/ResolvePlural.d.ts.map +1 -0
  212. package/src/PluralRules/ResolvePlural.js +29 -0
  213. package/src/RelativeTimeFormat/FormatRelativeTime.d.ts +5 -0
  214. package/src/RelativeTimeFormat/FormatRelativeTime.d.ts.map +1 -0
  215. package/src/RelativeTimeFormat/FormatRelativeTime.js +14 -0
  216. package/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts +5 -0
  217. package/src/RelativeTimeFormat/FormatRelativeTimeToParts.d.ts.map +1 -0
  218. package/src/RelativeTimeFormat/FormatRelativeTimeToParts.js +22 -0
  219. package/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts +9 -0
  220. package/src/RelativeTimeFormat/InitializeRelativeTimeFormat.d.ts.map +1 -0
  221. package/src/RelativeTimeFormat/InitializeRelativeTimeFormat.js +36 -0
  222. package/src/RelativeTimeFormat/MakePartsList.d.ts +3 -0
  223. package/src/RelativeTimeFormat/MakePartsList.d.ts.map +1 -0
  224. package/src/RelativeTimeFormat/MakePartsList.js +31 -0
  225. package/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts +5 -0
  226. package/src/RelativeTimeFormat/PartitionRelativeTimePattern.d.ts.map +1 -0
  227. package/src/RelativeTimeFormat/PartitionRelativeTimePattern.js +58 -0
  228. package/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts +7 -0
  229. package/src/RelativeTimeFormat/SingularRelativeTimeUnit.d.ts.map +1 -0
  230. package/src/RelativeTimeFormat/SingularRelativeTimeUnit.js +40 -0
  231. package/src/SupportedLocales.js +2 -5
  232. package/src/data.js +1 -1
  233. package/types/date-time.d.ts +112 -0
  234. package/types/date-time.d.ts.map +1 -0
  235. package/types/date-time.js +2 -0
  236. package/types/number.d.ts +44 -0
  237. package/types/number.d.ts.map +1 -1
  238. package/types/plural-rules.d.ts +6 -0
  239. package/types/plural-rules.d.ts.map +1 -1
  240. package/types/relative-time.d.ts +63 -0
  241. package/types/relative-time.d.ts.map +1 -1
  242. package/types.js +1 -1
@@ -0,0 +1,32 @@
1
+ import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';
2
+ import { ToObject } from '../../262';
3
+ import { GetOption } from '../GetOption';
4
+ import { ResolveLocale } from '../ResolveLocale';
5
+ var NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
6
+ export function InitializeRelativeTimeFormat(rtf, locales, options, _a) {
7
+ var getInternalSlots = _a.getInternalSlots, availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale;
8
+ var internalSlots = getInternalSlots(rtf);
9
+ internalSlots.initializedRelativeTimeFormat = true;
10
+ var requestedLocales = CanonicalizeLocaleList(locales);
11
+ var opt = Object.create(null);
12
+ var opts = options === undefined ? Object.create(null) : ToObject(options);
13
+ var matcher = GetOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');
14
+ opt.localeMatcher = matcher;
15
+ var numberingSystem = GetOption(opts, 'numberingSystem', 'string', undefined, undefined);
16
+ if (numberingSystem !== undefined) {
17
+ if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {
18
+ throw new RangeError("Invalid numbering system " + numberingSystem);
19
+ }
20
+ }
21
+ opt.nu = numberingSystem;
22
+ var r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
23
+ var locale = r.locale, nu = r.nu;
24
+ internalSlots.locale = locale;
25
+ internalSlots.style = GetOption(opts, 'style', 'string', ['long', 'narrow', 'short'], 'long');
26
+ internalSlots.numeric = GetOption(opts, 'numeric', 'string', ['always', 'auto'], 'always');
27
+ internalSlots.fields = localeData[locale];
28
+ internalSlots.numberFormat = new Intl.NumberFormat(locales);
29
+ internalSlots.pluralRules = new Intl.PluralRules(locales);
30
+ internalSlots.numberingSystem = nu;
31
+ return rtf;
32
+ }
@@ -0,0 +1,3 @@
1
+ import { RelativeTimeUnit, RelativeTimePart } from '../../types/relative-time';
2
+ export declare function MakePartsList(pattern: string, unit: RelativeTimeUnit, parts: Intl.NumberFormatPart[]): RelativeTimePart[];
3
+ //# sourceMappingURL=MakePartsList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MakePartsList.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/ecma402-abstract/src/RelativeTimeFormat/MakePartsList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAI7E,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAsB/B"}
@@ -0,0 +1,27 @@
1
+ import { PartitionPattern } from '../PartitionPattern';
2
+ import { invariant } from '../utils';
3
+ export function MakePartsList(pattern, unit, parts) {
4
+ var patternParts = PartitionPattern(pattern);
5
+ var result = [];
6
+ for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {
7
+ var patternPart = patternParts_1[_i];
8
+ if (patternPart.type === 'literal') {
9
+ result.push({
10
+ type: 'literal',
11
+ value: patternPart.value,
12
+ });
13
+ }
14
+ else {
15
+ invariant(patternPart.type === '0', "Malformed pattern " + pattern);
16
+ for (var _a = 0, parts_1 = parts; _a < parts_1.length; _a++) {
17
+ var part = parts_1[_a];
18
+ result.push({
19
+ type: part.type,
20
+ value: part.value,
21
+ unit: unit,
22
+ });
23
+ }
24
+ }
25
+ }
26
+ return result;
27
+ }
@@ -0,0 +1,5 @@
1
+ import { RelativeTimeFormattableUnit, RelativeTimeFormat, RelativeTimeFormatInternal, RelativeTimePart } from '../../types/relative-time';
2
+ export declare function PartitionRelativeTimePattern(rtf: RelativeTimeFormat, value: number, unit: RelativeTimeFormattableUnit, { getInternalSlots, }: {
3
+ getInternalSlots(rtf: RelativeTimeFormat): RelativeTimeFormatInternal;
4
+ }): RelativeTimePart[];
5
+ //# sourceMappingURL=PartitionRelativeTimePattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PartitionRelativeTimePattern.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/ecma402-abstract/src/RelativeTimeFormat/PartitionRelativeTimePattern.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAI3B,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAOnC,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,2BAA2B,EACjC,EACE,gBAAgB,GACjB,EAAE;IACD,gBAAgB,CAAC,GAAG,EAAE,kBAAkB,GAAG,0BAA0B,CAAC;CACvE,GACA,gBAAgB,EAAE,CA2DpB"}
@@ -0,0 +1,54 @@
1
+ import { invariant } from '../utils';
2
+ import { SingularRelativeTimeUnit } from './SingularRelativeTimeUnit';
3
+ import { MakePartsList } from './MakePartsList';
4
+ import { ToString, Type, SameValue } from '../../262';
5
+ export function PartitionRelativeTimePattern(rtf, value, unit, _a) {
6
+ var getInternalSlots = _a.getInternalSlots;
7
+ invariant(Type(value) === 'Number', "value must be number, instead got " + typeof value, TypeError);
8
+ invariant(Type(unit) === 'String', "unit must be number, instead got " + typeof value, TypeError);
9
+ if (isNaN(value) || !isFinite(value)) {
10
+ throw new RangeError("Invalid value " + value);
11
+ }
12
+ var resolvedUnit = SingularRelativeTimeUnit(unit);
13
+ var _b = getInternalSlots(rtf), fields = _b.fields, style = _b.style, numeric = _b.numeric, pluralRules = _b.pluralRules, numberFormat = _b.numberFormat;
14
+ var entry = resolvedUnit;
15
+ if (style === 'short') {
16
+ entry = resolvedUnit + "-short";
17
+ }
18
+ else if (style === 'narrow') {
19
+ entry = resolvedUnit + "-narrow";
20
+ }
21
+ if (!(entry in fields)) {
22
+ entry = resolvedUnit;
23
+ }
24
+ var patterns = fields[entry];
25
+ if (numeric === 'auto') {
26
+ if (ToString(value) in patterns) {
27
+ return [
28
+ {
29
+ type: 'literal',
30
+ value: patterns[ToString(value)],
31
+ },
32
+ ];
33
+ }
34
+ }
35
+ var tl = 'future';
36
+ if (SameValue(value, -0) || value < 0) {
37
+ tl = 'past';
38
+ }
39
+ var po = patterns[tl];
40
+ var fv = typeof numberFormat.formatToParts === 'function'
41
+ ? numberFormat.formatToParts(Math.abs(value))
42
+ : // TODO: If formatToParts is not supported, we assume the whole formatted
43
+ // number is a part
44
+ [
45
+ {
46
+ type: 'literal',
47
+ value: numberFormat.format(Math.abs(value)),
48
+ unit: unit,
49
+ },
50
+ ];
51
+ var pr = pluralRules.select(value);
52
+ var pattern = po[pr];
53
+ return MakePartsList(pattern, resolvedUnit, fv);
54
+ }
@@ -0,0 +1,7 @@
1
+ import { RelativeTimeFormattableUnit, RelativeTimeUnit } from '../../types/relative-time';
2
+ /**
3
+ * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit
4
+ * @param unit
5
+ */
6
+ export declare function SingularRelativeTimeUnit(unit: RelativeTimeFormattableUnit): RelativeTimeUnit;
7
+ //# sourceMappingURL=SingularRelativeTimeUnit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingularRelativeTimeUnit.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/ecma402-abstract/src/RelativeTimeFormat/SingularRelativeTimeUnit.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,2BAA2B,GAChC,gBAAgB,CAuBlB"}
@@ -0,0 +1,36 @@
1
+ import { invariant } from '../utils';
2
+ import { Type } from '../../262';
3
+ /**
4
+ * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit
5
+ * @param unit
6
+ */
7
+ export function SingularRelativeTimeUnit(unit) {
8
+ invariant(Type(unit) === 'String', 'unit must be a string');
9
+ if (unit === 'seconds')
10
+ return 'second';
11
+ if (unit === 'minutes')
12
+ return 'minute';
13
+ if (unit === 'hours')
14
+ return 'hour';
15
+ if (unit === 'days')
16
+ return 'day';
17
+ if (unit === 'weeks')
18
+ return 'week';
19
+ if (unit === 'months')
20
+ return 'month';
21
+ if (unit === 'quarters')
22
+ return 'quarter';
23
+ if (unit === 'years')
24
+ return 'year';
25
+ if (unit !== 'second' &&
26
+ unit !== 'minute' &&
27
+ unit !== 'hour' &&
28
+ unit !== 'day' &&
29
+ unit !== 'week' &&
30
+ unit !== 'month' &&
31
+ unit !== 'quarter' &&
32
+ unit !== 'year') {
33
+ throw new RangeError('invalid unit');
34
+ }
35
+ return unit;
36
+ }
@@ -1,4 +1,4 @@
1
- import ToObject from 'es-abstract/2019/ToObject';
1
+ import { ToObject } from '../262';
2
2
  import { GetOption } from './GetOption';
3
3
  import { LookupSupportedLocales } from './LookupSupportedLocales';
4
4
  /**
package/lib/src/data.js CHANGED
@@ -2,7 +2,7 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
package/lib/types/core.js CHANGED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,112 @@
1
+ export interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {
2
+ hourCycle?: 'h11' | 'h12' | 'h23' | 'h24';
3
+ dateStyle?: 'full' | 'long' | 'medium' | 'short';
4
+ timeStyle?: 'full' | 'long' | 'medium' | 'short';
5
+ fractionalSecondDigits?: number;
6
+ calendar?: 'buddhist' | 'chinese' | 'coptic' | 'ethiopia' | 'ethiopic' | 'gregory' | 'hebrew' | 'indian' | 'islamic' | 'iso8601' | 'japanese' | 'persian' | 'roc';
7
+ numberingSystem?: string;
8
+ }
9
+ export declare type Formats = Pick<DateTimeFormatOptions, 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName'> & {
10
+ hour12?: boolean;
11
+ pattern: string;
12
+ pattern12: string;
13
+ skeleton: string;
14
+ rawPattern: string;
15
+ };
16
+ export interface IntlDateTimeFormatInternal {
17
+ locale: string;
18
+ dataLocale: string;
19
+ calendar?: string;
20
+ dateStyle?: 'full' | 'long' | 'medium' | 'short';
21
+ timeStyle?: 'full' | 'long' | 'medium' | 'short';
22
+ weekday: 'narrow' | 'short' | 'long';
23
+ era: 'narrow' | 'short' | 'long';
24
+ year: '2-digit' | 'numeric';
25
+ month: '2-digit' | 'numeric' | 'narrow' | 'short' | 'long';
26
+ day: '2-digit' | 'numeric';
27
+ hour: '2-digit' | 'numeric';
28
+ minute: '2-digit' | 'numeric';
29
+ second: '2-digit' | 'numeric';
30
+ timeZoneName: 'short' | 'long';
31
+ hourCycle: string;
32
+ numberingSystem: string;
33
+ timeZone: string;
34
+ pattern: string;
35
+ boundFormat?: Intl.DateTimeFormat['format'];
36
+ }
37
+ export declare type TABLE_6 = 'weekday' | 'era' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'timeZoneName';
38
+ export declare type TimeZoneNameData = Record<string, {
39
+ long?: [string, string];
40
+ short?: [string, string];
41
+ }>;
42
+ export interface EraData {
43
+ BC: string;
44
+ AD: string;
45
+ }
46
+ export interface DateTimeFormatLocaleInternalData {
47
+ am: string;
48
+ pm: string;
49
+ weekday: {
50
+ narrow: string[];
51
+ long: string[];
52
+ short: string[];
53
+ };
54
+ era: {
55
+ narrow: EraData;
56
+ long: EraData;
57
+ short: EraData;
58
+ };
59
+ month: {
60
+ narrow: string[];
61
+ long: string[];
62
+ short: string[];
63
+ };
64
+ timeZoneName: TimeZoneNameData;
65
+ /**
66
+ * So we can construct GMT+08:00
67
+ */
68
+ gmtFormat: string;
69
+ /**
70
+ * So we can construct GMT+08:00
71
+ */
72
+ hourFormat: string;
73
+ hourCycle: string;
74
+ dateFormat: {
75
+ full: Formats;
76
+ long: Formats;
77
+ medium: Formats;
78
+ short: Formats;
79
+ };
80
+ timeFormat: {
81
+ full: Formats;
82
+ long: Formats;
83
+ medium: Formats;
84
+ short: Formats;
85
+ };
86
+ dateTimeFormat: {
87
+ full: string;
88
+ long: string;
89
+ medium: string;
90
+ short: string;
91
+ };
92
+ formats: Record<string, Formats[]>;
93
+ nu: string[];
94
+ hc: string[];
95
+ ca: string[];
96
+ }
97
+ export interface DateTimeFormat extends Intl.DateTimeFormat {
98
+ resolvedOptions(): ResolvedDateTimeFormatOptions;
99
+ }
100
+ export interface ResolvedDateTimeFormatOptions extends Intl.ResolvedDateTimeFormatOptions {
101
+ dateStyle?: 'full' | 'long' | 'medium' | 'short';
102
+ timeStyle?: 'full' | 'long' | 'medium' | 'short';
103
+ hourCycle: string;
104
+ numberingSystem: string;
105
+ }
106
+ export declare type UnpackedZoneData = [
107
+ number,
108
+ string,
109
+ number,
110
+ boolean
111
+ ];
112
+ //# sourceMappingURL=date-time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/date-time.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,qBAAqB;IACvE,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC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
99
99
  integerDigitsCount: number;
100
100
  }
101
+ export declare type NumberFormatOptionsLocaleMatcher = 'lookup' | 'best fit';
102
+ export declare type NumberFormatOptionsStyle = 'decimal' | 'percent' | 'currency' | 'unit';
103
+ export declare type NumberFormatOptionsCompactDisplay = 'short' | 'long';
104
+ export declare type NumberFormatOptionsCurrencyDisplay = 'symbol' | 'code' | 'name' | 'narrowSymbol';
105
+ export declare type NumberFormatOptionsCurrencySign = 'standard' | 'accounting';
106
+ export declare type NumberFormatOptionsNotation = NumberFormatNotation;
107
+ export declare type NumberFormatOptionsSignDisplay = 'auto' | 'always' | 'never' | 'exceptZero';
108
+ export declare type NumberFormatOptionsUnitDisplay = 'long' | 'short' | 'narrow';
109
+ export interface NumberFormatInternal extends NumberFormatDigitInternalSlots {
110
+ locale: string;
111
+ dataLocale: string;
112
+ style: NumberFormatOptionsStyle;
113
+ currency?: string;
114
+ currencyDisplay: NumberFormatOptionsCurrencyDisplay;
115
+ unit?: string;
116
+ unitDisplay: NumberFormatOptionsUnitDisplay;
117
+ currencySign: NumberFormatOptionsCurrencySign;
118
+ notation: NumberFormatOptionsNotation;
119
+ compactDisplay: NumberFormatOptionsCompactDisplay;
120
+ signDisplay: NumberFormatOptionsSignDisplay;
121
+ useGrouping: boolean;
122
+ pl: Intl.PluralRules;
123
+ boundFormat?: Intl.NumberFormat['format'];
124
+ numberingSystem: string;
125
+ dataLocaleData: NumberFormatLocaleInternalData;
126
+ }
127
+ export declare type NumberFormatOptions = Intl.NumberFormatOptions & NumberFormatDigitOptions & {
128
+ localeMatcher?: NumberFormatOptionsLocaleMatcher;
129
+ style?: NumberFormatOptionsStyle;
130
+ compactDisplay?: NumberFormatOptionsCompactDisplay;
131
+ currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
132
+ currencySign?: NumberFormatOptionsCurrencySign;
133
+ notation?: NumberFormatOptionsNotation;
134
+ signDisplay?: NumberFormatOptionsSignDisplay;
135
+ unit?: string;
136
+ unitDisplay?: NumberFormatOptionsUnitDisplay;
137
+ numberingSystem?: string;
138
+ };
139
+ export declare type ResolvedNumberFormatOptions = Intl.ResolvedNumberFormatOptions & Pick<NumberFormatInternal, 'currencySign' | 'unit' | 'unitDisplay' | 'notation' | 'compactDisplay' | 'signDisplay'>;
140
+ export declare type NumberFormatPartTypes = Intl.NumberFormatPartTypes | 'exponentSeparator' | 'exponentMinusSign' | 'exponentInteger' | 'compact' | 'unit' | 'literal';
141
+ export interface NumberFormatPart {
142
+ type: NumberFormatPartTypes;
143
+ value: string;
144
+ }
101
145
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAElC,oBAAY,oBAAoB,GAC5B,UAAU,GACV,YAAY,GACZ,aAAa,GACb,SAAS,CAAC;AAEd,oBAAY,wBAAwB,GAChC,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,wBAAwB;IACvC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,EAAE,wBAAwB,CAAC;IAEvC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACj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AmB,GAAG,IAAI,CAAC,mBAAmB,GACxD,wBAAwB,GAAG;IACzB,aAAa,CAAC,EAAE,gCAAgC,CAAC;IACjD,KAAK,CAAC,EAAE,wBAAwB,CAAC;IACjC,cAAc,CAAC,EAAE,iCAAiC,CAAC;IACnD,eAAe,CAAC,EAAE,kCAAkC,CAAC;IACrD,YAAY,CAAC,EAAE,+BAA+B,CAAC;IAC/C,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,WAAW,CAAC,EAAE,8BAA8B,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,8BAA8B,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,oBAAY,2BAA2B,GAAG,IAAI,CAAC,2BAA2B,GACxE,IAAI,CACF,oBAAoB,EAClB,cAAc,GACd,MAAM,GACN,aAAa,GACb,UAAU,GACV,gBAAgB,GAChB,aAAa,CAChB,CAAC;AAEJ,oBAAY,qBAAqB,GAC7B,IAAI,CAAC,qBAAqB,GAC1B,mBAAmB,GACnB,mBAAmB,GACnB,iBAAiB,GACjB,SAAS,GACT,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { LocaleData } from './core';
2
+ import { NumberFormatDigitInternalSlots } from './number';
2
3
  export declare type LDMLPluralRule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
3
4
  export interface PluralRulesData {
4
5
  categories: {
@@ -8,4 +9,9 @@ export interface PluralRulesData {
8
9
  fn: (val: number | string, ord?: boolean) => LDMLPluralRule;
9
10
  }
10
11
  export declare type PluralRulesLocaleData = LocaleData<PluralRulesData>;
12
+ export interface PluralRulesInternal extends NumberFormatDigitInternalSlots {
13
+ initializedPluralRules: boolean;
14
+ locale: string;
15
+ type: 'cardinal' | 'ordinal';
16
+ }
11
17
  //# sourceMappingURL=plural-rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plural-rules.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/plural-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAClC,oBAAY,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAC/E,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,cAAc,CAAC;CAC7D;AAED,oBAAY,qBAAqB,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"plural-rules.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/plural-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAC,8BAA8B,EAAC,MAAM,UAAU,CAAC;AACxD,oBAAY,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAC/E,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,cAAc,CAAC;CAC7D;AAED,oBAAY,qBAAqB,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AAEhE,MAAM,WAAW,mBAAoB,SAAQ,8BAA8B;IACzE,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CAC9B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { LocaleData } from './core';
2
2
  import { LDMLPluralRule } from './plural-rules';
3
+ import { LiteralPart } from '../src/utils';
3
4
  export interface FieldData {
4
5
  '0'?: string;
5
6
  '1'?: string;
@@ -26,5 +27,67 @@ export declare type LocaleFieldsData = {
26
27
  };
27
28
  export declare type RelativeTimeField = 'second' | 'second-short' | 'second-narrow' | 'minute' | 'minute-short' | 'minute-narrow' | 'hour' | 'hour-short' | 'hour-narrow' | 'day' | 'day-short' | 'day-narrow' | 'week' | 'week-short' | 'week-narrow' | 'month' | 'month-short' | 'month-narrow' | 'quarter' | 'quarter-short' | 'quarter-narrow' | 'year' | 'year-short' | 'year-narrow';
28
29
  export declare type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;
30
+ export declare type RelativeTimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
31
+ export declare type RelativeTimeUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'quarters' | 'years';
32
+ export declare type RelativeTimeFormattableUnit = RelativeTimeUnit | RelativeTimeUnits;
33
+ export declare type RelativeTimePart = LiteralPart | RelativeTimeFormatNumberPart;
34
+ export interface RelativeTimeFormatNumberPart extends Intl.NumberFormatPart {
35
+ unit: RelativeTimeUnit;
36
+ }
37
+ export interface IntlRelativeTimeFormatOptions {
38
+ /**
39
+ * The locale matching algorithm to use.
40
+ * Possible values are "lookup" and "best fit"; the default is "best fit".
41
+ * For information about this option, see
42
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation.
43
+ */
44
+ localeMatcher?: 'best fit' | 'lookup';
45
+ /**
46
+ * The format of output message. Possible values are:
47
+ * - "always" (default, e.g., 1 day ago),
48
+ * - or "auto" (e.g., yesterday).
49
+ * The "auto" value allows to not always have to
50
+ * use numeric values in the output.
51
+ */
52
+ numeric?: 'always' | 'auto';
53
+ /**
54
+ * The length of the internationalized message. Possible values are:
55
+ * - "long" (default, e.g., in 1 month)
56
+ * - "short" (e.g., in 1 mo.),
57
+ * - or "narrow" (e.g., in 1 mo.).
58
+ * The narrow style could be similar to the short style for some locales.
59
+ */
60
+ style?: 'long' | 'short' | 'narrow';
61
+ }
62
+ export interface ResolvedIntlRelativeTimeFormatOptions extends Pick<IntlRelativeTimeFormatOptions, 'style' | 'numeric'> {
63
+ /**
64
+ * The BCP 47 language tag for the locale actually used.
65
+ * If any Unicode extension values were requested in the
66
+ * input BCP 47 language tag that led to this locale,
67
+ * the key-value pairs that were requested and are
68
+ * supported for this locale are included in locale.
69
+ */
70
+ locale: string;
71
+ /**
72
+ * The value requested using the Unicode
73
+ * extension key "nu" or filled in as a default.
74
+ */
75
+ numberingSystem: string;
76
+ }
77
+ export interface RelativeTimeFormat {
78
+ format(value: number, unit: RelativeTimeFormattableUnit): string;
79
+ formatToParts(value: number, unit: RelativeTimeFormattableUnit): RelativeTimePart[];
80
+ resolvedOptions(): ResolvedIntlRelativeTimeFormatOptions;
81
+ }
82
+ export interface RelativeTimeFormatInternal {
83
+ numberFormat: Intl.NumberFormat;
84
+ pluralRules: Intl.PluralRules;
85
+ locale: string;
86
+ fields: LocaleFieldsData;
87
+ style: IntlRelativeTimeFormatOptions['style'];
88
+ numeric: IntlRelativeTimeFormatOptions['numeric'];
89
+ numberingSystem: string;
90
+ initializedRelativeTimeFormat: boolean;
91
+ }
29
92
  export {};
30
93
  //# sourceMappingURL=relative-time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/types/relative-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC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CAAC;IAChC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC9C,OAAO,EAAE,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAClD,eAAe,EAAE,MAAM,CAAC;IACxB,6BAA6B,EAAE,OAAO,CAAC;CACxC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/ecma402-abstract",
3
- "version": "1.0.3",
3
+ "version": "1.2.2",
4
4
  "description": "A collection of implementation for ECMAScript abstract operations",
5
5
  "keywords": [
6
6
  "intl",
@@ -27,9 +27,5 @@
27
27
  "types": "index.d.ts",
28
28
  "homepage": "https://github.com/formatjs/formatjs",
29
29
  "license": "MIT",
30
- "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
31
- "dependencies": {
32
- "@types/es-abstract": "^1.17.1",
33
- "es-abstract": "^1.17.6"
34
- }
30
+ "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c"
35
31
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
3
+ * @param locales
4
+ */
5
+ export declare function CanonicalizeLocaleList(locales?: string | string[]): any;
6
+ //# sourceMappingURL=CanonicalizeLocaleList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/src/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,OAGjE"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CanonicalizeLocaleList = void 0;
4
+ /**
5
+ * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
6
+ * @param locales
7
+ */
8
+ function CanonicalizeLocaleList(locales) {
9
+ // TODO
10
+ return Intl.getCanonicalLocales(locales);
11
+ }
12
+ exports.CanonicalizeLocaleList = CanonicalizeLocaleList;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * https://tc39.es/ecma402/#sec-canonicalizetimezonename
3
+ * @param tz
4
+ */
5
+ export declare function CanonicalizeTimeZoneName(tz: string, { tzData, uppercaseLinks, }: {
6
+ tzData: Record<string, unknown>;
7
+ uppercaseLinks: Record<string, string>;
8
+ }): string;
9
+ //# sourceMappingURL=CanonicalizeTimeZoneName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CanonicalizeTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/src/CanonicalizeTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,UAgBF"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CanonicalizeTimeZoneName = void 0;
4
+ /**
5
+ * https://tc39.es/ecma402/#sec-canonicalizetimezonename
6
+ * @param tz
7
+ */
8
+ function CanonicalizeTimeZoneName(tz, _a) {
9
+ var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
10
+ var uppercasedTz = tz.toUpperCase();
11
+ var uppercasedZones = Object.keys(tzData).reduce(function (all, z) {
12
+ all[z.toUpperCase()] = z;
13
+ return all;
14
+ }, {});
15
+ var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];
16
+ if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {
17
+ return 'UTC';
18
+ }
19
+ return ianaTimeZone;
20
+ }
21
+ exports.CanonicalizeTimeZoneName = CanonicalizeTimeZoneName;
@@ -0,0 +1,8 @@
1
+ import { DateTimeFormatOptions, Formats } from '../../types/date-time';
2
+ /**
3
+ * https://tc39.es/ecma402/#sec-basicformatmatcher
4
+ * @param options
5
+ * @param formats
6
+ */
7
+ export declare function BasicFormatMatcher(options: DateTimeFormatOptions, formats: Formats[]): Formats;
8
+ //# sourceMappingURL=BasicFormatMatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BasicFormatMatcher.d.ts","sourceRoot":"","sources":["../../../../../../../packages/ecma402-abstract/src/DateTimeFormat/BasicFormatMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAYrE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,OAAO,EAAE,GACjB,OAAO,CAsCT"}