Move some files around to where they should be

This commit is contained in:
2026-02-14 12:49:57 -07:00
parent 105913503c
commit 70433b76ab
18 changed files with 21 additions and 21 deletions

View File

@@ -0,0 +1,13 @@
export class DownloadProgress {
constructor (
public version: string,
public progress: number,
public progressBytes: number,
public failed: boolean,
public queued: boolean,
public hash_checking: boolean,
public finishing: boolean,
public speed: number,
public etaSecs: number
) {}
}

8
src/types/Game.ts Normal file
View File

@@ -0,0 +1,8 @@
export interface Game {
id: number
name: string
official: boolean
verified: boolean
developer: string | null
categoryNames: Record<string, string>
}

15
src/types/GameVersion.ts Normal file
View File

@@ -0,0 +1,15 @@
export interface GameVersion {
id: string
displayName: string
releaseDate: number
game: number
downloadUrl: string
executable: string
sha512sum: string
size: number
place: number
changelog: string
wine: number | undefined
category: number
lastRevision: number
}

View File

@@ -0,0 +1,10 @@
export interface LeaderboardEntry {
username: string
userid: bigint
value: bigint
icon: number
overlay: number
birdColor: number[]
overlayColor: number[]
customIcon: string | null
}

View File

@@ -0,0 +1,6 @@
import { LeaderboardEntry } from './LeaderboardEntry'
export interface LeaderboardResponse {
entries: LeaderboardEntry[]
customIcons: Record<string, string>
}

21
src/types/NormalConfig.ts Normal file
View File

@@ -0,0 +1,21 @@
import { SettingsType } from './SettingsType'
type NormalConfigData = {
version: string
settings?: Partial<SettingsType>
}
export class NormalConfig {
constructor (
public version: string,
public settings: SettingsType = new SettingsType()
) {}
static import (data: NormalConfigData) {
const cfg = new NormalConfig(data.version)
if (data.settings) {
cfg.settings = { ...cfg.settings, ...data.settings }
}
return cfg
}
}

View File

@@ -0,0 +1,7 @@
import { Game } from './Game'
import { GameVersion } from './GameVersion'
export interface ServerVersionsResponse {
versions: GameVersion[]
games: Game[]
}

View File

@@ -0,0 +1,7 @@
export type SettingProps = {
label: string
value: boolean
onChange: (val: boolean) => void
className?: string
title?: string
}

View File

@@ -0,0 +1,9 @@
export class SettingsType {
constructor (
public allowNotifications: boolean = true,
public alwaysShowGamesInSidebar: boolean = true,
public useWineOnUnixWhenNeeded: boolean = false,
public wineOnUnixCommand: string = 'wine %path%',
public theme: number = 0
) {}
}

View File

@@ -0,0 +1,17 @@
export type VersionsConfigData = {
version: string
list: Record<string, number>
}
export class VersionsConfig {
constructor (
public version: string,
public list: Record<string, number> = {}
) {}
static import (data: VersionsConfigData) {
const cfg = new VersionsConfig(data.version)
cfg.list = { ...data.list }
return cfg
}
}