Skip to content
1 min read · 130 words

@nhtio/adk/batteries/tts/native/validation

Runtime validation schema and wrapper for OS-native TTS adapter options.

Remarks

Validates NativeTtsAdapterOptions at construction time. Throws @nhtio/adk/batteries/tts/native!E_INVALID_NATIVE_TTS_OPTIONS on failure. Every field is optional — a zero-config new NativeTtsAdapter() is valid and auto-detects the platform — but unknown top-level keys are rejected (.unknown(false)) so typos fail loud. The seam functions (executor/fs/tmpdir/randomName/isAvailable) are accepted as bare functions (or, for fs/executor, an object whose members are functions) so unit tests can inject fakes.

Variables

VariableDescription
nativeTtsOptionsSchemaValidator schema for NativeTtsAdapterOptions. Every field is optional; unknown top-level keys are rejected. Seam functions are accepted as-is.

Functions

FunctionDescription
validateOptionsValidates an arbitrary input against nativeTtsOptionsSchema.