Skip to content

Commit

Permalink
fix: global vue type augmentation
Browse files Browse the repository at this point in the history
Augment vue types instead of 'vue/types/vue' and '@vue/runtime-core' to fix incompatibility with other libraries caused by the current augmentation behavior

Fixes: primefaces#6199
  • Loading branch information
sceee committed Aug 9, 2024
1 parent 6e55ee9 commit 4690823
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
10 changes: 1 addition & 9 deletions packages/core/src/config/PrimeVue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,7 @@ export declare function usePrimeVue(): {
declare const plugin: Plugin;
export default plugin;

declare module 'vue/types/vue' {
interface Vue {
$primevue: {
config: PrimeVueConfiguration;
};
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties {
$primevue: {
config: PrimeVueConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ export interface ConfirmationServiceMethods {
close(): void;
}

declare module 'vue/types/vue' {
interface Vue {
$confirm: ConfirmationServiceMethods;
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties {
$confirm: ConfirmationServiceMethods;
}
Expand Down
8 changes: 1 addition & 7 deletions packages/primevue/src/dialogservice/DialogService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ export interface DialogServiceMethods {
open(content: any, options?: DynamicDialogOptions): DynamicDialogInstance;
}

declare module 'vue/types/vue' {
interface Vue {
$dialog: DialogServiceMethods;
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties {
$dialog: DialogServiceMethods;
}
Expand Down
8 changes: 1 addition & 7 deletions packages/primevue/src/toastservice/ToastService.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,7 @@ export interface ToastServiceMethods {
removeAllGroups(): void;
}

declare module 'vue/types/vue' {
interface Vue {
$toast: ToastServiceMethods;
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties {
$toast: ToastServiceMethods;
}
Expand Down

0 comments on commit 4690823

Please sign in to comment.