This commit is contained in:
lyswhut
2022-10-29 11:36:35 +08:00
parent 66b965d9f7
commit e45cee6596
715 changed files with 57096 additions and 31771 deletions
+44
View File
@@ -0,0 +1,44 @@
/* eslint-disable no-var */
// import { Event as WinMainEvent } from '@main/modules/winMain/event'
// import { Event as WinLyricEvent } from '@main/modules/winLyric/event'
import { AppType, ListType } from '@main/event'
import { DBSeriveTypes } from '@main/worker/utils'
declare global {
// declare module NodeJS {
// export interface Global {
// lx: {
// app_event: {
// winMain: WinMainEvent
// winLyric: WinLyricEvent
// }
// }
// }
// }
interface Lx {
appSetting: LX.AppSetting
hotKey: {
enable: boolean
config: LX.HotKeyConfigAll
state: LX.HotKeyState
}
isTrafficLightClose: boolean
isQuitting: boolean
event_app: AppType
event_list: ListType
worker: {
dbService: DBSeriveTypes
}
theme: LX.ThemeSetting
}
var isDev: boolean
var envParams: LX.EnvParams
var staticPath: string
var lxDataPath: string
var lxOldDataPath: string
var lx: Lx
var appWorder: AppWorder
}
+12
View File
@@ -0,0 +1,12 @@
import '@common/types/utils'
import '@common/types/app_setting'
import '@common/types/common'
import '@common/types/user_api'
import '@common/types/sync'
import '@common/types/list'
import '@common/types/download_list'
import '@common/types/music'
import '@common/types/player'
import '@common/types/desktop_lyric'
import '@common/types/theme'
import '@common/types/ipc_main'
+82
View File
@@ -0,0 +1,82 @@
declare namespace LX {
namespace DBService {
interface MusicInfo {
id: string
listId: string
name: string
singer: string
interval: string | null
source: LX.Music.MusicInfo['source']
meta: string
order: number
}
interface MusicInfoOrder {
listId: string
musicInfoId: string
order: number
}
interface MusicInfoQuery {
listId: string
}
interface MusicInfoRemove {
listId: string
id: string
}
interface ListMusicInfoQuery {
listId: string
musicInfoId: string
}
interface UserListInfo {
id: string
name: string
source?: LX.Source
sourceListId?: string
position: number
locationUpdateTime: number | null
}
type Lyricnfo = {
id: string
type: 'lyric'
text: string
source: 'raw' | 'edited'
} | {
id: string
type: keyof Omit<LX.Music.LyricInfo, 'lyric'>
text: string | null
source: 'raw' | 'edited'
}
interface MusicUrlInfo {
id: string
url: string
}
interface DownloadMusicInfo {
id: string
isComplate: 0 | 1
status: LX.Download.DownloadTaskStatus
statusText: string
progress_downloaded: number
progress_total: number
url: string | null
quality: LX.Quality
ext: LX.Download.FileExt
fileName: string
filePath: string
musicInfo: string
position: number
}
interface MusicInfoOtherSource extends Omit<MusicInfoOnline, 'listId'> {
source_id: string
}
}
}
+25
View File
@@ -0,0 +1,25 @@
// interface Lx {
// appSetting: LX.AppSetting
// hotKey: {
// enable: boolean
// config: LX.HotKeyConfigAll
// state: LX.HotKeyState
// }
// isTrafficLightClose: boolean
// isQuitting: boolean
// }
// // declare module NodeJS {
// // interface Global {
// // isDev: boolean
// // envParams: LX.EnvParams
// // staticPath: string
// // lx: Lx
// // }
// // }
declare const webpackStaticPath: string
declare const webpackUserApiPath: string
+41
View File
@@ -0,0 +1,41 @@
import { Socket as _Socket, RemoteSocket as _RemoteSocket } from 'socket.io'
interface DefaultEventsMap {
[event: string]: (...args: any[]) => void
}
declare global {
namespace LX {
namespace Sync {
class Socket extends _Socket {
data: SocketData
}
class RemoteSocket extends _RemoteSocket<DefaultEventsMap, any> {
readonly data: SyncSocketData
}
interface Data {
action: string
data: any
}
interface SocketData {
snapshotFilePath: string
isCreatedSnapshot: boolean
keyInfo: KeyInfo
}
type Action = 'list:sync'
type ListAction = 'getData' | 'finished'
}
}
// interface SyncListActionData_none {
// action: 'finished'
// }
// interface SyncListActionData_getData {
// action: 'getData'
// data: 'all'
// }
// type SyncListActionData = SyncListActionData_none | SyncListActionData_getData
}
+10
View File
@@ -0,0 +1,10 @@
import { workerDBSeriveTypes } from '@main/worker/dbService'
declare global {
// interface WorkerDBSeriveTypes {
// list: typeof list
// }
namespace LX {
type WorkerDBSeriveListTypes = workerDBSeriveTypes
}
}