types.ts 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. export type WallpaperType = 'scene' | 'video' | 'web' | 'application'
  2. /** Matches linux-wallpaperengine's --scaling choices */
  3. export type ScalingMode = 'default' | 'stretch' | 'fit' | 'fill' | 'center'
  4. export type WallpaperBackend =
  5. | 'swww'
  6. | 'swaybg'
  7. | 'feh'
  8. | 'xwallpaper'
  9. | 'gsettings'
  10. | 'qdbus'
  11. | 'windows'
  12. | 'macos'
  13. | 'auto'
  14. export type WorkshopQueryType =
  15. | 'RankedByVote'
  16. | 'RankedByPublicationDate'
  17. | 'RankedByTrend'
  18. | 'RankedByTotalUniqueSubscriptions'
  19. | 'RankedByTextSearch'
  20. | 'RankedByLastUpdatedDate'
  21. export type ContentRating = 'everyone' | 'questionable' | 'mature' | 'uncategorized'
  22. export interface WallpaperMeta {
  23. id: string
  24. title: string
  25. description?: string
  26. type: WallpaperType
  27. contentRating?: ContentRating
  28. previewUrl?: string
  29. previewLocal?: string
  30. localPath?: string
  31. file?: string
  32. fileSize?: number
  33. createdAt: number
  34. updatedAt: number
  35. subscribed: boolean
  36. appliedCount: number
  37. lastAppliedAt?: number
  38. authorSteamId?: string
  39. authorName?: string
  40. source: 'workshop' | 'local' | 'backup'
  41. tags: string[]
  42. categories: string[]
  43. downloading?: boolean
  44. downloadFailed?: boolean
  45. fpsOverride?: number
  46. volumeOverride?: number
  47. /** Forces the "xray" scene effect's reveal spot to cover the whole masked area instead of following the mouse */
  48. xrayFullReveal?: boolean
  49. /** How the wallpaper is scaled to fit the screen, applied via linux-wallpaperengine --scaling */
  50. scalingMode?: ScalingMode
  51. /** Manual zoom layered on top of scalingMode via linux-wallpaperengine --zoom (1 = no extra zoom) */
  52. zoom?: number
  53. /** Force-disables the scene's mouse parallax effect via linux-wallpaperengine --disable-parallax */
  54. disableParallax?: boolean
  55. /**
  56. * Color shown outside the wallpaper's bounds (Center/Fit letterboxing, zoomed-out scaling) as a
  57. * "RRGGBB"/"RRGGBBAA" hex string, applied via linux-wallpaperengine --corner-color. Default: black.
  58. */
  59. cornerColor?: string
  60. /**
  61. * Global playback speed multiplier for animations/particles/effects, applied via
  62. * linux-wallpaperengine --speed (1 = normal speed, less than 1 = slower)
  63. */
  64. playbackSpeed?: number
  65. backedUp?: boolean
  66. /** Set by a "check unavailable" scan: true if the item has been removed from the Steam Workshop */
  67. unavailable?: boolean
  68. /** Object/layer ids or names to force-hide via linux-wallpaperengine --disable-object */
  69. disabledObjects?: string[]
  70. /** Object/layer ids or names to force-show via linux-wallpaperengine --enable-object */
  71. enabledObjects?: string[]
  72. /** Property name -> override value, applied via linux-wallpaperengine --set-property name=value */
  73. propertyOverrides?: Record<string, string>
  74. }
  75. export interface LweSceneObject {
  76. id: string
  77. name: string
  78. type: 'image' | 'particle' | 'text' | 'sound' | 'unknown'
  79. }
  80. export interface LweProperty {
  81. name: string
  82. type: 'slider' | 'boolean' | 'color' | 'combo' | 'text' | 'scene-texture' | 'file' | 'textinput' | 'unknown'
  83. text?: string
  84. value: string
  85. min?: number
  86. max?: number
  87. step?: number
  88. options?: { value: string; label: string }[]
  89. }
  90. export interface WorkshopAuthorInfo {
  91. steamId: string
  92. name: string
  93. avatarUrl: string
  94. }
  95. export interface WorkshopItem {
  96. publishedFileId: string
  97. title: string
  98. description: string
  99. previewUrl: string
  100. creatorSteamId: string
  101. tags: string[]
  102. timeCreated: number
  103. timeUpdated: number
  104. subscriptions: number
  105. upvotes: number
  106. downvotes: number
  107. isSubscribed: boolean
  108. }
  109. export interface WorkshopQueryParams {
  110. appId?: number
  111. searchText?: string
  112. tags?: string[]
  113. excludedTags?: string[]
  114. queryType?: WorkshopQueryType
  115. page?: number
  116. }
  117. export interface WorkshopQueryResult {
  118. items: WorkshopItem[]
  119. page: number
  120. totalResults: number
  121. }
  122. export interface CreatorWorkshopQueryParams {
  123. searchText?: string
  124. tags?: string[]
  125. excludedTags?: string[]
  126. queryType?: WorkshopQueryType
  127. page?: number
  128. }
  129. export interface ApplyWallpaperOptions {
  130. wallpaperId: string
  131. displayIndex?: number
  132. backend?: WallpaperBackend
  133. }
  134. export interface DownloadProgressEvent {
  135. itemId: string
  136. bytesDownloaded: number
  137. bytesTotal: number
  138. percentage: number
  139. status: 'downloading' | 'completed' | 'error'
  140. }
  141. export interface LibraryFilters {
  142. tags?: string[]
  143. categories?: string[]
  144. type?: WallpaperType
  145. contentRating?: ContentRating
  146. searchText?: string
  147. sortBy?: 'title' | 'createdAt' | 'updatedAt' | 'lastApplied' | 'appliedCount' | 'fileSize'
  148. sortDir?: 'asc' | 'desc'
  149. }
  150. export interface WallpaperFolder {
  151. id: string
  152. title: string
  153. items: string[] // workshop IDs
  154. }
  155. export interface WallpaperEnvironment {
  156. displayServer: 'wayland' | 'x11' | 'unknown'
  157. desktopEnv: 'gnome' | 'kde' | 'hyprland' | 'sway' | 'other'
  158. availableBackends: WallpaperBackend[]
  159. recommendedBackend: WallpaperBackend
  160. linuxWallpaperEngine: LweStatus
  161. }
  162. export interface LweStatus {
  163. installed: boolean
  164. path?: string
  165. version?: string
  166. }
  167. export type LinuxDistro = 'fedora' | 'arch' | 'debian' | 'unknown'
  168. export interface LweInstallProgress {
  169. stage: 'installing-deps' | 'cloning' | 'building' | 'installing' | 'done' | 'error'
  170. message: string
  171. percentage: number
  172. }
  173. export interface BackupProgressEvent {
  174. itemId: string
  175. bytesCopied: number
  176. bytesTotal: number
  177. percentage: number
  178. status: 'copying' | 'completed' | 'error'
  179. message?: string
  180. }
  181. export interface PlaylistItem {
  182. wallpaperId: string
  183. /** 0-100, overrides the playlist's defaultVolume when set */
  184. volume?: number
  185. /** Overrides the playlist's defaultDurationSec when set */
  186. durationSec?: number
  187. }
  188. export interface PlaylistSettings {
  189. /** Shuffle playback order; reshuffled every time the playlist loops back to the start */
  190. randomize: boolean
  191. /** Base ordering when randomize is off; 'manual' respects PlaylistItem[] order */
  192. sortBy: 'manual' | 'title' | 'createdAt'
  193. /** How long each wallpaper plays before advancing, in seconds */
  194. defaultDurationSec: number
  195. /** 0-100, used for items without a per-item volume override */
  196. defaultVolume: number
  197. }
  198. export interface Playlist {
  199. id: string
  200. title: string
  201. items: PlaylistItem[]
  202. settings: PlaylistSettings
  203. createdAt: number
  204. updatedAt: number
  205. }
  206. export interface PlaylistPlaybackState {
  207. playlistId: string | null
  208. currentItemId: string | null
  209. currentIndex: number
  210. isPlaying: boolean
  211. order: string[]
  212. }