From 1c802ad5f545aaebe1561a0d24e95f0f32ee9283 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 11 Jan 2023 16:47:57 +0800 Subject: [PATCH] fix type --- src/common/utils/common.ts | 2 +- src/main/types/db_service.d.ts | 2 +- src/renderer/store/list/listManage/action.ts | 2 +- src/renderer/worker/main/list.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/utils/common.ts b/src/common/utils/common.ts index b554b7f2..21797d3b 100644 --- a/src/common/utils/common.ts +++ b/src/common/utils/common.ts @@ -176,7 +176,7 @@ export const similar = (a: string, b: string) => { * @param arr * @param data */ -export const sortInsert = (arr: Array<{ num: number, data: any }>, data: { num: number, data: any }) => { +export const sortInsert = (arr: Array<{ num: number, data: T }>, data: { num: number, data: T }) => { let key = data.num let left = 0 let right = arr.length - 1 diff --git a/src/main/types/db_service.d.ts b/src/main/types/db_service.d.ts index 6ab1fd2f..927efe31 100644 --- a/src/main/types/db_service.d.ts +++ b/src/main/types/db_service.d.ts @@ -35,7 +35,7 @@ declare namespace LX { interface UserListInfo { id: string name: string - source?: LX.Source + source?: LX.OnlineSource sourceListId?: string position: number locationUpdateTime: number | null diff --git a/src/renderer/store/list/listManage/action.ts b/src/renderer/store/list/listManage/action.ts index 0c50a384..39fcae91 100644 --- a/src/renderer/store/list/listManage/action.ts +++ b/src/renderer/store/list/listManage/action.ts @@ -147,7 +147,7 @@ export const listDataOverwrite = ({ defaultList, loveList, userList, tempList }: export const userListCreate = ({ name, id, source, sourceListId, position, locationUpdateTime }: { name: string id: string - source?: LX.Source + source?: LX.OnlineSource sourceListId?: string position: number locationUpdateTime: number | null diff --git a/src/renderer/worker/main/list.ts b/src/renderer/worker/main/list.ts index ddaef343..955ba101 100644 --- a/src/renderer/worker/main/list.ts +++ b/src/renderer/worker/main/list.ts @@ -195,7 +195,7 @@ export const searchListMusic = (list: LX.Music.MusicInfo[], text: string) => { if (rxp.test(str)) result.push(mInfo) } - const sortedList: any[] = [] + const sortedList: Array<{ num: number, data: LX.Music.MusicInfo }> = [] for (const mInfo of result) { sortInsert(sortedList, {