Move type definitions
This commit is contained in:
parent
146b8126a2
commit
12207c30b1
19
src/App.tsx
19
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 <div>Conlang { conlang } not yet supported</div>;
|
||||
};
|
||||
|
||||
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<any>;
|
||||
searchTerm: string;
|
||||
conlang: Conlang;
|
||||
direction: SearchDirection;
|
||||
|
17
src/dbtypes.ts
Normal file
17
src/dbtypes.ts
Normal file
@ -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 };
|
Loading…
Reference in New Issue
Block a user