/** * **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 { Alt2 } from 'fp-ts/lib/Alt' import { Category2 } from 'fp-ts/lib/Category' import { Refinement } from 'fp-ts/lib/function' import { Functor2 } from 'fp-ts/lib/Functor' import * as TE from 'fp-ts/lib/TaskEither' import * as D from './Decoder' import * as G from './Guard' import * as K from './Kleisli' import * as S from './Schemable' /** * @category model * @since 2.2.8 */ export interface TaskDecoder extends K.Kleisli {} /** * @category DecodeError * @since 2.2.7 */ export declare type DecodeError = D.DecodeError /** * @category DecodeError * @since 2.2.7 */ export declare const error: (actual: unknown, message: string) => DecodeError /** * @category DecodeError * @since 2.2.7 */ export declare const success: (a: A) => TE.TaskEither /** * @category DecodeError * @since 2.2.7 */ export declare const failure: (actual: unknown, message: string) => TE.TaskEither /** * @category constructors * @since 2.2.7 */ export declare const fromDecoder: (decoder: D.Decoder) => TaskDecoder /** * @category constructors * @since 2.2.8 */ export declare const fromRefinement: ( refinement: Refinement, expected: string ) => TaskDecoder /** * @category constructors * @since 2.2.7 */ export declare const fromGuard: (guard: G.Guard, expected: string) => TaskDecoder /** * @category constructors * @since 2.2.7 */ export declare const literal: ], L extends S.Literal = S.Literal>( ...values: A ) => TaskDecoder /** * @category primitives * @since 2.2.7 */ export declare const string: TaskDecoder /** * @category primitives * @since 2.2.7 */ export declare const number: TaskDecoder /** * @category primitives * @since 2.2.7 */ export declare const boolean: TaskDecoder /** * @category primitives * @since 2.2.7 */ export declare const UnknownArray: TaskDecoder> /** * @category primitives * @since 2.2.7 */ export declare const UnknownRecord: TaskDecoder> /** * @category combinators * @since 2.2.7 */ export declare const mapLeftWithInput: ( f: (input: I, e: DecodeError) => DecodeError ) => (decoder: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.9 */ export declare const withMessage: ( message: (input: I, e: DecodeError) => string ) => (decoder: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const refine: ( refinement: Refinement, id: string ) => (from: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const parse: ( parser: (a: A) => TE.TaskEither ) => (from: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const nullable: (or: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.15 */ export declare const fromStruct:

>>( properties: P ) => TaskDecoder< { [K in keyof P]: K.InputOf<'TaskEither', P[K]> }, { [K_1 in keyof P]: K.TypeOf<'TaskEither', P[K_1]> } > /** * Use `fromStruct` instead. * * @category combinators * @since 2.2.8 * @deprecated */ export declare const fromType:

>>( properties: P ) => TaskDecoder< Partial<{ [K in keyof P]: K.InputOf<'TaskEither', P[K]> }>, Partial<{ [K_1 in keyof P]: K.TypeOf<'TaskEither', P[K_1]> }> > /** * @category combinators * @since 2.2.7 */ export declare const partial: ( properties: { [K in keyof A]: TaskDecoder } ) => TaskDecoder> /** * @category combinators * @since 2.2.8 */ export declare const fromArray: (item: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const array: (item: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.8 */ export declare const fromRecord: ( codomain: TaskDecoder ) => TaskDecoder, Record> /** * @category combinators * @since 2.2.7 */ export declare const record: (codomain: TaskDecoder) => TaskDecoder> /** * @category combinators * @since 2.2.8 */ export declare const fromTuple: []>( ...components: C ) => TaskDecoder< { [K in keyof C]: K.InputOf<'TaskEither', C[K]> }, { [K_1 in keyof C]: K.TypeOf<'TaskEither', C[K_1]> } > /** * @category combinators * @since 2.2.7 */ export declare const tuple: ( ...components: { [K in keyof A]: TaskDecoder } ) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const union: , ...Array>]>( ...members: MS ) => TaskDecoder, TypeOf> /** * @category combinators * @since 2.2.7 */ export declare const intersect: ( right: TaskDecoder ) => (left: TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.8 */ export declare const fromSum: ( tag: T ) => >>( members: MS ) => TaskDecoder, K.TypeOf<'TaskEither', MS[keyof MS]>> /** * @category combinators * @since 2.2.7 */ export declare const sum: ( tag: T ) => (members: { [K in keyof A]: TaskDecoder> }) => TaskDecoder /** * @category combinators * @since 2.2.7 */ export declare const lazy: (id: string, f: () => TaskDecoder) => TaskDecoder /** * @category combinators * @since 2.2.15 */ export declare const readonly: (decoder: TaskDecoder) => TaskDecoder> /** * @category Functor * @since 2.2.7 */ export declare const map: (f: (a: A) => B) => (fa: TaskDecoder) => TaskDecoder /** * @category Alt * @since 2.2.7 */ export declare const alt: (that: () => TaskDecoder) => (me: TaskDecoder) => TaskDecoder /** * @category Semigroupoid * @since 2.2.8 */ export declare const compose: (to: TaskDecoder) => (from: TaskDecoder) => TaskDecoder /** * @category Category * @since 2.2.8 */ export declare const id: () => TaskDecoder /** * @category instances * @since 2.2.7 */ export declare const URI = 'io-ts/TaskDecoder' /** * @category instances * @since 2.2.7 */ export declare type URI = typeof URI declare module 'fp-ts/lib/HKT' { interface URItoKind2 { readonly [URI]: TaskDecoder } } /** * @category instances * @since 2.2.8 */ export declare const Functor: Functor2 /** * @category instances * @since 2.2.8 */ export declare const Alt: Alt2 /** * @category instances * @since 2.2.8 */ export declare const Category: Category2 /** * @category instances * @since 2.2.8 */ export declare const Schemable: S.Schemable2C /** * @category instances * @since 2.2.8 */ export declare const WithUnknownContainers: S.WithUnknownContainers2C /** * @category instances * @since 2.2.8 */ export declare const WithUnion: S.WithUnion2C /** * @category instances * @since 2.2.8 */ export declare const WithRefine: S.WithRefine2C /** * @since 2.2.7 */ export declare type TypeOf = K.TypeOf /** * @since 2.2.8 */ export declare type InputOf = K.InputOf /** * @since 2.2.7 */ export declare const draw: (e: DecodeError) => string

>>( properties: P ) => TaskDecoder< { [K in keyof P]: K.InputOf<'TaskEither', P[K]> }, { [K_1 in keyof P]: K.TypeOf<'TaskEither', P[K_1]> } > /** * @category combinators * @since 2.2.15 */ export declare const struct: ( properties: { [K in keyof A]: TaskDecoder } ) => TaskDecoder /** * Use `struct` instead. * * @category combinators * @since 2.2.7 * @deprecated */ export declare const type: ( properties: { [K in keyof A]: TaskDecoder } ) => TaskDecoder /** * @category combinators * @since 2.2.8 */ export declare const fromPartial: