Add type definitions#32
Merged
wooorm merged 7 commits intoremarkjs:mainfrom Jul 23, 2020
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
ChristianMurphy
approved these changes
Jul 10, 2020
Member
ChristianMurphy
left a comment
There was a problem hiding this comment.
Thanks @TaylorBeeston!
Closed
Contributor
Author
|
I went ahead and added the correct type definitions for This is the first time I've had a pull request open while the main branch merged in changes, so I'm not 100% certain I handled it correctly. I just |
ChristianMurphy
approved these changes
Jul 21, 2020
Member
ChristianMurphy
left a comment
There was a problem hiding this comment.
LGTM, thanks @TaylorBeeston! 🙇
Co-authored-by: Christian Murphy <[email protected]>
Rokt33r
approved these changes
Jul 22, 2020
wooorm
approved these changes
Jul 23, 2020
Member
|
Thanks @TaylorBeeston, released! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes GH-28This PR adds the
typesdirectory that contains anindex.d.tsfile that allows TypeScript projects to use this package more easily. Additionally, there are some tests to ensure the correctness of this type definition, and some boilerplate associated with dtslint.package.jsonhas been updated to includedtslintandunified(this is required for thePlugintype) as explicit dependencies. There is also the addition of thetest-typesscript to run dslint, andindex.d.tsis exported as the types file for this project.This is my first time writing a
.d.tsfile for a project, so please forgive me if there are any issues. One thing I would like to note is that thesanitizeparameter is currently just accepting nearly any object. I feel that a more rigid type should be defined within hast-util-sanitize based upon the definition ofschemain the readme. If needed, I can try and write a.d.tsfile for that repo as well, however, I would like to try and solve one step at a time, and make sure that I am doing things correctly along the way.