@adaptabletools/adaptable
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
87 lines (86 loc) • 5.25 kB
TypeScript
import { SortOrder } from '../../AdaptableState/Common/Enums';
import { GridCell } from '../../AdaptableState/Selection/GridCell';
export type NonEmptyArray<T> = [T, ...Array<T>];
export declare function GetLength(arrayToCheck: any[]): number;
export declare function CorrectLength(arrayToCheck: any[], requiredLength: number): boolean;
export declare function NotCorrectLength(arrayToCheck: any[], requiredLength: number): boolean;
export declare function AddItem(array: any[], itemToAdd: any): void;
export declare function ContainsItem<T>(array: T[], itemToCheck: T): boolean;
export declare function ContainsAnyItem<T>(array: T[], itemsToCheck: T[]): boolean;
export declare function NotContainsItem<T>(array: T[], itemToCheck: T): boolean;
export declare function RetrieveDistinct(array: any[]): any[];
export declare function IsNull(arrayToCheck: any[] | undefined | null): boolean;
export declare function IsNotNull(arrayToCheck: any[] | undefined | null): boolean;
export declare function IsEmpty(arrayToCheck: any[]): boolean;
export declare function IsNotEmpty(arrayToCheck: any[]): boolean;
export declare function IsNullOrEmpty(arrayToCheck: any[] | undefined | null): boolean;
export declare function IsNotNullOrEmpty(arrayToCheck: any[] | undefined | null): boolean;
export declare function IsNullOrEmptyOrContainsSingleEmptyValue(arrayToCheck: any[]): boolean;
export declare function IsNotNullOrEmptyNorContainsSingleEmptyValue(arrayToCheck: any[]): boolean;
export declare function HasSingleEmptyValue(arrayToCheck: any[]): boolean;
export declare function getOccurrence(arrayToCheck: any[], valueToCheck: any): number;
export declare function hasOneItem(arrayToCheck: any[]): boolean;
export declare function hasItemsOfCount(arrayToCheck: any[], numberOfItems: number): boolean;
export declare function moveArray(array: any[], from: number, to: number): void;
export declare function areArraysEqual(arr1: any[], arr2: any[]): boolean;
export declare function areArraysNotEqual(arr1: any[], arr2: any[]): boolean;
export declare function areArraysEqualWithOrder(arr1: any[], arr2: any[]): boolean;
export declare function areArraysEqualWithOrderandProperties(value: any[], other: any[]): boolean;
export declare function sortArrayWithProperty(sortOrder: SortOrder, values: any[], sortProperty?: string): any[];
export declare function sortArray(values: any[], sortOrder?: SortOrder): any[];
export declare function sortCellValueArray<T extends GridCell>(cellValues: T[], sortOrder?: SortOrder): T[];
export declare function sortCellValueArrayNumeric<T extends GridCell>(cellValues: T[], sortOrder?: SortOrder): T[];
export declare function sortCellValueArrayDates<T extends GridCell>(cellValues: T[], sortOrder?: SortOrder): T[];
export declare function groupArrayBy(array: Array<any>, prop: string): Array<any>;
export declare function createCommaSeparatedString(values: any[]): string;
export declare function SumArray(array: (number | undefined)[]): number;
export declare function reorderArray(array: any[], startIndex: number, endIndex: number): any[];
export declare function sortArrayWithOrder<T>(array: T[], order: T[],
/**
*
* The array can contain items which are not listed in the order array.
* So sortUnorderedItems decides whether to leave these items untouched
* in the current order in which they are in the array (sortUnorderedItems: false)
* or to sort them using normal comparison rules
*/
{ sortUnorderedItems }: {
sortUnorderedItems: boolean;
}): T[];
export declare const ArrayExtensions: {
GetLength: typeof GetLength;
CorrectLength: typeof CorrectLength;
NotCorrectLength: typeof NotCorrectLength;
groupArrayBy: typeof groupArrayBy;
AddItem: typeof AddItem;
ContainsItem: typeof ContainsItem;
NotContainsItem: typeof NotContainsItem;
ContainsAnyItem: typeof ContainsAnyItem;
RetrieveDistinct: typeof RetrieveDistinct;
IsNull: typeof IsNull;
IsNotNull: typeof IsNotNull;
IsEmpty: typeof IsEmpty;
IsNotEmpty: typeof IsNotEmpty;
IsNullOrEmpty: typeof IsNullOrEmpty;
IsNotNullOrEmpty: typeof IsNotNullOrEmpty;
IsNullOrEmptyOrContainsSingleEmptyValue: typeof IsNullOrEmptyOrContainsSingleEmptyValue;
IsNotNullOrEmptyNorContainsSingleEmptyValue: typeof IsNotNullOrEmptyNorContainsSingleEmptyValue;
HasSingleEmptyValue: typeof HasSingleEmptyValue;
getOccurrence: typeof getOccurrence;
hasOneItem: typeof hasOneItem;
hasItemsOfCount: typeof hasItemsOfCount;
moveArray: typeof moveArray;
areArraysEqual: typeof areArraysEqual;
areArraysNotEqual: typeof areArraysNotEqual;
areArraysEqualWithOrder: typeof areArraysEqualWithOrder;
areArraysEqualWithOrderandProperties: typeof areArraysEqualWithOrderandProperties;
sortArray: typeof sortArray;
sortCellValueArray: typeof sortCellValueArray;
sortCellValueArrayNumeric: typeof sortCellValueArrayNumeric;
sortCellValueArrayDates: typeof sortCellValueArrayDates;
sortArrayWithProperty: typeof sortArrayWithProperty;
createCommaSeparatedString: typeof createCommaSeparatedString;
SumArray: typeof SumArray;
reorderArray: typeof reorderArray;
sortArrayWithOrder: typeof sortArrayWithOrder;
};
export default ArrayExtensions;