forked from GitHubMirrors/silverbullet-icalendar
All checks were successful
Build SilverBullet Plug / build (push) Successful in 31s
874 lines
48 KiB
TypeScript
874 lines
48 KiB
TypeScript
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
|
type Line = {
|
|
value: string;
|
|
options?: Record<string, string>;
|
|
};
|
|
|
|
type ConvertComponentType<TType, TOptions = undefined> = (schema: StandardSchemaV1<TType> | undefined, lines: string, options?: TOptions) => TType;
|
|
type ParseComponentType<TType, TOptions = undefined> = (lines: string, options?: TOptions) => TType;
|
|
type ConvertLineType<TType, TOptions = undefined> = (schema: StandardSchemaV1<TType> | undefined, line: Line, options?: TOptions) => TType;
|
|
type ParseLineType<TType, TOptions = undefined> = (line: Line, options?: TOptions) => TType;
|
|
|
|
declare const attachmentEncodingTypes: readonly ["BASE64"];
|
|
type IcsAttachmentEncodingTypes = typeof attachmentEncodingTypes;
|
|
type IcsAttachmentEncodingType = IcsAttachmentEncodingTypes[number];
|
|
declare const attachmentValueTypes: readonly ["BINARY"];
|
|
type IcsAttachmentValueTypes = typeof attachmentValueTypes;
|
|
type IcsAttachmentValueType = IcsAttachmentValueTypes[number];
|
|
type IcsAttachment = {
|
|
type: "uri";
|
|
url: string;
|
|
formatType?: string;
|
|
encoding?: never;
|
|
value?: never;
|
|
binary?: never;
|
|
} | {
|
|
type: "binary";
|
|
url?: never;
|
|
formatType?: never;
|
|
encoding?: IcsAttachmentEncodingType;
|
|
value?: IcsAttachmentValueType;
|
|
binary: string;
|
|
};
|
|
type ConvertAttachment = ConvertLineType<IcsAttachment>;
|
|
type ParseAttachment = ParseLineType<IcsAttachment>;
|
|
|
|
declare const attendeePartStatusTypes: readonly ["NEEDS-ACTION", "ACCEPTED", "DECLINED", "TENTATIVE", "DELEGATED"];
|
|
type IcsAttendeePartStatusTypes = typeof attendeePartStatusTypes;
|
|
type IcsAttendeePartStatusType = IcsAttendeePartStatusTypes[number];
|
|
type IcsAttendee = {
|
|
email: string;
|
|
name?: string;
|
|
member?: string;
|
|
delegatedFrom?: string;
|
|
role?: string;
|
|
partstat?: IcsAttendeePartStatusType;
|
|
dir?: string;
|
|
sentBy?: string;
|
|
rsvp?: boolean;
|
|
};
|
|
type ConvertAttendee = ConvertLineType<IcsAttendee>;
|
|
type ParseAttendee = ParseLineType<IcsAttendee>;
|
|
|
|
type IcsDuration = {
|
|
before?: boolean;
|
|
weeks?: number;
|
|
days?: number;
|
|
hours?: number;
|
|
minutes?: number;
|
|
seconds?: number;
|
|
};
|
|
type ConvertDuration = ConvertLineType<IcsDuration>;
|
|
type ParseDuration = ParseLineType<IcsDuration>;
|
|
|
|
type NonStandardValueName = `X-${string}`;
|
|
type NonStandardValuesGeneric = Record<string, any>;
|
|
type ParseNonStandardValue<TValue = unknown> = {
|
|
name: NonStandardValueName;
|
|
convert: (line: Line) => TValue;
|
|
schema?: StandardSchemaV1<TValue>;
|
|
};
|
|
type ParseNonStandardValues<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
[K in keyof TNonStandardValues]: ParseNonStandardValue<TNonStandardValues[K]>;
|
|
};
|
|
type GenerateNonStandardValue<TValue = unknown> = {
|
|
name: NonStandardValueName;
|
|
generate: (value: TValue) => Line | undefined | null;
|
|
};
|
|
type GenerateNonStandardValues<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
[K in keyof TNonStandardValues]: GenerateNonStandardValue<TNonStandardValues[K]>;
|
|
};
|
|
|
|
declare const dateObjectTypes: readonly ["DATE", "DATE-TIME"];
|
|
type DateObjectTypes = typeof dateObjectTypes;
|
|
type DateObjectType = DateObjectTypes[number];
|
|
type DateObjectTzProps = {
|
|
date: Date;
|
|
timezone: string;
|
|
tzoffset: string;
|
|
};
|
|
type IcsDateObject = {
|
|
date: Date;
|
|
type?: DateObjectType;
|
|
local?: DateObjectTzProps;
|
|
};
|
|
type ConvertDate = ConvertLineType<Date>;
|
|
type ParseDate = ParseLineType<Date>;
|
|
type ParseTimeStampOptions = {
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertTimeStamp = ConvertLineType<IcsDateObject, ParseTimeStampOptions>;
|
|
type ParseTimeStamp = ParseLineType<IcsDateObject, ParseTimeStampOptions>;
|
|
|
|
declare const weekDays: readonly ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
|
|
type IcsWeekDays = typeof weekDays;
|
|
type IcsWeekDay = IcsWeekDays[number];
|
|
type ConvertWeekDay = ConvertLineType<IcsWeekDay>;
|
|
type ParseWeekDay = ParseLineType<IcsWeekDay>;
|
|
type IcsWeekdayNumber = {
|
|
day: IcsWeekDay;
|
|
occurrence?: number;
|
|
};
|
|
type WeekDayNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
type ConvertWeekDayNumber = ConvertLineType<IcsWeekdayNumber>;
|
|
type ParseWeekDayNumber = ParseLineType<IcsWeekdayNumber>;
|
|
|
|
declare const recurrenceRuleFrequencies: readonly ["SECONDLY", "MINUTELY", "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "YEARLY"];
|
|
type IcsRecurrenceRuleFrequencies = typeof recurrenceRuleFrequencies;
|
|
type IcsRecurrenceRuleFrequency = IcsRecurrenceRuleFrequencies[number];
|
|
type IcsRecurrenceRule = {
|
|
frequency: IcsRecurrenceRuleFrequency;
|
|
until?: IcsDateObject;
|
|
count?: number;
|
|
interval?: number;
|
|
bySecond?: number[];
|
|
byMinute?: number[];
|
|
byHour?: number[];
|
|
byDay?: IcsWeekdayNumber[];
|
|
byMonthday?: number[];
|
|
byYearday?: number[];
|
|
byWeekNo?: number[];
|
|
byMonth?: number[];
|
|
bySetPos?: number[];
|
|
workweekStart?: IcsWeekDay;
|
|
};
|
|
type ParseRecurrenceRuleOptions = {
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertRecurrenceRule = ConvertLineType<IcsRecurrenceRule, ParseRecurrenceRuleOptions>;
|
|
type ParseRecurrenceRule = ParseLineType<IcsRecurrenceRule, ParseRecurrenceRuleOptions>;
|
|
|
|
declare const TIMEZONE_PROP_COMPONENTS: readonly ["STANDARD", "DAYLIGHT"];
|
|
type IcsTimezonePropTypes = typeof TIMEZONE_PROP_COMPONENTS;
|
|
type IcsTimezonePropType = IcsTimezonePropTypes[number];
|
|
type IcsTimezoneProp<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
type: IcsTimezonePropType;
|
|
start: Date;
|
|
offsetTo: string;
|
|
offsetFrom: string;
|
|
recurrenceRule?: IcsRecurrenceRule;
|
|
comment?: string;
|
|
recurrenceDate?: IcsDateObject;
|
|
name?: string;
|
|
nonStandard?: TNonStandardValues;
|
|
};
|
|
type ParseTimezonePropOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertTimezoneProp<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsTimezoneProp<TNonStandardValues>, ParseTimezonePropOptions<TNonStandardValues>>;
|
|
type ParseTimezoneProp<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsTimezoneProp<TNonStandardValues>, ParseTimezonePropOptions<TNonStandardValues>>;
|
|
|
|
type IcsTimezone<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
id: string;
|
|
lastModified?: Date;
|
|
url?: string;
|
|
props: IcsTimezoneProp<TNonStandardValues>[];
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type ParseTimezoneOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertTimezone<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsTimezone<TNonStandardValues>, ParseTimezoneOptions<TNonStandardValues>>;
|
|
type ParseTimezone<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsTimezone<TNonStandardValues>, ParseTimezoneOptions<TNonStandardValues>>;
|
|
|
|
declare const triggerRelations: readonly ["START", "END"];
|
|
type IcsTriggerRelations = typeof triggerRelations;
|
|
type IcsTriggerRelation = IcsTriggerRelations[number];
|
|
type IcsTriggerUnion = {
|
|
type: "absolute";
|
|
value: IcsDateObject;
|
|
} | {
|
|
type: "relative";
|
|
value: IcsDuration;
|
|
};
|
|
type IcsTriggerOptions = {
|
|
related?: IcsTriggerRelation;
|
|
};
|
|
type IcsTriggerBase = {
|
|
options?: IcsTriggerOptions;
|
|
};
|
|
type IcsTrigger = IcsTriggerBase & IcsTriggerUnion;
|
|
type ParseTriggerOptions = {
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertTrigger = ConvertLineType<IcsTrigger, ParseTriggerOptions>;
|
|
type ParseTrigger = ParseLineType<IcsTrigger, ParseTriggerOptions>;
|
|
|
|
type IcsAlarm<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
action?: string;
|
|
description?: string;
|
|
trigger: IcsTrigger;
|
|
attendees?: IcsAttendee[];
|
|
duration?: IcsDuration;
|
|
repeat?: number;
|
|
summary?: string;
|
|
attachments?: IcsAttachment[];
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type ParseAlarmOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertAlarm<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsAlarm<TNonStandardValues>, ParseAlarmOptions<TNonStandardValues>>;
|
|
type ParseAlarm<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsAlarm<TNonStandardValues>, ParseAlarmOptions<TNonStandardValues>>;
|
|
|
|
type IcsOrganizer = {
|
|
name?: string;
|
|
email: string;
|
|
dir?: string;
|
|
sentBy?: string;
|
|
};
|
|
type ConvertOrganizer = ConvertLineType<IcsOrganizer>;
|
|
type ParseOrganizer = ParseLineType<IcsOrganizer>;
|
|
|
|
type IcsRecurrenceId = {
|
|
range?: "THISANDFUTURE";
|
|
value: IcsDateObject;
|
|
};
|
|
type ParseRecurrenceIdOptions = {
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertRecurrenceId = ConvertLineType<IcsRecurrenceId, ParseRecurrenceIdOptions>;
|
|
type ParseRecurrenceId = ParseLineType<IcsRecurrenceId, ParseRecurrenceIdOptions>;
|
|
|
|
declare const eventStatusTypes: readonly ["TENTATIVE", "CONFIRMED", "CANCELLED"];
|
|
type IcsEventStatusTypes = typeof eventStatusTypes;
|
|
type IcsEventStatusType = IcsEventStatusTypes[number];
|
|
type ConvertEventStatus = ConvertLineType<IcsEventStatusType>;
|
|
type ParseEventStatus = ParseLineType<IcsEventStatusType>;
|
|
declare const todoStatusTypes: readonly ["NEEDS-ACTION", "COMPLETED", "IN-PROGRESS", "CANCELLED"];
|
|
type IcsTodoStatusTypes = typeof todoStatusTypes;
|
|
type IcsTodoStatusType = IcsTodoStatusTypes[number];
|
|
type ConvertTodoStatus = ConvertLineType<IcsTodoStatusType>;
|
|
type ParseTodoStatus = ParseLineType<IcsTodoStatusType>;
|
|
declare const journalStatusTypes: readonly ["DRAFT", "FINAL", "CANCELLED"];
|
|
type IcsJournalStatusTypes = typeof journalStatusTypes;
|
|
type IcsJournalStatusType = IcsJournalStatusTypes[number];
|
|
type ConvertJournalStatus = ConvertLineType<IcsJournalStatusType>;
|
|
type ParseJournalStatus = ParseLineType<IcsJournalStatusType>;
|
|
|
|
type IcsExceptionDate = IcsDateObject;
|
|
type IcsExceptionDates = IcsExceptionDate[];
|
|
type ParseExceptionDatesOptions = {
|
|
timezones?: IcsTimezone[];
|
|
};
|
|
type ConvertExceptionDates = ConvertLineType<IcsExceptionDates, ParseExceptionDatesOptions>;
|
|
type ParseExceptionDates = ParseLineType<IcsExceptionDates, ParseExceptionDatesOptions>;
|
|
|
|
declare const classTypes: readonly ["PRIVATE", "PUBLIC", "CONFIDENTIAL"];
|
|
type IcsClassTypes = typeof classTypes;
|
|
type IcsClassType = IcsClassTypes[number];
|
|
type ConvertClass = ConvertLineType<IcsClassType>;
|
|
type ParseClassType = ParseLineType<IcsClassType>;
|
|
|
|
declare const timeTransparentTypes: readonly ["TRANSPARENT", "OPAQUE"];
|
|
type IcsTimeTransparentTypes = typeof timeTransparentTypes;
|
|
type IcsTimeTransparentType = IcsTimeTransparentTypes[number];
|
|
type ConvertTimeTransparent = ConvertLineType<IcsTimeTransparentType>;
|
|
type ParseTimeTransparent = ParseLineType<IcsTimeTransparentType>;
|
|
|
|
type IcsEventDurationOrEnd = {
|
|
duration: IcsDuration;
|
|
end?: never;
|
|
} | {
|
|
duration?: never;
|
|
end: IcsDateObject;
|
|
};
|
|
type IcsEventBase<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
summary: string;
|
|
uid: string;
|
|
created?: IcsDateObject;
|
|
lastModified?: IcsDateObject;
|
|
stamp: IcsDateObject;
|
|
start: IcsDateObject;
|
|
location?: string;
|
|
description?: string;
|
|
descriptionAltRep?: string;
|
|
categories?: string[];
|
|
exceptionDates?: IcsExceptionDates;
|
|
recurrenceRule?: IcsRecurrenceRule;
|
|
alarms?: IcsAlarm<TNonStandardValues>[];
|
|
timeTransparent?: IcsTimeTransparentType;
|
|
url?: string;
|
|
geo?: string;
|
|
class?: IcsClassType;
|
|
organizer?: IcsOrganizer;
|
|
priority?: string;
|
|
sequence?: number;
|
|
status?: IcsEventStatusType;
|
|
attach?: string;
|
|
recurrenceId?: IcsRecurrenceId;
|
|
attendees?: IcsAttendee[];
|
|
comment?: string;
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type IcsEvent<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = IcsEventBase<TNonStandardValues> & IcsEventDurationOrEnd;
|
|
type ParseEventOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertEvent<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsEvent<TNonStandardValues>, ParseEventOptions<TNonStandardValues>>;
|
|
type ParseEvent<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsEvent<TNonStandardValues>, ParseEventOptions<TNonStandardValues>>;
|
|
|
|
declare const freeBusyTypes: readonly ["FREE", "BUSY", "BUSY-UNAVAILABLE", "BUSY-TENTATIVE"];
|
|
type FreeBusyTypes = typeof freeBusyTypes;
|
|
type FreeBusyType = FreeBusyTypes[number];
|
|
type IcsFreeBusyTimeValueDurationOrEnd = {
|
|
duration: IcsDuration;
|
|
end?: never;
|
|
} | {
|
|
duration?: never;
|
|
end: Date;
|
|
};
|
|
type IcsFreeBusyTimeValueBase = {
|
|
start: Date;
|
|
};
|
|
type IcsFreeBusyTimeValue = IcsFreeBusyTimeValueBase & IcsFreeBusyTimeValueDurationOrEnd;
|
|
type IcsFreeBusyTime = {
|
|
type?: FreeBusyType;
|
|
values: IcsFreeBusyTimeValue[];
|
|
};
|
|
type ConvertFreeBusyTime = ConvertLineType<IcsFreeBusyTime>;
|
|
type ParseFreeBusyTime = ParseLineType<IcsFreeBusyTime>;
|
|
type IcsFreeBusy<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
stamp: IcsDateObject;
|
|
uid: string;
|
|
start?: IcsDateObject;
|
|
end?: IcsDateObject;
|
|
organizer?: IcsOrganizer;
|
|
url?: string;
|
|
attendees?: IcsAttendee[];
|
|
freeBusy?: IcsFreeBusyTime[];
|
|
comment?: string;
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type ParseFreeBusyOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertFreeBusy<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsFreeBusy<TNonStandardValues>, ParseFreeBusyOptions<TNonStandardValues>>;
|
|
type ParseFreeBusy<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsFreeBusy<TNonStandardValues>, ParseFreeBusyOptions<TNonStandardValues>>;
|
|
|
|
type IcsJournal<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
stamp: IcsDateObject;
|
|
uid: string;
|
|
class?: IcsClassType;
|
|
created?: IcsDateObject;
|
|
start?: IcsDateObject;
|
|
lastModified?: IcsDateObject;
|
|
organizer?: IcsOrganizer;
|
|
recurrenceId?: IcsRecurrenceId;
|
|
sequence?: number;
|
|
status?: IcsJournalStatusType;
|
|
summary?: string;
|
|
url?: string;
|
|
recurrenceRule?: IcsRecurrenceRule;
|
|
attach?: string;
|
|
attendees?: IcsAttendee[];
|
|
categories?: string[];
|
|
comment?: string;
|
|
description?: string;
|
|
geo?: string;
|
|
exceptionDates?: IcsExceptionDates;
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type ParseJournalOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertJournal<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsJournal<TNonStandardValues>, ParseJournalOptions<TNonStandardValues>>;
|
|
type ParseJournal<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsJournal<TNonStandardValues>, ParseJournalOptions<TNonStandardValues>>;
|
|
|
|
type IcsTodoDurationOrDue = {
|
|
start: IcsDateObject;
|
|
duration: IcsDuration;
|
|
due?: never;
|
|
} | {
|
|
start?: never;
|
|
duration?: never;
|
|
due: IcsDateObject;
|
|
};
|
|
type IcsTodoBase<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
stamp: IcsDateObject;
|
|
uid: string;
|
|
class?: IcsClassType;
|
|
completed?: IcsDateObject;
|
|
created?: IcsDateObject;
|
|
description?: string;
|
|
geo?: string;
|
|
lastModified?: IcsDateObject;
|
|
location?: string;
|
|
organizer?: IcsOrganizer;
|
|
percentComplete?: number;
|
|
priority?: string;
|
|
recurrenceId?: IcsRecurrenceId;
|
|
sequence?: number;
|
|
status?: IcsTodoStatusType;
|
|
summary?: string;
|
|
url?: string;
|
|
recurrenceRule?: IcsRecurrenceRule;
|
|
attach?: string;
|
|
attendees?: IcsAttendee[];
|
|
categories?: string[];
|
|
comment?: string;
|
|
exceptionDates?: IcsExceptionDates;
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type IcsTodo<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = IcsTodoBase<TNonStandardValues> & IcsTodoDurationOrDue;
|
|
type ParseTodoOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
timezones?: IcsTimezone[];
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertTodo<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsTodo<TNonStandardValues>, ParseTodoOptions<TNonStandardValues>>;
|
|
type ParseTodo<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsTodo<TNonStandardValues>, ParseTodoOptions<TNonStandardValues>>;
|
|
|
|
declare const calendarMethods: readonly ["PUBLISH"];
|
|
type IcsCalendarMethods = typeof calendarMethods;
|
|
type IcsCalenderMethod = IcsCalendarMethods[number];
|
|
declare const calendarVersions: readonly ["2.0"];
|
|
type IcsCalendarVersions = typeof calendarVersions;
|
|
type IcsCalendarVersion = IcsCalendarVersions[number];
|
|
type IcsCalendar<TNonStandardValues extends NonStandardValuesGeneric = NonStandardValuesGeneric> = {
|
|
version: IcsCalendarVersion;
|
|
prodId: string;
|
|
method?: IcsCalenderMethod | string;
|
|
timezones?: IcsTimezone<TNonStandardValues>[];
|
|
events?: IcsEvent<TNonStandardValues>[];
|
|
todos?: IcsTodo<TNonStandardValues>[];
|
|
journals?: IcsJournal<TNonStandardValues>[];
|
|
freeBusy?: IcsFreeBusy<TNonStandardValues>[];
|
|
name?: string;
|
|
nonStandard?: Partial<TNonStandardValues>;
|
|
};
|
|
type ParseCalendarOptions<TNonStandardValues extends NonStandardValuesGeneric> = {
|
|
nonStandard?: ParseNonStandardValues<TNonStandardValues>;
|
|
};
|
|
type ConvertCalendar<TNonStandardValues extends NonStandardValuesGeneric> = ConvertComponentType<IcsCalendar<TNonStandardValues>, ParseCalendarOptions<TNonStandardValues>>;
|
|
type ParseCalendar<TNonStandardValues extends NonStandardValuesGeneric> = ParseComponentType<IcsCalendar<TNonStandardValues>, ParseCalendarOptions<TNonStandardValues>>;
|
|
|
|
type ConvertInteger = ConvertLineType<number>;
|
|
|
|
type ConvertText = ConvertLineType<string>;
|
|
|
|
declare const createGetRegex: (key: string) => RegExp;
|
|
declare const createReplaceRegex: (key: string) => RegExp;
|
|
|
|
declare const CRLF_BREAK_REGEX: RegExp;
|
|
declare const BREAK_REGEX: RegExp;
|
|
declare const CRLF_BREAK = "\r\n";
|
|
declare const LF_BREAK = "\n";
|
|
declare const SEPARATOR = ":";
|
|
declare const COMMA = ",";
|
|
declare const QUOTE = "\"";
|
|
declare const SEMICOLON = ";";
|
|
declare const SPACE = " ";
|
|
declare const EQUAL_SIGN = "=";
|
|
declare const MAX_LINE_LENGTH = 75;
|
|
|
|
type IcsCalendarObjectKey = Exclude<keyof IcsCalendar, "events" | "timezones" | "nonStandard" | "todos" | "journals" | "freeBusy">;
|
|
type IcsCalendarObjectKeys = IcsCalendarObjectKey[];
|
|
declare const VCALENDAR_TO_KEYS: {
|
|
readonly method: "METHOD";
|
|
readonly prodId: "PRODID";
|
|
readonly version: "VERSION";
|
|
readonly name: "X-WR-CALNAME";
|
|
};
|
|
declare const VCALENDAR_TO_OBJECT_KEYS: Record<"METHOD" | "PRODID" | "VERSION" | "X-WR-CALNAME", "version" | "prodId" | "method" | "name">;
|
|
type IcsCalendarKey = keyof typeof VCALENDAR_TO_OBJECT_KEYS;
|
|
type IcsCalendarKeys = IcsCalendarKey[];
|
|
declare const VCALENDAR_KEYS: ("METHOD" | "PRODID" | "VERSION" | "X-WR-CALNAME")[];
|
|
declare const VCALENDAR_OBJECT_KEYS: ("version" | "prodId" | "method" | "name")[];
|
|
|
|
type IcsAlarmObjectKey = Exclude<keyof IcsAlarm, "nonStandard">;
|
|
type IcsAlarmObjectKeys = IcsAlarmObjectKey[];
|
|
declare const VALARM_TO_KEYS: {
|
|
readonly action: "ACTION";
|
|
readonly description: "DESCRIPTION";
|
|
readonly duration: "DURATION";
|
|
readonly repeat: "REPEAT";
|
|
readonly summary: "SUMMARY";
|
|
readonly trigger: "TRIGGER";
|
|
readonly attachments: "ATTACH";
|
|
readonly attendees: "ATTENDEE";
|
|
};
|
|
declare const VALARM_TO_OBJECT_KEYS: Record<"DESCRIPTION" | "SUMMARY" | "DURATION" | "ATTACH" | "ATTENDEE" | "ACTION" | "REPEAT" | "TRIGGER", "summary" | "description" | "attendees" | "duration" | "action" | "trigger" | "repeat" | "attachments">;
|
|
type IcsAlarmKey = keyof typeof VALARM_TO_OBJECT_KEYS;
|
|
type IcsAlarmKeys = IcsAlarmKey[];
|
|
declare const VALARM_KEYS: ("DESCRIPTION" | "SUMMARY" | "DURATION" | "ATTACH" | "ATTENDEE" | "ACTION" | "REPEAT" | "TRIGGER")[];
|
|
declare const VALARM_OBJECT_KEYS: ("summary" | "description" | "attendees" | "duration" | "action" | "trigger" | "repeat" | "attachments")[];
|
|
|
|
type IcsEventObjectKey = Exclude<keyof IcsEvent, "nonStandard" | "descriptionAltRep">;
|
|
type IcsEventObjectKeys = IcsEventObjectKey[];
|
|
declare const VEVENT_TO_KEYS: {
|
|
readonly alarms: "ALARM";
|
|
readonly categories: "CATEGORIES";
|
|
readonly created: "CREATED";
|
|
readonly description: "DESCRIPTION";
|
|
readonly lastModified: "LAST-MODIFIED";
|
|
readonly location: "LOCATION";
|
|
readonly exceptionDates: "EXDATE";
|
|
readonly recurrenceRule: "RRULE";
|
|
readonly stamp: "DTSTAMP";
|
|
readonly start: "DTSTART";
|
|
readonly summary: "SUMMARY";
|
|
readonly uid: "UID";
|
|
readonly timeTransparent: "TRANSP";
|
|
readonly url: "URL";
|
|
readonly end: "DTEND";
|
|
readonly duration: "DURATION";
|
|
readonly geo: "GEO";
|
|
readonly class: "CLASS";
|
|
readonly organizer: "ORGANIZER";
|
|
readonly priority: "PRIORITY";
|
|
readonly sequence: "SEQUENCE";
|
|
readonly status: "STATUS";
|
|
readonly attach: "ATTACH";
|
|
readonly recurrenceId: "RECURRENCE-ID";
|
|
readonly attendees: "ATTENDEE";
|
|
readonly comment: "COMMENT";
|
|
};
|
|
declare const VEVENT_TO_OBJECT_KEYS: Record<"ALARM" | "CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "LOCATION" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "TRANSP" | "URL" | "DTEND" | "DURATION" | "GEO" | "CLASS" | "ORGANIZER" | "PRIORITY" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT", "summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "location" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "alarms" | "timeTransparent" | "url" | "geo" | "class" | "organizer" | "priority" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment" | "duration" | "end">;
|
|
type IcsEventKey = keyof typeof VEVENT_TO_OBJECT_KEYS;
|
|
type IcsEventKeys = IcsEventKey[];
|
|
declare const VEVENT_KEYS: ("ALARM" | "CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "LOCATION" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "TRANSP" | "URL" | "DTEND" | "DURATION" | "GEO" | "CLASS" | "ORGANIZER" | "PRIORITY" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT")[];
|
|
declare const VEVENT_OBJECT_KEYS: ("summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "location" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "alarms" | "timeTransparent" | "url" | "geo" | "class" | "organizer" | "priority" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment" | "duration" | "end")[];
|
|
|
|
type IcsTimezoneObjectKey = Exclude<keyof IcsTimezone, "props" | "nonStandard">;
|
|
type IcsTimezoneObjectKeys = IcsTimezoneObjectKey[];
|
|
declare const VTIMEZONE_TO_KEYS: {
|
|
readonly id: "TZID";
|
|
readonly lastModified: "LAST-MODIFIED";
|
|
readonly url: "TZURL";
|
|
};
|
|
declare const VTIMEZONE_TO_OBJECT_KEYS: Record<"LAST-MODIFIED" | "TZID" | "TZURL", "lastModified" | "url" | "id">;
|
|
type IcsTimezoneKey = keyof typeof VTIMEZONE_TO_OBJECT_KEYS;
|
|
type IcsTimezoneKeys = IcsTimezoneKey[];
|
|
declare const VTIMEZONE_KEYS: ("LAST-MODIFIED" | "TZID" | "TZURL")[];
|
|
declare const VTIMEZONE_OBJECT_KEYS: ("lastModified" | "url" | "id")[];
|
|
|
|
type IcsTimezonePropObjectKey = Exclude<keyof IcsTimezoneProp, "type" | "nonStandard">;
|
|
type IcsTimezonePropObjectKeys = IcsTimezonePropObjectKey[];
|
|
declare const VTIMEZONE_PROP_TO_KEYS: {
|
|
readonly comment: "COMMENT";
|
|
readonly name: "TZNAME";
|
|
readonly offsetFrom: "TZOFFSETFROM";
|
|
readonly offsetTo: "TZOFFSETTO";
|
|
readonly recurrenceDate: "RDATE";
|
|
readonly recurrenceRule: "RRULE";
|
|
readonly start: "DTSTART";
|
|
};
|
|
declare const VTIMEZONE_PROP_TO_OBJECT_KEYS: Record<"RRULE" | "DTSTART" | "COMMENT" | "TZNAME" | "TZOFFSETFROM" | "TZOFFSETTO" | "RDATE", "name" | "start" | "recurrenceRule" | "comment" | "offsetTo" | "offsetFrom" | "recurrenceDate">;
|
|
type IcsTimezonePropKey = keyof typeof VTIMEZONE_PROP_TO_OBJECT_KEYS;
|
|
type IcsTimezonePropKeys = IcsTimezonePropKey[];
|
|
declare const VTIMEZONE_PROP_KEYS: ("RRULE" | "DTSTART" | "COMMENT" | "TZNAME" | "TZOFFSETFROM" | "TZOFFSETTO" | "RDATE")[];
|
|
declare const VTIMEZONE_PROP_OBJECT_KEYS: ("name" | "start" | "recurrenceRule" | "comment" | "offsetTo" | "offsetFrom" | "recurrenceDate")[];
|
|
|
|
type IcsRecurrenceRuleObjectKey = keyof IcsRecurrenceRule;
|
|
type IcsRecurrenceRuleObjectKeys = IcsRecurrenceRuleObjectKey[];
|
|
declare const RRULE_TO_KEYS: {
|
|
readonly byDay: "BYDAY";
|
|
readonly byHour: "BYHOUR";
|
|
readonly byMinute: "BYMINUTE";
|
|
readonly byMonth: "BYMONTH";
|
|
readonly byMonthday: "BYMONTHDAY";
|
|
readonly bySecond: "BYSECOND";
|
|
readonly bySetPos: "BYSETPOS";
|
|
readonly byWeekNo: "BYWEEKNO";
|
|
readonly byYearday: "BYYEARDAY";
|
|
readonly count: "COUNT";
|
|
readonly frequency: "FREQ";
|
|
readonly interval: "INTERVAL";
|
|
readonly until: "UNTIL";
|
|
readonly workweekStart: "WKST";
|
|
};
|
|
declare const RRULE_TO_OBJECT_KEYS: Record<"BYDAY" | "BYHOUR" | "BYMINUTE" | "BYMONTH" | "BYMONTHDAY" | "BYSECOND" | "BYSETPOS" | "BYWEEKNO" | "BYYEARDAY" | "COUNT" | "FREQ" | "INTERVAL" | "UNTIL" | "WKST", "frequency" | "until" | "count" | "interval" | "bySecond" | "byMinute" | "byHour" | "byDay" | "byMonthday" | "byYearday" | "byWeekNo" | "byMonth" | "bySetPos" | "workweekStart">;
|
|
type IcsRecurrenceRuleKey = keyof typeof RRULE_TO_OBJECT_KEYS;
|
|
type IcsRecurrenceRuleKeys = IcsRecurrenceRuleKey[];
|
|
declare const RRULE_KEYS: ("BYDAY" | "BYHOUR" | "BYMINUTE" | "BYMONTH" | "BYMONTHDAY" | "BYSECOND" | "BYSETPOS" | "BYWEEKNO" | "BYYEARDAY" | "COUNT" | "FREQ" | "INTERVAL" | "UNTIL" | "WKST")[];
|
|
declare const RRULE_OBJECT_KEYS: ("frequency" | "until" | "count" | "interval" | "bySecond" | "byMinute" | "byHour" | "byDay" | "byMonthday" | "byYearday" | "byWeekNo" | "byMonth" | "bySetPos" | "workweekStart")[];
|
|
|
|
type IcsTodoObjectKey = Exclude<keyof IcsTodo, "nonStandard">;
|
|
type IcsTodoObjectKeys = IcsTodoObjectKey[];
|
|
declare const VTODO_TO_KEYS: {
|
|
readonly categories: "CATEGORIES";
|
|
readonly created: "CREATED";
|
|
readonly description: "DESCRIPTION";
|
|
readonly lastModified: "LAST-MODIFIED";
|
|
readonly location: "LOCATION";
|
|
readonly exceptionDates: "EXDATE";
|
|
readonly recurrenceRule: "RRULE";
|
|
readonly stamp: "DTSTAMP";
|
|
readonly start: "DTSTART";
|
|
readonly summary: "SUMMARY";
|
|
readonly uid: "UID";
|
|
readonly url: "URL";
|
|
readonly duration: "DURATION";
|
|
readonly geo: "GEO";
|
|
readonly class: "CLASS";
|
|
readonly organizer: "ORGANIZER";
|
|
readonly priority: "PRIORITY";
|
|
readonly sequence: "SEQUENCE";
|
|
readonly status: "STATUS";
|
|
readonly attach: "ATTACH";
|
|
readonly recurrenceId: "RECURRENCE-ID";
|
|
readonly attendees: "ATTENDEE";
|
|
readonly comment: "COMMENT";
|
|
readonly completed: "COMPLETED";
|
|
readonly due: "DUE";
|
|
readonly percentComplete: "PERCENT-COMPLETE";
|
|
};
|
|
declare const VTODO_TO_OBJECT_KEYS: Record<"CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "LOCATION" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "URL" | "DURATION" | "GEO" | "CLASS" | "ORGANIZER" | "PRIORITY" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT" | "COMPLETED" | "DUE" | "PERCENT-COMPLETE", "summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "location" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "url" | "geo" | "class" | "organizer" | "priority" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment" | "duration" | "completed" | "percentComplete" | "due">;
|
|
type IcsTodoKey = keyof typeof VTODO_TO_OBJECT_KEYS;
|
|
type IcsTodoKeys = IcsTodoKey[];
|
|
declare const VTODO_KEYS: ("CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "LOCATION" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "URL" | "DURATION" | "GEO" | "CLASS" | "ORGANIZER" | "PRIORITY" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT" | "COMPLETED" | "DUE" | "PERCENT-COMPLETE")[];
|
|
declare const VTODO_OBJECT_KEYS: ("summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "location" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "url" | "geo" | "class" | "organizer" | "priority" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment" | "duration" | "completed" | "percentComplete" | "due")[];
|
|
|
|
type IcsJournalObjectKey = Exclude<keyof IcsJournal, "nonStandard">;
|
|
type IcsJournalObjectKeys = IcsJournalObjectKey[];
|
|
declare const VJOURNAL_TO_KEYS: {
|
|
readonly categories: "CATEGORIES";
|
|
readonly created: "CREATED";
|
|
readonly description: "DESCRIPTION";
|
|
readonly lastModified: "LAST-MODIFIED";
|
|
readonly exceptionDates: "EXDATE";
|
|
readonly recurrenceRule: "RRULE";
|
|
readonly stamp: "DTSTAMP";
|
|
readonly start: "DTSTART";
|
|
readonly summary: "SUMMARY";
|
|
readonly uid: "UID";
|
|
readonly url: "URL";
|
|
readonly geo: "GEO";
|
|
readonly class: "CLASS";
|
|
readonly organizer: "ORGANIZER";
|
|
readonly sequence: "SEQUENCE";
|
|
readonly status: "STATUS";
|
|
readonly attach: "ATTACH";
|
|
readonly recurrenceId: "RECURRENCE-ID";
|
|
readonly attendees: "ATTENDEE";
|
|
readonly comment: "COMMENT";
|
|
};
|
|
declare const VJOURNAL_TO_OBJECT_KEYS: Record<"CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "URL" | "GEO" | "CLASS" | "ORGANIZER" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT", "summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "url" | "geo" | "class" | "organizer" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment">;
|
|
type IcsJournalKey = keyof typeof VJOURNAL_TO_OBJECT_KEYS;
|
|
type IcsJournalKeys = IcsJournalKey[];
|
|
declare const VJOURNAL_KEYS: ("CATEGORIES" | "CREATED" | "DESCRIPTION" | "LAST-MODIFIED" | "EXDATE" | "RRULE" | "DTSTAMP" | "DTSTART" | "SUMMARY" | "UID" | "URL" | "GEO" | "CLASS" | "ORGANIZER" | "SEQUENCE" | "STATUS" | "ATTACH" | "RECURRENCE-ID" | "ATTENDEE" | "COMMENT")[];
|
|
declare const VJOURNAL_OBJECT_KEYS: ("summary" | "uid" | "created" | "lastModified" | "stamp" | "start" | "description" | "categories" | "exceptionDates" | "recurrenceRule" | "url" | "geo" | "class" | "organizer" | "sequence" | "status" | "attach" | "recurrenceId" | "attendees" | "comment")[];
|
|
|
|
type IcsFreeBusyObjectKey = Exclude<keyof IcsFreeBusy, "nonStandard">;
|
|
type IcsFreeBusyObjectKeys = IcsFreeBusyObjectKey[];
|
|
declare const VFREEBUSY_TO_KEYS: {
|
|
readonly stamp: "DTSTAMP";
|
|
readonly start: "DTSTART";
|
|
readonly uid: "UID";
|
|
readonly url: "URL";
|
|
readonly organizer: "ORGANIZER";
|
|
readonly attendees: "ATTENDEE";
|
|
readonly comment: "COMMENT";
|
|
readonly end: "DTEND";
|
|
readonly freeBusy: "FREEBUSY";
|
|
};
|
|
declare const VFREEBUSY_TO_OBJECT_KEYS: Record<"DTSTAMP" | "DTSTART" | "UID" | "URL" | "DTEND" | "ORGANIZER" | "ATTENDEE" | "COMMENT" | "FREEBUSY", "freeBusy" | "uid" | "stamp" | "start" | "url" | "organizer" | "attendees" | "comment" | "end">;
|
|
type IcsFreeBusyKey = keyof typeof VFREEBUSY_TO_OBJECT_KEYS;
|
|
type IcsFreeBusyKeys = IcsFreeBusyKey[];
|
|
declare const VFREEBUSY_KEYS: ("DTSTAMP" | "DTSTART" | "UID" | "URL" | "DTEND" | "ORGANIZER" | "ATTENDEE" | "COMMENT" | "FREEBUSY")[];
|
|
declare const VFREEBUSY_OBJECT_KEYS: ("freeBusy" | "uid" | "stamp" | "start" | "url" | "organizer" | "attendees" | "comment" | "end")[];
|
|
|
|
declare const OBJECT_START = "BEGIN";
|
|
declare const OBJECT_END = "END";
|
|
declare const VCALENDAR_OBJECT_KEY = "VCALENDAR";
|
|
declare const VTIMEZONE_OBJECT_KEY = "VTIMEZONE";
|
|
declare const VTIMEZONE_STANDARD_OBJECT_KEY = "STANDARD";
|
|
declare const VTIMEZONE_DAYLIGHT_OBJECT_KEY = "DAYLIGHT";
|
|
declare const VEVENT_OBJECT_KEY = "VEVENT";
|
|
declare const VALARM_OBJECT_KEY = "VALARM";
|
|
declare const VTODO_OBJECT_KEY = "VTODO";
|
|
declare const VJOURNAL_OBJECT_KEY = "VJOURNAL";
|
|
declare const VFREEBUSY_OBJECT_KEY = "VFREEBUSY";
|
|
type IcsComponents = typeof ICS_COMPONENTS;
|
|
type IcsComponent = IcsComponents[number];
|
|
declare const ICS_COMPONENTS: readonly ["VCALENDAR", "VTIMEZONE", "STANDARD", "DAYLIGHT", "VEVENT", "VALARM", "VTODO", "VJOURNAL", "VFREEBUSY"];
|
|
|
|
type PickArrays<T> = {
|
|
[K in keyof T as Exclude<T[K], undefined> extends unknown[] ? K : never]: T[K];
|
|
};
|
|
type ArrayElement<T> = T extends (infer U)[] ? U : never;
|
|
type GenerateIcsComponentProps<TData extends object & {
|
|
nonStandard?: object;
|
|
}, TNonStandard extends NonStandardValuesGeneric, TArrayData extends PickArrays<TData> = PickArrays<TData>, TChildComponentData extends PickArrays<TData> = PickArrays<TData>> = {
|
|
icsComponent: IcsComponent;
|
|
icsKeyMap: Partial<Omit<Record<keyof TData, string>, "nonStandard">>;
|
|
skipFormatLines?: boolean;
|
|
nonStandard?: GenerateNonStandardValues<TNonStandard>;
|
|
timezones?: IcsTimezone[];
|
|
generateValues: {
|
|
[K in keyof TData]?: (props: {
|
|
icsKey: string;
|
|
value: NonNullable<TData[K]>;
|
|
key: K;
|
|
}) => string | undefined;
|
|
};
|
|
generateArrayValues?: {
|
|
[K in keyof TArrayData]?: (props: {
|
|
icsKey: string;
|
|
value: ArrayElement<TArrayData[K]>;
|
|
}) => string | undefined;
|
|
};
|
|
childComponents?: {
|
|
[K in keyof TChildComponentData]: (childData: ArrayElement<TChildComponentData[K]> & {
|
|
nonStandard?: object;
|
|
}) => string;
|
|
};
|
|
omitGenerateKeys?: (keyof TData)[];
|
|
};
|
|
|
|
declare const generateIcsAlarm: <T extends NonStandardValuesGeneric>(alarm: IcsAlarm, options?: Pick<GenerateIcsComponentProps<IcsAlarm, T>, "nonStandard" | "skipFormatLines">) => string;
|
|
|
|
declare const generateIcsCalendar: <T extends NonStandardValuesGeneric>(calendar: IcsCalendar, options?: Pick<GenerateIcsComponentProps<IcsCalendar, T>, "nonStandard">) => string;
|
|
|
|
declare const generateIcsEvent: <T extends NonStandardValuesGeneric>(event: IcsEvent, options?: Pick<GenerateIcsComponentProps<IcsEvent, T>, "nonStandard" | "skipFormatLines" | "timezones">) => string;
|
|
|
|
declare const generateIcsFreeBusy: <T extends NonStandardValuesGeneric>(freeBusy: IcsFreeBusy, options?: Pick<GenerateIcsComponentProps<IcsFreeBusy, T>, "nonStandard" | "skipFormatLines" | "timezones">) => string;
|
|
|
|
declare const generateIcsJournal: <T extends NonStandardValuesGeneric>(journal: IcsJournal, options?: Pick<GenerateIcsComponentProps<IcsJournal, T>, "nonStandard" | "skipFormatLines" | "timezones">) => string;
|
|
|
|
declare const generateIcsTimezone: <T extends NonStandardValuesGeneric>(timezone: IcsTimezone, options?: Pick<GenerateIcsComponentProps<IcsTimezone, T>, "nonStandard" | "skipFormatLines">) => string;
|
|
|
|
declare const generateIcsTimezoneProp: <T extends NonStandardValuesGeneric>(timezoneProp: IcsTimezoneProp, options?: Pick<GenerateIcsComponentProps<IcsTimezoneProp, T>, "nonStandard" | "skipFormatLines">) => string;
|
|
|
|
declare const generateIcsTodo: <T extends NonStandardValuesGeneric>(todo: IcsTodo, options?: Pick<GenerateIcsComponentProps<IcsTodo, T>, "nonStandard" | "skipFormatLines" | "timezones">) => string;
|
|
|
|
declare const generateNonStandardValues: <T extends NonStandardValuesGeneric>(nonStandardValues?: T, nonStandardOptions?: GenerateNonStandardValues<T>) => string;
|
|
|
|
declare const generateIcsAttachment: (attachment: IcsAttachment) => string;
|
|
|
|
declare const generateIcsAttendee: (attendee: IcsAttendee, key: string) => string;
|
|
|
|
declare const generateIcsDate: (date: Date) => string;
|
|
declare const generateIcsUtcDateTime: (date: Date) => string;
|
|
declare const generateIcsLocalDateTime: (date: Date, local: DateObjectTzProps, timezones?: IcsTimezone[]) => string;
|
|
declare const generateIcsLocalOnlyDateTime: (date: Date, offset: string) => string;
|
|
|
|
declare const generateIcsDuration: (duration: IcsDuration) => string | undefined;
|
|
|
|
declare const generateIcsMail: (email: string, isOption?: boolean) => string;
|
|
|
|
declare const generateIcsOrganizer: (organizer: IcsOrganizer) => string;
|
|
|
|
declare const generateIcsRecurrenceRule: (value: IcsRecurrenceRule) => string;
|
|
|
|
type GenerateIcsOptionsProps = {
|
|
key: string;
|
|
value: string;
|
|
}[];
|
|
|
|
type GenerateIcsTimeStampOptions = {
|
|
timezones?: IcsTimezone[];
|
|
forceUtc?: boolean;
|
|
};
|
|
declare const generateIcsTimeStamp: (icsKey: string, dateObject: IcsDateObject, lineOptions?: GenerateIcsOptionsProps, options?: GenerateIcsTimeStampOptions) => string;
|
|
|
|
declare const generateIcsTrigger: (trigger: IcsTrigger) => string | undefined;
|
|
|
|
declare const generateIcsWeekdayNumber: (value: IcsWeekdayNumber) => string;
|
|
|
|
declare const generateIcsInteger: (icsKey: string, value: number) => string;
|
|
|
|
declare const generateIcsText: (icsKey: string, value: string, options?: GenerateIcsOptionsProps) => string;
|
|
|
|
declare const convertIcsAlarm: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertAlarm<T>>) => ReturnType<ConvertAlarm<T>>;
|
|
|
|
declare const convertIcsCalendar: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertCalendar<T>>) => ReturnType<ConvertCalendar<T>>;
|
|
|
|
declare const convertIcsEvent: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertEvent<T>>) => ReturnType<ConvertEvent<T>>;
|
|
|
|
declare const convertIcsTimezone: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertTimezone<T>>) => ReturnType<ConvertTimezone<T>>;
|
|
|
|
declare const convertIcsTimezoneProp: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertTimezoneProp<T>>) => ReturnType<ConvertTimezoneProp<T>>;
|
|
|
|
declare const convertIcsTodo: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertTodo<T>>) => ReturnType<ConvertTodo<T>>;
|
|
|
|
declare const convertIcsJournal: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertJournal<T>>) => ReturnType<ConvertJournal<T>>;
|
|
|
|
declare const convertIcsFreeBusy: <T extends NonStandardValuesGeneric>(...args: Parameters<ConvertFreeBusy<T>>) => ReturnType<ConvertFreeBusy<T>>;
|
|
|
|
declare const convertNonStandardValues: <T extends {
|
|
nonStandard?: NonStandardValuesGeneric;
|
|
}, TNonStandardValues extends NonStandardValuesGeneric>(base: T, nonStandardValues: Record<string, Line>, nonStandardOptions?: ParseNonStandardValues<TNonStandardValues>) => T;
|
|
|
|
declare const convertIcsAttachment: ConvertAttachment;
|
|
|
|
declare const convertIcsAttendee: ConvertAttendee;
|
|
|
|
declare const convertIcsDate: ConvertDate;
|
|
declare const convertIcsDateTime: ConvertDate;
|
|
declare const convertIcsLocalOnlyDateTime: (schema: Parameters<ConvertDate>[0], line: Parameters<ConvertDate>[1], offset: string) => Date;
|
|
|
|
declare const convertIcsDuration: ConvertDuration;
|
|
|
|
declare const convertIcsOrganizer: ConvertOrganizer;
|
|
|
|
declare const convertIcsRecurrenceId: ConvertRecurrenceId;
|
|
|
|
declare const recurrenceTimestampKeys: "until"[];
|
|
type RecurrenceTimeStampKey = (typeof recurrenceTimestampKeys)[number];
|
|
declare const recurrenceObjectKeyIsTimeStamp: (objectKey: IcsRecurrenceRuleObjectKey) => objectKey is RecurrenceTimeStampKey;
|
|
declare const recurrenceNumberArrayKeys: ("bySecond" | "byMinute" | "byHour" | "byMonthday" | "byYearday" | "byWeekNo" | "bySetPos")[];
|
|
type RecurrenceNumberArrayKey = (typeof recurrenceNumberArrayKeys)[number];
|
|
declare const recurrenceObjectKeyIsNumberArray: (objectKey: IcsRecurrenceRuleObjectKey) => objectKey is RecurrenceNumberArrayKey;
|
|
declare const recurrenceWeekdayNumberArrayKeys: "byDay"[];
|
|
type RecurrenceWeekDayNumberArrayKey = (typeof recurrenceWeekdayNumberArrayKeys)[number];
|
|
declare const recurrenceObjectKeyIsWeekdayNumberArray: (objectKey: IcsRecurrenceRuleObjectKey) => objectKey is RecurrenceWeekDayNumberArrayKey;
|
|
declare const recurrenceNumberKeys: ("count" | "interval")[];
|
|
type RecurrenceNumberKey = (typeof recurrenceNumberKeys)[number];
|
|
declare const recurrenceObjectKeyIsNumber: (objectKey: IcsRecurrenceRuleObjectKey) => objectKey is RecurrenceNumberKey;
|
|
declare const convertIcsRecurrenceRule: ConvertRecurrenceRule;
|
|
|
|
declare const convertIcsTimeStamp: ConvertTimeStamp;
|
|
|
|
declare const convertIcsTrigger: ConvertTrigger;
|
|
|
|
declare const convertIcsWeekDayNumber: ConvertWeekDayNumber;
|
|
|
|
declare const convertIcsClass: ConvertClass;
|
|
|
|
declare const convertIcsTimeTransparent: ConvertTimeTransparent;
|
|
|
|
declare const convertIcsExceptionDates: ConvertExceptionDates;
|
|
|
|
declare const convertIcsWeekDay: ConvertWeekDay;
|
|
|
|
declare const convertIcsEventStatus: ConvertEventStatus;
|
|
declare const convertIcsTodoStatus: ConvertTodoStatus;
|
|
declare const convertIcsJournalStatus: ConvertJournalStatus;
|
|
|
|
declare const convertIcsInteger: ConvertInteger;
|
|
|
|
declare const convertIcsText: ConvertText;
|
|
|
|
declare const getDurationFromInterval: (start: Date, end: Date) => IcsDuration;
|
|
|
|
declare const getEventEndFromDuration: (start: Date, duration: IcsDuration) => Date;
|
|
|
|
declare const getEventEnd: (event: IcsEvent) => Date;
|
|
|
|
type ExtendByRecurrenceRuleOptions = {
|
|
start: Date;
|
|
end?: Date;
|
|
exceptions?: Date[];
|
|
};
|
|
declare const DEFAULT_END_IN_YEARS = 2;
|
|
declare const extendByRecurrenceRule: (rule: IcsRecurrenceRule, options: ExtendByRecurrenceRuleOptions) => Date[];
|
|
|
|
declare const extendTimezoneProps: (date: Date, timezoneProps: IcsTimezoneProp[]) => IcsTimezoneProp[];
|
|
|
|
declare const getTimezoneObjectOffset: (date: Date, tzid: string, timezones?: IcsTimezone[]) => {
|
|
offset: DateObjectTzProps["tzoffset"];
|
|
milliseconds: number;
|
|
} | undefined;
|
|
|
|
declare const timeZoneOffsetToMilliseconds: (offset: string) => number;
|
|
|
|
export { BREAK_REGEX, COMMA, CRLF_BREAK, CRLF_BREAK_REGEX, type ConvertAlarm, type ConvertAttachment, type ConvertAttendee, type ConvertCalendar, type ConvertClass, type ConvertComponentType, type ConvertDate, type ConvertDuration, type ConvertEvent, type ConvertEventStatus, type ConvertExceptionDates, type ConvertFreeBusy, type ConvertFreeBusyTime, type ConvertInteger, type ConvertJournal, type ConvertJournalStatus, type ConvertLineType, type ConvertOrganizer, type ConvertRecurrenceId, type ConvertRecurrenceRule, type ConvertText, type ConvertTimeStamp, type ConvertTimeTransparent, type ConvertTimezone, type ConvertTimezoneProp, type ConvertTodo, type ConvertTodoStatus, type ConvertTrigger, type ConvertWeekDay, type ConvertWeekDayNumber, DEFAULT_END_IN_YEARS, type DateObjectType, type DateObjectTypes, type DateObjectTzProps, EQUAL_SIGN, type ExtendByRecurrenceRuleOptions, type FreeBusyType, type FreeBusyTypes, type GenerateNonStandardValue, type GenerateNonStandardValues, ICS_COMPONENTS, type IcsAlarm, type IcsAlarmKey, type IcsAlarmKeys, type IcsAlarmObjectKey, type IcsAlarmObjectKeys, type IcsAttachment, type IcsAttachmentEncodingType, type IcsAttachmentEncodingTypes, type IcsAttachmentValueType, type IcsAttachmentValueTypes, type IcsAttendee, type IcsAttendeePartStatusType, type IcsAttendeePartStatusTypes, type IcsCalendar, type IcsCalendarKey, type IcsCalendarKeys, type IcsCalendarMethods, type IcsCalendarObjectKey, type IcsCalendarObjectKeys, type IcsCalendarVersion, type IcsCalendarVersions, type IcsCalenderMethod, type IcsClassType, type IcsClassTypes, type IcsComponent, type IcsComponents, type IcsDateObject, type IcsDuration, type IcsEvent, type IcsEventBase, type IcsEventDurationOrEnd, type IcsEventKey, type IcsEventKeys, type IcsEventObjectKey, type IcsEventObjectKeys, type IcsEventStatusType, type IcsEventStatusTypes, type IcsExceptionDate, type IcsExceptionDates, type IcsFreeBusy, type IcsFreeBusyKey, type IcsFreeBusyKeys, type IcsFreeBusyObjectKey, type IcsFreeBusyObjectKeys, type IcsFreeBusyTime, type IcsFreeBusyTimeValue, type IcsFreeBusyTimeValueBase, type IcsFreeBusyTimeValueDurationOrEnd, type IcsJournal, type IcsJournalKey, type IcsJournalKeys, type IcsJournalObjectKey, type IcsJournalObjectKeys, type IcsJournalStatusType, type IcsJournalStatusTypes, type IcsOrganizer, type IcsRecurrenceId, type IcsRecurrenceRule, type IcsRecurrenceRuleFrequencies, type IcsRecurrenceRuleFrequency, type IcsRecurrenceRuleKey, type IcsRecurrenceRuleKeys, type IcsRecurrenceRuleObjectKey, type IcsRecurrenceRuleObjectKeys, type IcsTimeTransparentType, type IcsTimeTransparentTypes, type IcsTimezone, type IcsTimezoneKey, type IcsTimezoneKeys, type IcsTimezoneObjectKey, type IcsTimezoneObjectKeys, type IcsTimezoneProp, type IcsTimezonePropKey, type IcsTimezonePropKeys, type IcsTimezonePropObjectKey, type IcsTimezonePropObjectKeys, type IcsTimezonePropType, type IcsTimezonePropTypes, type IcsTodo, type IcsTodoBase, type IcsTodoDurationOrDue, type IcsTodoKey, type IcsTodoKeys, type IcsTodoObjectKey, type IcsTodoObjectKeys, type IcsTodoStatusType, type IcsTodoStatusTypes, type IcsTrigger, type IcsTriggerBase, type IcsTriggerOptions, type IcsTriggerRelation, type IcsTriggerRelations, type IcsTriggerUnion, type IcsWeekDay, type IcsWeekDays, type IcsWeekdayNumber, LF_BREAK, type Line, MAX_LINE_LENGTH, type NonStandardValueName, type NonStandardValuesGeneric, OBJECT_END, OBJECT_START, type ParseAlarm, type ParseAlarmOptions, type ParseAttachment, type ParseAttendee, type ParseCalendar, type ParseCalendarOptions, type ParseClassType, type ParseComponentType, type ParseDate, type ParseDuration, type ParseEvent, type ParseEventOptions, type ParseEventStatus, type ParseExceptionDates, type ParseExceptionDatesOptions, type ParseFreeBusy, type ParseFreeBusyOptions, type ParseFreeBusyTime, type ParseJournal, type ParseJournalOptions, type ParseJournalStatus, type ParseLineType, type ParseNonStandardValue, type ParseNonStandardValues, type ParseOrganizer, type ParseRecurrenceId, type ParseRecurrenceIdOptions, type ParseRecurrenceRule, type ParseRecurrenceRuleOptions, type ParseTimeStamp, type ParseTimeStampOptions, type ParseTimeTransparent, type ParseTimezone, type ParseTimezoneOptions, type ParseTimezoneProp, type ParseTimezonePropOptions, type ParseTodo, type ParseTodoOptions, type ParseTodoStatus, type ParseTrigger, type ParseTriggerOptions, type ParseWeekDay, type ParseWeekDayNumber, QUOTE, RRULE_KEYS, RRULE_OBJECT_KEYS, RRULE_TO_KEYS, RRULE_TO_OBJECT_KEYS, SEMICOLON, SEPARATOR, SPACE, TIMEZONE_PROP_COMPONENTS, VALARM_KEYS, VALARM_OBJECT_KEY, VALARM_OBJECT_KEYS, VALARM_TO_KEYS, VALARM_TO_OBJECT_KEYS, VCALENDAR_KEYS, VCALENDAR_OBJECT_KEY, VCALENDAR_OBJECT_KEYS, VCALENDAR_TO_KEYS, VCALENDAR_TO_OBJECT_KEYS, VEVENT_KEYS, VEVENT_OBJECT_KEY, VEVENT_OBJECT_KEYS, VEVENT_TO_KEYS, VEVENT_TO_OBJECT_KEYS, VFREEBUSY_KEYS, VFREEBUSY_OBJECT_KEY, VFREEBUSY_OBJECT_KEYS, VFREEBUSY_TO_KEYS, VFREEBUSY_TO_OBJECT_KEYS, VJOURNAL_KEYS, VJOURNAL_OBJECT_KEY, VJOURNAL_OBJECT_KEYS, VJOURNAL_TO_KEYS, VJOURNAL_TO_OBJECT_KEYS, VTIMEZONE_DAYLIGHT_OBJECT_KEY, VTIMEZONE_KEYS, VTIMEZONE_OBJECT_KEY, VTIMEZONE_OBJECT_KEYS, VTIMEZONE_PROP_KEYS, VTIMEZONE_PROP_OBJECT_KEYS, VTIMEZONE_PROP_TO_KEYS, VTIMEZONE_PROP_TO_OBJECT_KEYS, VTIMEZONE_STANDARD_OBJECT_KEY, VTIMEZONE_TO_KEYS, VTIMEZONE_TO_OBJECT_KEYS, VTODO_KEYS, VTODO_OBJECT_KEY, VTODO_OBJECT_KEYS, VTODO_TO_KEYS, VTODO_TO_OBJECT_KEYS, type WeekDayNumber, attachmentEncodingTypes, attachmentValueTypes, attendeePartStatusTypes, calendarMethods, calendarVersions, classTypes, convertIcsAlarm, convertIcsAttachment, convertIcsAttendee, convertIcsCalendar, convertIcsClass, convertIcsDate, convertIcsDateTime, convertIcsDuration, convertIcsEvent, convertIcsEventStatus, convertIcsExceptionDates, convertIcsFreeBusy, convertIcsInteger, convertIcsJournal, convertIcsJournalStatus, convertIcsLocalOnlyDateTime, convertIcsOrganizer, convertIcsRecurrenceId, convertIcsRecurrenceRule, convertIcsText, convertIcsTimeStamp, convertIcsTimeTransparent, convertIcsTimezone, convertIcsTimezoneProp, convertIcsTodo, convertIcsTodoStatus, convertIcsTrigger, convertIcsWeekDay, convertIcsWeekDayNumber, convertNonStandardValues, createGetRegex, createReplaceRegex, dateObjectTypes, eventStatusTypes, extendByRecurrenceRule, extendTimezoneProps, freeBusyTypes, generateIcsAlarm, generateIcsAttachment, generateIcsAttendee, generateIcsCalendar, generateIcsDate, generateIcsDuration, generateIcsEvent, generateIcsFreeBusy, generateIcsInteger, generateIcsJournal, generateIcsLocalDateTime, generateIcsLocalOnlyDateTime, generateIcsMail, generateIcsOrganizer, generateIcsRecurrenceRule, generateIcsText, generateIcsTimeStamp, generateIcsTimezone, generateIcsTimezoneProp, generateIcsTodo, generateIcsTrigger, generateIcsUtcDateTime, generateIcsWeekdayNumber, generateNonStandardValues, getDurationFromInterval, getEventEnd, getEventEndFromDuration, getTimezoneObjectOffset, journalStatusTypes, recurrenceObjectKeyIsNumber, recurrenceObjectKeyIsNumberArray, recurrenceObjectKeyIsTimeStamp, recurrenceObjectKeyIsWeekdayNumberArray, recurrenceRuleFrequencies, timeTransparentTypes, timeZoneOffsetToMilliseconds, todoStatusTypes, triggerRelations, weekDays };
|