diff --git a/library/src/types/other.ts b/library/src/types/other.ts index b0f3a42f7..75388a471 100644 --- a/library/src/types/other.ts +++ b/library/src/types/other.ts @@ -14,7 +14,7 @@ import type { Dataset } from './dataset.ts'; import type { InferInput, InferIssue } from './infer.ts'; import type { BaseIssue } from './issue.ts'; import type { BaseSchema, BaseSchemaAsync } from './schema.ts'; -import type { MaybePromise } from './utils.ts'; +import type { MaybePromise, MaybeReadonly } from './utils.ts'; /** * Error message type. @@ -38,12 +38,11 @@ export type Default< TWrapped extends BaseSchema>, TInput extends null | undefined, > = - | InferInput - | TInput + | MaybeReadonly | TInput> | (( dataset?: Dataset, config?: Config> - ) => InferInput | TInput); + ) => MaybeReadonly | TInput>); /** * Default async type. @@ -54,12 +53,11 @@ export type DefaultAsync< | BaseSchemaAsync>, TInput extends null | undefined, > = - | InferInput - | TInput + | MaybeReadonly | TInput> | (( dataset?: Dataset, config?: Config> - ) => MaybePromise | TInput>); + ) => MaybePromise | TInput>>); /** * Default value type.