Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
"Titus Wormer <[email protected]> (https://wooorm.com)"
],
"files": [
"index.js"
"index.js",
"types/index.d.ts"
],
"dependencies": {},
"types": "types/index.d.ts",
"devDependencies": {
"browserify": "^17.0.0",
"dtslint": "^4.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
Expand All @@ -45,7 +47,8 @@
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "nyc --reporter lcov tape test.js",
"test": "npm run format && npm run build && npm run test-coverage"
"test-types": "dtslint types",
"test": "npm run format && npm run build && npm run test-coverage && npm run test-types"
},
"prettier": {
"tabWidth": 2,
Expand Down
8 changes: 8 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Minimum TypeScript Version: 3.0
import {Node} from 'unist'

declare namespace mdastToString {}

declare function mdastToString(node: Node): string

export = mdastToString
4 changes: 4 additions & 0 deletions types/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import mdastUtilToString = require('mdast-util-to-string')

mdastUtilToString() // $ExpectError
mdastUtilToString({type: 'root'}) // $ExpectType string
15 changes: 15 additions & 0 deletions types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"moduleResolution": "node",
"lib": [
"ES5"
],
"strict": true,
"baseUrl": ".",
"paths": {
"mdast-util-to-string": [
"./index.d.ts"
]
}
}
}
7 changes: 7 additions & 0 deletions types/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"semicolon": false,
"whitespace": false
}
}