更新ts类型导入导出语法

This commit is contained in:
lyswhut
2022-11-25 23:01:39 +08:00
parent 5e9b3a16fa
commit 77ea6d3748
19 changed files with 527 additions and 513 deletions
@@ -225,3 +225,4 @@
// getScrollTop,
// }
// }
export {}
+1 -1
View File
@@ -14,7 +14,7 @@ const initPrevPlayInfo = async() => {
window.lx.restorePlayInfo = null
if (!info?.listId || info.index < 0) return
const list = await getListMusics(info.listId)
if (!list?.[info.index]) return
if (!list[info.index]) return
window.lx.restorePlayInfo = info
playList(info.listId, info.index)
+4 -2
View File
@@ -39,7 +39,9 @@ export const registerEvents = () => {
// // unregisterRendererEvents()
// }
export { AppEventTypes } from './appEvent'
export { KeyEventTypes, clearDownKeys } from './keyEvent'
export { clearDownKeys } from './keyEvent'
export type { AppEventTypes } from './appEvent'
export type { KeyEventTypes } from './keyEvent'
registerEvents()
+4 -2
View File
@@ -19,6 +19,8 @@ import router from './router'
import { getSetting, updateSetting } from './utils/ipc'
import { langList } from '@/lang'
import type { I18n } from '@/lang/i18n'
import { initSetting } from './store/setting'
// import { bubbleCursor } from './utils/cursor-effects/bubbleCursor'
@@ -40,8 +42,8 @@ void getSetting().then(setting => {
// window.lx.appSetting = setting
// Set language automatically
if (!setting['common.langId'] || !window.i18n.availableLocales.includes(setting['common.langId'])) {
let langId = null
let locale = window.navigator.language.toLocaleLowerCase()
let langId: I18n['locale'] | null = null
let locale = window.navigator.language.toLocaleLowerCase() as I18n['locale']
if (window.i18n.availableLocales.includes(locale)) {
langId = locale
} else {
+4 -2
View File
@@ -1,9 +1,11 @@
import { createI18n, i18nPlugin, useI18n, I18n } from '@/lang'
import type { I18n } from '@/lang'
import { createI18n, i18nPlugin, useI18n } from '@/lang'
window.i18n = createI18n()
export {
i18nPlugin,
useI18n,
I18n,
}
export type { I18n }
+1 -1
View File
@@ -17,7 +17,7 @@ export const setUserLists = (lists: LX.List.UserListInfo[]) => {
export const setMusicList = (listId: string, musicList: LX.Music.MusicInfo[]) => {
const list = shallowReactive(markRawList(musicList))
allMusicList.set(listId, shallowReactive(musicList))
allMusicList.set(listId, list)
return list
}
+2 -1
View File
@@ -2,7 +2,8 @@ import { markRawList } from '@common/utils/vueTools'
import music from '@renderer/utils/musicSdk'
import { sortInsert, similar } from '@common/utils/common'
import { sources, maxPages, listInfos, ListInfoItem, SearchListInfo } from './state'
import type { ListInfoItem, SearchListInfo } from './state'
import { sources, maxPages, listInfos } from './state'
interface SearchResult {
list: ListInfoItem[]
+1 -1
View File
@@ -5,7 +5,7 @@ import music from '@renderer/utils/musicSdk'
import { ListInfo } from '@renderer/store/songList/state'
export { ListInfoItem } from '@renderer/store/songList/state'
export type { ListInfoItem } from '@renderer/store/songList/state'
export const sources: Array<LX.OnlineSource | 'all'> = markRaw([])
+1 -3
View File
@@ -2,14 +2,12 @@
import { deduplicationList, toNewMusicInfo } from '@renderer/utils'
import musicSdk from '@renderer/utils/musicSdk'
import { markRaw, markRawList } from '@common/utils/vueTools'
import type { ListDetailInfo, ListInfoItem, ListInfo } from './state'
import {
tags,
TagInfo,
listInfo,
listDetailInfo,
ListDetailInfo,
ListInfoItem,
ListInfo,
selectListInfo,
isVisibleListDetail,
openSongListInputInfo,
+1 -1
View File
@@ -53,7 +53,7 @@ export const getFontSizeWithScreen = (screenWidth: number = window.innerWidth):
export const deduplicationList = <T extends LX.Music.MusicInfo>(list: T[]): T[] => {
const ids: Set<string | number> = new Set()
const ids: Set<string> = new Set()
return list.filter(s => {
if (ids.has(s.id)) return false
ids.add(s.id)
@@ -3,7 +3,8 @@ import { ref, nextTick } from '@common/utils/vueTools'
import { addHistoryWord } from '@renderer/store/search/action'
// import { useI18n } from '@renderer/plugins/i18n'
// import { } from '@renderer/store/search/state'
import { search as searchSongList, listInfos, SearchListInfo, ListInfoItem } from '@renderer/store/search/songlist'
import type { SearchListInfo, ListInfoItem } from '@renderer/store/search/songlist'
import { search as searchSongList, listInfos } from '@renderer/store/search/songlist'
export declare type SearchSource = LX.OnlineSource | 'all'
@@ -34,7 +34,7 @@
<script setup lang="ts">
import { ref, defineEmits, defineExpose } from '@common/utils/vueTools'
import { ListInfo, ListInfoItem } from '@renderer/store/songList/state'
import type { ListInfo, ListInfoItem } from '@renderer/store/songList/state'
// import LX from '@renderer/types/lx'
import { useRoute, useRouter } from '@common/utils/vueRouter'