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've been trying to figure out how to import the node types (Node, Document, etc) and can't figure out any way to do it except via the DefaultTreeAdapter type and an index expression, which is quite non-obvious and tedious:
The individual node types don't show up because they just aren't exported in any public module. Is there a reason that parse5/tree-adapters/default.js isn't exported?
if i remember correctly, it was mostly because there are multiple tree adapters. so it didn't seem to make much sense exporting the default one's types (since everything else in the package is generic)
i'm not sure though tbh. i ran into the same so i just added it to the @parse5/tools package in the end (import {Element} from '@parse5/tools')
I've been trying to figure out how to import the node types (
Node
,Document
, etc) and can't figure out any way to do it except via theDefaultTreeAdapter
type and an index expression, which is quite non-obvious and tedious:The API docs mention the
DefaultTreeAdapterTypes
namespace, but while that's in the source inindex.ts
:That line doesn't appear in my installed
dist/index.d.ts
at least in version 7.1.2.I can't import the type's exported from
parse5/dist/tree-adapters/default.js
because that file isn't in the package exports.The text was updated successfully, but these errors were encountered: