import * as E from 'fp-ts/es6/Either'; import { Refinement } from 'fp-ts/es6/function'; import * as DE from './DecodeError'; import * as FS from './FreeSemigroup'; import * as K from './Kleisli'; import { Literal } from './Schemable'; /** * @category model * @since 2.2.7 */ export interface KleisliDecoder extends K.Kleisli { } /** * @category DecodeError * @since 2.2.7 */ export declare type DecodeError = FS.FreeSemigroup>; /** * @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) => E.Either; /** * @category DecodeError * @since 2.2.7 */ export declare const failure: (actual: unknown, message: string) => E.Either>, A>; /** * @category constructors * @since 2.2.7 */ export declare const fromRefinement: (refinement: Refinement, expected: string) => KleisliDecoder; /** * @category constructors * @since 2.2.7 */ export declare const literal: ]>(...values: A) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const mapLeftWithInput: (f: (input: I, e: DecodeError) => DecodeError) => (decoder: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const refine: (refinement: (a: A) => a is B, id: string) => (from: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const parse: (parser: (a: A) => E.Either) => (from: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const nullable: (or: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const type:

>>(properties: P) => KleisliDecoder<{ [K in keyof P]: K.InputOf<"Either", P[K]>; }, { [K_1 in keyof P]: K.TypeOf<"Either", P[K_1]>; }>; /** * @category combinators * @since 2.2.7 */ export declare const partial:

>>(properties: P) => KleisliDecoder<{ [K in keyof P]: K.InputOf<"Either", P[K]>; }, Partial<{ [K_1 in keyof P]: K.TypeOf<"Either", P[K_1]>; }>>; /** * @category combinators * @since 2.2.7 */ export declare const array: (items: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const record: (codomain: KleisliDecoder) => KleisliDecoder, Record>; /** * @category combinators * @since 2.2.7 */ export declare const tuple: []>(...components: C) => KleisliDecoder<{ [K in keyof C]: K.InputOf<"Either", C[K]>; }, { [K_1 in keyof C]: K.TypeOf<"Either", C[K_1]>; }>; /** * @category combinators * @since 2.2.7 */ export declare const union: , ...Array>]>(...members: MS) => KleisliDecoder, TypeOf>; /** * @category combinators * @since 2.2.7 */ export declare const intersect: (right: KleisliDecoder) => (left: KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const sum: (tag: T) => >>(members: MS) => KleisliDecoder, K.TypeOf<"Either", MS[keyof MS]>>; /** * @category combinators * @since 2.2.7 */ export declare const lazy: (id: string, f: () => KleisliDecoder) => KleisliDecoder; /** * @category combinators * @since 2.2.7 */ export declare const compose: (to: KleisliDecoder) => (from: KleisliDecoder) => KleisliDecoder; /** * @category Functor * @since 2.2.7 */ export declare const map: (f: (a: A) => B) => (fa: KleisliDecoder) => KleisliDecoder; /** * @category Alt * @since 2.2.7 */ export declare const alt: (that: () => KleisliDecoder) => (me: KleisliDecoder) => KleisliDecoder; /** * @since 2.2.7 */ export declare type TypeOf = K.TypeOf; /** * @since 2.2.7 */ export declare type InputOf = K.InputOf;