From 12207c30b1808a9f58ac3b4062ed32c8a492d5f4 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 12 Sep 2021 21:43:26 -0700 Subject: [PATCH] Move type definitions --- src/App.tsx | 19 ++----------------- src/dbtypes.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 src/dbtypes.ts diff --git a/src/App.tsx b/src/App.tsx index fd2066b..e5afcec 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import React, {Component} from 'react'; import './App.scss'; import {declineSaimiar} from './saimiar_morphology'; +import {SaiEntryProps, JutEntryProps } from './dbtypes'; const backendUrl = 'https://kucinakobackend.ichigo.everydayimshuflin.com'; @@ -63,14 +64,6 @@ const Entry = (props: EntryProps) => { return
Conlang { conlang } not yet supported
; }; -interface SaiEntryProps { - id: number; - sai: string; - eng: string; - syn_category: string; - morph_type: string; -} - const SaiEntry = (props: {entry: SaiEntryProps}) => { const {entry} = props; const synCategory = entry.syn_category; @@ -89,14 +82,6 @@ const SaiEntry = (props: {entry: SaiEntryProps}) => { ); }; -interface JutEntryProps { - id: number; - jut: string; - eng: string; - syn_category: string; - gender: string; -} - const JutEntry = (props: {entry: JutEntryProps}) => { const {entry} = props; console.log(props); @@ -129,7 +114,7 @@ function formatMorphology(entry) { } interface ResultsProps { - searchResults: any; + searchResults: Array; searchTerm: string; conlang: Conlang; direction: SearchDirection; diff --git a/src/dbtypes.ts b/src/dbtypes.ts new file mode 100644 index 0000000..649d8a1 --- /dev/null +++ b/src/dbtypes.ts @@ -0,0 +1,17 @@ +interface SaiEntryProps { + id: number; + sai: string; + eng: string; + syn_category: string; + morph_type: string; +} + +interface JutEntryProps { + id: number; + jut: string; + eng: string; + syn_category: string; + gender: string; +} + +export { SaiEntryProps, JutEntryProps };