UNPKG

520 BTypeScriptView Raw
1import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js';
2/**
3 * For comparison functions
4 *
5 * A comparison function returns:
6 * - negative value whenever `a < b`
7 * - positive value whenever `a > b`
8 * - zero whenever `a` and `b` are equivalent
9 *
10 * Comparison functions are transitive: `a < b and b < c => a < c`
11 *
12 * They also satisfy: `a < b <=> b > a` and `a = b <=> b = a`
13 *
14 * @remarks Since 1.6.0
15 * @public
16 */
17export declare function compareFunc<T>(): Arbitrary<(a: T, b: T) => number>;