327327type null = private Ojs.t
328328val null_of_js: Ojs.t -> null
329329val null_to_js: null -> Ojs.t
330+ val null: null [@@js.custom let null = Ojs.null]
330331module Null : sig
331332 type t = null
332333 val t_of_js: Ojs.t -> t
339340type undefined = private Ojs.t
340341val undefined_of_js: Ojs.t -> undefined
341342val undefined_to_js: undefined -> Ojs.t
343+ val undefined: undefined [@@js.custom let undefined = Ojs.unit_to_js ()]
342344module Undefined : sig
343345 type t = undefined
344346 val t_of_js: Ojs.t -> t
@@ -522,7 +524,7 @@ val union7_of_js: (Ojs.t -> 'a) -> (Ojs.t -> 'b) -> (Ojs.t -> 'c) -> (Ojs.t -> '
522524val union8_to_js: ('a -> Ojs.t) -> ('b -> Ojs.t) -> ('c -> Ojs.t) -> ('d -> Ojs.t) -> ('e -> Ojs.t) -> ('f -> Ojs.t) -> ('g -> Ojs.t) -> ('h -> Ojs.t) -> ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h) union8 -> Ojs.t
523525val union8_of_js: (Ojs.t -> 'a) -> (Ojs.t -> 'b) -> (Ojs.t -> 'c) -> (Ojs.t -> 'd) -> (Ojs.t -> 'e) -> (Ojs.t -> 'f) -> (Ojs.t -> 'g) -> (Ojs.t -> 'h) -> Ojs.t -> ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h) union8
524526
525- module TypeofableUnion : sig
527+ module Primitive : sig
526528 [@@@js.stop]
527529 type +'cases t = private Ojs.t
528530 val t_to_js: ('cases -> Ojs.t) -> 'cases t -> Ojs.t
@@ -574,71 +576,11 @@ module TypeofableUnion : sig
574576 | "boolean" -> Obj.magic (`Boolean (Ojs.bool_of_js u))
575577 | "symbol" -> Obj.magic (`Symbol (symbol_of_js u))
576578 | "bigint" -> Obj.magic (`BigInt (bigint_of_js u))
577- | "null" -> Obj.magic `Null
578579 | "undefined" -> Obj.magic `Undefined
579- | _ -> Obj.magic (`Other (other_of_js u))
580+ | _ ->
581+ if Ojs.is_null u then Obj.magic `Null
582+ else Obj.magic (`Other (other_of_js u))
580583 let classify c = classify' Obj.magic c
581584 ]
582585end
583-
584- type 'a or_null = 'a option
585- val or_null_to_js: ('a -> Ojs.t) -> 'a or_null -> Ojs.t
586- val or_null_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_null
587- type 'a or_undefined = 'a option
588- val or_undefined_to_js: ('a -> Ojs.t) -> 'a or_undefined -> Ojs.t
589- val or_undefined_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_undefined
590- type 'a or_null_or_undefined = 'a option
591- val or_null_or_undefined_to_js: ('a -> Ojs.t) -> 'a or_null_or_undefined -> Ojs.t
592- val or_null_or_undefined_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_null_or_undefined
593-
594- type 'a or_string = [`String of string | `Other of 'a] [@@js.custom {
595- of_js = (fun a_of_js x -> match Ojs.type_of x with "string" -> `String (Ojs.string_of_js x) | _ -> `Other (a_of_js x));
596- to_js = (fun a_to_js -> function `String x -> Ojs.string_to_js x | `Other x -> a_to_js x)
597- }]
598- val or_string_to_js: ('a -> Ojs.t) -> 'a or_string -> Ojs.t
599- val or_string_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_string
600- type 'a or_number = [`Number of float | `Other of 'a] [@@js.custom {
601- of_js = (fun a_of_js x -> match Ojs.type_of x with "number" -> `Number (Ojs.float_of_js x) | _ -> `Other (a_of_js x));
602- to_js = (fun a_to_js -> function `Number x -> Ojs.float_to_js x | `Other x -> a_to_js x)
603- }]
604- val or_number_to_js: ('a -> Ojs.t) -> 'a or_number -> Ojs.t
605- val or_number_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_number
606- type 'a or_boolean = [`Boolean of bool | `Other of 'a] [@@js.custom {
607- of_js = (fun a_of_js x -> match Ojs.type_of x with "boolean" -> `Boolean (Ojs.bool_of_js x) | _ -> `Other (a_of_js x));
608- to_js = (fun a_to_js -> function `Boolean x -> Ojs.bool_to_js x | `Other x -> a_to_js x)
609- }]
610- val or_boolean_to_js: ('a -> Ojs.t) -> 'a or_boolean -> Ojs.t
611- val or_boolean_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_boolean
612- type 'a or_symbol = [`Symbol of symbol | `Other of 'a] [@@js.custom {
613- of_js = (fun a_of_js x -> match Ojs.type_of x with "symbol" -> `Symbol (symbol_of_js x) | _ -> `Other (a_of_js x));
614- to_js = (fun a_to_js -> function `Symbol x -> symbol_to_js x | `Other x -> a_to_js x)
615- }]
616- val or_symbol_to_js: ('a -> Ojs.t) -> 'a or_symbol -> Ojs.t
617- val or_symbol_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_symbol
618- type 'a or_bigint = [`BigInt of bigint | `Other of 'a] [@@js.custom {
619- of_js = (fun a_of_js x -> match Ojs.type_of x with "bigint" -> `BigInt (bigint_of_js x) | _ -> `Other (a_of_js x));
620- to_js = (fun a_to_js -> function `BigInt x -> bigint_to_js x | `Other x -> a_to_js x)
621- }]
622- val or_bigint_to_js: ('a -> Ojs.t) -> 'a or_bigint -> Ojs.t
623- val or_bigint_of_js: (Ojs.t -> 'a) -> Ojs.t -> 'a or_bigint
624-
625- val is_array: Ojs.t -> bool [@@js.global "Array.isArray"]
626-
627- type ('a, 't) or_array = [`Array of 't list | `Other of 'a] [@@js.custom {
628- of_js = (fun a_of_js t_of_js x ->
629- if is_array x then `Array (Ojs.list_of_js t_of_js x)
630- else `Other (a_of_js x)
631- );
632- to_js = (fun a_to_js t_to_js -> function `Array x -> Ojs.list_to_js t_to_js x | `Other x -> a_to_js x)
633- }]
634- val or_array_to_js: ('a -> Ojs.t) -> ('t -> Ojs.t) -> ('a, 't) or_array -> Ojs.t
635- val or_array_of_js: (Ojs.t -> 'a) -> (Ojs.t -> 't) -> Ojs.t -> ('a, 't) or_array
636-
637- type ('a, 'cases) or_enum = [`Enum of 'cases | `Other of 'a] [@@js.custom {
638- of_js = (fun a_of_js cases_of_js x ->
639- try `Enum (cases_of_js x) with _ -> `Other (a_of_js x));
640- to_js = (fun a_to_js cases_to_js -> function `Enum cases -> cases_to_js cases | `Other x -> a_to_js x)
641- }]
642- val or_enum_to_js: ('a -> Ojs.t) -> ('cases -> Ojs.t) -> ('a, 'cases) or_enum -> Ojs.t
643- val or_enum_of_js: (Ojs.t -> 'a) -> (Ojs.t -> 'cases) -> Ojs.t -> ('a, 'cases) or_enum
644586"""
0 commit comments