2
0
Files
bot/packages/schemas/features/blocks/bubbles/video/schemas.ts

25 lines
825 B
TypeScript
Raw Normal View History

import { z } from 'zod'
import { blockBaseSchema } from '../../baseSchemas'
import { BubbleBlockType } from '../enums'
import { VideoBubbleContentType } from './enums'
import { variableStringSchema } from '../../../utils'
export const videoBubbleContentSchema = z.object({
url: z.string().optional(),
id: z.string().optional(),
type: z.nativeEnum(VideoBubbleContentType).optional(),
height: z.number().or(variableStringSchema).optional(),
})
export const videoBubbleBlockSchema = blockBaseSchema.merge(
z.object({
2022-06-11 07:27:38 +02:00
type: z.enum([BubbleBlockType.VIDEO]),
content: videoBubbleContentSchema,
})
)
export const defaultVideoBubbleContent: VideoBubbleContent = {}
2022-06-11 07:27:38 +02:00
export type VideoBubbleBlock = z.infer<typeof videoBubbleBlockSchema>
export type VideoBubbleContent = z.infer<typeof videoBubbleContentSchema>