OneSignal / onesignal-vue3

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

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

Open andersmar opened 3 months ago

andersmar commented 3 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 1 month 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)."