OneSignal / onesignal-vue

Vue OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!
Other
13 stars 2 forks source link

`OneSignal.init` function signature is incorrect #6

Closed iAmWillShepherd closed 2 years ago

iAmWillShepherd commented 2 years ago

The init function signature incorrectly states options is optional.

init(options?: any): Promise<void>;

Given the appId is required to initialize the plugin, options cannot be optional. A more correct type signature for this function is:

init(options: any): Promise<void>;

Even with this correction, there is still the problem that I get no completions for the options object because it's typed as any. We should define a type for this object because the current one allows you to pass silly stuff like init(false).

rgomezp commented 2 years ago

Fixed in code, need to update README