export declare type UnitOptionsObject = { /** * 单位名称 */ name: string; /** * 阈值 * * 超出此阈值后会用此单位, 同时也是基数 * * @example * * ```json * { * "name": "KB", * "threshold": 1024 * } * ``` * 大于或等于 1024 后会用 KB,比如 2048 会显示为 2 KB */ threshold: number; }; export declare type UnitOptions = UnitOptionsObject[] | string; export declare type UnitHumanizeNumFn = (num?: number) => string; export declare function createUnit(value?: number, options?: UnitOptions, decimals?: number): string;