From f7e91e82c3627f7e995bb9b29a5d15d8f2e4db1d Mon Sep 17 00:00:00 2001 From: rhysd Date: Sun, 29 Oct 2023 21:12:44 +0900 Subject: [PATCH] explicitly define type of processer is for mdast tree in type definition --- package-lock.json | 1 + package.json | 7 ++++--- types/index.d.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 744d5ef..17bfd04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "4.0.0", "license": "MIT", "dependencies": { + "@types/mdast": "^4.0.2", "emoticon": "^4.0.1", "mdast-util-find-and-replace": "^3.0.1", "node-emoji": "^2.1.0" diff --git a/package.json b/package.json index caa03d3..d2b698d 100644 --- a/package.json +++ b/package.json @@ -58,12 +58,13 @@ "remark-github": "^12.0.0", "remark-html": "^16.0.1", "remark-slug": "^7.0.1", - "typescript": "^5.2.2", - "unified": "^11.0.4" + "typescript": "^5.2.2" }, "dependencies": { + "@types/mdast": "^4.0.2", "emoticon": "^4.0.1", "mdast-util-find-and-replace": "^3.0.1", - "node-emoji": "^2.1.0" + "node-emoji": "^2.1.0", + "unified": "^11.0.4" } } diff --git a/types/index.d.ts b/types/index.d.ts index 9d7cd0d..80558a5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,6 +1,7 @@ // TypeScript Version: 4.8 import type { Plugin } from 'unified'; +import type { Root } from 'mdast'; export interface RemarkEmojiOptions { /** @@ -26,5 +27,5 @@ export interface RemarkEmojiOptions { emoticon?: boolean; } -declare const plugin: Plugin<[(RemarkEmojiOptions | null | undefined)?]>; +declare const plugin: Plugin<[(RemarkEmojiOptions | null | undefined)?], Root>; export default plugin;