Skip to content

Commit 318964c

Browse files
committed
chore: add type definitions
1 parent 511f095 commit 318964c

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

index.d.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React from 'react';
2+
export type ProgressBarAndroidProps = {
3+
/**
4+
* styleAttr: style of ProgressBar
5+
*
6+
* default: 'Normal'
7+
*/
8+
styleAttr?: 'Normal'| 'Horizontal' | 'Small' | 'Large' | 'Inverse' |'SmallInverse' |'LargeInverse'
9+
/**
10+
* color: Color of the ProgressBar
11+
*/
12+
color?: string
13+
/**
14+
* indeterminate: boolean flag for indeterminate mode.
15+
*
16+
* Use indeterminate mode for the progress bar when you do not know how long an operation will take. Indeterminate mode is the default for progress bar and shows a cyclic animation without a specific amount of progress indicated.
17+
*
18+
* default: false
19+
*/
20+
indeterminate?: boolean
21+
/**
22+
* progress: sets the amount of progress in 0-100.
23+
*
24+
* 25 will show that a progress bar is 25% complete
25+
*/
26+
progress?: number
27+
/**
28+
* animating: weather ProgressBar is animated or not.
29+
*
30+
* default: true
31+
*/
32+
animating?: boolean
33+
}
34+
export class ProgressBarAndroid extends React.Component<ProgressBarAndroidProps> {}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "Progress Bar component for React Native",
55
"main": "index.js",
6+
"types":"index.d.ts",
67
"scripts": {
78
"start": "node node_modules/react-native/local-cli/cli.js start",
89
"start:android": "adb shell am start -n com.androidprogressbar/.MainActivity",
@@ -26,7 +27,8 @@
2627
"android",
2728
"ios",
2829
"js",
29-
"index.js"
30+
"index.js",
31+
"index.d.ts"
3032
],
3133
"author": "Wagner Maciel <[email protected]>",
3234
"contributors": [
@@ -43,6 +45,7 @@
4345
"@babel/core": "^7.4.3",
4446
"@babel/runtime": "^7.4.3",
4547
"@react-native-community/eslint-config": "0.0.5",
48+
"@types/react": "^16.9.17",
4649
"babel-jest": "^24.9.0",
4750
"babel-plugin-module-resolver": "^3.2.0",
4851
"eslint": "^5.16.0",
@@ -52,7 +55,8 @@
5255
"prettier": "^1.17.0",
5356
"react": "16.9.0",
5457
"react-native": "^0.61.5",
55-
"react-test-renderer": "16.8.3"
58+
"react-test-renderer": "16.8.3",
59+
"typescript": "^3.7.4"
5660
},
5761
"jest": {
5862
"preset": "react-native"

yarn.lock

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,19 @@
12031203
"@types/istanbul-lib-coverage" "*"
12041204
"@types/istanbul-lib-report" "*"
12051205

1206+
"@types/prop-types@*":
1207+
version "15.7.3"
1208+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
1209+
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
1210+
1211+
"@types/react@^16.9.17":
1212+
version "16.9.17"
1213+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.17.tgz#58f0cc0e9ec2425d1441dd7b623421a867aa253e"
1214+
integrity sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==
1215+
dependencies:
1216+
"@types/prop-types" "*"
1217+
csstype "^2.2.0"
1218+
12061219
"@types/stack-utils@^1.0.1":
12071220
version "1.0.1"
12081221
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
@@ -2122,6 +2135,11 @@ cssstyle@^1.0.0:
21222135
dependencies:
21232136
cssom "0.3.x"
21242137

2138+
csstype@^2.2.0:
2139+
version "2.6.8"
2140+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431"
2141+
integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==
2142+
21252143
dashdash@^1.12.0:
21262144
version "1.14.1"
21272145
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -6610,6 +6628,11 @@ typedarray@^0.0.6:
66106628
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
66116629
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
66126630

6631+
typescript@^3.7.4:
6632+
version "3.7.4"
6633+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19"
6634+
integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==
6635+
66136636
ua-parser-js@^0.7.18:
66146637
version "0.7.21"
66156638
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"

0 commit comments

Comments
 (0)