Skip to content

Commit

Permalink
Merge pull request #76 from mrdrogdrog/master
Browse files Browse the repository at this point in the history
Change markdown-it dependency to `*` and add types
  • Loading branch information
nagaozen authored Dec 27, 2020
2 parents 3c88a15 + 175510b commit a672d70
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 17 deletions.
32 changes: 19 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markdown-it-anchor",
"version": "6.0.1",
"name": "@mrdrogdrog/markdown-it-anchor",
"version": "6.0.3",
"description": "Header anchors for markdown-it.",
"source": "index.js",
"main": "dist/markdownItAnchor.js",
Expand All @@ -9,6 +9,7 @@
"mangle": {
"regex": "^_"
},
"types": "./types/index.d.ts",
"keywords": [
"markdown",
"markdown-it",
Expand All @@ -22,7 +23,8 @@
"README.md",
"UNLICENSE",
"dist/*",
"runkit.js"
"runkit.js",
"types/*"
],
"repository": {
"type": "git",
Expand All @@ -38,7 +40,7 @@
"runkitExampleFilename": "runkit.js",
"dependencies": {},
"devDependencies": {
"markdown-it": "^10.0.0",
"markdown-it": "*",
"markdown-it-attrs": "^3.0.1",
"microbundle": "^0.12.0",
"standard": "^14.3.1"
Expand Down
26 changes: 26 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import MarkdownIt = require('markdown-it');
import Core = require('markdown-it/lib/parser_core');
import Token = require('markdown-it/lib/token');

declare namespace anchor {
interface AnchorInfo {
slug: string;
title: string;
}

interface AnchorOptions {
level?: number;
slugify?(str: string): string;
permalink?: boolean;
renderPermalink?(slug: string, opts: AnchorOptions, state: Core, idx: number): void;
permalinkClass?: string;
permalinkSymbol?: string;
permalinkBefore?: boolean;
permalinkHref?(slug: string): string;
callback?(token: Token, anchor_info: AnchorInfo): void;
}
}

declare function anchor(md: MarkdownIt, opts: anchor.AnchorOptions): void;

export = anchor;

0 comments on commit a672d70

Please sign in to comment.