Skip to content

TypeScript Types

All shared types live in src/lib/types.ts — the single source of truth.

The universal unit of optimization. Every optimization type (gear, gems, enchants) produces axes.

interface OptimizationAxis {
id: string; // e.g. "slot:trinket1", "enchant:finger1", "gem:head:socket1"
label: string; // human-readable for UI
options: OptimizationOption[];
}

One choice within an axis.

interface OptimizationOption {
id: string;
label: string;
simcLines: string[]; // lines to inject into the profileset
// e.g. ["trinket1=,id=235616,bonus_id=..."]
// or ["finger1=,id=235614,...,enchant_id=7340"]
}

A single gear item parsed from the SimC export.

interface GearItem {
slot: string; // e.g. "head", "trinket1"
id: number;
bonusIds: number[];
gemIds: number[];
enchantId?: number;
name?: string; // from tooltip lookup, optional
isEquipped: boolean; // true = currently equipped, false = in bag
}

The complete parsed character profile.

interface SimcProfile {
characterName: string;
realm: string;
region: string;
race: string;
spec: string;
level: number;
talentString: string;
gear: Record<string, GearItem[]>; // slot → items (first = equipped)
rawLines: string[]; // original lines for reconstruction
}

One result from the simulation output.

interface SimResult {
name: string; // "combo_0000" = baseline, "combo_0001"+ = profilesets
isBaseline: boolean;
dps: number;
stdDev: number;
meanStdDev: number; // standard error of the mean — use for noise detection
axes: Record<string, string>; // axisId → optionId for this combination
}

Internal type used by the ProfileSet builder.

interface CombinationSpec {
name: string; // "combo_0001"
axes: Record<string, string>; // axisId → optionId
overrideLines: string[]; // SimC lines that differ from base
}

User-configurable simulation settings.

interface SimSettings {
fightStyle: string; // "Patchwerk", "DungeonSlice", etc.
maxTime: number; // seconds (default 300)
varyCombatLength: number; // fraction (default 0.2)
numEnemies: number; // total enemies (default 1)
iterations: number; // default 10000
threads: number; // default cpu_count - 1
}
interface SimCJson2Output {
sim: {
players: [{
collected_data: {
dps: {
mean: number;
std_dev: number;
mean_std_dev: number;
};
};
}];
};
profilesets: {
results: Array<{
name: string; // "combo_0001"
mean: number;
stddev: number;
mean_stddev: number;
min: number;
max: number;
median: number;
}>;
};
}
interface GemPreset {
id: number; // SimC gem_id
name: string; // "Masterful Ysemerald"
stat: string; // "Mastery" — for display grouping
color: 'prismatic';
}
interface EnchantPreset {
id: number; // SimC enchant_id
name: string; // "Enchant Ring – Cursed Devotion"
slot: string; // "finger" | "head" | "chest" | etc.
stat: string; // primary stat for display
}