remarkjs / remark-toc

plugin to generate a table of contents (TOC)
https://remark.js.org
MIT License
423 stars 33 forks source link

Error when using `prefix` and `parents` of `mdast-util-toc` options #32

Closed babie closed 3 years ago

babie commented 3 years ago

Problem

I have a typescript error when using prefix and parents of mdast-util-toc options.

My environment

Steps to reproduce

Write below code on types/remark-toc-tests.ts:

remark().use(toc, {
  prefix: 'prefix-'
})

Expected behavior

no error.

Actual behavior

I have an error.

Argument of type '{ prefix: string; }' is not assignable to parameter of type 'Pick<TOCOptions, "heading" | "maxDepth" | "tight" | "skip">'.
  Object literal may only specify known properties, and 'prefix' does not exist in type 'Pick<TOCOptions, "heading" | "maxDepth" | "tight" | "skip">'.ts(2345)
wooorm commented 3 years ago

released!