bigbuffet-rw/packages/pl-api/lib/entities/announcement-reaction.ts
marcin mikołajczak a6bc160caa pl-api: Do some blind search and replace
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-14 00:25:30 +02:00

15 lines
576 B
TypeScript

import * as v from 'valibot';
/** @see {@link https://docs.joinmastodon.org/entities/announcement/} */
const announcementReactionSchema = v.object({
name: v.fallback(v.string(), ''),
count: z.number().int().nonnegative().catch(0),
me: v.fallback(v.boolean(), false),
url: v.fallback(v.nullable(v.string()), null),
static_url: v.fallback(v.nullable(v.string()), null),
announcement_id: v.fallback(v.string(), ''),
});
type AnnouncementReaction = v.InferOutput<typeof announcementReactionSchema>;
export { announcementReactionSchema, type AnnouncementReaction };