fix type
This commit is contained in:
parent
db38db9256
commit
1c802ad5f5
@ -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 = <T>(arr: Array<{ num: number, data: T }>, data: { num: number, data: T }) => {
|
||||
let key = data.num
|
||||
let left = 0
|
||||
let right = arr.length - 1
|
||||
|
||||
2
src/main/types/db_service.d.ts
vendored
2
src/main/types/db_service.d.ts
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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, {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user