Skip to content

@kaiord/core


@kaiord/core / durationSchema

Variable: durationSchema

const durationSchema: ZodDiscriminatedUnion<[ZodObject<{ seconds: ZodNumber; type: ZodLiteral<"time">; }, $strip>, ZodObject<{ meters: ZodNumber; type: ZodLiteral<"distance">; }, $strip>, ZodObject<{ bpm: ZodNumber; type: ZodLiteral<"heart_rate_less_than">; }, $strip>, ZodObject<{ bpm: ZodNumber; repeatFrom: ZodNumber; type: ZodLiteral<"repeat_until_heart_rate_greater_than">; }, $strip>], "type">

Defined in: packages/core/src/domain/schemas/duration.ts:15

Zod schema for workout step duration.

Validates duration specifications using discriminated unions based on duration type. Supports time-based, distance-based, heart rate conditional, power conditional, calorie-based, and open durations.