/** * caldav-ics-generate.ts, RFC 5545 (iCalendar) writing for the CalDAV backend. * * The other half of `caldav-ics.ts`: what a PUT of a new event serialises with, * and what `calendar.ics.export` renders a whole collection with. * * Pure, including the stamp. `dtStamp` is a required input rather than a * defaulted `new Date()` so that no clock is read here, the caller passes the * instant from its own injected clock, which is also what makes a generated * .ics byte-for-byte reproducible under test. */ export interface GenerateICalInput { readonly uid: string; readonly summary: string; /** ISO-8601. */ readonly start: string; /** ISO-8601. */ readonly end: string; readonly description?: string | undefined; readonly location?: string | undefined; /** Raw addresses or display names. */ readonly attendees?: readonly string[] | undefined; readonly organizer?: string | undefined; readonly status?: string | undefined; readonly recurrence?: string | undefined; readonly allDay?: boolean | undefined; /** Stamp time (ISO-8601). Required: this module never reads a clock. */ readonly dtStamp: string; } /** * Fold a content line to <=75 octets per line (RFC 5545 §3.1), with * continuation lines prefixed by a single space. * * Folding is measured in UTF-8 OCTETS, not JS string length (UTF-16 code * units), and a fold boundary is never placed in the middle of a multi-byte * codepoint. Iterating by Unicode codepoint (the string iterator yields whole * codepoints rather than surrogate halves) keeps the wire bytes valid UTF-8 * even for non-ASCII SUMMARY/DESCRIPTION/LOCATION content. */ export declare function foldLine(line: string): string; /** Format an ISO-8601 datetime as a UTC iCalendar timestamp: YYYYMMDDTHHMMSSZ. */ export declare function formatICalDateTime(iso: string): string; /** * Format an ISO-8601 datetime as an all-day iCalendar DATE: YYYYMMDD. * * An all-day DATE is a floating calendar day with no timezone (RFC 5545 * §3.3.4), so it must reflect the calendar day as written in the INPUT's own * offset, not the UTC instant. Deriving YYYYMMDD from UTC components would roll * an input such as `2026-12-25T00:00:00+09:00` back to the 24th, corrupting the * DATE. We read the wall-clock date components directly from the ISO string's * leading `YYYY-MM-DD` (which, for any offset, IS that offset's calendar day) * and fall back to UTC components only for non-extended forms that omit a date * prefix. */ export declare function formatICalDate(iso: string): string; /** One VEVENT block, without the enclosing VCALENDAR. */ export declare function eventToVEvent(input: GenerateICalInput): string[]; /** A full VCALENDAR wrapping one event. CRLF line endings, as the wire wants. */ export declare function generateICS(input: GenerateICalInput): string; /** A full VCALENDAR wrapping many events (what export renders). */ export declare function generateCalendar(events: readonly GenerateICalInput[]): string; //# sourceMappingURL=caldav-ics-generate.d.ts.map