-
Notifications
You must be signed in to change notification settings - Fork 75
Description
xpath.d.ts
has a /// <reference lib="dom" />
directive, which makes the whole DOM API available to any TypeScript project that imports xpath
, even though it does not need the DOM to function.
In my Node project, my types are now getting all mixed up because TypeScript imported the DOM types and made them available in the whole project, creating conflicts for Document
, setTimeout
, clearTimeout
etc. No need to tell you this is a huge hit in code quality and safety.
@xmldom/xmldom
had the exact same issue, which they fixed last autumn: xmldom/xmldom#285
I think their modus operandi was to basically extract the definitions from TypeScript’s lib.dom.d.ts
.
Should this package reuse @xmldom/xmldom
’s interfaces to not depend on the DOM, or have a similar approach?
EDIT: I just checked your package.json
and @xmldom/xmldom
is already listed as a dev dependency, to me it would make sense to use their types (Document
, Node
), etc. rather than lib.dom.d.ts
’s.