HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
241 stars 68 forks source link

Unhelpful Typescript type definitions #290

Open Akatroj opened 1 year ago

Akatroj commented 1 year ago

You provide typescript type declaration files(.d.ts) for your modules. They are however very poorly typed - specifying the return type as any generic Object, or the accepted argument as any generic Function. There are also type definitions for your libraries made by the community, and they represent the api more accurately. You can compare these two here:

https://github.com/HMS-Core/hms-react-native-plugin/blob/master/react-native-hms-push/src/index.d.ts#L34 https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/hmscore__react-native-hms-push/index.d.ts#L47

Right now, I will have to configure my tsconfig to ignore your types and use the community typings. I would like this to not be the case however 🥺.

AlexeyNovikov commented 1 year ago

Types are awful 😞