@@ -413,6 +413,57 @@ module PluralRules = struct
413413 end
414414end
415415
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. meth
459+
460+ method formatToParts :
461+ Js. number Js. t -> Js. js_string Js. t -> 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+
416467class type intl = object
417468 method _Collator : Collator. _object Js. t Js. readonly_prop
418469
@@ -422,6 +473,8 @@ class type intl = object
422473
423474 method _PluralRules : PluralRules. _object Js. t Js. readonly_prop
424475
476+ method _RelativeTimeFormat : RelativeTimeFormat. _object Js. t Js. readonly_prop
477+
425478 method getCanonicalLocales :
426479 Js. js_string Js. t Js. js_array Js. t -> Js. js_string Js. t Js. js_array Js. t Js. meth
427480end
@@ -436,4 +489,6 @@ let numberFormat_constr = Js.Unsafe.global##._Intl##._NumberFormat
436489
437490let pluralRules_constr = Js.Unsafe. global##._Intl##._PluralRules
438491
492+ let relativeTimeFormat_constr = Js.Unsafe. global##._Intl##._RelativeTimeFormat
493+
439494let is_supported () = Js.Optdef. test intl
0 commit comments