/** * Return b's the occurrence percentage in a. * The ordering of a & b matters. */ declare function intersectionPercentage(a: T[], b: T[]): number; declare function toObject(array: ReadonlyArray, mapperCallback: (item: T, index: number) => [string, V]): { [key: string]: V; }; /** * Accepts a list of item and a callback, maps each item with the callback, * then removes value of `null`, `undefined`, `NaN` from the resulting list. * Other falsy values are **NOT** removed. * * @param array List of items to be filtered * @param callback Callback to transform item */ declare function compactMap(array: ReadonlyArray, callback: (item: T, index: number) => V): Array>; /** * If element exists in array, it will return a new array without this element. * If element not exists in array, it will return a new array with this element in the last. */ declare function toggleElement(array: ReadonlyArray, element: T): T[]; export declare const ArrayUtil: Readonly<{ intersectionPercentage: typeof intersectionPercentage; toObject: typeof toObject; compactMap: typeof compactMap; toggleElement: typeof toggleElement; }>; export {};