2
0
Files
bot/packages/models/features/blocks/bubbles/image.ts

20 lines
572 B
TypeScript
Raw Normal View History

import { z } from 'zod'
import { blockBaseSchema } from '../baseSchemas'
import { BubbleBlockType } from './enums'
export const imageBubbleContentSchema = z.object({
url: z.string().optional(),
})
2022-06-11 07:27:38 +02:00
export const imageBubbleBlockSchema = blockBaseSchema.and(
z.object({
2022-06-11 07:27:38 +02:00
type: z.enum([BubbleBlockType.IMAGE]),
content: imageBubbleContentSchema,
})
)
export const defaultImageBubbleContent: ImageBubbleContent = {}
2022-06-11 07:27:38 +02:00
export type ImageBubbleBlock = z.infer<typeof imageBubbleBlockSchema>
export type ImageBubbleContent = z.infer<typeof imageBubbleContentSchema>