-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade markdown-it types to v14 (#3772)
- Loading branch information
Showing
7 changed files
with
127 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/package.json b/package.json | ||
index 46d7bfb79a36d8090d98d1ea1e36216137e00072..7bc1e8be5f1c5b74f52f7fa08935d2df3d19d3e2 100644 | ||
--- a/package.json | ||
+++ b/package.json | ||
@@ -27,7 +27,7 @@ | ||
} | ||
], | ||
"main": "", | ||
- "types": "index.d.ts", | ||
+ "types": "index.d.mts", | ||
"exports": { | ||
".": { | ||
"import": "./index.d.mts", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/types/index.d.ts b/types/index.d.ts | ||
index 7c94aae194faa66ca006ace98cdb0dee82a3e471..0377cace7c4a9653d4ecf963babffd4bd68494b0 100644 | ||
--- a/types/index.d.ts | ||
+++ b/types/index.d.ts | ||
@@ -1,10 +1,10 @@ | ||
-import MarkdownIt = require('markdown-it'); | ||
-import Token = require('markdown-it/lib/token'); | ||
-import State = require('markdown-it/lib/rules_core/state_core'); | ||
+import MarkdownIt from 'markdown-it'; | ||
+import Token from 'markdown-it/lib/token.mjs'; | ||
+import StateCore from 'markdown-it/lib/rules_core/state_core.mjs'; | ||
|
||
declare namespace anchor { | ||
- export type RenderHref = (slug: string, state: State) => string; | ||
- export type RenderAttrs = (slug: string, state: State) => Record<string, string | number>; | ||
+ export type RenderHref = (slug: string, state: StateCore) => string; | ||
+ export type RenderAttrs = (slug: string, state: StateCore) => Record<string, string | number>; | ||
|
||
export interface PermalinkOptions { | ||
class?: string, | ||
@@ -37,7 +37,7 @@ declare namespace anchor { | ||
placement?: 'before' | 'after' | ||
} | ||
|
||
- export type PermalinkGenerator = (slug: string, opts: PermalinkOptions, state: State, index: number) => void; | ||
+ export type PermalinkGenerator = (slug: string, opts: PermalinkOptions, state: StateCore, index: number) => void; | ||
|
||
export interface AnchorInfo { | ||
slug: string; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters