2
0
Files
bot/packages/schemas/features/blocks/bubbles/image.ts
2023-03-15 08:35:16 +01:00

20 lines
574 B
TypeScript

import { z } from 'zod'
import { blockBaseSchema } from '../baseSchemas'
import { BubbleBlockType } from './enums'
export const imageBubbleContentSchema = z.object({
url: z.string().optional(),
})
export const imageBubbleBlockSchema = blockBaseSchema.merge(
z.object({
type: z.enum([BubbleBlockType.IMAGE]),
content: imageBubbleContentSchema,
})
)
export const defaultImageBubbleContent: ImageBubbleContent = {}
export type ImageBubbleBlock = z.infer<typeof imageBubbleBlockSchema>
export type ImageBubbleContent = z.infer<typeof imageBubbleContentSchema>