From 4ea0d443f93d6c0cca94b799a28234488796eebb Mon Sep 17 00:00:00 2001 From: qowevisa Date: Mon, 11 Nov 2024 22:30:03 +0200 Subject: [PATCH] Add Category interface to $lib/entities.ts --- src/lib/entities.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/entities.ts b/src/lib/entities.ts index c3d583d..6e238c9 100644 --- a/src/lib/entities.ts +++ b/src/lib/entities.ts @@ -20,13 +20,24 @@ export interface Card { name: string; } +export interface Category { + id: number; + name: string; + parent_id: number; +} + export const EntityTypes = { card: "Card", - type: "Type" + type: "Type", + category: "Category", } as const; export type EntityName = keyof typeof EntityTypes; -export type EntityType = T extends "card" ? Card : Type; +export type EntityType = + T extends "card" ? Card : + T extends "type" ? Type : + T extends "category" ? Category : + never; // // }}}