fix: Missing ManaType type export from elements.ts breaks discipline type safety #22

Closed
opened 2026-05-18 15:54:40 +02:00 by Anexim · 2 comments
Owner

Severity: Critical

File: src/lib/game/types/elements.ts

Problem: disciplines.ts imports ManaType from ./elements, but elements.ts does not export any ManaType type. This means DisciplineDefinition.manaType has no type safety — it's implicitly any. Every discipline data file references manaType: ManaType which will be untyped.

Impact: All discipline mana types are untyped. Any typo or invalid mana type string will go undetected at compile time.

Fix: Add the ManaType type to elements.ts:

export type ManaType = 'raw' | 'fire' | 'water' | 'air' | 'earth' | 'light' | 'dark' | 'death' | 'transference' | 'metal' | 'sand' | 'lightning' | 'crystal' | 'stellar' | 'void';

Then re-export it from types/index.ts.

**Severity:** Critical **File:** `src/lib/game/types/elements.ts` **Problem:** `disciplines.ts` imports `ManaType` from `./elements`, but `elements.ts` does not export any `ManaType` type. This means `DisciplineDefinition.manaType` has no type safety — it's implicitly `any`. Every discipline data file references `manaType: ManaType` which will be untyped. **Impact:** All discipline mana types are untyped. Any typo or invalid mana type string will go undetected at compile time. **Fix:** Add the `ManaType` type to `elements.ts`: ```ts export type ManaType = 'raw' | 'fire' | 'water' | 'air' | 'earth' | 'light' | 'dark' | 'death' | 'transference' | 'metal' | 'sand' | 'lightning' | 'crystal' | 'stellar' | 'void'; ``` Then re-export it from `types/index.ts`.
Anexim added the ai:todo label 2026-05-18 15:54:40 +02:00
n8n-gitea was assigned by Anexim 2026-05-18 15:54:40 +02:00
Author
Owner

Starting work on Missing ManaType type export from elements.ts

Starting work on Missing ManaType type export from elements.ts
Author
Owner

Fixed: Added ManaType type export to elements.ts and re-exported from types/index.ts

Fixed: Added ManaType type export to elements.ts and re-exported from types/index.ts
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#22