Add the relationships to the type level.

This commit is contained in:
Dave Smith-Hayes 2024-04-01 21:26:33 -04:00
parent 0d2cfd3002
commit 195a421163
5 changed files with 28 additions and 9 deletions

View File

@ -1,4 +1,7 @@
type Channel = { import type { Episode } from "@slovo/models/episode";
import type { Image } from "@slobo/models/image";
export type Channel = {
name: string, name: string,
description: string, description: string,
link: URL, link: URL,
@ -6,6 +9,8 @@ type Channel = {
copyright: string, copyright: string,
explicit: boolean, explicit: boolean,
category: string, category: string,
episodes?: Set<Episode>,
image?: Image
}; };
export default Channel;

View File

@ -1,9 +1,12 @@
type Episode = { import type { Image } from "@slovo/models/image";
export type Episode = {
title: string, title: string,
link: URL, link: URL,
duration: string, duration: string,
description: string, description: string,
explicit: boolean explicit: boolean,
image?: Image,
}; };
export default Episode;

View File

@ -1,8 +1,6 @@
type Image = { export type Image = {
url: URL, url: URL,
title: string, title: string,
width: number, width: number,
height: number, height: number,
}; };
export default Image;

10
app/src/models/user.ts Normal file
View File

@ -0,0 +1,10 @@
import type { Channel } from "@slovo/models/channel";
export type User = {
email: string,
name: string,
password?: string,
channel?: Channel
};

View File

@ -22,6 +22,9 @@
// Some stricter flags (disabled by default) // Some stricter flags (disabled by default)
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false "noPropertyAccessFromIndexSignature": false,
"paths": {
"@slovo/*": [ "./src/*" ]
}
} }
} }