From 72dd02adae0210c6c9a9fc50689e4e243b52d249 Mon Sep 17 00:00:00 2001 From: Caroline Paulic Date: Tue, 31 Aug 2021 18:45:38 -0700 Subject: [PATCH 1/2] Added type definitions for Entity and BoundingBox --- ui/src/data/types.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ui/src/data/types.ts diff --git a/ui/src/data/types.ts b/ui/src/data/types.ts new file mode 100644 index 00000000..03031454 --- /dev/null +++ b/ui/src/data/types.ts @@ -0,0 +1,23 @@ +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; + }; +}; From 61ca89ee44ced93db1eb0924252d23e1f31ecaa3 Mon Sep 17 00:00:00 2001 From: Caroline Paulic Date: Tue, 31 Aug 2021 19:04:13 -0700 Subject: [PATCH 2/2] Added type definition for Mention, SymbolData, and PaperData --- ui/src/data/types.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/src/data/types.ts b/ui/src/data/types.ts index 03031454..10d8036f 100644 --- a/ui/src/data/types.ts +++ b/ui/src/data/types.ts @@ -21,3 +21,24 @@ export type Entity = { boundingBoxes: Array; }; }; + +// TODO: uncomment this once other types are merged in +// export type Mention = Citation | Equation | Symbol | Term; +export type Mention = Entity; + +export type SymbolData = { + label: string; + definingFormulaEquations: Array; + definingFormulas: Array; + definitionSentences: Array; + definitionTexs: Array; + definitions: Array; + snippets: Array; + snippetSentences: Array; + sources: Array; +}; + +export type PaperData = { + entities: Array; + sharedSymbolData: Array; +};