aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/javascript/vevent.texi
blob: 4ceaa3800356741433f19c1f832e8ed09d61751d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
@node vevent
@subsection vevent.js

@deftp {Interface} Redrawable
@deftypeop {Interface Field} Redrawable void redraw VEvent
@end deftypeop
@end deftp

@deffn {Type Predicate} isRedrawable element
Checks if the given element is an instance of Redrawable.
@end deffn


@deftp {class} VEventValue {type: ical_type} {value: any} {parameters: Map<string, any>}

@deftypemethod VEventValue {[Record<string, any>, ical_type, any]} @
               to_jcal {}
The return value is @emph{almost} a @code{JCalProperty}, just without
the field name.
@end deftypemethod

@end deftp

@deftp VEvent {properties: Map<string, VEventValue | VEventValue[]>} @
              {components: VEvent[]}

Component for a single instance of a calendar event. Almost all data
access should go through @code{getProperty} and @code{setProperty},
with the exception of the current calendar (which is accessed directly
through @code{calendar}). Almost all changes through these interfaces
are logged, and can be viewed in @var{_changelog}.

@deftypemethod VEvent {any?} getProperty {key: string}
@anchor{VEvent.getProperty}
Returns the value of the given property if set, or undefined otherwise.

For the keys
@itemize
@item @code{'CATEGORIES'},
@item @code{'RESOURCES'},
@item @code{'FREEBUSY'},
@item @code{'EXDATE'}, and
@item @code{'RDATE'}
@end itemize
instead returns a list list of values.
@end deftypemethod


@deftypemethod VEvent void setProperty {key: string} {value: any} {type: ical_type?}
Sets the given property to the given value. If type is given it's
stored alongside the value, possibly updating what is already
there. Do however note that no validation between the given type and
the type of the value is done.

@var{value} may also be a list, but should only be so for the keys
mentioned in @var{getProperty}.

After the value is set, @var{redraw} is called on all registered
objects, notifying them of the change.
@end deftypemethod

@deftypemethod VEvent void setProperties {[string, any, ical_type?][]}
Equivalent to running @var{setProperty} for each element in the input
list, but only calls @var{redraw} once at the end.
@end deftypemethod

@deftypemethod VEvent {IteratableIterator<string>} boundProperties
Returns an iterator of all our properties.
@end deftypemethod

@deftypeivar VEvent {ChangeLogEntry[]} {_changelog}
Every write through getProperty gets logged here, and can be
consumed. Hopefully this will one day turn into an undo system.
@ref{ChangeLogEntry}.
@end deftypeivar

@deftypeivar VEvent {string?} calendar
The name of the calendar which this event belongs to.
@end deftypeivar

@deftypemethod VEvent void register {htmlNode: Redrawable}
Register something redrawable, which will be notified whenever this
VEvents data is updated.
@end deftypemethod

@deftypemethod VEvent void unregister {htmlNode: Redrawable}
Stop recieving redraw events on the given component.
@end deftypemethod

@deftypemethod VEvent JCal to_jcal
Converts the object to JCal data.
@end deftypemethod

@end deftp


@deftp {class} RecurrenceRule
@deftypemethod RecurrenceRule {Record<string, any>} to_jcal
Converts ourselves to JCal data.
@end deftypemethod
@end deftp

@deftypefun RecurrencRule xml_to_recurrence_rule {Element}
Parse a XCAL recurrence rule into a RecurrenceRule object.
@end deftypefun

@deftypefun VEvent xml_to_vcal {Element}
Parse a complete XCAL object into a JS VEvent object.
@end deftypefun