To improve the typing situation when loading dom types in the same environment as workers-types, this PR moves the URL type out of RequestInfo, in favour of e.g. fetch() referencing fetch(req: RequestInfo | URL) directly. This matches how dom types are defined.
There should be no user-observable behaviour change for users using just workers-types, but this should improve the situation if e.g. the fetch definition comes from workers-types but the RequestInfo definition comes from dom types.
Fixes https://github.com/cloudflare/workerd/issues/3090
To improve the typing situation when loading dom types in the same environment as workers-types, this PR moves the
URL
type out ofRequestInfo
, in favour of e.g.fetch()
referencingfetch(req: RequestInfo | URL)
directly. This matches how dom types are defined.There should be no user-observable behaviour change for users using just workers-types, but this should improve the situation if e.g. the fetch definition comes from workers-types but the
RequestInfo
definition comes from dom types.