forceCalendar/Docs
API Reference

ICSHandler

API reference for the ICSHandler class.

import { ICSHandler } from '@forcecalendar/core';

Constructor

new ICSHandler(calendar: Calendar)

Methods

MethodSignatureReturns
import(input: string | File, options?: ImportOptions) => Promise<ImportResult>Import result
export(options?: ExportOptions) => stringICS string (synchronous)
downloadAsFile(filename?: string, options?: ExportOptions) => void— (synchronous)
importFromURL(url: string, options?: ImportOptions) => Promise<ImportResult>Import result
subscribe(url: string, options?: SubscribeOptions) => SubscriptionSubscription
validate(icsString: string) => ValidationResultValidation result

ImportOptions

OptionTypeDefault
mergebooleantrue
updateExistingbooleanfalse
skipDuplicatesbooleantrue
dateRange{ start: Date, end: Date }undefined
categoriesstring[][]

ExportOptions

OptionTypeDefault
dateRange{ start: Date, end: Date }undefined
categoriesstring[][]
calendarNamestring'Lightning Calendar Export'
includeRecurringbooleantrue
expandRecurringbooleanfalse

Subscription Object

MethodDescription
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.