2
0
Files
bot/packages/schemas/features/blocks/bubbles/schema.ts
2023-12-22 09:13:53 +01:00

22 lines
663 B
TypeScript

import { z } from '../../../zod'
import { audioBubbleBlockSchema } from './audio'
import { embedBubbleBlockSchema } from './embed'
import { imageBubbleBlockSchema } from './image'
import { textBubbleBlockSchema } from './text'
import { videoBubbleBlockSchema } from './video'
export const bubbleBlockSchemas = [
textBubbleBlockSchema,
imageBubbleBlockSchema,
videoBubbleBlockSchema,
embedBubbleBlockSchema,
audioBubbleBlockSchema,
] as const
export const bubbleBlockSchema = z.discriminatedUnion('type', [
...bubbleBlockSchemas,
])
export type BubbleBlock = z.infer<typeof bubbleBlockSchema>
export type BubbleBlockContent = BubbleBlock['content']