Skip to content

Commit

Permalink
typing for alarms (jens-maus#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnytest1 authored and sujal committed May 7, 2024
1 parent 2582c2d commit 52cd6f7
Showing 1 changed file with 44 additions and 0 deletions.
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

0 comments on commit 52cd6f7

Please sign in to comment.