Skip to content

Commit db257e0

Browse files
committed
types: added types for anchor-markdown-header
temp file while PR gets merged, see thlorenz/anchor-markdown-header#50
1 parent 7d6c410 commit db257e0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

src/anchor.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
declare module "anchor-markdown-header" {
2+
/**
3+
* @param header {String} The header to be anchored.
4+
* @param mode {String} The anchor mode (github.com|nodejs.org|bitbucket.org|ghost.org|gitlab.com).
5+
* @param repetition {Number} The nth occurrence of this header text, starting with 0. Not required for the 0th instance.
6+
* @param moduleName {String} The name of the module of the given header (required only for 'nodejs.org' mode).
7+
* @return {String} The header anchor that is compatible with the given mode.
8+
*/
9+
function anchor(
10+
header: string,
11+
mode?:
12+
| "github.com"
13+
| "nodejs.org"
14+
| "bitbucket.org"
15+
| "ghost.org"
16+
| "gitlab.com",
17+
repetition?: number,
18+
moduleName?: string
19+
): string;
20+
export = anchor;
21+
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"moduleResolution": "node",
1212
"importHelpers": true,
1313
"lib": ["dom", "es5", "scripthost", "es2015"],
14-
"strict": true
14+
"strict": true,
15+
"types": ["./src/anchor.d.ts"]
1516
},
1617
"include": ["**/*.ts"]
1718
}

0 commit comments

Comments
 (0)