import { Option } from '../Option' ; import { ExtractNested } from '../types' ; /** Creates an empty array. Alternative for `const xs = [] as ReadonlyArray<A>`. */ export declare function makeEmpty < A > ( ) ; /** Returns a new array of size `n` populated by `mapFn(index)`, or an empty array if `n` is negative. */ export declare function makeWithIndex < A > ( n , mapFn ) ; export declare function makeWithIndex < A > ( mapFn ) ; /** Returns a new array of size `n` populated by `element`, or an empty array if `n` is negative. */ export declare function make < A > ( n , element ) ; export declare function make < A > ( element ) ; /** Alias for `make`. */ export declare function repeat < A > ( n , element ) ; export declare function repeat < A > ( element ) ; /** Returns the size of the provided array. */ export declare function length < A > ( xs ) ; /** Determines whether the given array is empty. */ export declare function isEmpty < A > ( xs ) ; /** Determines whether the given array is not empty. */ export declare function isNotEmpty < A > ( xs ) ; /** Returns a new array with the elements of the provided array in reverse order. */ export declare function reverse < A > ( xs ) ; /** Adds a single element to the end of an array. */ export declare function append < A > ( xs , element ) ; export declare function append < A > ( element ) ; /** Prepends a single element to the start of the given array. */ export declare function prepend < A > ( xs , element ) ; export declare function prepend < A > ( element ) ; /** Returns a new array which contains the given delimiter inserted before every element in the provided array. */ export declare function prependToAll < A > ( xs , delimiter ) ; export declare function prependToAll < A > ( delimiter ) ; /** Creates a new array with the separator interposed between elements. */ export declare function intersperse < A > ( xs , delimiter ) ; export declare function intersperse < A > ( delimiter ) ; /** Returns `Some(value)` at the given index, or `None` if the given index is out of range. */ export declare function get < A > ( xs , index ) ; export declare function get < A > ( index ) ; /** Alias for `get`. */ export declare function at < A > ( xs , index ) ; export declare function at < A > ( index ) ; /** Returns `value` at the given index (use only if you're entirely sure that a value exists at the given index). */ export declare function getUnsafe < A > ( xs , index ) ; export declare function getUnsafe < A > ( index ) ; /** Returns `value` at the given index, or `undefined` if the given index is out of range. */ export declare function getUndefined < A > ( xs , index ) ; export declare function getUndefined < A > ( index ) ; /** Returns `Some(value)` for the first element in the array that satisifies the given predicate function, or `None` if no element satisifies the predicate. */ export declare function getBy < A > ( xs , predicateFn ) ; export declare function getBy < A > ( predicateFn ) ; /** Alias for `getBy`. */ export declare function find < A > ( xs , predicateFn ) ; export declare function find < A > ( predicateFn ) ; /** Returns `Some(value)` where `value` is the first element of the array, or `None` if the given array is empty. */ export declare function head < A > ( xs ) ; /** Returns the last element (`Some(value)`) in the array, or `None` if the given array is empty. */ export declare function last < A > ( xs ) ; /** Returns a new array containing all but the the first element of the provided array, or `None` if the given array is empty (has no tail). */ export declare function tail < A > ( xs ) ; /** Returns a new array containing all but the first element of the provided array, or an empty array if the given array is empty (has no tail). */ export declare function tailOrEmpty < A > ( xs ) ; /** Returns a new array (`Some(xs)`) with all elements except the last of the provided array. */ export declare function init < A > ( xs ) ; /** Returns a new array with all elements except the last of the provided array, or an empty array if the given array is empty. */ export declare function initOrEmpty < A > ( xs ) ; /** Returns a new array including the first `n` elements of the provided array, or an empty array if `n` is either negative or greater than the length of the provided array. */ export declare function take < A > ( xs , n ) ; export declare function take < A > ( n ) ; /** Returns a new array (`Some(xs)`) with the first `n` elements of the provided array, or `None` if `n` is either negative or greater than the length of the provided array. */ export declare function takeExactly < A > ( xs , n ) ; export declare function takeExactly < A > ( n ) ; /** Returns a new array, filled with elements from the provided array until an element doesn't pass the provided predicate. */ export declare function takeWhile < A > ( xs , predicateFn ) ; export declare function takeWhile < A > ( predicateFn ) ; /** Returns a new array that does not contain the first `n` elements of the provided array, or an empty array if `n` is either less than `0` or greater than the length of the provided array. */ export declare function drop < A > ( xs , n ) ; export declare function drop < A > ( n ) ; /** Returns a new array (`Some(xs)`) that does not contain the first `n` elements of the provided array, or `None` if `n` is either less than `0` or greater than the length of the provided array. */ export declare function dropExactly < A > ( xs , n ) ; export declare function dropExactly < A > ( n ) ; /** Drops elements from the beginning of the array until an element is reached which does not satisfy the given predicate. */ export declare function dropWhile < A > ( xs , predicateFn ) ; export declare function dropWhile < A > ( predicateFn ) ; /** Splits the provided array into head and tail parts (as a tuple), but only if the array is not empty. */ export declare function uncons < A > ( xs ) ; /** Returns a new array by calling `mapFn` for each element of the provided array. */ export declare function map < A , B > ( xs , mapFn ) ; export declare function map < A , B > ( mapFn ) ; /** Returns a new array by calling `mapFn` (which takes two arguments: the element from array and its index) for each element of the provided array. */ export declare function mapWithIndex < A , B > ( xs , mapFn ) ; export declare function mapWithIndex < A , B > ( mapFn ) ; /** Returns a new array that keep all elements satisfy the given predicate. */ export declare function filter < A > ( xs , predicateFn ) ; export declare function filter < A > ( predicateFn ) ; /** Alias for `filter`. */ export declare function keep < A > ( xs , predicateFn ) ; export declare function keep < A > ( predicateFn ) ; /** Returns a new array that keep all elements satisfy the given predicate (which take two arguments: the element for the array and its index). */ export declare function filterWithIndex < A > ( xs , predicateFn ) ; export declare function filterWithIndex < A > ( predicateFn ) ; /** Alias for `filterWithIndex`. */ export declare function keepWithIndex < A > ( xs , predicateFn ) ; export declare function keepWithIndex < A > ( predicateFn ) ; /** Returns a new array of elements from the provided array which do not satisfy the given predicate. */ export declare function reject < A > ( xs , predicateFn ) ; export declare function reject < A > ( predicateFn ) ; /** Returns a new array of elements from the provided array which do not satisfy the given predicate (which take two arguments: the element for the array and its index). */ export declare function rejectWithIndex < A > ( xs , predicateFn ) ; export declare function rejectWithIndex < A > ( predicateFn ) ; /** Applies `reduceFn` (which has two parameters: an `accumulator` which starts with a value of `initialValue` and the next value from the array) to each element of the provided array, and eventually it returns the final value of the accumulator. */ export declare function reduce < A , B > ( xs , initialValue , reduceFn ) ; export declare function reduce < A , B > ( initialValue , reduceFn ) ; /** Works like A.reduce, except that the function `reduceFn` is applied to each item of `xs` from the last back to the first. */ export declare function reduceReverse < A , B > ( xs , initialValue , reduceFn ) ; export declare function reduceReverse < A , B > ( initialValue , reduceFn ) ; /** Applies `reduceFn` (which has three parameters: an `accumulator` which starts with a value of `initialValue`, the next value from the array and its index) to each element of the provided array, and eventually it returns the final value of the accumulator. */ export declare function reduceWithIndex < A , B > ( xs , initialValue , reduceFn ) ; export declare function reduceWithIndex < A , B > ( initialValue , reduceFn ) ; /** Returns two arrays (`Some([xs, ys])`), with the original array divided at the given index, or `None` if the index is out of range. */ export declare function splitAt < A > ( xs , offset ) ; export declare function splitAt < A > ( offset ) ; /** Returns an array of arrays, where each of the inner arrays has length equal to the provided `size` parameter. */ export declare function splitEvery < A > ( xs , size ) ; export declare function splitEvery < A > ( size ) ; /** Returns a new array with elements in the original array randomly shuffled. */ export declare function shuffle < A > ( xs ) ; /** Splits the provided array into two separate arrays - one containing elements which satisfy the predicate, and the other array containing the elements which do not satisfy the predicate. */ export declare function partition < A > ( xs , fn ) ; export declare function partition < A > ( fn ) ; /** Returns a new array containing the concatenation of two provided arrays. */ export declare function concat < A > ( xs1 ) ; export declare function concat < A > ( xs0 , xs1 ) ; /** Returns a new array as the concatenation of the provided array of arrays. */ export declare function concatMany < A > ( xs ) ; /** Returns `true`` if all elements satisfy the given predicate. */ export declare function every < A > ( xs , fn ) ; export declare function every < A > ( fn ) ; /** Returns `true` if at least one of the elements in the given array satifies the predicate. */ export declare function some < A > ( xs , fn ) ; export declare function some < A > ( fn ) ; /** Returns a new array with the `len` elements of the given array starting at `offset` (offset can be negative). */ export declare function slice < A > ( xs , offset , len ) ; export declare function slice < A > ( offset , len ) ; /** Returns a new array with the elements of the given array starting at `offset` (offset can be negative). */ export declare function sliceToEnd < A > ( xs , offset ) ; export declare function sliceToEnd < A > ( offset ) ; /** Returns `false` if length of both arrays is not the same, otherwise compares elements one by one using the comparator. */ export declare function eq < A > ( xs0 , xs1 , comparatorFn ) ; export declare function eq < A > ( xs1 , comparatorFn ) ; /** Returns a new array of numbers from `start` (inclusive) to `finish` (exclusive). */ export declare function range ( finish ) ; export declare function range ( start , finish ) ; /** Returns a new array of numbers from `start` (inclusive) to `finish` (exclusive). */ export declare function rangeBy ( finish , step ) ; export declare function rangeBy ( start , finish , step ) ; /** Returns a copy of the provided array. */ export declare function copy < A > ( xs ) ; /** Creates a new array of pairs from corresponding elements of two provided arrays. */ export declare function zip < A , B > ( xs1 ) ; export declare function zip < A , B > ( xs0 , xs1 ) ; /** Creates a new array by applying `zipFn` to corresponding elements of two provided arrays. */ export declare function zipWith < A , B , C > ( xs0 , xs1 , zipFn ) ; export declare function zipWith < A , B , C > ( xs1 , zipFn ) ; /** Takes an array of pairs and creates a pair of arrays. The first array contains all the first elements of the pairs and the other one contains all the second elements. */ export declare function unzip < A , B > ( xs ) ; /** Creates a new array by replacing the value at the given index with the given value (no replacement is made if the index is out of range). */ export declare function replaceAt < A > ( xs , targetIndex , element ) ; export declare function replaceAt < A > ( targetIndex , element ) ; /** Creates a new array that inserts the given value at the given index (no insertion is made if the index is out of range). */ export declare function insertAt < A > ( xs , targetIndex , element ) ; export declare function insertAt < A > ( targetIndex , element ) ; /** Creates a new array that replaces the value at the given index with the value returned by the provided function (the original array if the index is out of range). */ export declare function updateAt < A > ( xs , targetIndex , fn ) ; export declare function updateAt < A > ( targetIndex , fn ) ; /** Creates a new array with the elements at the two given indexes swapped (the original array if the index is out of range). */ export declare function swapAt < A > ( xs , targetIndex , swapIndex ) ; export declare function swapAt < A > ( targetIndex , swapIndex ) ; /** Creates a new array without the element at the given index (the original array if the index is out of range). */ export declare function removeAt < A > ( xs , targetIndex ) ; export declare function removeAt < A > ( targetIndex ) ; /** Returns a new array containing only one copy of each element in the provided array, based upon the value returned by applying the function to each element. */ export declare function uniqBy < A , B > ( xs , uniqFn ) ; export declare function uniqBy < A , B > ( uniqFn ) ; /** Returns a new array containing only one copy of each element in the provided array. */ export declare function uniq < A > ( xs ) ; /** Calls `fn` on each element of the provided array. */ export declare function forEach < A > ( xs , fn ) ; export declare function forEach < A > ( fn ) ; /** Calls `fn` (which takes two arguments: the element from array and its index) on each element of the provided array. */ export declare function forEachWithIndex < A > ( xs , fn ) ; export declare function forEachWithIndex < A > ( fn ) ; /** Returns `Some(index)` for the first value in the provided array that satisifies the predicate function. */ export declare function getIndexBy < A > ( xs , predicateFn ) ; export declare function getIndexBy < A > ( predicateFn ) ; /** Returns `true` if the provided value is equal to at least one element of the given array. */ export declare function includes < A > ( xs , value ) ; export declare function includes < A > ( value ) ; /** Converts each element of the array to a string and concatenates them, separated by the given string. */ export declare function join < A > ( xs , delimiter ) ; export declare function join < A > ( delimiter ) ; /** Returns a new array, sorted according to the comparator function. */ export declare function sort < A > ( xs , sortFn ) ; export declare function sort < A > ( sortFn ) ; /** Returns a new array, sorted according to the provided function. */ export declare function sortBy < A , B > ( xs , sortFn ) ; export declare function sortBy < A , B > ( sortFn ) ; /** Splits the given array into sub-arrays in an object, grouped by the result of running each value through the provided function. */ export declare function groupBy < A , B extends PropertyKey > ( xs , groupFn ) ; export declare function groupBy < A , B extends PropertyKey > ( groupFn ) ; /** Creates a new array with all sub-array elements concatenated into it (the single level depth). */ export declare function flat < A > ( xs ) ; /** Creates a new array with all sub-array elements concatenated into it recursively up to the `Infinite` depth. */ export declare function deepFlat < A > ( xs ) ; /** Converts the given array to the TypeScript's tuple. */ export declare function toTuple < T extends ReadonlyArray < any > > ( xs ) ; /** Applies a side-effect function on each element of the provided array. */ export declare function tap < A > ( xs , fn ) ; export declare function tap < A > ( fn ) ; /** Returns a new tuple with the reverse order of the elements. */ export declare function flip < A , B > ( xs ) ; /** Returns a new array that keep all elements that return `Some(value)` applied within `predicateFn`. */ export declare function filterMap < A , B > ( xs , predicateFn ) ; export declare function filterMap < A , B > ( predicateFn ) ; /** Alias for `filterMap`. */ export declare function keepMap < A , B > ( xs , predicateFn ) ; export declare function keepMap < A , B > ( predicateFn ) ; /** Removes the first occurrence of the given value from the array, using the given equality function. */ export declare function removeFirstBy < A , B > ( xs , value , predicateFn ) ; export declare function removeFirstBy < A , B > ( value , predicateFn ) ; /** Creates a copy of the given array with the first occurrence of the given element removed */ export declare function removeFirst < A > ( xs , value ) ; export declare function removeFirst < A > ( value ) ; /** Creates a new array of each value paired with its index in a tuple. */ export declare function zipWithIndex < A > ( xs ) ;