/** * Placeholder to indicate that the argument is not explicitly set. * * @returns The results of `Symbol('_')` * * @public */ declare const _: unique symbol; type Params = { (a: number, b: number): number; (a: number): (b: number) => number; (a: bigint, b: bigint): bigint; (a: bigint): (b: bigint) => bigint; }; type NonIdempotentParams = Params & { (a: typeof _, b: number): (a: number) => number; (a: typeof _, b: bigint): (a: bigint) => bigint; }; /** * Add first argument and second argument. * * @param a - The first input number * @param b - The second input number * @returns The result of `a + b` * * @example * ```ts * // Basic * add(1, 2) // 3 * ``` * * @example * ```ts * // Bigint * add(1n, 2n) //3n * ``` * * @example * ```ts * // Curry * const plus2(2) * plus2(-3) // -1 * ``` * * @public */ declare const add: Params; /** * Divide its second argument from its first argument. * * @param a - The first input number * @param b - The second input number * @returns The result of `a / b` * @remarks * Since division is not idempotent, there are two ways to curry. * * @example * ```ts * // Number * divide(10, 100) // 0.1 * ``` * * @example * ```ts * // Bigint * divide(1n, 2n) // 3n * ``` * * @example * ```ts * // First argument curry * const reciprocal = divide(1) * reciprocal(4) // 0.25 * ``` * * @example * ```ts * // Second argument curry * import { _ } from 'arithmetic4' * const half = divide(_, 2) * half(20) // 10 * ``` * * @public */ declare const divide: NonIdempotentParams; /** * Multiplies first argument and second argument. * * @param a - The first input number * @param b - The second input number * @returns The result of `a * b` * * @example * ```ts * // Basic * multiply(2, 3) // 6 * ``` * * @example * ```ts * // Bigint * multiply(2n, 3n) // 6n * ``` * * @example * ```ts * // Curry * const double = multiply(2) * double(4) // 8 * ``` * * @public */ declare const multiply: Params; /** * Subtracts its second argument from its first argument. * * @param a - The first input number * @param b - The second input number * @returns The result of `a - b` * * @remarks * Since subtraction is not idempotent, there are two ways to curry. * * @example * ```ts * // Number * subtract(2, 1) // 1 * ``` * * @example * ```ts * // Bigint * subtract(3n, 2n) //1n * ``` * * @example * ```ts * // First argument curry * const from5Minus = subtract(5) * from5Minus(10) // -5 * ``` * * @example * ```ts * // Second argument curry * import { _ } from 'arithmetic4' * const minus5 = (_, 5) * minus5(20) // 15 * ``` * * @public */ declare const subtract: NonIdempotentParams; export { add, _, divide, multiply, subtract }; //# sourceMappingURL=index.es.d.ts.map