Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/src/index.ts>InferDefaults

The modular and type safe schema library for validating structural data 🤖
Latest
type alias InferDefaults
Re-export
import { type InferDefaults } from "https://deno.land/x/valibot@v1.0.0-beta.1-i18n/src/index.ts";

Infer defaults type.

Type Parameters

TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>
definition: TSchema extends
| LooseObjectSchema<infer TEntries, ErrorMessage<LooseObjectIssue> | undefined>
| ObjectSchema<infer TEntries, ErrorMessage<ObjectIssue> | undefined>
| ObjectWithRestSchema<infer TEntries, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<ObjectWithRestIssue> | undefined>
| StrictObjectSchema<infer TEntries, ErrorMessage<StrictObjectIssue> | undefined>
? -readonly [TKey in keyof TEntries]: InferDefaults<TEntries[TKey]> : TSchema extends
| LooseObjectSchemaAsync<infer TEntries, ErrorMessage<LooseObjectIssue> | undefined>
| ObjectSchemaAsync<infer TEntries, ErrorMessage<ObjectIssue> | undefined>
| ObjectWithRestSchemaAsync<infer TEntries, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<ObjectWithRestIssue> | undefined>
| StrictObjectSchemaAsync<infer TEntries, ErrorMessage<StrictObjectIssue> | undefined>
? -readonly [TKey in keyof TEntries]: InferDefaults<TEntries[TKey]> : TSchema extends
| LooseTupleSchema<infer TItems, ErrorMessage<LooseTupleIssue> | undefined>
| StrictTupleSchema<infer TItems, ErrorMessage<StrictTupleIssue> | undefined>
| TupleSchema<infer TItems, ErrorMessage<TupleIssue> | undefined>
| TupleWithRestSchema<infer TItems, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<TupleWithRestIssue> | undefined>
? -readonly [TKey in keyof TItems]: InferDefaults<TItems[TKey]> : TSchema extends
| LooseTupleSchemaAsync<infer TItems, ErrorMessage<LooseTupleIssue> | undefined>
| TupleSchemaAsync<infer TItems, ErrorMessage<TupleIssue> | undefined>
| TupleWithRestSchemaAsync<infer TItems, BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<TupleWithRestIssue> | undefined>
? -readonly [TKey in keyof TItems]: InferDefaults<TItems[TKey]> : Awaited<InferDefault<TSchema>>