This repository has been archived on 2022-12-21. You can view files and clone it, but cannot push or open issues or pull requests.
ddm/hw02/Papers.ts

68 lines
1.8 KiB
TypeScript

type ID = string;
type UInt = number;
// each interface is a mongodb collection
type Section = { title: string, content: Content[] }
type Content = Section | string /* text */ | { reference: number } /* bib reference */ | { label: string } /* figure reference */
interface Paper {
_id: ID,
title: string,
abstract: string,
authors: [{ // attributes here reflect the data found when the paper was published
affiliation: string, // university of blah
email: string | null,
name: string,
authorId: ID
}],
keywords: string[],
publicationDetails: {
journalRef: ID,
journal: string, // "Journal of AI"
volume: string, // "Spring 2020 edition"
number: string // reference for this paper in the volume
date: Date,
pages: { // pages in the volume where this paper is
start: number,
end: number
} // [0, 1]
},
content: Section[],
figures: [{
page: number // page number where the figure is placed
label: string,
caption: string,
imageURL?: string // some figures are tables, not in the scope of this assignment to model a table
}],
references: [{
referenceNumber: number,
paperId?: ID, // optional
title: string,
authors: [{
name: string,
authorId?: ID //optional
}], // list of author names
journal: string,
journalId?: ID,
volume: string,
number: string
}]
}
interface Author { // author data here reflects the most up to date info in the author
_id: ID,
name: string,
email: string,
affiliation: string,
bio: string
}
interface Journal {
_id: ID,
name: string,
volumes: [{
name: string,
papers: ID[] // references to papers in volumes
}]
}