2
0
Files
bot/packages/schemas/features/blocks/bubbles/schema.ts
Baptiste Arnaud 35300eaf34 ♻️ Introduce typebot v6 with events (#1013)
Closes #885
2023-11-08 15:34:16 +01:00

22 lines
654 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']