From cd56f94876dea166746c59e355895f4136993dea Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Fri, 11 Aug 2023 19:41:42 +0330 Subject: [PATCH] refactor: update podcast types --- src/types/lpe.types.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/types/lpe.types.ts b/src/types/lpe.types.ts index 4d6a788..e64be3d 100644 --- a/src/types/lpe.types.ts +++ b/src/types/lpe.types.ts @@ -11,9 +11,9 @@ export namespace LPE { export namespace Author { export type Document = { name: string + url?: string emailAddress?: string image?: Image.Document - url?: string } } @@ -39,7 +39,13 @@ export namespace LPE { export type Toc = TocItem[] - export type ContentBlockType = 'image' | 'text' + export const ContentBlockTypes = { + Image: 'image', + Text: 'text', + } as const + + export type ContentBlockType = + (typeof ContentBlockTypes)[keyof typeof ContentBlockTypes] export const ContentBlockLabels = { Title: 'title', @@ -77,6 +83,21 @@ export namespace LPE { } export type ContentBlock = TextBlock | ImageBlock + + export type SearchResultItemData = { + id: string + url: string + slug: string + date: string + title: string + tags: string + description: string + priority: 1 | 2 | 3 + authors: Author.Document[] + coverImage?: Post.ImageBlock + + type: 'article' | 'podcast' + } } export namespace Article { @@ -134,6 +155,7 @@ export namespace LPE { title: string tags: string[] summary: string + authors: Author.Document[] publishedAt: string episodeNumber: number }