From e8ce14ecd6512c8bbe66628b34f253e8104ece15 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 18 Feb 2024 22:20:01 +0900 Subject: [PATCH] chore: add types on MkAutocomplete --- .../src/components/MkAutocomplete.vue | 55 +++++++++++++++---- packages/frontend/src/scripts/autocomplete.ts | 11 ++-- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/packages/frontend/src/components/MkAutocomplete.vue b/packages/frontend/src/components/MkAutocomplete.vue index 412325bfee7c..07747d3e5c3f 100644 --- a/packages/frontend/src/components/MkAutocomplete.vue +++ b/packages/frontend/src/components/MkAutocomplete.vue @@ -15,12 +15,12 @@ SPDX-License-Identifier: AGPL-3.0-only
  • {{ i18n.ts.selectUser }}
  • -
      +
      1. {{ hashtag }}
      -
        +
        1. @@ -30,12 +30,12 @@ SPDX-License-Identifier: AGPL-3.0-only ({{ emoji.aliasOf }})
        -
          +
          1. {{ tag }}
          -
            +
            1. {{ param }}
            2. @@ -58,6 +58,32 @@ import { miLocalStorage } from '@/local-storage.js'; import { customEmojis } from '@/custom-emojis.js'; import { MFM_TAGS, MFM_PARAMS } from '@/const.js'; +export type CompleteInfo = { + user: { + payload: any; + query: string | null; + }, + hashtag: { + payload: string; + query: string; + }, + emoji: { + payload: string; + query: string; + }, + mfmTag: { + payload: string; + query: string; + }, + mfmParam: { + payload: string; + query: { + tag: string; + params: string[]; + }; + }, +} + type EmojiDef = { emoji: string; name: string; @@ -132,18 +158,23 @@ export default { }; -