import { IdName, KeyPair, KeyPairEx, Tree } from "../models"; import { IFlattenTree, IFlattenTreeNode, INode, ITreeNode } from "../models/tree"; export declare class ArrayHelper { static insert(array: any[], index: number, item: any): void; /** * Remove item from array * @param array * @param item item to remove */ static remove(array: any[], item: any): void; /** * Remove all items from array * @param array * @param item item to remove */ static removeAll(array: any[], item: any): void; static move(array: any[], fromIndex: number, toIndex: number): any[]; static contains(value: any[], v: any): boolean; static isArray(value: any): boolean; static distinct(array: any[]): any[]; /** * Returns a new array with duplicates removed based on a specific key or selector. * @param array The source array. * @param keySelector A function that returns the value to compare by. */ static distinctBy(array: T[], keySelector: (item: T) => K): T[]; static filterByKeyString(filterValue: any, key: string, array: any[]): any[]; /** * Filters an array based on whether the value derived by the keySelector * equals the filterValue. * @param filterValue The value to match. * @param keySelector A function that takes an item of type T and returns the key value of type K. * @param array The array of items to filter. * @returns A new array containing only the items that match the filter criteria. */ static filterByKey(filterValue: K, keySelector: (item: T) => K, array: T[]): T[]; static flatten(array: any, indent?: number): any[]; /** * @deprecated use flattenDropDownList2 */ static flattenDropDownList(tree: Tree | Tree[], indent?: number): IFlattenTree[]; static flattenTreeNodeDropDownList(tree: ITreeNode | ITreeNode[], indent?: number): IFlattenTreeNode[]; private static enumToKeyPairBaseArray; static enumToKeyPairArray(value: any): KeyPair[]; static enumToKeyPairExArray(value: any): KeyPairEx[]; static enumToArray>(value: any): T[]; /** * Method to create a tree from a flat array of nodes * @param array * @param safe if tue and some nodes not have parent thand adds as a root node. if false than thoose nodes skipped. * @returns */ static createTree(array: INode[], safe?: boolean): ITreeNode[]; }