@hebcal/icalendar 5.0.6 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icalendar.d.ts +98 -0
- package/dist/index.cjs +412 -450
- package/dist/index.mjs +412 -450
- package/dist/pkgVersion.d.ts +1 -0
- package/package.json +25 -17
- package/icalendar.d.ts +0 -36
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { CalOptions, Event } from '@hebcal/core';
|
|
2
|
+
export type ICalEventOptions = {
|
|
3
|
+
dtstamp?: string;
|
|
4
|
+
sequence?: number;
|
|
5
|
+
emoji?: boolean;
|
|
6
|
+
utmSource?: string;
|
|
7
|
+
utmMedium?: string;
|
|
8
|
+
utmCampaign?: string;
|
|
9
|
+
appendHebrewToSubject?: boolean;
|
|
10
|
+
prodid?: string;
|
|
11
|
+
caldesc?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
publishedTTL?: string | boolean;
|
|
14
|
+
calendarColor?: string;
|
|
15
|
+
relcalid?: string;
|
|
16
|
+
yahrzeit?: boolean;
|
|
17
|
+
subscribe?: string | boolean;
|
|
18
|
+
};
|
|
19
|
+
export type ICalOptions = CalOptions & ICalEventOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Represents an RFC 2445 iCalendar VEVENT
|
|
22
|
+
*/
|
|
23
|
+
export declare class IcalEvent {
|
|
24
|
+
ev: Event;
|
|
25
|
+
options: ICalOptions;
|
|
26
|
+
dtstamp: string;
|
|
27
|
+
sequence?: number;
|
|
28
|
+
timed: boolean;
|
|
29
|
+
locationName: string | null | undefined;
|
|
30
|
+
startDate: string;
|
|
31
|
+
isoDateOnly: string;
|
|
32
|
+
dtargs: string;
|
|
33
|
+
transp: string;
|
|
34
|
+
busyStatus: string;
|
|
35
|
+
endDate: string;
|
|
36
|
+
subj: string;
|
|
37
|
+
category: string | null;
|
|
38
|
+
lines?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Builds an IcalEvent object from a Hebcal Event
|
|
41
|
+
*/
|
|
42
|
+
constructor(ev: Event, options?: ICalOptions);
|
|
43
|
+
getAlarm(): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* @return {string}
|
|
46
|
+
*/
|
|
47
|
+
getUid(): string;
|
|
48
|
+
/**
|
|
49
|
+
* @return {string[]}
|
|
50
|
+
*/
|
|
51
|
+
getLongLines(): string[];
|
|
52
|
+
/**
|
|
53
|
+
* @return {string}
|
|
54
|
+
*/
|
|
55
|
+
toString(): string;
|
|
56
|
+
/**
|
|
57
|
+
* fold lines to 75 characters
|
|
58
|
+
* @return {string[]}
|
|
59
|
+
*/
|
|
60
|
+
getLines(): string[];
|
|
61
|
+
/**
|
|
62
|
+
* fold line to 75 characters
|
|
63
|
+
* @param {string} line
|
|
64
|
+
* @return {string}
|
|
65
|
+
*/
|
|
66
|
+
static fold(line: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* @param {string} str
|
|
69
|
+
* @return {string}
|
|
70
|
+
*/
|
|
71
|
+
static escape(str: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* @param {Date} dt
|
|
74
|
+
* @return {string}
|
|
75
|
+
*/
|
|
76
|
+
static formatYYYYMMDD(dt: Date): string;
|
|
77
|
+
/**
|
|
78
|
+
* Returns UTC string for iCalendar
|
|
79
|
+
* @param {Date} dt
|
|
80
|
+
* @return {string}
|
|
81
|
+
*/
|
|
82
|
+
static makeDtstamp(dt: Date): string;
|
|
83
|
+
/** @return {string} */
|
|
84
|
+
static version(): string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Transforms a single Event into a VEVENT string
|
|
88
|
+
* @return {string} multi-line result, delimited by \r\n
|
|
89
|
+
*/
|
|
90
|
+
export declare function eventToIcal(ev: Event, options: ICalOptions): string;
|
|
91
|
+
/**
|
|
92
|
+
* Generates an RFC 2445 iCalendar string from an array of events
|
|
93
|
+
*/
|
|
94
|
+
export declare function eventsToIcalendar(events: Event[], options: ICalOptions): Promise<string>;
|
|
95
|
+
/**
|
|
96
|
+
* Generates an RFC 2445 iCalendar string from an array of IcalEvents
|
|
97
|
+
*/
|
|
98
|
+
export declare function icalEventsToString(icals: IcalEvent[], options: ICalOptions): Promise<string>;
|