type Func = (...args: any[]) => any; /** * 防抖函数 * @param { Function } func 函数 * @param { Number } delay 防抖时间 * @param { Boolean } immediate 是否立即执行 * @param { Function } resultCallback */ export declare function debounce(func: Func, delay?: number, immediate?: boolean, resultCallback?: Func): { (this: unknown, ...args: any[]): Promise; cancel(): void; }; /** * 节流函数 * @param { Function } func * @param { Boolean } interval * @param { Object } options * leading:初始 trailing:结尾 */ export declare function throttle(func: Func, interval: number, options?: { leading: boolean; trailing: boolean; }): { (this: unknown, ...args: any[]): void; cancel(): void; }; /** * 驼峰转换下划线 * @param { String } name */ export declare function toLine(name: string): string; export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string; export declare const formatNumberDigit: (num: any, digit: any) => any; export declare const formatPercentage: (number: any) => string; /** * 数据转化 */ export declare const getNestedValue: (obj: any, keys: any) => any; /** * 设置项目配置 */ interface configProps { baseURL: string; sysCode: string; appType: string; tokenName: string; token: string; key: string; } export declare const setAjaxConfig: (config?: configProps) => void; export declare const getAjaxConfig: (key?: string) => any; export declare const typeofXAxis: (item: any) => "function" | "string" | "number" | "object" | "boolean" | "undefined" | "bigint" | "symbol" | "null"; export declare const typeIsEmpty: (item: any) => boolean; /** * 导出表格 * @param exportType 导出文件类型,可选值为 'excel' | 'csv',默认 'excel' * @param excelConfig Excel 配置对象(表名、sheet、表头结构、样式等) * @param exportDataQueryParam 数据查询参数 * @param excelSheetNum sheets 页数量,默认 1 * @param headers 请求头 */ export declare function exportTable({ exportType, excelConfig, exportDataQueryParam, excelSheetNum, headers, }: { exportType?: 'excel' | 'csv'; excelConfig: object; exportDataQueryParam: any[]; excelSheetNum?: number; headers?: Record; }): void; /** * 单位配置项 */ interface UnitConfig { field: string; unit: string; } /** * 单位处理结果 */ interface UnitResult { data: Record[]; unitMap: Record; } /** * 合计配置 */ interface SummaryConfig { sumFields: string[]; avgFields?: string[]; labelField?: string; labelText?: string; } /** * 单位处理函数 * @param data 原始数据数组 * @param unitConfigs 单位配置数组 * @param options.inferBy 推断方式:'avg' 按平均值(默认),'max' 按最大值 * @returns 处理后的数据和单位映射 */ export declare const formatUnit: (data: Record[], unitConfigs: UnitConfig[], options?: { inferBy?: "avg" | "max"; }) => UnitResult; /** * 同比计算函数 * @param data 原始数据数组 * @param config 配置项 * @returns 添加同比结果的数据数组 */ export declare const calcYearOverYear: (data: Record[], config: { timeField: string; valueFields: string[]; }) => Record[]; /** * 环比计算函数 * @param data 原始数据数组 * @param config 配置项 * @returns 添加环比结果的数据数组 */ export declare const calcPeriodOverPeriod: (data: Record[], config: { timeField: string; valueFields: string[]; }) => Record[]; /** * 合计计算函数 * @param data 原始数据数组 * @param config 合计配置 * @returns 添加合计行的数据数组 * @note sumFields 仅适用于可累加的数值字段(如金额、数量等) * 百分比、比率类字段请使用 avgFields 求平均,不可放入 sumFields 求和 */ export declare const calcSummary: (data: Record[], config: SummaryConfig) => Record[]; export {};