You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using xmlbuilder2 in Node writing my code in TypeScript. I am unsure what is the recommended / idiomatic way to import the type XMLBuilder which is defined in node_modules/xmlbuilder2/lib/interfaces.d.ts
To Reproduce
Currently I am doing this:
import {XMLBuilder} from 'xmlbuilder2/lib/interfaces';
This is working but it feels odd.
Expected behavior
I was expecting something more streamlined like:
import {XMLBuilder} from 'xmlbuilder2';
Version:
node.js: [4.19.2]
xmlbuilder2 [3.0.2]
Additional context
None
The text was updated successfully, but these errors were encountered:
xmlbuilder2/lib/interfaces appears to be not public API, as it is not reachable from entry point.
Furthermore, it is a type, so you should use import type {XMLBuilder} from 'xmlbuilder2/lib/interfaces';
You might use import XMLBuilder from 'xmlbuilder2' to get the public API accessible, which is properly typed.
Describe the bug
I am using
xmlbuilder2
in Node writing my code in TypeScript. I am unsure what is the recommended / idiomatic way to import the typeXMLBuilder
which is defined innode_modules/xmlbuilder2/lib/interfaces.d.ts
To Reproduce
Currently I am doing this:
This is working but it feels odd.
Expected behavior
I was expecting something more streamlined like:
Version:
Additional context
None
The text was updated successfully, but these errors were encountered: