Hyperlinkv0.8.0-beta.28

Schema

Schema.Topinterfaceeffect/Schema.ts:629
Top

The existential "any schema" type — all type parameters are erased to unknown.

Details

Use Top as a constraint when writing generic utilities that must accept any schema regardless of its Type, Encoded, or service requirements. It is the widest possible schema type and therefore gives you the least static information.

In user code prefer the narrower interfaces:

  • Schema<T> — when you only care about the decoded type
  • Codec<T, E, RD, RE> — when you need the encoded type and service requirements
  • ConstraintDecoder<T, RD> — for decode-only APIs
  • ConstraintEncoder<E, RE> — for encode-only APIs
Source effect/Schema.ts:62919 lines
export interface Top extends
  Bottom<
    unknown,
    unknown,
    unknown,
    unknown,
    SchemaAST.AST,
    Top,
    unknown,
    unknown,
    any, // this is because TypeParameters is invariant
    unknown,
    Mutability,
    Optionality,
    ConstructorDefault,
    Mutability,
    Optionality
  >
{}
Referenced by 88 symbols