mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-31 01:00:47 +08:00
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>
16 lines
517 B
TypeScript
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(),
|
|
});
|