aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2024-12-28 12:30:24 +0000
committerMohamed Bassem <me@mbassem.com>2024-12-28 12:30:24 +0000
commit7956e9fa6772ab57a0794fb7cba7e9d9c0bd7878 (patch)
tree10d6e47afed8be007361cd40ec8b05fc52d6d4d9 /packages/shared
parent7dd5b2bc8751911f86448e6c4619b2583d9a4b53 (diff)
downloadkarakeep-7956e9fa6772ab57a0794fb7cba7e9d9c0bd7878.tar.zst
feat: Implement the all highlights page. Fixes #620
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/types/highlights.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/shared/types/highlights.ts b/packages/shared/types/highlights.ts
index 9bda6029..ff4b7e7f 100644
--- a/packages/shared/types/highlights.ts
+++ b/packages/shared/types/highlights.ts
@@ -1,5 +1,7 @@
import { z } from "zod";
+import { zCursorV2 } from "./pagination";
+
export const DEFAULT_NUM_HIGHLIGHTS_PER_PAGE = 20;
const zHighlightColorSchema = z.enum(["yellow", "red", "green", "blue"]);
@@ -31,3 +33,11 @@ export const zUpdateHighlightSchema = z.object({
highlightId: z.string(),
color: zHighlightColorSchema.optional(),
});
+
+export const zGetAllHighlightsResponseSchema = z.object({
+ highlights: z.array(zHighlightSchema),
+ nextCursor: zCursorV2.nullable(),
+});
+export type ZGetAllHighlightsResponse = z.infer<
+ typeof zGetAllHighlightsResponseSchema
+>;