| 1 | import { MutableList } from '../_internal/MutableList.d.mjs';
|
|---|
| 2 | import { RejectReadonly } from '../_internal/RejectReadonly.d.mjs';
|
|---|
| 3 |
|
|---|
| 4 | /**
|
|---|
| 5 | * This method is like `_.pullAll` except that it accepts `comparator` which is
|
|---|
| 6 | * invoked to compare elements of array to values. The comparator is invoked with
|
|---|
| 7 | * two arguments: (arrVal, othVal).
|
|---|
| 8 | *
|
|---|
| 9 | * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
|---|
| 10 | *
|
|---|
| 11 | * @template T
|
|---|
| 12 | * @param {T[]} array - The array to modify.
|
|---|
| 13 | * @param {ArrayLike<T>} [values] - The values to remove.
|
|---|
| 14 | * @param {(a: T, b: T) => boolean} [comparator] - The comparator invoked per element.
|
|---|
| 15 | * @returns {T[]} Returns `array`.
|
|---|
| 16 | *
|
|---|
| 17 | * @example
|
|---|
| 18 | * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
|---|
| 19 | *
|
|---|
| 20 | * pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
|---|
| 21 | * console.log(array);
|
|---|
| 22 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
|---|
| 23 | */
|
|---|
| 24 | declare function pullAllWith<T>(array: T[], values?: ArrayLike<T>, comparator?: (a: T, b: T) => boolean): T[];
|
|---|
| 25 | /**
|
|---|
| 26 | * This method is like `_.pullAll` except that it accepts `comparator` which is
|
|---|
| 27 | * invoked to compare elements of array to values. The comparator is invoked with
|
|---|
| 28 | * two arguments: (arrVal, othVal).
|
|---|
| 29 | *
|
|---|
| 30 | * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
|---|
| 31 | *
|
|---|
| 32 | * @template L
|
|---|
| 33 | * @param {RejectReadonly<L>} array - The array to modify.
|
|---|
| 34 | * @param {List<L[0]>} [values] - The values to remove.
|
|---|
| 35 | * @param {Comparator<L[0]>} [comparator] - The comparator invoked per element.
|
|---|
| 36 | * @returns {L} Returns `array`.
|
|---|
| 37 | *
|
|---|
| 38 | * @example
|
|---|
| 39 | * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
|---|
| 40 | *
|
|---|
| 41 | * pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
|---|
| 42 | * console.log(array);
|
|---|
| 43 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
|---|
| 44 | */
|
|---|
| 45 | declare function pullAllWith<L extends MutableList<any>>(array: RejectReadonly<L>, values?: ArrayLike<L[0]>, comparator?: (a: L[0], b: L[0]) => boolean): L;
|
|---|
| 46 | /**
|
|---|
| 47 | * This method is like `_.pullAll` except that it accepts `comparator` which is
|
|---|
| 48 | * invoked to compare elements of array to values. The comparator is invoked with
|
|---|
| 49 | * two arguments: (arrVal, othVal).
|
|---|
| 50 | *
|
|---|
| 51 | * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
|---|
| 52 | *
|
|---|
| 53 | * @template T, U
|
|---|
| 54 | * @param {T[]} array - The array to modify.
|
|---|
| 55 | * @param {ArrayLike<U>} values - The values to remove.
|
|---|
| 56 | * @param {(a: T, b: U) => boolean} comparator - The comparator invoked per element.
|
|---|
| 57 | * @returns {T[]} Returns `array`.
|
|---|
| 58 | *
|
|---|
| 59 | * @example
|
|---|
| 60 | * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
|---|
| 61 | *
|
|---|
| 62 | * pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
|---|
| 63 | * console.log(array);
|
|---|
| 64 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
|---|
| 65 | */
|
|---|
| 66 | declare function pullAllWith<T, U>(array: T[], values: ArrayLike<U>, comparator: (a: T, b: U) => boolean): T[];
|
|---|
| 67 | /**
|
|---|
| 68 | * This method is like `_.pullAll` except that it accepts `comparator` which is
|
|---|
| 69 | * invoked to compare elements of array to values. The comparator is invoked with
|
|---|
| 70 | * two arguments: (arrVal, othVal).
|
|---|
| 71 | *
|
|---|
| 72 | * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
|---|
| 73 | *
|
|---|
| 74 | * @template L1, L2
|
|---|
| 75 | * @param {RejectReadonly<L1>} array - The array to modify.
|
|---|
| 76 | * @param {List<L2>} values - The values to remove.
|
|---|
| 77 | * @param {Comparator2<L1[0], L2>} comparator - The comparator invoked per element.
|
|---|
| 78 | * @returns {L1} Returns `array`.
|
|---|
| 79 | *
|
|---|
| 80 | * @example
|
|---|
| 81 | * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
|---|
| 82 | *
|
|---|
| 83 | * pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
|---|
| 84 | * console.log(array);
|
|---|
| 85 | * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
|---|
| 86 | */
|
|---|
| 87 | declare function pullAllWith<L1 extends MutableList<any>, L2>(array: RejectReadonly<L1>, values: ArrayLike<L2>, comparator: (a: L1[0], b: L2) => boolean): L1;
|
|---|
| 88 |
|
|---|
| 89 | export { pullAllWith };
|
|---|