build(typedoc): harden gate and propagate CLI exit code
* typedoc.mjs: forward CLI args via execFileSync, propagate typedoc exit
status, and guarantee docs/*.md restoration via try/finally on failure.
* typedoc.json: enable treatWarningsAsErrors and excludeInternal; map
EventEmitter.defaultMaxListeners to nodejs.org docs.
* tsconfig.json: scope types to ["node"] to fix the TS2591 errors that
typedoc surfaces under TypeScript 6.x stricter implicit type
acquisition rules.
Extracted from PR #3211 as an atomic build/typedoc precursor.