From 327532fc4d1d20e546006cea96a5046cfc8a0e86 Mon Sep 17 00:00:00 2001 From: sumomo015 <138793740+sumomo015@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:42:55 +0900 Subject: [PATCH] fix: global vue type augmentation Augment vue types instead of 'vue/types/vue' and '@vue/runtime-core' to fix incompatibility with other libraries caused by the current augmentation behavior --- components/lib/config/PrimeVue.d.ts | 11 +---------- .../lib/confirmationservice/ConfirmationService.d.ts | 8 +------- components/lib/dialogservice/DialogService.d.ts | 8 +------- components/lib/toastservice/ToastService.d.ts | 8 +------- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/components/lib/config/PrimeVue.d.ts b/components/lib/config/PrimeVue.d.ts index 0591bf978..15d188d9e 100644 --- a/components/lib/config/PrimeVue.d.ts +++ b/components/lib/config/PrimeVue.d.ts @@ -358,16 +358,7 @@ export declare function usePrimeVue(): { declare const plugin: Plugin; export default plugin; -declare module 'vue/types/vue' { - interface Vue { - $primevue: { - config: PrimeVueConfiguration; - changeTheme: PrimeVueChangeTheme; - }; - } -} - -declare module '@vue/runtime-core' { +declare module 'vue' { interface ComponentCustomProperties { $primevue: { config: PrimeVueConfiguration; diff --git a/components/lib/confirmationservice/ConfirmationService.d.ts b/components/lib/confirmationservice/ConfirmationService.d.ts index 61f659adb..3bf6540f8 100644 --- a/components/lib/confirmationservice/ConfirmationService.d.ts +++ b/components/lib/confirmationservice/ConfirmationService.d.ts @@ -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; } diff --git a/components/lib/dialogservice/DialogService.d.ts b/components/lib/dialogservice/DialogService.d.ts index 43e2336a5..9c799ed91 100644 --- a/components/lib/dialogservice/DialogService.d.ts +++ b/components/lib/dialogservice/DialogService.d.ts @@ -25,13 +25,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; } diff --git a/components/lib/toastservice/ToastService.d.ts b/components/lib/toastservice/ToastService.d.ts index c1a1f3b41..847b08712 100755 --- a/components/lib/toastservice/ToastService.d.ts +++ b/components/lib/toastservice/ToastService.d.ts @@ -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; }