deno
9c8ee570 - feat(sync-types): defer node-owned URLPattern globals to @types/node

Commit
14 days ago
feat(sync-types): defer node-owned URLPattern globals to @types/node Deno ships the URLPattern *interface* but lets @types/node own the *constructor var* (a second unconditional `declare var URLPattern` collides, TS2403). So `new URLPattern()` yields Node's type while `x: URLPattern` annotations use Deno's, and the shapes diverge (@types/node's `URLPatternResult.inputs` is `URLPatternInput[]`, Deno's/the DOM lib's is the `[URLPatternInit] | [URLPatternInit, string]` tuple) -> TS2322, x64 in std. When generating the private @types/deno, strip the URLPattern family so both the constructor and the instance type come from the @types/node we always install. This is a deliberate hack scoped to the generated types; a project pinning an @types/node lacking these globals is on its own. The proper fix is dual-globals reconciliation in Deno's core libs (which also fixes `deno check`, broken on this today), out of scope here. std 132 -> 7 own errors (was 71 before this).
Author
Parents
Loading