forked from remarkjs/react-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
81 lines (71 loc) · 2.11 KB
/
Copy pathindex.d.ts
File metadata and controls
81 lines (71 loc) · 2.11 KB
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
72
73
74
75
76
77
78
79
80
81
// Type definitions for react-markdown v3.0.0-rc1
// Project: https://github.com/rexxars/react-markdown
// Definitions by: Ruslan Ibragimov <https://github.com/IRus>, Kohei Asai <me@axross.io>
import {Component, ReactElement, ReactNode, ReactType} from 'react'
declare class ReactMarkdown extends Component<ReactMarkdown.ReactMarkdownProps, {}> {}
declare namespace ReactMarkdown {
interface AllowNode {
readonly type: string
readonly value?: string
readonly depth?: number
readonly children?: ReactNode[]
}
interface SourcePosition {
readonly line: number
readonly column: number
readonly offset: number
}
interface NodePosition {
readonly start: SourcePosition
readonly end: SourcePosition
readonly indent: number[]
}
export type NodeType =
| 'root'
| 'break'
| 'paragraph'
| 'emphasis'
| 'strong'
| 'thematicBreak'
| 'blockquote'
| 'delete'
| 'link'
| 'image'
| 'linkReference'
| 'imageReference'
| 'table'
| 'tableHead'
| 'tableBody'
| 'tableRow'
| 'tableCell'
| 'list'
| 'listItem'
| 'definition'
| 'heading'
| 'inlineCode'
| 'code'
| 'html'
| 'virtualHtml'
export interface ReactMarkdownProps {
readonly className?: string
readonly source: string
readonly sourcePos?: boolean
readonly escapeHtml?: boolean
readonly skipHtml?: boolean
readonly allowNode?: (node: AllowNode, index: number, parent: NodeType) => boolean
readonly allowedTypes?: NodeType[]
readonly disallowedTypes?: NodeType[]
readonly transformLinkUri?: (uri: string, children?: ReactNode, title?: string) => string
readonly transformImageUri?: (uri: string, children?: ReactNode, title?: string, alt?: string) => string
readonly unwrapDisallowed?: boolean
readonly renderers?: {[nodeType: string]: ReactType}
}
type Renderer<T> = (props: T) => ReactElement<T>
interface Renderers {
[key: string]: string | Renderer<any>
}
export var types: NodeType[]
export var renderers: Renderers
export var uriTransformer: (uri: string) => string
}
export = ReactMarkdown