From 7ffc6cbad6b1fd37d7a261431ee2f9a597974408 Mon Sep 17 00:00:00 2001 From: achmad Date: Thu, 28 May 2026 22:25:27 +0700 Subject: [PATCH] feat: TypeScript types for Directus collections --- lib/types.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/types.ts diff --git a/lib/types.ts b/lib/types.ts new file mode 100644 index 0000000..f31c159 --- /dev/null +++ b/lib/types.ts @@ -0,0 +1,41 @@ +export type ArticleStatus = 'published' | 'draft' + +export interface Category { + id: string + name: string + slug: string + description: string | null +} + +export interface Tag { + id: string + name: string + slug: string +} + +export interface ArticleTag { + tags_id: Tag +} + +export interface Article { + id: string + title: string + slug: string + status: ArticleStatus + content: string | null + excerpt: string | null + featured_image: string | null + published_at: string | null + is_featured: boolean + seo_title: string | null + seo_description: string | null + category: Category + tags: ArticleTag[] +} + +export interface SiteSettings { + id: string + site_name: string + hero_article: Article | null + nav_categories: Category[] +}