/** * **This module is experimental** * * Experimental features are published in order to get early feedback from the community, see these tracking * [issues](https://github.com/gcanti/io-ts/issues?q=label%3Av2.2+) for further discussions and enhancements. * * A feature tagged as _Experimental_ is in a high state of flux, you're at risk of it changing without notice. * * @since 2.2.7 */ import { Semigroup } from 'fp-ts/lib/Semigroup' import * as FS from './FreeSemigroup' /** * @category model * @since 2.2.7 */ export interface Leaf { readonly _tag: 'Leaf' readonly actual: unknown readonly error: E } /** * @category model * @since 2.2.7 */ export declare const required: 'required' /** * @category model * @since 2.2.7 */ export declare const optional: 'optional' /** * @category model * @since 2.2.7 */ export declare type Kind = 'required' | 'optional' /** * @category model * @since 2.2.7 */ export interface Key { readonly _tag: 'Key' readonly key: string readonly kind: Kind readonly errors: FS.FreeSemigroup> } /** * @category model * @since 2.2.7 */ export interface Index { readonly _tag: 'Index' readonly index: number readonly kind: Kind readonly errors: FS.FreeSemigroup> } /** * @category model * @since 2.2.7 */ export interface Member { readonly _tag: 'Member' readonly index: number readonly errors: FS.FreeSemigroup> } /** * @category model * @since 2.2.7 */ export interface Lazy { readonly _tag: 'Lazy' readonly id: string readonly errors: FS.FreeSemigroup> } /** * @category model * @since 2.2.9 */ export interface Wrap { readonly _tag: 'Wrap' readonly error: E readonly errors: FS.FreeSemigroup> } /** * @category model * @since 2.2.7 */ export declare type DecodeError = Leaf | Key | Index | Member | Lazy | Wrap /** * @category constructors * @since 2.2.7 */ export declare const leaf: (actual: unknown, error: E) => DecodeError /** * @category constructors * @since 2.2.7 */ export declare const key: (key: string, kind: Kind, errors: FS.FreeSemigroup>) => DecodeError /** * @category constructors * @since 2.2.7 */ export declare const index: (index: number, kind: Kind, errors: FS.FreeSemigroup>) => DecodeError /** * @category constructors * @since 2.2.7 */ export declare const member: (index: number, errors: FS.FreeSemigroup>) => DecodeError /** * @category constructors * @since 2.2.7 */ export declare const lazy: (id: string, errors: FS.FreeSemigroup>) => DecodeError /** * @category constructors * @since 2.2.9 */ export declare const wrap: (error: E, errors: FS.FreeSemigroup>) => DecodeError /** * @category destructors * @since 2.2.7 */ export declare const fold: (patterns: { Leaf: (input: unknown, error: E) => R Key: (key: string, kind: Kind, errors: FS.FreeSemigroup>) => R Index: (index: number, kind: Kind, errors: FS.FreeSemigroup>) => R Member: (index: number, errors: FS.FreeSemigroup>) => R Lazy: (id: string, errors: FS.FreeSemigroup>) => R Wrap: (error: E, errors: FS.FreeSemigroup>) => R }) => (e: DecodeError) => R /** * @category instances * @since 2.2.7 */ export declare function getSemigroup(): Semigroup>>