Files
radicle-explorer/httpd-client/lib/project/comment.ts
T
Sebastian Martinez 5e5f7fc12f Add editing to issue/patch descriptions, comments and replies
Also does some refactoring for `action`, `editable` and other variables
we were using which weren't very clear

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-26 16:27:54 +02:00

16 lines
517 B
TypeScript

import type { z } from "zod";
import { array, number, object, string, tuple } from "zod";
export type Comment = z.infer<typeof commentSchema>;
export type Embed = z.infer<typeof commentSchema>["embeds"][0];
export const commentSchema = object({
id: string(),
author: object({ id: string(), alias: string().optional() }),
body: string(),
embeds: array(object({ name: string(), content: string() })),
reactions: array(tuple([string(), string()])),
timestamp: number(),
replyTo: string().nullable(),
});