@playcanvas/splat-transform
Version:
Library and CLI tool for 3D Gaussian splat format conversion and transformation
35 lines (34 loc) • 1.02 kB
TypeScript
/**
* Format a duration in milliseconds as a human-readable string.
*
* - Sub-minute durations render in seconds (e.g. `1.234s`).
* - Sub-hour durations render as `MmS.SSSs`.
* - Otherwise as `HhMmS.SSSs`.
*
* @param ms - The duration in milliseconds.
* @returns The formatted string.
*/
declare const fmtTime: (ms: number) => string;
/**
* Format a byte count using binary (1024-based) units.
*
* @param n - The number of bytes.
* @returns The formatted string (e.g. `1.5MB`).
*/
declare const fmtBytes: (n: number) => string;
/**
* Format a distance in metres as a human-readable string, picking the most
* appropriate unit (mm/cm/m/km).
*
* @param m - The distance in metres.
* @returns The formatted string.
*/
declare const fmtDistance: (m: number) => string;
/**
* Format a count using SI suffixes (K/M/B/T) above 1000.
*
* @param n - The count to format.
* @returns The formatted string.
*/
declare const fmtCount: (n: number) => string;
export { fmtBytes, fmtCount, fmtDistance, fmtTime };