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

x/valibot/src/methods/getDefault/getDefault.ts>InferDefault

The modular and type safe schema library for validating structural data 🤖
Latest
type alias InferDefault
import { type InferDefault } from "https://deno.land/x/valibot@v1.0.0-beta.7/src/methods/getDefault/getDefault.ts";

Infer default type.

Type Parameters

TSchema extends
| BaseSchema<unknown, unknown, BaseIssue<unknown>>
| BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>
| NullableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| UndefinedableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| UndefinedableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
definition: TSchema extends
| NullableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| NullableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| UndefinedableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
| UndefinedableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TDefault>
? [TDefault] extends [never] ? undefined : TDefault extends () => MaybePromise<InferInput<TSchema>> ? ReturnType<TDefault> : TDefault : undefined