UNPKG

48.2 kBTypeScriptView Raw
1import _ = require("../index");
2// tslint:disable-next-line:strict-export-declare-modifiers
3type GlobalFunction = Function;
4declare module "../index" {
5 type FunctionBase = GlobalFunction;
6 interface LoDashStatic {
7 /**
8 * Casts value as an array if it’s not one.
9 *
10 * @param value The value to inspect.
11 * @return Returns the cast array.
12 */
13 castArray<T>(value?: Many<T>): T[];
14 }
15 interface Collection<T> {
16 /**
17 * @see _.castArray
18 */
19 castArray(): Collection<T>;
20 }
21 interface String {
22 /**
23 * @see _.castArray
24 */
25 castArray(): Collection<string>;
26 }
27 interface Object<T> {
28 /**
29 * @see _.castArray
30 */
31 castArray(): Collection<T>;
32 }
33 interface Function<T extends (...args: any) => any> {
34 /**
35 * @see _.castArray
36 */
37 castArray(): Collection<T>;
38 }
39 interface Primitive<T> {
40 /**
41 * @see _.castArray
42 */
43 castArray(): Collection<T>;
44 }
45 interface CollectionChain<T> {
46 /**
47 * @see _.castArray
48 */
49 castArray(): CollectionChain<T>;
50 }
51 interface StringChain {
52 /**
53 * @see _.castArray
54 */
55 castArray(): CollectionChain<string>;
56 }
57 interface StringNullableChain {
58 /**
59 * @see _.castArray
60 */
61 castArray(): CollectionChain<string | undefined>;
62 }
63 interface ObjectChain<T> {
64 /**
65 * @see _.castArray
66 */
67 castArray(): CollectionChain<T>;
68 }
69 interface FunctionChain<T extends (...args: any) => any> {
70 /**
71 * @see _.castArray
72 */
73 castArray(): CollectionChain<T>;
74 }
75 interface PrimitiveChain<T> {
76 /**
77 * @see _.castArray
78 */
79 castArray(): CollectionChain<T>;
80 }
81
82 interface LoDashStatic {
83 /**
84 * Creates a shallow clone of value.
85 *
86 * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays,
87 * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols,
88 * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty
89 * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps.
90 *
91 * @param value The value to clone.
92 * @return Returns the cloned value.
93 */
94 clone<T>(value: T): T;
95 }
96
97 interface LoDashImplicitWrapper<TValue> {
98 /**
99 * @see _.clone
100 */
101 clone(): TValue;
102 /**
103 * @see _.cloneDeep
104 */
105 cloneDeep(): TValue;
106 /**
107 * @see _.cloneDeepWith
108 */
109 cloneDeepWith(customizer: CloneDeepWithCustomizer<TValue>): any;
110 /**
111 * @see _.cloneDeepWith
112 */
113 cloneDeepWith(): TValue;
114 /**
115 * @see _.cloneWith
116 */
117 cloneWith<TResult extends object | string | number | boolean | null>(customizer: CloneWithCustomizer<TValue, TResult>): TResult;
118 /**
119 * @see _.cloneWith
120 */
121 cloneWith<TResult>(customizer: CloneWithCustomizer<TValue, TResult | undefined>): TResult | TValue;
122 /**
123 * @see _.cloneWith
124 */
125 cloneWith(): TValue;
126 }
127 interface LoDashExplicitWrapper<TValue> {
128 /**
129 * @see _.clone
130 */
131 clone(): this;
132 /**
133 * @see _.cloneDeep
134 */
135 cloneDeep(): this;
136 /**
137 * @see _.cloneDeepWith
138 */
139 cloneDeepWith(customizer: CloneDeepWithCustomizer<TValue>): LoDashExplicitWrapper<any>;
140 /**
141 * @see _.cloneDeepWith
142 */
143 cloneDeepWith(): this;
144 /**
145 * @see _.cloneWith
146 */
147 cloneWith<TResult extends object | string | number | boolean | null>(customizer: CloneWithCustomizer<TValue, TResult>): ExpChain<TResult>;
148 /**
149 * @see _.cloneWith
150 */
151 cloneWith<TResult>(customizer: CloneWithCustomizer<TValue, TResult | undefined>): ExpChain<TResult | TValue>;
152 /**
153 * @see _.cloneWith
154 */
155 cloneWith(): this;
156 }
157
158 interface LoDashStatic {
159 /**
160 * This method is like _.clone except that it recursively clones value.
161 *
162 * @param value The value to recursively clone.
163 * @return Returns the deep cloned value.
164 */
165 cloneDeep<T>(value: T): T;
166 }
167 type CloneDeepWithCustomizer<TObject> = (value: any, key: number | string | undefined, object: TObject | undefined, stack: any) => any;
168 interface LoDashStatic {
169 /**
170 * This method is like _.cloneWith except that it recursively clones value.
171 *
172 * @param value The value to recursively clone.
173 * @param customizer The function to customize cloning.
174 * @return Returns the deep cloned value.
175 */
176 cloneDeepWith<T>(value: T, customizer: CloneDeepWithCustomizer<T>): any;
177 /**
178 * @see _.cloneDeepWith
179 */
180 cloneDeepWith<T>(value: T): T;
181 }
182 type CloneWithCustomizer<TValue, TResult> = (value: TValue, key: number | string | undefined, object: any, stack: any) => TResult;
183 interface LoDashStatic {
184 /**
185 * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value.
186 * If customizer returns undefined cloning is handled by the method instead.
187 *
188 * @param value The value to clone.
189 * @param customizer The function to customize cloning.
190 * @return Returns the cloned value.
191 */
192 cloneWith<T, TResult extends object | string | number | boolean | null>(value: T, customizer: CloneWithCustomizer<T, TResult>): TResult;
193 /**
194 * @see _.cloneWith
195 */
196 cloneWith<T, TResult>(value: T, customizer: CloneWithCustomizer<T, TResult | undefined>): TResult | T;
197 /**
198 * @see _.cloneWith
199 */
200 cloneWith<T>(value: T): T;
201 }
202 interface LoDashStatic {
203 /**
204 * Checks if object conforms to source by invoking the predicate properties of source with the
205 * corresponding property values of object.
206 *
207 * Note: This method is equivalent to _.conforms when source is partially applied.
208 */
209 conformsTo<T>(object: T, source: ConformsPredicateObject<T>): boolean;
210 }
211 interface LoDashImplicitWrapper<TValue> {
212 /**
213 * @see _.conformsTo
214 */
215 conformsTo(source: ConformsPredicateObject<TValue>): boolean;
216 }
217 interface LoDashExplicitWrapper<TValue> {
218 /**
219 * @see _.conformsTo
220 */
221 conformsTo(source: ConformsPredicateObject<TValue>): PrimitiveChain<boolean>;
222 }
223 type CondPair<T, R> = [(val: T) => boolean, (val: T) => R];
224 interface LoDashStatic {
225 /**
226 * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
227 * comparison between two values to determine if they are equivalent.
228 *
229 * @category Lang
230 * @param value The value to compare.
231 * @param other The other value to compare.
232 * @returns Returns `true` if the values are equivalent, else `false`.
233 * @example
234 *
235 * var object = { 'user': 'fred' };
236 * var other = { 'user': 'fred' };
237 *
238 * _.eq(object, object);
239 * // => true
240 *
241 * _.eq(object, other);
242 * // => false
243 *
244 * _.eq('a', 'a');
245 * // => true
246 *
247 * _.eq('a', Object('a'));
248 * // => false
249 *
250 * _.eq(NaN, NaN);
251 * // => true
252 */
253 eq(value: any, other: any): boolean;
254 }
255 interface LoDashImplicitWrapper<TValue> {
256 /**
257 * @see _.eq
258 */
259 eq(other: any): boolean;
260 }
261 interface LoDashExplicitWrapper<TValue> {
262 /**
263 * @see _.eq
264 */
265 eq(other: any): PrimitiveChain<boolean>;
266 }
267
268 interface LoDashStatic {
269 /**
270 * Checks if value is greater than other.
271 *
272 * @param value The value to compare.
273 * @param other The other value to compare.
274 * @return Returns true if value is greater than other, else false.
275 */
276 gt(value: any, other: any): boolean;
277 }
278 interface LoDashImplicitWrapper<TValue> {
279 /**
280 * @see _.gt
281 */
282 gt(other: any): boolean;
283 }
284 interface LoDashExplicitWrapper<TValue> {
285 /**
286 * @see _.gt
287 */
288 gt(other: any): PrimitiveChain<boolean>;
289 }
290
291 interface LoDashStatic {
292 /**
293 * Checks if value is greater than or equal to other.
294 *
295 * @param value The value to compare.
296 * @param other The other value to compare.
297 * @return Returns true if value is greater than or equal to other, else false.
298 */
299 gte(value: any, other: any): boolean;
300 }
301 interface LoDashImplicitWrapper<TValue> {
302 /**
303 * @see _.gte
304 */
305 gte(other: any): boolean;
306 }
307 interface LoDashExplicitWrapper<TValue> {
308 /**
309 * @see _.gte
310 */
311 gte(other: any): PrimitiveChain<boolean>;
312 }
313
314 interface LoDashStatic {
315 /**
316 * Checks if value is classified as an arguments object.
317 *
318 * @param value The value to check.
319 * @return Returns true if value is correctly classified, else false.
320 */
321 isArguments(value?: any): value is IArguments;
322 }
323 interface LoDashImplicitWrapper<TValue> {
324 /**
325 * @see _.isArguments
326 */
327 isArguments(): boolean;
328 }
329 interface LoDashExplicitWrapper<TValue> {
330 /**
331 * @see _.isArguments
332 */
333 isArguments(): PrimitiveChain<boolean>;
334 }
335
336 interface LoDashStatic {
337 /**
338 * Checks if value is classified as an Array object.
339 * @param value The value to check.
340 *
341 * @return Returns true if value is correctly classified, else false.
342 */
343 isArray(value?: any): value is any[];
344 /**
345 * @see _.isArray
346 */
347 isArray<T>(value?: any): value is any[];
348 }
349 interface LoDashImplicitWrapper<TValue> {
350 /**
351 * @see _.isArray
352 */
353 isArray(): boolean;
354 }
355 interface LoDashExplicitWrapper<TValue> {
356 /**
357 * @see _.isArray
358 */
359 isArray(): PrimitiveChain<boolean>;
360 }
361
362 interface LoDashStatic {
363 /**
364 * Checks if value is classified as an ArrayBuffer object.
365 *
366 * @param value The value to check.
367 * @return Returns true if value is correctly classified, else false.
368 */
369 isArrayBuffer(value?: any): value is ArrayBuffer;
370 }
371 interface LoDashImplicitWrapper<TValue> {
372 /**
373 * @see _.isArrayBuffer
374 */
375 isArrayBuffer(): boolean;
376 }
377 interface LoDashExplicitWrapper<TValue> {
378 /**
379 * @see _.isArrayBuffer
380 */
381 isArrayBuffer(): PrimitiveChain<boolean>;
382 }
383
384 interface LoDashStatic {
385 /**
386 * Checks if `value` is array-like. A value is considered array-like if it's
387 * not a function and has a `value.length` that's an integer greater than or
388 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
389 *
390 * @category Lang
391 * @param value The value to check.
392 * @returns Returns `true` if `value` is array-like, else `false`.
393 * @example
394 *
395 * _.isArrayLike([1, 2, 3]);
396 * // => true
397 *
398 * _.isArrayLike(document.body.children);
399 * // => true
400 *
401 * _.isArrayLike('abc');
402 * // => true
403 *
404 * _.isArrayLike(_.noop);
405 * // => false
406 */
407 isArrayLike<T extends { __lodashAnyHack: any }>(t: T): boolean;
408 /**
409 * @see _.isArrayLike
410 */
411 isArrayLike(value: ((...args: any[]) => any) | null | undefined): value is never;
412 /**
413 * @see _.isArrayLike
414 */
415 isArrayLike(value: any): value is { length: number };
416 }
417 interface LoDashImplicitWrapper<TValue> {
418 /**
419 * @see _.isArrayLike
420 */
421 isArrayLike(): boolean;
422 }
423 interface LoDashExplicitWrapper<TValue> {
424 /**
425 * @see _.isArrayLike
426 */
427 isArrayLike(): PrimitiveChain<boolean>;
428 }
429
430 interface LoDashStatic {
431 /**
432 * This method is like `_.isArrayLike` except that it also checks if `value`
433 * is an object.
434 *
435 * @category Lang
436 * @param value The value to check.
437 * @returns Returns `true` if `value` is an array-like object, else `false`.
438 * @example
439 *
440 * _.isArrayLikeObject([1, 2, 3]);
441 * // => true
442 *
443 * _.isArrayLikeObject(document.body.children);
444 * // => true
445 *
446 * _.isArrayLikeObject('abc');
447 * // => false
448 *
449 * _.isArrayLikeObject(_.noop);
450 * // => false
451 */
452 isArrayLikeObject<T extends { __lodashAnyHack: any }>(value: T): boolean;
453 /**
454 * @see _.isArrayLikeObject
455 */
456 isArrayLikeObject(value: ((...args: any[]) => any) | FunctionBase | string | boolean | number | null | undefined): value is never;
457 /**
458 * @see _.isArrayLikeObject
459 */
460 isArrayLikeObject(value: any): value is object & { length: number };
461 }
462 interface LoDashImplicitWrapper<TValue> {
463 /**
464 * @see _.isArrayLikeObject
465 */
466 isArrayLikeObject(): boolean;
467 }
468 interface LoDashExplicitWrapper<TValue> {
469 /**
470 * @see _.isArrayLikeObject
471 */
472 isArrayLikeObject(): PrimitiveChain<boolean>;
473 }
474
475 interface LoDashStatic {
476 /**
477 * Checks if value is classified as a boolean primitive or object.
478 *
479 * @param value The value to check.
480 * @return Returns true if value is correctly classified, else false.
481 */
482 isBoolean(value?: any): value is boolean;
483 }
484 interface LoDashImplicitWrapper<TValue> {
485 /**
486 * @see _.isBoolean
487 */
488 isBoolean(): boolean;
489 }
490 interface LoDashExplicitWrapper<TValue> {
491 /**
492 * @see _.isBoolean
493 */
494 isBoolean(): PrimitiveChain<boolean>;
495 }
496
497 interface LoDashStatic {
498 /**
499 * Checks if value is a buffer.
500 *
501 * @param value The value to check.
502 * @return Returns true if value is a buffer, else false.
503 */
504 isBuffer(value?: any): boolean;
505 }
506 interface LoDashImplicitWrapper<TValue> {
507 /**
508 * @see _.isBuffer
509 */
510 isBuffer(): boolean;
511 }
512 interface LoDashExplicitWrapper<TValue> {
513 /**
514 * @see _.isBuffer
515 */
516 isBuffer(): PrimitiveChain<boolean>;
517 }
518
519 interface LoDashStatic {
520 /**
521 * Checks if value is classified as a Date object.
522 * @param value The value to check.
523 *
524 * @return Returns true if value is correctly classified, else false.
525 */
526 isDate(value?: any): value is Date;
527 }
528 interface LoDashImplicitWrapper<TValue> {
529 /**
530 * @see _.isDate
531 */
532 isDate(): boolean;
533 }
534 interface LoDashExplicitWrapper<TValue> {
535 /**
536 * @see _.isDate
537 */
538 isDate(): PrimitiveChain<boolean>;
539 }
540
541 interface LoDashStatic {
542 /**
543 * Checks if value is a DOM element.
544 *
545 * @param value The value to check.
546 * @return Returns true if value is a DOM element, else false.
547 */
548 isElement(value?: any): boolean;
549 }
550 interface LoDashImplicitWrapper<TValue> {
551 /**
552 * @see _.isElement
553 */
554 isElement(): boolean;
555 }
556 interface LoDashExplicitWrapper<TValue> {
557 /**
558 * @see _.isElement
559 */
560 isElement(): PrimitiveChain<boolean>;
561 }
562
563 interface LoDashStatic {
564 /**
565 * Checks if value is empty. A value is considered empty unless its an arguments object, array, string, or
566 * jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
567 *
568 * @param value The value to inspect.
569 * @return Returns true if value is empty, else false.
570 */
571 isEmpty(value?: any): boolean;
572 }
573 interface LoDashImplicitWrapper<TValue> {
574 /**
575 * @see _.isEmpty
576 */
577 isEmpty(): boolean;
578 }
579 interface LoDashExplicitWrapper<TValue> {
580 /**
581 * @see _.isEmpty
582 */
583 isEmpty(): PrimitiveChain<boolean>;
584 }
585
586 interface LoDashStatic {
587 /**
588 * Performs a deep comparison between two values to determine if they are
589 * equivalent.
590 *
591 * **Note:** This method supports comparing arrays, array buffers, booleans,
592 * date objects, error objects, maps, numbers, `Object` objects, regexes,
593 * sets, strings, symbols, and typed arrays. `Object` objects are compared
594 * by their own, not inherited, enumerable properties. Functions and DOM
595 * nodes are **not** supported.
596 *
597 * @category Lang
598 * @param value The value to compare.
599 * @param other The other value to compare.
600 * @returns Returns `true` if the values are equivalent, else `false`.
601 * @example
602 *
603 * var object = { 'user': 'fred' };
604 * var other = { 'user': 'fred' };
605 *
606 * _.isEqual(object, other);
607 * // => true
608 *
609 * object === other;
610 * // => false
611 */
612 isEqual(value: any, other: any): boolean;
613 }
614 interface LoDashImplicitWrapper<TValue> {
615 /**
616 * @see _.isEqual
617 */
618 isEqual(other: any): boolean;
619 }
620 interface LoDashExplicitWrapper<TValue> {
621 /**
622 * @see _.isEqual
623 */
624 isEqual(other: any): PrimitiveChain<boolean>;
625 }
626
627 type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyName | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined;
628 interface LoDashStatic {
629 /**
630 * This method is like `_.isEqual` except that it accepts `customizer` which is
631 * invoked to compare values. If `customizer` returns `undefined` comparisons are
632 * handled by the method instead. The `customizer` is invoked with up to seven arguments:
633 * (objValue, othValue [, index|key, object, other, stack]).
634 *
635 * @category Lang
636 * @param value The value to compare.
637 * @param other The other value to compare.
638 * @param [customizer] The function to customize comparisons.
639 * @returns Returns `true` if the values are equivalent, else `false`.
640 * @example
641 *
642 * function isGreeting(value) {
643 * return /^h(?:i|ello)$/.test(value);
644 * }
645 *
646 * function customizer(objValue, othValue) {
647 * if (isGreeting(objValue) && isGreeting(othValue)) {
648 * return true;
649 * }
650 * }
651 *
652 * var array = ['hello', 'goodbye'];
653 * var other = ['hi', 'goodbye'];
654 *
655 * _.isEqualWith(array, other, customizer);
656 * // => true
657 */
658 isEqualWith(value: any, other: any, customizer?: IsEqualCustomizer): boolean;
659 }
660 interface LoDashImplicitWrapper<TValue> {
661 /**
662 * @see _.isEqualWith
663 */
664 isEqualWith(other: any, customizer?: IsEqualCustomizer): boolean;
665 }
666 interface LoDashExplicitWrapper<TValue> {
667 /**
668 * @see _.isEqualWith
669 */
670 isEqualWith(other: any, customizer?: IsEqualCustomizer): PrimitiveChain<boolean>;
671 }
672
673 interface LoDashStatic {
674 /**
675 * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
676 * object.
677 *
678 * @param value The value to check.
679 * @return Returns true if value is an error object, else false.
680 */
681 isError(value: any): value is Error;
682 }
683 interface LoDashImplicitWrapper<TValue> {
684 /**
685 * @see _.isError
686 */
687 isError(): boolean;
688 }
689 interface LoDashExplicitWrapper<TValue> {
690 /**
691 * @see _.isError
692 */
693 isError(): PrimitiveChain<boolean>;
694 }
695
696 interface LoDashStatic {
697 /**
698 * Checks if value is a finite primitive number.
699 *
700 * Note: This method is based on Number.isFinite.
701 *
702 * @param value The value to check.
703 * @return Returns true if value is a finite number, else false.
704 */
705 isFinite(value?: any): boolean;
706 }
707 interface LoDashImplicitWrapper<TValue> {
708 /**
709 * @see _.isFinite
710 */
711 isFinite(): boolean;
712 }
713 interface LoDashExplicitWrapper<TValue> {
714 /**
715 * @see _.isFinite
716 */
717 isFinite(): PrimitiveChain<boolean>;
718 }
719
720 interface LoDashStatic {
721 /**
722 * Checks if value is a callable function.
723 *
724 * @param value The value to check.
725 * @return Returns true if value is correctly classified, else false.
726 */
727 isFunction(value: any): value is (...args: any[]) => any;
728 }
729 interface LoDashImplicitWrapper<TValue> {
730 /**
731 * @see _.isFunction
732 */
733 isFunction(): boolean;
734 }
735 interface LoDashExplicitWrapper<TValue> {
736 /**
737 * @see _.isFunction
738 */
739 isFunction(): PrimitiveChain<boolean>;
740 }
741
742 interface LoDashStatic {
743 /**
744 * Checks if `value` is an integer.
745 *
746 * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
747 *
748 * @category Lang
749 * @param value The value to check.
750 * @returns Returns `true` if `value` is an integer, else `false`.
751 * @example
752 *
753 * _.isInteger(3);
754 * // => true
755 *
756 * _.isInteger(Number.MIN_VALUE);
757 * // => false
758 *
759 * _.isInteger(Infinity);
760 * // => false
761 *
762 * _.isInteger('3');
763 * // => false
764 */
765 isInteger(value?: any): boolean;
766 }
767 interface LoDashImplicitWrapper<TValue> {
768 /**
769 * @see _.isInteger
770 */
771 isInteger(): boolean;
772 }
773 interface LoDashExplicitWrapper<TValue> {
774 /**
775 * @see _.isInteger
776 */
777 isInteger(): PrimitiveChain<boolean>;
778 }
779
780 interface LoDashStatic {
781 /**
782 * Checks if `value` is a valid array-like length.
783 *
784 * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
785 *
786 * @category Lang
787 * @param value The value to check.
788 * @returns Returns `true` if `value` is a valid length, else `false`.
789 * @example
790 *
791 * _.isLength(3);
792 * // => true
793 *
794 * _.isLength(Number.MIN_VALUE);
795 * // => false
796 *
797 * _.isLength(Infinity);
798 * // => false
799 *
800 * _.isLength('3');
801 * // => false
802 */
803 isLength(value?: any): boolean;
804 }
805 interface LoDashImplicitWrapper<TValue> {
806 /**
807 * @see _.isLength
808 */
809 isLength(): boolean;
810 }
811 interface LoDashExplicitWrapper<TValue> {
812 /**
813 * @see _.isLength
814 */
815 isLength(): PrimitiveChain<boolean>;
816 }
817
818 interface LoDashStatic {
819 /**
820 * Checks if value is classified as a Map object.
821 *
822 * @param value The value to check.
823 * @returns Returns true if value is correctly classified, else false.
824 */
825 isMap(value?: any): value is Map<any, any>;
826 }
827 interface LoDashImplicitWrapper<TValue> {
828 /**
829 * @see _.isMap
830 */
831 isMap(): boolean;
832 }
833 interface LoDashExplicitWrapper<TValue> {
834 /**
835 * @see _.isMap
836 */
837 isMap(): PrimitiveChain<boolean>;
838 }
839
840 interface LoDashStatic {
841 /**
842 * Performs a deep comparison between `object` and `source` to determine if
843 * `object` contains equivalent property values.
844 *
845 * **Note:** This method supports comparing the same values as `_.isEqual`.
846 *
847 * @category Lang
848 * @param object The object to inspect.
849 * @param source The object of property values to match.
850 * @returns Returns `true` if `object` is a match, else `false`.
851 * @example
852 *
853 * var object = { 'user': 'fred', 'age': 40 };
854 *
855 * _.isMatch(object, { 'age': 40 });
856 * // => true
857 *
858 * _.isMatch(object, { 'age': 36 });
859 * // => false
860 */
861 isMatch(object: object, source: object): boolean;
862 }
863 interface LoDashImplicitWrapper<TValue> {
864 /**
865 * @see _.isMatch
866 */
867 isMatch(source: object): boolean;
868 }
869 interface LoDashExplicitWrapper<TValue> {
870 /**
871 * @see _.isMatch
872 */
873 isMatch(source: object): PrimitiveChain<boolean>;
874 }
875
876 type isMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyName, object: object, source: object) => boolean | undefined;
877 interface LoDashStatic {
878 /**
879 * This method is like `_.isMatch` except that it accepts `customizer` which
880 * is invoked to compare values. If `customizer` returns `undefined` comparisons
881 * are handled by the method instead. The `customizer` is invoked with three
882 * arguments: (objValue, srcValue, index|key, object, source).
883 *
884 * @category Lang
885 * @param object The object to inspect.
886 * @param source The object of property values to match.
887 * @param [customizer] The function to customize comparisons.
888 * @returns Returns `true` if `object` is a match, else `false`.
889 * @example
890 *
891 * function isGreeting(value) {
892 * return /^h(?:i|ello)$/.test(value);
893 * }
894 *
895 * function customizer(objValue, srcValue) {
896 * if (isGreeting(objValue) && isGreeting(srcValue)) {
897 * return true;
898 * }
899 * }
900 *
901 * var object = { 'greeting': 'hello' };
902 * var source = { 'greeting': 'hi' };
903 *
904 * _.isMatchWith(object, source, customizer);
905 * // => true
906 */
907 isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean;
908 }
909 interface LoDashImplicitWrapper<TValue> {
910 /**
911 * @see _.isMatchWith
912 */
913 isMatchWith(source: object, customizer: isMatchWithCustomizer): boolean;
914 }
915 interface LoDashExplicitWrapper<TValue> {
916 /**
917 * @see _.isMatchWith
918 */
919 isMatchWith(source: object, customizer: isMatchWithCustomizer): PrimitiveChain<boolean>;
920 }
921
922 interface LoDashStatic {
923 /**
924 * Checks if value is NaN.
925 *
926 * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
927 *
928 * @param value The value to check.
929 * @return Returns true if value is NaN, else false.
930 */
931 isNaN(value?: any): boolean;
932 }
933 interface LoDashImplicitWrapper<TValue> {
934 /**
935 * @see _.isNaN
936 */
937 isNaN(): boolean;
938 }
939 interface LoDashExplicitWrapper<TValue> {
940 /**
941 * @see _.isNaN
942 */
943 isNaN(): PrimitiveChain<boolean>;
944 }
945
946 interface LoDashStatic {
947 /**
948 * Checks if value is a native function.
949 * @param value The value to check.
950 *
951 * @retrun Returns true if value is a native function, else false.
952 */
953 isNative(value: any): value is (...args: any[]) => any;
954 }
955 interface LoDashImplicitWrapper<TValue> {
956 /**
957 * @see _.isNative
958 */
959 isNative(): boolean;
960 }
961 interface LoDashExplicitWrapper<TValue> {
962 /**
963 * @see _.isNative
964 */
965 isNative(): PrimitiveChain<boolean>;
966 }
967
968 interface LoDashStatic {
969 /**
970 * Checks if `value` is `null` or `undefined`.
971 *
972 * @category Lang
973 * @param value The value to check.
974 * @returns Returns `true` if `value` is nullish, else `false`.
975 * @example
976 *
977 * _.isNil(null);
978 * // => true
979 *
980 * _.isNil(void 0);
981 * // => true
982 *
983 * _.isNil(NaN);
984 * // => false
985 */
986 isNil(value: any): value is null | undefined;
987 }
988 interface LoDashImplicitWrapper<TValue> {
989 /**
990 * @see _.isNil
991 */
992 isNil(): boolean;
993 }
994 interface LoDashExplicitWrapper<TValue> {
995 /**
996 * @see _.isNil
997 */
998 isNil(): PrimitiveChain<boolean>;
999 }
1000
1001 interface LoDashStatic {
1002 /**
1003 * Checks if value is null.
1004 *
1005 * @param value The value to check.
1006 * @return Returns true if value is null, else false.
1007 */
1008 isNull(value: any): value is null;
1009 }
1010 interface LoDashImplicitWrapper<TValue> {
1011 /**
1012 * @see _.isNull
1013 */
1014 isNull(): boolean;
1015 }
1016 interface LoDashExplicitWrapper<TValue> {
1017 /**
1018 * @see _.isNull
1019 */
1020 isNull(): PrimitiveChain<boolean>;
1021 }
1022
1023 interface LoDashStatic {
1024 /**
1025 * Checks if value is classified as a Number primitive or object.
1026 *
1027 * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
1028 *
1029 * @param value The value to check.
1030 * @return Returns true if value is correctly classified, else false.
1031 */
1032 isNumber(value?: any): value is number;
1033 }
1034 interface LoDashImplicitWrapper<TValue> {
1035 /**
1036 * @see _.isNumber
1037 */
1038 isNumber(): boolean;
1039 }
1040 interface LoDashExplicitWrapper<TValue> {
1041 /**
1042 * @see _.isNumber
1043 */
1044 isNumber(): PrimitiveChain<boolean>;
1045 }
1046
1047 interface LoDashStatic {
1048 /**
1049 * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
1050 * and new String(''))
1051 *
1052 * @param value The value to check.
1053 * @return Returns true if value is an object, else false.
1054 */
1055 isObject(value?: any): value is object;
1056 }
1057 interface LoDashImplicitWrapper<TValue> {
1058 /**
1059 * @see _.isObject
1060 */
1061 isObject(): this is LoDashImplicitWrapper<object>;
1062 }
1063 interface LoDashExplicitWrapper<TValue> {
1064 /**
1065 * @see _.isObject
1066 */
1067 isObject(): PrimitiveChain<boolean>;
1068 }
1069
1070 interface LoDashStatic {
1071 /**
1072 * Checks if `value` is object-like. A value is object-like if it's not `null`
1073 * and has a `typeof` result of "object".
1074 *
1075 * @category Lang
1076 * @param value The value to check.
1077 * @returns Returns `true` if `value` is object-like, else `false`.
1078 * @example
1079 *
1080 * _.isObjectLike({});
1081 * // => true
1082 *
1083 * _.isObjectLike([1, 2, 3]);
1084 * // => true
1085 *
1086 * _.isObjectLike(_.noop);
1087 * // => false
1088 *
1089 * _.isObjectLike(null);
1090 * // => false
1091 */
1092 isObjectLike(value?: any): boolean;
1093 }
1094 interface LoDashImplicitWrapper<TValue> {
1095 /**
1096 * @see _.isObjectLike
1097 */
1098 isObjectLike(): boolean;
1099 }
1100 interface LoDashExplicitWrapper<TValue> {
1101 /**
1102 * @see _.isObjectLike
1103 */
1104 isObjectLike(): PrimitiveChain<boolean>;
1105 }
1106
1107 interface LoDashStatic {
1108 /**
1109 * Checks if value is a plain object, that is, an object created by the Object constructor or one with a
1110 * [[Prototype]] of null.
1111 *
1112 * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
1113 *
1114 * @param value The value to check.
1115 * @return Returns true if value is a plain object, else false.
1116 */
1117 isPlainObject(value?: any): boolean;
1118 }
1119 interface LoDashImplicitWrapper<TValue> {
1120 /**
1121 * @see _.isPlainObject
1122 */
1123 isPlainObject(): boolean;
1124 }
1125 interface LoDashExplicitWrapper<TValue> {
1126 /**
1127 * @see _.isPlainObject
1128 */
1129 isPlainObject(): PrimitiveChain<boolean>;
1130 }
1131
1132 interface LoDashStatic {
1133 /**
1134 * Checks if value is classified as a RegExp object.
1135 * @param value The value to check.
1136 *
1137 * @return Returns true if value is correctly classified, else false.
1138 */
1139 isRegExp(value?: any): value is RegExp;
1140 }
1141 interface LoDashImplicitWrapper<TValue> {
1142 /**
1143 * @see _.isRegExp
1144 */
1145 isRegExp(): boolean;
1146 }
1147 interface LoDashExplicitWrapper<TValue> {
1148 /**
1149 * @see _.isRegExp
1150 */
1151 isRegExp(): PrimitiveChain<boolean>;
1152 }
1153
1154 interface LoDashStatic {
1155 /**
1156 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
1157 * double precision number which isn't the result of a rounded unsafe integer.
1158 *
1159 * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
1160 *
1161 * @category Lang
1162 * @param value The value to check.
1163 * @returns Returns `true` if `value` is a safe integer, else `false`.
1164 * @example
1165 *
1166 * _.isSafeInteger(3);
1167 * // => true
1168 *
1169 * _.isSafeInteger(Number.MIN_VALUE);
1170 * // => false
1171 *
1172 * _.isSafeInteger(Infinity);
1173 * // => false
1174 *
1175 * _.isSafeInteger('3');
1176 * // => false
1177 */
1178 isSafeInteger(value: any): boolean;
1179 }
1180 interface LoDashImplicitWrapper<TValue> {
1181 /**
1182 * @see _.isSafeInteger
1183 */
1184 isSafeInteger(): boolean;
1185 }
1186 interface LoDashExplicitWrapper<TValue> {
1187 /**
1188 * @see _.isSafeInteger
1189 */
1190 isSafeInteger(): PrimitiveChain<boolean>;
1191 }
1192
1193 interface LoDashStatic {
1194 /**
1195 * Checks if value is classified as a Set object.
1196 *
1197 * @param value The value to check.
1198 * @returns Returns true if value is correctly classified, else false.
1199 */
1200 isSet(value?: any): value is Set<any>;
1201 }
1202 interface LoDashImplicitWrapper<TValue> {
1203 /**
1204 * @see _.isSet
1205 */
1206 isSet(): boolean;
1207 }
1208 interface LoDashExplicitWrapper<TValue> {
1209 /**
1210 * @see _.isSet
1211 */
1212 isSet(): PrimitiveChain<boolean>;
1213 }
1214
1215 interface LoDashStatic {
1216 /**
1217 * Checks if value is classified as a String primitive or object.
1218 *
1219 * @param value The value to check.
1220 * @return Returns true if value is correctly classified, else false.
1221 */
1222 isString(value?: any): value is string;
1223 }
1224 interface LoDashImplicitWrapper<TValue> {
1225 /**
1226 * @see _.isString
1227 */
1228 isString(): boolean;
1229 }
1230 interface LoDashExplicitWrapper<TValue> {
1231 /**
1232 * @see _.isString
1233 */
1234 isString(): PrimitiveChain<boolean>;
1235 }
1236
1237 interface LoDashStatic {
1238 /**
1239 * Checks if `value` is classified as a `Symbol` primitive or object.
1240 *
1241 * @category Lang
1242 * @param value The value to check.
1243 * @returns Returns `true` if `value` is correctly classified, else `false`.
1244 * @example
1245 *
1246 * _.isSymbol(Symbol.iterator);
1247 * // => true
1248 *
1249 * _.isSymbol('abc');
1250 * // => false
1251 */
1252 isSymbol(value: any): value is symbol;
1253 }
1254 interface LoDashImplicitWrapper<TValue> {
1255 /**
1256 * @see _.isSymbol
1257 */
1258 isSymbol(): boolean;
1259 }
1260 interface LoDashExplicitWrapper<TValue> {
1261 /**
1262 * @see _.isSymbol
1263 */
1264 isSymbol(): PrimitiveChain<boolean>;
1265 }
1266
1267 interface LoDashStatic {
1268 /**
1269 * Checks if value is classified as a typed array.
1270 *
1271 * @param value The value to check.
1272 * @return Returns true if value is correctly classified, else false.
1273 */
1274 isTypedArray(value: any): boolean;
1275 }
1276 interface LoDashImplicitWrapper<TValue> {
1277 /**
1278 * @see _.isTypedArray
1279 */
1280 isTypedArray(): boolean;
1281 }
1282 interface LoDashExplicitWrapper<TValue> {
1283 /**
1284 * @see _.isTypedArray
1285 */
1286 isTypedArray(): PrimitiveChain<boolean>;
1287 }
1288
1289 interface LoDashStatic {
1290 /**
1291 * Checks if value is undefined.
1292 *
1293 * @param value The value to check.
1294 * @return Returns true if value is undefined, else false.
1295 */
1296 isUndefined(value: any): value is undefined;
1297 }
1298 interface LoDashImplicitWrapper<TValue> {
1299 /**
1300 * @see _.isUndefined
1301 */
1302 isUndefined(): boolean;
1303 }
1304 interface LoDashExplicitWrapper<TValue> {
1305 /**
1306 * @see _.isUndefined
1307 */
1308 isUndefined(): PrimitiveChain<boolean>;
1309 }
1310
1311 interface LoDashStatic {
1312 /**
1313 * Checks if value is classified as a WeakMap object.
1314 *
1315 * @param value The value to check.
1316 * @returns Returns true if value is correctly classified, else false.
1317 */
1318 isWeakMap(value?: any): value is WeakMap<object, any>;
1319 }
1320 interface LoDashImplicitWrapper<TValue> {
1321 /**
1322 * @see _.isWeakMap
1323 */
1324 isWeakMap(): boolean;
1325 }
1326 interface LoDashExplicitWrapper<TValue> {
1327 /**
1328 * @see _.isWeakMap
1329 */
1330 isWeakMap(): PrimitiveChain<boolean>;
1331 }
1332
1333 interface LoDashStatic {
1334 /**
1335 * Checks if value is classified as a WeakSet object.
1336 *
1337 * @param value The value to check.
1338 * @returns Returns true if value is correctly classified, else false.
1339 */
1340 isWeakSet(value?: any): value is WeakSet<object>;
1341 }
1342 interface LoDashImplicitWrapper<TValue> {
1343 /**
1344 * @see _.isWeakSet
1345 */
1346 isWeakSet(): boolean;
1347 }
1348 interface LoDashExplicitWrapper<TValue> {
1349 /**
1350 * @see _.isWeakSet
1351 */
1352 isWeakSet(): PrimitiveChain<boolean>;
1353 }
1354
1355 interface LoDashStatic {
1356 /**
1357 * Checks if value is less than other.
1358 *
1359 * @param value The value to compare.
1360 * @param other The other value to compare.
1361 * @return Returns true if value is less than other, else false.
1362 */
1363 lt(value: any, other: any): boolean;
1364 }
1365 interface LoDashImplicitWrapper<TValue> {
1366 /**
1367 * @see _.lt
1368 */
1369 lt(other: any): boolean;
1370 }
1371 interface LoDashExplicitWrapper<TValue> {
1372 /**
1373 * @see _.lt
1374 */
1375 lt(other: any): PrimitiveChain<boolean>;
1376 }
1377
1378 interface LoDashStatic {
1379 /**
1380 * Checks if value is less than or equal to other.
1381 *
1382 * @param value The value to compare.
1383 * @param other The other value to compare.
1384 * @return Returns true if value is less than or equal to other, else false.
1385 */
1386 lte(value: any, other: any): boolean;
1387 }
1388 interface LoDashImplicitWrapper<TValue> {
1389 /**
1390 * @see _.lte
1391 */
1392 lte(other: any): boolean;
1393 }
1394 interface LoDashExplicitWrapper<TValue> {
1395 /**
1396 * @see _.lte
1397 */
1398 lte(other: any): PrimitiveChain<boolean>;
1399 }
1400
1401 interface LoDashStatic {
1402 /**
1403 * Converts value to an array.
1404 *
1405 * @param value The value to convert.
1406 * @return Returns the converted array.
1407 */
1408 toArray<T>(value: Dictionary<T> | NumericDictionary<T> | null | undefined): T[];
1409 /**
1410 * @see _.toArray
1411 */
1412 toArray<T>(value: T): Array<T[keyof T]>;
1413 /**
1414 * @see _.toArray
1415 */
1416 toArray(): any[];
1417 }
1418 interface String {
1419 /**
1420 * @see _.toArray
1421 */
1422 toArray(): Collection<string>;
1423 }
1424 interface Collection<T> {
1425 /**
1426 * @see _.toArray
1427 */
1428 toArray(): Collection<T>;
1429 }
1430 interface Object<T> {
1431 /**
1432 * @see _.toArray
1433 */
1434 toArray(): Collection<T[keyof T]>;
1435 }
1436 interface StringChain {
1437 /**
1438 * @see _.toArray
1439 */
1440 toArray(): CollectionChain<string>;
1441 }
1442 interface StringNullableChain {
1443 /**
1444 * @see _.toArray
1445 */
1446 toArray(): CollectionChain<string>;
1447 }
1448 interface CollectionChain<T> {
1449 /**
1450 * @see _.toArray
1451 */
1452 toArray(): CollectionChain<T>;
1453 }
1454 interface ObjectChain<T> {
1455 /**
1456 * @see _.toArray
1457 */
1458 toArray(): CollectionChain<T[keyof T]>;
1459 }
1460
1461 interface LoDashStatic {
1462 /**
1463 * Converts `value` to a finite number.
1464 *
1465 * @since 4.12.0
1466 * @category Lang
1467 * @param value The value to convert.
1468 * @returns Returns the converted number.
1469 * @example
1470 *
1471 * _.toFinite(3.2);
1472 * // => 3.2
1473 *
1474 * _.toFinite(Number.MIN_VALUE);
1475 * // => 5e-324
1476 *
1477 * _.toFinite(Infinity);
1478 * // => 1.7976931348623157e+308
1479 *
1480 * _.toFinite('3.2');
1481 * // => 3.2
1482 */
1483 toFinite(value: any): number;
1484 }
1485 interface LoDashImplicitWrapper<TValue> {
1486 /**
1487 * @see _.toFinite
1488 */
1489 toFinite(): number;
1490 }
1491 interface LoDashExplicitWrapper<TValue> {
1492 /**
1493 * @see _.toFinite
1494 */
1495 toFinite(): PrimitiveChain<number>;
1496 }
1497
1498 interface LoDashStatic {
1499 /**
1500 * Converts `value` to an integer.
1501 *
1502 * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
1503 *
1504 * @category Lang
1505 * @param value The value to convert.
1506 * @returns Returns the converted integer.
1507 * @example
1508 *
1509 * _.toInteger(3);
1510 * // => 3
1511 *
1512 * _.toInteger(Number.MIN_VALUE);
1513 * // => 0
1514 *
1515 * _.toInteger(Infinity);
1516 * // => 1.7976931348623157e+308
1517 *
1518 * _.toInteger('3');
1519 * // => 3
1520 */
1521 toInteger(value: any): number;
1522 }
1523 interface LoDashImplicitWrapper<TValue> {
1524 /**
1525 * @see _.toInteger
1526 */
1527 toInteger(): number;
1528 }
1529 interface LoDashExplicitWrapper<TValue> {
1530 /**
1531 * @see _.toInteger
1532 */
1533 toInteger(): PrimitiveChain<number>;
1534 }
1535
1536 interface LoDashStatic {
1537 /**
1538 * Converts `value` to an integer suitable for use as the length of an
1539 * array-like object.
1540 *
1541 * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
1542 *
1543 * @category Lang
1544 * @param value The value to convert.
1545 * @return Returns the converted integer.
1546 * @example
1547 *
1548 * _.toLength(3);
1549 * // => 3
1550 *
1551 * _.toLength(Number.MIN_VALUE);
1552 * // => 0
1553 *
1554 * _.toLength(Infinity);
1555 * // => 4294967295
1556 *
1557 * _.toLength('3');
1558 * // => 3
1559 */
1560 toLength(value: any): number;
1561 }
1562 interface LoDashImplicitWrapper<TValue> {
1563 /**
1564 * @see _.toLength
1565 */
1566 toLength(): number;
1567 }
1568 interface LoDashExplicitWrapper<TValue> {
1569 /**
1570 * @see _.toLength
1571 */
1572 toLength(): PrimitiveChain<number>;
1573 }
1574
1575 interface LoDashStatic {
1576 /**
1577 * Converts `value` to a number.
1578 *
1579 * @category Lang
1580 * @param value The value to process.
1581 * @returns Returns the number.
1582 * @example
1583 *
1584 * _.toNumber(3);
1585 * // => 3
1586 *
1587 * _.toNumber(Number.MIN_VALUE);
1588 * // => 5e-324
1589 *
1590 * _.toNumber(Infinity);
1591 * // => Infinity
1592 *
1593 * _.toNumber('3');
1594 * // => 3
1595 */
1596 toNumber(value: any): number;
1597 }
1598 interface LoDashImplicitWrapper<TValue> {
1599 /**
1600 * @see _.toNumber
1601 */
1602 toNumber(): number;
1603 }
1604 interface LoDashExplicitWrapper<TValue> {
1605 /**
1606 * @see _.toNumber
1607 */
1608 toNumber(): PrimitiveChain<number>;
1609 }
1610
1611 interface LoDashStatic {
1612 /**
1613 * Converts value to a plain object flattening inherited enumerable properties of value to own properties
1614 * of the plain object.
1615 *
1616 * @param value The value to convert.
1617 * @return Returns the converted plain object.
1618 */
1619 toPlainObject(value?: any): any;
1620 }
1621 interface LoDashImplicitWrapper<TValue> {
1622 /**
1623 * @see _.toPlainObject
1624 */
1625 toPlainObject(): Object<any>;
1626 }
1627 interface LoDashExplicitWrapper<TValue> {
1628 /**
1629 * @see _.toPlainObject
1630 */
1631 toPlainObject(): ObjectChain<any>;
1632 }
1633
1634 interface LoDashStatic {
1635 /**
1636 * Converts `value` to a safe integer. A safe integer can be compared and
1637 * represented correctly.
1638 *
1639 * @category Lang
1640 * @param value The value to convert.
1641 * @returns Returns the converted integer.
1642 * @example
1643 *
1644 * _.toSafeInteger(3);
1645 * // => 3
1646 *
1647 * _.toSafeInteger(Number.MIN_VALUE);
1648 * // => 0
1649 *
1650 * _.toSafeInteger(Infinity);
1651 * // => 9007199254740991
1652 *
1653 * _.toSafeInteger('3');
1654 * // => 3
1655 */
1656 toSafeInteger(value: any): number;
1657 }
1658 interface LoDashImplicitWrapper<TValue> {
1659 /**
1660 * @see _.toSafeInteger
1661 */
1662 toSafeInteger(): number;
1663 }
1664 interface LoDashExplicitWrapper<TValue> {
1665 /**
1666 * @see _.toSafeInteger
1667 */
1668 toSafeInteger(): PrimitiveChain<number>;
1669 }
1670
1671 interface LoDashStatic {
1672 /**
1673 * Converts `value` to a string if it's not one. An empty string is returned
1674 * for `null` and `undefined` values. The sign of `-0` is preserved.
1675 *
1676 * @category Lang
1677 * @param value The value to process.
1678 * @returns Returns the string.
1679 * @example
1680 *
1681 * _.toString(null);
1682 * // => ''
1683 *
1684 * _.toString(-0);
1685 * // => '-0'
1686 *
1687 * _.toString([1, 2, 3]);
1688 * // => '1,2,3'
1689 */
1690 toString(value: any): string;
1691 }
1692}