import type { StandardSchemaV1 } from '@standard-schema/spec'; /** Explicit bidirectional contract composed from two independent Standard Schemas. */ export interface Codec< EncodedInput = unknown, Application = unknown, ApplicationInput = Application, Encoded = EncodedInput, > { readonly kind: 'codec'; readonly decode: StandardSchemaV1; readonly encode: StandardSchemaV1; } /** Encoded input accepted by a codec. */ export type DecodeInput = StandardSchemaV1.InferInput; /** Application value produced by a codec. */ export type Decoded = StandardSchemaV1.InferOutput; /** Application input accepted for encoding. */ export type EncodeInput = StandardSchemaV1.InferInput; /** Encoded value produced by a codec. */ export type Encoded = StandardSchemaV1.InferOutput; /** Record of named codecs accepted by {@link object}. */ export type CodecShape = Readonly>; /** Decoded object input represented by a codec shape. */ export type ObjectDecodeInput = { readonly [Key in keyof Shape]: DecodeInput; }; /** Decoded application object represented by a codec shape. */ export type ObjectDecoded = { readonly [Key in keyof Shape]: Decoded; }; /** Application object accepted by a codec shape's encoder. */ export type ObjectEncodeInput = { readonly [Key in keyof Shape]: EncodeInput; }; /** Encoded object represented by a codec shape. */ export type ObjectEncoded = { readonly [Key in keyof Shape]: Encoded; };