1
1
/* eslint-disable no-use-before-define */
2
2
3
3
export type MarkedToken = (
4
- Tokens . Space
4
+ Tokens . Blockquote
5
+ | Tokens . Br
5
6
| Tokens . Code
7
+ | Tokens . Codespan
8
+ | Tokens . Def
9
+ | Tokens . Del
10
+ | Tokens . Em
11
+ | Tokens . Escape
6
12
| Tokens . Heading
7
- | Tokens . Table
8
13
| Tokens . Hr
9
- | Tokens . Blockquote
10
- | Tokens . List
11
- | Tokens . ListItem
12
- | Tokens . Paragraph
13
14
| Tokens . HTML
14
- | Tokens . Text
15
- | Tokens . Def
16
- | Tokens . Escape
17
- | Tokens . Tag
18
15
| Tokens . Image
19
16
| Tokens . Link
17
+ | Tokens . List
18
+ | Tokens . ListItem
19
+ | Tokens . Paragraph
20
+ | Tokens . Space
20
21
| Tokens . Strong
21
- | Tokens . Em
22
- | Tokens . Codespan
23
- | Tokens . Br
24
- | Tokens . Del ) ;
22
+ | Tokens . Table
23
+ | Tokens . Tag
24
+ | Tokens . Text
25
+ ) ;
25
26
26
27
export type Token = (
27
- MarkedToken
28
+ MarkedToken
28
29
| Tokens . Generic ) ;
29
30
30
31
export namespace Tokens {
31
- export interface Space {
32
- type : 'space' ;
32
+ export interface Blockquote {
33
+ type : 'blockquote' ;
34
+ raw : string ;
35
+ text : string ;
36
+ tokens : Token [ ] ;
37
+ }
38
+
39
+ export interface Br {
40
+ type : 'br' ;
33
41
raw : string ;
34
42
}
35
43
44
+ export interface Checkbox {
45
+ checked : boolean ;
46
+ }
47
+
36
48
export interface Code {
37
49
type : 'code' ;
38
50
raw : string ;
@@ -42,74 +54,59 @@ export namespace Tokens {
42
54
escaped ?: boolean ;
43
55
}
44
56
45
- export interface Heading {
46
- type : 'heading ' ;
57
+ export interface Codespan {
58
+ type : 'codespan ' ;
47
59
raw : string ;
48
- depth : number ;
49
60
text : string ;
50
- tokens : Token [ ] ;
51
61
}
52
62
53
- export interface Table {
54
- type : 'table ' ;
63
+ export interface Def {
64
+ type : 'def ' ;
55
65
raw : string ;
56
- align : Array < 'center' | 'left' | 'right' | null > ;
57
- header : TableCell [ ] ;
58
- rows : TableCell [ ] [ ] ;
59
- }
60
-
61
- export interface TableRow {
62
- text : string ;
66
+ tag : string ;
67
+ href : string ;
68
+ title : string ;
63
69
}
64
70
65
- export interface TableCell {
71
+ export interface Del {
72
+ type : 'del' ;
73
+ raw : string ;
66
74
text : string ;
67
75
tokens : Token [ ] ;
68
- header : boolean ;
69
- align : 'center' | 'left' | 'right' | null ;
70
76
}
71
77
72
- export interface Hr {
73
- type : 'hr ' ;
78
+ export interface Em {
79
+ type : 'em ' ;
74
80
raw : string ;
81
+ text : string ;
82
+ tokens : Token [ ] ;
75
83
}
76
84
77
- export interface Blockquote {
78
- type : 'blockquote ' ;
85
+ export interface Escape {
86
+ type : 'escape ' ;
79
87
raw : string ;
80
88
text : string ;
81
- tokens : Token [ ] ;
82
89
}
83
90
84
- export interface List {
85
- type : 'list' ;
91
+ export interface Generic {
92
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
+ [ index : string ] : any ;
94
+ type : string ;
86
95
raw : string ;
87
- ordered : boolean ;
88
- start : number | '' ;
89
- loose : boolean ;
90
- items : ListItem [ ] ;
96
+ tokens ?: Token [ ] ;
91
97
}
92
98
93
- export interface ListItem {
94
- type : 'list_item ' ;
99
+ export interface Heading {
100
+ type : 'heading ' ;
95
101
raw : string ;
96
- task : boolean ;
97
- checked ?: boolean ;
98
- loose : boolean ;
102
+ depth : number ;
99
103
text : string ;
100
104
tokens : Token [ ] ;
101
105
}
102
106
103
- export interface Checkbox {
104
- checked : boolean ;
105
- }
106
-
107
- export interface Paragraph {
108
- type : 'paragraph' ;
107
+ export interface Hr {
108
+ type : 'hr' ;
109
109
raw : string ;
110
- pre ?: boolean ;
111
- text : string ;
112
- tokens : Token [ ] ;
113
110
}
114
111
115
112
export interface HTML {
@@ -120,52 +117,53 @@ export namespace Tokens {
120
117
block : boolean ;
121
118
}
122
119
123
- export interface Text {
124
- type : 'text ' ;
120
+ export interface Image {
121
+ type : 'image ' ;
125
122
raw : string ;
123
+ href : string ;
124
+ title : string | null ;
126
125
text : string ;
127
- tokens ?: Token [ ] ;
128
- escaped ?: boolean ;
129
126
}
130
127
131
- export interface Def {
132
- type : 'def ' ;
128
+ export interface Link {
129
+ type : 'link ' ;
133
130
raw : string ;
134
- tag : string ;
135
131
href : string ;
136
- title : string ;
132
+ title ?: string | null ;
133
+ text : string ;
134
+ tokens : Token [ ] ;
137
135
}
138
136
139
- export interface Escape {
140
- type : 'escape ' ;
137
+ export interface List {
138
+ type : 'list ' ;
141
139
raw : string ;
142
- text : string ;
140
+ ordered : boolean ;
141
+ start : number | '' ;
142
+ loose : boolean ;
143
+ items : ListItem [ ] ;
143
144
}
144
145
145
- export interface Tag {
146
- type : 'html ' ;
146
+ export interface ListItem {
147
+ type : 'list_item ' ;
147
148
raw : string ;
148
- inLink : boolean ;
149
- inRawBlock : boolean ;
149
+ task : boolean ;
150
+ checked ?: boolean ;
151
+ loose : boolean ;
150
152
text : string ;
151
- block : boolean ;
153
+ tokens : Token [ ] ;
152
154
}
153
155
154
- export interface Link {
155
- type : 'link ' ;
156
+ export interface Paragraph {
157
+ type : 'paragraph ' ;
156
158
raw : string ;
157
- href : string ;
158
- title ?: string | null ;
159
+ pre ?: boolean ;
159
160
text : string ;
160
161
tokens : Token [ ] ;
161
162
}
162
163
163
- export interface Image {
164
- type : 'image ' ;
164
+ export interface Space {
165
+ type : 'space ' ;
165
166
raw : string ;
166
- href : string ;
167
- title : string | null ;
168
- text : string ;
169
167
}
170
168
171
169
export interface Strong {
@@ -175,38 +173,40 @@ export namespace Tokens {
175
173
tokens : Token [ ] ;
176
174
}
177
175
178
- export interface Em {
179
- type : 'em ' ;
176
+ export interface Table {
177
+ type : 'table ' ;
180
178
raw : string ;
181
- text : string ;
182
- tokens : Token [ ] ;
179
+ align : Array < 'center' | 'left' | 'right' | null > ;
180
+ header : TableCell [ ] ;
181
+ rows : TableCell [ ] [ ] ;
183
182
}
184
183
185
- export interface Codespan {
186
- type : 'codespan' ;
187
- raw : string ;
184
+ export interface TableCell {
188
185
text : string ;
186
+ tokens : Token [ ] ;
187
+ header : boolean ;
188
+ align : 'center' | 'left' | 'right' | null ;
189
189
}
190
190
191
- export interface Br {
192
- type : 'br' ;
193
- raw : string ;
191
+ export interface TableRow {
192
+ text : string ;
194
193
}
195
194
196
- export interface Del {
197
- type : 'del ' ;
195
+ export interface Tag {
196
+ type : 'html ' ;
198
197
raw : string ;
198
+ inLink : boolean ;
199
+ inRawBlock : boolean ;
199
200
text : string ;
200
- tokens : Token [ ] ;
201
+ block : boolean ;
201
202
}
202
203
203
- export interface Generic {
204
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
- [ index : string ] : any ;
206
-
207
- type : string ;
204
+ export interface Text {
205
+ type : 'text' ;
208
206
raw : string ;
207
+ text : string ;
209
208
tokens ?: Token [ ] ;
209
+ escaped ?: boolean ;
210
210
}
211
211
}
212
212
0 commit comments