UNPKG

ag-grid-community

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

33 lines (32 loc) 2.13 kB
/** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _last<T>(arr: readonly T[]): T; export declare function _last<T extends Node>(arr: NodeListOf<T>): T; /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _areEqual<T>(a: readonly T[] | null | undefined, b: readonly T[] | null | undefined, comparator?: (a: T, b: T) => boolean): boolean; /** * Returns `prev` when its contents equal `current`; otherwise `current.slice()` (or `[]` if * nullish). The same-reference case (`prev === current`) returns a fresh slice so callers never * receive the readonly `current` aliased back. Mutating a returned `prev` persists into the next * call's `prev`. * * @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _reuseArrayIfEqual<T>(prev: T[] | null | undefined, current: readonly T[] | null | undefined): T[]; /** * Utility that uses the fastest looping approach to apply a callback to each element of the array * https://jsperf.app/for-for-of-for-in-foreach-comparison * If callback returns true, exit early. */ export declare function _forAll<T>(array: T[] | undefined, callback: (value: T) => boolean | void): true | undefined; /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _removeFromArray<T>(array: T[], object: T): void; /** * O(N+M) way to remove M elements from an array of size N. Better than calling _removeFromArray in a loop * * Note: this implementation removes _any_ instances of the `elementsToRemove` * @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _removeAllFromArray<T>(array: T[], elementsToRemove: readonly T[]): void; export declare function _moveInArray<T>(array: T[], objectsToMove: T[], toIndex: number): void; /** @internal AG_GRID_INTERNAL - Not for public use. Can change / be removed at any time. */ export declare function _flatten<T>(arrays: Array<T[]>): T[];