添加mermaid图表接口 (#85)

* 添加mermaid图表接口

* 添加类型文件

* Update package.json

* Create next-env.d.ts
This commit is contained in:
stakeswky
2023-06-10 23:27:11 +08:00
committed by GitHub
parent 9a831b5b8b
commit d057d20c17
5 changed files with 117 additions and 23 deletions

19
client/src/types/mermaid.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
declare module "mermaid" {
import mermaidAPI from "mermaid";
const mermaid: any;
export default mermaid;
// 扩展 mermaidAPI
interface MermaidAPI extends mermaidAPI.mermaidAPI {
contentLoaded: (
targetEl: Element,
options?: mermaidAPI.mermaidAPI.Config
) => void;
}
const mermaidAPIInstance: MermaidAPI;
export default mermaidAPIInstance;
}
type Dispatch = (action: Action) => void;