diff --git a/packages/client/@types/vue.d.ts b/packages/client/@types/vue.d.ts index f6b66228f..9c9c34ccc 100644 --- a/packages/client/@types/vue.d.ts +++ b/packages/client/@types/vue.d.ts @@ -1,7 +1,16 @@ /// -declare module '*.vue' { - import type { DefineComponent } from 'vue'; - const component: DefineComponent<{}, {}, any>; - export default component; +import type { $i } from '@/account'; +import type { defaultStore } from '@/store'; +import type { instance } from '@/instance'; +import type { i18n } from '@/i18n'; + +declare module 'vue' { + interface ComponentCustomProperties { + $i: typeof $i; + $store: typeof defaultStore; + $instance: typeof instance; + $t: typeof i18n['t']; + $ts: typeof i18n['ts']; + } } diff --git a/packages/client/src/i18n.ts b/packages/client/src/i18n.ts index fbc10a0ba..31e066960 100644 --- a/packages/client/src/i18n.ts +++ b/packages/client/src/i18n.ts @@ -3,11 +3,3 @@ import { locale } from '@/config'; import { I18n } from '@/scripts/i18n'; export const i18n = markRaw(new I18n(locale)); - -// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $t: typeof i18n['t']; - $ts: typeof i18n['locale']; - } -} diff --git a/packages/client/src/instance.ts b/packages/client/src/instance.ts index d24eb2419..4f591f4fc 100644 --- a/packages/client/src/instance.ts +++ b/packages/client/src/instance.ts @@ -43,10 +43,3 @@ export const emojiTags = computed(() => { } return Array.from(tags); }); - -// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $instance: typeof instance; - } -} diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 061e1913d..d1b6e08bc 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -381,10 +381,3 @@ export class ColdDeviceStorage { }; } } - -// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $store: typeof defaultStore; - } -}