hms-react-native-plugin icon indicating copy to clipboard operation
hms-react-native-plugin copied to clipboard

Unhelpful Typescript type definitions

Open Akatroj opened this issue 1 year ago • 1 comments

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 🥺.

Akatroj avatar Aug 23 '23 11:08 Akatroj

Types are awful 😞

AlexeyNovikov avatar Sep 20 '23 21:09 AlexeyNovikov