defineConfig
defineConfig is the second item in the array returned by setupForm.
defineConfig is used throughout this documentation, but since setupForm() returns an array, you can name it anything.
defineConfig for nested structures
For flat form structures, <Form<TModel>> is enough as types flow naturally from Form<TModel> into the configuration. With nested structures, however:
You have two options: use dot notation keys — account.username — or use defineConfig if you prefer your config to mirror the shape of your data model, which is typically the case when using the built-in section type.
defineConfig for reusable configuration
Another common use case for defineConfig is to define configurations once and import them wherever needed, while still preserving the same field mapping and typing rules.
defineDynamicConfig for configs built from data
Added in v0.14.
A config is plain data except for functions (visible, validate, …), so it can be generated at runtime — for instance from field metadata stored in a database. Such configs can't satisfy the compile-time checks of defineConfig (the type is just a string, props are unknown). Use defineDynamicConfig instead: it accepts a loosely typed object and returns a config <Form> accepts.
rules.pattern accepts a string ("^\\d+$" or "/^abc$/i"), so validation can be stored as data too. Unknown types are not caught at compile time; they throw at render time like any unmapped type.

