From e27839594aaf058d6dc0852a2b7c443db2af2dd3 Mon Sep 17 00:00:00 2001 From: Ambrus Adrian-Zoltan Date: Fri, 11 Nov 2016 22:11:32 +0200 Subject: [PATCH 1/2] angular-bootstrap-calendar: Added event action interface Added event color interface Made Event type optional, as it is not obligatory according to the documentation Fixed IOnViewChangeClick, it must return a boolean, not void. --- .../angular-bootstrap-calendar.d.ts | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts index e32dcfca68..1ab82dfd7c 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts @@ -6,6 +6,34 @@ /// declare namespace angular.bootstrap.calendar { + interface IEventAction { + /** + * The label of the action + */ + label: string; + /** + * CSS class to be added to the action element + */ + cssClass?: string; + /** + * The action that occurs when it's clicked + * @param args - the IEvent whose action was clicked + */ + onClick: (args: IEvent) => void; + } + + interface IEventColor { + /** + * The primary color of the event, should be darker than secondary + */ + primary: string; + + /** + * The secondary color of the event, should be lighter than primary + */ + secondary: string; + } + interface IEvent { /** * The title of the event @@ -14,7 +42,7 @@ declare namespace angular.bootstrap.calendar { /** * The type of the event (determines its color). Can be important, warning, info, inverse, success or special */ - type: string; + type?: string; /** * A javascript date object for when the event starts */ @@ -23,6 +51,14 @@ declare namespace angular.bootstrap.calendar { * Optional - a javascript date object for when the event ends */ endsAt?: Date; + /** + * Color of the Event + */ + color?: IEventColor; + /** + * Actions of the Event + */ + actions?: Array; /** * If edit-event-html is set and this field is explicitly set to false then dont make it editable. */ @@ -51,6 +87,10 @@ declare namespace angular.bootstrap.calendar { * A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc */ cssClass?: string; + /** + * If set the event will display as all-day event + */ + allDay?: boolean; } interface ICalendarConfig { @@ -132,7 +172,7 @@ declare namespace angular.bootstrap.calendar { } interface IOnViewChangeClick { - (calendarDate: Date, calendarNextView: string): void; + (calendarDate: Date, calendarNextView: string): boolean; } } } From f04b4be809ab52d85e782c6a0d52b1f8cc7e6aa9 Mon Sep 17 00:00:00 2001 From: Ambrus Adrian-Zoltan Date: Wed, 16 Nov 2016 20:11:41 +0200 Subject: [PATCH 2/2] angular-bootstrap-calendar: Changed onClick function parameter type to any --- angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts index 1ab82dfd7c..34c7876897 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts @@ -19,7 +19,7 @@ declare namespace angular.bootstrap.calendar { * The action that occurs when it's clicked * @param args - the IEvent whose action was clicked */ - onClick: (args: IEvent) => void; + onClick: (args: any) => void; } interface IEventColor {