-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-markdown.d.ts
71 lines (64 loc) · 1.44 KB
/
react-markdown.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
declare module "react-markdown" {
import { ComponentType } from "react";
type AllowedTypes =
| "root"
| "text"
| "break"
| "paragraph"
| "emphasis"
| "strong"
| "thematicBreak"
| "blockquote"
| "delete"
| "link"
| "image"
| "linkReference"
| "imageReference"
| "list"
| "listItem"
| "definition"
| "heading"
| "inlineCode"
| "code"
| "html"
| "table"
| "tableCell"
| "tableRow";
type RenderProps = Record<string, unknown>;
export type NodeType = {
type: AllowedTypes;
children: Array<NodeType>;
[key: string]: unknown;
};
export type Renderers = {
[key in AllowedTypes]?: ComponentType<RenderProps>;
};
export type ReactMarkdownProps = {
className?: string;
source: string;
escapeHtml?: boolean;
skipHtml?: boolean;
sourcePos?: boolean;
rawSourcePos?: boolean;
includeNodeIndex?: boolean;
transformLinkUri?: (
uri: string,
children: NodeType,
title?: string
) => string;
linkTarget?:
| string
| ((
url: string,
text: string,
title?: string,
children?: NodeType
) => string | undefined);
renderers?: Renderers;
astPlugins?: Array<(ast: NodeType) => NodeType>;
plugins?: Array<unknown>;
allowDangerousHtml?: boolean;
};
const ReactMarkdown: ComponentType<ReactMarkdownProps>;
export default ReactMarkdown;
}