mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Restructure; use DaisyUI
This commit is contained in:
@@ -6,7 +6,7 @@ import { DriveChart } from './songDetails.interface'
|
||||
export interface Download {
|
||||
action: 'add' | 'retry' | 'cancel'
|
||||
versionID: number
|
||||
data?: NewDownload // Should be defined if action == 'add'
|
||||
data?: NewDownload // Should be defined if action === 'add'
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
105
src-shared/interfaces/ipc.interface.ts
Normal file
105
src-shared/interfaces/ipc.interface.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import { OpenDialogOptions, OpenDialogReturnValue } from 'electron'
|
||||
import { UpdateInfo } from 'electron-updater'
|
||||
|
||||
import { Settings } from '../Settings'
|
||||
import { Download, DownloadProgress } from './download.interface'
|
||||
import { SongResult, SongSearch } from './search.interface'
|
||||
import { VersionResult } from './songDetails.interface'
|
||||
import { UpdateProgress } from './update.interface'
|
||||
|
||||
export interface ContextBridgeApi {
|
||||
invoke: IpcInvokeHandlers
|
||||
emit: IpcToMainEmitHandlers
|
||||
on: IpcFromMainEmitHandlers
|
||||
}
|
||||
|
||||
/**
|
||||
* To add a new IPC listener:
|
||||
* 1.) Add listener to this interface.
|
||||
* 2.) Fix compile errors in `ipcHandler.ts` and `preload.ts`.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The list of possible async IPC events that return values.
|
||||
*/
|
||||
export interface IpcInvokeEvents {
|
||||
getSettings: {
|
||||
input: void
|
||||
output: Settings
|
||||
}
|
||||
songSearch: {
|
||||
input: SongSearch
|
||||
output: SongResult[]
|
||||
}
|
||||
getSongDetails: {
|
||||
input: SongResult['id']
|
||||
output: VersionResult[]
|
||||
}
|
||||
getBatchSongDetails: {
|
||||
input: number[]
|
||||
output: VersionResult[]
|
||||
}
|
||||
getCurrentVersion: {
|
||||
input: void
|
||||
output: string
|
||||
}
|
||||
getUpdateAvailable: {
|
||||
input: void
|
||||
output: boolean | null
|
||||
}
|
||||
isMaximized: {
|
||||
input: void
|
||||
output: boolean
|
||||
}
|
||||
showOpenDialog: {
|
||||
input: OpenDialogOptions
|
||||
output: OpenDialogReturnValue
|
||||
}
|
||||
}
|
||||
|
||||
export type IpcInvokeHandlers = {
|
||||
[K in keyof IpcInvokeEvents]:
|
||||
(input: IpcInvokeEvents[K]['input']) => Promise<IpcInvokeEvents[K]['output']>
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of possible async IPC events sent to the main process that don't return values.
|
||||
*/
|
||||
export interface IpcToMainEmitEvents {
|
||||
download: Download
|
||||
setSettings: Settings
|
||||
downloadUpdate: void
|
||||
retryUpdate: void
|
||||
quitAndInstall: void
|
||||
openUrl: string
|
||||
toggleDevTools: void
|
||||
maximize: void
|
||||
minimize: void
|
||||
restore: void
|
||||
quit: void
|
||||
showFolder: string
|
||||
showFile: string
|
||||
}
|
||||
|
||||
export type IpcToMainEmitHandlers = {
|
||||
[K in keyof IpcToMainEmitEvents]: (input: IpcToMainEmitEvents[K]) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* The list of possible async IPC events sent from the main process that don't return values.
|
||||
*/
|
||||
export interface IpcFromMainEmitEvents {
|
||||
errorLog: string
|
||||
updateError: string
|
||||
updateAvailable: UpdateInfo | null
|
||||
updateProgress: UpdateProgress
|
||||
updateDownloaded: void
|
||||
downloadUpdated: DownloadProgress
|
||||
queueUpdated: number[]
|
||||
maximized: void
|
||||
minimized: void
|
||||
}
|
||||
|
||||
export type IpcFromMainEmitHandlers = {
|
||||
[K in keyof IpcFromMainEmitEvents]: (listener: (data: IpcFromMainEmitEvents[K]) => void) => void
|
||||
}
|
||||
@@ -22,12 +22,14 @@ export function getDefaultSearch(): SongSearch {
|
||||
similarity: 'similar',
|
||||
fields: { name: true, artist: true, album: true, genre: true, year: true, charter: true, tag: true },
|
||||
tags: {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'sections': false, 'star power': false, 'forcing': false, 'taps': false, 'lyrics': false,
|
||||
'video': false, 'stems': false, 'solo sections': false, 'open notes': false
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'video': false, 'stems': false, 'solo sections': false, 'open notes': false,
|
||||
},
|
||||
instruments: {
|
||||
guitar: false, bass: false, rhythm: false, keys: false,
|
||||
drums: false, guitarghl: false, bassghl: false, vocals: false
|
||||
drums: false, guitarghl: false, bassghl: false, vocals: false,
|
||||
},
|
||||
difficulties: { expert: false, hard: false, medium: false, easy: false },
|
||||
minDiff: 0,
|
||||
@@ -49,13 +51,16 @@ export interface SearchFields {
|
||||
|
||||
export interface SearchTags {
|
||||
'sections': boolean // Tag inverted
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'star power': boolean // Tag inverted
|
||||
'forcing': boolean // Tag inverted
|
||||
'taps': boolean
|
||||
'lyrics': boolean
|
||||
'video': boolean
|
||||
'stems': boolean
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'solo sections': boolean
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
'open notes': boolean
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/**
|
||||
* The image data for a song's album art.
|
||||
*/
|
||||
export interface AlbumArtResult {
|
||||
base64Art: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a single chart version.
|
||||
*/
|
||||
|
||||
7
src-shared/interfaces/update.interface.ts
Normal file
7
src-shared/interfaces/update.interface.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
export interface UpdateProgress {
|
||||
bytesPerSecond: number
|
||||
percent: number
|
||||
transferred: number
|
||||
total: number
|
||||
}
|
||||
Reference in New Issue
Block a user