From 2f83d96a3feeb81da975dca867744b87675d666d Mon Sep 17 00:00:00 2001 From: Keisuke Kan <9renpoto@gmail.com> Date: Fri, 10 Nov 2017 10:08:41 +0900 Subject: [PATCH] refactor(types/react-calendar-heatmap) Update Function types --- types/react-calendar-heatmap/index.d.ts | 50 ++++++------ .../react-calendar-heatmap-tests.tsx | 28 +++---- types/react-calendar-heatmap/tsconfig.json | 2 +- types/react-calendar-heatmap/tslint.json | 78 +------------------ 4 files changed, 40 insertions(+), 118 deletions(-) diff --git a/types/react-calendar-heatmap/index.d.ts b/types/react-calendar-heatmap/index.d.ts index 9a977deeb1..b4efd2b156 100644 --- a/types/react-calendar-heatmap/index.d.ts +++ b/types/react-calendar-heatmap/index.d.ts @@ -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 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// +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; - export default ReactCalendarHeatmap; -} \ No newline at end of file +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 {} diff --git a/types/react-calendar-heatmap/react-calendar-heatmap-tests.tsx b/types/react-calendar-heatmap/react-calendar-heatmap-tests.tsx index 6d66508ca0..4e807ddfcd 100644 --- a/types/react-calendar-heatmap/react-calendar-heatmap-tests.tsx +++ b/types/react-calendar-heatmap/react-calendar-heatmap-tests.tsx @@ -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 ( - - ) -} \ No newline at end of file + return ( + + ); +} diff --git a/types/react-calendar-heatmap/tsconfig.json b/types/react-calendar-heatmap/tsconfig.json index ad3ac4522c..f605aa4478 100644 --- a/types/react-calendar-heatmap/tsconfig.json +++ b/types/react-calendar-heatmap/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/react-calendar-heatmap/tslint.json b/types/react-calendar-heatmap/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/react-calendar-heatmap/tslint.json +++ b/types/react-calendar-heatmap/tslint.json @@ -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" }