Files
DefinitelyTyped/react-big-calendar/index.d.ts
Eric Anderson 9b53298395 Support Pick<> on setState now that TS 2.1 is out (#13155)
* Support Partial<> on setState now that TS 2.1 is out

* Update readme to reflect setState being typed correctly

* Switch setState to Pick

* Restore cloneELement portion of readme

* Use Pick<> | S for setState due to cast issue

* state and props should be readonly

* Fix nit + document why we

* Add typescript compiler header

* Update to properly order headers

* Update readme to reflect 2.1.5 fixing stPick

* Update readme now that 2.1.5 is out

* All that depend on react now require 2.1

* Fix definition that fails due to readonly state
2017-01-23 12:36:53 -08:00

60 lines
2.1 KiB
TypeScript

// Type definitions for react-big-calendar 0.11
// Project: https://github.com/intljusticemission/react-big-calendar
// Definitions by: Piotr Witek <http://piotrwitek.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
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;
timeslots?: number;
defaultView?: string;
}
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;
}
/* This enables 'import * as BigCalendar' syntax when compiling to es2015 */
namespace BigCalendar {}
/* react-big-calendar is exported as a commonjs module (it uses babel-preset-jason) */
export = BigCalendar;
}