DefinitelyTyped/types/ical/ical-tests.ts
Nick Clifford 921c7103a4 Add types for ical (#39198)
* start ical types (external deps?)

* rework calendar component types

* add tests

* fix name

* fix callback return type

* optional index signature

* comment
2019-10-22 14:40:00 -07:00

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;