spokestack / react-native-spokestack

Spokestack: give your React Native app a voice interface!
https://spokestack.io
Apache License 2.0
56 stars 13 forks source link

feat: add TypeScript types #72

Closed timmywil closed 4 years ago

timmywil commented 4 years ago

Adds types for all configuration options and spokestack functions

timmywil commented 4 years ago

I'm realizing a lot of the "events" could be removed if more methods returned promises, but that's for another time.

noelweichbrodt commented 4 years ago

I'm realizing a lot of the "events" could be removed if more methods returned promises, but that's for another time.

Yes, just event callback style vs promise style. The native libraries actually have both styles available in their APIs.

timmywil commented 4 years ago

They won't be fully tested until I use all the functions.

timmywil commented 4 years ago

@noelweichbrodt I noticed that onInit is gone. Is that because .initialize() is synchronous?

noelweichbrodt commented 4 years ago

@noelweichbrodt I noticed that onInit is gone. Is that because .initialize() is synchronous?

It never made it into the docs (my oversight), but the event is still sent (https://github.com/spokestack/react-native-spokestack/blob/master/index.js#L157). Good catch.

timmywil commented 4 years ago

onInit added back.

timmywil commented 4 years ago

Please ensure no properties are missing and that required properties are correct.