AbsaOSS / rn-indy-sdk

This code was starting point of https://github.com/hyperledger/indy-sdk-react-native where the work continues.
Apache License 2.0
11 stars 6 forks source link

Added typescript definitions #26

Open emberist opened 4 years ago

emberist commented 4 years ago

Just to avoid @ts-ignore in typescript project

TimoGlastra commented 4 years ago

Hi @riccardocaranfil! We're working on getting the types published to the DefinitelyTyped repo.

Because indy-sdk and rn-indy-sdk share the same type definitions, we would have to maintain two versions of the definition if we add them to the repo.

See https://github.com/TimoGlastra/DefinitelyTyped/blob/%40types/indy-sdk/types/indy-sdk/index.d.ts for the current working version. It does seem like your definition contains some types not in our version and vice versa, so it'll be good to combine them.

See https://github.com/hyperledger/aries-framework-javascript/issues/38 for more informatin

emberist commented 4 years ago

@TimoGlastra sounds good! Thanks!

TimoGlastra commented 3 years ago

@riccardocaranfil I finally got around to creating a PR in the definitely typed repo. See https://www.npmjs.com/package/@types/indy-sdk for the published package.

You can use it for rn-indy-sdk using package aliases:

# npm
npm install @types/rn-indy-sdk@npm:@types/indy-sdk

# yarn
yarn add @types/rn-indy-sdk@npm:@types/indy-sdk

Or adding it to your package.json like this:

{
    //...
   "devDependencies": {
        "@types/rn-indy-sdk": "npm:@types/indy-sdk"
    }
}

I see your PR contains types that are not in the repo yet. I'd like to also get them included in the @types/indy-sdk package. Would you like to add it yourself? Otherwise I can look into porting it

See https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/indy-sdk