Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript support #315

Closed
pelletier197 opened this issue May 20, 2023 · 3 comments · Fixed by #324
Closed

Typescript support #315

pelletier197 opened this issue May 20, 2023 · 3 comments · Fixed by #324
Labels
enhancement New feature or request released

Comments

@pelletier197
Copy link

pelletier197 commented May 20, 2023

Issue

This module does not seem to provide typescript definitions. This causes compile errors in the projects using TypeScript + marked.

Do you think it be possible to provide these either out of the box or through @types/marked-gfm-heading-id?

@pelletier197
Copy link
Author

I took the time to write it for my project. Something like this should do the trick

declare module 'marked-gfm-heading-id' {
  type Extension = {
    hooks: {
      preprocess: (markdown: string) => string
    }
    renderer: {
      heading: (text: string, level: number, raw: string) => string
    }
  }

  export type Parameters = {
    prefix?: string
  }

  export const gfmHeadingId: (params?: Parameters) => Extension
}

@UziTech
Copy link
Member

UziTech commented May 24, 2023

If you want to create a PR that adds the types we could add it

@UziTech UziTech added the enhancement New feature or request label May 24, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2023

🎉 This issue has been resolved in version 3.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants