diff --git a/ui/src/data/types.ts b/ui/src/data/types.ts new file mode 100644 index 00000000..85ce1287 --- /dev/null +++ b/ui/src/data/types.ts @@ -0,0 +1,58 @@ +export type BoundingBox = { + page: number; + left: number; + top: number; + width: number; + height: number; +}; + +export enum ENTITY_TYPE { + CITATION, + EQUATION, + SENTENCE, + SYMBOL, + TERM, +} + +export type Entity = { + id: string; + type: ENTITY_TYPE; + attributes: { + boundingBoxes: Array; + }; +}; + +export type Reference = { + id: string; +}; + +export type Symbol = Entity & { + type: ENTITY_TYPE.SYMBOL; + attributes: { + tex: string; + type: string; + mathml: string; + matchmlNearMatches: Array; + isDefinition: boolean; + disambiguatedId: string; + nicknames: Array; + diagramLabel: string | null; + definitions: Array; + definingFormulas: Array; + passages: Array; + snippets: Array; + }; + relationships: { + equation: Reference; + children: Array; + sentence: Reference; + parent: { + id: string | null; + type: string; + }; + nicknameSentences: Array; + definitionSentences: Array; + definingFormulaEquations: Array; + snippetSentences: Array; + }; +};