docs(calendar): enhance docs and display interface

This commit is contained in:
Ibby 2016-12-06 08:57:53 -05:00
parent d02688971d
commit 2f9c5e6674

View File

@ -5,22 +5,49 @@ import { Cordova, Plugin } from './plugin';
*/
export interface CalendarOptions {
/**
* Id
*/
id?: string;
/**
*
*/
firstReminderMinutes?: number;
/**
*
*/
secondReminderMinutes?: number;
recurrence?: string; // options are: 'daily', 'weekly', 'monthly', 'yearly'
/**
* Recurrence. Can be set to `daily`, `weekly`, `monthly` or `yearly`
*/
recurrence?: string;
recurrenceInterval?: number; // only used when recurrence is set
/**
* Recurrence interval. Valid only when `recurrence` option is set.
*/
recurrenceInterval?: number;
/**
* Recurrence end date. Valid only when `recurrence` option is set.
*/
recurrenceEndDate?: Date;
/**
* Calendar name. Ths is supported by `iOS` only.
*/
calendarName?: string;
/**
* Calendar id
*/
calendarId?: number;
/**
* URL
*/
url?: string;
}
@ -44,7 +71,8 @@ export interface CalendarOptions {
* (err) => { console.log(err); }
* );
* ```
*
* @interfaces
* CalendarOptions
*/
@Plugin({
pluginName: 'Calendar',
@ -111,9 +139,7 @@ export class Calendar {
* @returns {Promise<any>} Returns a Promise
*/
@Cordova()
static createCalendar(
nameOrOptions: string | { calendarName: string, calendarColor: string }
): Promise<any> { return; }
static createCalendar(nameOrOptions: string | any): Promise<any> { return; }
/**
* Delete a calendar. (iOS only)
@ -126,31 +152,12 @@ export class Calendar {
/**
* Returns the default calendar options.
*
* @return Returns an object with the default calendar options:
* firstReminderMinutes: 60,
* secondReminderMinutes: null,
* recurrence: null, // options are: 'daily', 'weekly', 'monthly', 'yearly'
* recurrenceInterval: 1, // only used when recurrence is set
* recurrenceEndDate: null,
* calendarName: null,
* calendarId: null,
* url: null
* @return {CalendarOptions} Returns an object with the default calendar options
*/
@Cordova({
sync: true
})
static getCalendarOptions(): CalendarOptions {
return {
firstReminderMinutes: 60,
secondReminderMinutes: null,
recurrence: null,
recurrenceInterval: 1,
recurrenceEndDate: null,
calendarName: null,
calendarId: null,
url: null
};
}
static getCalendarOptions(): CalendarOptions { return; }
/**
* Silently create an event.
@ -288,7 +295,9 @@ export class Calendar {
* @param {Date} [endDate] The end date
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
*/
@Cordova()
@Cordova({
platforms: ['Android']
})
static listEventsInRange(startDate: Date, endDate: Date): Promise<any> { return; }
/**
@ -302,7 +311,9 @@ export class Calendar {
* Get a list of all future events in the specified calendar. (iOS only)
* @returns {Promise<any>} Returns a Promise that resolves with the list of events, or rejects with an error.
*/
@Cordova()
@Cordova({
platforms: ['iOS']
})
static findAllEventsInNamedCalendar(calendarName: string): Promise<any> { return; }
/**
@ -320,7 +331,9 @@ export class Calendar {
* @param {Date} [newEndDate] The new event end date
* @return Returns a Promise
*/
@Cordova()
@Cordova({
platforms: ['iOS']
})
static modifyEvent(
title?: string,
location?: string,
@ -351,7 +364,9 @@ export class Calendar {
* @param {CalendarOptions} [newOptions] New event options, see `getCalendarOptions`
* @return Returns a Promise
*/
@Cordova()
@Cordova({
platforms: ['iOS']
})
static modifyEventWithOptions(
title?: string,
location?: string,
@ -397,7 +412,9 @@ export class Calendar {
* @param {string} calendarName
* @return Returns a Promise
*/
@Cordova()
@Cordova({
platforms: ['iOS']
})
static deleteEventFromNamedCalendar(
title?: string,
location?: string,