Command-line and Emacs Calendar Client
1(** Functions for managing calendar directories with Collection.ts of .ics files 2*) 3 4type t 5(** A directory of Collection.ts, where each collection is a subdirectory 6 containing .ics files *) 7 8val create : 9 fs:Eio.Fs.dir_ty Eio.Path.t -> string -> (t, [> `Msg of string ]) result 10(** Create a calendar_dir from a directory path. Returns Ok with the 11 calendar_dir if successful, or Error with a message if the directory cannot 12 be created or accessed. *) 13 14val list_collections : 15 fs:Eio.Fs.dir_ty Eio.Path.t -> 16 t -> 17 (Collection.t list, [> `Msg of string ]) result 18(** List available Collection.ts in the calendar_dir. Returns Ok with the list 19 of Collection.t names if successful, or Error with a message if the 20 directory cannot be read. *) 21 22val get_collection : 23 fs:Eio.Fs.dir_ty Eio.Path.t -> 24 t -> 25 Collection.t -> 26 (Event.t list, [> `Msg of string | `Not_found ]) result 27(** Get all calendar files in a Collection.t. If the collection doesn't exist in 28 the cache, it will be loaded from disk. *) 29 30val get_events : 31 fs:Eio.Fs.dir_ty Eio.Path.t -> t -> (Event.t list, [> `Msg of string ]) result 32(** Get all events in all collections. This will load any Collection.ts that 33 haven't been loaded yet. *) 34 35val add_event : 36 fs:Eio.Fs.dir_ty Eio.Path.t -> 37 t -> 38 Event.t -> 39 (unit, [> `Msg of string ]) result 40 41val edit_event : 42 fs:Eio.Fs.dir_ty Eio.Path.t -> 43 t -> 44 Event.t -> 45 (unit, [> `Msg of string ]) result 46 47val delete_event : 48 fs:Eio.Fs.dir_ty Eio.Path.t -> 49 t -> 50 Event.t -> 51 (unit, [> `Msg of string ]) result 52 53val get_path : t -> string