Skip to content

Commit

Permalink
Add types
Browse files Browse the repository at this point in the history
Closes GH-17.
  • Loading branch information
pd4d10 authored Sep 29, 2020
1 parent a7f022f commit aa6ea0d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"types": "types/index.d.ts",
"files": [
"index.js"
"index.js",
"types/index.d.ts"
],
"dependencies": {
"hast-util-raw": "^5.0.0"
},
"devDependencies": {
"browserify": "^16.0.0",
"dtslint": "^3.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"rehype-stringify": "^8.0.0",
Expand All @@ -48,7 +51,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"
},
"nyc": {
"check-coverage": true,
Expand Down
7 changes: 7 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// TypeScript Version: 3.4

import {Plugin} from 'unified'

declare const rehypeRaw: Plugin<[]>

export = rehypeRaw
4 changes: 4 additions & 0 deletions types/rehype-raw-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import unified = require('unified')
import raw = require('rehype-raw')

unified().use(raw)
10 changes: 10 additions & 0 deletions types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"lib": ["es2015"],
"strict": true,
"baseUrl": ".",
"paths": {
"rehype-raw": ["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
}
}

0 comments on commit aa6ea0d

Please sign in to comment.