refactor(calendar):

This commit is contained in:
Guille 2016-07-08 00:40:35 +02:00
parent 35d083ed52
commit c122171dd5

View File

@ -1,4 +1,5 @@
import {Plugin, Cordova} from './plugin'; import { Cordova, Plugin } from './plugin';
export interface CalendarOptions { export interface CalendarOptions {
firstReminderMinutes?: number; firstReminderMinutes?: number;
@ -48,40 +49,40 @@ export class Calendar {
@Cordova() @Cordova()
static hasReadWritePermission(): Promise<boolean> { return; } static hasReadWritePermission(): Promise<boolean> { return; }
/** /**
* Check if we have read permission * Check if we have read permission
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
@Cordova() @Cordova()
static hasReadPermission(): Promise<boolean> {return; } static hasReadPermission(): Promise<boolean> { return; }
/** /**
* Check if we have write permission * Check if we have write permission
* @returns {Promise<boolean>} * @returns {Promise<boolean>}
*/ */
@Cordova() @Cordova()
static hasWritePermission(): Promise<boolean> {return; } static hasWritePermission(): Promise<boolean> { return; }
/** /**
* Request write permission * Request write permission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestWritePermission(): Promise<any> {return; } static requestWritePermission(): Promise<any> { return; }
/** /**
* Request read permission * Request read permission
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestReadPermission(): Promise<any> {return; } static requestReadPermission(): Promise<any> { return; }
/** /**
* Requests read/write permissions * Requests read/write permissions
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
static requestReadWritePermission(): Promise<any> {return; } static requestReadWritePermission(): Promise<any> { return; }
/** /**
* Create a calendar. (iOS only) * Create a calendar. (iOS only)
@ -107,7 +108,7 @@ export class Calendar {
@Cordova() @Cordova()
static createCalendar( static createCalendar(
nameOrOptions: string | { calendarName: string, calendarColor: string } nameOrOptions: string | { calendarName: string, calendarColor: string }
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Delete a calendar. (iOS only) * Delete a calendar. (iOS only)
@ -172,7 +173,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Silently create an event with additional options. * Silently create an event with additional options.
@ -193,7 +194,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Interactively create an event. * Interactively create an event.
@ -212,7 +213,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Interactively create an event with additional options. * Interactively create an event with additional options.
@ -233,7 +234,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
// deprecated // deprecated
// @Cordova() // @Cordova()
@ -263,7 +264,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Find an event with additional options. * Find an event with additional options.
@ -284,7 +285,7 @@ export class Calendar {
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
options?: CalendarOptions options?: CalendarOptions
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Find a list of events within the specified date range. (Android only) * Find a list of events within the specified date range. (Android only)
@ -337,7 +338,7 @@ export class Calendar {
newNotes?: string, newNotes?: string,
newStartDate?: Date, newStartDate?: Date,
newEndDate?: Date newEndDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Modify an event with additional options. (iOS only) * Modify an event with additional options. (iOS only)
@ -355,31 +356,31 @@ export class Calendar {
* @param {CalendarOptions} [options] Additional options, see `getCalendarOptions` * @param {CalendarOptions} [options] Additional options, see `getCalendarOptions`
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static modifyEventWithOptions( static modifyEventWithOptions(
title?: string, title?: string,
location?: string, location?: string,
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
newTitle?: string, newTitle?: string,
newLocation?: string, newLocation?: string,
newNotes?: string, newNotes?: string,
newStartDate?: Date, newStartDate?: Date,
newEndDate?: Date, newEndDate?: Date,
options?: CalendarOptions options?: CalendarOptions
) { return; } ) { return; }
/** /**
* Delete an event. * Delete an event.
* *
* @param {string} [title] The event title * @param {string} [title] The event title
* @param {string} [location] The event location * @param {string} [location] The event location
* @param {string} [notes] The event notes * @param {string} [notes] The event notes
* @param {Date} [startDate] The event start date * @param {Date} [startDate] The event start date
* @param {Date} [endDate] The event end date * @param {Date} [endDate] The event end date
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static deleteEvent( static deleteEvent(
title?: string, title?: string,
@ -387,7 +388,7 @@ export class Calendar {
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date endDate?: Date
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Delete an event from the specified Calendar. (iOS only) * Delete an event from the specified Calendar. (iOS only)
@ -400,15 +401,15 @@ export class Calendar {
* @param {string} calendarName * @param {string} calendarName
* @return Returns a Promise * @return Returns a Promise
*/ */
@Cordova() @Cordova()
static deleteEventFromNamedCalendar( static deleteEventFromNamedCalendar(
title?: string, title?: string,
location?: string, location?: string,
notes?: string, notes?: string,
startDate?: Date, startDate?: Date,
endDate?: Date, endDate?: Date,
calendarName?: string calendarName?: string
): Promise<any> { return; } ): Promise<any> { return; }
/** /**
* Open the calendar at the specified date. * Open the calendar at the specified date.