Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typing for alarms #308

Merged
merged 10 commits into from
Feb 28, 2024
44 changes: 44 additions & 0 deletions node-ical.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,48 @@ declare module 'node-ical' {

type TimeZoneDictionary = Record<string, TimeZoneDef | undefined>;

/**
* Example :
* TRIGGER:-P15M
* TRIGGER;RELATED=END:P5M
* TRIGGER;VALUE=DATE-TIME:19980101T050000Z
*/
type Trigger = string;

/**
* https://www.kanzaki.com/docs/ical/valarm.html
*/
export interface VAlarm extends BaseComponent {
type: 'VALARM';
action: 'AUDIO' | 'DISPLAY' | 'EMAIL' | 'PROCEDURE';
trigger: Trigger;
description?: string;
/**
* https://www.kanzaki.com/docs/ical/repeat.html
*/
repeat?: number;
/**
* Time between repeated alarms (if repeat is set)
* DURATION:PT15M
*/
duration?;
/**
* Everything except DISPLAY
* https://www.kanzaki.com/docs/ical/attach.html
*/
attach;
/**
* For action = email
*/
summary?: string;

/**
* For action = email
*/
attendee?: Attendee;

}

export interface VEvent extends BaseComponent {
type: 'VEVENT';
method: Method;
Expand Down Expand Up @@ -91,6 +133,8 @@ declare module 'node-ical' {
exdate: any;
geo: any;
recurrenceid: any;

alarms?: VAlarm[];
}

/**
Expand Down
Loading