OneSignal / onesignal-vue3

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

[Bug]: Onesignal global type breaks other global types #42

Open andersmar opened 2 months ago

andersmar commented 2 months ago

What happened?

Our own global types stopped working after installing the onesignal-vue3 package.

This is because it still uses the @vue/runtime-core in module declaration, whereas 'vue' should be used instead (vue docs).

index.d.ts

declare module '@vue/runtime-core' {
    interface ComponentCustomProperties {
        $OneSignal: IOneSignalOneSignal;
    }
}

index.ts

declare module '@vue/runtime-core' {
  export interface ComponentCustomProperties {
    $OneSignal: IOneSignalOneSignal;
  }
}

What browsers are you seeing the problem on?

Other

What operating system are you running?

w11 pro 22H2

Steps to reproduce?

1. install package
2. define custom global type elsewhere
3. write the custom properties in a vue template

What did you expect to happen?

I expected both types to work.

The change described fixes the problem.

Relevant log output

No response

cepicdalim commented 3 weeks ago

Facing with same issue and the proposal for fixing issue is legit.

"This is because it still uses the @vue/runtime-core in module declaration, whereas 'vue' should be used instead (vue docs)."