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

Provide typescript definitions #1

Closed
crystalfp opened this issue Sep 20, 2020 · 2 comments
Closed

Provide typescript definitions #1

crystalfp opened this issue Sep 20, 2020 · 2 comments
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have

Comments

@crystalfp
Copy link

Typescript support

The module has no accompanying type definition file for typescript in the same package or under @types.

Problem

PS D:\ProjectsShort\ParseMarkdown> tsc
parse.ts:1:28 - error TS7016: Could not find a declaration file for module 'mdast-util-from-markdown'. 
'D:/ProjectsShort/ParseMarkdown/node_modules/mdast-util-from-markdown/index.js' implicitly has an 'any' type.
  Try `npm install @types/mdast-util-from-markdown` if it exists or add a new declaration (.d.ts) file 
containing `declare module 'mdast-util-from-markdown';`

1 import fromMarkdown from "mdast-util-from-markdown";
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected behavior

Smooth integration in a typescript-based project.

Alternatives

Adding a mdast-util-from-markdown.d.ts file as suggested in the error message makes the compilation succeeds, but losing the type checking.

@crystalfp crystalfp added 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Sep 20, 2020
@ChristianMurphy
Copy link
Member

ChristianMurphy commented Sep 20, 2020

@crystalfp contributions are welcome, in unified/syntax-tree repos typically the JavaScript is left as is and the typings files are added in their own folder.
Unified also builds typings starting at lower level dependencies, and work the typings up,
Micromark will need typings before they'll make their way here.
There is some initial work towards this in micromark/micromark#17, again contributions are welcome!

@ChristianMurphy ChristianMurphy added ☂️ area/types This affects typings 🌊 blocked/upstream This cannot progress before something external happens first 🦋 type/enhancement This is great to have 🧑 semver/major This is a change help wanted 🙏 This could use your insight or help good first issue 👋 This may be a great place to get started! and removed 🙉 open/needs-info This needs some more info 🦋 type/enhancement This is great to have labels Sep 20, 2020
@wooorm
Copy link
Member

wooorm commented Oct 11, 2020

Closed by GH-5.

@wooorm wooorm closed this as completed Oct 11, 2020
@wooorm wooorm added ⛵️ status/released and removed good first issue 👋 This may be a great place to get started! help wanted 🙏 This could use your insight or help 🌊 blocked/upstream This cannot progress before something external happens first labels Oct 11, 2020
@wooorm wooorm added the 💪 phase/solved Post is done label Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

3 participants