mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 19:42:27 +08:00
Updated for fullCalendar 2.7.2
This commit is contained in:
@@ -599,17 +599,17 @@ $('#calendar').fullCalendar({
|
||||
});
|
||||
|
||||
$('#calendar').fullCalendar({
|
||||
events: function (start, end, callback) {
|
||||
events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) {
|
||||
$.ajax({
|
||||
url: 'myxmlfeed.php',
|
||||
dataType: 'xml',
|
||||
data: {
|
||||
// our hypothetical feed requires UNIX timestamps
|
||||
start: Math.round(start.getTime() / 1000),
|
||||
end: Math.round(end.getTime() / 1000)
|
||||
start: Math.round(start.toDate().getTime() / 1000),
|
||||
end: Math.round(end.toDate().getTime() / 1000)
|
||||
},
|
||||
success: function (doc) {
|
||||
var events = [];
|
||||
var events: any[] = [];
|
||||
$(doc).find('event').each(function () {
|
||||
events.push({
|
||||
title: $(this).attr('title'),
|
||||
@@ -628,7 +628,7 @@ $('#calendar').fullCalendar({
|
||||
|
||||
// your event source
|
||||
{
|
||||
events: function (start, end, callback) {
|
||||
events: function (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: (events: FullCalendar.EventObject[]) => void) {
|
||||
// ...
|
||||
},
|
||||
color: 'yellow', // an option!
|
||||
@@ -681,7 +681,7 @@ $('#calendar').fullCalendar({
|
||||
}
|
||||
// more events here
|
||||
],
|
||||
eventRender: function (event: EventWithDescription, element) {
|
||||
eventRender: function (event: EventWithDescription, element: any, view: any) {
|
||||
element.qtip({
|
||||
content: event.description
|
||||
});
|
||||
|
||||
91
fullCalendar/fullCalendar.d.ts
vendored
91
fullCalendar/fullCalendar.d.ts
vendored
@@ -1,5 +1,5 @@
|
||||
// Type definitions for FullCalendar 1.6.1
|
||||
// Project: http://arshaw.com/fullcalendar/
|
||||
// Type definitions for FullCalendar 2.7.2
|
||||
// Project: http://fullcalendar.io/
|
||||
// Definitions by: Neil Stalker <https://github.com/nestalk>, Marcelo Camargo <https://github.com/hasellcamargo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -8,27 +8,6 @@
|
||||
|
||||
declare namespace FullCalendar {
|
||||
export interface Calendar {
|
||||
|
||||
/**
|
||||
* Formats a Date object into a string.
|
||||
*/
|
||||
formatDate(date: Date, format: string, options?: Options): string;
|
||||
|
||||
/**
|
||||
* Formats a date range (two Date objects) into a string.
|
||||
*/
|
||||
formatDates(date1: Date, date2: Date, format: string, options?: Options): string;
|
||||
|
||||
/**
|
||||
* Parses a string into a Date object.
|
||||
*/
|
||||
parseDate(dateString: string, ignoreTimezone?: boolean): Date;
|
||||
|
||||
/**
|
||||
* Parses an ISO8601 string into a Date object.
|
||||
*/
|
||||
parseISO8601(dateString: string, ignoreTimezone?: boolean): Date;
|
||||
|
||||
/**
|
||||
* Gets the version of Fullcalendar
|
||||
*/
|
||||
@@ -47,8 +26,7 @@ declare namespace FullCalendar {
|
||||
}
|
||||
|
||||
export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions {
|
||||
|
||||
// General display - http://arshaw.com/fullcalendar/docs/display/
|
||||
// General display - http://fullcalendar.io/docs/display/
|
||||
|
||||
header?: {
|
||||
left: string;
|
||||
@@ -72,6 +50,7 @@ declare namespace FullCalendar {
|
||||
contentHeight?: number;
|
||||
aspectRatio?: number;
|
||||
handleWindowResize?: boolean;
|
||||
views?: ViewSpecificOptions;
|
||||
viewRender?: (view: ViewObject, element: JQuery) => void;
|
||||
viewDestroy?: (view: ViewObject, element: JQuery) => void;
|
||||
dayRender?: (date: Date, cell: HTMLTableDataCellElement) => void;
|
||||
@@ -81,22 +60,22 @@ declare namespace FullCalendar {
|
||||
timezone?: string | boolean;
|
||||
now?: moment.Moment | Date | string | (() => moment.Moment)
|
||||
|
||||
// Views - http://arshaw.com/fullcalendar/docs/views/
|
||||
// Views - http://fullcalendar.io/docs/views/
|
||||
|
||||
defaultView?: string;
|
||||
|
||||
// Current Date - http://arshaw.com/fullcalendar/docs/current_date/
|
||||
// Current Date - http://fullcalendar.io/docs/current_date/
|
||||
|
||||
defaultDate?: moment.Moment | Date | string;
|
||||
year?: number;
|
||||
month?: number;
|
||||
date?: number;
|
||||
|
||||
// Text/Time Customization - http://arshaw.com/fullcalendar/docs/text/
|
||||
// Text/Time Customization - http://fullcalendar.io/docs/text/
|
||||
|
||||
timeFormat?: any; // String/ViewOptionHash
|
||||
columnFormat?: any; // String/ViewOptionHash
|
||||
titleFormat?: any; // String/ViewOptionHash
|
||||
timeFormat?: any; // String
|
||||
columnFormat?: any; // String
|
||||
titleFormat?: any; // String
|
||||
|
||||
buttonText?: ButtonTextObject;
|
||||
monthNames?: Array<string>;
|
||||
@@ -105,21 +84,21 @@ declare namespace FullCalendar {
|
||||
dayNamesShort?: Array<string>;
|
||||
weekNumberTitle?: string;
|
||||
|
||||
// Clicking & Hovering - http://arshaw.com/fullcalendar/docs/mouse/
|
||||
// Clicking & Hovering - http://fullcalendar.io/docs/mouse/
|
||||
|
||||
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: ViewObject) => void;
|
||||
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => any; // return type boolean or void
|
||||
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
|
||||
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: ViewObject) => void;
|
||||
|
||||
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
|
||||
// Event Data - http://fullcalendar.io/docs/event_data/
|
||||
|
||||
/**
|
||||
* This has one of the following types:
|
||||
*
|
||||
* - EventObject[]
|
||||
* - string (JSON feed)
|
||||
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
|
||||
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
|
||||
*/
|
||||
events?: any;
|
||||
|
||||
@@ -129,19 +108,18 @@ declare namespace FullCalendar {
|
||||
* - EventSource
|
||||
* - EventObject[]
|
||||
* - string (JSON feed)
|
||||
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
|
||||
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
|
||||
*/
|
||||
eventSources?: any[];
|
||||
|
||||
allDayDefault?: boolean;
|
||||
ignoreTimezone?: boolean;
|
||||
startParam?: string;
|
||||
endParam?: string
|
||||
lazyFetching?: boolean;
|
||||
eventDataTransform?: (eventData: any) => EventObject;
|
||||
loading?: (isLoading: boolean, view: ViewObject) => void;
|
||||
|
||||
// Event Rendering - http://arshaw.com/fullcalendar/docs/event_rendering/
|
||||
// Event Rendering - http://fullcalendar.io/docs/event_rendering/
|
||||
|
||||
eventColor?: string;
|
||||
eventBackgroundColor?: string;
|
||||
@@ -151,25 +129,10 @@ declare namespace FullCalendar {
|
||||
eventAfterRender?: (event: EventObject, element: HTMLDivElement, view: ViewObject) => void;
|
||||
eventAfterAllRender?: (view: ViewObject) => void;
|
||||
eventDestroy?: (event: EventObject, element: JQuery, view: ViewObject) => void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface ViewOptionHash {
|
||||
month?: any;
|
||||
week?: any;
|
||||
day?: any;
|
||||
agenda?: any;
|
||||
agendaDay?: any;
|
||||
agendaWeek?: any;
|
||||
basic?: any;
|
||||
basicDay?: any;
|
||||
basicWeek?: any;
|
||||
''?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Agenda Options - http://arshaw.com/fullcalendar/docs/agenda/
|
||||
* Agenda Options - http://fullcalendar.io/docs/agenda/
|
||||
*/
|
||||
export interface AgendaOptions {
|
||||
allDaySlot?: boolean;
|
||||
@@ -204,7 +167,7 @@ declare namespace FullCalendar {
|
||||
eventResize?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void;
|
||||
}
|
||||
/*
|
||||
* Selection - http://arshaw.com/fullcalendar/docs/selection/
|
||||
* Selection - http://fullcalendar.io/docs/selection/
|
||||
*/
|
||||
export interface SelectionOptions {
|
||||
selectable?: boolean;
|
||||
@@ -258,13 +221,12 @@ declare namespace FullCalendar {
|
||||
}
|
||||
|
||||
export interface EventSource extends JQueryAjaxSettings {
|
||||
|
||||
/**
|
||||
* This has one of the following types:
|
||||
*
|
||||
* - EventObject[]
|
||||
* - string (JSON feed)
|
||||
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
|
||||
* - (start: moment.Moment, end: moment.Moment, timezone: string | boolean, callback: {(events: EventObject[]) => void;}) => void;
|
||||
*/
|
||||
events?: any;
|
||||
|
||||
@@ -281,10 +243,23 @@ declare namespace FullCalendar {
|
||||
endParam?: string
|
||||
}
|
||||
|
||||
/*
|
||||
* View Specific Options - http://fullcalendar.io/docs/views/View-Specific-Options/
|
||||
*/
|
||||
export interface ViewSpecificOptions {
|
||||
basic?: Options;
|
||||
agenda?: Options;
|
||||
week?: Options;
|
||||
day?: Options;
|
||||
month?: Options;
|
||||
basicWeek?: Options;
|
||||
basicDay?: Options;
|
||||
agendaWeek?: Options;
|
||||
agendaDay?: Options;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
/**
|
||||
* Get/Set option value
|
||||
*/
|
||||
@@ -428,4 +403,4 @@ interface JQuery {
|
||||
|
||||
interface JQueryStatic {
|
||||
fullCalendar: FullCalendar.Calendar;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user