lodash.d.ts 298 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369
  1. // Type definitions for Lo-Dash
  2. // Project: http://lodash.com/
  3. // Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>
  4. // Definitions: https://github.com/borisyankov/DefinitelyTyped
  5. declare var _: _.LoDashStatic;
  6. declare module _ {
  7. interface LoDashStatic {
  8. /**
  9. * Creates a lodash object which wraps the given value to enable intuitive method chaining.
  10. *
  11. * In addition to Lo-Dash methods, wrappers also have the following Array methods:
  12. * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift
  13. *
  14. * Chaining is supported in custom builds as long as the value method is implicitly or
  15. * explicitly included in the build.
  16. *
  17. * The chainable wrapper functions are:
  18. * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
  19. * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
  20. * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
  21. * indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
  22. * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
  23. * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
  24. * toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip
  25. *
  26. * The non-chainable wrapper functions are:
  27. * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast,
  28. * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean,
  29. * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber,
  30. * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin,
  31. * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some,
  32. * sortedIndex, runInContext, template, unescape, uniqueId, and value
  33. *
  34. * The wrapper functions first and last return wrapped values when n is provided, otherwise
  35. * they return unwrapped values.
  36. *
  37. * Explicit chaining can be enabled by using the _.chain method.
  38. **/
  39. (value: number): LoDashImplicitWrapper<number>;
  40. (value: string): LoDashImplicitStringWrapper;
  41. (value: boolean): LoDashImplicitWrapper<boolean>;
  42. (value: Array<number>): LoDashImplicitNumberArrayWrapper;
  43. <T>(value: Array<T>): LoDashImplicitArrayWrapper<T>;
  44. <T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
  45. (value: any): LoDashImplicitWrapper<any>;
  46. /**
  47. * The semantic version number.
  48. **/
  49. VERSION: string;
  50. /**
  51. * An object used to flag environments features.
  52. **/
  53. support: Support;
  54. /**
  55. * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
  56. * (ERB). Change the following template settings to use alternative delimiters.
  57. **/
  58. templateSettings: TemplateSettings;
  59. }
  60. /**
  61. * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
  62. * (ERB). Change the following template settings to use alternative delimiters.
  63. **/
  64. interface TemplateSettings {
  65. /**
  66. * The "escape" delimiter.
  67. **/
  68. escape?: RegExp;
  69. /**
  70. * The "evaluate" delimiter.
  71. **/
  72. evaluate?: RegExp;
  73. /**
  74. * An object to import into the template as local variables.
  75. **/
  76. imports?: Dictionary<any>;
  77. /**
  78. * The "interpolate" delimiter.
  79. **/
  80. interpolate?: RegExp;
  81. /**
  82. * Used to reference the data object in the template text.
  83. **/
  84. variable?: string;
  85. }
  86. /**
  87. * Creates a cache object to store key/value pairs.
  88. */
  89. interface MapCache {
  90. /**
  91. * Removes `key` and its value from the cache.
  92. * @param key The key of the value to remove.
  93. * @return Returns `true` if the entry was removed successfully, else `false`.
  94. */
  95. delete(key: string): boolean;
  96. /**
  97. * Gets the cached value for `key`.
  98. * @param key The key of the value to get.
  99. * @return Returns the cached value.
  100. */
  101. get(key: string): any;
  102. /**
  103. * Checks if a cached value for `key` exists.
  104. * @param key The key of the entry to check.
  105. * @return Returns `true` if an entry for `key` exists, else `false`.
  106. */
  107. has(key: string): boolean;
  108. /**
  109. * Sets `value` to `key` of the cache.
  110. * @param key The key of the value to cache.
  111. * @param value The value to cache.
  112. * @return Returns the cache object.
  113. */
  114. set(key: string, value: any): _.Dictionary<any>;
  115. }
  116. /**
  117. * An object used to flag environments features.
  118. **/
  119. interface Support {
  120. /**
  121. * Detect if an arguments object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
  122. **/
  123. argsClass: boolean;
  124. /**
  125. * Detect if arguments objects are Object objects (all but Narwhal and Opera < 10.5).
  126. **/
  127. argsObject: boolean;
  128. /**
  129. * Detect if name or message properties of Error.prototype are enumerable by default.
  130. * (IE < 9, Safari < 5.1)
  131. **/
  132. enumErrorProps: boolean;
  133. /**
  134. * Detect if prototype properties are enumerable by default.
  135. *
  136. * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 (if the prototype or a property on the
  137. * prototype has been set) incorrectly set the [[Enumerable]] value of a function’s prototype property to true.
  138. **/
  139. enumPrototypes: boolean;
  140. /**
  141. * Detect if Function#bind exists and is inferred to be fast (all but V8).
  142. **/
  143. fastBind: boolean;
  144. /**
  145. * Detect if functions can be decompiled by Function#toString (all but PS3 and older Opera
  146. * mobile browsers & avoided in Windows 8 apps).
  147. **/
  148. funcDecomp: boolean;
  149. /**
  150. * Detect if Function#name is supported (all but IE).
  151. **/
  152. funcNames: boolean;
  153. /**
  154. * Detect if arguments object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS,
  155. * Safari < 5.1).
  156. **/
  157. nonEnumArgs: boolean;
  158. /**
  159. * Detect if properties shadowing those on Object.prototype are non-enumerable.
  160. *
  161. * In IE < 9 an objects own properties, shadowing non-enumerable ones, are made
  162. * non-enumerable as well (a.k.a the JScript [[DontEnum]] bug).
  163. **/
  164. nonEnumShadows: boolean;
  165. /**
  166. * Detect if own properties are iterated after inherited properties (all but IE < 9).
  167. **/
  168. ownLast: boolean;
  169. /**
  170. * Detect if Array#shift and Array#splice augment array-like objects correctly.
  171. *
  172. * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array shift() and splice()
  173. * functions that fail to remove the last element, value[0], of array-like objects even
  174. * though the length property is set to 0. The shift() method is buggy in IE 8 compatibility
  175. * mode, while splice() is buggy regardless of mode in IE < 9 and buggy in compatibility mode
  176. * in IE 9.
  177. **/
  178. spliceObjects: boolean;
  179. /**
  180. * Detect lack of support for accessing string characters by index.
  181. *
  182. * IE < 8 can't access characters by index and IE 8 can only access characters by index on
  183. * string literals.
  184. **/
  185. unindexedChars: boolean;
  186. }
  187. interface LoDashWrapperBase<T, TWrapper> { }
  188. interface LoDashImplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
  189. interface LoDashExplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
  190. interface LoDashImplicitWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitWrapper<T>> { }
  191. interface LoDashExplicitWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitWrapper<T>> { }
  192. interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper<string> { }
  193. interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper<string> { }
  194. interface LoDashImplicitObjectWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitObjectWrapper<T>> { }
  195. interface LoDashExplicitObjectWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitObjectWrapper<T>> { }
  196. interface LoDashImplicitArrayWrapper<T> extends LoDashImplicitWrapperBase<T[], LoDashImplicitArrayWrapper<T>> {
  197. join(seperator?: string): string;
  198. pop(): T;
  199. push(...items: T[]): LoDashImplicitArrayWrapper<T>;
  200. shift(): T;
  201. sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper<T>;
  202. splice(start: number): LoDashImplicitArrayWrapper<T>;
  203. splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper<T>;
  204. unshift(...items: T[]): LoDashImplicitArrayWrapper<T>;
  205. }
  206. interface LoDashExplicitArrayWrapper<T> extends LoDashExplicitWrapperBase<T[], LoDashExplicitArrayWrapper<T>> { }
  207. interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper<number> { }
  208. interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper<number> { }
  209. /*********
  210. * Array *
  211. *********/
  212. //_.chunk
  213. interface LoDashStatic {
  214. /**
  215. * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
  216. * final chunk will be the remaining elements.
  217. *
  218. * @param array The array to process.
  219. * @param size The length of each chunk.
  220. * @return Returns the new array containing chunks.
  221. */
  222. chunk<T>(
  223. array: List<T>,
  224. size?: number
  225. ): T[][];
  226. }
  227. interface LoDashImplicitArrayWrapper<T> {
  228. /**
  229. * @see _.chunk
  230. */
  231. chunk(size?: number): LoDashImplicitArrayWrapper<T[]>;
  232. }
  233. interface LoDashImplicitObjectWrapper<T> {
  234. /**
  235. * @see _.chunk
  236. */
  237. chunk<TResult>(size?: number): LoDashImplicitArrayWrapper<TResult[]>;
  238. }
  239. //_.compact
  240. interface LoDashStatic {
  241. /**
  242. * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
  243. * falsey.
  244. *
  245. * @param array The array to compact.
  246. * @return (Array) Returns the new array of filtered values.
  247. */
  248. compact<T>(array?: List<T>): T[];
  249. }
  250. interface LoDashImplicitArrayWrapper<T> {
  251. /**
  252. * @see _.compact
  253. */
  254. compact(): LoDashImplicitArrayWrapper<T>;
  255. }
  256. interface LoDashImplicitObjectWrapper<T> {
  257. /**
  258. * @see _.compact
  259. */
  260. compact<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  261. }
  262. //_.difference
  263. interface LoDashStatic {
  264. /**
  265. * Creates an array of unique array values not included in the other provided arrays using SameValueZero for
  266. * equality comparisons.
  267. *
  268. * @param array The array to inspect.
  269. * @param values The arrays of values to exclude.
  270. * @return Returns the new array of filtered values.
  271. */
  272. difference<T>(
  273. array: T[]|List<T>,
  274. ...values: (T[]|List<T>)[]
  275. ): T[];
  276. }
  277. interface LoDashImplicitArrayWrapper<T> {
  278. /**
  279. * @see _.difference
  280. */
  281. difference(...values: (T[]|List<T>)[]): LoDashImplicitArrayWrapper<T>;
  282. }
  283. interface LoDashImplicitObjectWrapper<T> {
  284. /**
  285. * @see _.difference
  286. */
  287. difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashImplicitArrayWrapper<TValue>;
  288. }
  289. //_.drop
  290. interface LoDashStatic {
  291. /**
  292. * Creates a slice of array with n elements dropped from the beginning.
  293. *
  294. * @param array The array to query.
  295. * @param n The number of elements to drop.
  296. * @return Returns the slice of array.
  297. */
  298. drop<T>(array: T[]|List<T>, n?: number): T[];
  299. }
  300. interface LoDashImplicitArrayWrapper<T> {
  301. /**
  302. * @see _.drop
  303. */
  304. drop(n?: number): LoDashImplicitArrayWrapper<T>;
  305. }
  306. interface LoDashImplicitObjectWrapper<T> {
  307. /**
  308. * @see _.drop
  309. */
  310. drop<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
  311. }
  312. //_.dropRight
  313. interface LoDashStatic {
  314. /**
  315. * Creates a slice of array with n elements dropped from the end.
  316. *
  317. * @param array The array to query.
  318. * @param n The number of elements to drop.
  319. * @return Returns the slice of array.
  320. */
  321. dropRight<T>(
  322. array: List<T>,
  323. n?: number
  324. ): T[];
  325. }
  326. interface LoDashImplicitArrayWrapper<T> {
  327. /**
  328. * @see _.dropRight
  329. */
  330. dropRight(n?: number): LoDashImplicitArrayWrapper<T>;
  331. }
  332. interface LoDashImplicitObjectWrapper<T> {
  333. /**
  334. * @see _.dropRight
  335. */
  336. dropRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
  337. }
  338. //_.dropRightWhile
  339. interface LoDashStatic {
  340. /**
  341. * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate
  342. * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
  343. *
  344. * If a property name is provided for predicate the created _.property style callback returns the property
  345. * value of the given element.
  346. *
  347. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  348. * elements that have a matching property value, else false.
  349. *
  350. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  351. * match the properties of the given object, else false.
  352. *
  353. * @param array The array to query.
  354. * @param predicate The function invoked per iteration.
  355. * @param thisArg The this binding of predicate.
  356. * @return Returns the slice of array.
  357. */
  358. dropRightWhile<TValue>(
  359. array: List<TValue>,
  360. predicate?: ListIterator<TValue, boolean>,
  361. thisArg?: any
  362. ): TValue[];
  363. /**
  364. * @see _.dropRightWhile
  365. */
  366. dropRightWhile<TValue>(
  367. array: List<TValue>,
  368. predicate?: string,
  369. thisArg?: any
  370. ): TValue[];
  371. /**
  372. * @see _.dropRightWhile
  373. */
  374. dropRightWhile<TWhere, TValue>(
  375. array: List<TValue>,
  376. predicate?: TWhere
  377. ): TValue[];
  378. }
  379. interface LoDashImplicitArrayWrapper<T> {
  380. /**
  381. * @see _.dropRightWhile
  382. */
  383. dropRightWhile(
  384. predicate?: ListIterator<T, boolean>,
  385. thisArg?: any
  386. ): LoDashImplicitArrayWrapper<T>;
  387. /**
  388. * @see _.dropRightWhile
  389. */
  390. dropRightWhile(
  391. predicate?: string,
  392. thisArg?: any
  393. ): LoDashImplicitArrayWrapper<T>;
  394. /**
  395. * @see _.dropRightWhile
  396. */
  397. dropRightWhile<TWhere>(
  398. predicate?: TWhere
  399. ): LoDashImplicitArrayWrapper<T>;
  400. }
  401. interface LoDashImplicitObjectWrapper<T> {
  402. /**
  403. * @see _.dropRightWhile
  404. */
  405. dropRightWhile<TValue>(
  406. predicate?: ListIterator<TValue, boolean>,
  407. thisArg?: any
  408. ): LoDashImplicitArrayWrapper<TValue>;
  409. /**
  410. * @see _.dropRightWhile
  411. */
  412. dropRightWhile<TValue>(
  413. predicate?: string,
  414. thisArg?: any
  415. ): LoDashImplicitArrayWrapper<TValue>;
  416. /**
  417. * @see _.dropRightWhile
  418. */
  419. dropRightWhile<TWhere, TValue>(
  420. predicate?: TWhere
  421. ): LoDashImplicitArrayWrapper<TValue>;
  422. }
  423. //_.dropWhile
  424. interface LoDashStatic {
  425. /**
  426. * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate
  427. * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
  428. *
  429. * If a property name is provided for predicate the created _.property style callback returns the property
  430. * value of the given element.
  431. *
  432. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  433. * elements that have a matching property value, else false.
  434. *
  435. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  436. * have the properties of the given object, else false.
  437. *
  438. * @param array The array to query.
  439. * @param predicate The function invoked per iteration.
  440. * @param thisArg The this binding of predicate.
  441. * @return Returns the slice of array.
  442. */
  443. dropWhile<TValue>(
  444. array: List<TValue>,
  445. predicate?: ListIterator<TValue, boolean>,
  446. thisArg?: any
  447. ): TValue[];
  448. /**
  449. * @see _.dropWhile
  450. */
  451. dropWhile<TValue>(
  452. array: List<TValue>,
  453. predicate?: string,
  454. thisArg?: any
  455. ): TValue[];
  456. /**
  457. * @see _.dropWhile
  458. */
  459. dropWhile<TWhere, TValue>(
  460. array: List<TValue>,
  461. predicate?: TWhere
  462. ): TValue[];
  463. }
  464. interface LoDashImplicitArrayWrapper<T> {
  465. /**
  466. * @see _.dropWhile
  467. */
  468. dropWhile(
  469. predicate?: ListIterator<T, boolean>,
  470. thisArg?: any
  471. ): LoDashImplicitArrayWrapper<T>;
  472. /**
  473. * @see _.dropWhile
  474. */
  475. dropWhile(
  476. predicate?: string,
  477. thisArg?: any
  478. ): LoDashImplicitArrayWrapper<T>;
  479. /**
  480. * @see _.dropWhile
  481. */
  482. dropWhile<TWhere>(
  483. predicate?: TWhere
  484. ): LoDashImplicitArrayWrapper<T>;
  485. }
  486. interface LoDashImplicitObjectWrapper<T> {
  487. /**
  488. * @see _.dropWhile
  489. */
  490. dropWhile<TValue>(
  491. predicate?: ListIterator<TValue, boolean>,
  492. thisArg?: any
  493. ): LoDashImplicitArrayWrapper<TValue>;
  494. /**
  495. * @see _.dropWhile
  496. */
  497. dropWhile<TValue>(
  498. predicate?: string,
  499. thisArg?: any
  500. ): LoDashImplicitArrayWrapper<TValue>;
  501. /**
  502. * @see _.dropWhile
  503. */
  504. dropWhile<TWhere, TValue>(
  505. predicate?: TWhere
  506. ): LoDashImplicitArrayWrapper<TValue>;
  507. }
  508. //_.findIndex
  509. interface LoDashStatic {
  510. /**
  511. * This method is like _.find except that it returns the index of the first element predicate returns truthy
  512. * for instead of the element itself.
  513. *
  514. * If a property name is provided for predicate the created _.property style callback returns the property
  515. * value of the given element.
  516. *
  517. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  518. * elements that have a matching property value, else false.
  519. *
  520. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  521. * have the properties of the given object, else false.
  522. *
  523. * @param array The array to search.
  524. * @param predicate The function invoked per iteration.
  525. * @param thisArg The this binding of predicate.
  526. * @return Returns the index of the found element, else -1.
  527. */
  528. findIndex<T>(
  529. array: List<T>,
  530. predicate?: ListIterator<T, boolean>,
  531. thisArg?: any
  532. ): number;
  533. /**
  534. * @see _.findIndex
  535. */
  536. findIndex<T>(
  537. array: List<T>,
  538. predicate?: string,
  539. thisArg?: any
  540. ): number;
  541. /**
  542. * @see _.findIndex
  543. */
  544. findIndex<W, T>(
  545. array: List<T>,
  546. predicate?: W
  547. ): number;
  548. }
  549. interface LoDashImplicitArrayWrapper<T> {
  550. /**
  551. * @see _.findIndex
  552. */
  553. findIndex(
  554. predicate?: ListIterator<T, boolean>,
  555. thisArg?: any
  556. ): number;
  557. /**
  558. * @see _.findIndex
  559. */
  560. findIndex(
  561. predicate?: string,
  562. thisArg?: any
  563. ): number;
  564. /**
  565. * @see _.findIndex
  566. */
  567. findIndex<W>(
  568. predicate?: W
  569. ): number;
  570. }
  571. interface LoDashImplicitObjectWrapper<T> {
  572. /**
  573. * @see _.findIndex
  574. */
  575. findIndex<TResult>(
  576. predicate?: ListIterator<TResult, boolean>,
  577. thisArg?: any
  578. ): number;
  579. /**
  580. * @see _.findIndex
  581. */
  582. findIndex(
  583. predicate?: string,
  584. thisArg?: any
  585. ): number;
  586. /**
  587. * @see _.findIndex
  588. */
  589. findIndex<W>(
  590. predicate?: W
  591. ): number;
  592. }
  593. //_.findLastIndex
  594. interface LoDashStatic {
  595. /**
  596. * This method is like _.findIndex except that it iterates over elements of collection from right to left.
  597. *
  598. * If a property name is provided for predicate the created _.property style callback returns the property
  599. * value of the given element.
  600. *
  601. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  602. * elements that have a matching property value, else false.
  603. *
  604. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  605. * have the properties of the given object, else false.
  606. *
  607. * @param array The array to search.
  608. * @param predicate The function invoked per iteration.
  609. * @param thisArg The function invoked per iteration.
  610. * @return Returns the index of the found element, else -1.
  611. */
  612. findLastIndex<T>(
  613. array: List<T>,
  614. predicate?: ListIterator<T, boolean>,
  615. thisArg?: any
  616. ): number;
  617. /**
  618. * @see _.findLastIndex
  619. */
  620. findLastIndex<T>(
  621. array: List<T>,
  622. predicate?: string,
  623. thisArg?: any
  624. ): number;
  625. /**
  626. * @see _.findLastIndex
  627. */
  628. findLastIndex<W, T>(
  629. array: List<T>,
  630. predicate?: W
  631. ): number;
  632. }
  633. interface LoDashImplicitArrayWrapper<T> {
  634. /**
  635. * @see _.findLastIndex
  636. */
  637. findLastIndex(
  638. predicate?: ListIterator<T, boolean>,
  639. thisArg?: any
  640. ): number;
  641. /**
  642. * @see _.findLastIndex
  643. */
  644. findLastIndex(
  645. predicate?: string,
  646. thisArg?: any
  647. ): number;
  648. /**
  649. * @see _.findLastIndex
  650. */
  651. findLastIndex<W>(
  652. predicate?: W
  653. ): number;
  654. }
  655. interface LoDashImplicitObjectWrapper<T> {
  656. /**
  657. * @see _.findLastIndex
  658. */
  659. findLastIndex<TResult>(
  660. predicate?: ListIterator<TResult, boolean>,
  661. thisArg?: any
  662. ): number;
  663. /**
  664. * @see _.findLastIndex
  665. */
  666. findLastIndex(
  667. predicate?: string,
  668. thisArg?: any
  669. ): number;
  670. /**
  671. * @see _.findLastIndex
  672. */
  673. findLastIndex<W>(
  674. predicate?: W
  675. ): number;
  676. }
  677. //_.first
  678. interface LoDashStatic {
  679. /**
  680. * Gets the first element of array.
  681. *
  682. * @alias _.head
  683. *
  684. * @param array The array to query.
  685. * @return Returns the first element of array.
  686. */
  687. first<T>(array: List<T>): T;
  688. }
  689. interface LoDashImplicitArrayWrapper<T> {
  690. /**
  691. * @see _.first
  692. */
  693. first(): T;
  694. }
  695. interface LoDashImplicitObjectWrapper<T> {
  696. /**
  697. * @see _.first
  698. */
  699. first<TResult>(): TResult;
  700. }
  701. interface MaybeNestedList<T> extends List<T|List<T>> { }
  702. interface RecursiveArray<T> extends Array<T|RecursiveArray<T>> { }
  703. interface ListOfRecursiveArraysOrValues<T> extends List<T|RecursiveArray<T>> { }
  704. interface RecursiveList<T> extends List<T|RecursiveList<T>> { }
  705. //_.flatten
  706. interface LoDashStatic {
  707. /**
  708. * Flattens a nested array a single level.
  709. *
  710. * _.flatten(x) is equivalent to _.flatten(x, false);
  711. *
  712. * @param array The array to flatten.
  713. * @return `array` flattened.
  714. **/
  715. flatten<T>(array: MaybeNestedList<T>): T[];
  716. /**
  717. * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it is only
  718. * flattened a single level.
  719. *
  720. * If you know whether or not this should be recursively at compile time, you typically want to use a
  721. * version without a boolean parameter (i.e. `_.flatten(x)` or `_.flattenDeep(x)`).
  722. *
  723. * @param array The array to flatten.
  724. * @param deep Specify a deep flatten.
  725. * @return `array` flattened.
  726. **/
  727. flatten<T>(array: RecursiveList<T>, isDeep: boolean): List<T> | RecursiveList<T>;
  728. }
  729. interface LoDashImplicitArrayWrapper<T> {
  730. /**
  731. * @see _.flatten
  732. **/
  733. flatten<T>(): LoDashImplicitArrayWrapper<any>;
  734. /**
  735. * @see _.flatten
  736. **/
  737. flatten<T>(isShallow: boolean): LoDashImplicitArrayWrapper<any>;
  738. }
  739. //_.flattenDeep
  740. interface LoDashStatic {
  741. /**
  742. * Recursively flattens a nested array.
  743. *
  744. * @param array The array to recursively flatten.
  745. * @return Returns the new flattened array.
  746. */
  747. flattenDeep<T>(array: RecursiveArray<T>): T[];
  748. /**
  749. * @see _.flattenDeep
  750. */
  751. flattenDeep<T>(array: ListOfRecursiveArraysOrValues<T>): T[];
  752. /**
  753. * @see _.flattenDeep
  754. */
  755. flattenDeep<T>(array: RecursiveList<T>): any[];
  756. }
  757. interface LoDashImplicitArrayWrapper<T> {
  758. /**
  759. * @see _.flattenDeep
  760. */
  761. flattenDeep<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  762. }
  763. interface LoDashImplicitObjectWrapper<T> {
  764. /**
  765. * @see _.flattenDeep
  766. */
  767. flattenDeep<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  768. }
  769. //_.head
  770. interface LoDashStatic {
  771. /**
  772. * @see _.first
  773. */
  774. head<T>(array: List<T>): T;
  775. }
  776. interface LoDashImplicitArrayWrapper<T> {
  777. /**
  778. * @see _.first
  779. */
  780. head(): T;
  781. }
  782. interface LoDashImplicitObjectWrapper<T> {
  783. /**
  784. * @see _.first
  785. */
  786. head<TResult>(): TResult;
  787. }
  788. //_.indexOf
  789. interface LoDashStatic {
  790. /**
  791. * Gets the index at which the first occurrence of value is found in array using SameValueZero for equality
  792. * comparisons. If fromIndex is negative, it’s used as the offset from the end of array. If array is sorted
  793. * providing true for fromIndex performs a faster binary search.
  794. *
  795. * @param array The array to search.
  796. * @param value The value to search for.
  797. * @param fromIndex The index to search from or true to perform a binary search on a sorted array.
  798. * @return The index to search from or true to perform a binary search on a sorted array.
  799. */
  800. indexOf<T>(
  801. array: List<T>,
  802. value: T,
  803. fromIndex?: boolean|number
  804. ): number;
  805. }
  806. interface LoDashImplicitArrayWrapper<T> {
  807. /**
  808. * @see _.indexOf
  809. */
  810. indexOf(
  811. value: T,
  812. fromIndex?: boolean|number
  813. ): number;
  814. }
  815. interface LoDashImplicitObjectWrapper<T> {
  816. /**
  817. * @see _.indexOf
  818. */
  819. indexOf<TValue>(
  820. value: TValue,
  821. fromIndex?: boolean|number
  822. ): number;
  823. }
  824. //_.initial
  825. interface LoDashStatic {
  826. /**
  827. * Gets all but the last element of array.
  828. *
  829. * @param array The array to query.
  830. * @return Returns the slice of array.
  831. */
  832. initial<T>(array: T[]|List<T>): T[];
  833. }
  834. interface LoDashImplicitArrayWrapper<T> {
  835. /**
  836. * @see _.initial
  837. */
  838. initial(): LoDashImplicitArrayWrapper<T>;
  839. }
  840. interface LoDashImplicitObjectWrapper<T> {
  841. /**
  842. * @see _.initial
  843. */
  844. initial<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  845. }
  846. //_.intersection
  847. interface LoDashStatic {
  848. /**
  849. * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for
  850. * equality comparisons.
  851. *
  852. * @param arrays The arrays to inspect.
  853. * @return Returns the new array of shared values.
  854. */
  855. intersection<T>(...arrays: (T[]|List<T>)[]): T[];
  856. }
  857. interface LoDashImplicitArrayWrapper<T> {
  858. /**
  859. * @see _.intersection
  860. */
  861. intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
  862. }
  863. interface LoDashImplicitObjectWrapper<T> {
  864. /**
  865. * @see _.intersection
  866. */
  867. intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
  868. }
  869. //_.last
  870. interface LoDashStatic {
  871. /**
  872. * Gets the last element of array.
  873. *
  874. * @param array The array to query.
  875. * @return Returns the last element of array.
  876. */
  877. last<T>(array: List<T>): T;
  878. }
  879. interface LoDashImplicitArrayWrapper<T> {
  880. /**
  881. * @see _.last
  882. */
  883. last(): T;
  884. }
  885. interface LoDashImplicitObjectWrapper<T> {
  886. /**
  887. * @see _.last
  888. */
  889. last<T>(): T;
  890. }
  891. //_.lastIndexOf
  892. interface LoDashStatic {
  893. /**
  894. * This method is like _.indexOf except that it iterates over elements of array from right to left.
  895. *
  896. * @param array The array to search.
  897. * @param value The value to search for.
  898. * @param fromIndex The index to search from or true to perform a binary search on a sorted array.
  899. * @return Returns the index of the matched value, else -1.
  900. */
  901. lastIndexOf<T>(
  902. array: List<T>,
  903. value: T,
  904. fromIndex?: boolean|number
  905. ): number;
  906. }
  907. interface LoDashImplicitArrayWrapper<T> {
  908. /**
  909. * @see _.lastIndexOf
  910. */
  911. lastIndexOf(
  912. value: T,
  913. fromIndex?: boolean|number
  914. ): number;
  915. }
  916. interface LoDashImplicitObjectWrapper<T> {
  917. /**
  918. * @see _.lastIndexOf
  919. */
  920. lastIndexOf<TResult>(
  921. value: TResult,
  922. fromIndex?: boolean|number
  923. ): number;
  924. }
  925. //_.object
  926. interface LoDashStatic {
  927. /**
  928. * @see _.zipObject
  929. */
  930. object<TValues, TResult extends {}>(
  931. props: List<StringRepresentable>,
  932. values?: List<TValues>
  933. ): TResult;
  934. /**
  935. * @see _.zipObject
  936. */
  937. object<TResult extends {}>(
  938. props: List<StringRepresentable>,
  939. values?: List<any>
  940. ): TResult;
  941. /**
  942. * @see _.zipObject
  943. */
  944. object(
  945. props: List<StringRepresentable>,
  946. values?: List<any>
  947. ): _.Dictionary<any>;
  948. }
  949. interface LoDashImplicitArrayWrapper<T> {
  950. /**
  951. * @see _.zipObject
  952. */
  953. object<TValues, TResult extends {}>(
  954. values?: List<TValues>
  955. ): _.LoDashImplicitObjectWrapper<TResult>;
  956. /**
  957. * @see _.zipObject
  958. */
  959. object<TResult extends {}>(
  960. values?: List<any>
  961. ): _.LoDashImplicitObjectWrapper<TResult>;
  962. /**
  963. * @see _.zipObject
  964. */
  965. object(
  966. values?: List<any>
  967. ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
  968. }
  969. interface LoDashImplicitObjectWrapper<T> {
  970. /**
  971. * @see _.zipObject
  972. */
  973. object<TValues, TResult extends {}>(
  974. values?: List<TValues>
  975. ): _.LoDashImplicitObjectWrapper<TResult>;
  976. /**
  977. * @see _.zipObject
  978. */
  979. object<TResult extends {}>(
  980. values?: List<any>
  981. ): _.LoDashImplicitObjectWrapper<TResult>;
  982. /**
  983. * @see _.zipObject
  984. */
  985. object(
  986. values?: List<any>
  987. ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
  988. }
  989. //_.pull
  990. interface LoDashStatic {
  991. /**
  992. * Removes all provided values from array using SameValueZero for equality comparisons.
  993. *
  994. * Note: Unlike _.without, this method mutates array.
  995. *
  996. * @param array The array to modify.
  997. * @param values The values to remove.
  998. * @return Returns array.
  999. */
  1000. pull<T>(
  1001. array: T[],
  1002. ...values: T[]
  1003. ): T[];
  1004. /**
  1005. * @see _.pull
  1006. */
  1007. pull<T>(
  1008. array: List<T>,
  1009. ...values: T[]
  1010. ): List<T>;
  1011. }
  1012. interface LoDashImplicitArrayWrapper<T> {
  1013. /**
  1014. * @see _.pull
  1015. */
  1016. pull(...values: T[]): LoDashImplicitArrayWrapper<T>;
  1017. }
  1018. interface LoDashImplicitObjectWrapper<T> {
  1019. /**
  1020. * @see _.pull
  1021. */
  1022. pull<TValue>(...values: TValue[]): LoDashImplicitObjectWrapper<List<TValue>>;
  1023. }
  1024. //_.pullAt
  1025. interface LoDashStatic {
  1026. /**
  1027. * Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
  1028. * Indexes may be specified as an array of indexes or as individual arguments.
  1029. *
  1030. * Note: Unlike _.at, this method mutates array.
  1031. *
  1032. * @param array The array to modify.
  1033. * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes.
  1034. * @return Returns the new array of removed elements.
  1035. */
  1036. pullAt<T>(
  1037. array: T[]|List<T>,
  1038. ...indexes: (number|number[])[]
  1039. ): T[];
  1040. }
  1041. interface LoDashImplicitArrayWrapper<T> {
  1042. /**
  1043. * @see _.pullAt
  1044. */
  1045. pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
  1046. }
  1047. interface LoDashImplicitObjectWrapper<T> {
  1048. /**
  1049. * @see _.pullAt
  1050. */
  1051. pullAt<TValue>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<TValue>;
  1052. }
  1053. //_.remove
  1054. interface LoDashStatic {
  1055. /**
  1056. * Removes all elements from array that predicate returns truthy for and returns an array of the removed
  1057. * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
  1058. *
  1059. * If a property name is provided for predicate the created _.property style callback returns the property
  1060. * value of the given element.
  1061. *
  1062. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  1063. * elements that have a matching property value, else false.
  1064. *
  1065. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  1066. * have the properties of the given object, else false.
  1067. *
  1068. * Note: Unlike _.filter, this method mutates array.
  1069. *
  1070. * @param array The array to modify.
  1071. * @param predicate The function invoked per iteration.
  1072. * @param thisArg The this binding of predicate.
  1073. * @return Returns the new array of removed elements.
  1074. */
  1075. remove<T>(
  1076. array: List<T>,
  1077. predicate?: ListIterator<T, boolean>,
  1078. thisArg?: any
  1079. ): T[];
  1080. /**
  1081. * @see _.remove
  1082. */
  1083. remove<T>(
  1084. array: List<T>,
  1085. predicate?: string,
  1086. thisArg?: any
  1087. ): T[];
  1088. /**
  1089. * @see _.remove
  1090. */
  1091. remove<W, T>(
  1092. array: List<T>,
  1093. predicate?: W
  1094. ): T[];
  1095. }
  1096. interface LoDashImplicitArrayWrapper<T> {
  1097. /**
  1098. * @see _.remove
  1099. */
  1100. remove(
  1101. predicate?: ListIterator<T, boolean>,
  1102. thisArg?: any
  1103. ): LoDashImplicitArrayWrapper<T>;
  1104. /**
  1105. * @see _.remove
  1106. */
  1107. remove(
  1108. predicate?: string,
  1109. thisArg?: any
  1110. ): LoDashImplicitArrayWrapper<T>;
  1111. /**
  1112. * @see _.remove
  1113. */
  1114. remove<W>(
  1115. predicate?: W
  1116. ): LoDashImplicitArrayWrapper<T>;
  1117. }
  1118. interface LoDashImplicitObjectWrapper<T> {
  1119. /**
  1120. * @see _.remove
  1121. */
  1122. remove<TResult>(
  1123. predicate?: ListIterator<TResult, boolean>,
  1124. thisArg?: any
  1125. ): LoDashImplicitArrayWrapper<TResult>;
  1126. /**
  1127. * @see _.remove
  1128. */
  1129. remove<TResult>(
  1130. predicate?: string,
  1131. thisArg?: any
  1132. ): LoDashImplicitArrayWrapper<TResult>;
  1133. /**
  1134. * @see _.remove
  1135. */
  1136. remove<W, TResult>(
  1137. predicate?: W
  1138. ): LoDashImplicitArrayWrapper<TResult>;
  1139. }
  1140. //_.rest
  1141. interface LoDashStatic {
  1142. /**
  1143. * Gets all but the first element of array.
  1144. *
  1145. * @alias _.tail
  1146. *
  1147. * @param array The array to query.
  1148. * @return Returns the slice of array.
  1149. */
  1150. rest<T>(array: List<T>): T[];
  1151. }
  1152. interface LoDashImplicitArrayWrapper<T> {
  1153. /**
  1154. * @see _.rest
  1155. */
  1156. rest(): LoDashImplicitArrayWrapper<T>;
  1157. }
  1158. interface LoDashImplicitObjectWrapper<T> {
  1159. /**
  1160. * @see _.rest
  1161. */
  1162. rest<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  1163. }
  1164. //_.slice
  1165. interface LoDashStatic {
  1166. /**
  1167. * Creates a slice of array from start up to, but not including, end.
  1168. *
  1169. * @param array The array to slice.
  1170. * @param start The start position.
  1171. * @param end The end position.
  1172. * @return Returns the slice of array.
  1173. */
  1174. slice<T>(
  1175. array: T[],
  1176. start?: number,
  1177. end?: number
  1178. ): T[];
  1179. }
  1180. interface LoDashImplicitArrayWrapper<T> {
  1181. /**
  1182. * @see _.slice
  1183. */
  1184. slice(
  1185. start?: number,
  1186. end?: number
  1187. ): LoDashImplicitArrayWrapper<T>;
  1188. }
  1189. //_.sortedIndex
  1190. interface LoDashStatic {
  1191. /**
  1192. * Uses a binary search to determine the smallest index at which a value should be inserted
  1193. * into a given sorted array in order to maintain the sort order of the array. If a callback
  1194. * is provided it will be executed for value and each element of array to compute their sort
  1195. * ranking. The callback is bound to thisArg and invoked with one argument; (value).
  1196. *
  1197. * If a property name is provided for callback the created "_.pluck" style callback will
  1198. * return the property value of the given element.
  1199. *
  1200. * If an object is provided for callback the created "_.where" style callback will return
  1201. * true for elements that have the properties of the given object, else false.
  1202. * @param array The sorted list.
  1203. * @param value The value to determine its index within `list`.
  1204. * @param callback Iterator to compute the sort ranking of each value, optional.
  1205. * @return The index at which value should be inserted into array.
  1206. **/
  1207. sortedIndex<T, TSort>(
  1208. array: Array<T>,
  1209. value: T,
  1210. callback?: (x: T) => TSort,
  1211. thisArg?: any): number;
  1212. /**
  1213. * @see _.sortedIndex
  1214. **/
  1215. sortedIndex<T, TSort>(
  1216. array: List<T>,
  1217. value: T,
  1218. callback?: (x: T) => TSort,
  1219. thisArg?: any): number;
  1220. /**
  1221. * @see _.sortedIndex
  1222. * @param pluckValue the _.pluck style callback
  1223. **/
  1224. sortedIndex<T>(
  1225. array: Array<T>,
  1226. value: T,
  1227. pluckValue: string): number;
  1228. /**
  1229. * @see _.sortedIndex
  1230. * @param pluckValue the _.pluck style callback
  1231. **/
  1232. sortedIndex<T>(
  1233. array: List<T>,
  1234. value: T,
  1235. pluckValue: string): number;
  1236. /**
  1237. * @see _.sortedIndex
  1238. * @param pluckValue the _.where style callback
  1239. **/
  1240. sortedIndex<W, T>(
  1241. array: Array<T>,
  1242. value: T,
  1243. whereValue: W): number;
  1244. /**
  1245. * @see _.sortedIndex
  1246. * @param pluckValue the _.where style callback
  1247. **/
  1248. sortedIndex<W, T>(
  1249. array: List<T>,
  1250. value: T,
  1251. whereValue: W): number;
  1252. }
  1253. //_.tail
  1254. interface LoDashStatic {
  1255. /**
  1256. * @see _.rest
  1257. */
  1258. tail<T>(array: List<T>): T[];
  1259. }
  1260. interface LoDashImplicitArrayWrapper<T> {
  1261. /**
  1262. * @see _.rest
  1263. */
  1264. tail(): LoDashImplicitArrayWrapper<T>;
  1265. }
  1266. interface LoDashImplicitObjectWrapper<T> {
  1267. /**
  1268. * @see _.rest
  1269. */
  1270. tail<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  1271. }
  1272. //_.take
  1273. interface LoDashStatic {
  1274. /**
  1275. * Creates a slice of array with n elements taken from the beginning.
  1276. *
  1277. * @param array The array to query.
  1278. * @param n The number of elements to take.
  1279. * @return Returns the slice of array.
  1280. */
  1281. take<T>(
  1282. array: List<T>,
  1283. n?: number
  1284. ): T[];
  1285. }
  1286. interface LoDashImplicitArrayWrapper<T> {
  1287. /**
  1288. * @see _.take
  1289. */
  1290. take(n?: number): LoDashImplicitArrayWrapper<T>;
  1291. }
  1292. interface LoDashImplicitObjectWrapper<T> {
  1293. /**
  1294. * @see _.take
  1295. */
  1296. take<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
  1297. }
  1298. //_.takeRight
  1299. interface LoDashStatic {
  1300. /**
  1301. * Creates a slice of array with n elements taken from the end.
  1302. *
  1303. * @param array The array to query.
  1304. * @param n The number of elements to take.
  1305. * @return Returns the slice of array.
  1306. */
  1307. takeRight<T>(
  1308. array: T[]|List<T>,
  1309. n?: number
  1310. ): T[];
  1311. }
  1312. interface LoDashImplicitArrayWrapper<T> {
  1313. /**
  1314. * @see _.takeRight
  1315. */
  1316. takeRight(n?: number): LoDashImplicitArrayWrapper<T>;
  1317. }
  1318. interface LoDashImplicitObjectWrapper<T> {
  1319. /**
  1320. * @see _.takeRight
  1321. */
  1322. takeRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
  1323. }
  1324. //_.takeRightWhile
  1325. interface LoDashStatic {
  1326. /**
  1327. * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns
  1328. * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
  1329. *
  1330. * If a property name is provided for predicate the created _.property style callback returns the property
  1331. * value of the given element.
  1332. *
  1333. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  1334. * elements that have a matching property value, else false.
  1335. *
  1336. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  1337. * have the properties of the given object, else false.
  1338. *
  1339. * @param array The array to query.
  1340. * @param predicate The function invoked per iteration.
  1341. * @param thisArg The this binding of predicate.
  1342. * @return Returns the slice of array.
  1343. */
  1344. takeRightWhile<TValue>(
  1345. array: List<TValue>,
  1346. predicate?: ListIterator<TValue, boolean>,
  1347. thisArg?: any
  1348. ): TValue[];
  1349. /**
  1350. * @see _.takeRightWhile
  1351. */
  1352. takeRightWhile<TValue>(
  1353. array: List<TValue>,
  1354. predicate?: string,
  1355. thisArg?: any
  1356. ): TValue[];
  1357. /**
  1358. * @see _.takeRightWhile
  1359. */
  1360. takeRightWhile<TWhere, TValue>(
  1361. array: List<TValue>,
  1362. predicate?: TWhere
  1363. ): TValue[];
  1364. }
  1365. interface LoDashImplicitArrayWrapper<T> {
  1366. /**
  1367. * @see _.takeRightWhile
  1368. */
  1369. takeRightWhile(
  1370. predicate?: ListIterator<T, boolean>,
  1371. thisArg?: any
  1372. ): LoDashImplicitArrayWrapper<T>;
  1373. /**
  1374. * @see _.takeRightWhile
  1375. */
  1376. takeRightWhile(
  1377. predicate?: string,
  1378. thisArg?: any
  1379. ): LoDashImplicitArrayWrapper<T>;
  1380. /**
  1381. * @see _.takeRightWhile
  1382. */
  1383. takeRightWhile<TWhere>(
  1384. predicate?: TWhere
  1385. ): LoDashImplicitArrayWrapper<T>;
  1386. }
  1387. interface LoDashImplicitObjectWrapper<T> {
  1388. /**
  1389. * @see _.takeRightWhile
  1390. */
  1391. takeRightWhile<TValue>(
  1392. predicate?: ListIterator<TValue, boolean>,
  1393. thisArg?: any
  1394. ): LoDashImplicitArrayWrapper<TValue>;
  1395. /**
  1396. * @see _.takeRightWhile
  1397. */
  1398. takeRightWhile<TValue>(
  1399. predicate?: string,
  1400. thisArg?: any
  1401. ): LoDashImplicitArrayWrapper<TValue>;
  1402. /**
  1403. * @see _.takeRightWhile
  1404. */
  1405. takeRightWhile<TWhere, TValue>(
  1406. predicate?: TWhere
  1407. ): LoDashImplicitArrayWrapper<TValue>;
  1408. }
  1409. //_.takeWhile
  1410. interface LoDashStatic {
  1411. /**
  1412. * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns
  1413. * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
  1414. *
  1415. * If a property name is provided for predicate the created _.property style callback returns the property
  1416. * value of the given element.
  1417. *
  1418. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  1419. * elements that have a matching property value, else false.
  1420. *
  1421. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  1422. * have the properties of the given object, else false.
  1423. *
  1424. * @param array The array to query.
  1425. * @param predicate The function invoked per iteration.
  1426. * @param thisArg The this binding of predicate.
  1427. * @return Returns the slice of array.
  1428. */
  1429. takeWhile<TValue>(
  1430. array: List<TValue>,
  1431. predicate?: ListIterator<TValue, boolean>,
  1432. thisArg?: any
  1433. ): TValue[];
  1434. /**
  1435. * @see _.takeWhile
  1436. */
  1437. takeWhile<TValue>(
  1438. array: List<TValue>,
  1439. predicate?: string,
  1440. thisArg?: any
  1441. ): TValue[];
  1442. /**
  1443. * @see _.takeWhile
  1444. */
  1445. takeWhile<TWhere, TValue>(
  1446. array: List<TValue>,
  1447. predicate?: TWhere
  1448. ): TValue[];
  1449. }
  1450. interface LoDashImplicitArrayWrapper<T> {
  1451. /**
  1452. * @see _.takeWhile
  1453. */
  1454. takeWhile(
  1455. predicate?: ListIterator<T, boolean>,
  1456. thisArg?: any
  1457. ): LoDashImplicitArrayWrapper<T>;
  1458. /**
  1459. * @see _.takeWhile
  1460. */
  1461. takeWhile(
  1462. predicate?: string,
  1463. thisArg?: any
  1464. ): LoDashImplicitArrayWrapper<T>;
  1465. /**
  1466. * @see _.takeWhile
  1467. */
  1468. takeWhile<TWhere>(
  1469. predicate?: TWhere
  1470. ): LoDashImplicitArrayWrapper<T>;
  1471. }
  1472. interface LoDashImplicitObjectWrapper<T> {
  1473. /**
  1474. * @see _.takeWhile
  1475. */
  1476. takeWhile<TValue>(
  1477. predicate?: ListIterator<TValue, boolean>,
  1478. thisArg?: any
  1479. ): LoDashImplicitArrayWrapper<TValue>;
  1480. /**
  1481. * @see _.takeWhile
  1482. */
  1483. takeWhile<TValue>(
  1484. predicate?: string,
  1485. thisArg?: any
  1486. ): LoDashImplicitArrayWrapper<TValue>;
  1487. /**
  1488. * @see _.takeWhile
  1489. */
  1490. takeWhile<TWhere, TValue>(
  1491. predicate?: TWhere
  1492. ): LoDashImplicitArrayWrapper<TValue>;
  1493. }
  1494. //_.union
  1495. interface LoDashStatic {
  1496. /**
  1497. * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for
  1498. * equality comparisons.
  1499. *
  1500. * @param arrays The arrays to inspect.
  1501. * @return Returns the new array of combined values.
  1502. */
  1503. union<T>(...arrays: List<T>[]): T[];
  1504. }
  1505. interface LoDashImplicitArrayWrapper<T> {
  1506. /**
  1507. * @see _.union
  1508. */
  1509. union(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
  1510. /**
  1511. * @see _.union
  1512. */
  1513. union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
  1514. }
  1515. interface LoDashImplicitObjectWrapper<T> {
  1516. /**
  1517. * @see _.union
  1518. */
  1519. union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
  1520. }
  1521. //_.uniq
  1522. interface LoDashStatic {
  1523. /**
  1524. * Creates a duplicate-value-free version of an array using strict equality for comparisons,
  1525. * i.e. ===. If the array is sorted, providing true for isSorted will use a faster algorithm.
  1526. * If a callback is provided each element of array is passed through the callback before
  1527. * uniqueness is computed. The callback is bound to thisArg and invoked with three arguments;
  1528. * (value, index, array).
  1529. *
  1530. * If a property name is provided for callback the created "_.pluck" style callback will
  1531. * return the property value of the given element.
  1532. *
  1533. * If an object is provided for callback the created "_.where" style callback will return
  1534. * true for elements that have the properties of the given object, else false.
  1535. * @param array Array to remove duplicates from.
  1536. * @param isSorted True if `array` is already sorted, optiona, default = false.
  1537. * @param iterator Transform the elements of `array` before comparisons for uniqueness.
  1538. * @param context 'this' object in `iterator`, optional.
  1539. * @return Copy of `array` where all elements are unique.
  1540. **/
  1541. uniq<T, TSort>(array: Array<T>, isSorted?: boolean): T[];
  1542. /**
  1543. * @see _.uniq
  1544. **/
  1545. uniq<T, TSort>(array: List<T>, isSorted?: boolean): T[];
  1546. /**
  1547. * @see _.uniq
  1548. **/
  1549. uniq<T, TSort>(
  1550. array: Array<T>,
  1551. isSorted: boolean,
  1552. callback: ListIterator<T, TSort>,
  1553. thisArg?: any): T[];
  1554. /**
  1555. * @see _.uniq
  1556. **/
  1557. uniq<T, TSort>(
  1558. array: List<T>,
  1559. isSorted: boolean,
  1560. callback: ListIterator<T, TSort>,
  1561. thisArg?: any): T[];
  1562. /**
  1563. * @see _.uniq
  1564. **/
  1565. uniq<T, TSort>(
  1566. array: Array<T>,
  1567. callback: ListIterator<T, TSort>,
  1568. thisArg?: any): T[];
  1569. /**
  1570. * @see _.uniq
  1571. **/
  1572. uniq<T, TSort>(
  1573. array: List<T>,
  1574. callback: ListIterator<T, TSort>,
  1575. thisArg?: any): T[];
  1576. /**
  1577. * @see _.uniq
  1578. * @param pluckValue _.pluck style callback
  1579. **/
  1580. uniq<T>(
  1581. array: Array<T>,
  1582. isSorted: boolean,
  1583. pluckValue: string): T[];
  1584. /**
  1585. * @see _.uniq
  1586. * @param pluckValue _.pluck style callback
  1587. **/
  1588. uniq<T>(
  1589. array: List<T>,
  1590. isSorted: boolean,
  1591. pluckValue: string): T[];
  1592. /**
  1593. * @see _.uniq
  1594. * @param pluckValue _.pluck style callback
  1595. **/
  1596. uniq<T>(
  1597. array: Array<T>,
  1598. pluckValue: string): T[];
  1599. /**
  1600. * @see _.uniq
  1601. * @param pluckValue _.pluck style callback
  1602. **/
  1603. uniq<T>(
  1604. array: List<T>,
  1605. pluckValue: string): T[];
  1606. /**
  1607. * @see _.uniq
  1608. * @param whereValue _.where style callback
  1609. **/
  1610. uniq<W, T>(
  1611. array: Array<T>,
  1612. isSorted: boolean,
  1613. whereValue: W): T[];
  1614. /**
  1615. * @see _.uniq
  1616. * @param whereValue _.where style callback
  1617. **/
  1618. uniq<W, T>(
  1619. array: List<T>,
  1620. isSorted: boolean,
  1621. whereValue: W): T[];
  1622. /**
  1623. * @see _.uniq
  1624. * @param whereValue _.where style callback
  1625. **/
  1626. uniq<W, T>(
  1627. array: Array<T>,
  1628. whereValue: W): T[];
  1629. /**
  1630. * @see _.uniq
  1631. * @param whereValue _.where style callback
  1632. **/
  1633. uniq<W, T>(
  1634. array: List<T>,
  1635. whereValue: W): T[];
  1636. /**
  1637. * @see _.uniq
  1638. **/
  1639. unique<T>(array: Array<T>, isSorted?: boolean): T[];
  1640. /**
  1641. * @see _.uniq
  1642. **/
  1643. unique<T>(array: List<T>, isSorted?: boolean): T[];
  1644. /**
  1645. * @see _.uniq
  1646. **/
  1647. unique<T, TSort>(
  1648. array: Array<T>,
  1649. callback: ListIterator<T, TSort>,
  1650. thisArg?: any): T[];
  1651. /**
  1652. * @see _.uniq
  1653. **/
  1654. unique<T, TSort>(
  1655. array: List<T>,
  1656. callback: ListIterator<T, TSort>,
  1657. thisArg?: any): T[];
  1658. /**
  1659. * @see _.uniq
  1660. **/
  1661. unique<T, TSort>(
  1662. array: Array<T>,
  1663. isSorted: boolean,
  1664. callback: ListIterator<T, TSort>,
  1665. thisArg?: any): T[];
  1666. /**
  1667. * @see _.uniq
  1668. **/
  1669. unique<T, TSort>(
  1670. array: List<T>,
  1671. isSorted: boolean,
  1672. callback: ListIterator<T, TSort>,
  1673. thisArg?: any): T[];
  1674. /**
  1675. * @see _.uniq
  1676. * @param pluckValue _.pluck style callback
  1677. **/
  1678. unique<T>(
  1679. array: Array<T>,
  1680. isSorted: boolean,
  1681. pluckValue: string): T[];
  1682. /**
  1683. * @see _.uniq
  1684. * @param pluckValue _.pluck style callback
  1685. **/
  1686. unique<T>(
  1687. array: List<T>,
  1688. isSorted: boolean,
  1689. pluckValue: string): T[];
  1690. /**
  1691. * @see _.uniq
  1692. * @param pluckValue _.pluck style callback
  1693. **/
  1694. unique<T>(
  1695. array: Array<T>,
  1696. pluckValue: string): T[];
  1697. /**
  1698. * @see _.uniq
  1699. * @param pluckValue _.pluck style callback
  1700. **/
  1701. unique<T>(
  1702. array: List<T>,
  1703. pluckValue: string): T[];
  1704. /**
  1705. * @see _.uniq
  1706. * @param whereValue _.where style callback
  1707. **/
  1708. unique<W, T>(
  1709. array: Array<T>,
  1710. whereValue?: W): T[];
  1711. /**
  1712. * @see _.uniq
  1713. * @param whereValue _.where style callback
  1714. **/
  1715. unique<W, T>(
  1716. array: List<T>,
  1717. whereValue?: W): T[];
  1718. /**
  1719. * @see _.uniq
  1720. * @param whereValue _.where style callback
  1721. **/
  1722. unique<W, T>(
  1723. array: Array<T>,
  1724. isSorted: boolean,
  1725. whereValue?: W): T[];
  1726. /**
  1727. * @see _.uniq
  1728. * @param whereValue _.where style callback
  1729. **/
  1730. unique<W, T>(
  1731. array: List<T>,
  1732. isSorted: boolean,
  1733. whereValue?: W): T[];
  1734. }
  1735. interface LoDashImplicitArrayWrapper<T> {
  1736. /**
  1737. * @see _.uniq
  1738. **/
  1739. uniq<TSort>(isSorted?: boolean): LoDashImplicitArrayWrapper<T>;
  1740. /**
  1741. * @see _.uniq
  1742. **/
  1743. uniq<TSort>(
  1744. isSorted: boolean,
  1745. callback: ListIterator<T, TSort>,
  1746. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  1747. /**
  1748. * @see _.uniq
  1749. **/
  1750. uniq<TSort>(
  1751. callback: ListIterator<T, TSort>,
  1752. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  1753. /**
  1754. * @see _.uniq
  1755. * @param pluckValue _.pluck style callback
  1756. **/
  1757. uniq(
  1758. isSorted: boolean,
  1759. pluckValue: string): LoDashImplicitArrayWrapper<T>;
  1760. /**
  1761. * @see _.uniq
  1762. * @param pluckValue _.pluck style callback
  1763. **/
  1764. uniq(pluckValue: string): LoDashImplicitArrayWrapper<T>;
  1765. /**
  1766. * @see _.uniq
  1767. * @param whereValue _.where style callback
  1768. **/
  1769. uniq<W>(
  1770. isSorted: boolean,
  1771. whereValue: W): LoDashImplicitArrayWrapper<T>;
  1772. /**
  1773. * @see _.uniq
  1774. * @param whereValue _.where style callback
  1775. **/
  1776. uniq<W>(
  1777. whereValue: W): LoDashImplicitArrayWrapper<T>;
  1778. /**
  1779. * @see _.uniq
  1780. **/
  1781. unique<TSort>(isSorted?: boolean): LoDashImplicitArrayWrapper<T>;
  1782. /**
  1783. * @see _.uniq
  1784. **/
  1785. unique<TSort>(
  1786. isSorted: boolean,
  1787. callback: ListIterator<T, TSort>,
  1788. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  1789. /**
  1790. * @see _.uniq
  1791. **/
  1792. unique<TSort>(
  1793. callback: ListIterator<T, TSort>,
  1794. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  1795. /**
  1796. * @see _.uniq
  1797. * @param pluckValue _.pluck style callback
  1798. **/
  1799. unique(
  1800. isSorted: boolean,
  1801. pluckValue: string): LoDashImplicitArrayWrapper<T>;
  1802. /**
  1803. * @see _.uniq
  1804. * @param pluckValue _.pluck style callback
  1805. **/
  1806. unique(pluckValue: string): LoDashImplicitArrayWrapper<T>;
  1807. /**
  1808. * @see _.uniq
  1809. * @param whereValue _.where style callback
  1810. **/
  1811. unique<W>(
  1812. isSorted: boolean,
  1813. whereValue: W): LoDashImplicitArrayWrapper<T>;
  1814. /**
  1815. * @see _.uniq
  1816. * @param whereValue _.where style callback
  1817. **/
  1818. unique<W>(
  1819. whereValue: W): LoDashImplicitArrayWrapper<T>;
  1820. }
  1821. //_.unzipWith
  1822. interface LoDashStatic {
  1823. /**
  1824. * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be
  1825. * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
  1826. * group).
  1827. *
  1828. * @param array The array of grouped elements to process.
  1829. * @param iteratee The function to combine regrouped values.
  1830. * @param thisArg The this binding of iteratee.
  1831. * @return Returns the new array of regrouped elements.
  1832. */
  1833. unzipWith<TArray, TResult>(
  1834. array: List<List<TArray>>,
  1835. iteratee?: MemoIterator<TArray, TResult>,
  1836. thisArg?: any
  1837. ): TResult[];
  1838. }
  1839. interface LoDashImplicitArrayWrapper<T> {
  1840. /**
  1841. * @see _.unzipWith
  1842. */
  1843. unzipWith<TArr, TResult>(
  1844. iteratee?: MemoIterator<TArr, TResult>,
  1845. thisArg?: any
  1846. ): LoDashImplicitArrayWrapper<TResult>;
  1847. }
  1848. interface LoDashImplicitObjectWrapper<T> {
  1849. /**
  1850. * @see _.unzipWith
  1851. */
  1852. unzipWith<TArr, TResult>(
  1853. iteratee?: MemoIterator<TArr, TResult>,
  1854. thisArg?: any
  1855. ): LoDashImplicitArrayWrapper<TResult>;
  1856. }
  1857. //_.without
  1858. interface LoDashStatic {
  1859. /**
  1860. * Creates an array excluding all provided values using SameValueZero for equality comparisons.
  1861. *
  1862. * @param array The array to filter.
  1863. * @param values The values to exclude.
  1864. * @return Returns the new array of filtered values.
  1865. */
  1866. without<T>(
  1867. array: T[]|List<T>,
  1868. ...values: T[]
  1869. ): T[];
  1870. }
  1871. interface LoDashImplicitArrayWrapper<T> {
  1872. /**
  1873. * @see _.without
  1874. */
  1875. without(...values: T[]): LoDashImplicitArrayWrapper<T>;
  1876. }
  1877. interface LoDashImplicitObjectWrapper<T> {
  1878. /**
  1879. * @see _.without
  1880. */
  1881. without<TValue>(...values: TValue[]): LoDashImplicitArrayWrapper<TValue>;
  1882. }
  1883. //_.xor
  1884. interface LoDashStatic {
  1885. /**
  1886. * Creates an array of unique values that is the symmetric difference of the provided arrays.
  1887. *
  1888. * @param arrays The arrays to inspect.
  1889. * @return Returns the new array of values.
  1890. */
  1891. xor<T>(...arrays: List<T>[]): T[];
  1892. }
  1893. interface LoDashImplicitArrayWrapper<T> {
  1894. /**
  1895. * @see _.xor
  1896. */
  1897. xor(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
  1898. }
  1899. interface LoDashImplicitObjectWrapper<T> {
  1900. /**
  1901. * @see _.xor
  1902. */
  1903. xor<TValue>(...arrays: List<TValue>[]): LoDashImplicitArrayWrapper<TValue>;
  1904. }
  1905. //_.zip
  1906. interface LoDashStatic {
  1907. /**
  1908. * Creates an array of grouped elements, the first of which contains the first
  1909. * elements of the given arrays, the second of which contains the second elements
  1910. * of the given arrays, and so on.
  1911. * @param arrays Arrays to process.
  1912. * @return A new array of grouped elements.
  1913. **/
  1914. zip(...arrays: any[][]): any[][];
  1915. /**
  1916. * @see _.zip
  1917. **/
  1918. zip(...arrays: any[]): any[];
  1919. /**
  1920. * @see _.zip
  1921. **/
  1922. unzip(...arrays: any[][]): any[][];
  1923. /**
  1924. * @see _.zip
  1925. **/
  1926. unzip(...arrays: any[]): any[];
  1927. }
  1928. interface LoDashImplicitArrayWrapper<T> {
  1929. /**
  1930. * @see _.zip
  1931. **/
  1932. zip(...arrays: any[][]): _.LoDashImplicitArrayWrapper<any[][]>;
  1933. /**
  1934. * @see _.zip
  1935. **/
  1936. unzip(...arrays: any[]): _.LoDashImplicitArrayWrapper<any[][]>;
  1937. }
  1938. //_.zipObject
  1939. interface LoDashStatic {
  1940. /**
  1941. * The inverse of _.pairs; this method returns an object composed from arrays of property names and values.
  1942. * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of
  1943. * property names and one of corresponding values.
  1944. *
  1945. * @alias _.object
  1946. *
  1947. * @param props The property names.
  1948. * @param values The property values.
  1949. * @return Returns the new object.
  1950. */
  1951. zipObject<TValues, TResult extends {}>(
  1952. props: List<StringRepresentable>,
  1953. values?: List<TValues>
  1954. ): TResult;
  1955. /**
  1956. * @see _.zipObject
  1957. */
  1958. zipObject<TResult extends {}>(
  1959. props: List<StringRepresentable>,
  1960. values?: List<any>
  1961. ): TResult;
  1962. /**
  1963. * @see _.zipObject
  1964. */
  1965. zipObject(
  1966. props: List<StringRepresentable>,
  1967. values?: List<any>
  1968. ): _.Dictionary<any>;
  1969. }
  1970. interface LoDashImplicitArrayWrapper<T> {
  1971. /**
  1972. * @see _.zipObject
  1973. */
  1974. zipObject<TValues, TResult extends {}>(
  1975. values?: List<TValues>
  1976. ): _.LoDashImplicitObjectWrapper<TResult>;
  1977. /**
  1978. * @see _.zipObject
  1979. */
  1980. zipObject<TResult extends {}>(
  1981. values?: List<any>
  1982. ): _.LoDashImplicitObjectWrapper<TResult>;
  1983. /**
  1984. * @see _.zipObject
  1985. */
  1986. zipObject(
  1987. values?: List<any>
  1988. ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
  1989. }
  1990. interface LoDashImplicitObjectWrapper<T> {
  1991. /**
  1992. * @see _.zipObject
  1993. */
  1994. zipObject<TValues, TResult extends {}>(
  1995. values?: List<TValues>
  1996. ): _.LoDashImplicitObjectWrapper<TResult>;
  1997. /**
  1998. * @see _.zipObject
  1999. */
  2000. zipObject<TResult extends {}>(
  2001. values?: List<any>
  2002. ): _.LoDashImplicitObjectWrapper<TResult>;
  2003. /**
  2004. * @see _.zipObject
  2005. */
  2006. zipObject(
  2007. values?: List<any>
  2008. ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
  2009. }
  2010. //_.zipWith
  2011. interface LoDashStatic {
  2012. /**
  2013. * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be
  2014. * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
  2015. * group).
  2016. * @param {...Array} [arrays] The arrays to process.
  2017. * @param {Function} [iteratee] The function to combine grouped values.
  2018. * @param {*} [thisArg] The `this` binding of `iteratee`.
  2019. * @return Returns the new array of grouped elements.
  2020. */
  2021. zipWith<TResult>(...args: any[]): TResult[];
  2022. }
  2023. interface LoDashImplicitArrayWrapper<T> {
  2024. /**
  2025. * @see _.zipWith
  2026. */
  2027. zipWith<TResult>(...args: any[]): LoDashImplicitArrayWrapper<TResult>;
  2028. }
  2029. /*********
  2030. * Chain *
  2031. *********/
  2032. //_.chain
  2033. interface LoDashStatic {
  2034. /**
  2035. * Creates a lodash object that wraps value with explicit method chaining enabled.
  2036. *
  2037. * @param value The value to wrap.
  2038. * @return Returns the new lodash wrapper instance.
  2039. */
  2040. chain(value: number): LoDashExplicitWrapper<number>;
  2041. chain(value: string): LoDashExplicitWrapper<string>;
  2042. chain(value: boolean): LoDashExplicitWrapper<boolean>;
  2043. chain<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
  2044. chain<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
  2045. chain(value: any): LoDashExplicitWrapper<any>;
  2046. }
  2047. interface LoDashImplicitWrapper<T> {
  2048. /**
  2049. * @see _.chain
  2050. */
  2051. chain(): LoDashExplicitWrapper<T>;
  2052. }
  2053. interface LoDashImplicitArrayWrapper<T> {
  2054. /**
  2055. * @see _.chain
  2056. */
  2057. chain(): LoDashExplicitArrayWrapper<T>;
  2058. }
  2059. interface LoDashImplicitObjectWrapper<T> {
  2060. /**
  2061. * @see _.chain
  2062. */
  2063. chain(): LoDashExplicitObjectWrapper<T>;
  2064. }
  2065. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2066. /**
  2067. * @see _.chain
  2068. */
  2069. chain(): TWrapper;
  2070. }
  2071. //_.tap
  2072. interface LoDashStatic {
  2073. /**
  2074. * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one
  2075. * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations
  2076. * on intermediate results within the chain.
  2077. *
  2078. * @param value The value to provide to interceptor.
  2079. * @param interceptor The function to invoke.
  2080. * @parem thisArg The this binding of interceptor.
  2081. * @return Returns value.
  2082. **/
  2083. tap<T>(
  2084. value: T,
  2085. interceptor: (value: T) => void,
  2086. thisArg?: any
  2087. ): T;
  2088. }
  2089. interface LoDashImplicitWrapperBase<T, TWrapper> {
  2090. /**
  2091. * @see _.tap
  2092. */
  2093. tap(
  2094. interceptor: (value: T) => void,
  2095. thisArg?: any
  2096. ): TWrapper;
  2097. }
  2098. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2099. /**
  2100. * @see _.tap
  2101. */
  2102. tap(
  2103. interceptor: (value: T) => void,
  2104. thisArg?: any
  2105. ): TWrapper;
  2106. }
  2107. //_.thru
  2108. interface LoDashStatic {
  2109. /**
  2110. * This method is like _.tap except that it returns the result of interceptor.
  2111. *
  2112. * @param value The value to provide to interceptor.
  2113. * @param interceptor The function to invoke.
  2114. * @param thisArg The this binding of interceptor.
  2115. * @return Returns the result of interceptor.
  2116. */
  2117. thru<T, TResult>(
  2118. value: T,
  2119. interceptor: (value: T) => TResult,
  2120. thisArg?: any
  2121. ): TResult;
  2122. }
  2123. interface LoDashImplicitWrapperBase<T, TWrapper> {
  2124. /**
  2125. * @see _.thru
  2126. */
  2127. thru<TResult extends number>(
  2128. interceptor: (value: T) => TResult,
  2129. thisArg?: any): LoDashImplicitWrapper<TResult>;
  2130. /**
  2131. * @see _.thru
  2132. */
  2133. thru<TResult extends string>(
  2134. interceptor: (value: T) => TResult,
  2135. thisArg?: any): LoDashImplicitWrapper<TResult>;
  2136. /**
  2137. * @see _.thru
  2138. */
  2139. thru<TResult extends boolean>(
  2140. interceptor: (value: T) => TResult,
  2141. thisArg?: any): LoDashImplicitWrapper<TResult>;
  2142. /**
  2143. * @see _.thru
  2144. */
  2145. thru<TResult extends {}>(
  2146. interceptor: (value: T) => TResult,
  2147. thisArg?: any): LoDashImplicitObjectWrapper<TResult>;
  2148. /**
  2149. * @see _.thru
  2150. */
  2151. thru<TResult>(
  2152. interceptor: (value: T) => TResult[],
  2153. thisArg?: any): LoDashImplicitArrayWrapper<TResult>;
  2154. }
  2155. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2156. /**
  2157. * @see _.thru
  2158. */
  2159. thru<TResult extends number>(
  2160. interceptor: (value: T) => TResult,
  2161. thisArg?: any
  2162. ): LoDashExplicitWrapper<TResult>;
  2163. /**
  2164. * @see _.thru
  2165. */
  2166. thru<TResult extends string>(
  2167. interceptor: (value: T) => TResult,
  2168. thisArg?: any
  2169. ): LoDashExplicitWrapper<TResult>;
  2170. /**
  2171. * @see _.thru
  2172. */
  2173. thru<TResult extends boolean>(
  2174. interceptor: (value: T) => TResult,
  2175. thisArg?: any
  2176. ): LoDashExplicitWrapper<TResult>;
  2177. /**
  2178. * @see _.thru
  2179. */
  2180. thru<TResult extends {}>(
  2181. interceptor: (value: T) => TResult,
  2182. thisArg?: any
  2183. ): LoDashExplicitObjectWrapper<TResult>;
  2184. /**
  2185. * @see _.thru
  2186. */
  2187. thru<TResult>(
  2188. interceptor: (value: T) => TResult[],
  2189. thisArg?: any
  2190. ): LoDashExplicitArrayWrapper<TResult>;
  2191. }
  2192. //_.prototype.commit
  2193. interface LoDashImplicitWrapperBase<T, TWrapper> {
  2194. /**
  2195. * Executes the chained sequence and returns the wrapped result.
  2196. *
  2197. * @return Returns the new lodash wrapper instance.
  2198. */
  2199. commit(): TWrapper;
  2200. }
  2201. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2202. /**
  2203. * @see _.commit
  2204. */
  2205. commit(): TWrapper;
  2206. }
  2207. //_.prototype.concat
  2208. interface LoDashImplicitWrapperBase<T, TWrapper> {
  2209. /**
  2210. * Creates a new array joining a wrapped array with any additional arrays and/or values.
  2211. *
  2212. * @param items
  2213. * @return Returns the new concatenated array.
  2214. */
  2215. concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashImplicitArrayWrapper<TItem>;
  2216. /**
  2217. * @see _.concat
  2218. */
  2219. concat(...items: Array<T|Array<T>>): LoDashImplicitArrayWrapper<T>;
  2220. }
  2221. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2222. /**
  2223. * @see _.concat
  2224. */
  2225. concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashExplicitArrayWrapper<TItem>;
  2226. /**
  2227. * @see _.concat
  2228. */
  2229. concat(...items: Array<T|Array<T>>): LoDashExplicitArrayWrapper<T>;
  2230. }
  2231. //_.prototype.plant
  2232. interface LoDashImplicitWrapperBase<T, TWrapper> {
  2233. /**
  2234. * Creates a clone of the chained sequence planting value as the wrapped value.
  2235. * @param value The value to plant as the wrapped value.
  2236. * @return Returns the new lodash wrapper instance.
  2237. */
  2238. plant(value: number): LoDashImplicitWrapper<number>;
  2239. /**
  2240. * @see _.plant
  2241. */
  2242. plant(value: string): LoDashImplicitStringWrapper;
  2243. /**
  2244. * @see _.plant
  2245. */
  2246. plant(value: boolean): LoDashImplicitWrapper<boolean>;
  2247. /**
  2248. * @see _.plant
  2249. */
  2250. plant(value: number[]): LoDashImplicitNumberArrayWrapper;
  2251. /**
  2252. * @see _.plant
  2253. */
  2254. plant<T>(value: T[]): LoDashImplicitArrayWrapper<T>;
  2255. /**
  2256. * @see _.plant
  2257. */
  2258. plant<T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
  2259. /**
  2260. * @see _.plant
  2261. */
  2262. plant(value: any): LoDashImplicitWrapper<any>;
  2263. }
  2264. interface LoDashExplicitWrapperBase<T, TWrapper> {
  2265. /**
  2266. * @see _.plant
  2267. */
  2268. plant(value: number): LoDashExplicitWrapper<number>;
  2269. /**
  2270. * @see _.plant
  2271. */
  2272. plant(value: string): LoDashExplicitStringWrapper;
  2273. /**
  2274. * @see _.plant
  2275. */
  2276. plant(value: boolean): LoDashExplicitWrapper<boolean>;
  2277. /**
  2278. * @see _.plant
  2279. */
  2280. plant(value: number[]): LoDashExplicitNumberArrayWrapper;
  2281. /**
  2282. * @see _.plant
  2283. */
  2284. plant<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
  2285. /**
  2286. * @see _.plant
  2287. */
  2288. plant<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
  2289. /**
  2290. * @see _.plant
  2291. */
  2292. plant(value: any): LoDashExplicitWrapper<any>;
  2293. }
  2294. //_.prototype.reverse
  2295. interface LoDashImplicitArrayWrapper<T> {
  2296. /**
  2297. * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to
  2298. * last, and so on.
  2299. *
  2300. * Note: This method mutates the wrapped array.
  2301. *
  2302. * @return Returns the new reversed lodash wrapper instance.
  2303. */
  2304. reverse(): LoDashImplicitArrayWrapper<T>;
  2305. }
  2306. interface LoDashExplicitArrayWrapper<T> {
  2307. /**
  2308. * @see _.reverse
  2309. */
  2310. reverse(): LoDashExplicitArrayWrapper<T>;
  2311. }
  2312. //_.prototype.run
  2313. interface LoDashWrapperBase<T, TWrapper> {
  2314. /**
  2315. * @see _.value
  2316. */
  2317. run(): T;
  2318. }
  2319. //_.prototype.toJSON
  2320. interface LoDashWrapperBase<T, TWrapper> {
  2321. /**
  2322. * @see _.value
  2323. */
  2324. toJSON(): T;
  2325. }
  2326. //_.prototype.toString
  2327. interface LoDashWrapperBase<T, TWrapper> {
  2328. /**
  2329. * Produces the result of coercing the unwrapped value to a string.
  2330. *
  2331. * @return Returns the coerced string value.
  2332. */
  2333. toString(): string;
  2334. }
  2335. //_.prototype.value
  2336. interface LoDashWrapperBase<T, TWrapper> {
  2337. /**
  2338. * Executes the chained sequence to extract the unwrapped value.
  2339. *
  2340. * @alias _.run, _.toJSON, _.valueOf
  2341. *
  2342. * @return Returns the resolved unwrapped value.
  2343. */
  2344. value(): T;
  2345. }
  2346. //_.valueOf
  2347. interface LoDashWrapperBase<T, TWrapper> {
  2348. /**
  2349. * @see _.value
  2350. */
  2351. valueOf(): T;
  2352. }
  2353. /**************
  2354. * Collection *
  2355. **************/
  2356. //_.all
  2357. interface LoDashStatic {
  2358. /**
  2359. * @see _.every
  2360. */
  2361. all<T>(
  2362. collection: List<T>,
  2363. predicate?: ListIterator<T, boolean>,
  2364. thisArg?: any
  2365. ): boolean;
  2366. /**
  2367. * @see _.every
  2368. */
  2369. all<T>(
  2370. collection: Dictionary<T>,
  2371. predicate?: DictionaryIterator<T, boolean>,
  2372. thisArg?: any
  2373. ): boolean;
  2374. /**
  2375. * @see _.every
  2376. */
  2377. all<T>(
  2378. collection: List<T>|Dictionary<T>,
  2379. predicate?: string,
  2380. thisArg?: any
  2381. ): boolean;
  2382. /**
  2383. * @see _.every
  2384. */
  2385. all<TObject extends {}, T>(
  2386. collection: List<T>|Dictionary<T>,
  2387. predicate?: TObject
  2388. ): boolean;
  2389. }
  2390. interface LoDashImplicitArrayWrapper<T> {
  2391. /**
  2392. * @see _.every
  2393. */
  2394. all(
  2395. predicate?: ListIterator<T, boolean>,
  2396. thisArg?: any
  2397. ): boolean;
  2398. /**
  2399. * @see _.every
  2400. */
  2401. all(
  2402. predicate?: string,
  2403. thisArg?: any
  2404. ): boolean;
  2405. /**
  2406. * @see _.every
  2407. */
  2408. all<TObject extends {}>(
  2409. predicate?: TObject
  2410. ): boolean;
  2411. }
  2412. interface LoDashImplicitObjectWrapper<T> {
  2413. /**
  2414. * @see _.every
  2415. */
  2416. all<TResult>(
  2417. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  2418. thisArg?: any
  2419. ): boolean;
  2420. /**
  2421. * @see _.every
  2422. */
  2423. all(
  2424. predicate?: string,
  2425. thisArg?: any
  2426. ): boolean;
  2427. /**
  2428. * @see _.every
  2429. */
  2430. all<TObject extends {}>(
  2431. predicate?: TObject
  2432. ): boolean;
  2433. }
  2434. //_.any
  2435. interface LoDashStatic {
  2436. /**
  2437. * @see _.some
  2438. */
  2439. any<T>(
  2440. collection: List<T>,
  2441. predicate?: ListIterator<T, boolean>,
  2442. thisArg?: any
  2443. ): boolean;
  2444. /**
  2445. * @see _.some
  2446. */
  2447. any<T>(
  2448. collection: Dictionary<T>,
  2449. predicate?: DictionaryIterator<T, boolean>,
  2450. thisArg?: any
  2451. ): boolean;
  2452. /**
  2453. * @see _.some
  2454. */
  2455. any<T>(
  2456. collection: List<T>|Dictionary<T>,
  2457. predicate?: string,
  2458. thisArg?: any
  2459. ): boolean;
  2460. /**
  2461. * @see _.some
  2462. */
  2463. any<TObject extends {}, T>(
  2464. collection: List<T>|Dictionary<T>,
  2465. predicate?: TObject
  2466. ): boolean;
  2467. }
  2468. interface LoDashImplicitArrayWrapper<T> {
  2469. /**
  2470. * @see _.some
  2471. */
  2472. any(
  2473. predicate?: ListIterator<T, boolean>,
  2474. thisArg?: any
  2475. ): boolean;
  2476. /**
  2477. * @see _.some
  2478. */
  2479. any(
  2480. predicate?: string,
  2481. thisArg?: any
  2482. ): boolean;
  2483. /**
  2484. * @see _.some
  2485. */
  2486. any<TObject extends {}>(
  2487. predicate?: TObject
  2488. ): boolean;
  2489. }
  2490. interface LoDashImplicitObjectWrapper<T> {
  2491. /**
  2492. * @see _.some
  2493. */
  2494. any<TResult>(
  2495. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  2496. thisArg?: any
  2497. ): boolean;
  2498. /**
  2499. * @see _.some
  2500. */
  2501. any(
  2502. predicate?: string,
  2503. thisArg?: any
  2504. ): boolean;
  2505. /**
  2506. * @see _.some
  2507. */
  2508. any<TObject extends {}>(
  2509. predicate?: TObject
  2510. ): boolean;
  2511. }
  2512. //_.at
  2513. interface LoDashStatic {
  2514. /**
  2515. * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be
  2516. * specified as individual arguments or as arrays of keys.
  2517. *
  2518. * @param collection The collection to iterate over.
  2519. * @param props The property names or indexes of elements to pick, specified individually or in arrays.
  2520. * @return Returns the new array of picked elements.
  2521. */
  2522. at<T>(
  2523. collection: List<T>|Dictionary<T>,
  2524. ...props: Array<number|string|Array<number|string>>
  2525. ): T[];
  2526. }
  2527. interface LoDashImplicitArrayWrapper<T> {
  2528. /**
  2529. * @see _.at
  2530. */
  2531. at(...props: Array<number|string|Array<number|string>>): LoDashImplicitArrayWrapper<T>;
  2532. }
  2533. interface LoDashImplicitObjectWrapper<T> {
  2534. /**
  2535. * @see _.at
  2536. */
  2537. at<TResult>(...props: Array<number|string|Array<number|string>>): LoDashImplicitArrayWrapper<TResult>;
  2538. }
  2539. //_.collect
  2540. interface LoDashStatic {
  2541. /**
  2542. * @see _.map
  2543. */
  2544. collect<T, TResult>(
  2545. collection: List<T>,
  2546. iteratee?: ListIterator<T, TResult>,
  2547. thisArg?: any
  2548. ): TResult[];
  2549. /**
  2550. * @see _.map
  2551. */
  2552. collect<T extends {}, TResult>(
  2553. collection: Dictionary<T>,
  2554. iteratee?: DictionaryIterator<T, TResult>,
  2555. thisArg?: any
  2556. ): TResult[];
  2557. /**
  2558. * @see _.map
  2559. */
  2560. collect<T, TResult>(
  2561. collection: List<T>,
  2562. iteratee?: string
  2563. ): TResult[];
  2564. /**
  2565. * @see _.map
  2566. */
  2567. collect<T, TResult>(
  2568. collection: Dictionary<T>,
  2569. iteratee?: string
  2570. ): TResult[];
  2571. /**
  2572. * @see _.map
  2573. */
  2574. collect<T, TObject extends {}>(
  2575. collection: List<T>,
  2576. iteratee?: TObject
  2577. ): boolean[];
  2578. /**
  2579. * @see _.map
  2580. */
  2581. collect<T, TObject extends {}>(
  2582. collection: Dictionary<T>,
  2583. iteratee?: TObject
  2584. ): boolean[];
  2585. }
  2586. interface LoDashImplicitArrayWrapper<T> {
  2587. /**
  2588. * @see _.map
  2589. */
  2590. collect<TResult>(
  2591. iteratee?: ListIterator<T, TResult>,
  2592. thisArg?: any
  2593. ): LoDashImplicitArrayWrapper<TResult>;
  2594. /**
  2595. * @see _.map
  2596. */
  2597. collect<TResult>(
  2598. iteratee?: string
  2599. ): LoDashImplicitArrayWrapper<TResult>;
  2600. /**
  2601. * @see _.map
  2602. */
  2603. collect<TObject extends {}>(
  2604. iteratee?: TObject
  2605. ): LoDashImplicitArrayWrapper<boolean>;
  2606. }
  2607. interface LoDashImplicitObjectWrapper<T> {
  2608. /**
  2609. * @see _.map
  2610. */
  2611. collect<TValue, TResult>(
  2612. iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
  2613. thisArg?: any
  2614. ): LoDashImplicitArrayWrapper<TResult>;
  2615. /**
  2616. * @see _.map
  2617. */
  2618. collect<TValue, TResult>(
  2619. iteratee?: string
  2620. ): LoDashImplicitArrayWrapper<TResult>;
  2621. /**
  2622. * @see _.map
  2623. */
  2624. collect<TObject extends {}>(
  2625. iteratee?: TObject
  2626. ): LoDashImplicitArrayWrapper<boolean>;
  2627. }
  2628. //_.contains
  2629. interface LoDashStatic {
  2630. /**
  2631. * Checks if a given value is present in a collection using strict equality for comparisons,
  2632. * i.e. ===. If fromIndex is negative, it is used as the offset from the end of the collection.
  2633. * @param collection The collection to iterate over.
  2634. * @param target The value to check for.
  2635. * @param fromIndex The index to search from.
  2636. * @return True if the target element is found, else false.
  2637. **/
  2638. contains<T>(
  2639. collection: Array<T>,
  2640. target: T,
  2641. fromIndex?: number): boolean;
  2642. /**
  2643. * @see _.contains
  2644. **/
  2645. contains<T>(
  2646. collection: List<T>,
  2647. target: T,
  2648. fromIndex?: number): boolean;
  2649. /**
  2650. * @see _.contains
  2651. * @param dictionary The dictionary to iterate over.
  2652. * @param value The value in the dictionary to search for.
  2653. **/
  2654. contains<T>(
  2655. dictionary: Dictionary<T>,
  2656. value: T,
  2657. fromIndex?: number): boolean;
  2658. /**
  2659. * @see _.contains
  2660. * @param searchString the string to search
  2661. * @param targetString the string to search for
  2662. **/
  2663. contains(
  2664. searchString: string,
  2665. targetString: string,
  2666. fromIndex?: number): boolean;
  2667. /**
  2668. * @see _.contains
  2669. **/
  2670. include<T>(
  2671. collection: Array<T>,
  2672. target: T,
  2673. fromIndex?: number): boolean;
  2674. /**
  2675. * @see _.contains
  2676. **/
  2677. include<T>(
  2678. collection: List<T>,
  2679. target: T,
  2680. fromIndex?: number): boolean;
  2681. /**
  2682. * @see _.contains
  2683. **/
  2684. include<T>(
  2685. dictionary: Dictionary<T>,
  2686. value: T,
  2687. fromIndex?: number): boolean;
  2688. /**
  2689. * @see _.contains
  2690. **/
  2691. include(
  2692. searchString: string,
  2693. targetString: string,
  2694. fromIndex?: number): boolean;
  2695. /**
  2696. * @see _.contains
  2697. **/
  2698. includes<T>(
  2699. collection: Array<T>,
  2700. target: T,
  2701. fromIndex?: number): boolean;
  2702. /**
  2703. * @see _.contains
  2704. **/
  2705. includes<T>(
  2706. collection: List<T>,
  2707. target: T,
  2708. fromIndex?: number): boolean;
  2709. /**
  2710. * @see _.contains
  2711. **/
  2712. includes<T>(
  2713. dictionary: Dictionary<T>,
  2714. value: T,
  2715. fromIndex?: number): boolean;
  2716. /**
  2717. * @see _.contains
  2718. **/
  2719. includes(
  2720. searchString: string,
  2721. targetString: string,
  2722. fromIndex?: number): boolean;
  2723. }
  2724. interface LoDashImplicitArrayWrapper<T> {
  2725. /**
  2726. * @see _.contains
  2727. **/
  2728. contains(target: T, fromIndex?: number): boolean;
  2729. /**
  2730. * @see _.contains
  2731. **/
  2732. include(target: T, fromIndex?: number): boolean;
  2733. /**
  2734. * @see _.contains
  2735. **/
  2736. includes(target: T, fromIndex?: number): boolean;
  2737. }
  2738. interface LoDashImplicitObjectWrapper<T> {
  2739. /**
  2740. * @see _.contains
  2741. **/
  2742. contains<TValue>(target: TValue, fromIndex?: number): boolean;
  2743. /**
  2744. * @see _.contains
  2745. **/
  2746. include<TValue>(target: TValue, fromIndex?: number): boolean;
  2747. /**
  2748. * @see _.contains
  2749. **/
  2750. includes<TValue>(target: TValue, fromIndex?: number): boolean;
  2751. }
  2752. interface LoDashImplicitStringWrapper {
  2753. /**
  2754. * @see _.contains
  2755. **/
  2756. contains(target: string, fromIndex?: number): boolean;
  2757. /**
  2758. * @see _.contains
  2759. **/
  2760. include(target: string, fromIndex?: number): boolean;
  2761. /**
  2762. * @see _.contains
  2763. **/
  2764. includes(target: string, fromIndex?: number): boolean;
  2765. }
  2766. //_.countBy
  2767. interface LoDashStatic {
  2768. /**
  2769. * Creates an object composed of keys generated from the results of running each element
  2770. * of collection through the callback. The corresponding value of each key is the number
  2771. * of times the key was returned by the callback. The callback is bound to thisArg and
  2772. * invoked with three arguments; (value, index|key, collection).
  2773. *
  2774. * If a property name is provided for callback the created "_.pluck" style callback will
  2775. * return the property value of the given element.
  2776. *
  2777. * If an object is provided for callback the created "_.where" style callback will return
  2778. * true for elements that have the properties of the given object, else false.
  2779. * @param collection The collection to iterate over.
  2780. * @param callback The function called per iteration.
  2781. * @param thisArg The this binding of callback.
  2782. * @return Returns the composed aggregate object.
  2783. **/
  2784. countBy<T>(
  2785. collection: Array<T>,
  2786. callback?: ListIterator<T, any>,
  2787. thisArg?: any): Dictionary<number>;
  2788. /**
  2789. * @see _.countBy
  2790. * @param callback Function name
  2791. **/
  2792. countBy<T>(
  2793. collection: List<T>,
  2794. callback?: ListIterator<T, any>,
  2795. thisArg?: any): Dictionary<number>;
  2796. /**
  2797. * @see _.countBy
  2798. * @param callback Function name
  2799. **/
  2800. countBy<T>(
  2801. collection: Dictionary<T>,
  2802. callback?: DictionaryIterator<T, any>,
  2803. thisArg?: any): Dictionary<number>;
  2804. /**
  2805. * @see _.countBy
  2806. * @param callback Function name
  2807. **/
  2808. countBy<T>(
  2809. collection: Array<T>,
  2810. callback: string,
  2811. thisArg?: any): Dictionary<number>;
  2812. /**
  2813. * @see _.countBy
  2814. * @param callback Function name
  2815. **/
  2816. countBy<T>(
  2817. collection: List<T>,
  2818. callback: string,
  2819. thisArg?: any): Dictionary<number>;
  2820. /**
  2821. * @see _.countBy
  2822. * @param callback Function name
  2823. **/
  2824. countBy<T>(
  2825. collection: Dictionary<T>,
  2826. callback: string,
  2827. thisArg?: any): Dictionary<number>;
  2828. }
  2829. interface LoDashImplicitArrayWrapper<T> {
  2830. /**
  2831. * @see _.countBy
  2832. **/
  2833. countBy(
  2834. callback?: ListIterator<T, any>,
  2835. thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<number>>;
  2836. /**
  2837. * @see _.countBy
  2838. * @param callback Function name
  2839. **/
  2840. countBy(
  2841. callback: string,
  2842. thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<number>>;
  2843. }
  2844. //_.detect
  2845. interface LoDashStatic {
  2846. /**
  2847. * @see _.find
  2848. */
  2849. detect<T>(
  2850. collection: List<T>,
  2851. predicate?: ListIterator<T, boolean>,
  2852. thisArg?: any
  2853. ): T;
  2854. /**
  2855. * @see _.find
  2856. */
  2857. detect<T>(
  2858. collection: Dictionary<T>,
  2859. predicate?: DictionaryIterator<T, boolean>,
  2860. thisArg?: any
  2861. ): T;
  2862. /**
  2863. * @see _.find
  2864. */
  2865. detect<T>(
  2866. collection: List<T>|Dictionary<T>,
  2867. predicate?: string,
  2868. thisArg?: any
  2869. ): T;
  2870. /**
  2871. * @see _.find
  2872. */
  2873. detect<TObject extends {}, T>(
  2874. collection: List<T>|Dictionary<T>,
  2875. predicate?: TObject
  2876. ): T;
  2877. }
  2878. interface LoDashImplicitArrayWrapper<T> {
  2879. /**
  2880. * @see _.find
  2881. */
  2882. detect(
  2883. predicate?: ListIterator<T, boolean>,
  2884. thisArg?: any
  2885. ): T;
  2886. /**
  2887. * @see _.find
  2888. */
  2889. detect(
  2890. predicate?: string,
  2891. thisArg?: any
  2892. ): T;
  2893. /**
  2894. * @see _.find
  2895. */
  2896. detect<TObject extends {}>(
  2897. predicate?: TObject
  2898. ): T;
  2899. }
  2900. interface LoDashImplicitObjectWrapper<T> {
  2901. /**
  2902. * @see _.find
  2903. */
  2904. detect<TResult>(
  2905. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  2906. thisArg?: any
  2907. ): TResult;
  2908. /**
  2909. * @see _.find
  2910. */
  2911. detect<TResult>(
  2912. predicate?: string,
  2913. thisArg?: any
  2914. ): TResult;
  2915. /**
  2916. * @see _.find
  2917. */
  2918. detect<TObject extends {}, TResult>(
  2919. predicate?: TObject
  2920. ): TResult;
  2921. }
  2922. //_.every
  2923. interface LoDashStatic {
  2924. /**
  2925. * Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and
  2926. * invoked with three arguments: (value, index|key, collection).
  2927. *
  2928. * If a property name is provided for predicate the created _.property style callback returns the property
  2929. * value of the given element.
  2930. *
  2931. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  2932. * elements that have a matching property value, else false.
  2933. *
  2934. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  2935. * have the properties of the given object, else false.
  2936. *
  2937. * @alias _.all
  2938. *
  2939. * @param collection The collection to iterate over.
  2940. * @param predicate The function invoked per iteration.
  2941. * @param thisArg The this binding of predicate.
  2942. * @return Returns true if all elements pass the predicate check, else false.
  2943. */
  2944. every<T>(
  2945. collection: List<T>,
  2946. predicate?: ListIterator<T, boolean>,
  2947. thisArg?: any
  2948. ): boolean;
  2949. /**
  2950. * @see _.every
  2951. */
  2952. every<T>(
  2953. collection: Dictionary<T>,
  2954. predicate?: DictionaryIterator<T, boolean>,
  2955. thisArg?: any
  2956. ): boolean;
  2957. /**
  2958. * @see _.every
  2959. */
  2960. every<T>(
  2961. collection: List<T>|Dictionary<T>,
  2962. predicate?: string,
  2963. thisArg?: any
  2964. ): boolean;
  2965. /**
  2966. * @see _.every
  2967. */
  2968. every<TObject extends {}, T>(
  2969. collection: List<T>|Dictionary<T>,
  2970. predicate?: TObject
  2971. ): boolean;
  2972. }
  2973. interface LoDashImplicitArrayWrapper<T> {
  2974. /**
  2975. * @see _.every
  2976. */
  2977. every(
  2978. predicate?: ListIterator<T, boolean>,
  2979. thisArg?: any
  2980. ): boolean;
  2981. /**
  2982. * @see _.every
  2983. */
  2984. every(
  2985. predicate?: string,
  2986. thisArg?: any
  2987. ): boolean;
  2988. /**
  2989. * @see _.every
  2990. */
  2991. every<TObject extends {}>(
  2992. predicate?: TObject
  2993. ): boolean;
  2994. }
  2995. interface LoDashImplicitObjectWrapper<T> {
  2996. /**
  2997. * @see _.every
  2998. */
  2999. every<TResult>(
  3000. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  3001. thisArg?: any
  3002. ): boolean;
  3003. /**
  3004. * @see _.every
  3005. */
  3006. every(
  3007. predicate?: string,
  3008. thisArg?: any
  3009. ): boolean;
  3010. /**
  3011. * @see _.every
  3012. */
  3013. every<TObject extends {}>(
  3014. predicate?: TObject
  3015. ): boolean;
  3016. }
  3017. //_.fill
  3018. interface LoDashStatic {
  3019. /**
  3020. * Fills elements of array with value from start up to, but not including, end.
  3021. *
  3022. * Note: This method mutates array.
  3023. *
  3024. * @param array (Array): The array to fill.
  3025. * @param value (*): The value to fill array with.
  3026. * @param [start=0] (number): The start position.
  3027. * @param [end=array.length] (number): The end position.
  3028. * @return (Array): Returns array.
  3029. */
  3030. fill<TResult>(
  3031. array: any[],
  3032. value: any,
  3033. start?: number,
  3034. end?: number): TResult[];
  3035. /**
  3036. * @see _.fill
  3037. */
  3038. fill<TResult>(
  3039. array: List<any>,
  3040. value: any,
  3041. start?: number,
  3042. end?: number): List<TResult>;
  3043. }
  3044. interface LoDashImplicitArrayWrapper<T> {
  3045. /**
  3046. * @see _.fill
  3047. */
  3048. fill<TResult>(
  3049. value: TResult,
  3050. start?: number,
  3051. end?: number): LoDashImplicitArrayWrapper<TResult>;
  3052. }
  3053. interface LoDashImplicitObjectWrapper<T> {
  3054. /**
  3055. * @see _.fill
  3056. */
  3057. fill<TResult>(
  3058. value: TResult,
  3059. start?: number,
  3060. end?: number): LoDashImplicitObjectWrapper<List<TResult>>;
  3061. }
  3062. //_.filter
  3063. interface LoDashStatic {
  3064. /**
  3065. * Iterates over elements of a collection, returning an array of all elements the
  3066. * identity function returns truey for.
  3067. *
  3068. * @param collection The collection to iterate over.
  3069. * @return Returns a new array of elements that passed the callback check.
  3070. **/
  3071. filter<T>(
  3072. collection: (Array<T>|List<T>)): T[];
  3073. /**
  3074. * Iterates over elements of a collection, returning an array of all elements the
  3075. * callback returns truey for. The callback is bound to thisArg and invoked with three
  3076. * arguments; (value, index|key, collection).
  3077. *
  3078. * If a property name is provided for callback the created "_.pluck" style callback will
  3079. * return the property value of the given element.
  3080. *
  3081. * If an object is provided for callback the created "_.where" style callback will return
  3082. * true for elements that have the properties of the given object, else false.
  3083. * @param collection The collection to iterate over.
  3084. * @param callback The function called per iteration.
  3085. * @param context The this binding of callback.
  3086. * @return Returns a new array of elements that passed the callback check.
  3087. **/
  3088. filter<T>(
  3089. collection: Array<T>,
  3090. callback: ListIterator<T, boolean>,
  3091. thisArg?: any): T[];
  3092. /**
  3093. * @see _.filter
  3094. **/
  3095. filter<T>(
  3096. collection: List<T>,
  3097. callback: ListIterator<T, boolean>,
  3098. thisArg?: any): T[];
  3099. /**
  3100. * @see _.filter
  3101. **/
  3102. filter<T>(
  3103. collection: Dictionary<T>,
  3104. callback: DictionaryIterator<T, boolean>,
  3105. thisArg?: any): T[];
  3106. /**
  3107. * @see _.filter
  3108. * @param pluckValue _.pluck style callback
  3109. **/
  3110. filter<T>(
  3111. collection: Array<T>,
  3112. pluckValue: string): T[];
  3113. /**
  3114. * @see _.filter
  3115. * @param pluckValue _.pluck style callback
  3116. **/
  3117. filter<T>(
  3118. collection: List<T>,
  3119. pluckValue: string): T[];
  3120. /**
  3121. * @see _.filter
  3122. * @param pluckValue _.pluck style callback
  3123. **/
  3124. filter<T>(
  3125. collection: Dictionary<T>,
  3126. pluckValue: string): T[];
  3127. /**
  3128. * @see _.filter
  3129. * @param pluckValue _.pluck style callback
  3130. **/
  3131. filter<W, T>(
  3132. collection: Array<T>,
  3133. whereValue: W): T[];
  3134. /**
  3135. * @see _.filter
  3136. * @param pluckValue _.pluck style callback
  3137. **/
  3138. filter<W, T>(
  3139. collection: List<T>,
  3140. whereValue: W): T[];
  3141. /**
  3142. * @see _.filter
  3143. * @param pluckValue _.pluck style callback
  3144. **/
  3145. filter<W, T>(
  3146. collection: Dictionary<T>,
  3147. whereValue: W): T[];
  3148. /**
  3149. * @see _.filter
  3150. **/
  3151. select<T>(
  3152. collection: Array<T>,
  3153. callback: ListIterator<T, boolean>,
  3154. thisArg?: any): T[];
  3155. /**
  3156. * @see _.filter
  3157. **/
  3158. select<T>(
  3159. collection: List<T>,
  3160. callback: ListIterator<T, boolean>,
  3161. thisArg?: any): T[];
  3162. /**
  3163. * @see _.filter
  3164. **/
  3165. select<T>(
  3166. collection: Dictionary<T>,
  3167. callback: DictionaryIterator<T, boolean>,
  3168. thisArg?: any): T[];
  3169. /**
  3170. * @see _.filter
  3171. * @param pluckValue _.pluck style callback
  3172. **/
  3173. select<T>(
  3174. collection: Array<T>,
  3175. pluckValue: string): T[];
  3176. /**
  3177. * @see _.filter
  3178. * @param pluckValue _.pluck style callback
  3179. **/
  3180. select<T>(
  3181. collection: List<T>,
  3182. pluckValue: string): T[];
  3183. /**
  3184. * @see _.filter
  3185. * @param pluckValue _.pluck style callback
  3186. **/
  3187. select<T>(
  3188. collection: Dictionary<T>,
  3189. pluckValue: string): T[];
  3190. /**
  3191. * @see _.filter
  3192. * @param pluckValue _.pluck style callback
  3193. **/
  3194. select<W, T>(
  3195. collection: Array<T>,
  3196. whereValue: W): T[];
  3197. /**
  3198. * @see _.filter
  3199. * @param pluckValue _.pluck style callback
  3200. **/
  3201. select<W, T>(
  3202. collection: List<T>,
  3203. whereValue: W): T[];
  3204. /**
  3205. * @see _.filter
  3206. * @param pluckValue _.pluck style callback
  3207. **/
  3208. select<W, T>(
  3209. collection: Dictionary<T>,
  3210. whereValue: W): T[];
  3211. }
  3212. interface LoDashImplicitArrayWrapper<T> {
  3213. /**
  3214. * @see _.filter
  3215. **/
  3216. filter(): LoDashImplicitArrayWrapper<T>;
  3217. /**
  3218. * @see _.filter
  3219. **/
  3220. filter(
  3221. callback: ListIterator<T, boolean>,
  3222. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3223. /**
  3224. * @see _.filter
  3225. * @param pluckValue _.pluck style callback
  3226. **/
  3227. filter(
  3228. pluckValue: string): LoDashImplicitArrayWrapper<T>;
  3229. /**
  3230. * @see _.filter
  3231. * @param pluckValue _.pluck style callback
  3232. **/
  3233. filter<W>(
  3234. whereValue: W): LoDashImplicitArrayWrapper<T>;
  3235. /**
  3236. * @see _.filter
  3237. **/
  3238. select(
  3239. callback: ListIterator<T, boolean>,
  3240. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3241. /**
  3242. * @see _.filter
  3243. * @param pluckValue _.pluck style callback
  3244. **/
  3245. select(
  3246. pluckValue: string): LoDashImplicitArrayWrapper<T>;
  3247. /**
  3248. * @see _.filter
  3249. * @param pluckValue _.pluck style callback
  3250. **/
  3251. select<W>(
  3252. whereValue: W): LoDashImplicitArrayWrapper<T>;
  3253. }
  3254. interface LoDashImplicitObjectWrapper<T> {
  3255. /**
  3256. * @see _.filter
  3257. **/
  3258. filter<T extends {}>(
  3259. callback: ObjectIterator<T, boolean>,
  3260. thisArg?: any): LoDashImplicitObjectWrapper<T>;
  3261. }
  3262. //_.find
  3263. interface LoDashStatic {
  3264. /**
  3265. * Iterates over elements of collection, returning the first element predicate returns truthy for.
  3266. * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
  3267. *
  3268. * If a property name is provided for predicate the created _.property style callback returns the property
  3269. * value of the given element.
  3270. *
  3271. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  3272. * elements that have a matching property value, else false.
  3273. *
  3274. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  3275. * have the properties of the given object, else false.
  3276. *
  3277. * @alias _.detect
  3278. *
  3279. * @param collection The collection to search.
  3280. * @param predicate The function invoked per iteration.
  3281. * @param thisArg The this binding of predicate.
  3282. * @return Returns the matched element, else undefined.
  3283. */
  3284. find<T>(
  3285. collection: List<T>,
  3286. predicate?: ListIterator<T, boolean>,
  3287. thisArg?: any
  3288. ): T;
  3289. /**
  3290. * @see _.find
  3291. */
  3292. find<T>(
  3293. collection: Dictionary<T>,
  3294. predicate?: DictionaryIterator<T, boolean>,
  3295. thisArg?: any
  3296. ): T;
  3297. /**
  3298. * @see _.find
  3299. */
  3300. find<T>(
  3301. collection: List<T>|Dictionary<T>,
  3302. predicate?: string,
  3303. thisArg?: any
  3304. ): T;
  3305. /**
  3306. * @see _.find
  3307. */
  3308. find<TObject extends {}, T>(
  3309. collection: List<T>|Dictionary<T>,
  3310. predicate?: TObject
  3311. ): T;
  3312. }
  3313. interface LoDashImplicitArrayWrapper<T> {
  3314. /**
  3315. * @see _.find
  3316. */
  3317. find(
  3318. predicate?: ListIterator<T, boolean>,
  3319. thisArg?: any
  3320. ): T;
  3321. /**
  3322. * @see _.find
  3323. */
  3324. find(
  3325. predicate?: string,
  3326. thisArg?: any
  3327. ): T;
  3328. /**
  3329. * @see _.find
  3330. */
  3331. find<TObject extends {}>(
  3332. predicate?: TObject
  3333. ): T;
  3334. }
  3335. interface LoDashImplicitObjectWrapper<T> {
  3336. /**
  3337. * @see _.find
  3338. */
  3339. find<TResult>(
  3340. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  3341. thisArg?: any
  3342. ): TResult;
  3343. /**
  3344. * @see _.find
  3345. */
  3346. find<TResult>(
  3347. predicate?: string,
  3348. thisArg?: any
  3349. ): TResult;
  3350. /**
  3351. * @see _.find
  3352. */
  3353. find<TObject extends {}, TResult>(
  3354. predicate?: TObject
  3355. ): TResult;
  3356. }
  3357. //_.findWhere
  3358. interface LoDashStatic {
  3359. /**
  3360. * @see _.find
  3361. **/
  3362. findWhere<T>(
  3363. collection: Array<T>,
  3364. callback: ListIterator<T, boolean>,
  3365. thisArg?: any): T;
  3366. /**
  3367. * @see _.find
  3368. **/
  3369. findWhere<T>(
  3370. collection: List<T>,
  3371. callback: ListIterator<T, boolean>,
  3372. thisArg?: any): T;
  3373. /**
  3374. * @see _.find
  3375. **/
  3376. findWhere<T>(
  3377. collection: Dictionary<T>,
  3378. callback: DictionaryIterator<T, boolean>,
  3379. thisArg?: any): T;
  3380. /**
  3381. * @see _.find
  3382. * @param _.matches style callback
  3383. **/
  3384. findWhere<W, T>(
  3385. collection: Array<T>,
  3386. whereValue: W): T;
  3387. /**
  3388. * @see _.find
  3389. * @param _.matches style callback
  3390. **/
  3391. findWhere<W, T>(
  3392. collection: List<T>,
  3393. whereValue: W): T;
  3394. /**
  3395. * @see _.find
  3396. * @param _.matches style callback
  3397. **/
  3398. findWhere<W, T>(
  3399. collection: Dictionary<T>,
  3400. whereValue: W): T;
  3401. /**
  3402. * @see _.find
  3403. * @param _.property style callback
  3404. **/
  3405. findWhere<T>(
  3406. collection: Array<T>,
  3407. pluckValue: string): T;
  3408. /**
  3409. * @see _.find
  3410. * @param _.property style callback
  3411. **/
  3412. findWhere<T>(
  3413. collection: List<T>,
  3414. pluckValue: string): T;
  3415. /**
  3416. * @see _.find
  3417. * @param _.property style callback
  3418. **/
  3419. findWhere<T>(
  3420. collection: Dictionary<T>,
  3421. pluckValue: string): T;
  3422. }
  3423. //_.findLast
  3424. interface LoDashStatic {
  3425. /**
  3426. * This method is like _.find except that it iterates over elements of a collection from
  3427. * right to left.
  3428. * @param collection Searches for a value in this list.
  3429. * @param callback The function called per iteration.
  3430. * @param thisArg The this binding of callback.
  3431. * @return The found element, else undefined.
  3432. **/
  3433. findLast<T>(
  3434. collection: Array<T>,
  3435. callback: ListIterator<T, boolean>,
  3436. thisArg?: any): T;
  3437. /**
  3438. * @see _.find
  3439. **/
  3440. findLast<T>(
  3441. collection: List<T>,
  3442. callback: ListIterator<T, boolean>,
  3443. thisArg?: any): T;
  3444. /**
  3445. * @see _.find
  3446. **/
  3447. findLast<T>(
  3448. collection: Dictionary<T>,
  3449. callback: DictionaryIterator<T, boolean>,
  3450. thisArg?: any): T;
  3451. /**
  3452. * @see _.find
  3453. * @param _.pluck style callback
  3454. **/
  3455. findLast<W, T>(
  3456. collection: Array<T>,
  3457. whereValue: W): T;
  3458. /**
  3459. * @see _.find
  3460. * @param _.pluck style callback
  3461. **/
  3462. findLast<W, T>(
  3463. collection: List<T>,
  3464. whereValue: W): T;
  3465. /**
  3466. * @see _.find
  3467. * @param _.pluck style callback
  3468. **/
  3469. findLast<W, T>(
  3470. collection: Dictionary<T>,
  3471. whereValue: W): T;
  3472. /**
  3473. * @see _.find
  3474. * @param _.where style callback
  3475. **/
  3476. findLast<T>(
  3477. collection: Array<T>,
  3478. pluckValue: string): T;
  3479. /**
  3480. * @see _.find
  3481. * @param _.where style callback
  3482. **/
  3483. findLast<T>(
  3484. collection: List<T>,
  3485. pluckValue: string): T;
  3486. /**
  3487. * @see _.find
  3488. * @param _.where style callback
  3489. **/
  3490. findLast<T>(
  3491. collection: Dictionary<T>,
  3492. pluckValue: string): T;
  3493. }
  3494. interface LoDashImplicitArrayWrapper<T> {
  3495. /**
  3496. * @see _.findLast
  3497. */
  3498. findLast(
  3499. callback: ListIterator<T, boolean>,
  3500. thisArg?: any): T;
  3501. /**
  3502. * @see _.findLast
  3503. * @param _.where style callback
  3504. */
  3505. findLast<W>(
  3506. whereValue: W): T;
  3507. /**
  3508. * @see _.findLast
  3509. * @param _.where style callback
  3510. */
  3511. findLast(
  3512. pluckValue: string): T;
  3513. }
  3514. //_.forEach
  3515. interface LoDashStatic {
  3516. /**
  3517. * Iterates over elements of a collection, executing the callback for each element.
  3518. * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
  3519. * collection). Callbacks may exit iteration early by explicitly returning false.
  3520. * @param collection The collection to iterate over.
  3521. * @param callback The function called per iteration.
  3522. * @param thisArg The this binding of callback.
  3523. **/
  3524. forEach<T>(
  3525. collection: Array<T>,
  3526. callback: ListIterator<T, void>,
  3527. thisArg?: any): Array<T>;
  3528. /**
  3529. * @see _.forEach
  3530. **/
  3531. forEach<T>(
  3532. collection: List<T>,
  3533. callback: ListIterator<T, void>,
  3534. thisArg?: any): List<T>;
  3535. /**
  3536. * @see _.forEach
  3537. **/
  3538. forEach<T extends {}>(
  3539. object: Dictionary<T>,
  3540. callback: DictionaryIterator<T, void>,
  3541. thisArg?: any): Dictionary<T>;
  3542. /**
  3543. * @see _.each
  3544. **/
  3545. forEach<T extends {}, TValue>(
  3546. object: T,
  3547. callback: ObjectIterator<TValue, void>,
  3548. thisArg?: any): T
  3549. /**
  3550. * @see _.forEach
  3551. **/
  3552. each<T>(
  3553. collection: Array<T>,
  3554. callback: ListIterator<T, void>,
  3555. thisArg?: any): Array<T>;
  3556. /**
  3557. * @see _.forEach
  3558. **/
  3559. each<T>(
  3560. collection: List<T>,
  3561. callback: ListIterator<T, void>,
  3562. thisArg?: any): List<T>;
  3563. /**
  3564. * @see _.forEach
  3565. * @param object The object to iterate over
  3566. * @param callback The function called per iteration.
  3567. * @param thisArg The this binding of callback.
  3568. **/
  3569. each<T extends {}>(
  3570. object: Dictionary<T>,
  3571. callback: DictionaryIterator<T, void>,
  3572. thisArg?: any): Dictionary<T>;
  3573. /**
  3574. * @see _.each
  3575. **/
  3576. each<T extends {}, TValue>(
  3577. object: T,
  3578. callback: ObjectIterator<TValue, void>,
  3579. thisArg?: any): T
  3580. }
  3581. interface LoDashImplicitArrayWrapper<T> {
  3582. /**
  3583. * @see _.forEach
  3584. **/
  3585. forEach(
  3586. callback: ListIterator<T, void>,
  3587. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3588. /**
  3589. * @see _.forEach
  3590. **/
  3591. each(
  3592. callback: ListIterator<T, void>,
  3593. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3594. }
  3595. interface LoDashImplicitObjectWrapper<T> {
  3596. /**
  3597. * @see _.forEach
  3598. **/
  3599. forEach<T extends {}>(
  3600. callback: ObjectIterator<T, void>,
  3601. thisArg?: any): LoDashImplicitObjectWrapper<T>;
  3602. /**
  3603. * @see _.forEach
  3604. **/
  3605. each<T extends {}>(
  3606. callback: ObjectIterator<T, void>,
  3607. thisArg?: any): LoDashImplicitObjectWrapper<T>;
  3608. }
  3609. //_.forEachRight
  3610. interface LoDashStatic {
  3611. /**
  3612. * This method is like _.forEach except that it iterates over elements of a
  3613. * collection from right to left.
  3614. * @param collection The collection to iterate over.
  3615. * @param callback The function called per iteration.
  3616. * @param thisArg The this binding of callback.
  3617. **/
  3618. forEachRight<T>(
  3619. collection: Array<T>,
  3620. callback: ListIterator<T, void>,
  3621. thisArg?: any): Array<T>;
  3622. /**
  3623. * @see _.forEachRight
  3624. **/
  3625. forEachRight<T>(
  3626. collection: List<T>,
  3627. callback: ListIterator<T, void>,
  3628. thisArg?: any): List<T>;
  3629. /**
  3630. * @see _.forEachRight
  3631. **/
  3632. forEachRight<T extends {}>(
  3633. object: Dictionary<T>,
  3634. callback: DictionaryIterator<T, void>,
  3635. thisArg?: any): Dictionary<T>;
  3636. /**
  3637. * @see _.forEachRight
  3638. **/
  3639. eachRight<T>(
  3640. collection: Array<T>,
  3641. callback: ListIterator<T, void>,
  3642. thisArg?: any): Array<T>;
  3643. /**
  3644. * @see _.forEachRight
  3645. **/
  3646. eachRight<T>(
  3647. collection: List<T>,
  3648. callback: ListIterator<T, void>,
  3649. thisArg?: any): List<T>;
  3650. /**
  3651. * @see _.forEachRight
  3652. * @param object The object to iterate over
  3653. * @param callback The function called per iteration.
  3654. * @param thisArg The this binding of callback.
  3655. **/
  3656. eachRight<T extends {}>(
  3657. object: Dictionary<T>,
  3658. callback: DictionaryIterator<T, void>,
  3659. thisArg?: any): Dictionary<T>;
  3660. }
  3661. interface LoDashImplicitArrayWrapper<T> {
  3662. /**
  3663. * @see _.forEachRight
  3664. **/
  3665. forEachRight(
  3666. callback: ListIterator<T, void>,
  3667. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3668. /**
  3669. * @see _.forEachRight
  3670. **/
  3671. eachRight(
  3672. callback: ListIterator<T, void>,
  3673. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  3674. }
  3675. interface LoDashImplicitObjectWrapper<T> {
  3676. /**
  3677. * @see _.forEachRight
  3678. **/
  3679. forEachRight<T extends {}>(
  3680. callback: ObjectIterator<T, void>,
  3681. thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<T>>;
  3682. /**
  3683. * @see _.forEachRight
  3684. * @param object The object to iterate over
  3685. * @param callback The function called per iteration.
  3686. * @param thisArg The this binding of callback.
  3687. **/
  3688. eachRight<T extends {}>(
  3689. callback: ObjectIterator<T, void>,
  3690. thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<T>>;
  3691. }
  3692. //_.groupBy
  3693. interface LoDashStatic {
  3694. /**
  3695. * Creates an object composed of keys generated from the results of running each element
  3696. * of a collection through the callback. The corresponding value of each key is an array
  3697. * of the elements responsible for generating the key. The callback is bound to thisArg
  3698. * and invoked with three arguments; (value, index|key, collection).
  3699. *
  3700. * If a property name is provided for callback the created "_.pluck" style callback will
  3701. * return the property value of the given element.
  3702. * If an object is provided for callback the created "_.where" style callback will return
  3703. * true for elements that have the properties of the given object, else false
  3704. * @param collection The collection to iterate over.
  3705. * @param callback The function called per iteration.
  3706. * @param thisArg The this binding of callback.
  3707. * @return Returns the composed aggregate object.
  3708. **/
  3709. groupBy<T>(
  3710. collection: Array<T>,
  3711. callback?: ListIterator<T, any>,
  3712. thisArg?: any): Dictionary<T[]>;
  3713. /**
  3714. * @see _.groupBy
  3715. **/
  3716. groupBy<T>(
  3717. collection: List<T>,
  3718. callback?: ListIterator<T, any>,
  3719. thisArg?: any): Dictionary<T[]>;
  3720. /**
  3721. * @see _.groupBy
  3722. * @param pluckValue _.pluck style callback
  3723. **/
  3724. groupBy<T>(
  3725. collection: Array<T>,
  3726. pluckValue: string): Dictionary<T[]>;
  3727. /**
  3728. * @see _.groupBy
  3729. * @param pluckValue _.pluck style callback
  3730. **/
  3731. groupBy<T>(
  3732. collection: List<T>,
  3733. pluckValue: string): Dictionary<T[]>;
  3734. /**
  3735. * @see _.groupBy
  3736. * @param whereValue _.where style callback
  3737. **/
  3738. groupBy<W, T>(
  3739. collection: Array<T>,
  3740. whereValue: W): Dictionary<T[]>;
  3741. /**
  3742. * @see _.groupBy
  3743. * @param whereValue _.where style callback
  3744. **/
  3745. groupBy<W, T>(
  3746. collection: List<T>,
  3747. whereValue: W): Dictionary<T[]>;
  3748. /**
  3749. * @see _.groupBy
  3750. **/
  3751. groupBy<T>(
  3752. collection: Dictionary<T>,
  3753. callback?: DictionaryIterator<T, any>,
  3754. thisArg?: any): Dictionary<T[]>;
  3755. /**
  3756. * @see _.groupBy
  3757. * @param pluckValue _.pluck style callback
  3758. **/
  3759. groupBy<TValue>(
  3760. collection: Dictionary<TValue>,
  3761. pluckValue: string): Dictionary<TValue[]>;
  3762. /**
  3763. * @see _.groupBy
  3764. * @param whereValue _.where style callback
  3765. **/
  3766. groupBy<W, TValue>(
  3767. collection: Dictionary<TValue>,
  3768. whereValue: W): Dictionary<TValue[]>;
  3769. }
  3770. interface LoDashImplicitArrayWrapper<T> {
  3771. /**
  3772. * @see _.groupBy
  3773. **/
  3774. groupBy(
  3775. callback: ListIterator<T, any>,
  3776. thisArg?: any): _.LoDashImplicitObjectWrapper<_.Dictionary<T[]>>;
  3777. /**
  3778. * @see _.groupBy
  3779. **/
  3780. groupBy(
  3781. pluckValue: string): _.LoDashImplicitObjectWrapper<_.Dictionary<T[]>>;
  3782. /**
  3783. * @see _.groupBy
  3784. **/
  3785. groupBy<W>(
  3786. whereValue: W): _.LoDashImplicitObjectWrapper<_.Dictionary<T[]>>;
  3787. }
  3788. interface LoDashImplicitObjectWrapper<T> {
  3789. /**
  3790. * @see _.groupBy
  3791. **/
  3792. groupBy<TValue>(
  3793. callback: ListIterator<TValue, any>,
  3794. thisArg?: any): _.LoDashImplicitObjectWrapper<_.Dictionary<TValue[]>>;
  3795. /**
  3796. * @see _.groupBy
  3797. **/
  3798. groupBy<TValue>(
  3799. pluckValue: string): _.LoDashImplicitObjectWrapper<_.Dictionary<TValue[]>>;
  3800. /**
  3801. * @see _.groupBy
  3802. **/
  3803. groupBy<W, TValue>(
  3804. whereValue: W): _.LoDashImplicitObjectWrapper<_.Dictionary<TValue[]>>;
  3805. }
  3806. //_.indexBy
  3807. interface LoDashStatic {
  3808. /**
  3809. * Creates an object composed of keys generated from the results of running each element
  3810. * of the collection through the given callback. The corresponding value of each key is
  3811. * the last element responsible for generating the key. The callback is bound to thisArg
  3812. * and invoked with three arguments; (value, index|key, collection).
  3813. *
  3814. * If a property name is provided for callback the created "_.pluck" style callback will
  3815. * return the property value of the given element.
  3816. *
  3817. * If an object is provided for callback the created "_.where" style callback will return
  3818. * true for elements that have the properties of the given object, else false.
  3819. * @param collection The collection to iterate over.
  3820. * @param callback The function called per iteration.
  3821. * @param thisArg The this binding of callback.
  3822. * @return Returns the composed aggregate object.
  3823. **/
  3824. indexBy<T>(
  3825. list: Array<T>,
  3826. iterator: ListIterator<T, any>,
  3827. context?: any): Dictionary<T>;
  3828. /**
  3829. * @see _.indexBy
  3830. **/
  3831. indexBy<T>(
  3832. list: List<T>,
  3833. iterator: ListIterator<T, any>,
  3834. context?: any): Dictionary<T>;
  3835. /**
  3836. * @see _.indexBy
  3837. * @param pluckValue _.pluck style callback
  3838. **/
  3839. indexBy<T>(
  3840. collection: Array<T>,
  3841. pluckValue: string): Dictionary<T>;
  3842. /**
  3843. * @see _.indexBy
  3844. * @param pluckValue _.pluck style callback
  3845. **/
  3846. indexBy<T>(
  3847. collection: List<T>,
  3848. pluckValue: string): Dictionary<T>;
  3849. /**
  3850. * @see _.indexBy
  3851. * @param whereValue _.where style callback
  3852. **/
  3853. indexBy<W, T>(
  3854. collection: Array<T>,
  3855. whereValue: W): Dictionary<T>;
  3856. /**
  3857. * @see _.indexBy
  3858. * @param whereValue _.where style callback
  3859. **/
  3860. indexBy<W, T>(
  3861. collection: List<T>,
  3862. whereValue: W): Dictionary<T>;
  3863. }
  3864. //_.invoke
  3865. interface LoDashStatic {
  3866. /**
  3867. * Invokes the method named by methodName on each element in the collection returning
  3868. * an array of the results of each invoked method. Additional arguments will be provided
  3869. * to each invoked method. If methodName is a function it will be invoked for, and this
  3870. * bound to, each element in the collection.
  3871. * @param collection The collection to iterate over.
  3872. * @param methodName The name of the method to invoke.
  3873. * @param args Arguments to invoke the method with.
  3874. **/
  3875. invoke<T extends {}>(
  3876. collection: Array<T>,
  3877. methodName: string,
  3878. ...args: any[]): any;
  3879. /**
  3880. * @see _.invoke
  3881. **/
  3882. invoke<T extends {}>(
  3883. collection: List<T>,
  3884. methodName: string,
  3885. ...args: any[]): any;
  3886. /**
  3887. * @see _.invoke
  3888. **/
  3889. invoke<T extends {}>(
  3890. collection: Dictionary<T>,
  3891. methodName: string,
  3892. ...args: any[]): any;
  3893. /**
  3894. * @see _.invoke
  3895. **/
  3896. invoke<T extends {}>(
  3897. collection: Array<T>,
  3898. method: Function,
  3899. ...args: any[]): any;
  3900. /**
  3901. * @see _.invoke
  3902. **/
  3903. invoke<T extends {}>(
  3904. collection: List<T>,
  3905. method: Function,
  3906. ...args: any[]): any;
  3907. /**
  3908. * @see _.invoke
  3909. **/
  3910. invoke<T extends {}>(
  3911. collection: Dictionary<T>,
  3912. method: Function,
  3913. ...args: any[]): any;
  3914. }
  3915. //_.map
  3916. interface LoDashStatic {
  3917. /**
  3918. * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to
  3919. * thisArg and invoked with three arguments: (value, index|key, collection).
  3920. *
  3921. * If a property name is provided for iteratee the created _.property style callback returns the property value
  3922. * of the given element.
  3923. *
  3924. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  3925. * elements that have a matching property value, else false.
  3926. *
  3927. * If an object is provided for iteratee the created _.matches style callback returns true for elements that
  3928. * have the properties of the given object, else false.
  3929. *
  3930. * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues,
  3931. * _.reject, and _.some.
  3932. *
  3933. * The guarded methods are:
  3934. * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max,
  3935. * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range,
  3936. * sample, some, sum, uniq, and words
  3937. *
  3938. * @alias _.collect
  3939. *
  3940. * @param collection The collection to iterate over.
  3941. * @param iteratee The function invoked per iteration.
  3942. * @param thisArg The this binding of iteratee.
  3943. * @return Returns the new mapped array.
  3944. */
  3945. map<T, TResult>(
  3946. collection: List<T>,
  3947. iteratee?: ListIterator<T, TResult>,
  3948. thisArg?: any
  3949. ): TResult[];
  3950. /**
  3951. * @see _.map
  3952. */
  3953. map<T extends {}, TResult>(
  3954. collection: Dictionary<T>,
  3955. iteratee?: DictionaryIterator<T, TResult>,
  3956. thisArg?: any
  3957. ): TResult[];
  3958. /**
  3959. * @see _.map
  3960. */
  3961. map<T, TResult>(
  3962. collection: List<T>,
  3963. iteratee?: string
  3964. ): TResult[];
  3965. /**
  3966. * @see _.map
  3967. */
  3968. map<T, TResult>(
  3969. collection: Dictionary<T>,
  3970. iteratee?: string
  3971. ): TResult[];
  3972. /**
  3973. * @see _.map
  3974. */
  3975. map<T, TObject extends {}>(
  3976. collection: List<T>,
  3977. iteratee?: TObject
  3978. ): boolean[];
  3979. /**
  3980. * @see _.map
  3981. */
  3982. map<T, TObject extends {}>(
  3983. collection: Dictionary<T>,
  3984. iteratee?: TObject
  3985. ): boolean[];
  3986. }
  3987. interface LoDashImplicitArrayWrapper<T> {
  3988. /**
  3989. * @see _.map
  3990. */
  3991. map<TResult>(
  3992. iteratee?: ListIterator<T, TResult>,
  3993. thisArg?: any
  3994. ): LoDashImplicitArrayWrapper<TResult>;
  3995. /**
  3996. * @see _.map
  3997. */
  3998. map<TResult>(
  3999. iteratee?: string
  4000. ): LoDashImplicitArrayWrapper<TResult>;
  4001. /**
  4002. * @see _.map
  4003. */
  4004. map<TObject extends {}>(
  4005. iteratee?: TObject
  4006. ): LoDashImplicitArrayWrapper<boolean>;
  4007. }
  4008. interface LoDashImplicitObjectWrapper<T> {
  4009. /**
  4010. * @see _.map
  4011. */
  4012. map<TValue, TResult>(
  4013. iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
  4014. thisArg?: any
  4015. ): LoDashImplicitArrayWrapper<TResult>;
  4016. /**
  4017. * @see _.map
  4018. */
  4019. map<TValue, TResult>(
  4020. iteratee?: string
  4021. ): LoDashImplicitArrayWrapper<TResult>;
  4022. /**
  4023. * @see _.map
  4024. */
  4025. map<TObject extends {}>(
  4026. iteratee?: TObject
  4027. ): LoDashImplicitArrayWrapper<boolean>;
  4028. }
  4029. //_.sum
  4030. interface LoDashStatic {
  4031. /**
  4032. * Gets the sum of the values in collection.
  4033. *
  4034. * @param collection The collection to iterate over.
  4035. * @param iteratee The function invoked per iteration.
  4036. * @param thisArg The this binding of iteratee.
  4037. * @return Returns the sum.
  4038. **/
  4039. sum(
  4040. collection: Array<number>): number;
  4041. /**
  4042. * @see _.sum
  4043. **/
  4044. sum(
  4045. collection: List<number>): number;
  4046. /**
  4047. * @see _.sum
  4048. **/
  4049. sum(
  4050. collection: Dictionary<number>): number;
  4051. /**
  4052. * @see _.sum
  4053. **/
  4054. sum<T>(
  4055. collection: Array<T>,
  4056. iteratee: ListIterator<T, number>,
  4057. thisArg?: any): number;
  4058. /**
  4059. * @see _.sum
  4060. **/
  4061. sum<T>(
  4062. collection: List<T>,
  4063. iteratee: ListIterator<T, number>,
  4064. thisArg?: any): number;
  4065. /**
  4066. * @see _.sum
  4067. **/
  4068. sum<T>(
  4069. collection: Dictionary<T>,
  4070. iteratee: ObjectIterator<T, number>,
  4071. thisArg?: any): number;
  4072. /**
  4073. * @see _.sum
  4074. * @param property _.property callback shorthand.
  4075. **/
  4076. sum<T>(
  4077. collection: Array<T>,
  4078. property: string): number;
  4079. /**
  4080. * @see _.sum
  4081. * @param property _.property callback shorthand.
  4082. **/
  4083. sum<T>(
  4084. collection: List<T>,
  4085. property: string): number;
  4086. /**
  4087. * @see _.sum
  4088. * @param property _.property callback shorthand.
  4089. **/
  4090. sum<T>(
  4091. collection: Dictionary<T>,
  4092. property: string): number;
  4093. }
  4094. interface LoDashImplicitNumberArrayWrapper {
  4095. /**
  4096. * @see _.sum
  4097. **/
  4098. sum(): number;
  4099. /**
  4100. * @see _.sum
  4101. **/
  4102. sum(
  4103. iteratee: ListIterator<number, number>,
  4104. thisArg?: any): number;
  4105. }
  4106. interface LoDashImplicitArrayWrapper<T> {
  4107. /**
  4108. * @see _.sum
  4109. **/
  4110. sum(): number;
  4111. /**
  4112. * @see _.sum
  4113. **/
  4114. sum(
  4115. iteratee: ListIterator<T, number>,
  4116. thisArg?: any): number;
  4117. /**
  4118. * @see _.sum
  4119. * @param property _.property callback shorthand.
  4120. **/
  4121. sum(
  4122. property: string): number;
  4123. }
  4124. interface LoDashImplicitObjectWrapper<T> {
  4125. /**
  4126. * @see _.sum
  4127. **/
  4128. sum(): number;
  4129. /**
  4130. * @see _.sum
  4131. **/
  4132. sum(
  4133. iteratee: ObjectIterator<any, number>,
  4134. thisArg?: any): number;
  4135. /**
  4136. * @see _.sum
  4137. * @param property _.property callback shorthand.
  4138. **/
  4139. sum(
  4140. property: string): number;
  4141. }
  4142. //_.pluck
  4143. interface LoDashStatic {
  4144. /**
  4145. * Retrieves the value of a specified property from all elements in the collection.
  4146. * @param collection The collection to iterate over.
  4147. * @param property The property to pluck.
  4148. * @return A new array of property values.
  4149. **/
  4150. pluck<T extends {}>(
  4151. collection: Array<T>,
  4152. property: string|string[]): any[];
  4153. /**
  4154. * @see _.pluck
  4155. **/
  4156. pluck<T extends {}>(
  4157. collection: List<T>,
  4158. property: string|string[]): any[];
  4159. /**
  4160. * @see _.pluck
  4161. **/
  4162. pluck<T extends {}>(
  4163. collection: Dictionary<T>,
  4164. property: string|string[]): any[];
  4165. }
  4166. interface LoDashImplicitArrayWrapper<T> {
  4167. /**
  4168. * @see _.pluck
  4169. **/
  4170. pluck<TResult>(
  4171. property: string): LoDashImplicitArrayWrapper<TResult>;
  4172. }
  4173. interface LoDashImplicitObjectWrapper<T> {
  4174. /**
  4175. * @see _.pluck
  4176. **/
  4177. pluck<TResult>(
  4178. property: string): LoDashImplicitArrayWrapper<TResult>;
  4179. }
  4180. //_.partition
  4181. interface LoDashStatic {
  4182. /**
  4183. * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for,
  4184. * while the second of which contains elements predicate returns falsey for.
  4185. * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
  4186. *
  4187. * If a property name is provided for predicate the created _.property style callback
  4188. * returns the property value of the given element.
  4189. *
  4190. * If a value is also provided for thisArg the created _.matchesProperty style callback
  4191. * returns true for elements that have a matching property value, else false.
  4192. *
  4193. * If an object is provided for predicate the created _.matches style callback returns
  4194. * true for elements that have the properties of the given object, else false.
  4195. *
  4196. * @param collection The collection to iterate over.
  4197. * @param callback The function called per iteration.
  4198. * @param thisArg The this binding of predicate.
  4199. * @return Returns the array of grouped elements.
  4200. **/
  4201. partition<T>(
  4202. collection: List<T>,
  4203. callback: ListIterator<T, boolean>,
  4204. thisArg?: any): T[][];
  4205. /**
  4206. * @see _.partition
  4207. **/
  4208. partition<T>(
  4209. collection: Dictionary<T>,
  4210. callback: DictionaryIterator<T, boolean>,
  4211. thisArg?: any): T[][];
  4212. /**
  4213. * @see _.partition
  4214. **/
  4215. partition<W, T>(
  4216. collection: List<T>,
  4217. whereValue: W): T[][];
  4218. /**
  4219. * @see _.partition
  4220. **/
  4221. partition<W, T>(
  4222. collection: Dictionary<T>,
  4223. whereValue: W): T[][];
  4224. /**
  4225. * @see _.partition
  4226. **/
  4227. partition<T>(
  4228. collection: List<T>,
  4229. path: string,
  4230. srcValue: any): T[][];
  4231. /**
  4232. * @see _.partition
  4233. **/
  4234. partition<T>(
  4235. collection: Dictionary<T>,
  4236. path: string,
  4237. srcValue: any): T[][];
  4238. /**
  4239. * @see _.partition
  4240. **/
  4241. partition<T>(
  4242. collection: List<T>,
  4243. pluckValue: string): T[][];
  4244. /**
  4245. * @see _.partition
  4246. **/
  4247. partition<T>(
  4248. collection: Dictionary<T>,
  4249. pluckValue: string): T[][];
  4250. }
  4251. interface LoDashImplicitStringWrapper {
  4252. /**
  4253. * @see _.partition
  4254. */
  4255. partition(
  4256. callback: ListIterator<string, boolean>,
  4257. thisArg?: any): LoDashImplicitArrayWrapper<string[]>;
  4258. }
  4259. interface LoDashImplicitArrayWrapper<T> {
  4260. /**
  4261. * @see _.partition
  4262. */
  4263. partition(
  4264. callback: ListIterator<T, boolean>,
  4265. thisArg?: any): LoDashImplicitArrayWrapper<T[]>;
  4266. /**
  4267. * @see _.partition
  4268. */
  4269. partition<W>(
  4270. whereValue: W): LoDashImplicitArrayWrapper<T[]>;
  4271. /**
  4272. * @see _.partition
  4273. */
  4274. partition(
  4275. path: string,
  4276. srcValue: any): LoDashImplicitArrayWrapper<T[]>;
  4277. /**
  4278. * @see _.partition
  4279. */
  4280. partition(
  4281. pluckValue: string): LoDashImplicitArrayWrapper<T[]>;
  4282. }
  4283. interface LoDashImplicitObjectWrapper<T> {
  4284. /**
  4285. * @see _.partition
  4286. */
  4287. partition<TResult>(
  4288. callback: ListIterator<TResult, boolean>,
  4289. thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
  4290. /**
  4291. * @see _.partition
  4292. */
  4293. partition<TResult>(
  4294. callback: DictionaryIterator<TResult, boolean>,
  4295. thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
  4296. /**
  4297. * @see _.partition
  4298. */
  4299. partition<W, TResult>(
  4300. whereValue: W): LoDashImplicitArrayWrapper<TResult[]>;
  4301. /**
  4302. * @see _.partition
  4303. */
  4304. partition<TResult>(
  4305. path: string,
  4306. srcValue: any): LoDashImplicitArrayWrapper<TResult[]>;
  4307. /**
  4308. * @see _.partition
  4309. */
  4310. partition<TResult>(
  4311. pluckValue: string): LoDashImplicitArrayWrapper<TResult[]>;
  4312. }
  4313. //_.reduce
  4314. interface LoDashStatic {
  4315. /**
  4316. * Reduces a collection to a value which is the accumulated result of running each
  4317. * element in the collection through the callback, where each successive callback execution
  4318. * consumes the return value of the previous execution. If accumulator is not provided the
  4319. * first element of the collection will be used as the initial accumulator value. The callback
  4320. * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
  4321. * @param collection The collection to iterate over.
  4322. * @param callback The function called per iteration.
  4323. * @param accumulator Initial value of the accumulator.
  4324. * @param thisArg The this binding of callback.
  4325. * @return Returns the accumulated value.
  4326. **/
  4327. reduce<T, TResult>(
  4328. collection: Array<T>,
  4329. callback: MemoIterator<T, TResult>,
  4330. accumulator: TResult,
  4331. thisArg?: any): TResult;
  4332. /**
  4333. * @see _.reduce
  4334. **/
  4335. reduce<T, TResult>(
  4336. collection: List<T>,
  4337. callback: MemoIterator<T, TResult>,
  4338. accumulator: TResult,
  4339. thisArg?: any): TResult;
  4340. /**
  4341. * @see _.reduce
  4342. **/
  4343. reduce<T, TResult>(
  4344. collection: Dictionary<T>,
  4345. callback: MemoIterator<T, TResult>,
  4346. accumulator: TResult,
  4347. thisArg?: any): TResult;
  4348. /**
  4349. * @see _.reduce
  4350. **/
  4351. reduce<T, TResult>(
  4352. collection: Array<T>,
  4353. callback: MemoIterator<T, TResult>,
  4354. thisArg?: any): TResult;
  4355. /**
  4356. * @see _.reduce
  4357. **/
  4358. reduce<T, TResult>(
  4359. collection: List<T>,
  4360. callback: MemoIterator<T, TResult>,
  4361. thisArg?: any): TResult;
  4362. /**
  4363. * @see _.reduce
  4364. **/
  4365. reduce<T, TResult>(
  4366. collection: Dictionary<T>,
  4367. callback: MemoIterator<T, TResult>,
  4368. thisArg?: any): TResult;
  4369. /**
  4370. * @see _.reduce
  4371. **/
  4372. inject<T, TResult>(
  4373. collection: Array<T>,
  4374. callback: MemoIterator<T, TResult>,
  4375. accumulator: TResult,
  4376. thisArg?: any): TResult;
  4377. /**
  4378. * @see _.reduce
  4379. **/
  4380. inject<T, TResult>(
  4381. collection: List<T>,
  4382. callback: MemoIterator<T, TResult>,
  4383. accumulator: TResult,
  4384. thisArg?: any): TResult;
  4385. /**
  4386. * @see _.reduce
  4387. **/
  4388. inject<T, TResult>(
  4389. collection: Dictionary<T>,
  4390. callback: MemoIterator<T, TResult>,
  4391. accumulator: TResult,
  4392. thisArg?: any): TResult;
  4393. /**
  4394. * @see _.reduce
  4395. **/
  4396. inject<T, TResult>(
  4397. collection: Array<T>,
  4398. callback: MemoIterator<T, TResult>,
  4399. thisArg?: any): TResult;
  4400. /**
  4401. * @see _.reduce
  4402. **/
  4403. inject<T, TResult>(
  4404. collection: List<T>,
  4405. callback: MemoIterator<T, TResult>,
  4406. thisArg?: any): TResult;
  4407. /**
  4408. * @see _.reduce
  4409. **/
  4410. inject<T, TResult>(
  4411. collection: Dictionary<T>,
  4412. callback: MemoIterator<T, TResult>,
  4413. thisArg?: any): TResult;
  4414. /**
  4415. * @see _.reduce
  4416. **/
  4417. foldl<T, TResult>(
  4418. collection: Array<T>,
  4419. callback: MemoIterator<T, TResult>,
  4420. accumulator: TResult,
  4421. thisArg?: any): TResult;
  4422. /**
  4423. * @see _.reduce
  4424. **/
  4425. foldl<T, TResult>(
  4426. collection: List<T>,
  4427. callback: MemoIterator<T, TResult>,
  4428. accumulator: TResult,
  4429. thisArg?: any): TResult;
  4430. /**
  4431. * @see _.reduce
  4432. **/
  4433. foldl<T, TResult>(
  4434. collection: Dictionary<T>,
  4435. callback: MemoIterator<T, TResult>,
  4436. accumulator: TResult,
  4437. thisArg?: any): TResult;
  4438. /**
  4439. * @see _.reduce
  4440. **/
  4441. foldl<T, TResult>(
  4442. collection: Array<T>,
  4443. callback: MemoIterator<T, TResult>,
  4444. thisArg?: any): TResult;
  4445. /**
  4446. * @see _.reduce
  4447. **/
  4448. foldl<T, TResult>(
  4449. collection: List<T>,
  4450. callback: MemoIterator<T, TResult>,
  4451. thisArg?: any): TResult;
  4452. /**
  4453. * @see _.reduce
  4454. **/
  4455. foldl<T, TResult>(
  4456. collection: Dictionary<T>,
  4457. callback: MemoIterator<T, TResult>,
  4458. thisArg?: any): TResult;
  4459. }
  4460. interface LoDashImplicitArrayWrapper<T> {
  4461. /**
  4462. * @see _.reduce
  4463. **/
  4464. reduce<TResult>(
  4465. callback: MemoIterator<T, TResult>,
  4466. accumulator: TResult,
  4467. thisArg?: any): TResult;
  4468. /**
  4469. * @see _.reduce
  4470. **/
  4471. reduce<TResult>(
  4472. callback: MemoIterator<T, TResult>,
  4473. thisArg?: any): TResult;
  4474. /**
  4475. * @see _.reduce
  4476. **/
  4477. inject<TResult>(
  4478. callback: MemoIterator<T, TResult>,
  4479. accumulator: TResult,
  4480. thisArg?: any): TResult;
  4481. /**
  4482. * @see _.reduce
  4483. **/
  4484. inject<TResult>(
  4485. callback: MemoIterator<T, TResult>,
  4486. thisArg?: any): TResult;
  4487. /**
  4488. * @see _.reduce
  4489. **/
  4490. foldl<TResult>(
  4491. callback: MemoIterator<T, TResult>,
  4492. accumulator: TResult,
  4493. thisArg?: any): TResult;
  4494. /**
  4495. * @see _.reduce
  4496. **/
  4497. foldl<TResult>(
  4498. callback: MemoIterator<T, TResult>,
  4499. thisArg?: any): TResult;
  4500. }
  4501. interface LoDashImplicitObjectWrapper<T> {
  4502. /**
  4503. * @see _.reduce
  4504. **/
  4505. reduce<TValue, TResult>(
  4506. callback: MemoIterator<TValue, TResult>,
  4507. accumulator: TResult,
  4508. thisArg?: any): TResult;
  4509. /**
  4510. * @see _.reduce
  4511. **/
  4512. reduce<TValue, TResult>(
  4513. callback: MemoIterator<TValue, TResult>,
  4514. thisArg?: any): TResult;
  4515. /**
  4516. * @see _.reduce
  4517. **/
  4518. inject<TValue, TResult>(
  4519. callback: MemoIterator<TValue, TResult>,
  4520. accumulator: TResult,
  4521. thisArg?: any): TResult;
  4522. /**
  4523. * @see _.reduce
  4524. **/
  4525. inject<TValue, TResult>(
  4526. callback: MemoIterator<TValue, TResult>,
  4527. thisArg?: any): TResult;
  4528. /**
  4529. * @see _.reduce
  4530. **/
  4531. foldl<TValue, TResult>(
  4532. callback: MemoIterator<TValue, TResult>,
  4533. accumulator: TResult,
  4534. thisArg?: any): TResult;
  4535. /**
  4536. * @see _.reduce
  4537. **/
  4538. foldl<TValue, TResult>(
  4539. callback: MemoIterator<TValue, TResult>,
  4540. thisArg?: any): TResult;
  4541. }
  4542. //_.reduceRight
  4543. interface LoDashStatic {
  4544. /**
  4545. * This method is like _.reduce except that it iterates over elements of a collection from
  4546. * right to left.
  4547. * @param collection The collection to iterate over.
  4548. * @param callback The function called per iteration.
  4549. * @param accumulator Initial value of the accumulator.
  4550. * @param thisArg The this binding of callback.
  4551. * @return The accumulated value.
  4552. **/
  4553. reduceRight<T, TResult>(
  4554. collection: Array<T>,
  4555. callback: MemoIterator<T, TResult>,
  4556. accumulator: TResult,
  4557. thisArg?: any): TResult;
  4558. /**
  4559. * @see _.reduceRight
  4560. **/
  4561. reduceRight<T, TResult>(
  4562. collection: List<T>,
  4563. callback: MemoIterator<T, TResult>,
  4564. accumulator: TResult,
  4565. thisArg?: any): TResult;
  4566. /**
  4567. * @see _.reduceRight
  4568. **/
  4569. reduceRight<T, TResult>(
  4570. collection: Dictionary<T>,
  4571. callback: MemoIterator<T, TResult>,
  4572. accumulator: TResult,
  4573. thisArg?: any): TResult;
  4574. /**
  4575. * @see _.reduceRight
  4576. **/
  4577. reduceRight<T, TResult>(
  4578. collection: Array<T>,
  4579. callback: MemoIterator<T, TResult>,
  4580. thisArg?: any): TResult;
  4581. /**
  4582. * @see _.reduceRight
  4583. **/
  4584. reduceRight<T, TResult>(
  4585. collection: List<T>,
  4586. callback: MemoIterator<T, TResult>,
  4587. thisArg?: any): TResult;
  4588. /**
  4589. * @see _.reduceRight
  4590. **/
  4591. reduceRight<T, TResult>(
  4592. collection: Dictionary<T>,
  4593. callback: MemoIterator<T, TResult>,
  4594. thisArg?: any): TResult;
  4595. /**
  4596. * @see _.reduceRight
  4597. **/
  4598. foldr<T, TResult>(
  4599. collection: Array<T>,
  4600. callback: MemoIterator<T, TResult>,
  4601. accumulator: TResult,
  4602. thisArg?: any): TResult;
  4603. /**
  4604. * @see _.reduceRight
  4605. **/
  4606. foldr<T, TResult>(
  4607. collection: List<T>,
  4608. callback: MemoIterator<T, TResult>,
  4609. accumulator: TResult,
  4610. thisArg?: any): TResult;
  4611. /**
  4612. * @see _.reduceRight
  4613. **/
  4614. foldr<T, TResult>(
  4615. collection: Dictionary<T>,
  4616. callback: MemoIterator<T, TResult>,
  4617. accumulator: TResult,
  4618. thisArg?: any): TResult;
  4619. /**
  4620. * @see _.reduceRight
  4621. **/
  4622. foldr<T, TResult>(
  4623. collection: Array<T>,
  4624. callback: MemoIterator<T, TResult>,
  4625. thisArg?: any): TResult;
  4626. /**
  4627. * @see _.reduceRight
  4628. **/
  4629. foldr<T, TResult>(
  4630. collection: List<T>,
  4631. callback: MemoIterator<T, TResult>,
  4632. thisArg?: any): TResult;
  4633. /**
  4634. * @see _.reduceRight
  4635. **/
  4636. foldr<T, TResult>(
  4637. collection: Dictionary<T>,
  4638. callback: MemoIterator<T, TResult>,
  4639. thisArg?: any): TResult;
  4640. }
  4641. //_.reject
  4642. interface LoDashStatic {
  4643. /**
  4644. * The opposite of _.filter this method returns the elements of a collection that
  4645. * the callback does not return truey for.
  4646. *
  4647. * If a property name is provided for callback the created "_.pluck" style callback
  4648. * will return the property value of the given element.
  4649. *
  4650. * If an object is provided for callback the created "_.where" style callback will
  4651. * return true for elements that have the properties of the given object, else false.
  4652. * @param collection The collection to iterate over.
  4653. * @param callback The function called per iteration.
  4654. * @param thisArg The this binding of callback.
  4655. * @return A new array of elements that failed the callback check.
  4656. **/
  4657. reject<T>(
  4658. collection: Array<T>,
  4659. callback: ListIterator<T, boolean>,
  4660. thisArg?: any): T[];
  4661. /**
  4662. * @see _.reject
  4663. **/
  4664. reject<T>(
  4665. collection: List<T>,
  4666. callback: ListIterator<T, boolean>,
  4667. thisArg?: any): T[];
  4668. /**
  4669. * @see _.reject
  4670. **/
  4671. reject<T>(
  4672. collection: Dictionary<T>,
  4673. callback: DictionaryIterator<T, boolean>,
  4674. thisArg?: any): T[];
  4675. /**
  4676. * @see _.reject
  4677. * @param pluckValue _.pluck style callback
  4678. **/
  4679. reject<T>(
  4680. collection: Array<T>,
  4681. pluckValue: string): T[];
  4682. /**
  4683. * @see _.reject
  4684. * @param pluckValue _.pluck style callback
  4685. **/
  4686. reject<T>(
  4687. collection: List<T>,
  4688. pluckValue: string): T[];
  4689. /**
  4690. * @see _.reject
  4691. * @param pluckValue _.pluck style callback
  4692. **/
  4693. reject<T>(
  4694. collection: Dictionary<T>,
  4695. pluckValue: string): T[];
  4696. /**
  4697. * @see _.reject
  4698. * @param whereValue _.where style callback
  4699. **/
  4700. reject<W, T>(
  4701. collection: Array<T>,
  4702. whereValue: W): T[];
  4703. /**
  4704. * @see _.reject
  4705. * @param whereValue _.where style callback
  4706. **/
  4707. reject<W, T>(
  4708. collection: List<T>,
  4709. whereValue: W): T[];
  4710. /**
  4711. * @see _.reject
  4712. * @param whereValue _.where style callback
  4713. **/
  4714. reject<W, T>(
  4715. collection: Dictionary<T>,
  4716. whereValue: W): T[];
  4717. }
  4718. interface LoDashImplicitArrayWrapper<T> {
  4719. /**
  4720. * @see _.reject
  4721. **/
  4722. reject(
  4723. callback: ListIterator<T, boolean>,
  4724. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  4725. /**
  4726. * @see _.reject
  4727. * @param pluckValue _.pluck style callback
  4728. **/
  4729. reject(pluckValue: string): LoDashImplicitArrayWrapper<T>;
  4730. /**
  4731. * @see _.reject
  4732. * @param whereValue _.where style callback
  4733. **/
  4734. reject<W>(whereValue: W): LoDashImplicitArrayWrapper<T>;
  4735. }
  4736. //_.sample
  4737. interface LoDashStatic {
  4738. /**
  4739. * Retrieves a random element or n random elements from a collection.
  4740. * @param collection The collection to sample.
  4741. * @return Returns the random sample(s) of collection.
  4742. **/
  4743. sample<T>(collection: Array<T>): T;
  4744. /**
  4745. * @see _.sample
  4746. **/
  4747. sample<T>(collection: List<T>): T;
  4748. /**
  4749. * @see _.sample
  4750. **/
  4751. sample<T>(collection: Dictionary<T>): T;
  4752. /**
  4753. * @see _.sample
  4754. * @param n The number of elements to sample.
  4755. **/
  4756. sample<T>(collection: Array<T>, n: number): T[];
  4757. /**
  4758. * @see _.sample
  4759. * @param n The number of elements to sample.
  4760. **/
  4761. sample<T>(collection: List<T>, n: number): T[];
  4762. /**
  4763. * @see _.sample
  4764. * @param n The number of elements to sample.
  4765. **/
  4766. sample<T>(collection: Dictionary<T>, n: number): T[];
  4767. }
  4768. interface LoDashImplicitArrayWrapper<T> {
  4769. /**
  4770. * @see _.sample
  4771. **/
  4772. sample(n: number): LoDashImplicitArrayWrapper<T>;
  4773. /**
  4774. * @see _.sample
  4775. **/
  4776. sample(): LoDashImplicitWrapper<T>;
  4777. }
  4778. //_.shuffle
  4779. interface LoDashStatic {
  4780. /**
  4781. * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
  4782. * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
  4783. * @param collection The collection to shuffle.
  4784. * @return Returns a new shuffled collection.
  4785. **/
  4786. shuffle<T>(collection: Array<T>): T[];
  4787. /**
  4788. * @see _.shuffle
  4789. **/
  4790. shuffle<T>(collection: List<T>): T[];
  4791. /**
  4792. * @see _.shuffle
  4793. **/
  4794. shuffle<T>(collection: Dictionary<T>): T[];
  4795. }
  4796. interface LoDashImplicitArrayWrapper<T> {
  4797. /**
  4798. * @see _.shuffle
  4799. **/
  4800. shuffle(): LoDashImplicitArrayWrapper<T>;
  4801. }
  4802. interface LoDashImplicitObjectWrapper<T> {
  4803. /**
  4804. * @see _.shuffle
  4805. **/
  4806. shuffle(): LoDashImplicitArrayWrapper<T>;
  4807. }
  4808. //_.size
  4809. interface LoDashStatic {
  4810. /**
  4811. * Gets the size of the collection by returning collection.length for arrays and array-like
  4812. * objects or the number of own enumerable properties for objects.
  4813. * @param collection The collection to inspect.
  4814. * @return collection.length
  4815. **/
  4816. size<T>(collection: Array<T>): number;
  4817. /**
  4818. * @see _.size
  4819. **/
  4820. size<T>(collection: List<T>): number;
  4821. /**
  4822. * @see _.size
  4823. * @param object The object to inspect
  4824. * @return The number of own enumerable properties.
  4825. **/
  4826. size<T extends {}>(object: T): number;
  4827. /**
  4828. * @see _.size
  4829. * @param aString The string to inspect
  4830. * @return The length of aString
  4831. **/
  4832. size(aString: string): number;
  4833. }
  4834. interface LoDashImplicitArrayWrapper<T> {
  4835. /**
  4836. * @see _.size
  4837. **/
  4838. size(): number;
  4839. }
  4840. interface LoDashImplicitObjectWrapper<T> {
  4841. /**
  4842. * @see _.size
  4843. **/
  4844. size(): number;
  4845. }
  4846. //_.some
  4847. interface LoDashStatic {
  4848. /**
  4849. * Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds
  4850. * a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and
  4851. * invoked with three arguments: (value, index|key, collection).
  4852. *
  4853. * If a property name is provided for predicate the created _.property style callback returns the property
  4854. * value of the given element.
  4855. *
  4856. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  4857. * elements that have a matching property value, else false.
  4858. *
  4859. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  4860. * have the properties of the given object, else false.
  4861. *
  4862. * @alias _.any
  4863. *
  4864. * @param collection The collection to iterate over.
  4865. * @param predicate The function invoked per iteration.
  4866. * @param thisArg The this binding of predicate.
  4867. * @return Returns true if any element passes the predicate check, else false.
  4868. */
  4869. some<T>(
  4870. collection: List<T>,
  4871. predicate?: ListIterator<T, boolean>,
  4872. thisArg?: any
  4873. ): boolean;
  4874. /**
  4875. * @see _.some
  4876. */
  4877. some<T>(
  4878. collection: Dictionary<T>,
  4879. predicate?: DictionaryIterator<T, boolean>,
  4880. thisArg?: any
  4881. ): boolean;
  4882. /**
  4883. * @see _.some
  4884. */
  4885. some<T>(
  4886. collection: List<T>|Dictionary<T>,
  4887. predicate?: string,
  4888. thisArg?: any
  4889. ): boolean;
  4890. /**
  4891. * @see _.some
  4892. */
  4893. some<TObject extends {}, T>(
  4894. collection: List<T>|Dictionary<T>,
  4895. predicate?: TObject
  4896. ): boolean;
  4897. }
  4898. interface LoDashImplicitArrayWrapper<T> {
  4899. /**
  4900. * @see _.some
  4901. */
  4902. some(
  4903. predicate?: ListIterator<T, boolean>,
  4904. thisArg?: any
  4905. ): boolean;
  4906. /**
  4907. * @see _.some
  4908. */
  4909. some(
  4910. predicate?: string,
  4911. thisArg?: any
  4912. ): boolean;
  4913. /**
  4914. * @see _.some
  4915. */
  4916. some<TObject extends {}>(
  4917. predicate?: TObject
  4918. ): boolean;
  4919. }
  4920. interface LoDashImplicitObjectWrapper<T> {
  4921. /**
  4922. * @see _.some
  4923. */
  4924. some<TResult>(
  4925. predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
  4926. thisArg?: any
  4927. ): boolean;
  4928. /**
  4929. * @see _.some
  4930. */
  4931. some(
  4932. predicate?: string,
  4933. thisArg?: any
  4934. ): boolean;
  4935. /**
  4936. * @see _.some
  4937. */
  4938. some<TObject extends {}>(
  4939. predicate?: TObject
  4940. ): boolean;
  4941. }
  4942. //_.sortBy
  4943. interface LoDashStatic {
  4944. /**
  4945. * Creates an array of elements, sorted in ascending order by the results of running each
  4946. * element in a collection through the callback. This method performs a stable sort, that
  4947. * is, it will preserve the original sort order of equal elements. The callback is bound
  4948. * to thisArg and invoked with three arguments; (value, index|key, collection).
  4949. *
  4950. * If a property name is provided for callback the created "_.pluck" style callback will
  4951. * return the property value of the given element.
  4952. *
  4953. * If a value is also provided for thisArg the created "_.matchesProperty" style callback
  4954. * returns true for elements that have a matching property value, else false.
  4955. *
  4956. * If an object is provided for an iteratee the created "_.matches" style callback returns
  4957. * true for elements that have the properties of the given object, else false.
  4958. * @param collection The collection to iterate over.
  4959. * @param callback The function called per iteration.
  4960. * @param thisArg The this binding of callback.
  4961. * @return A new array of sorted elements.
  4962. **/
  4963. sortBy<T, TSort>(
  4964. collection: Array<T>,
  4965. iteratee?: ListIterator<T, TSort>,
  4966. thisArg?: any): T[];
  4967. /**
  4968. * @see _.sortBy
  4969. **/
  4970. sortBy<T, TSort>(
  4971. collection: List<T>,
  4972. iteratee?: ListIterator<T, TSort>,
  4973. thisArg?: any): T[];
  4974. /**
  4975. * @see _.sortBy
  4976. * @param pluckValue _.pluck style callback
  4977. **/
  4978. sortBy<T>(
  4979. collection: Array<T>,
  4980. pluckValue: string): T[];
  4981. /**
  4982. * @see _.sortBy
  4983. * @param pluckValue _.pluck style callback
  4984. **/
  4985. sortBy<T>(
  4986. collection: List<T>,
  4987. pluckValue: string): T[];
  4988. /**
  4989. * @see _.sortBy
  4990. * @param whereValue _.where style callback
  4991. **/
  4992. sortBy<W, T>(
  4993. collection: Array<T>,
  4994. whereValue: W): T[];
  4995. /**
  4996. * @see _.sortBy
  4997. * @param whereValue _.where style callback
  4998. **/
  4999. sortBy<W, T>(
  5000. collection: List<T>,
  5001. whereValue: W): T[];
  5002. /**
  5003. * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
  5004. * @param args The rules by which to sort
  5005. */
  5006. sortByAll<T>(
  5007. collection: (Array<T>|List<T>),
  5008. ...args: (ListIterator<T, boolean>|Object|string)[]
  5009. ): T[];
  5010. }
  5011. interface LoDashImplicitArrayWrapper<T> {
  5012. /**
  5013. * @see _.sortBy
  5014. **/
  5015. sortBy<TSort>(
  5016. iteratee?: ListIterator<T, TSort>,
  5017. thisArg?: any): LoDashImplicitArrayWrapper<T>;
  5018. /**
  5019. * @see _.sortBy
  5020. * @param pluckValue _.pluck style callback
  5021. **/
  5022. sortBy(pluckValue: string): LoDashImplicitArrayWrapper<T>;
  5023. /**
  5024. * @see _.sortBy
  5025. * @param whereValue _.where style callback
  5026. **/
  5027. sortBy<W>(whereValue: W): LoDashImplicitArrayWrapper<T>;
  5028. /**
  5029. * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
  5030. * @param args The rules by which to sort
  5031. */
  5032. sortByAll(...args: (ListIterator<T, boolean>|Object|string)[]): LoDashImplicitArrayWrapper<T>;
  5033. }
  5034. //_.sortByAll
  5035. interface LoDashStatic {
  5036. /**
  5037. * This method is like "_.sortBy" except that it can sort by multiple iteratees or
  5038. * property names.
  5039. *
  5040. * If a property name is provided for an iteratee the created "_.property" style callback
  5041. * returns the property value of the given element.
  5042. *
  5043. * If a value is also provided for thisArg the created "_.matchesProperty" style callback
  5044. * returns true for elements that have a matching property value, else false.
  5045. *
  5046. * If an object is provided for an iteratee the created "_.matches" style callback returns
  5047. * true for elements that have the properties of the given object, else false.
  5048. *
  5049. * @param collection The collection to iterate over.
  5050. * @param callback The function called per iteration.
  5051. * @param thisArg The this binding of callback.
  5052. * @return A new array of sorted elements.
  5053. **/
  5054. sortByAll<T>(
  5055. collection: Array<T>,
  5056. iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  5057. /**
  5058. * @see _.sortByAll
  5059. **/
  5060. sortByAll<T>(
  5061. collection: List<T>,
  5062. iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  5063. /**
  5064. * @see _.sortByAll
  5065. **/
  5066. sortByAll<T>(
  5067. collection: Array<T>,
  5068. ...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  5069. /**
  5070. * @see _.sortByAll
  5071. **/
  5072. sortByAll<T>(
  5073. collection: List<T>,
  5074. ...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  5075. }
  5076. interface LoDashImplicitArrayWrapper<T> {
  5077. /**
  5078. * @see _.sortByAll
  5079. **/
  5080. sortByAll(
  5081. iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>;
  5082. /**
  5083. * @see _.sortByAll
  5084. **/
  5085. sortByAll(
  5086. ...iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>;
  5087. }
  5088. //_.sortByOrder
  5089. interface LoDashStatic {
  5090. /**
  5091. * This method is like "_.sortByAll" except that it allows specifying the sort orders of the
  5092. * iteratees to sort by. If orders is unspecified, all values are sorted in ascending order.
  5093. * Otherwise, a value is sorted in ascending order if its corresponding order is "asc", and
  5094. * descending if "desc".
  5095. *
  5096. * If a property name is provided for an iteratee the created "_.property" style callback
  5097. * returns the property value of the given element.
  5098. *
  5099. * If an object is provided for an iteratee the created "_.matches" style callback returns
  5100. * true for elements that have the properties of the given object, else false.
  5101. *
  5102. * @param collection The collection to iterate over.
  5103. * @param callback The function called per iteration.
  5104. * @param thisArg The this binding of callback.
  5105. * @return A new array of sorted elements.
  5106. **/
  5107. sortByOrder<T>(
  5108. collection: Array<T>,
  5109. iteratees: (ListIterator<T, any>|string|Object)[],
  5110. orders?: boolean[]): T[];
  5111. /**
  5112. * @see _.sortByOrder
  5113. **/
  5114. sortByOrder<T>(
  5115. collection: List<T>,
  5116. iteratees: (ListIterator<T, any>|string|Object)[],
  5117. orders?: boolean[]): T[];
  5118. /**
  5119. * @see _.sortByOrder
  5120. **/
  5121. sortByOrder<T>(
  5122. collection: Array<T>,
  5123. iteratees: (ListIterator<T, any>|string|Object)[],
  5124. orders?: string[]): T[];
  5125. /**
  5126. * @see _.sortByOrder
  5127. **/
  5128. sortByOrder<T>(
  5129. collection: List<T>,
  5130. iteratees: (ListIterator<T, any>|string|Object)[],
  5131. orders?: string[]): T[];
  5132. }
  5133. interface LoDashImplicitArrayWrapper<T> {
  5134. /**
  5135. * @see _.sortByOrder
  5136. **/
  5137. sortByOrder(
  5138. iteratees: (ListIterator<T, any>|string|Object)[],
  5139. orders?: boolean[]): LoDashImplicitArrayWrapper<T>;
  5140. /**
  5141. * @see _.sortByOrder
  5142. **/
  5143. sortByOrder(
  5144. iteratees: (ListIterator<T, any>|string|Object)[],
  5145. orders?: string[]): LoDashImplicitArrayWrapper<T>;
  5146. }
  5147. //_.where
  5148. interface LoDashStatic {
  5149. /**
  5150. * Performs a deep comparison of each element in a collection to the given properties
  5151. * object, returning an array of all elements that have equivalent property values.
  5152. * @param collection The collection to iterate over.
  5153. * @param properties The object of property values to filter by.
  5154. * @return A new array of elements that have the given properties.
  5155. **/
  5156. where<T, U extends {}>(
  5157. list: Array<T>,
  5158. properties: U): T[];
  5159. /**
  5160. * @see _.where
  5161. **/
  5162. where<T, U extends {}>(
  5163. list: List<T>,
  5164. properties: U): T[];
  5165. /**
  5166. * @see _.where
  5167. **/
  5168. where<T, U extends {}>(
  5169. list: Dictionary<T>,
  5170. properties: U): T[];
  5171. }
  5172. interface LoDashImplicitArrayWrapper<T> {
  5173. /**
  5174. * @see _.where
  5175. **/
  5176. where<U extends {}>(properties: U): LoDashImplicitArrayWrapper<T>;
  5177. }
  5178. /********
  5179. * Date *
  5180. ********/
  5181. //_.now
  5182. interface LoDashStatic {
  5183. /**
  5184. * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC).
  5185. *
  5186. * @return The number of milliseconds.
  5187. */
  5188. now(): number;
  5189. }
  5190. interface LoDashImplicitWrapperBase<T, TWrapper> {
  5191. /**
  5192. * @see _.now
  5193. */
  5194. now(): number;
  5195. }
  5196. interface LoDashExplicitWrapperBase<T, TWrapper> {
  5197. /**
  5198. * @see _.now
  5199. */
  5200. now(): LoDashExplicitWrapper<number>;
  5201. }
  5202. /*************
  5203. * Functions *
  5204. *************/
  5205. //_.after
  5206. interface LoDashStatic {
  5207. /**
  5208. * Creates a function that executes func, with the this binding and arguments of the
  5209. * created function, only after being called n times.
  5210. * @param n The number of times the function must be called before func is executed.
  5211. * @param func The function to restrict.
  5212. * @return The new restricted function.
  5213. **/
  5214. after(
  5215. n: number,
  5216. func: Function): Function;
  5217. }
  5218. interface LoDashImplicitWrapper<T> {
  5219. /**
  5220. * @see _.after
  5221. **/
  5222. after(func: Function): LoDashImplicitObjectWrapper<Function>;
  5223. }
  5224. //_.ary
  5225. interface LoDashStatic {
  5226. /**
  5227. * Creates a function that accepts up to n arguments ignoring any additional arguments.
  5228. * @param func The function to cap arguments for.
  5229. * @param n The arity cap.
  5230. * @param guard Enables use as a callback for functions like `_.map`.
  5231. * @returns Returns the new function.
  5232. */
  5233. ary<TResult extends Function>(func: Function, n?: number, guard?: Object): TResult;
  5234. }
  5235. interface LoDashImplicitObjectWrapper<T> {
  5236. /**
  5237. * @see _.ary
  5238. */
  5239. ary<TResult extends Function>(n?: number, guard?: Object): LoDashImplicitObjectWrapper<TResult>;
  5240. }
  5241. //_.backflow
  5242. interface LoDashStatic {
  5243. /**
  5244. * @see _.flowRight
  5245. */
  5246. backflow<TResult extends Function>(...funcs: Function[]): TResult;
  5247. }
  5248. interface LoDashImplicitObjectWrapper<T> {
  5249. /**
  5250. * @see _.flowRight
  5251. **/
  5252. backflow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5253. }
  5254. //_.before
  5255. interface LoDashStatic {
  5256. /**
  5257. * Creates a function that invokes func, with the this binding and arguments of the created function, while
  5258. * it is called less than n times. Subsequent calls to the created function return the result of the last func
  5259. * invocation.
  5260. * @param n The number of calls at which func is no longer invoked.
  5261. * @param func The function to restrict.
  5262. * @return Returns the new restricted function.
  5263. */
  5264. before<TFunc extends Function>(n: number, func: TFunc): TFunc;
  5265. }
  5266. interface LoDashImplicitWrapper<T> {
  5267. /**
  5268. * @sed _.before
  5269. */
  5270. before<TFunc extends Function>(func: TFunc): TFunc;
  5271. }
  5272. //_.bind
  5273. interface LoDashStatic {
  5274. /**
  5275. * Creates a function that, when called, invokes func with the this binding of thisArg
  5276. * and prepends any additional bind arguments to those provided to the bound function.
  5277. * @param func The function to bind.
  5278. * @param thisArg The this binding of func.
  5279. * @param args Arguments to be partially applied.
  5280. * @return The new bound function.
  5281. **/
  5282. bind(
  5283. func: Function,
  5284. thisArg: any,
  5285. ...args: any[]): (...args: any[]) => any;
  5286. }
  5287. interface LoDashImplicitObjectWrapper<T> {
  5288. /**
  5289. * @see _.bind
  5290. **/
  5291. bind(
  5292. thisArg: any,
  5293. ...args: any[]): LoDashImplicitObjectWrapper<(...args: any[]) => any>;
  5294. }
  5295. //_.bindAll
  5296. interface LoDashStatic {
  5297. /**
  5298. * Binds methods of an object to the object itself, overwriting the existing method. Method
  5299. * names may be specified as individual arguments or as arrays of method names. If no method
  5300. * names are provided all the function properties of object will be bound.
  5301. * @param object The object to bind and assign the bound methods to.
  5302. * @param methodNames The object method names to bind, specified as individual method names
  5303. * or arrays of method names.
  5304. * @return object
  5305. **/
  5306. bindAll<T>(
  5307. object: T,
  5308. ...methodNames: string[]): T;
  5309. }
  5310. interface LoDashImplicitObjectWrapper<T> {
  5311. /**
  5312. * @see _.bindAll
  5313. **/
  5314. bindAll(...methodNames: string[]): LoDashImplicitWrapper<T>;
  5315. }
  5316. //_.bindKey
  5317. interface LoDashStatic {
  5318. /**
  5319. * Creates a function that, when called, invokes the method at object[key] and prepends any
  5320. * additional bindKey arguments to those provided to the bound function. This method differs
  5321. * from _.bind by allowing bound functions to reference methods that will be redefined or don't
  5322. * yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
  5323. * @param object The object the method belongs to.
  5324. * @param key The key of the method.
  5325. * @param args Arguments to be partially applied.
  5326. * @return The new bound function.
  5327. **/
  5328. bindKey<T>(
  5329. object: T,
  5330. key: string,
  5331. ...args: any[]): Function;
  5332. }
  5333. interface LoDashImplicitObjectWrapper<T> {
  5334. /**
  5335. * @see _.bindKey
  5336. **/
  5337. bindKey(
  5338. key: string,
  5339. ...args: any[]): LoDashImplicitObjectWrapper<Function>;
  5340. }
  5341. //_.compose
  5342. interface LoDashStatic {
  5343. /**
  5344. * @see _.flowRight
  5345. */
  5346. compose<TResult extends Function>(...funcs: Function[]): TResult;
  5347. }
  5348. interface LoDashImplicitObjectWrapper<T> {
  5349. /**
  5350. * @see _.flowRight
  5351. */
  5352. compose<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5353. }
  5354. //_.createCallback
  5355. interface LoDashStatic {
  5356. /**
  5357. * Produces a callback bound to an optional thisArg. If func is a property name the created
  5358. * callback will return the property value for a given element. If func is an object the created
  5359. * callback will return true for elements that contain the equivalent object properties,
  5360. * otherwise it will return false.
  5361. * @param func The value to convert to a callback.
  5362. * @param thisArg The this binding of the created callback.
  5363. * @param argCount The number of arguments the callback accepts.
  5364. * @return A callback function.
  5365. **/
  5366. createCallback(
  5367. func: string,
  5368. thisArg?: any,
  5369. argCount?: number): () => any;
  5370. /**
  5371. * @see _.createCallback
  5372. **/
  5373. createCallback(
  5374. func: Dictionary<any>,
  5375. thisArg?: any,
  5376. argCount?: number): () => boolean;
  5377. }
  5378. interface LoDashImplicitWrapper<T> {
  5379. /**
  5380. * @see _.createCallback
  5381. **/
  5382. createCallback(
  5383. thisArg?: any,
  5384. argCount?: number): LoDashImplicitObjectWrapper<() => any>;
  5385. }
  5386. interface LoDashImplicitObjectWrapper<T> {
  5387. /**
  5388. * @see _.createCallback
  5389. **/
  5390. createCallback(
  5391. thisArg?: any,
  5392. argCount?: number): LoDashImplicitObjectWrapper<() => any>;
  5393. }
  5394. //_.curry
  5395. interface LoDashStatic {
  5396. /**
  5397. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5398. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5399. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5400. * @param func The function to curry.
  5401. * @return Returns the new curried function.
  5402. */
  5403. curry<T1, R>(func: (t1: T1) => R):
  5404. CurriedFunction1<T1, R>;
  5405. /**
  5406. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5407. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5408. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5409. * @param func The function to curry.
  5410. * @return Returns the new curried function.
  5411. */
  5412. curry<T1, T2, R>(func: (t1: T1, t2: T2) => R):
  5413. CurriedFunction2<T1, T2, R>;
  5414. /**
  5415. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5416. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5417. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5418. * @param func The function to curry.
  5419. * @return Returns the new curried function.
  5420. */
  5421. curry<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
  5422. CurriedFunction3<T1, T2, T3, R>;
  5423. /**
  5424. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5425. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5426. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5427. * @param func The function to curry.
  5428. * @return Returns the new curried function.
  5429. */
  5430. curry<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
  5431. CurriedFunction4<T1, T2, T3, T4, R>;
  5432. /**
  5433. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5434. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5435. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5436. * @param func The function to curry.
  5437. * @return Returns the new curried function.
  5438. */
  5439. curry<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
  5440. CurriedFunction5<T1, T2, T3, T4, T5, R>;
  5441. /**
  5442. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  5443. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  5444. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  5445. * @param func The function to curry.
  5446. * @param arity The arity of func.
  5447. * @return Returns the new curried function.
  5448. */
  5449. curry<TResult extends Function>(
  5450. func: Function,
  5451. arity?: number): TResult;
  5452. }
  5453. interface CurriedFunction1<T1, R> {
  5454. (): CurriedFunction1<T1, R>;
  5455. (t1: T1): R;
  5456. }
  5457. interface CurriedFunction2<T1, T2, R> {
  5458. (): CurriedFunction2<T1, T2, R>;
  5459. (t1: T1): CurriedFunction1<T2, R>;
  5460. (t1: T1, t2: T2): R;
  5461. }
  5462. interface CurriedFunction3<T1, T2, T3, R> {
  5463. (): CurriedFunction3<T1, T2, T3, R>;
  5464. (t1: T1): CurriedFunction2<T2, T3, R>;
  5465. (t1: T1, t2: T2): CurriedFunction1<T3, R>;
  5466. (t1: T1, t2: T2, t3: T3): R;
  5467. }
  5468. interface CurriedFunction4<T1, T2, T3, T4, R> {
  5469. (): CurriedFunction4<T1, T2, T3, T4, R>;
  5470. (t1: T1): CurriedFunction3<T2, T3, T4, R>;
  5471. (t1: T1, t2: T2): CurriedFunction2<T3, T4, R>;
  5472. (t1: T1, t2: T2, t3: T3): CurriedFunction1<T4, R>;
  5473. (t1: T1, t2: T2, t3: T3, t4: T4): R;
  5474. }
  5475. interface CurriedFunction5<T1, T2, T3, T4, T5, R> {
  5476. (): CurriedFunction5<T1, T2, T3, T4, T5, R>;
  5477. (t1: T1): CurriedFunction4<T2, T3, T4, T5, R>;
  5478. (t1: T1, t2: T2): CurriedFunction3<T3, T4, T5, R>;
  5479. (t1: T1, t2: T2, t3: T3): CurriedFunction2<T4, T5, R>;
  5480. (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1<T5, R>;
  5481. (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R;
  5482. }
  5483. interface LoDashImplicitObjectWrapper<T> {
  5484. /**
  5485. * @see _.curry
  5486. **/
  5487. curry<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
  5488. }
  5489. //_.curryRight
  5490. interface LoDashStatic {
  5491. /**
  5492. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5493. * instead of _.partial.
  5494. * @param func The function to curry.
  5495. * @return Returns the new curried function.
  5496. */
  5497. curryRight<T1, R>(func: (t1: T1) => R):
  5498. CurriedFunction1<T1, R>;
  5499. /**
  5500. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5501. * instead of _.partial.
  5502. * @param func The function to curry.
  5503. * @return Returns the new curried function.
  5504. */
  5505. curryRight<T1, T2, R>(func: (t1: T1, t2: T2) => R):
  5506. CurriedFunction2<T2, T1, R>;
  5507. /**
  5508. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5509. * instead of _.partial.
  5510. * @param func The function to curry.
  5511. * @return Returns the new curried function.
  5512. */
  5513. curryRight<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
  5514. CurriedFunction3<T3, T2, T1, R>;
  5515. /**
  5516. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5517. * instead of _.partial.
  5518. * @param func The function to curry.
  5519. * @return Returns the new curried function.
  5520. */
  5521. curryRight<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
  5522. CurriedFunction4<T4, T3, T2, T1, R>;
  5523. /**
  5524. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5525. * instead of _.partial.
  5526. * @param func The function to curry.
  5527. * @return Returns the new curried function.
  5528. */
  5529. curryRight<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
  5530. CurriedFunction5<T5, T4, T3, T2, T1, R>;
  5531. /**
  5532. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  5533. * instead of _.partial.
  5534. * @param func The function to curry.
  5535. * @param arity The arity of func.
  5536. * @return Returns the new curried function.
  5537. */
  5538. curryRight<TResult extends Function>(
  5539. func: Function,
  5540. arity?: number): TResult;
  5541. }
  5542. interface LoDashImplicitObjectWrapper<T> {
  5543. /**
  5544. * @see _.curryRight
  5545. **/
  5546. curryRight<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
  5547. }
  5548. //_.debounce
  5549. interface LoDashStatic {
  5550. /**
  5551. * Creates a function that will delay the execution of func until after wait milliseconds have
  5552. * elapsed since the last time it was invoked. Provide an options object to indicate that func
  5553. * should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls
  5554. * to the debounced function will return the result of the last func call.
  5555. *
  5556. * Note: If leading and trailing options are true func will be called on the trailing edge of
  5557. * the timeout only if the the debounced function is invoked more than once during the wait
  5558. * timeout.
  5559. * @param func The function to debounce.
  5560. * @param wait The number of milliseconds to delay.
  5561. * @param options The options object.
  5562. * @param options.leading Specify execution on the leading edge of the timeout.
  5563. * @param options.maxWait The maximum time func is allowed to be delayed before it's called.
  5564. * @param options.trailing Specify execution on the trailing edge of the timeout.
  5565. * @return The new debounced function.
  5566. **/
  5567. debounce<T extends Function>(
  5568. func: T,
  5569. wait: number,
  5570. options?: DebounceSettings): T;
  5571. }
  5572. interface LoDashImplicitObjectWrapper<T> {
  5573. /**
  5574. * @see _.debounce
  5575. **/
  5576. debounce(
  5577. wait: number,
  5578. options?: DebounceSettings): LoDashImplicitObjectWrapper<Function>;
  5579. }
  5580. interface DebounceSettings {
  5581. /**
  5582. * Specify execution on the leading edge of the timeout.
  5583. **/
  5584. leading?: boolean;
  5585. /**
  5586. * The maximum time func is allowed to be delayed before it's called.
  5587. **/
  5588. maxWait?: number;
  5589. /**
  5590. * Specify execution on the trailing edge of the timeout.
  5591. **/
  5592. trailing?: boolean;
  5593. }
  5594. //_.defer
  5595. interface LoDashStatic {
  5596. /**
  5597. * Defers executing the func function until the current call stack has cleared. Additional
  5598. * arguments will be provided to func when it is invoked.
  5599. * @param func The function to defer.
  5600. * @param args Arguments to invoke the function with.
  5601. * @return The timer id.
  5602. **/
  5603. defer(
  5604. func: Function,
  5605. ...args: any[]): number;
  5606. }
  5607. interface LoDashImplicitObjectWrapper<T> {
  5608. /**
  5609. * @see _.defer
  5610. **/
  5611. defer(...args: any[]): LoDashImplicitWrapper<number>;
  5612. }
  5613. //_.delay
  5614. interface LoDashStatic {
  5615. /**
  5616. * Executes the func function after wait milliseconds. Additional arguments will be provided
  5617. * to func when it is invoked.
  5618. * @param func The function to delay.
  5619. * @param wait The number of milliseconds to delay execution.
  5620. * @param args Arguments to invoke the function with.
  5621. * @return The timer id.
  5622. **/
  5623. delay(
  5624. func: Function,
  5625. wait: number,
  5626. ...args: any[]): number;
  5627. }
  5628. interface LoDashImplicitObjectWrapper<T> {
  5629. /**
  5630. * @see _.delay
  5631. **/
  5632. delay(
  5633. wait: number,
  5634. ...args: any[]): LoDashImplicitWrapper<number>;
  5635. }
  5636. //_.flow
  5637. interface LoDashStatic {
  5638. /**
  5639. * Creates a function that returns the result of invoking the provided functions with the this binding of the
  5640. * created function, where each successive invocation is supplied the return value of the previous.
  5641. * @param funcs Functions to invoke.
  5642. * @return Returns the new function.
  5643. */
  5644. flow<TResult extends Function>(...funcs: Function[]): TResult;
  5645. }
  5646. interface LoDashImplicitObjectWrapper<T> {
  5647. /**
  5648. * @see _.flow
  5649. **/
  5650. flow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5651. }
  5652. //_.flowRight
  5653. interface LoDashStatic {
  5654. /**
  5655. * This method is like _.flow except that it creates a function that invokes the provided functions from right
  5656. * to left.
  5657. * @param funcs Functions to invoke.
  5658. * @return Returns the new function.
  5659. */
  5660. flowRight<TResult extends Function>(...funcs: Function[]): TResult;
  5661. }
  5662. interface LoDashImplicitObjectWrapper<T> {
  5663. /**
  5664. * @see _.flowRight
  5665. **/
  5666. flowRight<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5667. }
  5668. //_.memoize
  5669. interface MemoizedFunction extends Function {
  5670. cache: MapCache;
  5671. }
  5672. interface LoDashStatic {
  5673. /**
  5674. * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for
  5675. * storing the result based on the arguments provided to the memoized function. By default, the first argument
  5676. * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with
  5677. * the this binding of the memoized function.
  5678. * @param func The function to have its output memoized.
  5679. * @param resolver The function to resolve the cache key.
  5680. * @return Returns the new memoizing function.
  5681. */
  5682. memoize<TResult extends MemoizedFunction>(
  5683. func: Function,
  5684. resolver?: Function): TResult;
  5685. }
  5686. interface LoDashImplicitObjectWrapper<T> {
  5687. /**
  5688. * @see _.memoize
  5689. */
  5690. memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashImplicitObjectWrapper<TResult>;
  5691. }
  5692. //_.modArgs
  5693. interface LoDashStatic {
  5694. /**
  5695. * Creates a function that runs each argument through a corresponding transform function.
  5696. * @param func The function to wrap.
  5697. * @param transforms The functions to transform arguments, specified as individual functions or arrays
  5698. * of functions.
  5699. * @return Returns the new function.
  5700. */
  5701. modArgs<T extends Function, TResult extends Function>(
  5702. func: T,
  5703. ...transforms: Function[]
  5704. ): TResult;
  5705. /**
  5706. * @see _.modArgs
  5707. */
  5708. modArgs<T extends Function, TResult extends Function>(
  5709. func: T,
  5710. transforms: Function[]
  5711. ): TResult;
  5712. }
  5713. interface LoDashImplicitObjectWrapper<T> {
  5714. /**
  5715. * @see _.modArgs
  5716. */
  5717. modArgs<TResult extends Function>(...transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5718. /**
  5719. * @see _.modArgs
  5720. */
  5721. modArgs<TResult extends Function>(transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
  5722. }
  5723. //_.negate
  5724. interface LoDashStatic {
  5725. /**
  5726. * Creates a function that negates the result of the predicate func. The func predicate is invoked with
  5727. * the this binding and arguments of the created function.
  5728. * @param predicate The predicate to negate.
  5729. * @return Returns the new function.
  5730. */
  5731. negate<T extends Function>(predicate: T): (...args: any[]) => boolean;
  5732. /**
  5733. * @see _.negate
  5734. */
  5735. negate<T extends Function, TResult extends Function>(predicate: T): TResult;
  5736. }
  5737. interface LoDashImplicitObjectWrapper<T> {
  5738. /**
  5739. * @see _.negate
  5740. */
  5741. negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
  5742. /**
  5743. * @see _.negate
  5744. */
  5745. negate<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
  5746. }
  5747. //_.once
  5748. interface LoDashStatic {
  5749. /**
  5750. * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value
  5751. * of the first call. The func is invoked with the this binding and arguments of the created function.
  5752. * @param func The function to restrict.
  5753. * @return Returns the new restricted function.
  5754. */
  5755. once<T extends Function>(func: T): T;
  5756. }
  5757. interface LoDashImplicitObjectWrapper<T> {
  5758. /**
  5759. * @see _.once
  5760. */
  5761. once(): LoDashImplicitObjectWrapper<T>;
  5762. }
  5763. //_.partial
  5764. interface LoDashStatic {
  5765. /**
  5766. * Creates a function that, when called, invokes func with any additional partial arguments
  5767. * prepended to those provided to the new function. This method is similar to _.bind except
  5768. * it does not alter the this binding.
  5769. * @param func The function to partially apply arguments to.
  5770. * @param args Arguments to be partially applied.
  5771. * @return The new partially applied function.
  5772. **/
  5773. partial: Partial;
  5774. }
  5775. type PH = LoDashStatic;
  5776. type Function0<R> = () => R;
  5777. type Function1<T1, R> = (t1: T1) => R;
  5778. type Function2<T1, T2, R> = (t1: T1, t2: T2) => R;
  5779. type Function3<T1, T2, T3, R> = (t1: T1, t2: T2, t3: T3) => R;
  5780. type Function4<T1, T2, T3, T4, R> = (t1: T1, t2: T2, t3: T3, t4: T4) => R;
  5781. interface Partial {
  5782. // arity 0
  5783. <R>(func: Function0<R>): Function0<R>;
  5784. // arity 1
  5785. <T1, R>(func: Function1<T1, R>): Function1<T1, R>;
  5786. <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
  5787. // arity 2
  5788. <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
  5789. <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1): Function1< T2, R>;
  5790. <T1, T2, R>(func: Function2<T1, T2, R>, plc1: PH, arg2: T2): Function1<T1, R>;
  5791. <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
  5792. // arity 3
  5793. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
  5794. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1): Function2< T2, T3, R>;
  5795. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2): Function2<T1, T3, R>;
  5796. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2): Function1< T3, R>;
  5797. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, plc2: PH, arg3: T3): Function2<T1, T2, R>;
  5798. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
  5799. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2, arg3: T3): Function1<T1, R>;
  5800. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
  5801. // arity 4
  5802. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
  5803. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1): Function3< T2, T3, T4, R>;
  5804. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2): Function3<T1, T3, T4, R>;
  5805. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2): Function2< T3, T4, R>;
  5806. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3): Function3<T1, T2, T4, R>;
  5807. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>;
  5808. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3): Function2<T1, T4, R>;
  5809. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>;
  5810. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3<T1, T2, T3, R>;
  5811. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
  5812. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
  5813. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
  5814. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2<T1, T2, R>;
  5815. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
  5816. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
  5817. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
  5818. // catch-all
  5819. (func: Function, ...args: any[]): Function;
  5820. }
  5821. //_.partialRight
  5822. interface LoDashStatic {
  5823. /**
  5824. * This method is like _.partial except that partial arguments are appended to those provided
  5825. * to the new function.
  5826. * @param func The function to partially apply arguments to.
  5827. * @param args Arguments to be partially applied.
  5828. * @return The new partially applied function.
  5829. **/
  5830. partialRight: PartialRight
  5831. }
  5832. interface PartialRight {
  5833. // arity 0
  5834. <R>(func: Function0<R>): Function0<R>;
  5835. // arity 1
  5836. <T1, R>(func: Function1<T1, R>): Function1<T1, R>;
  5837. <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
  5838. // arity 2
  5839. <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
  5840. <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, plc2: PH): Function1< T2, R>;
  5841. <T1, T2, R>(func: Function2<T1, T2, R>, arg2: T2): Function1<T1, R>;
  5842. <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
  5843. // arity 3
  5844. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
  5845. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>;
  5846. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, plc3: PH): Function2<T1, T3, R>;
  5847. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>;
  5848. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg3: T3): Function2<T1, T2, R>;
  5849. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
  5850. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, arg3: T3): Function1<T1, R>;
  5851. <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
  5852. // arity 4
  5853. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
  5854. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>;
  5855. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, plc4: PH): Function3<T1, T3, T4, R>;
  5856. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>;
  5857. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, plc4: PH): Function3<T1, T2, T4, R>;
  5858. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>;
  5859. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, plc4: PH): Function2<T1, T4, R>;
  5860. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>;
  5861. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg4: T4): Function3<T1, T2, T3, R>;
  5862. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
  5863. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
  5864. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
  5865. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, arg4: T4): Function2<T1, T2, R>;
  5866. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
  5867. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
  5868. <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
  5869. // catch-all
  5870. (func: Function, ...args: any[]): Function;
  5871. }
  5872. //_.rearg
  5873. interface LoDashStatic {
  5874. /**
  5875. * Creates a function that invokes func with arguments arranged according to the specified indexes where the
  5876. * argument value at the first index is provided as the first argument, the argument value at the second index
  5877. * is provided as the second argument, and so on.
  5878. * @param func The function to rearrange arguments for.
  5879. * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes.
  5880. * @return Returns the new function.
  5881. */
  5882. rearg<TResult extends Function>(func: Function, indexes: number[]): TResult;
  5883. /**
  5884. * @see _.rearg
  5885. */
  5886. rearg<TResult extends Function>(func: Function, ...indexes: number[]): TResult;
  5887. }
  5888. interface LoDashImplicitObjectWrapper<T> {
  5889. /**
  5890. * @see _.rearg
  5891. */
  5892. rearg<TResult extends Function>(indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
  5893. /**
  5894. * @see _.rearg
  5895. */
  5896. rearg<TResult extends Function>(...indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
  5897. }
  5898. //_.restParam
  5899. interface LoDashStatic {
  5900. /**
  5901. * Creates a function that invokes func with the this binding of the created function and arguments from start
  5902. * and beyond provided as an array.
  5903. * @param func The function to apply a rest parameter to.
  5904. * @param start The start position of the rest parameter.
  5905. * @return Returns the new function.
  5906. */
  5907. restParam<TResult extends Function>(func: Function, start?: number): TResult;
  5908. /**
  5909. * @see _.restParam
  5910. */
  5911. restParam<TResult extends Function, TFunc extends Function>(func: TFunc, start?: number): TResult;
  5912. }
  5913. interface LoDashImplicitObjectWrapper<T> {
  5914. /**
  5915. * @see _.restParam
  5916. */
  5917. restParam<TResult extends Function>(start?: number): LoDashImplicitObjectWrapper<TResult>;
  5918. }
  5919. //_.spread
  5920. interface LoDashStatic {
  5921. /**
  5922. * Creates a function that invokes func with the this binding of the created function and an array of arguments
  5923. * much like Function#apply.
  5924. * @param func The function to spread arguments over.
  5925. * @return Returns the new function.
  5926. */
  5927. spread<TResult extends Function>(func: Function): TResult;
  5928. }
  5929. interface LoDashImplicitObjectWrapper<T> {
  5930. /**
  5931. * @see _.spread
  5932. */
  5933. spread<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
  5934. }
  5935. //_.throttle
  5936. interface LoDashStatic {
  5937. /**
  5938. * Creates a function that, when executed, will only call the func function at most once per
  5939. * every wait milliseconds. Provide an options object to indicate that func should be invoked
  5940. * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled
  5941. * function will return the result of the last func call.
  5942. *
  5943. * Note: If leading and trailing options are true func will be called on the trailing edge of
  5944. * the timeout only if the the throttled function is invoked more than once during the wait timeout.
  5945. * @param func The function to throttle.
  5946. * @param wait The number of milliseconds to throttle executions to.
  5947. * @param options The options object.
  5948. * @param options.leading Specify execution on the leading edge of the timeout.
  5949. * @param options.trailing Specify execution on the trailing edge of the timeout.
  5950. * @return The new throttled function.
  5951. **/
  5952. throttle<T extends Function>(
  5953. func: T,
  5954. wait: number,
  5955. options?: ThrottleSettings): T;
  5956. }
  5957. interface ThrottleSettings {
  5958. /**
  5959. * If you'd like to disable the leading-edge call, pass this as false.
  5960. **/
  5961. leading?: boolean;
  5962. /**
  5963. * If you'd like to disable the execution on the trailing-edge, pass false.
  5964. **/
  5965. trailing?: boolean;
  5966. }
  5967. //_.wrap
  5968. interface LoDashStatic {
  5969. /**
  5970. * Creates a function that provides value to the wrapper function as its first argument.
  5971. * Additional arguments provided to the function are appended to those provided to the
  5972. * wrapper function. The wrapper is executed with the this binding of the created function.
  5973. * @param value The value to wrap.
  5974. * @param wrapper The wrapper function.
  5975. * @return The new function.
  5976. **/
  5977. wrap(
  5978. value: any,
  5979. wrapper: (func: Function, ...args: any[]) => any): Function;
  5980. }
  5981. /********
  5982. * Lang *
  5983. ********/
  5984. //_.clone
  5985. interface LoDashStatic {
  5986. /**
  5987. * Creates a clone of value. If isDeep is true nested objects are cloned, otherwise they are assigned by
  5988. * reference. If customizer is provided it’s invoked to produce the cloned values. If customizer returns
  5989. * undefined cloning is handled by the method instead. The customizer is bound to thisArg and invoked with up
  5990. * to three argument; (value [, index|key, object]).
  5991. * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
  5992. * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
  5993. * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
  5994. * @param value The value to clone.
  5995. * @param isDeep Specify a deep clone.
  5996. * @param customizer The function to customize cloning values.
  5997. * @param thisArg The this binding of customizer.
  5998. * @return Returns the cloned value.
  5999. */
  6000. clone<T>(
  6001. value: T,
  6002. isDeep?: boolean,
  6003. customizer?: (value: any) => any,
  6004. thisArg?: any): T;
  6005. /**
  6006. * @see _.clone
  6007. */
  6008. clone<T>(
  6009. value: T,
  6010. customizer?: (value: any) => any,
  6011. thisArg?: any): T;
  6012. }
  6013. interface LoDashImplicitWrapper<T> {
  6014. /**
  6015. * @see _.clone
  6016. */
  6017. clone(
  6018. isDeep?: boolean,
  6019. customizer?: (value: any) => any,
  6020. thisArg?: any): T;
  6021. /**
  6022. * @see _.clone
  6023. */
  6024. clone(
  6025. customizer?: (value: any) => any,
  6026. thisArg?: any): T;
  6027. }
  6028. interface LoDashImplicitArrayWrapper<T> {
  6029. /**
  6030. * @see _.clone
  6031. */
  6032. clone(
  6033. isDeep?: boolean,
  6034. customizer?: (value: any) => any,
  6035. thisArg?: any): T[];
  6036. /**
  6037. * @see _.clone
  6038. */
  6039. clone(
  6040. customizer?: (value: any) => any,
  6041. thisArg?: any): T[];
  6042. }
  6043. interface LoDashImplicitObjectWrapper<T> {
  6044. /**
  6045. * @see _.clone
  6046. */
  6047. clone(
  6048. isDeep?: boolean,
  6049. customizer?: (value: any) => any,
  6050. thisArg?: any): T;
  6051. /**
  6052. * @see _.clone
  6053. */
  6054. clone(
  6055. customizer?: (value: any) => any,
  6056. thisArg?: any): T;
  6057. }
  6058. //_.cloneDeep
  6059. interface LoDashStatic {
  6060. /**
  6061. * Creates a deep clone of value. If customizer is provided it’s invoked to produce the cloned values. If
  6062. * customizer returns undefined cloning is handled by the method instead. The customizer is bound to thisArg
  6063. * and invoked with up to three argument; (value [, index|key, object]).
  6064. * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
  6065. * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
  6066. * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
  6067. * @param value The value to deep clone.
  6068. * @param customizer The function to customize cloning values.
  6069. * @param thisArg The this binding of customizer.
  6070. * @return Returns the deep cloned value.
  6071. */
  6072. cloneDeep<T>(
  6073. value: T,
  6074. customizer?: (value: any) => any,
  6075. thisArg?: any): T;
  6076. }
  6077. interface LoDashImplicitWrapper<T> {
  6078. /**
  6079. * @see _.cloneDeep
  6080. */
  6081. cloneDeep(
  6082. customizer?: (value: any) => any,
  6083. thisArg?: any): T;
  6084. }
  6085. interface LoDashImplicitArrayWrapper<T> {
  6086. /**
  6087. * @see _.cloneDeep
  6088. */
  6089. cloneDeep(
  6090. customizer?: (value: any) => any,
  6091. thisArg?: any): T[];
  6092. }
  6093. interface LoDashImplicitObjectWrapper<T> {
  6094. /**
  6095. * @see _.cloneDeep
  6096. */
  6097. cloneDeep(
  6098. customizer?: (value: any) => any,
  6099. thisArg?: any): T;
  6100. }
  6101. //_.eq
  6102. interface LoDashStatic {
  6103. /**
  6104. * @see _.isEqual
  6105. */
  6106. eq(
  6107. value: any,
  6108. other: any,
  6109. customizer?: IsEqualCustomizer,
  6110. thisArg?: any
  6111. ): boolean;
  6112. }
  6113. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6114. /**
  6115. * @see _.isEqual
  6116. */
  6117. eq(
  6118. other: any,
  6119. customizer?: IsEqualCustomizer,
  6120. thisArg?: any
  6121. ): boolean;
  6122. }
  6123. //_.gt
  6124. interface LoDashStatic {
  6125. /**
  6126. * Checks if value is greater than other.
  6127. * @param value The value to compare.
  6128. * @param other The other value to compare.
  6129. * @return Returns true if value is greater than other, else false.
  6130. */
  6131. gt(value: any, other: any): boolean;
  6132. }
  6133. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6134. /**
  6135. * @see _.gt
  6136. */
  6137. gt(other: any): boolean;
  6138. }
  6139. //_.gte
  6140. interface LoDashStatic {
  6141. /**
  6142. * Checks if value is greater than or equal to other.
  6143. * @param value The value to compare.
  6144. * @param other The other value to compare.
  6145. * @return Returns true if value is greater than or equal to other, else false.
  6146. */
  6147. gte(value: any, other: any): boolean;
  6148. }
  6149. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6150. /**
  6151. * @see _.gte
  6152. */
  6153. gte(other: any): boolean;
  6154. }
  6155. //_.isArguments
  6156. interface LoDashStatic {
  6157. /**
  6158. * Checks if value is classified as an arguments object.
  6159. * @param value The value to check.
  6160. * @return Returns true if value is correctly classified, else false.
  6161. */
  6162. isArguments(value?: any): boolean;
  6163. }
  6164. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6165. /**
  6166. * @see _.isArguments
  6167. */
  6168. isArguments(): boolean;
  6169. }
  6170. //_.isArray
  6171. interface LoDashStatic {
  6172. /**
  6173. * Checks if value is classified as an Array object.
  6174. * @param value The value to check.
  6175. * @return Returns true if value is correctly classified, else false.
  6176. **/
  6177. isArray(value?: any): boolean;
  6178. }
  6179. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6180. /**
  6181. * @see _.isArray
  6182. */
  6183. isArray(): boolean;
  6184. }
  6185. //_.isBoolean
  6186. interface LoDashStatic {
  6187. /**
  6188. * Checks if value is classified as a boolean primitive or object.
  6189. * @param value The value to check.
  6190. * @return Returns true if value is correctly classified, else false.
  6191. **/
  6192. isBoolean(value?: any): boolean;
  6193. }
  6194. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6195. /**
  6196. * @see _.isBoolean
  6197. */
  6198. isBoolean(): boolean;
  6199. }
  6200. //_.isDate
  6201. interface LoDashStatic {
  6202. /**
  6203. * Checks if value is classified as a Date object.
  6204. * @param value The value to check.
  6205. * @return Returns true if value is correctly classified, else false.
  6206. **/
  6207. isDate(value?: any): boolean;
  6208. }
  6209. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6210. /**
  6211. * @see _.isDate
  6212. */
  6213. isDate(): boolean;
  6214. }
  6215. //_.isElement
  6216. interface LoDashStatic {
  6217. /**
  6218. * Checks if value is a DOM element.
  6219. * @param value The value to check.
  6220. * @return Returns true if value is a DOM element, else false.
  6221. */
  6222. isElement(value?: any): boolean;
  6223. }
  6224. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6225. /**
  6226. * @see _.isElement
  6227. */
  6228. isElement(): boolean;
  6229. }
  6230. //_.isEmpty
  6231. interface LoDashStatic {
  6232. /**
  6233. * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
  6234. * jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
  6235. * @param value The value to inspect.
  6236. * @return Returns true if value is empty, else false.
  6237. **/
  6238. isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
  6239. }
  6240. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6241. /**
  6242. * @see _.isEmpty
  6243. */
  6244. isEmpty(): boolean;
  6245. }
  6246. //_.isEqual
  6247. interface IsEqualCustomizer {
  6248. (value: any, other: any, indexOrKey?: number|string): boolean;
  6249. }
  6250. interface LoDashStatic {
  6251. /**
  6252. * Performs a deep comparison between two values to determine if they are equivalent. If customizer is
  6253. * provided it’s invoked to compare values. If customizer returns undefined comparisons are handled by the
  6254. * method instead. The customizer is bound to thisArg and invoked with up to three arguments: (value, other
  6255. * [, index|key]).
  6256. *
  6257. * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes,
  6258. * and strings. Objects are compared by their own, not inherited, enumerable properties. Functions and DOM
  6259. * nodes are not supported. Provide a customizer function to extend support for comparing other values.
  6260. *
  6261. * @alias _.eq
  6262. *
  6263. * @param value The value to compare.
  6264. * @param other The other value to compare.
  6265. * @param customizer The function to customize value comparisons.
  6266. * @param thisArg The this binding of customizer.
  6267. * @return Returns true if the values are equivalent, else false.
  6268. */
  6269. isEqual(
  6270. value: any,
  6271. other: any,
  6272. customizer?: IsEqualCustomizer,
  6273. thisArg?: any
  6274. ): boolean;
  6275. }
  6276. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6277. /**
  6278. * @see _.isEqual
  6279. */
  6280. isEqual(
  6281. other: any,
  6282. customizer?: IsEqualCustomizer,
  6283. thisArg?: any
  6284. ): boolean;
  6285. }
  6286. //_.isError
  6287. interface LoDashStatic {
  6288. /**
  6289. * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
  6290. * object.
  6291. * @param value The value to check.
  6292. * @return Returns true if value is an error object, else false.
  6293. */
  6294. isError(value: any): boolean;
  6295. }
  6296. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6297. /**
  6298. * @see _.isError
  6299. */
  6300. isError(): boolean;
  6301. }
  6302. //_.isFinite
  6303. interface LoDashStatic {
  6304. /**
  6305. * Checks if value is a finite primitive number.
  6306. * Note: This method is based on Number.isFinite.
  6307. * @param value The value to check.
  6308. * @return Returns true if value is a finite number, else false.
  6309. **/
  6310. isFinite(value?: any): boolean;
  6311. }
  6312. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6313. /**
  6314. * @see _.isFinite
  6315. */
  6316. isFinite(): boolean;
  6317. }
  6318. //_.isFunction
  6319. interface LoDashStatic {
  6320. /**
  6321. * Checks if value is classified as a Function object.
  6322. * @param value The value to check.
  6323. * @return Returns true if value is correctly classified, else false.
  6324. **/
  6325. isFunction(value?: any): boolean;
  6326. }
  6327. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6328. /**
  6329. * @see _.isFunction
  6330. */
  6331. isFunction(): boolean;
  6332. }
  6333. //_.isMatch
  6334. interface isMatchCustomizer {
  6335. (value: any, other: any, indexOrKey?: number|string): boolean;
  6336. }
  6337. interface LoDashStatic {
  6338. /**
  6339. * Performs a deep comparison between object and source to determine if object contains equivalent property
  6340. * values. If customizer is provided it’s invoked to compare values. If customizer returns undefined
  6341. * comparisons are handled by the method instead. The customizer is bound to thisArg and invoked with three
  6342. * arguments: (value, other, index|key).
  6343. * @param object The object to inspect.
  6344. * @param source The object of property values to match.
  6345. * @param customizer The function to customize value comparisons.
  6346. * @param thisArg The this binding of customizer.
  6347. * @return Returns true if object is a match, else false.
  6348. */
  6349. isMatch(object: Object, source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
  6350. }
  6351. interface LoDashImplicitObjectWrapper<T> {
  6352. /**
  6353. * @see _.isMatch
  6354. */
  6355. isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
  6356. }
  6357. //_.isNaN
  6358. interface LoDashStatic {
  6359. /**
  6360. * Checks if value is NaN.
  6361. * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
  6362. * @param value The value to check.
  6363. * @return Returns true if value is NaN, else false.
  6364. */
  6365. isNaN(value?: any): boolean;
  6366. }
  6367. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6368. /**
  6369. * @see _.isNaN
  6370. */
  6371. isNaN(): boolean;
  6372. }
  6373. //_.isNative
  6374. interface LoDashStatic {
  6375. /**
  6376. * Checks if value is a native function.
  6377. * @param value The value to check.
  6378. * @retrun Returns true if value is a native function, else false.
  6379. */
  6380. isNative(value: any): boolean;
  6381. }
  6382. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6383. /**
  6384. * see _.isNative
  6385. */
  6386. isNative(): boolean;
  6387. }
  6388. //_.isNull
  6389. interface LoDashStatic {
  6390. /**
  6391. * Checks if value is null.
  6392. * @param value The value to check.
  6393. * @return Returns true if value is null, else false.
  6394. **/
  6395. isNull(value?: any): boolean;
  6396. }
  6397. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6398. /**
  6399. * see _.isNull
  6400. */
  6401. isNull(): boolean;
  6402. }
  6403. //_.isNumber
  6404. interface LoDashStatic {
  6405. /**
  6406. * Checks if value is classified as a Number primitive or object.
  6407. * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
  6408. * @param value The value to check.
  6409. * @return Returns true if value is correctly classified, else false.
  6410. */
  6411. isNumber(value?: any): boolean;
  6412. }
  6413. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6414. /**
  6415. * see _.isNumber
  6416. */
  6417. isNumber(): boolean;
  6418. }
  6419. //_.isObject
  6420. interface LoDashStatic {
  6421. /**
  6422. * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
  6423. * and new String(''))
  6424. * @param value The value to check.
  6425. * @return Returns true if value is an object, else false.
  6426. **/
  6427. isObject(value?: any): boolean;
  6428. }
  6429. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6430. /**
  6431. * see _.isObject
  6432. */
  6433. isObject(): boolean;
  6434. }
  6435. //_.isPlainObject
  6436. interface LoDashStatic {
  6437. /**
  6438. * Checks if value is a plain object, that is, an object created by the Object constructor or one with a
  6439. * [[Prototype]] of null.
  6440. *
  6441. * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
  6442. *
  6443. * @param value The value to check.
  6444. * @return Returns true if value is a plain object, else false.
  6445. */
  6446. isPlainObject(value?: any): boolean;
  6447. }
  6448. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6449. /**
  6450. * see _.isPlainObject
  6451. */
  6452. isPlainObject(): boolean;
  6453. }
  6454. //_.isRegExp
  6455. interface LoDashStatic {
  6456. /**
  6457. * Checks if value is classified as a RegExp object.
  6458. * @param value The value to check.
  6459. * @return Returns true if value is correctly classified, else false.
  6460. */
  6461. isRegExp(value?: any): boolean;
  6462. }
  6463. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6464. /**
  6465. * see _.isRegExp
  6466. */
  6467. isRegExp(): boolean;
  6468. }
  6469. //_.isString
  6470. interface LoDashStatic {
  6471. /**
  6472. * Checks if value is classified as a String primitive or object.
  6473. * @param value The value to check.
  6474. * @return Returns true if value is correctly classified, else false.
  6475. **/
  6476. isString(value?: any): boolean;
  6477. }
  6478. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6479. /**
  6480. * see _.isString
  6481. */
  6482. isString(): boolean;
  6483. }
  6484. //_.isTypedArray
  6485. interface LoDashStatic {
  6486. /**
  6487. * Checks if value is classified as a typed array.
  6488. * @param value The value to check.
  6489. * @return Returns true if value is correctly classified, else false.
  6490. */
  6491. isTypedArray(value: any): boolean;
  6492. }
  6493. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6494. /**
  6495. * see _.isTypedArray
  6496. */
  6497. isTypedArray(): boolean;
  6498. }
  6499. //_.isUndefined
  6500. interface LoDashStatic {
  6501. /**
  6502. * Checks if value is undefined.
  6503. * @param value The value to check.
  6504. * @return Returns true if value is undefined, else false.
  6505. **/
  6506. isUndefined(value: any): boolean;
  6507. }
  6508. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6509. /**
  6510. * see _.isUndefined
  6511. */
  6512. isUndefined(): boolean;
  6513. }
  6514. //_.lt
  6515. interface LoDashStatic {
  6516. /**
  6517. * Checks if value is less than other.
  6518. * @param value The value to compare.
  6519. * @param other The other value to compare.
  6520. * @return Returns true if value is less than other, else false.
  6521. */
  6522. lt(value: any, other: any): boolean;
  6523. }
  6524. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6525. /**
  6526. * @see _.lt
  6527. */
  6528. lt(other: any): boolean;
  6529. }
  6530. //_.lte
  6531. interface LoDashStatic {
  6532. /**
  6533. * Checks if value is less than or equal to other.
  6534. * @param value The value to compare.
  6535. * @param other The other value to compare.
  6536. * @return Returns true if value is less than or equal to other, else false.
  6537. */
  6538. lte(value: any, other: any): boolean;
  6539. }
  6540. interface LoDashImplicitWrapperBase<T,TWrapper> {
  6541. /**
  6542. * @see _.lte
  6543. */
  6544. lte(other: any): boolean;
  6545. }
  6546. //_.toArray
  6547. interface LoDashStatic {
  6548. /**
  6549. * Converts value to an array.
  6550. *
  6551. * @param value The value to convert.
  6552. * @return Returns the converted array.
  6553. */
  6554. toArray(value: string): string[];
  6555. /**
  6556. * @see _.toArray
  6557. */
  6558. toArray<T>(value: List<T>|Dictionary<T>): T[];
  6559. /**
  6560. * @see _.toArray
  6561. */
  6562. toArray<TValue, TResult>(value: TValue): TResult[];
  6563. /**
  6564. * @see _.toArray
  6565. */
  6566. toArray<TValue>(value: TValue): any[];
  6567. /**
  6568. * @see _.toArray
  6569. */
  6570. toArray(value?: any): any[];
  6571. }
  6572. interface LoDashImplicitWrapper<T> {
  6573. /**
  6574. * @see _.toArray
  6575. */
  6576. toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  6577. }
  6578. interface LoDashImplicitArrayWrapper<T> {
  6579. /**
  6580. * @see _.toArray
  6581. */
  6582. toArray(): LoDashImplicitArrayWrapper<T>;
  6583. }
  6584. interface LoDashImplicitObjectWrapper<T> {
  6585. /**
  6586. * @see _.toArray
  6587. */
  6588. toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
  6589. }
  6590. //_.toPlainObject
  6591. interface LoDashStatic {
  6592. /**
  6593. * Converts value to a plain object flattening inherited enumerable properties of value to own properties
  6594. * of the plain object.
  6595. *
  6596. * @param value The value to convert.
  6597. * @return Returns the converted plain object.
  6598. */
  6599. toPlainObject<TResult extends {}>(value?: any): TResult;
  6600. }
  6601. interface LoDashImplicitWrapperBase<T, TWrapper> {
  6602. /**
  6603. * @see _.toPlainObject
  6604. */
  6605. toPlainObject<TResult extends {}>(): LoDashImplicitObjectWrapper<TResult>;
  6606. }
  6607. /********
  6608. * Math *
  6609. ********/
  6610. //_.add
  6611. interface LoDashStatic {
  6612. /**
  6613. * Adds two numbers.
  6614. *
  6615. * @param augend The first number to add.
  6616. * @param addend The second number to add.
  6617. * @return Returns the sum.
  6618. */
  6619. add(
  6620. augend: number,
  6621. addend: number
  6622. ): number;
  6623. }
  6624. interface LoDashImplicitWrapper<T> {
  6625. /**
  6626. * @see _.add
  6627. */
  6628. add(addend: number): number;
  6629. }
  6630. interface LoDashExplicitWrapper<T> {
  6631. /**
  6632. * @see _.add
  6633. */
  6634. add(addend: number): LoDashExplicitWrapper<number>;
  6635. }
  6636. //_.ceil
  6637. interface LoDashStatic {
  6638. /**
  6639. * Calculates n rounded up to precision.
  6640. *
  6641. * @param n The number to round up.
  6642. * @param precision The precision to round up to.
  6643. * @return Returns the rounded up number.
  6644. */
  6645. ceil(
  6646. n: number,
  6647. precision?: number
  6648. ): number;
  6649. }
  6650. interface LoDashImplicitWrapper<T> {
  6651. /**
  6652. * @see _.ceil
  6653. */
  6654. ceil(precision?: number): number;
  6655. }
  6656. interface LoDashExplicitWrapper<T> {
  6657. /**
  6658. * @see _.ceil
  6659. */
  6660. ceil(precision?: number): LoDashExplicitWrapper<number>;
  6661. }
  6662. //_.floor
  6663. interface LoDashStatic {
  6664. /**
  6665. * Calculates n rounded down to precision.
  6666. *
  6667. * @param n The number to round down.
  6668. * @param precision The precision to round down to.
  6669. * @return Returns the rounded down number.
  6670. */
  6671. floor(
  6672. n: number,
  6673. precision?: number
  6674. ): number;
  6675. }
  6676. interface LoDashImplicitWrapper<T> {
  6677. /**
  6678. * @see _.floor
  6679. */
  6680. floor(precision?: number): number;
  6681. }
  6682. interface LoDashExplicitWrapper<T> {
  6683. /**
  6684. * @see _.floor
  6685. */
  6686. floor(precision?: number): LoDashExplicitWrapper<number>;
  6687. }
  6688. //_.max
  6689. interface LoDashStatic {
  6690. /**
  6691. * Gets the maximum value of collection. If collection is empty or falsey -Infinity is returned. If an iteratee
  6692. * function is provided it’s invoked for each value in collection to generate the criterion by which the value
  6693. * is ranked. The iteratee is bound to thisArg and invoked with three arguments: (value, index, collection).
  6694. *
  6695. * If a property name is provided for iteratee the created _.property style callback returns the property value
  6696. * of the given element.
  6697. *
  6698. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  6699. * elements that have a matching property value, else false.
  6700. *
  6701. * If an object is provided for iteratee the created _.matches style callback returns true for elements that
  6702. * have the properties of the given object, else false.
  6703. *
  6704. * @param collection The collection to iterate over.
  6705. * @param iteratee The function invoked per iteration.
  6706. * @param thisArg The this binding of iteratee.
  6707. * @return Returns the maximum value.
  6708. */
  6709. max<T>(
  6710. collection: List<T>,
  6711. iteratee?: ListIterator<T, any>,
  6712. thisArg?: any
  6713. ): T;
  6714. /**
  6715. * @see _.max
  6716. */
  6717. max<T>(
  6718. collection: Dictionary<T>,
  6719. iteratee?: DictionaryIterator<T, any>,
  6720. thisArg?: any
  6721. ): T;
  6722. /**
  6723. * @see _.max
  6724. */
  6725. max<T>(
  6726. collection: List<T>|Dictionary<T>,
  6727. iteratee?: string,
  6728. thisArg?: any
  6729. ): T;
  6730. /**
  6731. * @see _.max
  6732. */
  6733. max<TObject extends {}, T>(
  6734. collection: List<T>|Dictionary<T>,
  6735. whereValue?: TObject
  6736. ): T;
  6737. }
  6738. interface LoDashImplicitArrayWrapper<T> {
  6739. /**
  6740. * @see _.max
  6741. */
  6742. max(
  6743. iteratee?: ListIterator<T, any>,
  6744. thisArg?: any
  6745. ): T;
  6746. /**
  6747. * @see _.max
  6748. */
  6749. max(
  6750. iteratee?: string,
  6751. thisArg?: any
  6752. ): T;
  6753. /**
  6754. * @see _.max
  6755. */
  6756. max<TObject extends {}>(
  6757. whereValue?: TObject
  6758. ): T;
  6759. }
  6760. interface LoDashImplicitObjectWrapper<T> {
  6761. /**
  6762. * @see _.max
  6763. */
  6764. max<T>(
  6765. iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
  6766. thisArg?: any
  6767. ): T;
  6768. /**
  6769. * @see _.max
  6770. */
  6771. max<T>(
  6772. iteratee?: string,
  6773. thisArg?: any
  6774. ): T;
  6775. /**
  6776. * @see _.max
  6777. */
  6778. max<TObject extends {}, T>(
  6779. whereValue?: TObject
  6780. ): T;
  6781. }
  6782. //_.min
  6783. interface LoDashStatic {
  6784. /**
  6785. * Gets the minimum value of collection. If collection is empty or falsey Infinity is returned. If an iteratee
  6786. * function is provided it’s invoked for each value in collection to generate the criterion by which the value
  6787. * is ranked. The iteratee is bound to thisArg and invoked with three arguments: (value, index, collection).
  6788. *
  6789. * If a property name is provided for iteratee the created _.property style callback returns the property value
  6790. * of the given element.
  6791. *
  6792. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  6793. * elements that have a matching property value, else false.
  6794. *
  6795. * If an object is provided for iteratee the created _.matches style callback returns true for elements that
  6796. * have the properties of the given object, else false.
  6797. *
  6798. * @param collection The collection to iterate over.
  6799. * @param iteratee The function invoked per iteration.
  6800. * @param thisArg The this binding of iteratee.
  6801. * @return Returns the minimum value.
  6802. */
  6803. min<T>(
  6804. collection: List<T>,
  6805. iteratee?: ListIterator<T, any>,
  6806. thisArg?: any
  6807. ): T;
  6808. /**
  6809. * @see _.min
  6810. */
  6811. min<T>(
  6812. collection: Dictionary<T>,
  6813. iteratee?: DictionaryIterator<T, any>,
  6814. thisArg?: any
  6815. ): T;
  6816. /**
  6817. * @see _.min
  6818. */
  6819. min<T>(
  6820. collection: List<T>|Dictionary<T>,
  6821. iteratee?: string,
  6822. thisArg?: any
  6823. ): T;
  6824. /**
  6825. * @see _.min
  6826. */
  6827. min<TObject extends {}, T>(
  6828. collection: List<T>|Dictionary<T>,
  6829. whereValue?: TObject
  6830. ): T;
  6831. }
  6832. interface LoDashImplicitArrayWrapper<T> {
  6833. /**
  6834. * @see _.min
  6835. */
  6836. min(
  6837. iteratee?: ListIterator<T, any>,
  6838. thisArg?: any
  6839. ): T;
  6840. /**
  6841. * @see _.min
  6842. */
  6843. min(
  6844. iteratee?: string,
  6845. thisArg?: any
  6846. ): T;
  6847. /**
  6848. * @see _.min
  6849. */
  6850. min<TObject extends {}>(
  6851. whereValue?: TObject
  6852. ): T;
  6853. }
  6854. interface LoDashImplicitObjectWrapper<T> {
  6855. /**
  6856. * @see _.min
  6857. */
  6858. min<T>(
  6859. iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
  6860. thisArg?: any
  6861. ): T;
  6862. /**
  6863. * @see _.min
  6864. */
  6865. min<T>(
  6866. iteratee?: string,
  6867. thisArg?: any
  6868. ): T;
  6869. /**
  6870. * @see _.min
  6871. */
  6872. min<TObject extends {}, T>(
  6873. whereValue?: TObject
  6874. ): T;
  6875. }
  6876. //_.round
  6877. interface LoDashStatic {
  6878. /**
  6879. * Calculates n rounded to precision.
  6880. *
  6881. * @param n The number to round.
  6882. * @param precision The precision to round to.
  6883. * @return Returns the rounded number.
  6884. */
  6885. round(
  6886. n: number,
  6887. precision?: number
  6888. ): number;
  6889. }
  6890. interface LoDashImplicitWrapper<T> {
  6891. /**
  6892. * @see _.round
  6893. */
  6894. round(precision?: number): number;
  6895. }
  6896. interface LoDashExplicitWrapper<T> {
  6897. /**
  6898. * @see _.round
  6899. */
  6900. round(precision?: number): LoDashExplicitWrapper<number>;
  6901. }
  6902. /**********
  6903. * Number *
  6904. **********/
  6905. //_.inRange
  6906. interface LoDashStatic {
  6907. /**
  6908. * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start
  6909. * with start then set to 0.
  6910. *
  6911. * @param n The number to check.
  6912. * @param start The start of the range.
  6913. * @param end The end of the range.
  6914. * @return Returns true if n is in the range, else false.
  6915. */
  6916. inRange(
  6917. n: number,
  6918. start: number,
  6919. end: number
  6920. ): boolean;
  6921. /**
  6922. * @see _.inRange
  6923. */
  6924. inRange(
  6925. n: number,
  6926. end: number
  6927. ): boolean;
  6928. }
  6929. interface LoDashImplicitWrapper<T> {
  6930. /**
  6931. * @see _.inRange
  6932. */
  6933. inRange(
  6934. start: number,
  6935. end: number
  6936. ): boolean;
  6937. /**
  6938. * @see _.inRange
  6939. */
  6940. inRange(end: number): boolean;
  6941. }
  6942. interface LoDashExplicitWrapper<T> {
  6943. /**
  6944. * @see _.inRange
  6945. */
  6946. inRange(
  6947. start: number,
  6948. end: number
  6949. ): LoDashExplicitWrapper<boolean>;
  6950. /**
  6951. * @see _.inRange
  6952. */
  6953. inRange(end: number): LoDashExplicitWrapper<boolean>;
  6954. }
  6955. //_.random
  6956. interface LoDashStatic {
  6957. /**
  6958. * Produces a random number between min and max (inclusive). If only one argument is provided a number between
  6959. * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point
  6960. * number is returned instead of an integer.
  6961. *
  6962. * @param min The minimum possible value.
  6963. * @param max The maximum possible value.
  6964. * @param floating Specify returning a floating-point number.
  6965. * @return Returns the random number.
  6966. */
  6967. random(
  6968. min?: number,
  6969. max?: number,
  6970. floating?: boolean
  6971. ): number;
  6972. /**
  6973. * @see _.random
  6974. */
  6975. random(
  6976. min?: number,
  6977. floating?: boolean
  6978. ): number;
  6979. /**
  6980. * @see _.random
  6981. */
  6982. random(floating?: boolean): number;
  6983. }
  6984. interface LoDashImplicitWrapper<T> {
  6985. /**
  6986. * @see _.random
  6987. */
  6988. random(
  6989. max?: number,
  6990. floating?: boolean
  6991. ): number;
  6992. /**
  6993. * @see _.random
  6994. */
  6995. random(floating?: boolean): number;
  6996. }
  6997. interface LoDashExplicitWrapper<T> {
  6998. /**
  6999. * @see _.random
  7000. */
  7001. random(
  7002. max?: number,
  7003. floating?: boolean
  7004. ): LoDashExplicitWrapper<number>;
  7005. /**
  7006. * @see _.random
  7007. */
  7008. random(floating?: boolean): LoDashExplicitWrapper<number>;
  7009. }
  7010. /**********
  7011. * Object *
  7012. **********/
  7013. //_.assign
  7014. interface LoDashStatic {
  7015. /**
  7016. * Assigns own enumerable properties of source object(s) to the destination object. Subsequent
  7017. * sources will overwrite property assignments of previous sources. If a callback is provided
  7018. * it will be executed to produce the assigned values. The callback is bound to thisArg and
  7019. * invoked with two arguments; (objectValue, sourceValue).
  7020. * @param object The destination object.
  7021. * @param s1-8 The source object(s)
  7022. * @param callback The function to customize merging properties.
  7023. * @param thisArg The this binding of callback.
  7024. * @return The destination object.
  7025. **/
  7026. assign<P, T, S1, Value, Result>(
  7027. object: T,
  7028. s1: S1,
  7029. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7030. thisArg?: any): Result;
  7031. /**
  7032. * @see _.assign
  7033. **/
  7034. assign<P, T, S1, S2, Value, Result>(
  7035. object: T,
  7036. s1: S1,
  7037. s2: S2,
  7038. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7039. thisArg?: any): Result;
  7040. /**
  7041. * @see _.assign
  7042. **/
  7043. assign<P, T, S1, S2, S3, Value, Result>(
  7044. object: T,
  7045. s1: S1,
  7046. s2: S2,
  7047. s3: S3,
  7048. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7049. thisArg?: any): Result;
  7050. /**
  7051. * @see _.assign
  7052. **/
  7053. assign<P, T, S1, S2, S3, S4, Value, Result>(
  7054. object: T,
  7055. s1: S1,
  7056. s2: S2,
  7057. s3: S3,
  7058. s4: S4,
  7059. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7060. thisArg?: any): Result;
  7061. /**
  7062. * @see _.assign
  7063. **/
  7064. extend<P, T, S1, Value, Result>(
  7065. object: T,
  7066. s1: S1,
  7067. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7068. thisArg?: any): Result;
  7069. /**
  7070. * @see _.assign
  7071. **/
  7072. extend<P, T, S1, S2, Value, Result>(
  7073. object: T,
  7074. s1: S1,
  7075. s2: S2,
  7076. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7077. thisArg?: any): Result;
  7078. /**
  7079. * @see _.assign
  7080. **/
  7081. extend<P, T, S1, S2, S3, Value, Result>(
  7082. object: T,
  7083. s1: S1,
  7084. s2: S2,
  7085. s3: S3,
  7086. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7087. thisArg?: any): Result;
  7088. /**
  7089. * @see _.assign
  7090. **/
  7091. extend<P, T, S1, S2, S3, S4, Value, Result>(
  7092. object: T,
  7093. s1: S1,
  7094. s2: S2,
  7095. s3: S3,
  7096. s4: S4,
  7097. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7098. thisArg?: any): Result;
  7099. }
  7100. interface LoDashImplicitObjectWrapper<T> {
  7101. /**
  7102. * @see _.assign
  7103. **/
  7104. assign<S1, Value, TResult>(
  7105. s1: S1,
  7106. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7107. thisArg?: any): TResult;
  7108. /**
  7109. * @see _.assign
  7110. **/
  7111. assign<S1, S2, Value, TResult>(
  7112. s1: S1,
  7113. s2: S2,
  7114. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7115. thisArg?: any): TResult;
  7116. /**
  7117. * @see _.assign
  7118. **/
  7119. assign<S1, S2, S3, Value, TResult>(
  7120. s1: S1,
  7121. s2: S2,
  7122. s3: S3,
  7123. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7124. thisArg?: any): TResult;
  7125. /**
  7126. * @see _.assign
  7127. **/
  7128. assign<S1, S2, S3, S4, Value, TResult>(
  7129. s1: S1,
  7130. s2: S2,
  7131. s3: S3,
  7132. s4: S4,
  7133. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7134. thisArg?: any): TResult;
  7135. /**
  7136. * @see _.assign
  7137. **/
  7138. assign<S1, S2, S3, S4, S5, Value, TResult>(
  7139. s1: S1,
  7140. s2: S2,
  7141. s3: S3,
  7142. s4: S4,
  7143. s5: S5,
  7144. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7145. thisArg?: any): TResult;
  7146. /**
  7147. * @see _.assign
  7148. **/
  7149. extend<S1, Value, TResult>(
  7150. s1: S1,
  7151. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7152. thisArg?: any): TResult;
  7153. /**
  7154. * @see _.assign
  7155. **/
  7156. extend<S1, S2, Value, TResult>(
  7157. s1: S1,
  7158. s2: S2,
  7159. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7160. thisArg?: any): TResult;
  7161. /**
  7162. * @see _.assign
  7163. **/
  7164. extend<S1, S2, S3, Value, TResult>(
  7165. s1: S1,
  7166. s2: S2,
  7167. s3: S3,
  7168. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7169. thisArg?: any): TResult;
  7170. /**
  7171. * @see _.assign
  7172. **/
  7173. extend<S1, S2, S3, S4, Value, TResult>(
  7174. s1: S1,
  7175. s2: S2,
  7176. s3: S3,
  7177. s4: S4,
  7178. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7179. thisArg?: any): TResult;
  7180. /**
  7181. * @see _.assign
  7182. **/
  7183. extend<S1, S2, S3, S4, S5, Value, TResult>(
  7184. s1: S1,
  7185. s2: S2,
  7186. s3: S3,
  7187. s4: S4,
  7188. s5: S5,
  7189. callback?: (objectValue: Value, sourceValue: Value) => Value,
  7190. thisArg?: any): TResult;
  7191. }
  7192. //_.create
  7193. interface LoDashStatic {
  7194. /**
  7195. * Creates an object that inherits from the given prototype object. If a properties object is provided its own
  7196. * enumerable properties are assigned to the created object.
  7197. * @param prototype The object to inherit from.
  7198. * @param properties The properties to assign to the object.
  7199. * @return Returns the new object.
  7200. */
  7201. create<TResult extends {}>(prototype: Object, properties?: Object): TResult;
  7202. }
  7203. interface LoDashImplicitObjectWrapper<T> {
  7204. /**
  7205. * @see _.create
  7206. */
  7207. create<TResult extends {}>(properties?: Object): LoDashImplicitObjectWrapper<TResult>;
  7208. }
  7209. //_.defaults
  7210. interface LoDashStatic {
  7211. /**
  7212. * Assigns own enumerable properties of source object(s) to the destination object for all
  7213. * destination properties that resolve to undefined. Once a property is set, additional defaults
  7214. * of the same property will be ignored.
  7215. * @param object The destination object.
  7216. * @param sources The source objects.
  7217. * @return The destination object.
  7218. **/
  7219. defaults<T, TResult>(
  7220. object: T,
  7221. ...sources: any[]): TResult;
  7222. }
  7223. interface LoDashImplicitObjectWrapper<T> {
  7224. /**
  7225. * @see _.defaults
  7226. **/
  7227. defaults<T, TResult>(...sources: any[]): LoDashImplicitObjectWrapper<TResult>
  7228. }
  7229. //_.defaultsDeep
  7230. interface LoDashStatic {
  7231. /**
  7232. * This method is like _.defaults except that it recursively assigns default properties.
  7233. * @param object The destination object.
  7234. * @param sources The source objects.
  7235. * @return Returns object.
  7236. **/
  7237. defaultsDeep<T, TResult>(
  7238. object: T,
  7239. ...sources: any[]): TResult;
  7240. }
  7241. interface LoDashImplicitObjectWrapper<T> {
  7242. /**
  7243. * @see _.defaultsDeep
  7244. **/
  7245. defaultsDeep<TResult>(...sources: any[]): LoDashImplicitObjectWrapper<TResult>
  7246. }
  7247. //_.findKey
  7248. interface LoDashStatic {
  7249. /**
  7250. * This method is like _.find except that it returns the key of the first element predicate returns truthy for
  7251. * instead of the element itself.
  7252. *
  7253. * If a property name is provided for predicate the created _.property style callback returns the property
  7254. * value of the given element.
  7255. *
  7256. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  7257. * elements that have a matching property value, else false.
  7258. *
  7259. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  7260. * have the properties of the given object, else false.
  7261. *
  7262. * @param object The object to search.
  7263. * @param predicate The function invoked per iteration.
  7264. * @param thisArg The this binding of predicate.
  7265. * @return Returns the key of the matched element, else undefined.
  7266. */
  7267. findKey<TValues, TObject>(
  7268. object: TObject,
  7269. predicate?: DictionaryIterator<TValues, boolean>,
  7270. thisArg?: any
  7271. ): string;
  7272. /**
  7273. * @see _.findKey
  7274. */
  7275. findKey<TObject>(
  7276. object: TObject,
  7277. predicate?: ObjectIterator<any, boolean>,
  7278. thisArg?: any
  7279. ): string;
  7280. /**
  7281. * @see _.findKey
  7282. */
  7283. findKey<TObject>(
  7284. object: TObject,
  7285. predicate?: string,
  7286. thisArg?: any
  7287. ): string;
  7288. /**
  7289. * @see _.findKey
  7290. */
  7291. findKey<TWhere extends Dictionary<any>, TObject>(
  7292. object: TObject,
  7293. predicate?: TWhere
  7294. ): string;
  7295. }
  7296. interface LoDashImplicitObjectWrapper<T> {
  7297. /**
  7298. * @see _.findKey
  7299. */
  7300. findKey<TValues>(
  7301. predicate?: DictionaryIterator<TValues, boolean>,
  7302. thisArg?: any
  7303. ): string;
  7304. /**
  7305. * @see _.findKey
  7306. */
  7307. findKey(
  7308. predicate?: ObjectIterator<any, boolean>,
  7309. thisArg?: any
  7310. ): string;
  7311. /**
  7312. * @see _.findKey
  7313. */
  7314. findKey(
  7315. predicate?: string,
  7316. thisArg?: any
  7317. ): string;
  7318. /**
  7319. * @see _.findKey
  7320. */
  7321. findKey<TWhere extends Dictionary<any>>(
  7322. predicate?: TWhere
  7323. ): string;
  7324. }
  7325. //_.findLastKey
  7326. interface LoDashStatic {
  7327. /**
  7328. * This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
  7329. *
  7330. * If a property name is provided for predicate the created _.property style callback returns the property
  7331. * value of the given element.
  7332. *
  7333. * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
  7334. * elements that have a matching property value, else false.
  7335. *
  7336. * If an object is provided for predicate the created _.matches style callback returns true for elements that
  7337. * have the properties of the given object, else false.
  7338. *
  7339. * @param object The object to search.
  7340. * @param predicate The function invoked per iteration.
  7341. * @param thisArg The this binding of predicate.
  7342. * @return Returns the key of the matched element, else undefined.
  7343. */
  7344. findLastKey<TValues, TObject>(
  7345. object: TObject,
  7346. predicate?: DictionaryIterator<TValues, boolean>,
  7347. thisArg?: any
  7348. ): string;
  7349. /**
  7350. * @see _.findLastKey
  7351. */
  7352. findLastKey<TObject>(
  7353. object: TObject,
  7354. predicate?: ObjectIterator<any, boolean>,
  7355. thisArg?: any
  7356. ): string;
  7357. /**
  7358. * @see _.findLastKey
  7359. */
  7360. findLastKey<TObject>(
  7361. object: TObject,
  7362. predicate?: string,
  7363. thisArg?: any
  7364. ): string;
  7365. /**
  7366. * @see _.findLastKey
  7367. */
  7368. findLastKey<TWhere extends Dictionary<any>, TObject>(
  7369. object: TObject,
  7370. predicate?: TWhere
  7371. ): string;
  7372. }
  7373. interface LoDashImplicitObjectWrapper<T> {
  7374. /**
  7375. * @see _.findLastKey
  7376. */
  7377. findLastKey<TValues>(
  7378. predicate?: DictionaryIterator<TValues, boolean>,
  7379. thisArg?: any
  7380. ): string;
  7381. /**
  7382. * @see _.findLastKey
  7383. */
  7384. findLastKey(
  7385. predicate?: ObjectIterator<any, boolean>,
  7386. thisArg?: any
  7387. ): string;
  7388. /**
  7389. * @see _.findLastKey
  7390. */
  7391. findLastKey(
  7392. predicate?: string,
  7393. thisArg?: any
  7394. ): string;
  7395. /**
  7396. * @see _.findLastKey
  7397. */
  7398. findLastKey<TWhere extends Dictionary<any>>(
  7399. predicate?: TWhere
  7400. ): string;
  7401. }
  7402. //_.forIn
  7403. interface LoDashStatic {
  7404. /**
  7405. * Iterates over own and inherited enumerable properties of an object, executing the callback for
  7406. * each property. The callback is bound to thisArg and invoked with three arguments; (value, key,
  7407. * object). Callbacks may exit iteration early by explicitly returning false.
  7408. * @param object The object to iterate over.
  7409. * @param callback The function called per iteration.
  7410. * @param thisArg The this binding of callback.
  7411. * @return object
  7412. **/
  7413. forIn<T>(
  7414. object: Dictionary<T>,
  7415. callback?: DictionaryIterator<T, void>,
  7416. thisArg?: any): Dictionary<T>;
  7417. /**
  7418. * @see _.forIn
  7419. **/
  7420. forIn<T>(
  7421. object: T,
  7422. callback?: ObjectIterator<any, void>,
  7423. thisArg?: any): T;
  7424. }
  7425. interface LoDashImplicitObjectWrapper<T> {
  7426. /**
  7427. * @see _.forIn
  7428. **/
  7429. forIn<T extends {}>(
  7430. callback: ObjectIterator<T, void>,
  7431. thisArg?: any): _.LoDashImplicitObjectWrapper<T>;
  7432. }
  7433. //_.forInRight
  7434. interface LoDashStatic {
  7435. /**
  7436. * This method is like _.forIn except that it iterates over elements of a collection in the
  7437. * opposite order.
  7438. * @param object The object to iterate over.
  7439. * @param callback The function called per iteration.
  7440. * @param thisArg The this binding of callback.
  7441. * @return object
  7442. **/
  7443. forInRight<T extends {}>(
  7444. object: Dictionary<T>,
  7445. callback?: DictionaryIterator<T, void>,
  7446. thisArg?: any): Dictionary<T>;
  7447. /**
  7448. * @see _.forInRight
  7449. **/
  7450. forInRight<T extends {}>(
  7451. object: T,
  7452. callback?: ObjectIterator<T, void>,
  7453. thisArg?: any): T;
  7454. }
  7455. interface LoDashImplicitObjectWrapper<T> {
  7456. /**
  7457. * @see _.forInRight
  7458. **/
  7459. forInRight<T extends {}>(
  7460. callback: ObjectIterator<T, void>,
  7461. thisArg?: any): _.LoDashImplicitObjectWrapper<T>;
  7462. }
  7463. //_.forOwn
  7464. interface LoDashStatic {
  7465. /**
  7466. * Iterates over own enumerable properties of an object, executing the callback for each
  7467. * property. The callback is bound to thisArg and invoked with three arguments; (value, key,
  7468. * object). Callbacks may exit iteration early by explicitly returning false.
  7469. * @param object The object to iterate over.
  7470. * @param callback The function called per iteration.
  7471. * @param thisArg The this binding of callback.
  7472. * @return object
  7473. **/
  7474. forOwn<T extends {}>(
  7475. object: Dictionary<T>,
  7476. callback?: DictionaryIterator<T, void>,
  7477. thisArg?: any): Dictionary<T>;
  7478. /**
  7479. * @see _.forOwn
  7480. **/
  7481. forOwn<T extends {}>(
  7482. object: T,
  7483. callback?: ObjectIterator<any, void>,
  7484. thisArg?: any): T;
  7485. }
  7486. interface LoDashImplicitObjectWrapper<T> {
  7487. /**
  7488. * @see _.forOwn
  7489. **/
  7490. forOwn<T extends {}>(
  7491. callback: ObjectIterator<T, void>,
  7492. thisArg?: any): _.LoDashImplicitObjectWrapper<T>;
  7493. }
  7494. //_.forOwnRight
  7495. interface LoDashStatic {
  7496. /**
  7497. * This method is like _.forOwn except that it iterates over elements of a collection in the
  7498. * opposite order.
  7499. * @param object The object to iterate over.
  7500. * @param callback The function called per iteration.
  7501. * @param thisArg The this binding of callback.
  7502. * @return object
  7503. **/
  7504. forOwnRight<T extends {}>(
  7505. object: Dictionary<T>,
  7506. callback?: DictionaryIterator<T, void>,
  7507. thisArg?: any): Dictionary<T>;
  7508. /**
  7509. * @see _.forOwnRight
  7510. **/
  7511. forOwnRight<T extends {}>(
  7512. object: T,
  7513. callback?: ObjectIterator<any, void>,
  7514. thisArg?: any): T;
  7515. }
  7516. interface LoDashImplicitObjectWrapper<T> {
  7517. /**
  7518. * @see _.forOwnRight
  7519. **/
  7520. forOwnRight<T extends {}>(
  7521. callback: ObjectIterator<T, void>,
  7522. thisArg?: any): _.LoDashImplicitObjectWrapper<T>;
  7523. }
  7524. //_.functions
  7525. interface LoDashStatic {
  7526. /**
  7527. * Creates a sorted array of property names of all enumerable properties, own and inherited, of
  7528. * object that have function values.
  7529. * @param object The object to inspect.
  7530. * @return An array of property names that have function values.
  7531. **/
  7532. functions(object: any): string[];
  7533. /**
  7534. * @see _functions
  7535. **/
  7536. methods(object: any): string[];
  7537. }
  7538. interface LoDashImplicitObjectWrapper<T> {
  7539. /**
  7540. * @see _.functions
  7541. **/
  7542. functions(): _.LoDashImplicitArrayWrapper<string>;
  7543. /**
  7544. * @see _.functions
  7545. **/
  7546. methods(): _.LoDashImplicitArrayWrapper<string>;
  7547. }
  7548. //_.get
  7549. interface LoDashStatic {
  7550. /**
  7551. * Gets the property value at path of object. If the resolved
  7552. * value is undefined the defaultValue is used in its place.
  7553. * @param object The object to query.
  7554. * @param path The path of the property to get.
  7555. * @param defaultValue The value returned if the resolved value is undefined.
  7556. * @return Returns the resolved value.
  7557. **/
  7558. get<TResult>(object: Object,
  7559. path: string|number|boolean|Array<string|number|boolean>,
  7560. defaultValue?:TResult
  7561. ): TResult;
  7562. }
  7563. interface LoDashImplicitObjectWrapper<T> {
  7564. /**
  7565. * @see _.get
  7566. **/
  7567. get<TResult>(path: string|number|boolean|Array<string|number|boolean>,
  7568. defaultValue?: TResult
  7569. ): TResult;
  7570. }
  7571. //_.has
  7572. interface LoDashStatic {
  7573. /**
  7574. * Checks if path is a direct property.
  7575. *
  7576. * @param object The object to query.
  7577. * @param path The path to check.
  7578. * @return Returns true if path is a direct property, else false.
  7579. */
  7580. has(object: any, path: string|number|boolean|Array<string|number|boolean>): boolean;
  7581. }
  7582. interface LoDashImplicitObjectWrapper<T> {
  7583. /**
  7584. * @see _.has
  7585. */
  7586. has(path: string|number|boolean|Array<string|number|boolean>): boolean;
  7587. }
  7588. //_.invert
  7589. interface LoDashStatic {
  7590. /**
  7591. * Creates an object composed of the inverted keys and values of object. If object contains duplicate values,
  7592. * subsequent values overwrite property assignments of previous values unless multiValue is true.
  7593. *
  7594. * @param object The object to invert.
  7595. * @param multiValue Allow multiple values per key.
  7596. * @return Returns the new inverted object.
  7597. */
  7598. invert<T extends {}, TResult extends {}>(object: T, multiValue?: boolean): TResult;
  7599. }
  7600. interface LoDashImplicitObjectWrapper<T> {
  7601. /**
  7602. * @see _.invert
  7603. */
  7604. invert<TResult extends {}>(multiValue?: boolean): LoDashImplicitObjectWrapper<TResult>;
  7605. }
  7606. //_.keys
  7607. interface LoDashStatic {
  7608. /**
  7609. * Creates an array composed of the own enumerable property names of an object.
  7610. * @param object The object to inspect.
  7611. * @return An array of property names.
  7612. **/
  7613. keys(object?: any): string[];
  7614. }
  7615. interface LoDashImplicitObjectWrapper<T> {
  7616. /**
  7617. * @see _.keys
  7618. **/
  7619. keys(): LoDashImplicitArrayWrapper<string>
  7620. }
  7621. //_.keysIn
  7622. interface LoDashStatic {
  7623. /**
  7624. * Creates an array of the own and inherited enumerable property names of object.
  7625. * @param object The object to query.
  7626. * @return An array of property names.
  7627. **/
  7628. keysIn(object?: any): string[];
  7629. }
  7630. interface LoDashImplicitObjectWrapper<T> {
  7631. /**
  7632. * @see _.keysIn
  7633. **/
  7634. keysIn(): LoDashImplicitArrayWrapper<string>
  7635. }
  7636. //_.mapKeys
  7637. interface LoDashStatic {
  7638. /**
  7639. * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated
  7640. * by running each own enumerable property of object through iteratee.
  7641. *
  7642. * @param object The object to iterate over.
  7643. * @param iteratee The function invoked per iteration.
  7644. * @param thisArg The this binding of iteratee.
  7645. * @return Returns the new mapped object.
  7646. */
  7647. mapKeys<T, TKey>(
  7648. object: List<T>,
  7649. iteratee?: ListIterator<T, TKey>,
  7650. thisArg?: any
  7651. ): Dictionary<T>;
  7652. /**
  7653. * @see _.mapKeys
  7654. */
  7655. mapKeys<T, TKey>(
  7656. object: Dictionary<T>,
  7657. iteratee?: DictionaryIterator<T, TKey>,
  7658. thisArg?: any
  7659. ): Dictionary<T>;
  7660. /**
  7661. * @see _.mapKeys
  7662. */
  7663. mapKeys<T, TObject extends {}>(
  7664. object: List<T>|Dictionary<T>,
  7665. iteratee?: TObject
  7666. ): Dictionary<T>;
  7667. /**
  7668. * @see _.mapKeys
  7669. */
  7670. mapKeys<T>(
  7671. object: List<T>|Dictionary<T>,
  7672. iteratee?: string
  7673. ): Dictionary<T>;
  7674. }
  7675. interface LoDashImplicitArrayWrapper<T> {
  7676. /**
  7677. * @see _.mapKeys
  7678. */
  7679. mapKeys<TKey>(
  7680. iteratee?: ListIterator<T, TKey>,
  7681. thisArg?: any
  7682. ): LoDashImplicitObjectWrapper<Dictionary<T>>;
  7683. /**
  7684. * @see _.mapKeys
  7685. */
  7686. mapKeys<TObject extends {}>(
  7687. iteratee?: TObject
  7688. ): LoDashImplicitObjectWrapper<Dictionary<T>>;
  7689. /**
  7690. * @see _.mapKeys
  7691. */
  7692. mapKeys(
  7693. iteratee?: string
  7694. ): LoDashImplicitObjectWrapper<Dictionary<T>>;
  7695. }
  7696. interface LoDashImplicitObjectWrapper<T> {
  7697. /**
  7698. * @see _.mapKeys
  7699. */
  7700. mapKeys<TResult, TKey>(
  7701. iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>,
  7702. thisArg?: any
  7703. ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  7704. /**
  7705. * @see _.mapKeys
  7706. */
  7707. mapKeys<TResult, TObject extends {}>(
  7708. iteratee?: TObject
  7709. ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  7710. /**
  7711. * @see _.mapKeys
  7712. */
  7713. mapKeys<TResult>(
  7714. iteratee?: string
  7715. ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  7716. }
  7717. //_.mapValues
  7718. interface LoDashStatic {
  7719. /**
  7720. * Creates an object with the same keys as object and values generated by running each own
  7721. * enumerable property of object through iteratee. The iteratee function is bound to thisArg
  7722. * and invoked with three arguments: (value, key, object).
  7723. *
  7724. * If a property name is provided iteratee the created "_.property" style callback returns
  7725. * the property value of the given element.
  7726. *
  7727. * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns
  7728. * true for elements that have a matching property value, else false;.
  7729. *
  7730. * If an object is provided for iteratee the created "_.matches" style callback returns true
  7731. * for elements that have the properties of the given object, else false.
  7732. *
  7733. * @param {Object} object The object to iterate over.
  7734. * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
  7735. * @param {Object} [thisArg] The `this` binding of `iteratee`.
  7736. * @return {Object} Returns the new mapped object.
  7737. */
  7738. mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>;
  7739. mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>;
  7740. mapValues<T, TMapped>(obj: T, pluck: string): TMapped;
  7741. mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T;
  7742. }
  7743. interface LoDashImplicitObjectWrapper<T> {
  7744. /**
  7745. * @see _.mapValues
  7746. * TValue is the type of the property values of T.
  7747. * TResult is the type output by the ObjectIterator function
  7748. */
  7749. mapValues<TValue, TResult>(callback: ObjectIterator<TValue, TResult>, thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  7750. /**
  7751. * @see _.mapValues
  7752. * TResult is the type of the property specified by pluck.
  7753. * T should be a Dictionary<Dictionary<TResult>>
  7754. */
  7755. mapValues<TResult>(pluck: string): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  7756. /**
  7757. * @see _.mapValues
  7758. * TResult is the type of the properties on the object specified by pluck.
  7759. * T should be a Dictionary<Dictionary<Dictionary<TResult>>>
  7760. */
  7761. mapValues<TResult>(pluck: string, where: Dictionary<TResult>): LoDashImplicitArrayWrapper<Dictionary<boolean>>;
  7762. /**
  7763. * @see _.mapValues
  7764. * TResult is the type of the properties of each object in the values of T
  7765. * T should be a Dictionary<Dictionary<TResult>>
  7766. */
  7767. mapValues<TResult>(where: Dictionary<TResult>): LoDashImplicitArrayWrapper<boolean>;
  7768. }
  7769. //_.merge
  7770. interface MergeCustomizer {
  7771. (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any;
  7772. }
  7773. interface LoDashStatic {
  7774. /**
  7775. * Recursively merges own enumerable properties of the source object(s), that don’t resolve to undefined into
  7776. * the destination object. Subsequent sources overwrite property assignments of previous sources. If customizer
  7777. * is provided it’s invoked to produce the merged values of the destination and source properties. If
  7778. * customizer returns undefined merging is handled by the method instead. The customizer is bound to thisArg
  7779. * and invoked with five arguments: (objectValue, sourceValue, key, object, source).
  7780. *
  7781. * @param object The destination object.
  7782. * @param source The source objects.
  7783. * @param customizer The function to customize assigned values.
  7784. * @param thisArg The this binding of customizer.
  7785. * @return Returns object.
  7786. */
  7787. merge<TObject, TSource, TResult>(
  7788. object: TObject,
  7789. source: TSource,
  7790. customizer?: MergeCustomizer,
  7791. thisArg?: any
  7792. ): TResult;
  7793. /**
  7794. * @see _.merge
  7795. */
  7796. merge<TObject, TSource1, TSource2, TResult>(
  7797. object: TObject,
  7798. source1: TSource1,
  7799. source2: TSource2,
  7800. customizer?: MergeCustomizer,
  7801. thisArg?: any
  7802. ): TResult;
  7803. /**
  7804. * @see _.merge
  7805. */
  7806. merge<TObject, TSource1, TSource2, TSource3, TResult>(
  7807. object: TObject,
  7808. source1: TSource1,
  7809. source2: TSource2,
  7810. source3: TSource3,
  7811. customizer?: MergeCustomizer,
  7812. thisArg?: any
  7813. ): TResult;
  7814. /**
  7815. * @see _.merge
  7816. */
  7817. merge<TObject, TSource1, TSource2, TSource3, TSource4, TResult>(
  7818. object: TObject,
  7819. source1: TSource1,
  7820. source2: TSource2,
  7821. source3: TSource3,
  7822. source4: TSource4,
  7823. customizer?: MergeCustomizer,
  7824. thisArg?: any
  7825. ): TResult;
  7826. /**
  7827. * @see _.merge
  7828. */
  7829. merge<TObject, TResult>(
  7830. object: TObject,
  7831. ...otherArgs: any[]
  7832. ): TResult;
  7833. }
  7834. interface LoDashImplicitObjectWrapper<T> {
  7835. /**
  7836. * @see _.merge
  7837. */
  7838. merge<TSource, TResult>(
  7839. source: TSource,
  7840. customizer?: MergeCustomizer,
  7841. thisArg?: any
  7842. ): LoDashImplicitObjectWrapper<TResult>;
  7843. /**
  7844. * @see _.merge
  7845. */
  7846. merge<TSource1, TSource2, TResult>(
  7847. source1: TSource1,
  7848. source2: TSource2,
  7849. customizer?: MergeCustomizer,
  7850. thisArg?: any
  7851. ): LoDashImplicitObjectWrapper<TResult>;
  7852. /**
  7853. * @see _.merge
  7854. */
  7855. merge<TSource1, TSource2, TSource3, TResult>(
  7856. source1: TSource1,
  7857. source2: TSource2,
  7858. source3: TSource3,
  7859. customizer?: MergeCustomizer,
  7860. thisArg?: any
  7861. ): LoDashImplicitObjectWrapper<TResult>;
  7862. /**
  7863. * @see _.merge
  7864. */
  7865. merge<TSource1, TSource2, TSource3, TSource4, TResult>(
  7866. source1: TSource1,
  7867. source2: TSource2,
  7868. source3: TSource3,
  7869. source4: TSource4,
  7870. customizer?: MergeCustomizer,
  7871. thisArg?: any
  7872. ): LoDashImplicitObjectWrapper<TResult>;
  7873. /**
  7874. * @see _.merge
  7875. */
  7876. merge<TResult>(
  7877. ...otherArgs: any[]
  7878. ): LoDashImplicitObjectWrapper<TResult>;
  7879. }
  7880. //_.omit
  7881. interface LoDashStatic {
  7882. /**
  7883. * Creates a shallow clone of object excluding the specified properties. Property names may be
  7884. * specified as individual arguments or as arrays of property names. If a callback is provided
  7885. * it will be executed for each property of object omitting the properties the callback returns
  7886. * truey for. The callback is bound to thisArg and invoked with three arguments; (value, key,
  7887. * object).
  7888. * @param object The source object.
  7889. * @param keys The properties to omit.
  7890. * @return An object without the omitted properties.
  7891. **/
  7892. omit<Omitted, T>(
  7893. object: T,
  7894. ...keys: string[]): Omitted;
  7895. /**
  7896. * @see _.omit
  7897. **/
  7898. omit<Omitted, T>(
  7899. object: T,
  7900. keys: string[]): Omitted;
  7901. /**
  7902. * @see _.omit
  7903. **/
  7904. omit<Omitted, T>(
  7905. object: T,
  7906. callback: ObjectIterator<any, boolean>,
  7907. thisArg?: any): Omitted;
  7908. }
  7909. interface LoDashImplicitObjectWrapper<T> {
  7910. /**
  7911. * @see _.omit
  7912. **/
  7913. omit<Omitted>(
  7914. ...keys: string[]): LoDashImplicitObjectWrapper<Omitted>;
  7915. /**
  7916. * @see _.omit
  7917. **/
  7918. omit<Omitted>(
  7919. keys: string[]): LoDashImplicitObjectWrapper<Omitted>;
  7920. /**
  7921. * @see _.omit
  7922. **/
  7923. omit<Omitted>(
  7924. callback: ObjectIterator<any, boolean>,
  7925. thisArg?: any): LoDashImplicitObjectWrapper<Omitted>;
  7926. }
  7927. //_.pairs
  7928. interface LoDashStatic {
  7929. /**
  7930. * Creates a two dimensional array of an object's key-value pairs,
  7931. * i.e. [[key1, value1], [key2, value2]].
  7932. * @param object The object to inspect.
  7933. * @return Aew array of key-value pairs.
  7934. **/
  7935. pairs(object?: any): any[][];
  7936. }
  7937. interface LoDashImplicitObjectWrapper<T> {
  7938. /**
  7939. * @see _.pairs
  7940. **/
  7941. pairs(): LoDashImplicitArrayWrapper<any[]>;
  7942. }
  7943. //_.pick
  7944. interface LoDashStatic {
  7945. /**
  7946. * Creates an object composed of the picked object properties. Property names may be specified as individual
  7947. * arguments or as arrays of property names. If predicate is provided it’s invoked for each property of object
  7948. * picking the properties predicate returns truthy for. The predicate is bound to thisArg and invoked with
  7949. * three arguments: (value, key, object).
  7950. *
  7951. * @param object The source object.
  7952. * @param predicate The function invoked per iteration or property names to pick, specified as individual
  7953. * property names or arrays of property names.
  7954. * @param thisArg The this binding of predicate.
  7955. * @return An object composed of the picked properties.
  7956. */
  7957. pick<TResult extends Object, T extends Object>(
  7958. object: T,
  7959. predicate: ObjectIterator<any, boolean>,
  7960. thisArg?: any
  7961. ): TResult;
  7962. /**
  7963. * @see _.pick
  7964. */
  7965. pick<TResult extends Object, T extends Object>(
  7966. object: T,
  7967. ...predicate: Array<string|number|boolean|Array<string|number|boolean>>
  7968. ): TResult;
  7969. }
  7970. interface LoDashImplicitObjectWrapper<T> {
  7971. /**
  7972. * @see _.pick
  7973. */
  7974. pick<TResult extends Object>(
  7975. predicate: ObjectIterator<any, boolean>,
  7976. thisArg?: any
  7977. ): LoDashImplicitObjectWrapper<TResult>;
  7978. /**
  7979. * @see _.pick
  7980. */
  7981. pick<TResult extends Object>(
  7982. ...predicate: Array<string|number|boolean|Array<string|number|boolean>>
  7983. ): LoDashImplicitObjectWrapper<TResult>;
  7984. }
  7985. //_.result
  7986. interface LoDashStatic {
  7987. /**
  7988. * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding
  7989. * of its parent object and its result is returned.
  7990. *
  7991. * @param object The object to query.
  7992. * @param path The path of the property to resolve.
  7993. * @param defaultValue The value returned if the resolved value is undefined.
  7994. * @return Returns the resolved value.
  7995. */
  7996. result<TObject, TResult>(
  7997. object: TObject,
  7998. path: number|string|boolean|Array<number|string|boolean>,
  7999. defaultValue?: TResult
  8000. ): TResult;
  8001. }
  8002. interface LoDashImplicitWrapperBase<T, TWrapper> {
  8003. /**
  8004. * @see _.result
  8005. */
  8006. result<TResult>(
  8007. path: number|string|boolean|Array<number|string|boolean>,
  8008. defaultValue?: TResult
  8009. ): TResult;
  8010. }
  8011. //_.set
  8012. interface LoDashStatic {
  8013. /**
  8014. * Sets the property value of path on object. If a portion of path does not exist it’s created.
  8015. *
  8016. * @param object The object to augment.
  8017. * @param path The path of the property to set.
  8018. * @param value The value to set.
  8019. * @return Returns object.
  8020. */
  8021. set<T>(
  8022. object: T,
  8023. path: StringRepresentable|StringRepresentable[],
  8024. value: any
  8025. ): T;
  8026. }
  8027. interface LoDashImplicitObjectWrapper<T> {
  8028. /**
  8029. * @see _.set
  8030. */
  8031. set(
  8032. path: StringRepresentable|StringRepresentable[],
  8033. value: any
  8034. ): LoDashImplicitObjectWrapper<T>;
  8035. }
  8036. //_.transform
  8037. interface LoDashStatic {
  8038. /**
  8039. * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of
  8040. * running each of its own enumerable properties through iteratee, with each invocation potentially mutating
  8041. * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator,
  8042. * value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
  8043. *
  8044. * @param object The object to iterate over.
  8045. * @param iteratee The function invoked per iteration.
  8046. * @param accumulator The custom accumulator value.
  8047. * @param thisArg The this binding of iteratee.
  8048. * @return Returns the accumulated value.
  8049. */
  8050. transform<T, TResult>(
  8051. object: T[],
  8052. iteratee?: MemoVoidArrayIterator<T, TResult[]>,
  8053. accumulator?: TResult[],
  8054. thisArg?: any
  8055. ): TResult[];
  8056. /**
  8057. * @see _.transform
  8058. */
  8059. transform<T, TResult>(
  8060. object: T[],
  8061. iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
  8062. accumulator?: Dictionary<TResult>,
  8063. thisArg?: any
  8064. ): Dictionary<TResult>;
  8065. /**
  8066. * @see _.transform
  8067. */
  8068. transform<T, TResult>(
  8069. object: Dictionary<T>,
  8070. iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
  8071. accumulator?: Dictionary<TResult>,
  8072. thisArg?: any
  8073. ): Dictionary<TResult>;
  8074. /**
  8075. * @see _.transform
  8076. */
  8077. transform<T, TResult>(
  8078. object: Dictionary<T>,
  8079. iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
  8080. accumulator?: TResult[],
  8081. thisArg?: any
  8082. ): TResult[];
  8083. }
  8084. interface LoDashImplicitArrayWrapper<T> {
  8085. /**
  8086. * @see _.transform
  8087. */
  8088. transform<TResult>(
  8089. iteratee?: MemoVoidArrayIterator<T, TResult[]>,
  8090. accumulator?: TResult[],
  8091. thisArg?: any
  8092. ): LoDashImplicitArrayWrapper<TResult>;
  8093. /**
  8094. * @see _.transform
  8095. */
  8096. transform<TResult>(
  8097. iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
  8098. accumulator?: Dictionary<TResult>,
  8099. thisArg?: any
  8100. ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  8101. }
  8102. interface LoDashImplicitObjectWrapper<T> {
  8103. /**
  8104. * @see _.transform
  8105. */
  8106. transform<T, TResult>(
  8107. iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
  8108. accumulator?: Dictionary<TResult>,
  8109. thisArg?: any
  8110. ): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
  8111. /**
  8112. * @see _.transform
  8113. */
  8114. transform<T, TResult>(
  8115. iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
  8116. accumulator?: TResult[],
  8117. thisArg?: any
  8118. ): LoDashImplicitArrayWrapper<TResult>;
  8119. }
  8120. //_.values
  8121. interface LoDashStatic {
  8122. /**
  8123. * Creates an array of the own enumerable property values of object.
  8124. * @param object The object to query.
  8125. * @return Returns an array of property values.
  8126. **/
  8127. values<T>(object?: any): T[];
  8128. }
  8129. interface LoDashImplicitObjectWrapper<T> {
  8130. /**
  8131. * @see _.values
  8132. **/
  8133. values<TResult>(): LoDashImplicitObjectWrapper<TResult[]>;
  8134. }
  8135. //_.valuesIn
  8136. interface LoDashStatic {
  8137. /**
  8138. * Creates an array of the own and inherited enumerable property values of object.
  8139. * @param object The object to query.
  8140. * @return Returns the array of property values.
  8141. **/
  8142. valuesIn<T>(object?: any): T[];
  8143. }
  8144. interface LoDashImplicitObjectWrapper<T> {
  8145. /**
  8146. * @see _.valuesIn
  8147. **/
  8148. valuesIn<TResult>(): LoDashImplicitObjectWrapper<TResult[]>;
  8149. }
  8150. /**********
  8151. * String *
  8152. **********/
  8153. //_.camelCase
  8154. interface LoDashStatic {
  8155. /**
  8156. * Converts string to camel case.
  8157. *
  8158. * @param string The string to convert.
  8159. * @return Returns the camel cased string.
  8160. */
  8161. camelCase(string?: string): string;
  8162. }
  8163. interface LoDashImplicitWrapper<T> {
  8164. /**
  8165. * @see _.camelCase
  8166. */
  8167. camelCase(): string;
  8168. }
  8169. interface LoDashExplicitWrapper<T> {
  8170. /**
  8171. * @see _.camelCase
  8172. */
  8173. camelCase(): LoDashExplicitWrapper<string>;
  8174. }
  8175. //_.capitalize
  8176. interface LoDashStatic {
  8177. capitalize(string?: string): string;
  8178. }
  8179. interface LoDashImplicitWrapper<T> {
  8180. /**
  8181. * @see _.capitalize
  8182. */
  8183. capitalize(): string;
  8184. }
  8185. interface LoDashExplicitWrapper<T> {
  8186. /**
  8187. * @see _.capitalize
  8188. */
  8189. capitalize(): LoDashExplicitWrapper<string>;
  8190. }
  8191. //_.deburr
  8192. interface LoDashStatic {
  8193. /**
  8194. * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining
  8195. * diacritical marks.
  8196. * @param string The string to deburr.
  8197. * @return Returns the deburred string.
  8198. */
  8199. deburr(string?: string): string;
  8200. }
  8201. interface LoDashImplicitWrapper<T> {
  8202. /**
  8203. * @see _.deburr
  8204. */
  8205. deburr(): string;
  8206. }
  8207. //_.endsWith
  8208. interface LoDashStatic {
  8209. /**
  8210. * Checks if string ends with the given target string.
  8211. *
  8212. * @param string The string to search.
  8213. * @param target The string to search for.
  8214. * @param position The position to search from.
  8215. * @return Returns true if string ends with target, else false.
  8216. */
  8217. endsWith(
  8218. string?: string,
  8219. target?: string,
  8220. position?: number
  8221. ): boolean;
  8222. }
  8223. interface LoDashImplicitWrapper<T> {
  8224. /**
  8225. * @see _.endsWith
  8226. */
  8227. endsWith(
  8228. target?: string,
  8229. position?: number
  8230. ): boolean;
  8231. }
  8232. interface LoDashExplicitWrapper<T> {
  8233. /**
  8234. * @see _.endsWith
  8235. */
  8236. endsWith(
  8237. target?: string,
  8238. position?: number
  8239. ): LoDashExplicitWrapper<boolean>;
  8240. }
  8241. // _.escape
  8242. interface LoDashStatic {
  8243. /**
  8244. * Converts the characters "&", "<", ">", '"', "'", and "`", in string to their corresponding HTML entities.
  8245. * @param string The string to escape.
  8246. * @return Returns the escaped string.
  8247. */
  8248. escape(string?: string): string;
  8249. }
  8250. interface LoDashImplicitWrapper<T> {
  8251. /**
  8252. * @see _.escape
  8253. */
  8254. escape(): string;
  8255. }
  8256. // _.escapeRegExp
  8257. interface LoDashStatic {
  8258. /**
  8259. * Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]",
  8260. * "{" and "}" in string.
  8261. *
  8262. * @param string The string to escape.
  8263. * @return Returns the escaped string.
  8264. */
  8265. escapeRegExp(string?: string): string;
  8266. }
  8267. interface LoDashImplicitWrapper<T> {
  8268. /**
  8269. * @see _.escapeRegExp
  8270. */
  8271. escapeRegExp(): string;
  8272. }
  8273. interface LoDashExplicitWrapper<T> {
  8274. /**
  8275. * @see _.escapeRegExp
  8276. */
  8277. escapeRegExp(): LoDashExplicitWrapper<string>;
  8278. }
  8279. //_.kebabCase
  8280. interface LoDashStatic {
  8281. /**
  8282. * Converts string to kebab case.
  8283. * @param string The string to convert.
  8284. * @return Returns the kebab cased string.
  8285. */
  8286. kebabCase(string?: string): string;
  8287. }
  8288. interface LoDashImplicitWrapper<T> {
  8289. /**
  8290. * @see _.kebabCase
  8291. */
  8292. kebabCase(): string;
  8293. }
  8294. //_.pad
  8295. interface LoDashStatic {
  8296. /**
  8297. * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if
  8298. * they can’t be evenly divided by length.
  8299. *
  8300. * @param string The string to pad.
  8301. * @param length The padding length.
  8302. * @param chars The string used as padding.
  8303. * @return Returns the padded string.
  8304. */
  8305. pad(
  8306. string?: string,
  8307. length?: number,
  8308. chars?: string
  8309. ): string;
  8310. }
  8311. interface LoDashImplicitWrapper<T> {
  8312. /**
  8313. * @see _.pad
  8314. */
  8315. pad(
  8316. length?: number,
  8317. chars?: string
  8318. ): string;
  8319. }
  8320. interface LoDashExplicitWrapper<T> {
  8321. /**
  8322. * @see _.pad
  8323. */
  8324. pad(
  8325. length?: number,
  8326. chars?: string
  8327. ): LoDashExplicitWrapper<string>;
  8328. }
  8329. //_.padLeft
  8330. interface LoDashStatic {
  8331. /**
  8332. * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed
  8333. * length.
  8334. * @param string The string to pad.
  8335. * @param length The padding length.
  8336. * @param chars The string used as padding.
  8337. * @return Returns the padded string.
  8338. */
  8339. padLeft(string?: string, length?: number, chars?: string): string;
  8340. }
  8341. //_.padLeft
  8342. interface LoDashImplicitWrapper<T> {
  8343. /**
  8344. * @see _.padLeft
  8345. */
  8346. padLeft(length?: number, chars?: string): string;
  8347. }
  8348. //_.padRight
  8349. interface LoDashStatic {
  8350. /**
  8351. * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed
  8352. * length.
  8353. *
  8354. * @param string The string to pad.
  8355. * @param length The padding length.
  8356. * @param chars The string used as padding.
  8357. * @return Returns the padded string.
  8358. */
  8359. padRight(
  8360. string?: string,
  8361. length?: number,
  8362. chars?: string
  8363. ): string;
  8364. }
  8365. interface LoDashImplicitWrapper<T> {
  8366. /**
  8367. * @see _.padRight
  8368. */
  8369. padRight(
  8370. length?: number,
  8371. chars?: string
  8372. ): string;
  8373. }
  8374. interface LoDashExplicitWrapper<T> {
  8375. /**
  8376. * @see _.padRight
  8377. */
  8378. padRight(
  8379. length?: number,
  8380. chars?: string
  8381. ): LoDashExplicitWrapper<string>;
  8382. }
  8383. //_.parseInt
  8384. interface LoDashStatic {
  8385. /**
  8386. * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
  8387. * unless value is a hexadecimal, in which case a radix of 16 is used.
  8388. * Note: This method aligns with the ES5 implementation of parseInt.
  8389. * @param string The string to convert.
  8390. * @param radix The radix to interpret value by.
  8391. * @return Returns the converted integer.
  8392. */
  8393. parseInt(string: string, radix?: number): number;
  8394. }
  8395. interface LoDashImplicitWrapper<T> {
  8396. /**
  8397. * @see _.parseInt
  8398. */
  8399. parseInt(radix?: number): number;
  8400. }
  8401. //_.repeat
  8402. interface LoDashStatic {
  8403. /**
  8404. * Repeats the given string n times.
  8405. *
  8406. * @param string The string to repeat.
  8407. * @param n The number of times to repeat the string.
  8408. * @return Returns the repeated string.
  8409. */
  8410. repeat(
  8411. string?: string,
  8412. n?: number
  8413. ): string;
  8414. }
  8415. interface LoDashImplicitWrapper<T> {
  8416. /**
  8417. * @see _.repeat
  8418. */
  8419. repeat(n?: number): string;
  8420. }
  8421. interface LoDashExplicitWrapper<T> {
  8422. /**
  8423. * @see _.repeat
  8424. */
  8425. repeat(n?: number): LoDashExplicitWrapper<string>;
  8426. }
  8427. //_.snakeCase
  8428. interface LoDashStatic {
  8429. /**
  8430. * Converts string to snake case.
  8431. * @param string The string to convert.
  8432. * @return Returns the snake cased string.
  8433. */
  8434. snakeCase(string?: string): string;
  8435. }
  8436. interface LoDashImplicitWrapper<T> {
  8437. /**
  8438. * @see _.snakeCase
  8439. */
  8440. snakeCase(): string;
  8441. }
  8442. //_.startCase
  8443. interface LoDashStatic {
  8444. /**
  8445. * Converts string to start case.
  8446. *
  8447. * @param string The string to convert.
  8448. * @return Returns the start cased string.
  8449. */
  8450. startCase(string?: string): string;
  8451. }
  8452. interface LoDashImplicitWrapper<T> {
  8453. /**
  8454. * @see _.startCase
  8455. */
  8456. startCase(): string;
  8457. }
  8458. interface LoDashExplicitWrapper<T> {
  8459. /**
  8460. * @see _.startCase
  8461. */
  8462. startCase(): LoDashExplicitWrapper<string>;
  8463. }
  8464. //_.startsWith
  8465. interface LoDashStatic {
  8466. /**
  8467. * Checks if string starts with the given target string.
  8468. * @param string The string to search.
  8469. * @param target The string to search for.
  8470. * @param position The position to search from.
  8471. * @return Returns true if string starts with target, else false.
  8472. */
  8473. startsWith(string?: string, target?: string, position?: number): boolean;
  8474. }
  8475. interface LoDashImplicitWrapper<T> {
  8476. /**
  8477. * @see _.startsWith
  8478. */
  8479. startsWith(target?: string, position?: number): boolean;
  8480. }
  8481. //_.template
  8482. interface TemplateOptions extends TemplateSettings {
  8483. /**
  8484. * The sourceURL of the template's compiled source.
  8485. */
  8486. sourceURL?: string;
  8487. }
  8488. interface TemplateExecutor {
  8489. (data?: Object): string;
  8490. source: string;
  8491. }
  8492. interface LoDashStatic {
  8493. /**
  8494. * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters,
  8495. * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate"
  8496. * delimiters. Data properties may be accessed as free variables in the template. If a setting object is
  8497. * provided it takes precedence over _.templateSettings values.
  8498. *
  8499. * Note: In the development build _.template utilizes
  8500. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier
  8501. * debugging.
  8502. *
  8503. * For more information on precompiling templates see
  8504. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  8505. *
  8506. * For more information on Chrome extension sandboxes see
  8507. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  8508. *
  8509. * @param string The template string.
  8510. * @param options The options object.
  8511. * @param options.escape The HTML "escape" delimiter.
  8512. * @param options.evaluate The "evaluate" delimiter.
  8513. * @param options.imports An object to import into the template as free variables.
  8514. * @param options.interpolate The "interpolate" delimiter.
  8515. * @param options.sourceURL The sourceURL of the template's compiled source.
  8516. * @param options.variable The data object variable name.
  8517. * @return Returns the compiled template function.
  8518. */
  8519. template(
  8520. string: string,
  8521. options?: TemplateOptions
  8522. ): TemplateExecutor;
  8523. }
  8524. interface LoDashImplicitWrapper<T> {
  8525. /**
  8526. * @see _.template
  8527. */
  8528. template(options?: TemplateOptions): TemplateExecutor;
  8529. }
  8530. interface LoDashExplicitWrapper<T> {
  8531. /**
  8532. * @see _.template
  8533. */
  8534. template(options?: TemplateOptions): LoDashExplicitObjectWrapper<TemplateExecutor>;
  8535. }
  8536. //_.trim
  8537. interface LoDashStatic {
  8538. /**
  8539. * Removes leading and trailing whitespace or specified characters from string.
  8540. * @param string The string to trim.
  8541. * @param chars The characters to trim.
  8542. * @return Returns the trimmed string.
  8543. */
  8544. trim(string?: string, chars?: string): string;
  8545. }
  8546. interface LoDashImplicitWrapper<T> {
  8547. /**
  8548. * @see _.trim
  8549. */
  8550. trim(chars?: string): string;
  8551. }
  8552. //_.trimLeft
  8553. interface LoDashStatic {
  8554. /**
  8555. * Removes leading whitespace or specified characters from string.
  8556. *
  8557. * @param string The string to trim.
  8558. * @param chars The characters to trim.
  8559. * @return Returns the trimmed string.
  8560. */
  8561. trimLeft(
  8562. string?: string,
  8563. chars?: string
  8564. ): string;
  8565. }
  8566. interface LoDashImplicitWrapper<T> {
  8567. /**
  8568. * @see _.trimLeft
  8569. */
  8570. trimLeft(chars?: string): string;
  8571. }
  8572. interface LoDashExplicitWrapper<T> {
  8573. /**
  8574. * @see _.trimLeft
  8575. */
  8576. trimLeft(chars?: string): LoDashExplicitWrapper<string>;
  8577. }
  8578. //_.trimRight
  8579. interface LoDashStatic {
  8580. /**
  8581. * Removes trailing whitespace or specified characters from string.
  8582. * @param string The string to trim.
  8583. * @param chars The characters to trim.
  8584. * @return Returns the trimmed string.
  8585. */
  8586. trimRight(string?: string, chars?: string): string;
  8587. }
  8588. interface LoDashImplicitWrapper<T> {
  8589. /**
  8590. * @see _.trimRight
  8591. */
  8592. trimRight(chars?: string): string;
  8593. }
  8594. //_.trunc
  8595. interface TruncOptions {
  8596. /** The maximum string length. */
  8597. length?: number;
  8598. /** The string to indicate text is omitted. */
  8599. omission?: string;
  8600. /** The separator pattern to truncate to. */
  8601. separator?: string|RegExp;
  8602. }
  8603. interface LoDashStatic {
  8604. /**
  8605. * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated
  8606. * string are replaced with the omission string which defaults to "…".
  8607. *
  8608. * @param string The string to truncate.
  8609. * @param options The options object or maximum string length.
  8610. * @return Returns the truncated string.
  8611. */
  8612. trunc(
  8613. string?: string,
  8614. options?: TruncOptions|number
  8615. ): string;
  8616. }
  8617. interface LoDashImplicitWrapper<T> {
  8618. /**
  8619. * @see _.trunc
  8620. */
  8621. trunc(options?: TruncOptions|number): string;
  8622. }
  8623. interface LoDashExplicitWrapper<T> {
  8624. /**
  8625. * @see _.trunc
  8626. */
  8627. trunc(options?: TruncOptions|number): LoDashExplicitWrapper<string>;
  8628. }
  8629. //_.unescape
  8630. interface LoDashStatic {
  8631. /**
  8632. * The inverse of _.escape; this method converts the HTML entities &amp;, &lt;, &gt;, &quot;, &#39;, and &#96;
  8633. * in string to their corresponding characters.
  8634. * @param string The string to unescape.
  8635. * @return Returns the unescaped string.
  8636. */
  8637. unescape(string?: string): string;
  8638. }
  8639. interface LoDashImplicitWrapper<T> {
  8640. /**
  8641. * @see _.unescape
  8642. */
  8643. unescape(): string;
  8644. }
  8645. //_.words
  8646. interface LoDashStatic {
  8647. /**
  8648. * Splits string into an array of its words.
  8649. *
  8650. * @param string The string to inspect.
  8651. * @param pattern The pattern to match words.
  8652. * @return Returns the words of string.
  8653. */
  8654. words(
  8655. string?: string,
  8656. pattern?: string|RegExp
  8657. ): string[];
  8658. }
  8659. interface LoDashImplicitWrapper<T> {
  8660. /**
  8661. * @see _.words
  8662. */
  8663. words(pattern?: string|RegExp): string[];
  8664. }
  8665. interface LoDashExplicitWrapper<T> {
  8666. /**
  8667. * @see _.words
  8668. */
  8669. words(pattern?: string|RegExp): LoDashExplicitArrayWrapper<string>;
  8670. }
  8671. /***********
  8672. * Utility *
  8673. ***********/
  8674. //_.attempt
  8675. interface LoDashStatic {
  8676. /**
  8677. * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments
  8678. * are provided to func when it’s invoked.
  8679. *
  8680. * @param func The function to attempt.
  8681. * @return Returns the func result or error object.
  8682. */
  8683. attempt<TResult>(func: (...args: any[]) => TResult): TResult|Error;
  8684. }
  8685. interface LoDashImplicitObjectWrapper<T> {
  8686. /**
  8687. * @see _.attempt
  8688. */
  8689. attempt<TResult>(): TResult|Error;
  8690. }
  8691. interface LoDashExplicitObjectWrapper<T> {
  8692. /**
  8693. * @see _.attempt
  8694. */
  8695. attempt<TResult>(): LoDashExplicitObjectWrapper<TResult|Error>;
  8696. }
  8697. //_.callback
  8698. interface LoDashStatic {
  8699. /**
  8700. * Creates a function that invokes func with the this binding of thisArg and arguments of the created function.
  8701. * If func is a property name the created callback returns the property value for a given element. If func is
  8702. * an object the created callback returns true for elements that contain the equivalent object properties,
  8703. * otherwise it returns false.
  8704. *
  8705. * @param func The value to convert to a callback.
  8706. * @param thisArg The this binding of func.
  8707. * @result Returns the callback.
  8708. */
  8709. callback<TResult>(
  8710. func: Function,
  8711. thisArg?: any
  8712. ): (...args: any[]) => TResult;
  8713. /**
  8714. * @see _.callback
  8715. */
  8716. callback<TResult>(
  8717. func: string,
  8718. thisArg?: any
  8719. ): (object: any) => TResult;
  8720. /**
  8721. * @see _.callback
  8722. */
  8723. callback(
  8724. func: Object,
  8725. thisArg?: any
  8726. ): (object: any) => boolean;
  8727. /**
  8728. * @see _.callback
  8729. */
  8730. callback<TResult>(): (value: TResult) => TResult;
  8731. }
  8732. interface LoDashImplicitWrapper<T> {
  8733. /**
  8734. * @see _.callback
  8735. */
  8736. callback<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
  8737. }
  8738. interface LoDashImplicitObjectWrapper<T> {
  8739. /**
  8740. * @see _.callback
  8741. */
  8742. callback(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;
  8743. /**
  8744. * @see _.callback
  8745. */
  8746. callback<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
  8747. }
  8748. //_.constant
  8749. interface LoDashStatic {
  8750. /**
  8751. * Creates a function that returns value.
  8752. *
  8753. * @param value The value to return from the new function.
  8754. * @return Returns the new function.
  8755. */
  8756. constant<T>(value: T): () => T;
  8757. }
  8758. interface LoDashImplicitWrapperBase<T, TWrapper> {
  8759. /**
  8760. * @see _.constant
  8761. */
  8762. constant<TResult>(): LoDashImplicitObjectWrapper<() => TResult>;
  8763. }
  8764. interface LoDashExplicitWrapperBase<T, TWrapper> {
  8765. /**
  8766. * @see _.constant
  8767. */
  8768. constant<TResult>(): LoDashExplicitObjectWrapper<() => TResult>;
  8769. }
  8770. //_.identity
  8771. interface LoDashStatic {
  8772. /**
  8773. * This method returns the first argument provided to it.
  8774. * @param value Any value.
  8775. * @return Returns value.
  8776. */
  8777. identity<T>(value?: T): T;
  8778. }
  8779. interface LoDashImplicitWrapper<T> {
  8780. /**
  8781. * @see _.identity
  8782. */
  8783. identity(): T;
  8784. }
  8785. interface LoDashImplicitArrayWrapper<T> {
  8786. /**
  8787. * @see _.identity
  8788. */
  8789. identity(): T[];
  8790. }
  8791. interface LoDashImplicitObjectWrapper<T> {
  8792. /**
  8793. * @see _.identity
  8794. */
  8795. identity(): T;
  8796. }
  8797. //_.iteratee
  8798. interface LoDashStatic {
  8799. /**
  8800. * @see _.callback
  8801. */
  8802. iteratee<TResult>(
  8803. func: Function,
  8804. thisArg?: any
  8805. ): (...args: any[]) => TResult;
  8806. /**
  8807. * @see _.callback
  8808. */
  8809. iteratee<TResult>(
  8810. func: string,
  8811. thisArg?: any
  8812. ): (object: any) => TResult;
  8813. /**
  8814. * @see _.callback
  8815. */
  8816. iteratee(
  8817. func: Object,
  8818. thisArg?: any
  8819. ): (object: any) => boolean;
  8820. /**
  8821. * @see _.callback
  8822. */
  8823. iteratee<TResult>(): (value: TResult) => TResult;
  8824. }
  8825. interface LoDashImplicitWrapper<T> {
  8826. /**
  8827. * @see _.callback
  8828. */
  8829. iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
  8830. }
  8831. interface LoDashImplicitObjectWrapper<T> {
  8832. /**
  8833. * @see _.callback
  8834. */
  8835. iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;
  8836. /**
  8837. * @see _.callback
  8838. */
  8839. iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
  8840. }
  8841. //_.matches
  8842. interface LoDashStatic {
  8843. /**
  8844. * Creates a function that performs a deep comparison between a given object and source, returning true if the
  8845. * given object has equivalent property values, else false.
  8846. *
  8847. * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
  8848. * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own
  8849. * or inherited property value see _.matchesProperty.
  8850. *
  8851. * @param source The object of property values to match.
  8852. * @return Returns the new function.
  8853. */
  8854. matches<T>(source: T): (value: any) => boolean;
  8855. /**
  8856. * @see _.matches
  8857. */
  8858. matches<T, V>(source: T): (value: V) => boolean;
  8859. }
  8860. interface LoDashImplicitWrapperBase<T, TWrapper> {
  8861. /**
  8862. * @see _.matches
  8863. */
  8864. matches<V>(): LoDashImplicitObjectWrapper<(value: V) => boolean>;
  8865. }
  8866. interface LoDashExplicitWrapperBase<T, TWrapper> {
  8867. /**
  8868. * @see _.matches
  8869. */
  8870. matches<V>(): LoDashExplicitObjectWrapper<(value: V) => boolean>;
  8871. }
  8872. //_.matchesProperty
  8873. interface LoDashStatic {
  8874. /**
  8875. * Creates a function that compares the property value of path on a given object to value.
  8876. *
  8877. * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
  8878. * strings. Objects are compared by their own, not inherited, enumerable properties.
  8879. *
  8880. * @param path The path of the property to get.
  8881. * @param srcValue The value to match.
  8882. * @return Returns the new function.
  8883. */
  8884. matchesProperty<T>(
  8885. path: StringRepresentable|StringRepresentable[],
  8886. srcValue: T
  8887. ): (value: any) => boolean;
  8888. /**
  8889. * @see _.matchesProperty
  8890. */
  8891. matchesProperty<T, V>(
  8892. path: StringRepresentable|StringRepresentable[],
  8893. srcValue: T
  8894. ): (value: V) => boolean;
  8895. }
  8896. interface LoDashImplicitWrapperBase<T, TWrapper> {
  8897. /**
  8898. * @see _.matchesProperty
  8899. */
  8900. matchesProperty<SrcValue>(
  8901. srcValue: SrcValue
  8902. ): LoDashImplicitObjectWrapper<(value: any) => boolean>;
  8903. /**
  8904. * @see _.matchesProperty
  8905. */
  8906. matchesProperty<SrcValue, Value>(
  8907. srcValue: SrcValue
  8908. ): LoDashImplicitObjectWrapper<(value: Value) => boolean>;
  8909. }
  8910. //_.method
  8911. interface LoDashStatic {
  8912. /**
  8913. * Creates a function that invokes the method at path on a given object. Any additional arguments are provided
  8914. * to the invoked method.
  8915. *
  8916. * @param path The path of the method to invoke.
  8917. * @param args The arguments to invoke the method with.
  8918. * @return Returns the new function.
  8919. */
  8920. method<TObject, TResult>(
  8921. path: string|StringRepresentable[],
  8922. ...args: any[]
  8923. ): (object: TObject) => TResult;
  8924. /**
  8925. * @see _.method
  8926. */
  8927. method<TResult>(
  8928. path: string|StringRepresentable[],
  8929. ...args: any[]
  8930. ): (object: any) => TResult;
  8931. }
  8932. interface LoDashImplicitWrapper<T> {
  8933. /**
  8934. * @see _.method
  8935. */
  8936. method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
  8937. /**
  8938. * @see _.method
  8939. */
  8940. method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
  8941. }
  8942. interface LoDashImplicitArrayWrapper<T> {
  8943. /**
  8944. * @see _.method
  8945. */
  8946. method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
  8947. /**
  8948. * @see _.method
  8949. */
  8950. method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
  8951. }
  8952. interface LoDashExplicitWrapper<T> {
  8953. /**
  8954. * @see _.method
  8955. */
  8956. method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
  8957. /**
  8958. * @see _.method
  8959. */
  8960. method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
  8961. }
  8962. interface LoDashExplicitArrayWrapper<T> {
  8963. /**
  8964. * @see _.method
  8965. */
  8966. method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
  8967. /**
  8968. * @see _.method
  8969. */
  8970. method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
  8971. }
  8972. //_.methodOf
  8973. interface LoDashStatic {
  8974. /**
  8975. * The opposite of _.method; this method creates a function that invokes the method at a given path on object.
  8976. * Any additional arguments are provided to the invoked method.
  8977. * @param object The object to query.
  8978. * @param args The arguments to invoke the method with.
  8979. * @return Returns the new function.
  8980. */
  8981. methodOf<TResult>(object: Object, ...args: any[]): (path: string | any[]) => TResult;
  8982. }
  8983. interface LoDashImplicitObjectWrapper<T> {
  8984. /**
  8985. * @see _.methodOf
  8986. */
  8987. methodOf<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(path: string | any[]) => TResult>;
  8988. }
  8989. //_.mixin
  8990. interface MixinOptions {
  8991. chain?: boolean;
  8992. }
  8993. interface LoDashStatic {
  8994. /**
  8995. * Adds all own enumerable function properties of a source object to the destination object. If object is a
  8996. * function then methods are added to its prototype as well.
  8997. *
  8998. * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying
  8999. * the original.
  9000. *
  9001. * @param object The destination object.
  9002. * @param source The object of functions to add.
  9003. * @param options The options object.
  9004. * @param options.chain Specify whether the functions added are chainable.
  9005. * @return Returns object.
  9006. */
  9007. mixin<TResult, TObject>(
  9008. object: TObject,
  9009. source: Dictionary<Function>,
  9010. options?: MixinOptions
  9011. ): TResult;
  9012. /**
  9013. * @see _.mixin
  9014. */
  9015. mixin<TResult>(
  9016. source: Dictionary<Function>,
  9017. options?: MixinOptions
  9018. ): TResult;
  9019. }
  9020. interface LoDashImplicitObjectWrapper<T> {
  9021. /**
  9022. * @see _.mixin
  9023. */
  9024. mixin<TResult>(
  9025. source: Dictionary<Function>,
  9026. options?: MixinOptions
  9027. ): LoDashImplicitObjectWrapper<TResult>;
  9028. /**
  9029. * @see _.mixin
  9030. */
  9031. mixin<TResult>(
  9032. options?: MixinOptions
  9033. ): LoDashImplicitObjectWrapper<TResult>;
  9034. }
  9035. interface LoDashExplicitObjectWrapper<T> {
  9036. /**
  9037. * @see _.mixin
  9038. */
  9039. mixin<TResult>(
  9040. source: Dictionary<Function>,
  9041. options?: MixinOptions
  9042. ): LoDashExplicitObjectWrapper<TResult>;
  9043. /**
  9044. * @see _.mixin
  9045. */
  9046. mixin<TResult>(
  9047. options?: MixinOptions
  9048. ): LoDashExplicitObjectWrapper<TResult>;
  9049. }
  9050. //_.noConflict
  9051. interface LoDashStatic {
  9052. /**
  9053. * Reverts the _ variable to its previous value and returns a reference to the lodash function.
  9054. *
  9055. * @return Returns the lodash function.
  9056. */
  9057. noConflict(): typeof _;
  9058. }
  9059. interface LoDashImplicitWrapperBase<T, TWrapper> {
  9060. /**
  9061. * @see _.noConflict
  9062. */
  9063. noConflict(): typeof _;
  9064. }
  9065. //_.noop
  9066. interface LoDashStatic {
  9067. /**
  9068. * A no-operation function that returns undefined regardless of the arguments it receives.
  9069. * @return undefined
  9070. */
  9071. noop(...args: any[]): void;
  9072. }
  9073. interface LoDashImplicitWrapperBase<T, TWrapper> {
  9074. /**
  9075. * @see _.noop
  9076. */
  9077. noop(...args: any[]): void;
  9078. }
  9079. //_.property
  9080. interface LoDashStatic {
  9081. /**
  9082. * Creates a function that returns the property value at path on a given object.
  9083. * @param path The path of the property to get.
  9084. * @return Returns the new function.
  9085. */
  9086. property<TObj, TResult>(path: string|string[]): (obj: TObj) => TResult;
  9087. }
  9088. interface LoDashImplicitStringWrapper {
  9089. /**
  9090. * @see _.property
  9091. */
  9092. property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
  9093. }
  9094. interface LoDashImplicitArrayWrapper<T> {
  9095. /**
  9096. * @see _.property
  9097. */
  9098. property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
  9099. }
  9100. //_.propertyOf
  9101. interface LoDashStatic {
  9102. /**
  9103. * The opposite of _.property; this method creates a function that returns the property value at a given path
  9104. * on object.
  9105. * @param object The object to query.
  9106. * @return Returns the new function.
  9107. */
  9108. propertyOf<T extends {}>(object: T): (path: string|string[]) => any;
  9109. }
  9110. interface LoDashImplicitObjectWrapper<T> {
  9111. /**
  9112. * @see _.propertyOf
  9113. */
  9114. propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
  9115. }
  9116. //_.range
  9117. interface LoDashStatic {
  9118. /**
  9119. * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
  9120. * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length
  9121. * range is created unless a negative step is specified.
  9122. * @param start The start of the range.
  9123. * @param end The end of the range.
  9124. * @param step The value to increment or decrement by.
  9125. * @return Returns a new range array.
  9126. */
  9127. range(
  9128. start: number,
  9129. end: number,
  9130. step?: number): number[];
  9131. /**
  9132. * @see _.range
  9133. */
  9134. range(
  9135. end: number,
  9136. step?: number): number[];
  9137. }
  9138. interface LoDashImplicitWrapper<T> {
  9139. /**
  9140. * @see _.range
  9141. */
  9142. range(
  9143. end?: number,
  9144. step?: number): LoDashImplicitArrayWrapper<number>;
  9145. }
  9146. //_.runInContext
  9147. interface LoDashStatic {
  9148. /**
  9149. * Create a new pristine lodash function using the given context object.
  9150. *
  9151. * @param context The context object.
  9152. * @return Returns a new lodash function.
  9153. */
  9154. runInContext(context?: Object): typeof _;
  9155. }
  9156. interface LoDashImplicitObjectWrapper<T> {
  9157. /**
  9158. * @see _.runInContext
  9159. */
  9160. runInContext(): typeof _;
  9161. }
  9162. //_.times
  9163. interface LoDashStatic {
  9164. /**
  9165. * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is
  9166. * bound to thisArg and invoked with one argument; (index).
  9167. *
  9168. * @param n The number of times to invoke iteratee.
  9169. * @param iteratee The function invoked per iteration.
  9170. * @param thisArg The this binding of iteratee.
  9171. * @return Returns the array of results.
  9172. */
  9173. times<TResult>(
  9174. n: number,
  9175. iteratee: (num: number) => TResult,
  9176. thisArg?: any
  9177. ): TResult[];
  9178. /**
  9179. * @see _.times
  9180. */
  9181. times(n: number): number[];
  9182. }
  9183. interface LoDashImplicitWrapper<T> {
  9184. /**
  9185. * @see _.times
  9186. */
  9187. times<TResult>(
  9188. iteratee: (num: number) => TResult,
  9189. thisArgs?: any
  9190. ): LoDashImplicitArrayWrapper<TResult>;
  9191. /**
  9192. * @see _.times
  9193. */
  9194. times(): LoDashImplicitArrayWrapper<number>;
  9195. }
  9196. //_.uniqueId
  9197. interface LoDashStatic {
  9198. /**
  9199. * Generates a unique ID. If prefix is provided the ID is appended to it.
  9200. * @param prefix The value to prefix the ID with.
  9201. * @return Returns the unique ID.
  9202. */
  9203. uniqueId(prefix?: string): string;
  9204. }
  9205. interface LoDashImplicitWrapper<T> {
  9206. /**
  9207. * @see _.uniqueId
  9208. */
  9209. uniqueId(): string;
  9210. }
  9211. interface ListIterator<T, TResult> {
  9212. (value: T, index: number, collection: List<T>): TResult;
  9213. }
  9214. interface DictionaryIterator<T, TResult> {
  9215. (value: T, key?: string, collection?: Dictionary<T>): TResult;
  9216. }
  9217. interface ObjectIterator<T, TResult> {
  9218. (element: T, key?: string, collection?: any): TResult;
  9219. }
  9220. interface MemoVoidIterator<T, TResult> {
  9221. (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void;
  9222. }
  9223. interface MemoIterator<T, TResult> {
  9224. (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult;
  9225. }
  9226. interface MemoVoidArrayIterator<T, TResult> {
  9227. (acc: TResult, curr: T, index?: number, arr?: T[]): void;
  9228. }
  9229. interface MemoVoidDictionaryIterator<T, TResult> {
  9230. (acc: TResult, curr: T, key?: string, dict?: Dictionary<T>): void;
  9231. }
  9232. //interface Collection<T> {}
  9233. // Common interface between Arrays and jQuery objects
  9234. interface List<T> {
  9235. [index: number]: T;
  9236. length: number;
  9237. }
  9238. interface Dictionary<T> {
  9239. [index: string]: T;
  9240. }
  9241. interface StringRepresentable {
  9242. toString(): string;
  9243. }
  9244. }
  9245. declare module "lodash" {
  9246. export = _;
  9247. }