2
0
Files
bot/packages/schemas/features/blocks/logic/wait/schema.ts

18 lines
463 B
TypeScript
Raw Normal View History

2023-01-26 18:23:09 +01:00
import { z } from 'zod'
import { blockBaseSchema } from '../../shared'
import { LogicBlockType } from '../constants'
2023-01-26 18:23:09 +01:00
export const waitOptionsSchema = z.object({
secondsToWaitFor: z.string().optional(),
shouldPause: z.boolean().optional(),
2023-01-26 18:23:09 +01:00
})
export const waitBlockSchema = blockBaseSchema.merge(
2023-01-26 18:23:09 +01:00
z.object({
type: z.enum([LogicBlockType.WAIT]),
options: waitOptionsSchema.optional(),
2023-01-26 18:23:09 +01:00
})
)
export type WaitBlock = z.infer<typeof waitBlockSchema>