Add the relationships to the type level.
This commit is contained in:
parent
0d2cfd3002
commit
195a421163
@ -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;
|
|
||||||
|
@ -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;
|
|
||||||
|
@ -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
10
app/src/models/user.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import type { Channel } from "@slovo/models/channel";
|
||||||
|
|
||||||
|
export type User = {
|
||||||
|
email: string,
|
||||||
|
name: string,
|
||||||
|
password?: string,
|
||||||
|
|
||||||
|
channel?: Channel
|
||||||
|
};
|
||||||
|
|
@ -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/*" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user