UNPKG

1.6 kBTypeScriptView Raw
1import { CalendarEvent } from 'calendar-utils';
2/**
3 * This class is responsible for displaying all event titles within the calendar. You may override any of its methods via angulars DI to suit your requirements. For example:
4 *
5 * ```typescript
6 * import { Injectable } from '@angular/core';
7 * import { CalendarEventTitleFormatter, CalendarEvent } from 'angular-calendar';
8 *
9 * @Injectable()
10 * class CustomEventTitleFormatter extends CalendarEventTitleFormatter {
11 *
12 * month(event: CalendarEvent): string {
13 * return `Custom prefix: ${event.title}`;
14 * }
15 *
16 * }
17 *
18 * // in your component
19 * providers: [{
20 * provide: CalendarEventTitleFormatter,
21 * useClass: CustomEventTitleFormatter
22 * }]
23 * ```
24 */
25export declare class CalendarEventTitleFormatter {
26 /**
27 * The month view event title.
28 */
29 month(event: CalendarEvent, title: string): string;
30 /**
31 * The month view event tooltip. Return a falsey value from this to disable the tooltip.
32 */
33 monthTooltip(event: CalendarEvent, title: string): string;
34 /**
35 * The week view event title.
36 */
37 week(event: CalendarEvent, title: string): string;
38 /**
39 * The week view event tooltip. Return a falsey value from this to disable the tooltip.
40 */
41 weekTooltip(event: CalendarEvent, title: string): string;
42 /**
43 * The day view event title.
44 */
45 day(event: CalendarEvent, title: string): string;
46 /**
47 * The day view event tooltip. Return a falsey value from this to disable the tooltip.
48 */
49 dayTooltip(event: CalendarEvent, title: string): string;
50}