/** * Use spread operator to spread the iterable target into the array. */ export declare const spreadToArray: (target: Iterable) => T[]; /** * Returns the length of `targetArray`. */ export declare const arrayLength: (targetArray: any[]) => number; /** * Returns a copy of `targetArray` in which last element has been removed. * New array's length is `targetArray.length - 1`. * @see {@link arrayPush}, {@link arrayShift} */ export declare const arrayPop: (targetArray: T[]) => T[]; /** * Returns a copy of `targetArray` in which inserts the given `item` as new last item. * New array's length is `targetArray.length + 1`. * @see {@link arrayPop}, {@link arrayUnshift}, {@link arrayAppend} */ export declare const arrayPush: (item: T, targetArray: T[]) => T[]; /** * Returns a new array containing the contents of the given array, followed by the given element. * @see {@link https://ramdajs.com/docs/#append} * @see {@link arrayPush}, {@link arrayPrepend} */ export declare const arrayAppend: (item: T, targetArray: T[]) => T[]; /** * Returns a copy of `targetArray` in which inserts the given `item` as new fist item. * New array's length is `targetArray`'s length + 1. * @see {@link arrayShift}, {@link arrayPush}, {@link arrayPrepend} */ export declare const arrayUnshift: (item: T, targetArray: T[]) => T[]; /** * Returns a new array with the given element at the front, followed by the contents of the array. * @see {@link https://ramdajs.com/docs/#prepend} * @see {@link arrayUnshift}, {@link arrayAppend} */ export declare const arrayPrepend: (item: T, targetArray: T[]) => T[]; /** * Returns a copy of `targetArray` in which first element has been removed. * New array's length is `targetArray`'s length - 1. * @see {@link arrayUnshift}, {@link arrayPop} */ export declare const arrayShift: (targetArray: T[]) => T[]; /** * Returns the first element of `targetArray`. * @see {@link arrayTail}, {@link arrayLast} */ export declare const arrayHead: (targetArray: T[]) => T | undefined; /** * Returns the tail of `targetArray`. * @see {@link arrayHead}, {@link arrayInit} */ export declare const arrayTail: (targetArray: T[]) => T[]; /** * Returns the init of `targetArray`. * @see {@link arrayLast}, {@link arrayTail} */ export declare const arrayInit: (targetArray: T[]) => T[]; /** * Returns the last element of `targetArray`. * @see {@link arrayInit}, {@link arrayHead} */ export declare const arrayLast: (targetArray: T[]) => T | undefined; /** * Returns a copy of a section of an array. * @see {@link Array.slice}, {@link arraySliceInit}, {@link arraySliceTail} */ export declare const arraySlice: (start: number, end: number, targetArray: T[]) => T[]; /** * Returns a copy of a section of an array. * @see {@link Array.slice}, {@link arraySlice}, {@link arraySliceTail} * @see {@link arrayDrop} */ export declare const arraySliceTail: (start: number, targetArray: T[]) => T[]; /** * @see {@link https://ramdajs.com/docs/#drop} * @see {@link arraySliceTail} */ export declare const arrayDrop: (n: number, targetArray: T[]) => T[]; /** * Returns a copy of a section of an array. * @see {@link Array.slice}, {@link arraySlice}, {@link arraySliceInit} */ export declare const arraySliceInit: (end: number, targetArray: T[]) => T[]; /** * @see {@link https://ramdajs.com/docs/#dropLast} * @see {@link arraySliceInit} */ export declare const arrayDropLast: (n: number, targetArray: T[]) => T[]; /** * @see {@link https://ramdajs.com/docs/#remove} */ export declare const arrayRemoveIndex: (index: number, targetArray: T[]) => T[]; /** * Combines two array. `appendedArray` will be appended to the end of `targetArray`. * @see {@link Array.concat} */ export declare const arrayConcat: (appendedArray: T[], targetArray: T[]) => T[]; /** * Adds all the elements of an array into a string, separated by the specified separator string. * @see {@link Array.join} */ export declare const arrayJoin: (separator: string, targetArray: any[]) => string; /** * @see {@link Array.indexOf} */ export declare const arrayIndexOf: (searchElement: any, targetArray: any[]) => number; /** * @see {@link Array.lastIndexOf} */ export declare const arrayLastIndexOf: (searchElement: any, targetArray: any[]) => number; /** * Predicate whether the target array includes the searchElement. * @see {@link Array.includes} */ export declare const arrayIncludes: (searchElement: T, targetArray: T[]) => boolean; /** * @see {@link Array.every} */ export declare function arrayEvery(predicate: (item: T, index: number, array: T[]) => item is S, targetArray: T[]): targetArray is S[]; export declare function arrayEvery(predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]): boolean; /** * @see {@link https://ramdajs.com/docs/#all} * @see {@link arrayEvery} */ export declare const arrayAll: typeof arrayEvery; /** * @see {@link Array.some} */ export declare const arraySome: (predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]) => boolean; /** * @see {@link https://ramdajs.com/docs/#any} * @see {@link arraySome} */ export declare const arrayAny: (predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]) => boolean; /** * @see {@link Array.forEach} */ export declare const arrayForEach: (callback: (item: T, index: number, array: T[]) => void, targetArray: T[]) => void; /** * @see {@link Array.filter}, {@link arrayReject} */ export declare function arrayFilter(predicate: (item: T, index: number, array: T[]) => item is S, targetArray: T[]): S[]; export declare function arrayFilter(predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]): T[]; /** * @see {@link arrayFilter} */ export declare const arrayReject: (predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]) => T[]; /** * @see {@link arrayFilter}, {@link arrayReject} */ export declare const arrayPartition: (predicate: (item: T, index: number, array: T[]) => boolean, targetArray: T[]) => [T[], T[]]; /** * @see {@link Array.map} */ export declare const arrayMap: (transformation: (item: T, index: number, array: T[]) => R, targetArray: T[]) => R[]; /** * @see {@link Array.flat}, {@link arrayFlatMap} */ export declare const arrayFlat: (depth: D, targetArray: T[]) => FlatArray[]; /** * @see {@link Array.flatMap}, {@link arrayMap}, {@link arrayFlat} */ export declare const arrayFlatMap: (transformation: (item: T, index: number, array: T[]) => R | R[], targetArray: T[]) => R[]; /** * @see {@link Array.reduce}, {@link arrayReduceLeft}, {@link arrayReduceRight} */ export declare const arrayReduce: (reducer: (accumulated: R, item: T, index: number, array: T[]) => R, initialValue: R, targetArray: T[]) => R; /** * @see {@link Array.reduce}, {@link arrayReduceLeft}, {@link arrayReduceRight} */ export declare const arrayReduceLeft: (reducer: (accumulated: R, item: T, index: number, array: T[]) => R, initialValue: R, targetArray: T[]) => R; /** * @see {@link Array.reduce}, {@link arrayReduceLeft}, {@link arrayReduceRight} */ export declare const arrayReduceRight: (reducer: (accumulated: R, item: T, index: number, array: T[]) => R, initialValue: R, targetArray: T[]) => R; /** * Returns a new array containing only one copy of each element in the original array. */ export declare const arrayUnique: (targetArray: T[]) => T[]; export declare const arrayUniqueBy: (uniqueFunction: (item: T) => any, targetArray: T[]) => T[]; /** * Combines two arrays into one array (no duplicates) composed of the elements of each array. * @see {@link https://ramdajs.com/docs/#union} * @see {@link arrayIntersection} */ export declare const arrayUnion: (firstArray: T[], secondArray: T[]) => T[]; /** * Combines two arrays into one array (no duplicates) composed of those elements common to both arrays. * @see {@link https://ramdajs.com/docs/#intersection} * @see {@link arrayUnion} */ export declare const arrayIntersection: (firstArray: T[], secondArray: T[]) => T[]; /** * @see {@link Array.reverse} */ export declare const arrayReverse: (targetArray: T[]) => T[]; /** * @param compareFunction `compareFunction` is expected to return * - a negative value if the first argument is less than the second, * - a positive value if it is greater than the second, * - or zero if they are equivalent. * @see {@link Array.sort} */ export declare const arraySort: (compareFunction: (a: T, b: T) => number, targetArray: T[]) => T[]; /** * Shuffle the target array. * @see https://github.com/mqyqingfeng/Blog/issues/51 */ export declare const shuffle: (target: T[]) => T[]; /** * Applies a function to the value at the given index of an array, * returning a new copy of the array with the element at the given index * replaced with the result of the function application. * @see {@link https://ramdajs.com/docs/#adjust} */ export declare const arrayAdjust: (index: number, transformation: (item: T) => T, targetArray: T[]) => T[]; /** * Returns a new copy of the array with the element * at the provided index replaced with the given value. * @see {@link https://ramdajs.com/docs/#update} * @see {@link arrayAdjust} */ export declare const arrayUpdate: (index: number, newItem: T, targetArray: T[]) => T[]; //# sourceMappingURL=array.d.ts.map