export type Interval = { start: number; end: number };export class SlotError extends Error { constructor(public readonly kind: "invalid_input") { super(kind); }}/** Returns the earliest start minute, or undefined when nothing fits. Throws SlotError. */export function findFreeSlot(busy: Interval[], dayStart: number, dayEnd: number, durationMin: number): number | undefined { // TODO}