import * as fs from 'fs'; import * as path from 'path'; export interface ConfigType { data: { worker_count: number; minSnipeProfit: number; minAvgProfit: number; minCraftProfit: number; maxAvgLbinDiff: number; rawCraftMaxWeightPP: number; minSnipePP: number; minCraftPP: number; ignoreCategories: Record; minSales: number; includeCraftCost: boolean; minPriceForRawcraft: number; }; filters: { EnchantThresholdConditionalBypass: Record>; EnchantThreshold: Record; itemIDExclusions: string[]; }; } export function loadConfig(): ConfigType { const configPath = path.join(__dirname, 'config.json'); try { const fileContents = fs.readFileSync(configPath, 'utf8'); return JSON.parse(fileContents) as ConfigType; } catch (error) { throw new Error(`Failed to load config.json at ${configPath}: ${error}`); } }