import type { TypeLambda } from "@fp-ts/core/HKT"; 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 Order { readonly compare: (self: A, that: A) => -1 | 0 | 1; } /** * @category type lambdas * @since 1.0.0 */ export interface OrderTypeLambda extends TypeLambda { readonly type: Order; } /** * @category constructors * @since 1.0.0 */ export declare const make: (compare: (self: A, that: A) => -1 | 0 | 1) => Order; /** * @category instances * @since 1.0.0 */ export declare const string: Order; /** * @category instances * @since 1.0.0 */ export declare const number: Order; /** * @category instances * @since 1.0.0 */ export declare const boolean: Order; /** * @category instances * @since 1.0.0 */ export declare const bigint: Order; /** * This function creates and returns a new `Order` for a tuple of values based on the given `Order`s for each element in the tuple. * The returned `Order` compares two tuples of the same type by applying the corresponding `Order` to each element in the tuple. * It is useful when you need to compare two tuples of the same type and you have a specific way of comparing each element * of the tuple. * * @category combinators * @since 1.0.0 */ export declare const tuple: (...orders: { readonly [K in keyof A]: Order; }) => Order>; /** * This function creates and returns a new `Order` for an array of values based on a given `Order` for the elements of the array. * The returned `Order` compares two arrays by applying the given `Order` to each element in the arrays. * If all elements are equal, the arrays are then compared based on their length. * It is useful when you need to compare two arrays of the same type and you have a specific way of comparing each element of the array. * * @category combinators * @since 1.0.0 */ export declare const array: (O: Order) => Order; /** * This function creates and returns a new `Order` for a struct of values based on the given `Order`s * for each property in the struct. * * @category combinators * @since 1.0.0 */ export declare const struct: (orders: { readonly [K in keyof A]: Order; }) => Order<{ readonly [K_1 in keyof A]: A[K_1]; }>; /** * @since 1.0.0 */ export declare const reverse: (O: Order) => Order; /** * @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: Order) => Order; (self: Order, f: (b: B) => A): Order; }; /** * @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; /** * Test whether one value is _strictly less than_ another. * * @since 1.0.0 */ export declare const lessThan: (O: Order) => { (that: A): (self: A) => boolean; (self: A, that: A): boolean; }; /** * Test whether one value is _strictly greater than_ another. * * @since 1.0.0 */ export declare const greaterThan: (O: Order) => { (that: A): (self: A) => boolean; (self: A, that: A): boolean; }; /** * Test whether one value is _non-strictly less than_ another. * * @since 1.0.0 */ export declare const lessThanOrEqualTo: (O: Order) => { (that: A): (self: A) => boolean; (self: A, that: A): boolean; }; /** * Test whether one value is _non-strictly greater than_ another. * * @since 1.0.0 */ export declare const greaterThanOrEqualTo: (O: Order) => { (that: A): (self: A) => boolean; (self: A, that: A): boolean; }; /** * Take the minimum of two values. If they are considered equal, the first argument is chosen. * * @since 1.0.0 */ export declare const min: (O: Order) => { (that: A): (self: A) => A; (self: A, that: A): A; }; /** * Take the maximum of two values. If they are considered equal, the first argument is chosen. * * @since 1.0.0 */ export declare const max: (O: Order) => { (that: A): (self: A) => A; (self: A, that: A): A; }; /** * Clamp a value between a minimum and a maximum. * * @since 1.0.0 */ export declare const clamp: (O: Order) => { (minimum: A, maximum: A): (a: A) => A; (a: A, minimum: A, maximum: A): A; }; /** * Test whether a value is between a minimum and a maximum (inclusive). * * @since 1.0.0 */ export declare const between: (O: Order) => { (minimum: A, maximum: A): (a: A) => boolean; (a: A, minimum: A, maximum: A): boolean; }; //# sourceMappingURL=Order.d.ts.map