-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
150 additions
and
1,450 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export declare const formatSiUnit: (value: number, minBase1000?: number, unit?: string) => string; | ||
export declare function formatSiUnit(value: number, minBase1000?: number, unit?: string): string; | ||
export declare function formatPower(value: number, minBase1000?: number): string; | ||
export declare function formatEnergy(value: number, minBase1000?: number): string; | ||
export declare function formatMoney(value: number, precision?: number): string; | ||
export declare function formatDb(value: number): string; | ||
export declare const formatSiBaseTenUnit: (value: number, minBase1000?: number, unit?: string) => string; | ||
export declare function formatSiBaseTenUnit(value: number, minBase1000?: number, unit?: string): string; | ||
/** | ||
* Formats decisecond count into HH:MM:SS display by default | ||
* "short" format does not pad and adds hms suffixes | ||
*/ | ||
export declare const formatTime: (val: number, formatType?: "short" | "default") => string; | ||
export declare function formatTime(val: number, formatType?: 'short' | 'default'): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
/** | ||
* Limits a number to the range between 'min' and 'max'. | ||
*/ | ||
export declare function clamp(value: any, min: any, max: any): any; | ||
export declare function clamp(value: number, min: number, max: number): number; | ||
/** | ||
* Limits a number between 0 and 1. | ||
*/ | ||
export declare function clamp01(value: any): any; | ||
export declare function clamp01(value: number): number; | ||
/** | ||
* Scales a number to fit into the range between min and max. | ||
*/ | ||
export declare function scale(value: any, min: any, max: any): number; | ||
export declare function scale(value: number, min?: number, max?: number): number; | ||
/** | ||
* Robust number rounding, similar to PHP's round() function. | ||
* | ||
* @url https://stackoverflow.com/questions/53450248/how-to-round-in-javascript-like-php-do/54721202#54721202 | ||
*/ | ||
export declare function round(num: any, dec: any): number; | ||
export declare function round(num: number, dec: number): number; | ||
/** | ||
* Returns a string representing a number in fixed point notation. | ||
*/ | ||
export declare function toFixed(value: any, fractionDigits?: number): string; | ||
export declare function toFixed(value: number, fractionDigits?: number): string; | ||
/** | ||
* Checks whether a value is within the provided range. | ||
* | ||
* Range is an array of two numbers, for example: [0, 15]. | ||
*/ | ||
export declare function inRange(value: any, range: any): any; | ||
export declare function inRange(value: number, range: number[]): boolean; | ||
/** | ||
* Walks over the object with ranges, comparing value against every range, | ||
* and returns the key of the first matching range. | ||
* | ||
* Range is an array of two numbers, for example: [0, 15]. | ||
*/ | ||
export declare function keyOfMatchingRange(value: any, ranges: any): string | undefined; | ||
export declare function keyOfMatchingRange(value: number, ranges: Record<string, any>): string | undefined; | ||
/** | ||
* Get number of digits following the decimal point in a number | ||
*/ | ||
export declare function numberOfDecimalDigits(value: any): any; | ||
export declare function numberOfDecimalDigits(value: number): number; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.