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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TS type information for remark-parse #384

Closed
wants to merge 7 commits into from

Conversation

mike-north
Copy link
Contributor

NOTE: This branch is based on top of #383

This PR adds ambient type information and tests for the remark-parse package

Consumers of this library who benefit from TypeScript type information can do stuff like

import * as remarkParse from 'remark-parse'
import {RemarkParseOptions} from 'remark-parse/types'
import * as unified from 'unified'

/**
 * 馃憞 type-checking against the options object
 */
const parseOptions: Partial<RemarkParseOptions> = {
  gfm: true,
  pedantic: true
}

unified().use(remarkParse, parseOptions)

/**
 * 馃憞 type-checking against the options object
 */
const badParseOptions: Partial<RemarkParseOptions> = {
  gfm: 'true' // 馃毃
}

@mike-north mike-north force-pushed the parse-types branch 2 times, most recently from 5781899 to 0a7ba78 Compare January 11, 2019 21:58
@mike-north mike-north force-pushed the parse-types branch 2 times, most recently from d8c8378 to b6b64a5 Compare January 15, 2019 07:22
@Rokt33r
Copy link
Member

Rokt33r commented Jan 21, 2019

I've merged this pr into #383

@Rokt33r Rokt33r closed this Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants