All files / rw-lazy-installer/src/types mod.d.ts

0% Statements 0/0
0% Branches 1/1
0% Functions 1/1
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158                                                                                                                                                                                                                                                                                                                           
/**
 * Core domain types for mod management
 */
 
/**
 * Represents a mod definition from the registry
 */
export interface Mod {
  /** Unique identifier (usually same as name) */
  id: string;
 
  /** Folder name for installation */
  name: string;
 
  /** Display name for the mod */
  label: string;
 
  /** Git repository URL */
  remote: string;
 
  /** Additional notes or warnings */
  remark?: string;
 
  /** Whether the mod is deprecated */
  deprecated?: boolean;
 
  /** Supported RimWorld versions (extracted from About.xml) */
  supportedVersions?: string[];
}
 
/**
 * Represents an installed mod with metadata
 */
export interface ModInstallation {
  /** Reference to the mod definition */
  modId: string;
 
  /** Installation folder name */
  name: string;
 
  /** Full path to installation directory */
  directory: string;
 
  /** Git remote URL */
  remote: string;
 
  /** Current Git commit hash */
  installedVersion?: string;
 
  /** Detected RimWorld versions from About.xml */
  supportedVersions?: string[];
 
  /** Installation timestamp */
  installedAt: Date;
 
  /** Last update timestamp */
  lastUpdated: Date;
 
  /** Last time we checked for updates */
  lastChecked?: Date;
}
 
/**
 * Result of an update operation
 */
export interface UpdateResult {
  /** Mod identifier */
  modId: string;
 
  /** Whether update succeeded */
  success: boolean;
 
  /** Previous Git commit hash */
  previousVersion?: string;
 
  /** New Git commit hash */
  newVersion?: string;
 
  /** Whether any changes were pulled */
  hasChanges: boolean;
 
  /** Error if update failed */
  error?: Error;
 
  /** Time taken in milliseconds */
  duration: number;
}
 
/**
 * Options for update operations
 */
export interface UpdateOptions {
  /** Force update even if no changes */
  force?: boolean;
 
  /** Update in parallel */
  parallel?: boolean;
 
  /** Maximum concurrent updates */
  concurrency?: number;
 
  /** Show detailed output */
  verbose?: boolean;
}
 
/**
 * Filter options for listing/searching mods
 */
export interface ModFilter {
  /** Include deprecated mods */
  includeDeprecated?: boolean;
 
  /** Filter by RimWorld version */
  rimworldVersion?: string;
 
  /** Filter by installation status */
  installed?: boolean;
 
  /** Search term for name/label */
  searchTerm?: string;
}
 
/**
 * Report from installation check
 */
export interface InstallationReport {
  /** Total mods in registry */
  totalMods: number;
 
  /** Currently installed mods */
  installedMods: number;
 
  /** Mods with corrupted Git repos */
  corruptedMods: string[];
 
  /** Mods in config but missing from disk */
  missingMods: string[];
 
  /** Mods on disk but not in registry */
  unknownMods: string[];
 
  /** Suggested actions */
  recommendations: string[];
}
 
/**
 * Result of a validation check
 */
export interface ValidationResult {
  /** Whether validation passed */
  valid: boolean;
 
  /** Validation errors */
  errors: string[];
 
  /** Validation warnings */
  warnings: string[];
}