Skip to content

Commit

Permalink
docs: Fix typedoc references
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbo2002 committed Feb 16, 2024
1 parent 9190c84 commit 6cf4b0d
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 49 deletions.
24 changes: 12 additions & 12 deletions src/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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 = {
Expand Down Expand Up @@ -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
*/
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions src/attendee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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 = {
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -208,15 +208,15 @@ export default class ICalCalendar {

/**
* Get the feed method attribute.
* See [[`ICalCalendarMethod`]] for possible results.
* See {@link ICalCalendarMethod} for possible results.
*
* @since 0.2.8
*/
method(): ICalCalendarMethod | null;

/**
* Set the feed method attribute.
* See [[`ICalCalendarMethod`]] for available options.
* See {@link ICalCalendarMethod} for available options.
*
* #### Typescript Example
* ```typescript
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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) {
Expand Down
26 changes: 13 additions & 13 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -143,7 +143,7 @@ export interface ICalEventJSONData {
x: {key: string, value: string}[];
}

interface ICalEventInternalRepeatingData {
export interface ICalEventJSONRepeatingData {
freq: ICalEventRepeatingFreq;
count?: number;
interval?: number;
Expand All @@ -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();
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down
Loading

0 comments on commit 6cf4b0d

Please sign in to comment.