Modernize the package and redesign the TOC APIs
- Rewrite the package in TypeScript, ship ESM-only output, and replace the legacy build/test/lint/CI stack with tsdown, Vitest, oxlint/oxfmt, pnpm, and GitHub Actions.
- Rename the DOM heading query option from
selectortoheadings, and allow DOM inputs such asroot,headings, andtargetto accept either CSS selectors or real DOM nodes. - Add
domItems()andmdItems()as first-class APIs that return normalizedTocItem[]data. - Change
domList()andmdList()to render normalizedTocItem[]input instead of the old tree tuple structure. - Simplify DOM rendering customization by supporting
renderon bothdomList()anddomToc(), and remove the old class-based and anchor/id renderer hooks. - Keep
domToc()andmdToc()as public named exports, publish explicitsimpletoc,simpletoc/dom, andsimpletoc/mdentry points, and movetree()behind the item-based APIs.
Full Changelog: v1.0.3...v2.0.0