From 6cf4b0d990c96d9a10f1c29aabd1c19a4899b3fe Mon Sep 17 00:00:00 2001 From: Sebastian Pekarek Date: Fri, 16 Feb 2024 19:32:10 +0100 Subject: [PATCH] docs: Fix typedoc references --- src/alarm.ts | 24 ++++++++++++------------ src/attendee.ts | 22 +++++++++++----------- src/calendar.ts | 12 ++++++------ src/category.ts | 11 ++++++----- src/event.ts | 26 +++++++++++++------------- src/index.ts | 10 ++++++++-- 6 files changed, 56 insertions(+), 49 deletions(-) diff --git a/src/alarm.ts b/src/alarm.ts index 273b295a0..066313833 100755 --- a/src/alarm.ts +++ b/src/alarm.ts @@ -37,11 +37,11 @@ export type ICalAlarmData = ICalAlarmBaseData | ICalAlarmTriggerAfterData | ICalAlarmTriggerBeforeData; -type ICalAlarmTriggerData = ICalAlarmBaseData & { trigger: number | ICalDateTimeValue }; -type ICalAlarmTriggerAfterData = ICalAlarmBaseData & { triggerAfter: number | ICalDateTimeValue }; -type ICalAlarmTriggerBeforeData = ICalAlarmBaseData & { triggerBefore: number | ICalDateTimeValue }; +export type ICalAlarmTriggerData = ICalAlarmBaseData & { trigger: number | ICalDateTimeValue }; +export type ICalAlarmTriggerAfterData = ICalAlarmBaseData & { triggerAfter: number | ICalDateTimeValue }; +export type ICalAlarmTriggerBeforeData = ICalAlarmBaseData & { triggerBefore: number | ICalDateTimeValue }; -interface ICalAlarmBaseData { +export interface ICalAlarmBaseData { type?: ICalAlarmType; relatesTo?: ICalAlarmRelatesTo | null; repeat?: ICalAlarmRepeatData | null; @@ -79,7 +79,7 @@ export interface ICalAlarmJSONData { /** - * Usually you get an `ICalAlarm` object like this: + * Usually you get an {@link ICalAlarm} object like this: * * ```javascript * import ical from 'ical-generator'; @@ -88,7 +88,7 @@ export interface ICalAlarmJSONData { * const alarm = event.createAlarm(); * ``` * - * You can also use the [[`ICalAlarm`]] object directly: + * You can also use the {@link ICalAlarm} object directly: * * ```javascript * import ical, {ICalAlarm} from 'ical-generator'; @@ -101,11 +101,11 @@ export default class ICalAlarm { private readonly event: ICalEvent; /** - * Constructor of [[`ICalAttendee`]]. The event reference is required + * Constructor of {@link ICalAttendee}. The event reference is required * to query the calendar's timezone and summary when required. * * @param data Alarm Data - * @param calendar Reference to ICalEvent object + * @param event Reference to ICalEvent object */ constructor (data: ICalAlarmData, event: ICalEvent) { this.data = { @@ -142,7 +142,7 @@ export default class ICalAlarm { type (type: ICalAlarmType): this; /** - * Set the alarm type. See [[`ICalAlarmType`]] + * Set the alarm type. See {@link ICalAlarmType} * for available status options. * @since 0.2.1 */ @@ -162,7 +162,7 @@ export default class ICalAlarm { /** * Get the trigger time for the alarm. Can either - * be a date and time value ([[`ICalDateTimeValue`]]) or + * be a date and time value ({@link ICalDateTimeValue}) or * a number, which will represent the seconds between * alarm and event start. The number is negative, if the * alarm is triggered after the event started. @@ -266,7 +266,7 @@ export default class ICalAlarm { /** * Get the trigger time for the alarm. Can either - * be a date and time value ([[`ICalDateTimeValue`]]) or + * be a date and time value ({@link ICalDateTimeValue}) or * a number, which will represent the seconds between * alarm and event start. The number is negative, if the * alarm is triggered before the event started. @@ -305,7 +305,7 @@ export default class ICalAlarm { /** * Get the trigger time for the alarm. Can either - * be a date and time value ([[`ICalDateTimeValue`]]) or + * be a date and time value ({@link ICalDateTimeValue}) or * a number, which will represent the seconds between * alarm and event start. The number is negative, if the * alarm is triggered after the event started. diff --git a/src/attendee.ts b/src/attendee.ts index 79b1c3351..3f23d78a8 100755 --- a/src/attendee.ts +++ b/src/attendee.ts @@ -75,7 +75,7 @@ export enum ICalAttendeeType { /** - * Usually you get an `ICalAttendee` object like this: + * Usually you get an {@link ICalAttendee} object like this: * * ```javascript * import ical from 'ical-generator'; @@ -84,7 +84,7 @@ export enum ICalAttendeeType { * const attendee = event.createAttendee({ email: 'mail@example.com' }); * ``` * - * You can also use the [[`ICalAttendee`]] object directly: + * You can also use the {@link ICalAttendee} object directly: * * ```javascript * import ical, {ICalAttendee} from 'ical-generator'; @@ -97,11 +97,11 @@ export default class ICalAttendee { private readonly event: ICalEvent; /** - * Constructor of [[`ICalAttendee`]]. The event reference is + * Constructor of {@link ICalAttendee}. The event reference is * required to query the calendar's timezone when required. * * @param data Attendee Data - * @param calendar Reference to ICalEvent object + * @param event Reference to ICalEvent object */ constructor(data: ICalAttendeeData, event: ICalEvent) { this.data = { @@ -232,7 +232,7 @@ export default class ICalAttendee { /** * Set the attendee's role, defaults to `REQ` / `REQ-PARTICIPANT`. - * Checkout [[`ICalAttendeeRole`]] for available roles. + * Checkout {@link ICalAttendeeRole} for available roles. * * @since 0.2.0 */ @@ -279,7 +279,7 @@ export default class ICalAttendee { status(): ICalAttendeeStatus | null; /** - * Set the attendee's status. See [[`ICalAttendeeStatus`]] + * Set the attendee's status. See {@link ICalAttendeeStatus} * for available status options. * * @since 0.2.0 @@ -307,7 +307,7 @@ export default class ICalAttendee { /** * Set attendee's type (a.k.a. CUTYPE). - * See [[`ICalAttendeeType`]] for available status options. + * See {@link ICalAttendeeType} for available status options. * * @since 0.2.3 */ @@ -336,7 +336,7 @@ export default class ICalAttendee { * Set the attendee's delegated-to field. * * Creates a new Attendee if the passed object is not already a - * [[`ICalAttendee`]] object. Will set the `delegatedTo` and + * {@link ICalAttendee} object. Will set the `delegatedTo` and * `delegatedFrom` attributes. * * Will also set the `status` to `DELEGATED`, if attribute is set. @@ -392,7 +392,7 @@ export default class ICalAttendee { * Set the attendee's delegated-from field * * Creates a new Attendee if the passed object is not already a - * [[`ICalAttendee`]] object. Will set the `delegatedTo` and + * {@link ICalAttendee} object. Will set the `delegatedTo` and * `delegatedFrom` attributes. * * @param delegatedFrom @@ -426,7 +426,7 @@ export default class ICalAttendee { /** * Create a new attendee this attendee delegates to and returns * this new attendee. Creates a new attendee if the passed object - * is not already an [[`ICalAttendee`]]. + * is not already an {@link ICalAttendee}. * * ```javascript * const cal = ical(); @@ -449,7 +449,7 @@ export default class ICalAttendee { /** * Create a new attendee this attendee delegates from and returns * this new attendee. Creates a new attendee if the passed object - * is not already an [[`ICalAttendee`]]. + * is not already an {@link ICalAttendee}. * * ```javascript * const cal = ical(); diff --git a/src/calendar.ts b/src/calendar.ts index 73bad6408..62063905e 100755 --- a/src/calendar.ts +++ b/src/calendar.ts @@ -73,7 +73,7 @@ export enum ICalCalendarMethod { /** - * Usually you get an `ICalCalendar` object like this: + * Usually you get an {@link ICalCalendar} object like this: * ```javascript * import ical from 'ical-generator'; * const calendar = ical(); @@ -160,7 +160,7 @@ export default class ICalCalendar { /** * Set your feed's prodid. `prodid` can be either a * string like `//sebbo.net//ical-generator//EN` or a - * valid [[`ICalCalendarProdIdData`]] object. `language` + * valid {@link ICalCalendarProdIdData} object. `language` * is optional and defaults to `EN`. * * ```javascript @@ -208,7 +208,7 @@ export default class ICalCalendar { /** * Get the feed method attribute. - * See [[`ICalCalendarMethod`]] for possible results. + * See {@link ICalCalendarMethod} for possible results. * * @since 0.2.8 */ @@ -216,7 +216,7 @@ export default class ICalCalendar { /** * Set the feed method attribute. - * See [[`ICalCalendarMethod`]] for available options. + * See {@link ICalCalendarMethod} for available options. * * #### Typescript Example * ```typescript @@ -315,7 +315,7 @@ export default class ICalCalendar { * Use this method to set your feed's timezone. Is used * to fill `TIMEZONE-ID` and `X-WR-TIMEZONE` in your iCal export. * Please not that all date values are treaded differently, if - * a timezone was set. See [[`formatDate`]] for details. If no + * a timezone was set. See {@link formatDate} for details. If no * time zone is specified, all information is output as UTC. * * ```javascript @@ -520,7 +520,7 @@ export default class ICalCalendar { /** - * Creates a new [[`ICalEvent`]] and returns it. Use options to prefill the event's attributes. + * Creates a new {@link ICalEvent} and returns it. Use options to prefill the event's attributes. * Calling this method without options will create an empty event. * * ```javascript diff --git a/src/category.ts b/src/category.ts index 894721571..9a71d35e3 100755 --- a/src/category.ts +++ b/src/category.ts @@ -8,15 +8,16 @@ export interface ICalCategoryData { name: string; } -export interface ICalCategoryInternalData { + +export interface ICalCategoryJSONData { name: string; } -export type ICalCategoryJSONData = ICalCategoryInternalData; +export type ICalCategoryInternalData = ICalCategoryJSONData; /** - * Usually you get an `ICalCategory` object like this: + * Usually you get an {@link ICalCategory} object like this: * * ```javascript * import ical from 'ical-generator'; @@ -25,7 +26,7 @@ export type ICalCategoryJSONData = ICalCategoryInternalData; * const category = event.createCategory(); * ``` * - * You can also use the [[`ICalCategory`]] object directly: + * You can also use the {@link ICalCategory} object directly: * * ```javascript * import ical, {ICalCategory} from 'ical-generator'; @@ -37,7 +38,7 @@ export default class ICalCategory { private readonly data: ICalCategoryInternalData; /** - * Constructor of [[`ICalCategory`]]. + * Constructor of {@link ICalCategory}. * @param data Category Data */ constructor(data: ICalCategoryData) { diff --git a/src/event.ts b/src/event.ts index cecb092ed..164d96ae4 100755 --- a/src/event.ts +++ b/src/event.ts @@ -94,7 +94,7 @@ interface ICalEventInternalData { stamp: ICalDateTimeValue, allDay: boolean, floating: boolean, - repeating: ICalEventInternalRepeatingData | ICalRRuleStub | string | null, + repeating: ICalEventJSONRepeatingData | ICalRRuleStub | string | null, summary: string, location: ICalLocation | null, description: ICalDescription | null, @@ -124,7 +124,7 @@ export interface ICalEventJSONData { stamp: string, allDay: boolean, floating: boolean, - repeating: ICalEventInternalRepeatingData | string | null, + repeating: ICalEventJSONRepeatingData | string | null, summary: string, location: ICalLocation | null, description: ICalDescription | null, @@ -143,7 +143,7 @@ export interface ICalEventJSONData { x: {key: string, value: string}[]; } -interface ICalEventInternalRepeatingData { +export interface ICalEventJSONRepeatingData { freq: ICalEventRepeatingFreq; count?: number; interval?: number; @@ -158,7 +158,7 @@ interface ICalEventInternalRepeatingData { /** - * Usually you get an `ICalEvent` object like this: + * Usually you get an {@link ICalEvent} object like this: * ```javascript * import ical from 'ical-generator'; * const calendar = ical(); @@ -643,10 +643,10 @@ export default class ICalEvent { * Get the event's repeating options * @since 0.2.0 */ - repeating(): ICalEventInternalRepeatingData | ICalRRuleStub | string | null; + repeating(): ICalEventJSONRepeatingData | ICalRRuleStub | string | null; /** - * Set the event's repeating options by passing an [[`ICalRepeatingOptions`]] object. + * Set the event's repeating options by passing an {@link ICalRepeatingOptions} object. * * ```javascript * event.repeating({ @@ -756,7 +756,7 @@ export default class ICalEvent { * @internal */ repeating(repeating: ICalRepeatingOptions | ICalRRuleStub | string | null): this; - repeating(repeating?: ICalRepeatingOptions | ICalRRuleStub | string | null): this | ICalEventInternalRepeatingData | ICalRRuleStub | string | null { + repeating(repeating?: ICalRepeatingOptions | ICalRRuleStub | string | null): this | ICalEventJSONRepeatingData | ICalRRuleStub | string | null { if (repeating === undefined) { return this.data.repeating; } @@ -880,7 +880,7 @@ export default class ICalEvent { /** * Set the event's location by passing a string (minimum) or - * an [[`ICalLocation`]] object which will also fill the iCal + * an {@link ICalLocation} object which will also fill the iCal * `GEO` attribute and Apple's `X-APPLE-STRUCTURED-LOCATION`. * * ```javascript @@ -933,7 +933,7 @@ export default class ICalEvent { /** - * Get the event's description as an [[`ICalDescription`]] object. + * Get the event's description as an {@link ICalDescription} object. * @since 0.2.0 */ description(): ICalDescription | null; @@ -1027,7 +1027,7 @@ export default class ICalEvent { /** - * Creates a new [[`ICalAttendee`]] and returns it. Use options to prefill + * Creates a new {@link ICalAttendee} and returns it. Use options to prefill * the attendee's attributes. Calling this method without options will create * an empty attendee. * @@ -1121,7 +1121,7 @@ export default class ICalEvent { /** - * Creates a new [[`ICalAlarm`]] and returns it. Use options to prefill + * Creates a new {@link ICalAlarm} and returns it. Use options to prefill * the alarm's attributes. Calling this method without options will create * an empty alarm. * @@ -1180,7 +1180,7 @@ export default class ICalEvent { /** - * Creates a new [[`ICalCategory`]] and returns it. Use options to prefill the category's attributes. + * Creates a new {@link ICalCategory} and returns it. Use options to prefill the category's attributes. * Calling this method without options will create an empty category. * * ```javascript @@ -1601,7 +1601,7 @@ export default class ICalEvent { * @since 0.2.4 */ toJSON(): ICalEventJSONData { - let repeating: ICalEventInternalRepeatingData | string | null = null; + let repeating: ICalEventJSONRepeatingData | string | null = null; if(isRRule(this.data.repeating) || typeof this.data.repeating === 'string') { repeating = this.data.repeating.toString(); } diff --git a/src/index.ts b/src/index.ts index d9587b871..c60479365 100755 --- a/src/index.ts +++ b/src/index.ts @@ -49,11 +49,16 @@ export default ical; export { default as ICalAlarm, ICalAlarmData, + ICalAlarmBaseData, + ICalAlarmJSONData, + ICalAlarmRelatesTo, ICalAlarmRepeatData, + ICalAlarmTriggerData, + ICalAlarmTriggerAfterData, + ICalAlarmTriggerBeforeData, ICalAlarmType, ICalAlarmTypeValue, - ICalAlarmJSONData, - ICalAttachment + ICalAttachment, } from './alarm.js'; export { @@ -86,6 +91,7 @@ export { ICalEventTransparency, ICalEventData, ICalEventJSONData, + ICalEventJSONRepeatingData, ICalEventClass, } from './event.js';