01358722055ae0eedf5c22f9617c1a6cd81b164c6401084717cdf9252a0db124a4179d05ae51b2118407fe95ed9b0b6dccccdd0c7ab5c6166d76a449253310 48 KB

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