mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* start ical types (external deps?) * rework calendar component types * add tests * fix name * fix callback return type * optional index signature * comment
22 lines
569 B
TypeScript
22 lines
569 B
TypeScript
import * as ical from 'ical';
|
|
|
|
const calendar: ical.FullCalendar = ical.parseFile('cal.ics');
|
|
const event: ical.CalendarComponent = calendar['uid'];
|
|
|
|
// $ExpectType CalendarComponentType
|
|
event.type;
|
|
// $ExpectType string | undefined
|
|
event.summary;
|
|
// $ExpectType Date | undefined
|
|
event.start;
|
|
// $ExpectType Geo | undefined
|
|
event.geo;
|
|
// $ExpectType string[] | undefined
|
|
event.categories;
|
|
// $ExpectType CalendarComponent[] | undefined
|
|
event.recurrences;
|
|
// $ExpectType FreeBusy | undefined
|
|
event.freebusy;
|
|
// $ExpectType string | ParamList | undefined
|
|
event.sequence;
|