@types/lodash 4.17.18 → 4.17.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lodash/README.md +1 -1
- lodash/common/array.d.ts +19 -11
- lodash/common/common.d.ts +4 -0
- lodash/package.json +2 -2
lodash/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for lodash (https://lodash.com).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 01 Jul 2025 20:02:28 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
|
|
14
14
|
# Credits
|
lodash/common/array.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import _ = require("../index");
|
|
2
|
+
|
|
3
|
+
// Helper types to reject readonly arrays
|
|
4
|
+
type _Eq<T, U> = (<X>() => X extends T ? 1 : 2) extends (<X>() => X extends U ? 1 : 2) ? true : false
|
|
5
|
+
type _IsWritable<T> = _Eq<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>
|
|
6
|
+
type RejectReadonly<T extends _.MutableList<unknown>> = _IsWritable<T> extends true ? T : never
|
|
7
|
+
|
|
8
|
+
export {}
|
|
9
|
+
|
|
2
10
|
declare module "../index" {
|
|
3
11
|
interface LoDashStatic {
|
|
4
12
|
/**
|
|
@@ -342,7 +350,7 @@ declare module "../index" {
|
|
|
342
350
|
/**
|
|
343
351
|
* @see _.fill
|
|
344
352
|
*/
|
|
345
|
-
fill<T, AnyList extends
|
|
353
|
+
fill<T, AnyList extends MutableList<any>>(array: RejectReadonly<AnyList> | null | undefined, value: T): List<T>;
|
|
346
354
|
/**
|
|
347
355
|
* @see _.fill
|
|
348
356
|
*/
|
|
@@ -350,7 +358,7 @@ declare module "../index" {
|
|
|
350
358
|
/**
|
|
351
359
|
* @see _.fill
|
|
352
360
|
*/
|
|
353
|
-
fill<T, UList extends
|
|
361
|
+
fill<T, UList extends MutableList<any>>(array: RejectReadonly<UList> | null | undefined, value: T, start?: number, end?: number): List<T | UList[0]>;
|
|
354
362
|
}
|
|
355
363
|
interface Collection<T> {
|
|
356
364
|
/**
|
|
@@ -932,7 +940,7 @@ declare module "../index" {
|
|
|
932
940
|
/**
|
|
933
941
|
* @see _.pull
|
|
934
942
|
*/
|
|
935
|
-
pull<TList extends
|
|
943
|
+
pull<TList extends MutableList<any>>(array: RejectReadonly<TList>, ...values: TList[0][]): TList;
|
|
936
944
|
}
|
|
937
945
|
interface Collection<T> {
|
|
938
946
|
/**
|
|
@@ -968,7 +976,7 @@ declare module "../index" {
|
|
|
968
976
|
/**
|
|
969
977
|
* @see _.pullAll
|
|
970
978
|
*/
|
|
971
|
-
pullAll<TList extends
|
|
979
|
+
pullAll<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>): TList;
|
|
972
980
|
}
|
|
973
981
|
interface Collection<T> {
|
|
974
982
|
/**
|
|
@@ -1007,7 +1015,7 @@ declare module "../index" {
|
|
|
1007
1015
|
/**
|
|
1008
1016
|
* @see _.pullAllBy
|
|
1009
1017
|
*/
|
|
1010
|
-
pullAllBy<TList extends
|
|
1018
|
+
pullAllBy<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>, iteratee?: ValueIteratee<TList[0]>): TList;
|
|
1011
1019
|
/**
|
|
1012
1020
|
* @see _.pullAllBy
|
|
1013
1021
|
*/
|
|
@@ -1015,7 +1023,7 @@ declare module "../index" {
|
|
|
1015
1023
|
/**
|
|
1016
1024
|
* @see _.pullAllBy
|
|
1017
1025
|
*/
|
|
1018
|
-
pullAllBy<T1List extends
|
|
1026
|
+
pullAllBy<T1List extends MutableList<any>, T2>(array: RejectReadonly<T1List>, values: List<T2>, iteratee: ValueIteratee<T1List[0] | T2>): T1List;
|
|
1019
1027
|
}
|
|
1020
1028
|
interface Collection<T> {
|
|
1021
1029
|
/**
|
|
@@ -1054,7 +1062,7 @@ declare module "../index" {
|
|
|
1054
1062
|
/**
|
|
1055
1063
|
* @see _.pullAllWith
|
|
1056
1064
|
*/
|
|
1057
|
-
pullAllWith<TList extends
|
|
1065
|
+
pullAllWith<TList extends MutableList<any>>(array: RejectReadonly<TList>, values?: List<TList[0]>, comparator?: Comparator<TList[0]>): TList;
|
|
1058
1066
|
/**
|
|
1059
1067
|
* @see _.pullAllWith
|
|
1060
1068
|
*/
|
|
@@ -1062,7 +1070,7 @@ declare module "../index" {
|
|
|
1062
1070
|
/**
|
|
1063
1071
|
* @see _.pullAllWith
|
|
1064
1072
|
*/
|
|
1065
|
-
pullAllWith<T1List extends
|
|
1073
|
+
pullAllWith<T1List extends MutableList<any>, T2>(array: RejectReadonly<T1List>, values: List<T2>, comparator: Comparator2<T1List[0], T2>): T1List;
|
|
1066
1074
|
}
|
|
1067
1075
|
interface Collection<T> {
|
|
1068
1076
|
/**
|
|
@@ -1091,7 +1099,7 @@ declare module "../index" {
|
|
|
1091
1099
|
/**
|
|
1092
1100
|
* @see _.pullAt
|
|
1093
1101
|
*/
|
|
1094
|
-
pullAt<TList extends
|
|
1102
|
+
pullAt<TList extends MutableList<any>>(array: RejectReadonly<TList>, ...indexes: Array<Many<number>>): TList;
|
|
1095
1103
|
}
|
|
1096
1104
|
interface Collection<T> {
|
|
1097
1105
|
/**
|
|
@@ -1116,7 +1124,7 @@ declare module "../index" {
|
|
|
1116
1124
|
* @param predicate The function invoked per iteration.
|
|
1117
1125
|
* @return Returns the new array of removed elements.
|
|
1118
1126
|
*/
|
|
1119
|
-
remove<TList extends
|
|
1127
|
+
remove<TList extends MutableList<any>>(array: RejectReadonly<TList>, predicate?: ListIteratee<TList[0]>): TList[0][];
|
|
1120
1128
|
}
|
|
1121
1129
|
interface Collection<T> {
|
|
1122
1130
|
/**
|
|
@@ -1150,7 +1158,7 @@ declare module "../index" {
|
|
|
1150
1158
|
* console.log(array);
|
|
1151
1159
|
* // => [3, 2, 1]
|
|
1152
1160
|
*/
|
|
1153
|
-
reverse<TList extends
|
|
1161
|
+
reverse<TList extends MutableList<any>>(array: RejectReadonly<TList>): TList;
|
|
1154
1162
|
}
|
|
1155
1163
|
interface LoDashStatic {
|
|
1156
1164
|
/**
|
lodash/common/common.d.ts
CHANGED
|
@@ -246,6 +246,10 @@ declare module "../index" {
|
|
|
246
246
|
type PropertyPath = Many<PropertyName>;
|
|
247
247
|
/** Common interface between Arrays and jQuery objects */
|
|
248
248
|
type List<T> = ArrayLike<T>;
|
|
249
|
+
interface MutableList<T> { // Needed since ArrayLike is readonly
|
|
250
|
+
length: number;
|
|
251
|
+
[k: number]: T;
|
|
252
|
+
}
|
|
249
253
|
interface Dictionary<T> {
|
|
250
254
|
[index: string]: T;
|
|
251
255
|
}
|
lodash/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/lodash",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.20",
|
|
4
4
|
"description": "TypeScript definitions for lodash",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,6 +51,6 @@
|
|
|
51
51
|
"scripts": {},
|
|
52
52
|
"dependencies": {},
|
|
53
53
|
"peerDependencies": {},
|
|
54
|
-
"typesPublisherContentHash": "
|
|
54
|
+
"typesPublisherContentHash": "965f926f13027c7e00359bf3899ec168b333c7e871110fa4d25af188bdcf5f08",
|
|
55
55
|
"typeScriptVersion": "5.1"
|
|
56
56
|
}
|