/*! Copyright 2018 Ron Buckton (rbuckton@chronicles.org) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** @module "iterable-query/fn" */ import "../compat"; import { Lazy } from "../lazy"; /** A function that returns the provided value. */ export declare function identity(value: T): T; /** Creates a function that always returns the provided value. */ export declare function thunk(value: T): () => T; /** Creates a function that returns the property value for the provided key. */ export declare function property(key: K): (value: T) => T[K]; /** Creates a function that returns the property value for the provided key. */ export declare function property(key: K): (value: T) => K extends keyof T ? T[K] : unknown; /** A function that does nothing. */ export declare function noop(...args: unknown[]): unknown; /** Creates a function that produces monotonically increasing number values. */ export declare function incrementer(start?: number): () => number; /** Creates a function that produces monotonically decreasing number values. */ export declare function decrementer(start?: number): () => number; /** Equate two values. */ export declare function equate(x: T, y: T): boolean; /** Compares two values. */ export declare function compare(x: T, y: T): number; /** Compose one function with another (i.e. `compose(g, f)` is `x => g(f(x))`) */ export declare function compose(g: (y: Y) => Z, f: (x: X) => Y): (x: X) => Z; /** Create a lazy-initialized value. */ export declare function lazy(factory: (...args: A) => T, ...args: A): Lazy; /** Makes a tuple from the provided arguments */ export declare function tuple(...args: A): A; /** Always returns `true` */ export declare function T(): true; /** Always returns `false` */ export declare function F(): false; /** Various shorthand operator functions */ export declare namespace Op { /** Add */ function add(x: number, y: number): number; /** Subtract */ function sub(x: number, y: number): number; /** Multiply */ function mul(x: number, y: number): number; /** Exponentiate */ function pow(x: number, y: number): number; /** Divide */ function div(x: number, y: number): number; /** Modulo */ function mod(x: number, y: number): number; /** Left shift */ function shl(x: number, n: number): number; /** Right shift */ function shr(x: number, n: number): number; /** Unsigned right shift */ function sru(x: number, n: number): number; /** Negate */ function neg(x: number): number; /** Bitwise AND */ function band(x: number, y: number): number; /** Bitwise OR */ function bor(x: number, y: number): number; /** Bitwise XOR */ function bxor(x: number, y: number): number; /** Bitwise NOT */ function bnot(x: number): number; /** Logical AND */ function and(x: boolean, y: boolean): boolean; /** Logical OR */ function or(x: boolean, y: boolean): boolean; /** Logical XOR */ function xor(x: boolean, y: boolean): boolean; /** Logical NOT */ function not(x: boolean): boolean; /** Relational greater-than */ function gt(x: T, y: T): boolean; /** Relational greater-than-equals */ function ge(x: T, y: T): boolean; /** Relational less-than */ function lt(x: T, y: T): boolean; /** Relational less-than-equals */ function le(x: T, y: T): boolean; /** Relational equals */ function eq(x: T, y: T): boolean; /** Relational not-equals */ function ne(x: T, y: T): boolean; /** Relational minimum */ function min(x: T, y: T): T; /** Relational maximum */ function max(x: T, y: T): T; } //# sourceMappingURL=common.d.ts.map