types.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. export type WallpaperType = 'scene' | 'video' | 'web' | 'application'
  2. export type WallpaperBackend =
  3. | 'swww'
  4. | 'swaybg'
  5. | 'feh'
  6. | 'xwallpaper'
  7. | 'gsettings'
  8. | 'qdbus'
  9. | 'windows'
  10. | 'macos'
  11. | 'auto'
  12. export type WorkshopQueryType =
  13. | 'RankedByVote'
  14. | 'RankedByPublicationDate'
  15. | 'RankedByTrend'
  16. | 'RankedByTotalUniqueSubscriptions'
  17. | 'RankedByTextSearch'
  18. | 'RankedByLastUpdatedDate'
  19. export type ContentRating = 'everyone' | 'questionable' | 'mature'
  20. export interface WallpaperMeta {
  21. id: string
  22. title: string
  23. description?: string
  24. type: WallpaperType
  25. contentRating?: ContentRating
  26. previewUrl?: string
  27. previewLocal?: string
  28. localPath?: string
  29. file?: string
  30. fileSize?: number
  31. createdAt: number
  32. updatedAt: number
  33. subscribed: boolean
  34. appliedCount: number
  35. lastAppliedAt?: number
  36. authorSteamId?: string
  37. authorName?: string
  38. source: 'workshop' | 'local'
  39. tags: string[]
  40. categories: string[]
  41. downloading?: boolean
  42. }
  43. export interface WorkshopItem {
  44. publishedFileId: string
  45. title: string
  46. description: string
  47. previewUrl: string
  48. creatorSteamId: string
  49. tags: string[]
  50. timeCreated: number
  51. timeUpdated: number
  52. subscriptions: number
  53. upvotes: number
  54. downvotes: number
  55. isSubscribed: boolean
  56. }
  57. export interface WorkshopQueryParams {
  58. appId?: number
  59. searchText?: string
  60. tags?: string[]
  61. excludedTags?: string[]
  62. queryType?: WorkshopQueryType
  63. page?: number
  64. }
  65. export interface WorkshopQueryResult {
  66. items: WorkshopItem[]
  67. page: number
  68. totalResults: number
  69. }
  70. export interface ApplyWallpaperOptions {
  71. wallpaperId: string
  72. displayIndex?: number
  73. backend?: WallpaperBackend
  74. }
  75. export interface DownloadProgressEvent {
  76. itemId: string
  77. bytesDownloaded: number
  78. bytesTotal: number
  79. percentage: number
  80. status: 'downloading' | 'completed' | 'error'
  81. }
  82. export interface LibraryFilters {
  83. tags?: string[]
  84. categories?: string[]
  85. type?: WallpaperType
  86. contentRating?: ContentRating
  87. searchText?: string
  88. sortBy?: 'title' | 'createdAt' | 'updatedAt' | 'lastApplied' | 'appliedCount' | 'fileSize'
  89. sortDir?: 'asc' | 'desc'
  90. }
  91. export interface WallpaperFolder {
  92. id: string
  93. title: string
  94. items: string[] // workshop IDs
  95. }
  96. export interface WallpaperEnvironment {
  97. displayServer: 'wayland' | 'x11' | 'unknown'
  98. desktopEnv: 'gnome' | 'kde' | 'hyprland' | 'sway' | 'other'
  99. availableBackends: WallpaperBackend[]
  100. recommendedBackend: WallpaperBackend
  101. linuxWallpaperEngine: LweStatus
  102. }
  103. export interface LweStatus {
  104. installed: boolean
  105. path?: string
  106. version?: string
  107. }
  108. export type LinuxDistro = 'fedora' | 'arch' | 'debian' | 'unknown'
  109. export interface LweInstallProgress {
  110. stage: 'installing-deps' | 'cloning' | 'building' | 'installing' | 'done' | 'error'
  111. message: string
  112. percentage: number
  113. }