diff --git a/lib/icalendar.ex b/lib/icalendar.ex index 7a6fb60..da83813 100644 --- a/lib/icalendar.ex +++ b/lib/icalendar.ex @@ -4,6 +4,17 @@ defmodule ICalendar do """ defstruct events: [] + + @typedoc """ + An ICalendar struct + + * `events`: A list of events + """ + + @type t :: %__MODULE__{ + events: [ICalendar.Event.t()] + } + defdelegate to_ics(events, options \\ []), to: ICalendar.Serialize defdelegate from_ics(events), to: ICalendar.Deserialize diff --git a/lib/icalendar/event.ex b/lib/icalendar/event.ex index 315c757..d890294 100644 --- a/lib/icalendar/event.ex +++ b/lib/icalendar/event.ex @@ -22,6 +22,51 @@ defmodule ICalendar.Event do organizer: nil, sequence: nil, attendees: [] + + @typedoc """ + An Event struct + + * `summary`: The summary of the event + * `dtstart`: The start time of the event + * `dtend`: The end time of the event + * `rrule`: The recurrence rule + * `exdates`: The exception dates + * `description`: The description of the event + * `location`: The location of the event + * `url`: The URL of the event + * `uid`: The unique identifier of the event + * `prodid`: The product identifier of the event + * `status`: The status of the event + * `categories`: The categories of the event + * `class`: The class of the event + * `comment`: An optional comment + * `geo`: The latitude and longitude of the event + * `modified`: The last modified time of the event + * `organizer`: The organizer of the event + * `sequence`: The sequence number of the event + * `attendees`: The attendees of the event + """ + @type t :: %__MODULE__{ + summary: String.t(), + dtstart: DateTime.t(), + dtend: DateTime.t(), + rrule: map(), + exdates: [DateTime.t()], + description: String.t(), + location: String.t(), + url: String.t(), + uid: String.t() | integer(), + prodid: String.t(), + status: String.t(), + categories: [String.t()], + class: String.t(), + comment: String.t(), + geo: {float(), float()}, + modified: DateTime.t(), + organizer: String.t(), + sequence: integer(), + attendees: [map()] + } end defimpl ICalendar.Serialize, for: ICalendar.Event do