mathup
Version:
Easy MathML authoring tool with a quick to write syntax
91 lines • 2.17 kB
TypeScript
export { default as parse } from "./parse.js";
export type LiteralAttrs = Record<string, string | boolean | number | null | undefined>;
export type GroupAttrs = {
open: {
value: string;
attrs?: LiteralAttrs;
};
close: {
value: string;
attrs?: LiteralAttrs;
} | null;
seps: {
value: string;
attrs?: LiteralAttrs;
}[];
};
export type Sentence = {
type: "Sentence";
body: Node[];
};
export type Term = {
type: "Term";
styles?: Map<string, string>;
items: Node[];
};
export type FencedGroup = {
type: "FencedGroup";
items: Node[][];
attrs: GroupAttrs;
};
export type MultiScripts = {
type: "MultiScripts";
base: Node;
post: [Node[], Node[]][];
pre?: [Node[], Node[]][];
};
export type MatrixGroup = {
type: "MatrixGroup";
items: Node[][][];
attrs: GroupAttrs;
};
export type UnaryOperation = {
type: "UnaryOperation";
name: string;
accent?: string;
transforms?: string[];
styles?: Map<string, string>;
attrs?: LiteralAttrs;
items: [Node];
};
export type BinaryOperation = {
type: "BinaryOperation";
name: string;
attrs?: LiteralAttrs;
items: [Node, Node];
};
export type TernaryOperation = {
type: "TernaryOperation";
name: string;
attrs?: LiteralAttrs;
items: [Node, Node, Node];
};
export type IdentLiteral = {
type: "IdentLiteral";
value: string;
attrs?: LiteralAttrs;
};
export type NumberLiteral = {
type: "NumberLiteral";
value: string;
attrs?: LiteralAttrs;
};
export type OperatorLiteral = {
type: "OperatorLiteral";
value: string;
attrs?: LiteralAttrs;
};
export type SpaceLiteral = {
type: "SpaceLiteral";
attrs: {
width: string;
};
};
export type TextLiteral = {
type: "TextLiteral";
value: string;
attrs?: LiteralAttrs;
};
export type Literal = IdentLiteral | NumberLiteral | OperatorLiteral | SpaceLiteral | TextLiteral;
export type Node = Sentence | Term | FencedGroup | MatrixGroup | UnaryOperation | BinaryOperation | TernaryOperation | MultiScripts | Literal;
//# sourceMappingURL=index.d.ts.map