summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2022-12-19 10:40:57 +0900
committerGitHub <noreply@github.com>2022-12-19 10:40:57 +0900
commit411b08841829fa07e8d87c01947ca6ebdbc70b4a (patch)
tree4810bcc4014889979d3ca7cf9bd7f46079382b61 /packages
parent12.120.0-alpha.17 (diff)
downloadmisskey-411b08841829fa07e8d87c01947ca6ebdbc70b4a.tar.gz
misskey-411b08841829fa07e8d87c01947ca6ebdbc70b4a.tar.bz2
misskey-411b08841829fa07e8d87c01947ca6ebdbc70b4a.zip
refactor: fix broken Vue component custom properties (#9351)
Diffstat (limited to 'packages')
-rw-r--r--packages/client/@types/vue.d.ts17
-rw-r--r--packages/client/src/i18n.ts8
-rw-r--r--packages/client/src/instance.ts7
-rw-r--r--packages/client/src/store.ts7
4 files changed, 13 insertions, 26 deletions
diff --git a/packages/client/@types/vue.d.ts b/packages/client/@types/vue.d.ts
index f6b66228f6..9c9c34ccc5 100644
--- a/packages/client/@types/vue.d.ts
+++ b/packages/client/@types/vue.d.ts
@@ -1,7 +1,16 @@
/// <reference types="vue/macros-global" />
-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 fbc10a0bad..31e066960d 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 d24eb2419a..4f591f4fc1 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 061e1913d6..d1b6e08bc8 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;
- }
-}