refactor: remove redundant imports

This commit is contained in:
aoito 2024-08-25 06:01:10 +09:00
parent 0fe159c761
commit 5122a9706f
34 changed files with 1 additions and 70 deletions

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
const { account, command, context, ...props } = defineProps<{
account: mastodon.v1.Account

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { fetchAccountByHandle } from '~/composables/cache'
type WatcherType = [acc?: mastodon.v1.Account | null, h?: string, v?: boolean]

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~~/composables/masto/relationship'
const { account } = defineProps<{
account: mastodon.v1.Account

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { LocaleObject } from '@nuxtjs/i18n'
import type { AriaAnnounceType, AriaLive } from '~/composables/aria'
const router = useRouter()
const { t, locale, locales } = useI18n()

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { AriaLive } from '~/composables/aria'
// tsc complaining when using $defineProps
withDefaults(defineProps<{
title: string

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { AriaLive } from '~/composables/aria'
// tsc complaining when using $defineProps
withDefaults(defineProps<{
ariaLive?: AriaLive

View file

@ -1,6 +1,4 @@
<script lang="ts" setup>
import type { ResolvedCommand } from '~/composables/command'
const {
cmd,
index,

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
type SearchResultType = SearchResult
const emit = defineEmits<{
(event: 'close'): void

View file

@ -1,19 +1,6 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import type { ConfirmDialogChoice } from '~/types'
import {
isCommandPanelOpen,
isConfirmDialogOpen,
isEditHistoryDialogOpen,
isErrorDialogOpen,
isFavouritedBoostedByDialogOpen,
isKeyboardShortcutsDialogOpen,
isMediaPreviewOpen,
isPreviewHelpOpen,
isPublishDialogOpen,
isReportDialogOpen,
isSigninDialogOpen,
} from '~/composables/dialog'
const isMac = useIsMac()

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { Component } from 'vue'
import type { NavButtonName } from '../../composables/settings'
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleFollowAccount, toggleMuteAccount, useRelationship } from '~~/composables/masto/relationship'
const { account, status } = defineProps<{
account: mastodon.v1.Account

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { SearchResult } from '~/composables/masto/search'
defineProps<{
result: SearchResult
active: boolean

View file

@ -1,5 +1,4 @@
<script setup lang="ts">
import type { NavButtonName } from '~/composables/settings'
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
interface NavButton {

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { ColorMode } from '~/composables/settings'
const colorMode = useColorMode()
function setColorMode(mode: ColorMode) {

View file

@ -1,6 +1,5 @@
<script lang="ts" setup>
import { DEFAULT_FONT_SIZE } from '~/constants'
import type { FontSize } from '~/composables/settings'
const userSettings = useUserSettings()

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import type { ThemeColors } from '~/composables/settings'
const themes = await import('~/constants/themes.json').then(r => r.default) as [string, ThemeColors][]
const settings = useUserSettings()

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleMuteAccount, useRelationship } from '~~/composables/masto/relationship'
const props = defineProps<{
status: mastodon.v1.Status

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import { favouritedBoostedByStatusId } from '~/composables/dialog'
const type = ref<'favourited-by' | 'boosted-by'>('favourited-by')
const { client } = useMasto()

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { fetchAccountById } from '~/composables/cache'
type WatcherType = [status?: mastodon.v1.Status, v?: boolean]

View file

@ -1,9 +1,6 @@
<script setup lang="ts">
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
import type { CustomEmoji, Emoji } from '~/composables/tiptap/suggestion'
import { isCustomEmoji } from '~/composables/tiptap/suggestion'
import { emojiFilename, emojiPrefix, emojiRegEx } from '~~/config/emojis'
import type { CommandHandler } from '~/composables/command'
const { items, command } = defineProps<{
items: (CustomEmoji | Emoji)[]

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import type { CommandHandler } from '~/composables/command'
const { items, command } = defineProps<{
items: mastodon.v1.Tag[]

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import type { CommandHandler } from '~/composables/command'
const { items, command } = defineProps<{
items: mastodon.v1.Account[]

View file

@ -2,7 +2,6 @@ import type { ComputedRef } from 'vue'
import { defineStore } from 'pinia'
import Fuse from 'fuse.js'
import type { LocaleObject } from '@nuxtjs/i18n'
import type { SearchResult } from '~/composables/masto/search'
// @unocss-include

View file

@ -1,10 +1,4 @@
import type { mastodon } from 'masto'
import type {
CreatePushNotification,
PushManagerSubscriptionInfo,
RequiredUserLogin,
} from '~/composables/push-notifications/types'
import { PushSubscriptionError } from '~/composables/push-notifications/types'
export async function createPushSubscription(
user: RequiredUserLogin,

View file

@ -1,11 +1,5 @@
import type { mastodon } from 'masto'
import type {
CreatePushNotification,
PushNotificationPolicy,
PushNotificationRequest,
SubscriptionResult,
} from '~/composables/push-notifications/types'
import { STORAGE_KEY_NOTIFICATION, STORAGE_KEY_NOTIFICATION_POLICY } from '~/constants'
const supportsPushNotifications = typeof window !== 'undefined'

View file

@ -6,7 +6,6 @@ import { PluginKey } from 'prosemirror-state'
import type { Component } from 'vue'
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
import type { mastodon } from 'masto'
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
import TiptapEmojiList from '~/components/tiptap/TiptapEmojiList.vue'

View file

@ -14,8 +14,6 @@ import {
STORAGE_KEY_SERVERS,
STORAGE_KEY_USERS,
} from '~/constants'
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
import { useAsyncIDBKeyval } from '~/composables/idb'
const mock = process.mock

View file

@ -1,6 +1,4 @@
<script lang="ts" setup>
import { usePreferences } from '~/composables/settings'
const route = useRoute()
const info = useBuildInfo()

View file

@ -1,6 +1,4 @@
import type { RouteLocationRaw } from 'vue-router'
import { useMagicSequence } from '~/composables/magickeys'
import { currentUser, getInstanceDomain } from '~/composables/users'
export default defineNuxtPlugin(({ $scrollToTop }) => {
const keys = useMagicKeys()

View file

@ -1,4 +1,3 @@
import type { OldFontSize } from '~/composables/settings'
import { oldFontSizeMap } from '~/constants/options'
import { DEFAULT_FONT_SIZE } from '~/constants'

View file

@ -2,7 +2,6 @@ import { Buffer } from 'node:buffer'
import { join, resolve } from 'pathe'
import fs from 'fs-extra'
import { ofetch } from 'ofetch'
import { elkTeamMembers } from '../composables/about'
const avatarsDir = resolve('./public/avatars/')

View file

@ -1,5 +1,4 @@
import chroma from 'chroma-js'
import type { ThemeColors } from '~/composables/settings'
// #cc7d24 -> hcl(67.14,62.19,59.56)
export const themesColor = Array.from(

View file

@ -3,8 +3,6 @@ import { renderToString } from 'vue/server-renderer'
import { format } from 'prettier'
import type { mastodon } from 'masto'
import { mockComponent } from '@nuxt/test-utils/runtime'
import { contentToVNode } from '~/composables/content-render'
import type { ContentParseOptions } from '~/composables/content-parse'
beforeEach(() => {
publicServer.value = useRuntimeConfig().public.defaultServer

View file

@ -1,7 +1,6 @@
import { describe, expect, it } from 'vitest'
import { format } from 'prettier'
import { render as renderTree } from 'ultrahtml'
import type { ContentParseOptions } from '~/composables/content-parse'
describe('html-parse', () => {
it('empty', async () => {