mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
* added react-big-calendar module declaration * added test file * added tests cases * updated definitions * fixing moment import * reindent to 4 spaces * reindented to 4 spaces * fix author url * Added Full API Example Test based on API Documentation http://intljusticemission.github.io/react-big-calendar/examples/index.html#api * fixed redeclaring same variable
55 lines
1.9 KiB
TypeScript
55 lines
1.9 KiB
TypeScript
// Type definitions for react-big-calendar v0.10.X
|
|
// Project: https://github.com/intljusticemission/react-big-calendar
|
|
// Definitions by: Piotr Witek <http://piotrwitek.github.io>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/// <reference path="../react/react.d.ts"/>
|
|
|
|
declare module 'react-big-calendar' {
|
|
import * as React from 'react';
|
|
|
|
type stringOrDate = string | Date;
|
|
|
|
interface BigCalendarProps extends React.Props<BigCalendar> {
|
|
date?: stringOrDate;
|
|
view?: string;
|
|
events?: Object[];
|
|
onNavigate?: Function;
|
|
onView?: Function;
|
|
onSelectSlot?: (slotInfo: { start: stringOrDate, end: stringOrDate, slots: Date[] | string[] }) => void;
|
|
onSelectEvent?: (event: Object) => void;
|
|
onSelecting?: (slotInfo: { start: stringOrDate, end: stringOrDate }) => boolean;
|
|
views?: Object;
|
|
toolbar?: boolean;
|
|
popup?: boolean;
|
|
popupOffset?: number | { x: number, y: number };
|
|
selectable?: boolean;
|
|
step?: number;
|
|
rtl?: boolean;
|
|
eventPropGetter?: (event: Object, start: stringOrDate, end: stringOrDate, isSelected: boolean) => void;
|
|
titleAccessor?: string;
|
|
allDayAccessor?: boolean;
|
|
startAccessor?: stringOrDate;
|
|
endAccessor?: stringOrDate;
|
|
min?: stringOrDate;
|
|
max?: stringOrDate;
|
|
scrollToTime?: stringOrDate;
|
|
formats?: Object;
|
|
components?: Object;
|
|
messages?: Object;
|
|
}
|
|
|
|
export class BigCalendar extends React.Component<BigCalendarProps, {}> {
|
|
/**
|
|
* Setup the localizer by providing the moment Object
|
|
*/
|
|
static momentLocalizer(momentInstance: Object): void;
|
|
/**
|
|
* Setup the localizer by providing the globalize Object
|
|
*/
|
|
static globalizeLocalizer(globalizeInstance: Object): void;
|
|
}
|
|
|
|
export default BigCalendar;
|
|
}
|