Skip to content

Commit 8156a21

Browse files
niekertfouad
authored andcommitted
Add TS and flow typings
1 parent 5e5879e commit 8156a21

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ interface ComponentSize {
33
height: number
44
}
55

6-
export default function useComponentSize(): ComponentSize
6+
export default function useComponentSize<T = any>(ref: React.RefObject<T>): ComponentSize

index.js.flow

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ interface ComponentSize {
33
height: number,
44
}
55

6-
declare export default function useComponentSize(): ComponentSize;
6+
declare export default function useComponentSize<T>(ref: React.Ref<T>): ComponentSize;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"react": "^16.7.0-alpha.0"
2626
},
2727
"devDependencies": {
28+
"@types/react": "^16.4.18",
2829
"ava": "^0.25.0",
2930
"browser-env": "^3.2.5",
3031
"parcel": "^1.10.3",

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,19 @@
624624
version "10.12.0"
625625
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235"
626626

627+
"@types/prop-types@*":
628+
version "15.5.6"
629+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.6.tgz#9c03d3fed70a8d517c191b7734da2879b50ca26c"
630+
integrity sha512-ZBFR7TROLVzCkswA3Fmqq+IIJt62/T7aY/Dmz+QkU7CaW2QFqAitCE8Ups7IzmGhcN1YWMBT4Qcoc07jU9hOJQ==
631+
632+
"@types/react@^16.4.18":
633+
version "16.4.18"
634+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.18.tgz#2e28a2e7f92d3fa7d6a65f2b73275c3e3138a13d"
635+
integrity sha512-eFzJKEg6pdeaukVLVZ8Xb79CTl/ysX+ExmOfAAqcFlCCK5TgFDD9kWR0S18sglQ3EmM8U+80enjUqbfnUyqpdA==
636+
dependencies:
637+
"@types/prop-types" "*"
638+
csstype "^2.2.0"
639+
627640
"@types/semver@^5.5.0":
628641
version "5.5.0"
629642
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45"
@@ -2167,6 +2180,11 @@ [email protected], "cssom@>= 0.3.2 < 0.4.0":
21672180
dependencies:
21682181
cssom "0.3.x"
21692182

2183+
csstype@^2.2.0:
2184+
version "2.5.7"
2185+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.5.7.tgz#bf9235d5872141eccfb2d16d82993c6b149179ff"
2186+
integrity sha512-Nt5VDyOTIIV4/nRFswoCKps1R5CD1hkiyjBE9/thNaNZILLEviVw9yWQw15+O+CpNjQKB/uvdcxFFOrSflY3Yw==
2187+
21702188
currently-unhandled@^0.4.1:
21712189
version "0.4.1"
21722190
resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"

0 commit comments

Comments
 (0)