Interface IFilesArray

A convenience type.

{@link http://gruntjs.com/configuring-tasks#files}

Hierarchy

Index

Index signatures

Properties

Methods

Index signatures

(n: number): T in Array<T>

Parameters

  • n: number

Returns

T in Array<T>

Properties

public length: number

Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.

Methods

public concat(items?: Array<U extends T[]>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<U extends T[]> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public concat(items?: Array<T>): Array<T>

Combines two or more arrays.

Parameters

  • items?: Array<T> optional

    Additional items to add to the end of array1.

Returns

Array<T>

public every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether all the members of an array satisfy the specified test.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): Array<T>

Returns the elements of an array that meet the condition specified in a callback function.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

Array<T>

public forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any)

Performs the specified action for each element in an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => void

    A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

public indexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the first occurrence of a value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

Returns

number

public join(separator?: string): string

Adds all the elements of an array separated by the specified separator string.

Parameters

  • separator?: string optional

    A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

Returns

string

public lastIndexOf(searchElement: T in Array<T>, fromIndex?: number): number

Returns the index of the last occurrence of a specified value in an array.

Parameters

  • searchElement: T in Array<T>

    The value to locate in the array.

  • fromIndex?: number optional

    The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.

Returns

number

public map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): Array<U>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => U

    A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

Array<U>

public pop(): T in Array<T>

Removes the last element from an array and returns it.

Returns

T in Array<T>

public push(items?: Array<T>): number

Appends new elements to an array, and returns the new length of the array.

Parameters

  • items?: Array<T> optional

    New elements of the Array.

Returns

number

public reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T in Array<T>): T in Array<T>

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue?: T in Array<T> optional

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

T in Array<T>

public reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

Parameters

  • callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U

    A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

  • initialValue: U

    If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

Returns

U

public reverse(): Array<T>

Reverses the elements in an Array.

Returns

Array<T>

public shift(): T in Array<T>

Removes the first element from an array and returns it.

Returns

T in Array<T>

public slice(start?: number, end?: number): Array<T>

Returns a section of an array.

Parameters

  • start?: number optional

    The beginning of the specified portion of the array.

  • end?: number optional

    The end of the specified portion of the array.

Returns

Array<T>

public some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean

Determines whether the specified callback function returns true for any element of an array.

Parameters

  • callbackfn: (value: T, index: number, array: T[]) => boolean

    A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.

  • thisArg?: any optional

    An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Returns

boolean

public sort(compareFn?: (a: T, b: T) => number): Array<T>

Sorts an array.

Parameters

  • compareFn?: (a: T, b: T) => number optional

    The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.

Returns

Array<T>

public splice(start: number): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

Returns

Array<T>

public splice(start: number, deleteCount: number, items?: Array<T>): Array<T>

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

  • start: number

    The zero-based location in the array from which to start removing elements.

  • deleteCount: number

    The number of elements to remove.

  • items?: Array<T> optional

    Elements to insert into the array in place of the deleted elements.

Returns

Array<T>

public toLocaleString(): string

Returns

string

public toString(): string

Returns a string representation of an array.

Returns

string

public unshift(items?: Array<T>): number

Inserts new elements at the start of an array.

Parameters

  • items?: Array<T> optional

    Elements to insert at the start of the Array.

Returns

number