OneSignal / onesignal-vue3

Vue 3 OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!
Other
19 stars 5 forks source link

fix: properly type `useOneSignal` #7

Closed innocenzi closed 2 years ago

innocenzi commented 2 years ago

This PR fixes the useOneSignal composable by adding a return type. Currently, there is no way for the compiler to know about it (that's how provide/inject is designed), so we need to specify it.

After this PR, the following changes will occur in index.d.ts:

- export declare const useOneSignal: () => unknown;
+ export declare function useOneSignal: () => IOneSignal;

(I also changed const to function because it's more appropriate, though it doesn't change anything in practice for the end-user)

innocenzi commented 2 years ago

Closing this as it's fixed in https://github.com/OneSignal/onesignal-vue3/pull/8