@nafr/echo-ui
Version:
A UI library born for WAA
21 lines (20 loc) • 1.04 kB
TypeScript
import * as d3 from 'd3';
import { type ClassValue } from 'clsx';
export declare function cn(...inputs: ClassValue[]): string;
export declare const validValue: (value: number, min: number, max: number) => number;
export declare const halfRange: (min: number, max: number) => number;
export declare const fixTo: (n: number, fix?: number) => number;
export declare const formatTime: (seconds: number) => string;
type ScaleType = d3.ScaleLinear<number, number> | d3.ScaleLogarithmic<number, number> | null;
/**
* Returns a valid scaled value for a given scale and data point.
*/
export declare const validScaledNaN: (scale: ScaleType, data: number, specify: number) => number;
/**
* Converts any color string to an RGBA string with the specified opacity.
* @param {string} color - The color string (hex, rgb, rgba, hsl, etc.)
* @param {number} opacity - The opacity value (0 to 1).
* @returns {string} - The resulting RGBA color string.
*/
export declare function convertColorToRGBA(color: string, opacity: number): string;
export {};