Files
suaveplan/packages/media/audio/audio-transport/src/scheduler/scheduler.schemas.md
2026-05-27 23:47:53 +01:00

868 B

TransportSchedulerOptionsSchema

Zod boundary schema for TransportScheduler construction options.

Purpose

Validates the options passed when constructing a TransportScheduler.

Features

  • Requires transport (any — runtime-validated)
  • Requires clock as a function returning number
  • Optional pollIntervalMs as positive number

Usage

import { TransportSchedulerOptionsSchema } from "@suaveplan/audio-transport";

const parsed = TransportSchedulerOptionsSchema.safeParse({
    transport: myTransport,
    clock: () => Date.now() / 1000,
});

API Reference

  • TransportSchedulerOptionsSchema — z.object({ transport, clock, pollIntervalMs })

Implementation Notes

transport is typed as z.any() because Zod cannot express the Transport class type at schema level. The constructor performs the actual instance check.