fix type
parent
db38db9256
commit
1c802ad5f5
|
@ -176,7 +176,7 @@ export const similar = (a: string, b: string) => {
|
||||||
* @param arr
|
* @param arr
|
||||||
* @param data
|
* @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 key = data.num
|
||||||
let left = 0
|
let left = 0
|
||||||
let right = arr.length - 1
|
let right = arr.length - 1
|
||||||
|
|
|
@ -35,7 +35,7 @@ declare namespace LX {
|
||||||
interface UserListInfo {
|
interface UserListInfo {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
source?: LX.Source
|
source?: LX.OnlineSource
|
||||||
sourceListId?: string
|
sourceListId?: string
|
||||||
position: number
|
position: number
|
||||||
locationUpdateTime: number | null
|
locationUpdateTime: number | null
|
||||||
|
|
|
@ -147,7 +147,7 @@ export const listDataOverwrite = ({ defaultList, loveList, userList, tempList }:
|
||||||
export const userListCreate = ({ name, id, source, sourceListId, position, locationUpdateTime }: {
|
export const userListCreate = ({ name, id, source, sourceListId, position, locationUpdateTime }: {
|
||||||
name: string
|
name: string
|
||||||
id: string
|
id: string
|
||||||
source?: LX.Source
|
source?: LX.OnlineSource
|
||||||
sourceListId?: string
|
sourceListId?: string
|
||||||
position: number
|
position: number
|
||||||
locationUpdateTime: number | null
|
locationUpdateTime: number | null
|
||||||
|
|
|
@ -195,7 +195,7 @@ export const searchListMusic = (list: LX.Music.MusicInfo[], text: string) => {
|
||||||
if (rxp.test(str)) result.push(mInfo)
|
if (rxp.test(str)) result.push(mInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedList: any[] = []
|
const sortedList: Array<{ num: number, data: LX.Music.MusicInfo }> = []
|
||||||
|
|
||||||
for (const mInfo of result) {
|
for (const mInfo of result) {
|
||||||
sortInsert(sortedList, {
|
sortInsert(sortedList, {
|
||||||
|
|
Loading…
Reference in New Issue