API Reference
ICSHandler
API reference for the ICSHandler class.
import { ICSHandler } from '@forcecalendar/core';Constructor
new ICSHandler(calendar: Calendar)Methods
| Method | Signature | Returns |
|---|---|---|
import | (input: string | File, options?: ImportOptions) => Promise<ImportResult> | Import result |
export | (options?: ExportOptions) => string | ICS string (synchronous) |
downloadAsFile | (filename?: string, options?: ExportOptions) => void | — (synchronous) |
importFromURL | (url: string, options?: ImportOptions) => Promise<ImportResult> | Import result |
subscribe | (url: string, options?: SubscribeOptions) => Subscription | Subscription |
validate | (icsString: string) => ValidationResult | Validation result |
ImportOptions
| Option | Type | Default |
|---|---|---|
merge | boolean | true |
updateExisting | boolean | false |
skipDuplicates | boolean | true |
dateRange | { start: Date, end: Date } | undefined |
categories | string[] | [] |
ExportOptions
| Option | Type | Default |
|---|---|---|
dateRange | { start: Date, end: Date } | undefined |
categories | string[] | [] |
calendarName | string | 'Lightning Calendar Export' |
includeRecurring | boolean | true |
expandRecurring | boolean | false |
Subscription Object
| Method | Description |
|---|---|
refresh() | Force immediate refresh |
stop() | Pause auto-refresh |
start() | Resume auto-refresh |
ValidationResult
{ valid: boolean, errors: string[], eventCount: number }URL transport options
importFromURL(url, options) additionally accepts requestTimeout (default 30,000 ms), maxRedirects (5), and maxFileSize (parser default). This helper performs network requests and does not replace host egress controls. See network boundaries.
Keep the object returned by subscribe() and call stop() on teardown. Its initial import is asynchronous, and the subscription is in-process rather than durable provider synchronization.