#Why isn't this global declaration file merging with other types?
2 messages · Page 1 of 1 (latest)
/// <reference types="jquery" />
declare global {
interface Math {
/**
* Returns the given number clamped to the specified bounds. Does not modify the original.
* @param num The number to clamp. May be an actual number or a numerical string.
* @param min The lower bound of the number.
* @param max The upper bound of the number.
* @since 2.0.0
* @example
* Math.clamp($stat, 0, 200) // Clamps $stat to the bounds 0–200 and returns the new value
* Math.clamp($stat, 1, 6.6) // Clamps $stat to the bounds 1–6.6 and returns the new value
*/
clamp(num: number | string, min: number, max: number): number;
/**
* Returns the whole(integer) part of the given number by removing its fractional part, if any. Does not modify the
* original.
* @param num The number to truncate to an integer.
* @since 2.0.0
* @example
* Math.trunc(12.7) // Returns 12
* Math.trunc(-12.7) // Returns -12
*/
trunc(num: number): number;
}
}
export {};