UNPKG

arcade-physics

Version:
22 lines 1.06 kB
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Searches a pre-sorted array for the closet value to the given number. * * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, * and will check for the closest value of those to the given number. * * @function Phaser.Utils.Array.FindClosestInSorted * @since 3.0.0 * * @param {number} value - The value to search for in the array. * @param {array} array - The array to search, which must be sorted. * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. * * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. */ export declare const FindClosestInSorted: (value: any, array: any, key: any) => any; //# sourceMappingURL=FindClosestInSorted.d.ts.map