Files
DefinitelyTyped/react-daterange-picker/react-daterange-picker.d.ts
Shinya Ohyanagi 2364c306eb Add definitions for react-daterange-picker (#10983)
* Add react-daterange-picker

* Fix 2-space to 4-space and add semicolon

DefinitelyTyped contributing says 'use tabs or 4-space indentation'.

* Remove declare var

declare var did not effected to build and run application.

* Add comment

Use Literal Types after TypeScript 2.0 GA released.

* Fix file name

Change react-daterange-picker-test.tsx to react-daterange-picker-tests.tsx
2016-09-07 20:15:23 +09:00

78 lines
2.3 KiB
TypeScript

// Type definitions for React Daterange Picker v1.1.0
// Project: https://github.com/onefinestay/react-daterange-picker
// Definitions by: UNCOVER TRUTH Inc. <https://github.com/uncovertruth/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../react/react.d.ts" />
/// <reference path="../moment/moment.d.ts" />
/// <reference path="../moment-range/moment-range.d.ts" />
declare module 'react-daterange-picker' {
import DateRangePicker = ReactDateRangePicker.DateRangePicker;
export = DateRangePicker;
}
declare namespace ReactDateRangePicker {
import React = __React;
interface Props extends React.Props<{}> {
bemBlock?: string;
bemNamespace?: string;
dateStates?: DateState[];
defaultState?: string;
disableNavigation?: boolean;
// Use Number Literal Types after TypeScript 2.0 GA released.
firstOfWeek?: number; // React.PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6])
helpMessage?: string;
initialFromValue?: boolean;
initialDate?: Date;
initialMonth?: number;
initialYear?: number;
initialRange?: {};
maximumDate?: Date;
minimumDate?: Date;
numberOfCalendars?: number;
onHighlightDate?(date: Date): void;
onHighlightRange?(date: Date): void;
onSelect?(value: Props): void;
onSelectStart?(value: moment.Moment): void;
paginationArrowComponent?: PaginationArrow;
selectedLabel?: string;
selectionType?: 'single' |'range';
singleDateRange?: boolean;
showLegend?: boolean;
stateDefinitions?: StateDefinitions;
value?: moment.Moment | moment.Range;
}
interface DateState {
state: string;
range: moment.Range;
}
interface StateDefinitions {
[key: string]: StateDefinition;
}
interface StateDefinition {
color: string;
label: string;
selectable?: boolean;
}
interface PaginationArrowProps extends React.Props<{}> {
disabled?: boolean;
onTrigger?(): void;
direction?: 'next' | 'previous';
}
class PaginationArrow extends React.Component<PaginationArrowProps, {}> {
}
class DateRangePicker extends React.Component<Props, {}> {
}
namespace DateRangePicker {
}
}