My agentic slop goes here. Not intended for anyone else!
1(** JMAP Primitive Data Types
2
3 This module defines the primitive data types used in JMAP.
4
5 Reference: RFC 8620 Section 1.3
6*)
7
8(** Signed 53-bit integer (-2^53 + 1 to 2^53 - 1) *)
9module Int53 : sig
10 type t
11
12 val min_value : int
13 val max_value : int
14
15 (** Create from int.
16 @raise Invalid_argument if out of range *)
17 val of_int : int -> t
18
19 val to_int : t -> int
20 val of_json : Ezjsonm.value -> t
21 val to_json : t -> Ezjsonm.value
22end
23
24(** Unsigned integer (0 to 2^53 - 1) *)
25module UnsignedInt : sig
26 type t
27
28 val min_value : int
29 val max_value : int
30
31 (** Create from int.
32 @raise Invalid_argument if out of range *)
33 val of_int : int -> t
34
35 val to_int : t -> int
36 val of_json : Ezjsonm.value -> t
37 val to_json : t -> Ezjsonm.value
38end
39
40(** RFC 3339 date-time (with or without timezone) *)
41module Date : sig
42 type t
43
44 (** Create from RFC 3339 string.
45 @raise Invalid_argument if invalid format *)
46 val of_string : string -> t
47
48 val to_string : t -> string
49 val of_json : Ezjsonm.value -> t
50 val to_json : t -> Ezjsonm.value
51end
52
53(** RFC 3339 date-time with Z timezone (UTC) *)
54module UTCDate : sig
55 type t
56
57 (** Create from RFC 3339 string with Z suffix.
58 @raise Invalid_argument if invalid format or missing Z *)
59 val of_string : string -> t
60
61 val to_string : t -> string
62 val of_json : Ezjsonm.value -> t
63 val to_json : t -> Ezjsonm.value
64
65 (** Get current UTC time as UTCDate *)
66 val now : unit -> t
67end