UNPKG

drip-table

Version:

A tiny and powerful enterprise-class solution for building tables.

18 lines (17 loc) 1.23 kB
/** * This file is part of the drip-table project. * @link : https://drip-table.jd.com/ * @author : Emil Zhai (root@derzh.com) * @modifier : Emil Zhai (root@derzh.com) * @copyright: Copyright (c) 2021 JD Network Technology Co., Ltd. */ declare type ChildrenLike<T extends ChildrenLike<T>> = { children?: readonly T[] | void; } | object; export declare const forEachRecursive: <T extends ChildrenLike<T>>(columns: readonly T[], callbackfn: (column: T, index: number) => void) => void; export declare const flattenRecursive: <T extends ChildrenLike<T>>(columns: readonly T[]) => readonly T[]; export declare const mapRecursive: <T extends ChildrenLike<T>>(columns: readonly T[], callbackfn: (column: T, index: number) => T) => readonly T[]; export declare const filterRecursive: <T extends ChildrenLike<T>>(columns: readonly T[], callbackfn: (column: T, index: number) => unknown) => readonly T[]; export declare const findRecursive: <T extends ChildrenLike<T>>(columns: readonly T[], callbackfn: (column: T, index: number) => unknown) => T | undefined; export declare const findIndexRecursive: <T extends ChildrenLike<T>>(columns: readonly T[], callbackfn: (column: T, index: number) => unknown) => number; export {};