type Schema<any, any, string, any>
A schema of any types, for code that holds or reads one without typing its output.
Every schema assigns to it, and to a bare Schema, which types what a
run is given and returns as unknown where this types them any.
import type {AnySchema} from '@fuzdev/fuz_schema/schema.ts'; members
kind
:stringdef
:anyrun
: (value:any, ctx: SchemaContext, parent?: Record<PropertyKey, unknown>, key?: PropertyKey, entry?: 1) => anyA schema that reads parent and key declares them as plain parameters,
with no default and not as a rest: nullable, union, pipe, and
message pass them on only to a run whose length says it takes them
or to a schema of kind 'lazy', read once when each is made. A lazy
passes on the object and the key it is called with.
value
:anythe value to validate
ctx
: SchemaContextthe state of the parse, where a failure is reported with fail
parent
?:Record<PropertyKey, unknown>the object value was read from, when an object schema is running an entry
key
?:PropertyKeythe entry's key in parent, given with it
entry
?:11 when this schema is the entry itself, as an object schema hands it and a message around it passes on, and absent where another schema passes the object and the key on
'~types'
?:{ readonly input: any; }Type-only, never set at runtime.
'~refines'
?:booleanType-only, never set at runtime. true on a SchemaRefinement, and a
boolean here, so a schema typed as one that isn't, a transform
included, is not assignable to one, and a pipe step that may be either
is typed by its own output.