Skip to content

Commit d7ed1f7

Browse files
adidahiyagpbl
authored andcommitted
Improve typings, use TypeScript 3.1 (#929)
* Upgrade TypeScript to 3.1 * Remove explicit TypeScript dependency * Remove redundant type exports * Add types/README.md
1 parent a674232 commit d7ed1f7

File tree

11 files changed

+32
-20
lines changed

11 files changed

+32
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"react": "~0.13.x || ~0.14.x || ^15.0.0 || ^16.0.0"
5858
},
5959
"devDependencies": {
60+
"@types/react": "^16.9.2",
6061
"autoprefixer": "^8.4.1",
6162
"babel-cli": "^6.26.0",
6263
"babel-core": "^6.26.3",
@@ -97,7 +98,6 @@
9798
"react-dom": "^16.4.2",
9899
"react-test-renderer": "^16.4.2",
99100
"rimraf": "^2.6.2",
100-
"typescript": "^3.0.1",
101101
"webpack": "^3.10.0"
102102
},
103103
"dependencies": {

types/DayPicker.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
import * as React from 'react';
44
import { LocaleUtils, ModifiersUtils, DateUtils } from './utils';

types/DayPickerInput.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
import * as React from 'react';
44
import { DayPickerInputProps } from './props';

types/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# TypeScript Definitions
2+
3+
react-day-picker includes type definitions which the TypeScript compiler and language services can use to check your usage of the library.
4+
5+
Note that _only exports from the root of the package_ (`import { ... } from "react-day-picker"`) are considered part of the public API.

types/common.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
export interface ClassNames {
44
container: string;

types/index.d.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
export { default } from './DayPicker';
4-
5-
import * as UtilTypes from './utils';
64
export * from './common';
75
export * from './props';
86
export * from './utils';
9-
10-
export const DateUtils: typeof UtilTypes.DateUtils;
11-
export const LocaleUtils: typeof UtilTypes.LocaleUtils;
12-
export const ModifiersUtils: typeof UtilTypes.ModifiersUtils;

types/moment.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
import { LocaleUtils } from './utils';
44

types/props.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
import * as React from 'react';
44
import {

types/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"es6",
66
"dom"
77
],
8-
"noImplicitAny": false,
8+
"noImplicitAny": true,
99
"noImplicitThis": true,
1010
"strictNullChecks": true,
1111
"noEmit": true,

types/utils.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// TypeScript Version: 2.3
1+
// TypeScript Version: 3.1
22

33
import { RangeModifier, Modifier } from './common';
44

0 commit comments

Comments
 (0)