/** * Minimal iCalendar (RFC 5545) codec for the calendar demo — pure data, no * I/O. Parses the common real-world subset honestly and marks what it can't * expand rather than inventing dates: * * • line unfolding / folding, text escaping * • VEVENT: UID, SUMMARY, LOCATION, DESCRIPTION, DTSTART/DTEND * (date-time, all-day VALUE=DATE, UTC "Z", TZID via Intl best-effort, * floating = local), DURATION fallback * • RRULE: simple FREQ=DAILY/WEEKLY/MONTHLY with INTERVAL/COUNT/UNTIL and * WEEKLY BYDAY, expanded inside a caller-given horizon (cap 500 * instances); anything gnarlier keeps the first instance flagged * `recurring` instead of silently-wrong dates * • EXDATE (exact-instant removal) */ export interface IcsEvent { uid: string; summary: string; location?: string; description?: string; startMs: number; endMs: number; allDay: boolean; /** RRULE was present but too complex to expand — first instance only */ recurring?: boolean; } export interface IcsCalendar { /** X-WR-CALNAME when present */ name?: string; events: IcsEvent[]; } /** RFC 5545 §3.1 — a CRLF followed by space/tab continues the line */ export declare function unfoldLines(text: string): string[]; /** UTC offset (ms) of an IANA zone at a given instant, via Intl */ export declare function zoneOffsetMs(ms: number, tz: string): number; /** parse an ICS date/date-time value to Unix ms; allDay for VALUE=DATE */ export declare function parseIcsDate(value: string, params?: Record): { ms: number; allDay: boolean; } | null; /** basic ISO-8601 duration (PnW / PnDTnHnMnS subset) → ms */ export declare function parseIcsDuration(value: string): number | null; /** * Expand a simple RRULE within [fromMs, toMs]. Returns null when the rule is * beyond the supported subset (caller keeps the first instance + a flag). */ export declare function expandRrule(rule: string, startMs: number, fromMs: number, toMs: number, cap?: number): number[] | null; export declare function parseIcs(text: string, opts?: { fromMs?: number; toMs?: number; }): IcsCalendar; export declare function serializeIcs(events: readonly IcsEvent[], name?: string): string; //# sourceMappingURL=ics.d.ts.map