From b07829e6e8b56a4120239a2e409e7f9bee40e7d6 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Thu, 23 Jun 2022 16:21:20 +0200 Subject: [PATCH] Typing --- lib/content/types.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/content/types.ts b/lib/content/types.ts index 82c4d16..a9b087d 100644 --- a/lib/content/types.ts +++ b/lib/content/types.ts @@ -1,9 +1,9 @@ -export type ContentList = (Project|Diary)[]; +export type ContentList = (Project | Diary)[]; export type ContentType = "project" | "diary"; -export interface Project { - type: "project"; +interface Content { + type: "project" | "diary"; name: string; desc: string[]; short_desc: string; @@ -11,15 +11,14 @@ export interface Project { repo?: string; } -export interface Diary { +export interface Project extends Content { + type: "project"; +} + +export interface Diary extends Content { type: "diary"; - name: string; - desc: string[]; - short_desc: string; - more?: string; - repo?: string; entries: { title: string; filename: string; }[]; -} \ No newline at end of file +}