@@ -818,6 +818,16 @@ module Top = {
818
818
let fromOption = o => o -> optionMap (identity )
819
819
}
820
820
821
+ module Sizes = {
822
+ open Chakra__AtomicTypes
823
+ let rec identity = x =>
824
+ switch x {
825
+ | #... Sizes .t as cs => cs -> Sizes .toString -> Identity .fromString
826
+ | #array (arr ) => arr -> arrayMap (identity )-> Identity .fromArray
827
+ }
828
+ let fromOption = o => o -> optionMap (identity )
829
+ }
830
+
821
831
module Right = Top
822
832
module Bottom = Top
823
833
module Left = Top
@@ -970,6 +980,55 @@ module Stat = {
970
980
let fromOption = o => o -> optionMap (identity )
971
981
}
972
982
}
983
+ /**
984
+ this is module for handle 2 type between [string] or [number]
985
+ */
986
+ module StringOrNumber = {
987
+ type t = [#str (string ) | #num (float )]
988
+ let identity = x =>
989
+ switch x {
990
+ | #str (str ) => str -> Identity .fromString
991
+ | #num (num ) => num -> Identity .fromFloat
992
+ }
993
+ let fromOption = o => o -> optionMap (identity )
994
+ }
995
+ /**
996
+ Object fit module
997
+ */
998
+ module ObjectFit = {
999
+ open Chakra__AtomicTypes
1000
+ let rec identity = x => {
1001
+ switch x {
1002
+ | #... ObjectFit .t as o => o -> ObjectFit .toString -> Identity .fromString
1003
+ | #array (arr ) => arr -> arrayMap (identity )-> Identity .fromArray
1004
+ }
1005
+ }
1006
+ let fromOption = o => o -> optionMap (identity )
1007
+ }
1008
+
1009
+ module NoOfLines = {
1010
+ @ocaml.text ("It could be simply when [@unwrap] can use in [JavaScript] Object." )
1011
+ let identity = x =>
1012
+ switch x {
1013
+ | #num (i ) => i -> Identity .fromInt
1014
+ | #array (arr ) => arr -> Identity .fromArray
1015
+ }
1016
+ let fromOption = o => o -> optionMap (identity )
1017
+ }
1018
+
1019
+ module ViewBox = {
1020
+ type t = [#viewBox (float , float , float , float )]
1021
+ let identity = x =>
1022
+ switch x {
1023
+ | #viewBox (a , b , c , d ) =>
1024
+ let a = a -> Js .Float .toString
1025
+ let b = b -> Js .Float .toString
1026
+ let c = c -> Js .Float .toString
1027
+ let d = d -> Js .Float .toString
1028
+ ` ${a} ${b} ${c} ${d}`
1029
+ }
1030
+ let fromOption = o => o -> optionMap (identity )
1031
+ }
973
1032
974
1033
include Chakra__Theme
975
1034
0 commit comments