defineConfig function is a type inference helper that provides TypeScript intellisense and validation for your Saykit configuration file.
Signature
Your Saykit configuration object
The same configuration object, with full type inference
Purpose
This function is a pass-through identity function that exists solely to provide TypeScript type inference. It:- Returns the exact same object you pass in
- Provides autocomplete for configuration options
- Validates your configuration against the Saykit schema
- Helps catch configuration errors at development time
defineConfig uses Zod’s input type to validate the configuration schema. This ensures your config matches the expected structure.Usage
UsedefineConfig in your saykit.config.ts file to get full TypeScript support:
saykit.config.ts
Benefits
1. Autocomplete
Your editor will suggest valid configuration options as you type:2. Type Safety
Invalid configurations are caught immediately:3. Documentation
Hover over any property to see inline documentation:Without defineConfig
You can still export a plain object, but you’ll lose type checking and autocomplete:Related
- Configuration Guide - Complete configuration reference
- Project Setup - Initial project configuration
- Say Class - Runtime API for translations