jc-marked
Version:
Markdown AST (Abstract syntax tree) parser based on finite-state machine (FSM).
70 lines (69 loc) • 1.58 kB
TypeScript
declare type initial = {
type: "initial";
};
declare type meta = {
type: "meta";
index: number;
};
declare type breakLine = {
type: "breakLine";
index: number;
};
declare type title = {
type: "title";
index: number;
};
declare type footnote = {
type: "footnote";
index: number;
};
declare type info = {
type: "info";
from: number;
to: number;
};
declare type code = {
type: "code";
from: number;
to: number;
};
declare type codeGroup = {
type: "code-group";
from: number;
to: number;
};
declare type chart = {
type: "chart";
from: number;
to: number;
};
declare type table = {
type: "table";
from: number;
to: number;
};
declare type quote = {
type: "quote";
from: number;
to: number;
};
declare type math = {
type: "math";
from: number;
to: number;
};
declare type text = {
type: "text";
from: number;
to: number;
};
declare type item = info | title | footnote | code | codeGroup | chart | table | quote | math | text | meta | breakLine | initial;
declare type elem = info | footnote | code | codeGroup | chart | table | quote | math | text | meta | breakLine;
declare type paragraph = {
type: 'paragraph';
order: string;
name: string;
body: treeItem[];
};
declare type treeItem = info | footnote | code | codeGroup | chart | table | quote | math | text | meta | breakLine | paragraph;
export type { initial, meta, breakLine, info, title, footnote, code, codeGroup, chart, table, quote, math, text, item, elem, paragraph, treeItem };