Restructure; use DaisyUI

This commit is contained in:
Geomitron
2023-11-28 19:50:45 -06:00
parent 49c3f38f99
commit 2eef4d0bee
727 changed files with 1283 additions and 298840 deletions

View File

@@ -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'
}
/**

View 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
}

View File

@@ -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
}

View File

@@ -1,10 +1,3 @@
/**
* The image data for a song's album art.
*/
export interface AlbumArtResult {
base64Art: string
}
/**
* Represents a single chart version.
*/

View File

@@ -0,0 +1,7 @@
export interface UpdateProgress {
bytesPerSecond: number
percent: number
transferred: number
total: number
}