2022-11-17 10:33:17 +01:00
|
|
|
import { z } from 'zod'
|
2023-11-08 15:34:16 +01:00
|
|
|
import { blockBaseSchema } from '../../shared'
|
|
|
|
import { BubbleBlockType } from '../constants'
|
2022-11-17 10:33:17 +01:00
|
|
|
|
|
|
|
export const audioBubbleContentSchema = z.object({
|
|
|
|
url: z.string().optional(),
|
2023-08-07 12:20:38 +02:00
|
|
|
isAutoplayEnabled: z.boolean().optional(),
|
2022-11-17 10:33:17 +01:00
|
|
|
})
|
|
|
|
|
2023-03-14 16:42:12 +01:00
|
|
|
export const audioBubbleBlockSchema = blockBaseSchema.merge(
|
2022-11-17 10:33:17 +01:00
|
|
|
z.object({
|
|
|
|
type: z.enum([BubbleBlockType.AUDIO]),
|
2023-11-08 15:34:16 +01:00
|
|
|
content: audioBubbleContentSchema.optional(),
|
2022-11-17 10:33:17 +01:00
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
export type AudioBubbleBlock = z.infer<typeof audioBubbleBlockSchema>
|
|
|
|
export type AudioBubbleContent = z.infer<typeof audioBubbleContentSchema>
|