Move some files around to where they should be
This commit is contained in:
13
src/types/DownloadProgress.ts
Normal file
13
src/types/DownloadProgress.ts
Normal 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
8
src/types/Game.ts
Normal 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
15
src/types/GameVersion.ts
Normal 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
|
||||
}
|
||||
10
src/types/LeaderboardEntry.ts
Normal file
10
src/types/LeaderboardEntry.ts
Normal 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
|
||||
}
|
||||
6
src/types/LeaderboardResponse.ts
Normal file
6
src/types/LeaderboardResponse.ts
Normal 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
21
src/types/NormalConfig.ts
Normal 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
|
||||
}
|
||||
}
|
||||
7
src/types/ServerVersionsResponse.ts
Normal file
7
src/types/ServerVersionsResponse.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Game } from './Game'
|
||||
import { GameVersion } from './GameVersion'
|
||||
|
||||
export interface ServerVersionsResponse {
|
||||
versions: GameVersion[]
|
||||
games: Game[]
|
||||
}
|
||||
7
src/types/SettingProps.ts
Normal file
7
src/types/SettingProps.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type SettingProps = {
|
||||
label: string
|
||||
value: boolean
|
||||
onChange: (val: boolean) => void
|
||||
className?: string
|
||||
title?: string
|
||||
}
|
||||
9
src/types/SettingsType.ts
Normal file
9
src/types/SettingsType.ts
Normal 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
|
||||
) {}
|
||||
}
|
||||
17
src/types/VersionsConfig.ts
Normal file
17
src/types/VersionsConfig.ts
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user