Skip to content

Commit e8bf617

Browse files
committed
feat: add typescript typings
1 parent ecabe90 commit e8bf617

File tree

5 files changed

+87
-7
lines changed

5 files changed

+87
-7
lines changed

.circleci/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,9 @@ workflows:
135135
- eslint:
136136
requires:
137137
- linux-checkout
138-
# TODO: implement typescript types
139-
# - type-check:
140-
# requires:
141-
# - linux-checkout
138+
- type-check:
139+
requires:
140+
- linux-checkout
142141
- jest:
143142
requires:
144143
- linux-checkout

index.d.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import {ViewProps,ImageSourcePropType} from 'react-native';
3+
4+
export type ProgressViewProps = ViewProps & {
5+
/**
6+
* The progress bar style.
7+
*/
8+
progressViewStyle?: 'default' | 'bar',
9+
10+
/**
11+
* The progress value (between 0 and 1).
12+
*/
13+
progress?: number,
14+
15+
/**
16+
* The tint color of the progress bar itself.
17+
*/
18+
progressTintColor?: string,
19+
20+
/**
21+
* The tint color of the progress bar track.
22+
*/
23+
trackTintColor?: string,
24+
25+
/**
26+
* A stretchable image to display as the progress bar.
27+
*/
28+
progressImage?: ImageSourcePropType,
29+
30+
/**
31+
* A stretchable image to display behind the progress bar.
32+
*/
33+
trackImage?: ImageSourcePropType,
34+
}
35+
export class ProgressView extends React.Component<ProgressViewProps> {}

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"run:ios": "node node_modules/react-native/local-cli/cli.js run-ios --project-path \"./example/ios\"",
1111
"start": "node node_modules/react-native/local-cli/cli.js start --projectRoot example --watchFolders $PWD",
1212
"flow": "flow",
13-
"test":"jest",
14-
"lint": "eslint ."
13+
"test": "jest",
14+
"lint": "eslint .",
15+
"type-check":"tsc --noEmit"
1516
},
1617
"peerDependencies": {
1718
"react": "^16.8.3",
@@ -23,6 +24,8 @@
2324
"@babel/runtime": "^7.4.3",
2425
"@react-native-community/eslint-config": "^0.0.6",
2526
"@react-native-community/eslint-plugin": "^1.0.0",
27+
"@types/react": "^16.9.19",
28+
"@types/react-native": "^0.61.2",
2629
"babel-jest": "24.7.1",
2730
"babel-plugin-module-resolver": "^3.2.0",
2831
"eslint": "^6.8.0",
@@ -33,7 +36,8 @@
3336
"prettier": "^1.19.1",
3437
"react": "16.8.3",
3538
"react-native": "^0.61.5",
36-
"react-test-renderer": "16.8.3"
39+
"react-test-renderer": "16.8.3",
40+
"typescript": "^3.7.5"
3741
},
3842
"jest": {
3943
"preset": "react-native"

tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
4+
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5+
"lib": ["es6"],
6+
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
7+
/* Strict Type-Checking Options */
8+
"strict": true /* Enable all strict type-checking options. */,
9+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
10+
}
11+
}

yarn.lock

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,27 @@
12561256
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
12571257
integrity sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==
12581258

1259+
"@types/prop-types@*":
1260+
version "15.7.3"
1261+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
1262+
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
1263+
1264+
"@types/react-native@^0.61.2":
1265+
version "0.61.2"
1266+
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.61.2.tgz#1ee4f1e1ad246d671399d1112a8a703020b7a38b"
1267+
integrity sha512-z15qGoBmZD6KIx3ZRYsqjelwBYXRMylPqz34swCH2exEk1EwOcPG2cp/TIpiN72lpByHlPvoMKbu8v1lzQrayw==
1268+
dependencies:
1269+
"@types/prop-types" "*"
1270+
"@types/react" "*"
1271+
1272+
"@types/react@*", "@types/react@^16.9.19":
1273+
version "16.9.19"
1274+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.19.tgz#c842aa83ea490007d29938146ff2e4d9e4360c40"
1275+
integrity sha512-LJV97//H+zqKWMms0kvxaKYJDG05U2TtQB3chRLF8MPNs+MQh/H1aGlyDUxjaHvu08EAGerdX2z4LTBc7ns77A==
1276+
dependencies:
1277+
"@types/prop-types" "*"
1278+
csstype "^2.2.0"
1279+
12591280
"@types/stack-utils@^1.0.1":
12601281
version "1.0.1"
12611282
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
@@ -2283,6 +2304,11 @@ cssstyle@^2.0.0:
22832304
dependencies:
22842305
cssom "~0.3.6"
22852306

2307+
csstype@^2.2.0:
2308+
version "2.6.8"
2309+
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.8.tgz#0fb6fc2417ffd2816a418c9336da74d7f07db431"
2310+
integrity sha512-msVS9qTuMT5zwAGCVm4mxfrZ18BNc6Csd0oJAtiFMZ1FAx1CCvy2+5MDmYoix63LM/6NDbNtodCiGYGmFgO0dA==
2311+
22862312
dashdash@^1.12.0:
22872313
version "1.14.1"
22882314
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -6907,6 +6933,11 @@ typedarray@^0.0.6:
69076933
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
69086934
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
69096935

6936+
typescript@^3.7.5:
6937+
version "3.7.5"
6938+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae"
6939+
integrity sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==
6940+
69106941
ua-parser-js@^0.7.18:
69116942
version "0.7.21"
69126943
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777"

0 commit comments

Comments
 (0)