Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

node-ical.d.ts 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. declare module 'node-ical' {
  2. import {RequestInit} from 'node-fetch';
  3. import {RRule} from 'rrule';
  4. /**
  5. * Methods (Sync)
  6. */
  7. export interface NodeICalSync {
  8. parseICS: (body: string) => CalendarResponse;
  9. parseFile: (file: string) => CalendarResponse;
  10. }
  11. export const sync: NodeICalSync;
  12. /**
  13. * Methods (Async)
  14. */
  15. export interface NodeICalAsync {
  16. fromURL: ((url: string, callback: NodeIcalCallback) => void) & ((url: string, options: RequestInit | NodeIcalCallback, callback?: NodeIcalCallback) => void) & ((url: string) => Promise<CalendarResponse>);
  17. parseICS: ((body: string, callback: NodeIcalCallback) => void) & ((body: string) => Promise<CalendarResponse>);
  18. parseFile: ((file: string, callback: NodeIcalCallback) => void) & ((file: string) => Promise<CalendarResponse>);
  19. }
  20. export const async: NodeICalAsync;
  21. /**
  22. * Methods (Autodetect)
  23. */
  24. export function fromURL(url: string, callback: NodeIcalCallback): void;
  25. export function fromURL(url: string, options: RequestInit | NodeIcalCallback, callback?: NodeIcalCallback): void;
  26. export function fromURL(url: string): Promise<CalendarResponse>;
  27. export function parseICS(body: string, callback: NodeIcalCallback): void;
  28. export function parseICS(body: string): CalendarResponse;
  29. export function parseFile(file: string, callback: NodeIcalCallback): void;
  30. export function parseFile(file: string): CalendarResponse;
  31. /**
  32. * Response objects
  33. */
  34. export type NodeIcalCallback = (error: any, data: CalendarResponse) => void;
  35. export type CalendarResponse = Record<string, CalendarComponent>;
  36. export type CalendarComponent = VTimeZone | VEvent;
  37. export type VTimeZone = TimeZoneProps & TimeZoneDictionary;
  38. interface TimeZoneProps extends BaseComponent {
  39. type: 'VTIMEZONE';
  40. tzid: string;
  41. tzurl: string;
  42. }
  43. type TimeZoneDictionary = Record<string, TimeZoneDef | undefined>;
  44. export interface VEvent extends BaseComponent {
  45. type: 'VEVENT';
  46. dtstamp: DateWithTimeZone;
  47. uid: string;
  48. sequence: string;
  49. transparency: Transparency;
  50. class: Class;
  51. summary: string;
  52. start: DateWithTimeZone;
  53. datetype: DateType;
  54. end: DateWithTimeZone;
  55. location: string;
  56. description: string;
  57. url: string;
  58. completion: string;
  59. created: DateWithTimeZone;
  60. lastmodified: DateWithTimeZone;
  61. rrule?: RRule;
  62. // I am not entirely sure about these, leave them as any for now..
  63. organizer: any;
  64. exdate: any;
  65. geo: any;
  66. recurrenceid: any;
  67. }
  68. export interface BaseComponent {
  69. params: any[];
  70. }
  71. export interface TimeZoneDef {
  72. type: 'DAYLIGHT' | 'STANDARD';
  73. params: any[];
  74. tzoffsetfrom: string;
  75. tzoffsetto: string;
  76. tzname: string;
  77. start: DateWithTimeZone;
  78. dateType: DateType;
  79. rrule: string;
  80. rdate: string | string[];
  81. }
  82. export type DateWithTimeZone = Date & {tz: string};
  83. export type DateType = 'date-time' | 'date';
  84. export type Transparency = 'TRANSPARENT' | 'OPAQUE';
  85. export type Class = 'PUBLIC' | 'PRIVATE' | 'CONFIDENTIAL';
  86. }