Skip to content

Commit

Permalink
chore: sort tokens alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerWhitehead7 committed Nov 9, 2024
1 parent 2305475 commit cfe4305
Showing 1 changed file with 101 additions and 101 deletions.
202 changes: 101 additions & 101 deletions src/Tokens.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
/* eslint-disable no-use-before-define */

export type MarkedToken = (
Tokens.Space
Tokens.Blockquote
| Tokens.Br
| Tokens.Code
| Tokens.Codespan
| Tokens.Def
| Tokens.Del
| Tokens.Em
| Tokens.Escape
| Tokens.Heading
| Tokens.Table
| Tokens.Hr
| Tokens.Blockquote
| Tokens.List
| Tokens.ListItem
| Tokens.Paragraph
| Tokens.HTML
| Tokens.Text
| Tokens.Def
| Tokens.Escape
| Tokens.Tag
| Tokens.Image
| Tokens.Link
| Tokens.List
| Tokens.ListItem
| Tokens.Paragraph
| Tokens.Space
| Tokens.Strong
| Tokens.Em
| Tokens.Codespan
| Tokens.Br
| Tokens.Del);
| Tokens.Table
| Tokens.Tag
| Tokens.Text
);

export type Token = (
MarkedToken
MarkedToken
| Tokens.Generic);

export namespace Tokens {
export interface Space {
type: 'space';
export interface Blockquote {
type: 'blockquote';
raw: string;
text: string;
tokens: Token[];
}

export interface Br {
type: 'br';
raw: string;
}

export interface Checkbox {
checked: boolean;
}

export interface Code {
type: 'code';
raw: string;
Expand All @@ -42,74 +54,59 @@ export namespace Tokens {
escaped?: boolean;
}

export interface Heading {
type: 'heading';
export interface Codespan {
type: 'codespan';
raw: string;
depth: number;
text: string;
tokens: Token[];
}

export interface Table {
type: 'table';
export interface Def {
type: 'def';
raw: string;
align: Array<'center' | 'left' | 'right' | null>;
header: TableCell[];
rows: TableCell[][];
}

export interface TableRow {
text: string;
tag: string;
href: string;
title: string;
}

export interface TableCell {
export interface Del {
type: 'del';
raw: string;
text: string;
tokens: Token[];
header: boolean;
align: 'center' | 'left' | 'right' | null;
}

export interface Hr {
type: 'hr';
export interface Em {
type: 'em';
raw: string;
text: string;
tokens: Token[];
}

export interface Blockquote {
type: 'blockquote';
export interface Escape {
type: 'escape';
raw: string;
text: string;
tokens: Token[];
}

export interface List {
type: 'list';
export interface Generic {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[index: string]: any;
type: string;
raw: string;
ordered: boolean;
start: number | '';
loose: boolean;
items: ListItem[];
tokens?: Token[];
}

export interface ListItem {
type: 'list_item';
export interface Heading {
type: 'heading';
raw: string;
task: boolean;
checked?: boolean;
loose: boolean;
depth: number;
text: string;
tokens: Token[];
}

export interface Checkbox {
checked: boolean;
}

export interface Paragraph {
type: 'paragraph';
export interface Hr {
type: 'hr';
raw: string;
pre?: boolean;
text: string;
tokens: Token[];
}

export interface HTML {
Expand All @@ -120,52 +117,53 @@ export namespace Tokens {
block: boolean;
}

export interface Text {
type: 'text';
export interface Image {
type: 'image';
raw: string;
href: string;
title: string | null;
text: string;
tokens?: Token[];
escaped?: boolean;
}

export interface Def {
type: 'def';
export interface Link {
type: 'link';
raw: string;
tag: string;
href: string;
title: string;
title?: string | null;
text: string;
tokens: Token[];
}

export interface Escape {
type: 'escape';
export interface List {
type: 'list';
raw: string;
text: string;
ordered: boolean;
start: number | '';
loose: boolean;
items: ListItem[];
}

export interface Tag {
type: 'html';
export interface ListItem {
type: 'list_item';
raw: string;
inLink: boolean;
inRawBlock: boolean;
task: boolean;
checked?: boolean;
loose: boolean;
text: string;
block: boolean;
tokens: Token[];
}

export interface Link {
type: 'link';
export interface Paragraph {
type: 'paragraph';
raw: string;
href: string;
title?: string | null;
pre?: boolean;
text: string;
tokens: Token[];
}

export interface Image {
type: 'image';
export interface Space {
type: 'space';
raw: string;
href: string;
title: string | null;
text: string;
}

export interface Strong {
Expand All @@ -175,38 +173,40 @@ export namespace Tokens {
tokens: Token[];
}

export interface Em {
type: 'em';
export interface Table {
type: 'table';
raw: string;
text: string;
tokens: Token[];
align: Array<'center' | 'left' | 'right' | null>;
header: TableCell[];
rows: TableCell[][];
}

export interface Codespan {
type: 'codespan';
raw: string;
export interface TableCell {
text: string;
tokens: Token[];
header: boolean;
align: 'center' | 'left' | 'right' | null;
}

export interface Br {
type: 'br';
raw: string;
export interface TableRow {
text: string;
}

export interface Del {
type: 'del';
export interface Tag {
type: 'html';
raw: string;
inLink: boolean;
inRawBlock: boolean;
text: string;
tokens: Token[];
block: boolean;
}

export interface Generic {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[index: string]: any;

type: string;
export interface Text {
type: 'text';
raw: string;
text: string;
tokens?: Token[];
escaped?: boolean;
}
}

Expand Down

0 comments on commit cfe4305

Please sign in to comment.