/** * @file * * Mocks of the helper methods Obsidian adds to `Array.prototype`, each called with the array as `this`. */ /** * Checks whether the array includes a value, like `Array.prototype.includes`. * * @typeParam T - The array's element type. * @param target - The value to look for. * @returns `true` when the array includes `target`. */ export declare function contains(this: T[], target: T): boolean; /** * Finds the index of the last element matching a predicate, scanning from the end. * * @typeParam T - The array's element type. * @param predicate - Called with each element; the scan stops at the first one it returns `true` for. `undefined` * elements are skipped without calling it. * @returns The index of the last matching element, or `-1` when none matches. */ export declare function findLastIndex(this: T[], predicate: (value: T) => boolean): number; /** * Gets the array's first element. * * @typeParam T - The array's element type. * @returns The first element, or `undefined` when the array is empty. */ export declare function first(this: T[]): T | undefined; /** * Gets the array's last element. * * @typeParam T - The array's element type. * @returns The last element, or `undefined` when the array is empty. */ export declare function last(this: T[]): T | undefined; /** * Removes the first occurrence of a value from the array in place; does nothing when it is absent. * * @typeParam T - The array's element type. * @param target - The value to remove. */ export declare function remove(this: T[], target: T): void; /** * Shuffles the array in place. Obsidian shuffles randomly; the mock reverses the array instead, so tests stay * deterministic. * * @typeParam T - The array's element type. * @returns The same array, now reordered. */ export declare function shuffle(this: T[]): T[]; /** * Collects the array's distinct values, keeping the order of their first occurrence. * * @typeParam T - The array's element type. * @returns A new array without duplicates. */ export declare function unique(this: T[]): T[];