Initial Commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# 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
|
||||
|
||||
```ts
|
||||
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.
|
||||
Reference in New Issue
Block a user