import { type Bind, type TypeLambda } from 'sts:hkt';
import { DecodeFailure, type DecodeMode, type Decoder, type UrlLike } from 'sts:decode';
import { booleanEncoder as booleanEncoderValue, contramap as contramapEncoder, type EncodeFailure, type Encoder, type EncodeMode, numberEncoder as numberEncoderValue, stringEncoder as stringEncoderValue } from 'sts:encode';
import type { Invariant } from 'sts:typeclasses';
import type { JsonArray, JsonObject, JsonValue } from 'sts:json';
export type { EncodeFailure, Encoder } from 'sts:encode';
export { booleanEncoderValue as booleanEncoder, contramapEncoder as contramap, numberEncoderValue as numberEncoder, stringEncoderValue as stringEncoder, };
export type Codec<T, TEncoded = unknown, DE = DecodeFailure, EE = EncodeFailure, DM extends DecodeMode = 'sync', EM extends EncodeMode = 'sync'> = Decoder<T, DE, DM> & Encoder<T, TEncoded, EE, EM>;
export interface CodecF extends TypeLambda {
    readonly type: Codec<this['Args'][3], this['Args'][2], this['Args'][1], this['Args'][0]>;
}
// #[effects(add: [mut])]
export declare function codec<T, TEncoded, DE, EE, DM extends DecodeMode = 'sync', EM extends EncodeMode = 'sync'>(decoder: Decoder<T, DE, DM>, encoder: Encoder<T, TEncoded, EE, EM>): Codec<T, TEncoded, DE, EE, DM, EM>;
// #[effects(add: [mut], unknown: [direct])]
export declare function imap<A, B, TEncoded, DE, EE, DM extends DecodeMode = 'sync', EM extends EncodeMode = 'sync'>(base: Codec<A, TEncoded, DE, EE, DM, EM>, decodeMap: (value: A) => B, encodeMap: (value: B) => A): Codec<B, TEncoded, DE, EE, DM, EM>;
// #[effects(add: [mut], unknown: [direct])]
export declare function mapDecodeError<T, TEncoded, DE1, DE2, EE, DM extends DecodeMode = 'sync', EM extends EncodeMode = 'sync'>(base: Codec<T, TEncoded, DE1, EE, DM, EM>, project: (error: DE1) => DE2): Codec<T, TEncoded, DE2, EE, DM, EM>;
// #[effects(add: [mut], unknown: [direct])]
export declare function mapEncodeError<T, TEncoded, DE, EE1, EE2, DM extends DecodeMode = 'sync', EM extends EncodeMode = 'sync'>(base: Codec<T, TEncoded, DE, EE1, DM, EM>, project: (error: EE1) => EE2): Codec<T, TEncoded, DE, EE2, DM, EM>;
// #[effects(add: [])]
export declare function codecInvariant<TEncoded, DE = DecodeFailure, EE = EncodeFailure>(): Invariant<Bind<Bind<Bind<CodecF, [
    EE
]>, [
    DE
]>, [
    TEncoded
]>>;
export declare const stringCodec: Codec<string, string>;
export declare const numberCodec: Codec<number, number>;
export declare const booleanCodec: Codec<boolean, boolean>;
export declare const jsonValue: Codec<JsonValue, JsonValue>;
export declare const jsonObject: Codec<JsonObject, JsonObject>;
export declare const jsonArray: Codec<JsonArray, JsonArray>;
export declare const url: Codec<UrlLike, string>;
export declare const isoDate: Codec<Date, string>;
