Files
start-os/web/projects/ui/src/app/services/patch-db/data-model.ts
Matt Hill 71b83245b4 Chore/unexport api ts (#2585)
* don't export api params

* import from SDK instead of BE

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
2024-04-01 14:47:03 -06:00

77 lines
1.4 KiB
TypeScript

import { T } from '@start9labs/start-sdk'
export type DataModel = T.Public & {
ui: UIData
packageData: Record<string, PackageDataEntry>
}
export interface UIData {
name: string | null
ackWelcome: string // eOS emver
marketplace: UIMarketplaceData
gaming: {
snake: {
highScore: number
}
}
ackInstructions: Record<string, boolean>
theme: string
widgets: readonly Widget[]
}
export interface Widget {
id: string
meta: {
name: string
width: number
height: number
mobileWidth: number
mobileHeight: number
}
url?: string
settings?: string
}
export interface UIMarketplaceData {
selectedUrl: string
knownHosts: {
'https://registry.start9.com/': UIStore
'https://community-registry.start9.com/': UIStore
[url: string]: UIStore
}
}
export interface UIStore {
name?: string
}
export type PackageDataEntry<T extends StateInfo = StateInfo> =
T.PackageDataEntry & {
stateInfo: T
}
export type StateInfo = InstalledState | InstallingState | UpdatingState
export type InstalledState = {
state: 'installed' | 'removing'
manifest: T.Manifest
installingInfo?: undefined
}
export type InstallingState = {
state: 'installing' | 'restoring'
installingInfo: InstallingInfo
manifest?: undefined
}
export type UpdatingState = {
state: 'updating'
installingInfo: InstallingInfo
manifest: T.Manifest
}
export type InstallingInfo = {
progress: T.FullProgress
newManifest: T.Manifest
}