@cn-ui/core
Version:
The @cn-ui/core is a collection of UI components and utilities for building modern web applications with SolidJS.
17 lines (16 loc) • 1.02 kB
TypeScript
import type { ColumnDef } from "../solidTable";
/**
* 创建一个虚拟列的数组。这个数组不支持 forEach map 等属性,只允许直接取值
* @param num 列的数量。
* @param gen 一个可选的生成器函数,用于根据列的索引自定义每列的属性。
* @returns 返回一个代理数组,模拟了具有指定数量的列,每列具有基础的accessorKey和header属性,以及可选的通过gen函数生成的额外属性。
*/
export declare const makeVirtualColumns: <T, D>(num: number, gen?: (item: string) => Partial<ColumnDef<T, D>>) => any[];
/**
* 创建一个虚拟数据对象的数组。
* @param num 数据行的数量。
* @param columnsKey 包含所有有效列键的数组。
* @returns 返回一个包含指定数量的虚拟数据对象的数组,每个数据对象的属性由列键和行索引组合而成。
* @example [ {1:'0-0'}, 1:'0-1'} ]
*/
export declare const makeVirtualData: (num: number, columnsKey: string[]) => Record<string, string>[];