mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
refactor(types/react-calendar-heatmap) Update Function types
This commit is contained in:
+24
-26
@@ -1,32 +1,30 @@
|
||||
// Type definitions for react-calendar-heatmap v1.6.1
|
||||
// Type definitions for react-calendar-heatmap 1.6
|
||||
// Project: https://github.com/patientslikeme/react-calendar-heatmap
|
||||
// Definitions by: Keisuke Kan <https://github.com/9renpoto>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="react" />
|
||||
import * as React from 'react';
|
||||
|
||||
declare module "react-calendar-heatmap" {
|
||||
interface Props {
|
||||
classForValue?: Function
|
||||
endDate?: string | number | Date
|
||||
gutterSize?: number
|
||||
horizontal?: boolean
|
||||
monthLabels?: string[]
|
||||
numDays?: number
|
||||
onClick?: Function
|
||||
onMouseLeave?: Function,
|
||||
onMouseOver?: Function,
|
||||
showMonthLabels?: boolean
|
||||
showOutOfRangeDays?: boolean
|
||||
showWeekdayLabels?: boolean,
|
||||
startDate?: string | number | Date,
|
||||
titleForValue?: Function,
|
||||
tooltipDataAttrs?: Object | Function
|
||||
transformDayElement?: Function,
|
||||
values: any[]
|
||||
weekdayLabels?: string[]
|
||||
}
|
||||
let ReactCalendarHeatmap : React.ClassicComponentClass<Props>;
|
||||
export default ReactCalendarHeatmap;
|
||||
}
|
||||
export interface Props {
|
||||
classForValue?: (value: any) => 'color-filled' | 'color-empty';
|
||||
endDate?: string | number | Date;
|
||||
gutterSize?: number;
|
||||
horizontal?: boolean;
|
||||
monthLabels?: string[];
|
||||
numDays?: number;
|
||||
onClick?: (value: any) => void;
|
||||
onMouseLeave?: (e: any, value: any) => void;
|
||||
onMouseOver?: (e: any, value: any) => void;
|
||||
showMonthLabels?: boolean;
|
||||
showOutOfRangeDays?: boolean;
|
||||
showWeekdayLabels?: boolean;
|
||||
startDate?: string | number | Date;
|
||||
titleForValue?: (value: any) => any;
|
||||
tooltipDataAttrs?: object;
|
||||
transformDayElement?: (rect: any, value: any, index: number) => any;
|
||||
values: any[];
|
||||
weekdayLabels?: string[];
|
||||
}
|
||||
|
||||
export default class ReactCalendarHeatmap extends React.Component<Props> {}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import * as React from "react"
|
||||
import CalendarHeatmap from "react-calendar-heatmap"
|
||||
import * as React from 'react';
|
||||
import CalendarHeatmap from 'react-calendar-heatmap';
|
||||
|
||||
export default function() {
|
||||
return (
|
||||
<CalendarHeatmap
|
||||
endDate={new Date('2016-04-01')}
|
||||
numDays={100}
|
||||
values={[
|
||||
{ date: '2016-01-01' },
|
||||
{ date: '2016-01-22' },
|
||||
{ date: '2016-01-30' },
|
||||
]}
|
||||
/>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<CalendarHeatmap
|
||||
endDate={new Date('2016-04-01')}
|
||||
numDays={100}
|
||||
values={[
|
||||
{date: '2016-01-01'},
|
||||
{date: '2016-01-22'},
|
||||
{date: '2016-01-30'}
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
@@ -1,79 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user