← effect
Schema320
Constructors
ArrayconstArrayEnsurefunctionCreates a schema that accepts either a value decoded by schema or an array decoded by Schema.Array(schema), then returns an array.asClassfunctionTransforms a schema into a class that can be extended with extends.declarefunctionCreates a schema for a non-parametric opaque type using a type-guard function.declareConstructorfunctionCreates a schema for a parametric type (a generic container such as Array<A>, Option<A>, etc.) by accepting a list of type-parameter schemas and a decoder factory.DefectfunctionSchema for unexpected defect values represented as unknown with a JSON encoded form.EnumfunctionCreates a schema from a TypeScript enum object.ErrorfunctionSchema for JavaScript Error objects.ErrorClassconstCreates a schema-backed error class that can be used as a typed, yieldable error in Effect programs.fromJsonStringfunctionReturns a schema that decodes a JSON string and then decodes the parsed value using the given schema.instanceOffunctionCreates a schema that validates values using instanceof.LiteralfunctionCreates a schema for a single literal value (string, number, bigint, boolean, or null).LiteralsfunctionCreates a union schema from an array of literal values.makeconstCreates a schema from an AST (Abstract Syntax Tree) node.makeFilterconstCreates a custom validation filter from a predicate function.makeFilterGroupfunctionGroups multiple checks into a single SchemaAST.FilterGroup, applying optional shared annotations to the group as a whole.OpaquefunctionWraps a struct schema so that its decoded Type becomes a nominally distinct type Self.RecordfunctionDefines a record schema whose dynamic properties are selected by a key schema and decoded with a value schema.StructfunctionDefines a struct schema from a map of field schemas.StructWithRestfunctionExtends a struct schema with one or more record (index-signature) schemas, producing a schema whose decoded type intersects the struct and all records.suspendfunctionCreates a suspended schema that defers evaluation until needed.tagfunctionCombines a Literal schema with withConstructorDefault, making it ideal for discriminator fields in tagged unions.tagDefaultOmitfunctionCreates a literal _tag schema that is omitted from encoded output.TaggedClassconstDefines a schema-backed class with an automatically populated _tag field.TaggedErrorClassconstDefines a schema-backed yieldable error class with an automatically populated _tag field.TaggedStructfunctionCreates a struct schema with an automatically populated _tag field.TaggedUnionfunctionBuilds a discriminated union from a record of field sets, one per variant.TemplateLiteralfunctionCreates a schema that validates strings by matching ordered template literal parts.TemplateLiteralParserfunctionSchema for parsing matched template literal strings into typed tuple parts.TuplefunctionDefines a fixed-length tuple schema from an array of element schemas.TupleWithRestfunctionExtends a fixed-length tuple schema with a variadic rest segment.UnionfunctionCreates a union schema from an array of member schemas.UniqueArrayfunctionReturns a new array schema that ensures all elements are unique.UniqueSymbolfunctionCreates a schema for a specific symbol.withConstructorDefaultfunctionAttaches a constructor default value to a schema field.Models
$ArrayinterfaceType-level representation returned by Array.$RecordinterfaceType-level representation returned by Record.AnyinterfaceType-level representation of Any.BigIntinterfaceType-level representation of BigInt.BooleaninterfaceType-level representation of Boolean.BottominterfaceThe fully-parameterized base interface for all schemas.ClassinterfaceType-level representation returned by Class.CodecinterfaceNamespace of type-level helpers for Codec.ConstraintinterfaceLightweight structural constraint for APIs that accept schema values but only read their data and type-level views.ConstraintCodecinterfaceLightweight structural constraint for APIs that need codec type views but do not need the full schema protocol.ConstraintDecoderinterfaceLightweight structural constraint for APIs that need decoder type views but do not need the full schema protocol.ConstraintEncoderinterfaceLightweight structural constraint for APIs that need encoder type views but do not need the full schema protocol.ConstraintRebuildableinterfaceLightweight structural constraint for APIs that need schema views and the rebuilt schema type, but do not call the full schema protocol.ConstructorDefaulttypeWhether a schema field has a constructor default value.DecoderinterfaceA schema that tracks the decoded type T and the Effect services required during decoding (RD).EncoderinterfaceA schema that tracks the encoded type E and the Effect services required during encoding (RE).FilterIssuetypeA single failure reported by a filter predicate.FilterOutputtypeThe value a filter predicate (see makeFilter) may return.JsontypeRecursive TypeScript type for any valid immutable JSON value: null, number, boolean, string, a readonly array of Json values, or a readonly record of string → Json.JsonArrayinterfaceA readonly array of Json values.JsonObjectinterfaceA readonly record whose values are Json values.MutabilitytypeWhether a schema field is readonly or mutable within a struct.MutableJsontypeRecursive TypeScript type for mutable JSON values: null, number, boolean, string, mutable arrays, or mutable string-keyed records.MutableJsonArrayinterfaceA mutable array of MutableJson values.MutableJsonObjectinterfaceA mutable record whose values are MutableJson values.mutableKeyinterfaceType-level representation returned by mutableKey.NeverinterfaceType-level representation of Never.NonEmptyArrayinterfaceType-level representation returned by NonEmptyArray.NullinterfaceType-level representation of Null.NullishOrinterfaceType-level representation returned by NullishOr.NullOrinterfaceType-level representation returned by NullOr.NumberinterfaceType-level representation of Number.ObjectKeywordinterfaceType-level representation of ObjectKeyword.OpticinterfaceA schema that additionally supports optic (lens/prism) operations.optionalinterfaceType-level representation returned by optional.OptionalitytypeWhether a schema field is required or optional within a struct.optionalKeyinterfaceType-level representation returned by optionalKey.SchemainterfaceNamespace of type-level helpers for Schema.StringinterfaceType-level representation of String.SymbolinterfaceType-level representation of Symbol.TopinterfaceThe existential "any schema" type — all type parameters are erased to unknown.UndefinedinterfaceType-level representation of Undefined.UndefinedOrinterfaceType-level representation returned by UndefinedOr.UnknowninterfaceType-level representation of Unknown.UnknownFromJsonStringinterfaceType-level representation of UnknownFromJsonString.VoidinterfaceType-level representation of Void.WithoutConstructorDefaultinterfaceConstraint used to ensure a schema field does not already have a constructor default.Decoding
decodeEffectconstDecodes a typed input (the schema's Encoded type) against a schema, returning an Effect that succeeds with the decoded value or fails with a SchemaError.decodeExitconstDecodes a typed input (the schema's Encoded type) against a schema synchronously, returning an Exit that is either a Success with the decoded value or a Failure.decodeOptionconstDecodes a typed input (the schema's Encoded type) against a schema, returning an Option that is Some with the decoded value on success or None for schema mismatches.decodePromiseconstDecodes a typed input (the schema's Encoded type) against a schema, returning a Promise that resolves with the decoded value or rejects with a SchemaError for schema mismatches.decodeResultconstDecodes a typed input (the schema's Encoded type) against a schema, returning a Result that succeeds with the decoded value or fails with a SchemaError for schema mismatches.decodeSyncconstDecodes a typed input (the schema's Encoded type) against a schema synchronously, returning the decoded value or throwing a SchemaError for schema mismatches.decodeUnknownEffectfunctionDecodes an unknown input against a schema, returning an Effect that succeeds with the decoded value or fails with a SchemaError.decodeUnknownExitfunctionDecodes an unknown input against a schema synchronously, returning an Exit that is either a Success with the decoded value or a Failure.decodeUnknownOptionconstDecodes an unknown input against a schema, returning an Option that is Some with the decoded value on success or None for schema mismatches.decodeUnknownPromisefunctionDecodes an unknown input against a schema, returning a Promise that resolves with the decoded value or rejects with a SchemaError for schema mismatches.decodeUnknownResultfunctionDecodes an unknown input against a schema, returning a Result that succeeds with the decoded value or fails with a SchemaError for schema mismatches.decodeUnknownSyncfunctionDecodes an unknown input against a schema synchronously, returning the decoded value or throwing a SchemaError for schema mismatches.fromFormDatafunctionSchema for decoding FormData through a bracket-notation tree.fromURLSearchParamsfunctionSchema for decoding URLSearchParams through a bracket-notation tree.middlewareDecodingfunctionIntercepts the decoding pipeline of a schema.withDecodingDefaultfunctionWraps the Encoded side with optional (key absent or undefined) and provides a default Encoded value when the field is missing or undefined during decoding.withDecodingDefaultKeyfunctionMakes a struct key optional on the Encoded side and provides a default Encoded value when the key is missing during decoding.withDecodingDefaultTypefunctionWraps the Encoded side with optional (key absent or undefined) and provides a default Type value when the field is missing or undefined during decoding.withDecodingDefaultTypeKeyfunctionMakes a struct key optional on the Encoded side (optionalKey, so the key may be absent but not undefined) and provides a default Type value when the key is missing during decoding.Encoding
encodeEffectconstEncodes a typed input (the schema's Type) against a schema, returning an Effect that succeeds with the encoded value or fails with a SchemaError.encodeExitconstEncodes a typed input (the schema's Type) against a schema synchronously, returning an Exit that is either a Success with the encoded value or a Failure.encodeOptionconstEncodes a typed input (the schema's Type) against a schema, returning an Option that is Some with the encoded value on success or None for schema mismatches.encodePromiseconstEncodes a typed input (the schema's Type) against a schema, returning a Promise that resolves with the encoded value or rejects with a SchemaError for schema mismatches.encodeResultconstEncodes a typed input (the schema's Type) against a schema, returning a Result that succeeds with the encoded value or fails with a SchemaError for schema mismatches.encodeSyncconstEncodes a typed input (the schema's Type) against a schema synchronously, throwing a SchemaError for schema mismatches.encodeUnknownEffectfunctionEncodes an unknown input against a schema, returning an Effect that succeeds with the encoded value or fails with a SchemaError.encodeUnknownExitfunctionEncodes an unknown input against a schema synchronously, returning an Exit that is either a Success with the encoded value or a Failure.encodeUnknownOptionconstEncodes an unknown input against a schema, returning an Option that is Some with the encoded value on success or None for schema mismatches.encodeUnknownPromisefunctionEncodes an unknown input against a schema, returning a Promise that resolves with the encoded value or rejects with a SchemaError for schema mismatches.encodeUnknownResultfunctionEncodes an unknown input against a schema, returning a Result that succeeds with the encoded value or fails with a SchemaError for schema mismatches.encodeUnknownSyncfunctionEncodes an unknown input against a schema synchronously, throwing a SchemaError for schema mismatches.middlewareEncodingfunctionIntercepts the encoding pipeline of a schema.