@@ -14,6 +14,7 @@ use serde::{Deserialize, Serialize};
1414use std:: fs;
1515use std:: path:: { Path , PathBuf } ;
1616use tauri:: AppHandle ;
17+ use ts_rs:: TS ;
1718use uuid:: Uuid ;
1819
1920/// Managed struct that encapsulates mod library operations.
@@ -94,7 +95,8 @@ impl ModLibrary {
9495}
9596
9697/// Slugified profile name used as the filesystem directory name.
97- #[ derive( Debug , Clone , Default , PartialEq , Eq , Serialize , Deserialize ) ]
98+ #[ derive( Debug , Clone , Default , PartialEq , Eq , Serialize , Deserialize , TS ) ]
99+ #[ ts( export) ]
98100#[ serde( transparent) ]
99101pub struct ProfileSlug ( pub String ) ;
100102
@@ -135,7 +137,8 @@ impl From<String> for ProfileSlug {
135137}
136138
137139/// A mod profile for organizing different mod configurations.
138- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
140+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
141+ #[ ts( export) ]
139142#[ serde( rename_all = "camelCase" ) ]
140143pub struct Profile {
141144 /// Unique identifier (UUID)
@@ -156,7 +159,8 @@ pub struct Profile {
156159}
157160
158161/// A mod layer shown in the UI.
159- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
162+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
163+ #[ ts( export) ]
160164#[ serde( rename_all = "camelCase" ) ]
161165pub struct ModLayer {
162166 pub name : String ,
@@ -165,7 +169,8 @@ pub struct ModLayer {
165169}
166170
167171/// A mod entry shown in the UI Library.
168- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
172+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
173+ #[ ts( export) ]
169174#[ serde( rename_all = "camelCase" ) ]
170175pub struct InstalledMod {
171176 pub id : String ,
@@ -185,15 +190,17 @@ pub struct InstalledMod {
185190}
186191
187192/// Result of a bulk mod install operation.
188- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
193+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
194+ #[ ts( export) ]
189195#[ serde( rename_all = "camelCase" ) ]
190196pub struct BulkInstallResult {
191197 pub installed : Vec < InstalledMod > ,
192198 pub failed : Vec < BulkInstallError > ,
193199}
194200
195201/// Error info for a single file that failed during bulk install.
196- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
202+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
203+ #[ ts( export) ]
197204#[ serde( rename_all = "camelCase" ) ]
198205pub struct BulkInstallError {
199206 pub file_path : String ,
@@ -202,7 +209,8 @@ pub struct BulkInstallError {
202209}
203210
204211/// Progress event emitted per-file during bulk mod install.
205- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
212+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
213+ #[ ts( export) ]
206214#[ serde( rename_all = "camelCase" ) ]
207215pub struct InstallProgress {
208216 pub current : usize ,
@@ -211,7 +219,8 @@ pub struct InstallProgress {
211219}
212220
213221/// Progress event emitted during cslol migration (both packaging and installing phases).
214- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
222+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
223+ #[ ts( export) ]
215224#[ serde( rename_all = "camelCase" ) ]
216225pub struct MigrationProgress {
217226 pub phase : MigrationPhase ,
@@ -220,7 +229,8 @@ pub struct MigrationProgress {
220229 pub current_file : String ,
221230}
222231
223- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
232+ #[ derive( Debug , Clone , Serialize , Deserialize , TS ) ]
233+ #[ ts( export) ]
224234#[ serde( rename_all = "camelCase" ) ]
225235pub enum MigrationPhase {
226236 Packaging ,
0 commit comments