react-native-charts-wrapper icon indicating copy to clipboard operation
react-native-charts-wrapper copied to clipboard

Add typings

Open BANG88 opened this issue 7 years ago • 14 comments

Can i add typescript definitions for this project ?

When typescript support is landed. we can have a good development experience. and we can generate documentation from type definitions.

  • add typings for this project or
  • rewrite lib/*.js using typescript then generate type definitions automatically.

Thank you 😄

BANG88 avatar May 25 '17 17:05 BANG88

That will be great. Fork and pull request are welcome.

wuxudong avatar May 25 '17 23:05 wuxudong

Add typings or rewrite it using typescript ?

BANG88 avatar May 26 '17 01:05 BANG88

It is ok to rewrite it using typescript if it is compatible to current javascript user.

wuxudong avatar May 26 '17 03:05 wuxudong

Yes. it does

BANG88 avatar May 26 '17 03:05 BANG88

We need upgrade to prop-types, i am almost done only have a few issues. prop-types does not call validator function.

dragDecelerationFrictionCoef: (props, propName, componentName) => {
            let coef = props[propName];
            if (coef && (typeof coef !== 'number' || coef < 0 || coef > 1)) {
                return new Error(`Invalid prop ${propName} supplied to '${componentName}'. Value must be number and between 0 and 1.`);
            }
        },

this prop-type should be changed.

BANG88 avatar May 26 '17 03:05 BANG88

@wuxudong I just file a PR. could take a look. thanks

BANG88 avatar May 26 '17 03:05 BANG88

Well, It may take me sometime, because I should learn typescript first. I will do it as soon as possible.

wuxudong avatar May 26 '17 03:05 wuxudong

😄 I just rename lib/* to src/*.tsx documentation need improvement and need your help.

BANG88 avatar May 26 '17 03:05 BANG88

any update on this please?

faizalshap avatar Sep 07 '18 04:09 faizalshap

2019 present! ✌️ :v

andresmtz98 avatar Jan 12 '19 14:01 andresmtz98

@bang88 Why you closed your PR? wasn't it correct?

SaeedZhiany avatar Jul 30 '19 03:07 SaeedZhiany

Well, It may take me sometime, because I should learn typescript first. I will do it as soon as possible.

Maybe the author has not ready ~ 2019.

BANG88 avatar Dec 16 '19 12:12 BANG88

@wuxudong

can you please add typescript support into your library? there are lots of RN projects using typescript as the main development language and they need to use libraries that have type support. currently, I even can't import the chart components in my project.

SaeedZhiany avatar Jan 29 '20 19:01 SaeedZhiany

There's a type file for 0.5.2 on DefinitelyTyped:

yarn add -D @types/react-native-charts-wrapper

kylegillen avatar Dec 13 '22 20:12 kylegillen