diff --git a/public/games/age-of-dwarves/guide/src/ambient.d.ts b/public/games/age-of-dwarves/guide/src/ambient.d.ts index 8310bb22..7782f21a 100644 --- a/public/games/age-of-dwarves/guide/src/ambient.d.ts +++ b/public/games/age-of-dwarves/guide/src/ambient.d.ts @@ -75,3 +75,4 @@ declare module '@/public/resources/*' { declare module '@magic-civ/guide-engine/components/climate-sim/polarHexGrid.js' { export * from '@magic-civ/guide-engine/components/climate-sim/polarHexGrid' } + diff --git a/public/games/age-of-dwarves/guide/src/styled-components-augmentation.d.ts b/public/games/age-of-dwarves/guide/src/styled-components-augmentation.d.ts new file mode 100644 index 00000000..a27de6dc --- /dev/null +++ b/public/games/age-of-dwarves/guide/src/styled-components-augmentation.d.ts @@ -0,0 +1,31 @@ +// Augments the `DefaultTheme` provided by `@lilith/ui-theme` with the +// race-independent flora palette injected at build time by +// `src/packages/guide/src/theme/buildTheme.ts`. Biome/ecology views read +// these as `theme.colors.flora.canopy | undergrowth | fungi`. +// +// This file is a module (has an `import`), so the `declare module` block +// performs declaration merging — NOT an ambient module re-declaration. +// Keep it separate from `ambient.d.ts` which is a pure ambient file and +// must stay import-free to register its `declare module '@magic-civ/...'` +// blocks globally. + +import 'styled-components' +import type { ThemeInterface } from '@lilith/ui-theme' + +// `@lilith/ui-theme` sets `DefaultTheme extends ThemeInterface {}`. `colors` +// is declared there as an inline object literal (not a named interface), so +// standard interface merging can't add `flora` into it. We instead redeclare +// `DefaultTheme` here with an intersection that adds `colors.flora` while +// preserving every other field of `ThemeInterface` (primary/text/etc.). +// Runtime injection happens in `src/packages/guide/src/theme/buildTheme.ts`. +declare module 'styled-components' { + interface DefaultTheme extends Omit { + colors: ThemeInterface['colors'] & { + flora: { + canopy: string + undergrowth: string + fungi: string + } + } + } +} diff --git a/public/games/age-of-elves/guide/src/styled-components-augmentation.d.ts b/public/games/age-of-elves/guide/src/styled-components-augmentation.d.ts new file mode 100644 index 00000000..ae547e14 --- /dev/null +++ b/public/games/age-of-elves/guide/src/styled-components-augmentation.d.ts @@ -0,0 +1,19 @@ +// Augments the `DefaultTheme` provided by `@lilith/ui-theme` with the +// race-independent flora palette injected at build time by +// `src/packages/guide/src/theme/buildTheme.ts`. Biome/ecology views read +// these as `theme.colors.flora.canopy | undergrowth | fungi`. + +import 'styled-components' +import type { ThemeInterface } from '@lilith/ui-theme' + +declare module 'styled-components' { + interface DefaultTheme extends Omit { + colors: ThemeInterface['colors'] & { + flora: { + canopy: string + undergrowth: string + fungi: string + } + } + } +} diff --git a/public/games/age-of-kzzkyt/guide/src/styled-components-augmentation.d.ts b/public/games/age-of-kzzkyt/guide/src/styled-components-augmentation.d.ts new file mode 100644 index 00000000..ae547e14 --- /dev/null +++ b/public/games/age-of-kzzkyt/guide/src/styled-components-augmentation.d.ts @@ -0,0 +1,19 @@ +// Augments the `DefaultTheme` provided by `@lilith/ui-theme` with the +// race-independent flora palette injected at build time by +// `src/packages/guide/src/theme/buildTheme.ts`. Biome/ecology views read +// these as `theme.colors.flora.canopy | undergrowth | fungi`. + +import 'styled-components' +import type { ThemeInterface } from '@lilith/ui-theme' + +declare module 'styled-components' { + interface DefaultTheme extends Omit { + colors: ThemeInterface['colors'] & { + flora: { + canopy: string + undergrowth: string + fungi: string + } + } + } +}