diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-03 16:51:22 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-03 16:51:22 +0200 |
| commit | 83a029084f1bbfd78b7099d9bea3371d4533c6d9 (patch) | |
| tree | f99854e4cb430ccbdb725cb2e287423f80cb9791 /src/ts/types/app.ts | |
| parent | 732d0943f8041d76262222a092b014f2557085ef (diff) | |
chore: add a LegalNotice page
Diffstat (limited to 'src/ts/types/app.ts')
| -rw-r--r-- | src/ts/types/app.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ts/types/app.ts b/src/ts/types/app.ts index b09f3d5..4d9c71c 100644 --- a/src/ts/types/app.ts +++ b/src/ts/types/app.ts @@ -1,8 +1,14 @@ -export type AuthorKind = 'page' | 'comment'; +export type ContentKind = + | 'article' + | 'comment' + | 'page' + | 'project' + | 'thematic' + | 'topic'; -export type Author<T extends AuthorKind> = { +export type Author<T extends ContentKind> = { avatar?: Image; - description?: T extends 'page' ? string | undefined : never; + description?: T extends 'comment' ? never : string; name: string; website?: string; }; @@ -44,11 +50,11 @@ export type SEO = { title: string; }; -export type PageKind = 'article' | 'project' | 'thematic' | 'topic'; +export type PageKind = Exclude<ContentKind, 'comment'>; export type Meta<T extends PageKind> = { articles?: T extends 'thematic' | 'topic' ? Article[] : never; - author: Author<'page'>; + author?: T extends 'article' | 'page' ? Author<T> : never; commentsCount?: T extends 'article' ? number : never; cover?: Image; dates: Dates; |
