aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/lib
diff options
context:
space:
mode:
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>;