Renderer: align NitroConfig Window decl with client + fix glob .default access

Two tsgo nits that propagate to the client when the renderer is linked
in:

- packages/utils/src/NitroConfig.ts declared
  'NitroConfig?: { [index: string]: any }' on Window, but Nitro-V3
  declares 'NitroConfig?: Record<string, unknown>' in its
  react-app-env.d.ts. The two declaration-merging fragments must
  match — switching the renderer side to Record<string, unknown>
  unifies them.
- packages/assets/src/AssetManager.ts: 'import.meta.glob(...)' is
  augmented as Record<string, string> in the client's typedef, so
  'mod.default ?? mod' (defensive handling of either string or
  { default: string }) failed because mod is typed string. Cast
  inline: '((mod as { default?: string }).default ?? mod)'.

Renderer tsgo error count: 3 -> 0.
This commit is contained in:
simoleo89
2026-05-11 21:34:47 +02:00
parent 22d4e5bfb0
commit f7a5897232
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -2,8 +2,8 @@ export { };
declare global
{
interface Window
{
NitroConfig?: { [index: string]: any };
}
interface Window
{
NitroConfig?: Record<string, unknown>;
}
}