2
0
Files
bot/packages/models/features/blocks/bubbles/embed.ts
2023-01-25 14:59:53 +01:00

21 lines
607 B
TypeScript

import { z } from 'zod'
import { blockBaseSchema } from '../baseSchemas'
import { BubbleBlockType } from './enums'
export const embedBubbleContentSchema = z.object({
url: z.string().optional(),
height: z.number(),
})
export const embedBubbleBlockSchema = blockBaseSchema.and(
z.object({
type: z.enum([BubbleBlockType.EMBED]),
content: embedBubbleContentSchema,
})
)
export const defaultEmbedBubbleContent: EmbedBubbleContent = { height: 400 }
export type EmbedBubbleBlock = z.infer<typeof embedBubbleBlockSchema>
export type EmbedBubbleContent = z.infer<typeof embedBubbleContentSchema>