@@ -413,6 +413,57 @@ module PluralRules = struct
413
413
end
414
414
end
415
415
416
+ module RelativeTimeFormat = struct
417
+ include Shared
418
+
419
+ class type resolved_options = object
420
+ method locale : Js. js_string Js. t Js. readonly_prop
421
+
422
+ method style : Js. js_string Js. t Js. readonly_prop
423
+
424
+ method numberingSystem : Js. js_string Js. t Js. readonly_prop
425
+
426
+ method numeric : Js. js_string Js. t Js. readonly_prop
427
+ end
428
+
429
+ class type options = object
430
+ method localeMatcher : Js. js_string Js. t Js. prop
431
+
432
+ method numberingSystem : Js. js_string Js. t Js. optdef Js. prop
433
+
434
+ method style : Js. js_string Js. t Js. optdef Js. prop
435
+
436
+ method numeric : Js. js_string Js. t Js. optdef Js. prop
437
+ end
438
+
439
+ let options () : options Js.t =
440
+ object % js
441
+ val mutable localeMatcher = Js. string " best fit"
442
+
443
+ val mutable style = Js. undefined
444
+
445
+ val mutable numberingSystem = Js. undefined
446
+
447
+ val mutable numeric = Js. undefined
448
+ end
449
+
450
+ class type format_part = object
451
+ method _type : Js. js_string Js. t Js. readonly_prop
452
+
453
+ method _value : Js. js_string Js. t Js. readonly_prop
454
+ end
455
+
456
+ class type t = object
457
+ method format :
458
+ (Js. number Js. t -> Js. js_string Js. t -> Js. js_string Js. t) Js. readonly_prop
459
+
460
+ method formatToParts :
461
+ Js. date Js. t Js. optdef -> format_part Js. t Js. js_array Js. t Js. meth
462
+
463
+ method resolvedOptions : unit -> resolved_options Js. t Js. meth
464
+ end
465
+ end
466
+
416
467
class type intl = object
417
468
method _Collator : Collator. _object Js. t Js. readonly_prop
418
469
@@ -422,6 +473,8 @@ class type intl = object
422
473
423
474
method _PluralRules : PluralRules. _object Js. t Js. readonly_prop
424
475
476
+ method _RelativeTimeFormat : RelativeTimeFormat. _object Js. t Js. readonly_prop
477
+
425
478
method getCanonicalLocales :
426
479
Js. js_string Js. t Js. js_array Js. t -> Js. js_string Js. t Js. js_array Js. t Js. meth
427
480
end
@@ -436,4 +489,6 @@ let numberFormat_constr = Js.Unsafe.global##._Intl##._NumberFormat
436
489
437
490
let pluralRules_constr = Js.Unsafe. global##._Intl##._PluralRules
438
491
492
+ let relativeTimeFormat_constr = Js.Unsafe. global##._Intl##._RelativeTimeFormat
493
+
439
494
let is_supported () = Js.Optdef. test intl
0 commit comments