Skip to content

Commit

Permalink
Add a bunch of new GOG interfaces/types
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandMC committed Oct 11, 2022
1 parent a124647 commit 29422b9
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/common/types/gog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,77 @@ export interface GOGCloudSavesLocation {
name: string
location: string
}

// Data inside the `goggame-appName.info` file in the game installation directory
export interface GOGGameDotInfoFile {
version: number
gameId: string
rootGameId: string
buildId?: string
clientId?: string
standalone: boolean
dependencyGameId: string
language: string
languages?: string[]
name: string
playTasks: (FileTask | URLTask)[]
supportTasks?: (FileTask | URLTask)[]
osBitness?: ['64']
}

interface TaskBase {
name: string
isPrimary?: true
isHidden?: true
languages?: string[]
category?: TaskCategory
}

interface FileTask extends TaskBase {
type: 'FileTask'
path: string
workingDir: string
arguments: string
}
interface URLTask extends TaskBase {
type: 'URLTask'
link: string
}

type TaskCategory = 'game' | 'tool' | 'document' | 'launcher'

export interface GOGGameDotIdFile {
buildId: string
}

// Data returned from https://remote-config.gog.com/components/galaxy_client/clients/clientId?component_version=2.0.45
export interface GOGClientsResponse {
version: string
content: {
MacOS: FeatureSupport
Windows: FeatureSupport
cloudStorage: {
quota: number
}
bases: unknown[]
}
}

interface FeatureSupport {
overlay: {
supported: boolean
}
cloudStorage: {
enabled: boolean
locations: GOGCloudSavesLocation[]
}
}

export type SaveFolderVariable =
| 'INSTALL'
| 'SAVED_GAMES'
| 'APPLICATION_DATA_LOCAL'
| 'APPLICATION_DATA_LOCAL_LOW'
| 'APPLICATION_DATA_ROAMING'
| 'DOCUMENTS'
| 'APPLICATION_SUPPORT'

0 comments on commit 29422b9

Please sign in to comment.