Skip to content

Commit cfe4305

Browse files
chore: sort tokens alphabetically
1 parent 2305475 commit cfe4305

File tree

1 file changed

+101
-101
lines changed

1 file changed

+101
-101
lines changed

src/Tokens.ts

+101-101
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
11
/* eslint-disable no-use-before-define */
22

33
export type MarkedToken = (
4-
Tokens.Space
4+
Tokens.Blockquote
5+
| Tokens.Br
56
| Tokens.Code
7+
| Tokens.Codespan
8+
| Tokens.Def
9+
| Tokens.Del
10+
| Tokens.Em
11+
| Tokens.Escape
612
| Tokens.Heading
7-
| Tokens.Table
813
| Tokens.Hr
9-
| Tokens.Blockquote
10-
| Tokens.List
11-
| Tokens.ListItem
12-
| Tokens.Paragraph
1314
| Tokens.HTML
14-
| Tokens.Text
15-
| Tokens.Def
16-
| Tokens.Escape
17-
| Tokens.Tag
1815
| Tokens.Image
1916
| Tokens.Link
17+
| Tokens.List
18+
| Tokens.ListItem
19+
| Tokens.Paragraph
20+
| Tokens.Space
2021
| Tokens.Strong
21-
| Tokens.Em
22-
| Tokens.Codespan
23-
| Tokens.Br
24-
| Tokens.Del);
22+
| Tokens.Table
23+
| Tokens.Tag
24+
| Tokens.Text
25+
);
2526

2627
export type Token = (
27-
MarkedToken
28+
MarkedToken
2829
| Tokens.Generic);
2930

3031
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';
3341
raw: string;
3442
}
3543

44+
export interface Checkbox {
45+
checked: boolean;
46+
}
47+
3648
export interface Code {
3749
type: 'code';
3850
raw: string;
@@ -42,74 +54,59 @@ export namespace Tokens {
4254
escaped?: boolean;
4355
}
4456

45-
export interface Heading {
46-
type: 'heading';
57+
export interface Codespan {
58+
type: 'codespan';
4759
raw: string;
48-
depth: number;
4960
text: string;
50-
tokens: Token[];
5161
}
5262

53-
export interface Table {
54-
type: 'table';
63+
export interface Def {
64+
type: 'def';
5565
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;
6369
}
6470

65-
export interface TableCell {
71+
export interface Del {
72+
type: 'del';
73+
raw: string;
6674
text: string;
6775
tokens: Token[];
68-
header: boolean;
69-
align: 'center' | 'left' | 'right' | null;
7076
}
7177

72-
export interface Hr {
73-
type: 'hr';
78+
export interface Em {
79+
type: 'em';
7480
raw: string;
81+
text: string;
82+
tokens: Token[];
7583
}
7684

77-
export interface Blockquote {
78-
type: 'blockquote';
85+
export interface Escape {
86+
type: 'escape';
7987
raw: string;
8088
text: string;
81-
tokens: Token[];
8289
}
8390

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;
8695
raw: string;
87-
ordered: boolean;
88-
start: number | '';
89-
loose: boolean;
90-
items: ListItem[];
96+
tokens?: Token[];
9197
}
9298

93-
export interface ListItem {
94-
type: 'list_item';
99+
export interface Heading {
100+
type: 'heading';
95101
raw: string;
96-
task: boolean;
97-
checked?: boolean;
98-
loose: boolean;
102+
depth: number;
99103
text: string;
100104
tokens: Token[];
101105
}
102106

103-
export interface Checkbox {
104-
checked: boolean;
105-
}
106-
107-
export interface Paragraph {
108-
type: 'paragraph';
107+
export interface Hr {
108+
type: 'hr';
109109
raw: string;
110-
pre?: boolean;
111-
text: string;
112-
tokens: Token[];
113110
}
114111

115112
export interface HTML {
@@ -120,52 +117,53 @@ export namespace Tokens {
120117
block: boolean;
121118
}
122119

123-
export interface Text {
124-
type: 'text';
120+
export interface Image {
121+
type: 'image';
125122
raw: string;
123+
href: string;
124+
title: string | null;
126125
text: string;
127-
tokens?: Token[];
128-
escaped?: boolean;
129126
}
130127

131-
export interface Def {
132-
type: 'def';
128+
export interface Link {
129+
type: 'link';
133130
raw: string;
134-
tag: string;
135131
href: string;
136-
title: string;
132+
title?: string | null;
133+
text: string;
134+
tokens: Token[];
137135
}
138136

139-
export interface Escape {
140-
type: 'escape';
137+
export interface List {
138+
type: 'list';
141139
raw: string;
142-
text: string;
140+
ordered: boolean;
141+
start: number | '';
142+
loose: boolean;
143+
items: ListItem[];
143144
}
144145

145-
export interface Tag {
146-
type: 'html';
146+
export interface ListItem {
147+
type: 'list_item';
147148
raw: string;
148-
inLink: boolean;
149-
inRawBlock: boolean;
149+
task: boolean;
150+
checked?: boolean;
151+
loose: boolean;
150152
text: string;
151-
block: boolean;
153+
tokens: Token[];
152154
}
153155

154-
export interface Link {
155-
type: 'link';
156+
export interface Paragraph {
157+
type: 'paragraph';
156158
raw: string;
157-
href: string;
158-
title?: string | null;
159+
pre?: boolean;
159160
text: string;
160161
tokens: Token[];
161162
}
162163

163-
export interface Image {
164-
type: 'image';
164+
export interface Space {
165+
type: 'space';
165166
raw: string;
166-
href: string;
167-
title: string | null;
168-
text: string;
169167
}
170168

171169
export interface Strong {
@@ -175,38 +173,40 @@ export namespace Tokens {
175173
tokens: Token[];
176174
}
177175

178-
export interface Em {
179-
type: 'em';
176+
export interface Table {
177+
type: 'table';
180178
raw: string;
181-
text: string;
182-
tokens: Token[];
179+
align: Array<'center' | 'left' | 'right' | null>;
180+
header: TableCell[];
181+
rows: TableCell[][];
183182
}
184183

185-
export interface Codespan {
186-
type: 'codespan';
187-
raw: string;
184+
export interface TableCell {
188185
text: string;
186+
tokens: Token[];
187+
header: boolean;
188+
align: 'center' | 'left' | 'right' | null;
189189
}
190190

191-
export interface Br {
192-
type: 'br';
193-
raw: string;
191+
export interface TableRow {
192+
text: string;
194193
}
195194

196-
export interface Del {
197-
type: 'del';
195+
export interface Tag {
196+
type: 'html';
198197
raw: string;
198+
inLink: boolean;
199+
inRawBlock: boolean;
199200
text: string;
200-
tokens: Token[];
201+
block: boolean;
201202
}
202203

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';
208206
raw: string;
207+
text: string;
209208
tokens?: Token[];
209+
escaped?: boolean;
210210
}
211211
}
212212

0 commit comments

Comments
 (0)