File tree Expand file tree Collapse file tree 6 files changed +68
-4
lines changed
Expand file tree Collapse file tree 6 files changed +68
-4
lines changed Original file line number Diff line number Diff line change 2828 " Jonathan Haines <jonno.haines@gmail.com>" ,
2929 " Robin Millette <robin@millette.info>"
3030 ],
31+ "types" : " types/index.d.ts" ,
3132 "files" : [
33+ " types/index.d.ts" ,
3234 " index.js"
3335 ],
3436 "dependencies" : {
35- "mdast-util-toc" : " ^4.0.0"
37+ "@types/unist" : " ^2.0.3" ,
38+ "mdast-util-toc" : " ^5.0.0"
3639 },
3740 "devDependencies" : {
3841 "browserify" : " ^16.0.0" ,
42+ "dtslint" : " ^2.0.0" ,
3943 "is-hidden" : " ^1.1.0" ,
4044 "negate" : " ^1.0.0" ,
4145 "nyc" : " ^14.0.0" ,
4549 "remark-preset-wooorm" : " ^6.0.0" ,
4650 "tape" : " ^4.0.0" ,
4751 "tinyify" : " ^2.0.0" ,
48- "xo" : " ^0.24 .0"
52+ "xo" : " ^0.25 .0"
4953 },
5054 "scripts" : {
5155 "format" : " remark *.md -qfo && prettier --write \" **/*.js\" && xo --fix" ,
5458 "build" : " npm run build-bundle && npm run build-mangle" ,
5559 "test-api" : " node test" ,
5660 "test-coverage" : " nyc --reporter lcov tape test/index.js" ,
57- "test" : " npm run format && npm run build && npm run test-coverage"
61+ "test-types" : " dtslint types" ,
62+ "test" : " npm run format && npm run build && npm run test-coverage && npm run test-types"
5863 },
5964 "prettier" : {
6065 "tabWidth" : 2 ,
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ test('Fixtures', function(t) {
4242
4343 try {
4444 config = JSON . parse ( read ( join ( filepath , 'config.json' ) ) )
45- } catch ( error ) {
45+ } catch ( _ ) {
4646 config = { }
4747 }
4848
Original file line number Diff line number Diff line change 1+ // Minimum TypeScript Version: 3.2
2+
3+ import { Node } from 'unist'
4+ import { TOCOptions } from 'mdast-util-toc'
5+
6+ declare namespace remarkToc {
7+ type TOCSettings = Pick < TOCOptions , 'heading' | 'maxDepth' | 'tight' | 'skip' > ;
8+ }
9+
10+ /**
11+ * Generate a Table of Contents.
12+ *
13+ * @param settings configuration for generating the table of contents
14+ */
15+ declare function remarkToc (
16+ settings ?: remarkToc . TOCSettings
17+ ) : ( node : Node ) => void
18+
19+ export = remarkToc
Original file line number Diff line number Diff line change 1+ import remark = require( 'remark' )
2+
3+ import toc = require( 'remark-toc' )
4+
5+ remark ( ) . use ( toc )
6+
7+ remark ( ) . use ( toc , { } )
8+
9+ remark ( ) . use ( toc , {
10+ heading : 'heading'
11+ } )
12+
13+ remark ( ) . use ( toc , {
14+ maxDepth : 2
15+ } )
16+
17+ remark ( ) . use ( toc , {
18+ tight : true
19+ } )
20+
21+ remark ( ) . use ( toc , {
22+ skip : 'skip-heading'
23+ } )
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "lib" : [" es2015" ],
4+ "strict" : true ,
5+ "baseUrl" : " ." ,
6+ "paths" : {
7+ "remark-toc" : [" index.d.ts" ]
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " dtslint/dtslint.json" ,
3+ "rules" : {
4+ "semicolon" : false ,
5+ "whitespace" : false
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments