aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/lib
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-02-28 20:45:28 +0000
committerMohamedBassem <me@mbassem.com>2024-02-28 20:45:28 +0000
commit3208dda3848ad739f54cebf44c423e2b68e85b2d (patch)
tree25602c451354a296e8779197fdd42acab7526502 /packages/web/lib
parent7096fb3941579e5c045796361745d597e03ff7fc (diff)
downloadkarakeep-3208dda3848ad739f54cebf44c423e2b68e85b2d.tar.zst
feature: Add support for storing and previewing raw notes
Diffstat (limited to 'packages/web/lib')
-rw-r--r--packages/web/lib/types/api/bookmarks.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/web/lib/types/api/bookmarks.ts b/packages/web/lib/types/api/bookmarks.ts
index 0970a7ed..9b0ae371 100644
--- a/packages/web/lib/types/api/bookmarks.ts
+++ b/packages/web/lib/types/api/bookmarks.ts
@@ -12,8 +12,15 @@ export const zBookmarkedLinkSchema = z.object({
});
export type ZBookmarkedLink = z.infer<typeof zBookmarkedLinkSchema>;
+export const zBookmarkedTextSchema = z.object({
+ type: z.literal("text"),
+ text: z.string().max(2000),
+});
+export type ZBookmarkedText = z.infer<typeof zBookmarkedTextSchema>;
+
export const zBookmarkContentSchema = z.discriminatedUnion("type", [
zBookmarkedLinkSchema,
+ zBookmarkedTextSchema,
]);
export type ZBookmarkContent = z.infer<typeof zBookmarkContentSchema>;