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
+98
View File
@@ -0,0 +1,98 @@
import { AppEventTypes, KeyEventTypes } from '@renderer/event'
import { MainTypes, DownloadTypes } from '@renderer/worker/utils'
import { I18n } from '@renderer/plugins/i18n'
// interface LX.EnvParams {
// deeplink?: string | null
// cmdParams: LX.CmdParams
// workAreaSize?: Electron.Size
// }
interface Lx {
// appSetting: LX.AppSetting
isEditingHotKey: boolean
isPlayedStop: boolean
appHotKeyConfig: LX.HotKeyConfigAll
restorePlayInfo: LX.Player.SavedPlayInfo | null
worker: {
main: MainTypes
download: DownloadTypes
}
isDev: boolean
songListInfo: {
fromName: string
searchKey: string | null
searchPosition?: number
songlistKey: string | null
songlistPosition?: number
}
}
declare global {
interface Window {
ELECTRON_DISABLE_SECURITY_WARNINGS?: string
dt: boolean
shouldUseDarkColors: boolean
lx: Lx
app_event: AppEventTypes
key_event: KeyEventTypes
i18n: I18n
lxData: any
setTheme: (colors: Record<string, string>) => void
}
module NodeJS {
interface ProcessVersions {
app: string
}
}
// const ENVIRONMENT: NodeJS.ProcessEnv
namespace LX {
interface KeyDownEevent {
/**
* 原始事件
*/
event: KeyEvent | null
/**
* 按下的按键数组
*/
keys: string[]
/**
* 按下的按键组合
*
* 类似:`shift`、`mod+a`
*
* 其中 `Ctrl` 的名称为 `mod`, 对应 MacOS 上的 `Command` 键
*/
key: string
/**
* 当前触发此事件的单个按键(不包括之前已按下的键)
*/
eventKey: string
/**
* 按键操作类型
*/
type: 'down' | 'up'
}
type LyricFormat = 'gbk' | 'utf8'
class KeyEvent extends KeyboardEvent {
/**
* 此事件是否标记为 已被处理,如果设置为`true`,则停止触发key event事件
*/
lx_handled?: boolean
}
}
}
// declare const ELECTRON_DISABLE_SECURITY_WARNINGS: string
// declare const userApiPath: string
+15
View File
@@ -0,0 +1,15 @@
import '@common/types/app_setting'
import '@common/types/common'
import '@common/types/user_api'
import '@common/types/sync'
import '@common/types/music'
import '@common/types/list'
import '@common/types/download_list'
import '@common/types/player'
import '@common/types/shims_vue'
import '@common/types/utils'
import '@common/types/theme'
import '@common/types/desktop_lyric'
import '@common/types/ipc_renderer'
import '@common/types/config_files'
import '@common/types/music_metadata'
+7
View File
@@ -0,0 +1,7 @@
import { I18n } from '@/lang'
declare module 'vue' {
interface ComponentCustomProperties {
$t: I18n['t']
}
}
+1
View File
@@ -0,0 +1 @@
export default LX
+57
View File
@@ -0,0 +1,57 @@
declare namespace LX {
namespace Player {
interface PlayMusicInfo {
/**
* 当前播放歌曲的列表 id
*/
musicInfo: LX.Download.ListItem | LX.Music.MusicInfo
/**
* 当前播放歌曲的列表 id
*/
listId: string
/**
* 是否属于 “稍后播放”
*/
isTempPlay: boolean
}
interface PlayInfo {
/**
* 当前正在播放歌曲 index
*/
playIndex: number
/**
* 播放器的播放列表 id
*/
playerListId: string | null
/**
* 播放器播放歌曲 index
*/
playerPlayIndex: number
}
interface TempPlayListItem {
/**
* 播放列表id
*/
listId: '__temp__'
/**
* 歌曲信息
*/
musicInfo: LX.Music.MusicInfo | LX.Download.ListItem
/**
* 是否添加到列表顶部
*/
isTop?: boolean
}
interface SavedPlayInfo {
time: number
maxTime: number
listId: string
index: number
}
}
}
+10
View File
@@ -0,0 +1,10 @@
import { workerMainTypes } from '@renderer/worker/main/index'
import { workerDownloadTypes } from '@renderer/worker/download/index'
declare global {
namespace LX {
type WorkerMainTypes = workerMainTypes
type WorkerDownloadTypes = workerDownloadTypes
}
}