@kaiord/core / durationSchema
Variable: durationSchema
constdurationSchema: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:21
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.
repeatFrom (on the repeat_until_* variants) is a 0-based step index, not a repeat count: execution jumps back to the step at that index and repeats the steps from there up to the current one until the variant's condition is met (elapsed time, distance, calories, or the HR/power threshold crossing).