Skip to content

Commit

Permalink
Add augmentation of settings types to rehype
Browse files Browse the repository at this point in the history
Related-to: #150.
  • Loading branch information
wooorm committed Aug 30, 2023
1 parent eb283bd commit 372da4d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ node_modules/
*.log
.DS_Store
yarn.lock
!packages/rehype/index.d.ts
!packages/rehype-parse/index.d.ts
!packages/rehype-stringify/index.d.ts
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
],
"rules": {
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-definitions": "off"
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/triple-slash-reference": "off"
}
}
],
Expand Down
11 changes: 11 additions & 0 deletions packages/rehype/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference types="rehype-parse" />
/// <reference types="rehype-stringify" />

import type {Root} from 'hast'
import type {Processor} from 'unified'

/**
* Create a new unified processor that already uses `rehype-parse` and
* `rehype-stringify`.
*/
export const rehype: Processor<Root, undefined, undefined, Root, string>
1 change: 1 addition & 0 deletions packages/rehype/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Note: types exposed from `index.d.ts`
import rehypeParse from 'rehype-parse'
import rehypeStringify from 'rehype-stringify'
import {unified} from 'unified'
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"exclude": ["**/coverage/", "**/node_modules/"],
"include": [
"**/*.js",
"packages/rehype/index.d.ts",
"packages/rehype-parse/index.d.ts",
"packages/rehype-stringify/index.d.ts"
]
Expand Down

0 comments on commit 372da4d

Please sign in to comment.