| [a762898] | 1 | import { Many } from '../_internal/Many.js';
|
|---|
| 2 | import { MutableList } from '../_internal/MutableList.d.js';
|
|---|
| 3 | import { RejectReadonly } from '../_internal/RejectReadonly.d.js';
|
|---|
| 4 |
|
|---|
| 5 | /**
|
|---|
| 6 | * Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
|
|---|
| 7 | * Indexes may be specified as an array of indexes or as individual arguments.
|
|---|
| 8 | *
|
|---|
| 9 | * **Note:** Unlike `_.at`, this method mutates `array`.
|
|---|
| 10 | *
|
|---|
| 11 | * @template T
|
|---|
| 12 | * @param {T[]} array - The array to modify.
|
|---|
| 13 | * @param {...Array<number | number[]>} indexes - The indexes of elements to remove, specified as individual indexes or arrays of indexes.
|
|---|
| 14 | * @returns {T[]} Returns the new array of removed elements.
|
|---|
| 15 | *
|
|---|
| 16 | * @example
|
|---|
| 17 | * var array = [5, 10, 15, 20];
|
|---|
| 18 | * var evens = pullAt(array, 1, 3);
|
|---|
| 19 | *
|
|---|
| 20 | * console.log(array);
|
|---|
| 21 | * // => [5, 15]
|
|---|
| 22 | *
|
|---|
| 23 | * console.log(evens);
|
|---|
| 24 | * // => [10, 20]
|
|---|
| 25 | */
|
|---|
| 26 | declare function pullAt<T>(array: T[], ...indexes: Array<Many<number>>): T[];
|
|---|
| 27 | /**
|
|---|
| 28 | * Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
|
|---|
| 29 | * Indexes may be specified as an array of indexes or as individual arguments.
|
|---|
| 30 | *
|
|---|
| 31 | * **Note:** Unlike `_.at`, this method mutates `array`.
|
|---|
| 32 | *
|
|---|
| 33 | * @template L
|
|---|
| 34 | * @param {L} array - The array to modify.
|
|---|
| 35 | * @param {...Array<number | number[]>} indexes - The indexes of elements to remove, specified as individual indexes or arrays of indexes.
|
|---|
| 36 | * @returns {L} Returns the new array of removed elements.
|
|---|
| 37 | *
|
|---|
| 38 | * @example
|
|---|
| 39 | * var array = [5, 10, 15, 20];
|
|---|
| 40 | * var evens = pullAt(array, 1, 3);
|
|---|
| 41 | *
|
|---|
| 42 | * console.log(array);
|
|---|
| 43 | * // => [5, 15]
|
|---|
| 44 | *
|
|---|
| 45 | * console.log(evens);
|
|---|
| 46 | * // => [10, 20]
|
|---|
| 47 | */
|
|---|
| 48 | declare function pullAt<L extends MutableList<any>>(array: RejectReadonly<L>, ...indexes: Array<Many<number>>): L;
|
|---|
| 49 |
|
|---|
| 50 | export { pullAt };
|
|---|