EmaSuriano/react-scroll-section

Feature suggestion: Export type definitions

christikaes opened this issue · 2 comments

Awesome library!

I'm using this with a typescript project and couldn't find type definitions for the library. I ended up adding something like this:

type SectionLinkData = {
  isSelected: boolean
  onClick: () => void
}

type SectionLinksData = {
  allLinks: Record<string, SectionLinkData>
}

Although it's just for the section's links (there may be other types that I'm missing), it would be helpful to have this exported so I don't need to do this in code. Is this something you would consider?

Hey, thanks for creating this issue. Yeah, I don't intend to re-write the whole library to typescript, so I think that packing the types inside the package it's the best approach.

@christikaes could you please create a PR with the types you have defined? 🙏

Hello I created this pr #68 to address this issue :)