Description
tsconfig.json's compilerOptions.lib is ["ES2022"] only — no "DOM". Yet src/stellar/signing.ts (if (typeof window === 'undefined' || !(window as any).freighter)), src/wallet/albedo.ts (if (typeof window === 'undefined') { return null; } return (window as any).albedo), and src/wallet/freighter.ts (three separate window references) all reference the global window identifier directly. Without the DOM lib, TypeScript has no declaration for window at all, so tsc --noEmit fails with TS2304: Cannot find name 'window' at every one of these call sites — even though the code is deliberately written to be safe in a non-browser environment via the typeof guard, the guard itself doesn't compile.
Component
SDK
Difficulty
🔴 Hard
Tasks
Acceptance Criteria
Estimated Time
2-3 days
Description
tsconfig.json'scompilerOptions.libis["ES2022"]only — no"DOM". Yetsrc/stellar/signing.ts(if (typeof window === 'undefined' || !(window as any).freighter)),src/wallet/albedo.ts(if (typeof window === 'undefined') { return null; } return (window as any).albedo), andsrc/wallet/freighter.ts(three separatewindowreferences) all reference the globalwindowidentifier directly. Without theDOMlib, TypeScript has no declaration forwindowat all, sotsc --noEmitfails withTS2304: Cannot find name 'window'at every one of these call sites — even though the code is deliberately written to be safe in a non-browser environment via thetypeofguard, the guard itself doesn't compile.Component
SDK
Difficulty
🔴 Hard
Tasks
"DOM"to the sharedtsconfig.json'slib(simplest, but makes all ofsrc/see DOM globals even where inappropriate), or isolate browser-only files (signing.ts,wallet/*.ts) under a separatetsconfigwith its ownlibarraytsc --noEmitto confirm thewindow-related errors are gonetsup.config.ts'splatform: 'neutral'build still produces correct output for both Node and browser consumers after the changeAcceptance Criteria
tsc --noEmitreports no undeclared-windowerrorsEstimated Time
2-3 days