diff --git a/packages/client/@types/window.d.ts b/packages/client/@types/window.d.ts new file mode 100644 index 0000000000..1ae20c0d20 --- /dev/null +++ b/packages/client/@types/window.d.ts @@ -0,0 +1,6 @@ +declare global { + interface Window { + __misskey_input_ref__?: HTMLInputElement | null; + } +} +export type {}; diff --git a/packages/client/src/components/MkDialog.vue b/packages/client/src/components/MkDialog.vue index c1f8f581a7..a345f7dcea 100644 --- a/packages/client/src/components/MkDialog.vue +++ b/packages/client/src/components/MkDialog.vue @@ -216,25 +216,32 @@ interface Input { | "paragraph"; placeholder?: string | null; autocomplete?: string; - default: string | number | null; + default?: string | number | null; minLength?: number; maxLength?: number; } -interface Select { - items: { - value: string; - text: string; - }[]; - groupedItems: { - label: string; - items: { - value: string; - text: string; - }[]; - }[]; - default: string | null; -} +type Select = { + default?: string | null; +} & ( + | { + items: { + value: string; + text: string; + }[]; + groupedItems?: undefined; + } + | { + items?: undefined; + groupedItems: { + label: string; + items: { + value: string; + text: string; + }[]; + }[]; + } +); const props = withDefaults( defineProps<{ diff --git a/packages/client/src/components/MkMenu.vue b/packages/client/src/components/MkMenu.vue index c778f0f6f1..e92305d8f3 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -254,8 +254,7 @@ const isActive = ref(); watch( () => props.items, () => { - // FIXME: what's this? - const items: (MenuItem | MenuPending)[] = [...props.items].filter( + const items: (MenuItem | MenuPending)[] = props.items.filter( (item) => item !== undefined, ); diff --git a/packages/client/src/components/MkUrlPreview.vue b/packages/client/src/components/MkUrlPreview.vue index e72bdd704e..95e46ee2cc 100644 --- a/packages/client/src/components/MkUrlPreview.vue +++ b/packages/client/src/components/MkUrlPreview.vue @@ -181,10 +181,10 @@ function adjustTweetHeight(message: any) { if (height) tweetHeight.value = height; } -(window as any).addEventListener("message", adjustTweetHeight); +window.addEventListener("message", adjustTweetHeight); onUnmounted(() => { - (window as any).removeEventListener("message", adjustTweetHeight); + window.removeEventListener("message", adjustTweetHeight); }); diff --git a/packages/client/src/components/MkWaitingDialog.vue b/packages/client/src/components/MkWaitingDialog.vue index c35023adcb..18cec42a49 100644 --- a/packages/client/src/components/MkWaitingDialog.vue +++ b/packages/client/src/components/MkWaitingDialog.vue @@ -13,7 +13,7 @@ ]" >