@fivem-ts/shared
Version:
FiveM Typescript wrapper shared part
18 lines (17 loc) • 414 B
TypeScript
/**
* Clamps a number to a specified range.
*
* @example
* ```ts
* clamp(5, 1, 10); // 5
* clamp(0, 1, 10); // 1
* clamp(15, 1, 10); // 10
* ```
*
* @param {number} num - The number to clamp.
* @param {number} min - The minimum value.
* @param {number} max - The maximum value.
*
* @return {number} The clamped value.
*/
export declare function clamp(num: number, min: number, max: number): number;