Skip to content

Commit 32367dc

Browse files
MichaelDeBoeyerikras
authored andcommitted
Add TypeScript typings (#9)
1 parent 013d6a1 commit 32367dc

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

package-lock.json

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = {
5151
},
5252
andTest: series.nps('build', 'test.size')
5353
},
54-
copyTypes: npsUtils.copy('src/*.js.flow dist'),
54+
copyTypes: npsUtils.copy('src/*.js.flow src/*.d.ts dist'),
5555
docs: {
5656
description: 'Generates table of contents in README',
5757
script: 'doctoc README.md'

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"main": "dist/react-final-form-arrays.cjs.js",
77
"jsnext:main": "dist/react-final-form-arrays.es.js",
88
"module": "dist/react-final-form-arrays.es.js",
9+
"typings": "dist/index.d.js",
910
"files": ["dist"],
1011
"scripts": {
1112
"start": "nps",
@@ -24,6 +25,7 @@
2425
},
2526
"homepage": "https://github.com/final-form/react-final-form-arrays#readme",
2627
"devDependencies": {
28+
"@types/react": "^16.0.31",
2729
"babel-eslint": "^8.0.2",
2830
"babel-jest": "^21.2.0",
2931
"babel-plugin-external-helpers": "^6.22.0",

src/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from 'react'
2+
import { FieldArrayProps } from 'final-form'
3+
4+
export var FieldArray: React.ComponentType<FieldArrayProps>
5+
export var version: string

0 commit comments

Comments
 (0)