import type { TypeLambda } from "@fp-ts/core/HKT"; import type { ReadonlyRecord } from "@fp-ts/core/ReadonlyRecord"; import * as contravariant from "@fp-ts/core/typeclass/Contravariant"; import type * as invariant from "@fp-ts/core/typeclass/Invariant"; import type { Monoid } from "@fp-ts/core/typeclass/Monoid"; import type * as product_ from "@fp-ts/core/typeclass/Product"; import type { Semigroup } from "@fp-ts/core/typeclass/Semigroup"; import type * as semiProduct from "@fp-ts/core/typeclass/SemiProduct"; /** * @category type class * @since 1.0.0 */ export interface Equivalence { (self: A, that: A): boolean; } /** * @category type lambdas * @since 1.0.0 */ export interface EquivalenceTypeLambda extends TypeLambda { readonly type: Equivalence; } /** * @category constructors * @since 1.0.0 */ export declare const make: (isEquivalent: (self: A, that: A) => boolean) => Equivalence; /** * Return an `Equivalence` that uses strict equality (===) to compare values. * * @since 1.0.0 * @category constructors */ export declare const strict: () => Equivalence; /** * @category instances * @since 1.0.0 */ export declare const string: Equivalence; /** * @category instances * @since 1.0.0 */ export declare const number: Equivalence; /** * @category instances * @since 1.0.0 */ export declare const boolean: Equivalence; /** * @category instances * @since 1.0.0 */ export declare const bigint: Equivalence; /** * @category instances * @since 1.0.0 */ export declare const symbol: Equivalence; /** * Given a tuple of `Equivalence`s returns a new `Equivalence` that compares values of a tuple * by applying each `Equivalence` to the corresponding element of the tuple. * * @category combinators * @since 1.0.0 */ export declare const tuple: (...equivalences: { readonly [K in keyof A]: Equivalence; }) => Equivalence>; /** * Given an `Equivalence` of type `A`, returns a new `Equivalence` of type `ReadonlyArray`. * The returned `Equivalence` compares arrays by first checking their length and then applying the provided `Equivalence` to each element. * If all comparisons return true, the arrays are considered equal. * * @category combinators * @since 1.0.0 */ export declare const array: (equivalence: Equivalence) => Equivalence; /** * Given a struct of `Equivalence`s returns a new `Equivalence` that compares values of a struct * by applying each `Equivalence` to the corresponding property of the struct. * * @category combinators * @since 1.0.0 */ export declare const struct: (equivalences: { [K in keyof A]: Equivalence; }) => Equivalence<{ readonly [K_1 in keyof A]: A[K_1]; }>; /** * Given an `Equivalence` of type `A`, returns a new `Equivalence` of type `{ readonly [x: string]: A }`. * The returned `Equivalence` compares records by first checking their number of keys and then applying the provided `Equivalence` to each value. * If all comparisons return true, the records are considered equal. * * @category combinators * @since 1.0.0 */ export declare const record: (equivalence: Equivalence) => Equivalence>; /** * @category instances * @since 1.0.0 */ export declare const getSemigroup: () => Semigroup>; /** * @category instances * @since 1.0.0 */ export declare const getMonoid: () => Monoid>; /** * @category combinators * @since 1.0.0 */ export declare const contramap: { (f: (b: B) => A): (self: Equivalence) => Equivalence; (self: Equivalence, f: (b: B) => A): Equivalence; }; /** * @category instances * @since 1.0.0 */ export declare const Contravariant: contravariant.Contravariant; /** * @category instances * @since 1.0.0 */ export declare const Invariant: invariant.Invariant; /** * @category instances * @since 1.0.0 */ export declare const SemiProduct: semiProduct.SemiProduct; /** * @category instances * @since 1.0.0 */ export declare const Product: product_.Product; //# sourceMappingURL=Equivalence.d.ts.map