/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/generate/GenerateRandomInt.ts * @create: 2025-06-28 09:39:15.408 * @modify: 2025-07-11 21:19:12.888 * @version: 6.0.0 * @times: 3 * @lines: 70 * @copyright: Copyright © 2018-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ /** * Generates a random integer between the specified `min` and `max` values. * * @param min - The minimum integer value (inclusive). * @param max - The maximum integer value (inclusive or exclusive based on `maxExclusive`). * @param maxExclusive - If `true`, the `max` value is exclusive; otherwise, it is inclusive. Defaults to `false`. * @returns A random integer between `min` (inclusive) and `max` (exclusive if `maxExclusive` is `true`, inclusive otherwise). * * @remarks * - If `maxExclusive` is `true`, the result is in the range `[min, max)`. * - If `maxExclusive` is `false`, the result is in the range `[min, max]`. * - Both `min` and `max` are rounded to the nearest integer using `Math.ceil` and `Math.floor` respectively. * * @example * ```typescript * // Inclusive max * const random1 = GenerateRandomInt(1, 10); // 1 <= random1 <= 10 * * // Exclusive max * const random2 = GenerateRandomInt(1, 10, true); // 1 <= random2 < 10 * ``` * * @since 4.0.0 * @version 2021-12-12 */ export declare function GenerateRandomInt(min: number, max: number, maxExclusive?: boolean): number; //# sourceMappingURL=GenerateRandomInt.d.ts.map