interface Array { first: typeof first; findById: typeof findById; last: typeof last; exists: typeof exists; intersect: typeof intersect; } /** * This function returns the first element of the array, if it exists. Otherwise it returns undefined. * @param this The array itself * @returns T | undefined */ declare function first(this: T[]): T | undefined; /** * This function returns the first element of the array, if it exists. Otherwise it returns undefined. * @param this The array itself * @returns T | undefined */ declare function findById(this: T[], id: number): T | undefined; /** * This function returns the last element of the array, if it exists. Otherwise it returns undefined. * @param this The array itself * @returns T | undefined */ declare function last(this: T[]): T | undefined; /** * This function returns true, if the array exists (has more than one element). * @param this The array itself * @returns boolean */ declare function exists(this: T[]): boolean; /** * This function gets the intersects of two arrays. * @param this The array itself * @param array The relative array. The other one, that needs to check. * @example array.intersect(array2); * @returns Array */ declare function intersect(this: T[], array: T[]): T[];