lodash.d.ts 240 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521
  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): LoDashWrapper<number>;
  40. (value: string): LoDashStringWrapper;
  41. (value: boolean): LoDashWrapper<boolean>;
  42. (value: Array<number>): LoDashNumberArrayWrapper;
  43. <T>(value: Array<T>): LoDashArrayWrapper<T>;
  44. <T extends {}>(value: T): LoDashObjectWrapper<T>;
  45. (value: any): LoDashWrapper<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. /**
  189. * Produces the toString result of the wrapped value.
  190. * @return Returns the string result.
  191. **/
  192. toString(): string;
  193. /**
  194. * Executes the chained sequence to extract the unwrapped value.
  195. * @return Returns the resolved unwrapped value.
  196. **/
  197. value(): T;
  198. /**
  199. * @see _.value
  200. **/
  201. run(): T;
  202. /**
  203. * @see _.value
  204. **/
  205. toJSON(): T;
  206. /**
  207. * @see _.value
  208. **/
  209. valueOf(): T;
  210. /**
  211. * @see _.toPlainObject
  212. */
  213. toPlainObject(): Object;
  214. }
  215. interface LoDashWrapper<T> extends LoDashWrapperBase<T, LoDashWrapper<T>> { }
  216. interface LoDashStringWrapper extends LoDashWrapper<string> { }
  217. interface LoDashObjectWrapper<T> extends LoDashWrapperBase<T, LoDashObjectWrapper<T>> { }
  218. interface LoDashArrayWrapper<T> extends LoDashWrapperBase<T[], LoDashArrayWrapper<T>> {
  219. concat(...items: Array<T|Array<T>>): LoDashArrayWrapper<T>;
  220. join(seperator?: string): string;
  221. pop(): T;
  222. push(...items: T[]): LoDashArrayWrapper<T>;
  223. reverse(): LoDashArrayWrapper<T>;
  224. shift(): T;
  225. slice(start: number, end?: number): LoDashArrayWrapper<T>;
  226. sort(compareFn?: (a: T, b: T) => number): LoDashArrayWrapper<T>;
  227. splice(start: number): LoDashArrayWrapper<T>;
  228. splice(start: number, deleteCount: number, ...items: any[]): LoDashArrayWrapper<T>;
  229. unshift(...items: T[]): LoDashArrayWrapper<T>;
  230. }
  231. interface LoDashNumberArrayWrapper extends LoDashArrayWrapper<number> { }
  232. //_.chain
  233. interface LoDashStatic {
  234. /**
  235. * Creates a lodash object that wraps the given value with explicit method chaining enabled.
  236. * @param value The value to wrap.
  237. * @return The wrapper object.
  238. **/
  239. chain(value: number): LoDashWrapper<number>;
  240. chain(value: string): LoDashWrapper<string>;
  241. chain(value: boolean): LoDashWrapper<boolean>;
  242. chain<T>(value: Array<T>): LoDashArrayWrapper<T>;
  243. chain<T extends {}>(value: T): LoDashObjectWrapper<T>;
  244. chain(value: any): LoDashWrapper<any>;
  245. }
  246. interface LoDashWrapperBase<T, TWrapper> {
  247. /**
  248. * Enables explicit method chaining on the wrapper object.
  249. * @see _.chain
  250. * @return The wrapper object.
  251. **/
  252. chain(): TWrapper;
  253. }
  254. //_.tap
  255. interface LoDashStatic {
  256. /**
  257. * Invokes interceptor with the value as the first argument and then returns value. The
  258. * purpose of this method is to "tap into" a method chain in order to perform operations on
  259. * intermediate results within the chain.
  260. * @param value The value to provide to interceptor
  261. * @param interceptor The function to invoke.
  262. * @return value
  263. **/
  264. tap<T>(
  265. value: T,
  266. interceptor: (value: T) => void): T;
  267. }
  268. interface LoDashWrapperBase<T, TWrapper> {
  269. /**
  270. * @see _.tap
  271. **/
  272. tap(interceptor: (value: T) => void): TWrapper;
  273. }
  274. /*********
  275. * Arrays *
  276. **********/
  277. //_.chunk
  278. interface LoDashStatic {
  279. /**
  280. * Creates an array of elements split into groups the length of size. If collection can't be
  281. * split evenly, the final chunk will be the remaining elements.
  282. * @param array The array to process.
  283. * @param size The length of each chunk.
  284. * @return Returns the new array containing chunks.
  285. **/
  286. chunk<T>(array: Array<T>, size?: number): T[][];
  287. /**
  288. * @see _.chunk
  289. **/
  290. chunk<T>(array: List<T>, size?: number): T[][];
  291. }
  292. interface LoDashArrayWrapper<T> {
  293. /**
  294. * @see _.chunk
  295. **/
  296. chunk(size?: number): LoDashArrayWrapper<T[]>;
  297. }
  298. //_.compact
  299. interface LoDashStatic {
  300. /**
  301. * Returns a copy of the array with all falsy values removed. In JavaScript, false, null, 0, "",
  302. * undefined and NaN are all falsy.
  303. * @param array Array to compact.
  304. * @return (Array) Returns a new array of filtered values.
  305. **/
  306. compact<T>(array?: Array<T>): T[];
  307. /**
  308. * @see _.compact
  309. **/
  310. compact<T>(array?: List<T>): T[];
  311. }
  312. interface LoDashArrayWrapper<T> {
  313. /**
  314. * @see _.compact
  315. **/
  316. compact(): LoDashArrayWrapper<T>;
  317. }
  318. //_.difference
  319. interface LoDashStatic {
  320. /**
  321. * Creates an array excluding all values of the provided arrays using strict equality for comparisons
  322. * , i.e. ===.
  323. * @param array The array to process
  324. * @param others The arrays of values to exclude.
  325. * @return Returns a new array of filtered values.
  326. **/
  327. difference<T>(
  328. array?: Array<T>,
  329. ...others: Array<T>[]): T[];
  330. /**
  331. * @see _.difference
  332. **/
  333. difference<T>(
  334. array?: List<T>,
  335. ...others: List<T>[]): T[];
  336. }
  337. interface LoDashArrayWrapper<T> {
  338. /**
  339. * @see _.difference
  340. **/
  341. difference(
  342. ...others: Array<T>[]): LoDashArrayWrapper<T>;
  343. /**
  344. * @see _.difference
  345. **/
  346. difference(
  347. ...others: List<T>[]): LoDashArrayWrapper<T>;
  348. }
  349. //_.findIndex
  350. interface LoDashStatic {
  351. /**
  352. * This method is like _.find except that it returns the index of the first element that passes
  353. * the callback check, instead of the element itself.
  354. * @param array The array to search.
  355. * @param {(Function|Object|string)} callback The function called per iteration. If a property name or object is provided it will be
  356. * used to create a ".pluck" or ".where" style callback, respectively.
  357. * @param thisArg The this binding of callback.
  358. * @return Returns the index of the found element, else -1.
  359. **/
  360. findIndex<T>(
  361. array: Array<T>,
  362. callback: ListIterator<T, boolean>,
  363. thisArg?: any): number;
  364. /**
  365. * @see _.findIndex
  366. **/
  367. findIndex<T>(
  368. array: List<T>,
  369. callback: ListIterator<T, boolean>,
  370. thisArg?: any): number;
  371. /**
  372. * @see _.findIndex
  373. **/
  374. findIndex<T>(
  375. array: Array<T>,
  376. pluckValue: string): number;
  377. /**
  378. * @see _.findIndex
  379. **/
  380. findIndex<T>(
  381. array: List<T>,
  382. pluckValue: string): number;
  383. /**
  384. * @see _.findIndex
  385. **/
  386. findIndex<W, T>(
  387. array: Array<T>,
  388. whereDictionary: W): number;
  389. /**
  390. * @see _.findIndex
  391. **/
  392. findIndex<W, T>(
  393. array: List<T>,
  394. whereDictionary: W): number;
  395. }
  396. //_.findLastIndex
  397. interface LoDashStatic {
  398. /**
  399. * This method is like _.findIndex except that it iterates over elements of a collection from right to left.
  400. * @param array The array to search.
  401. * @param {(Function|Object|string)} callback The function called per iteration. If a property name or object is provided it will be
  402. * used to create a ".pluck" or ".where" style callback, respectively.
  403. * @param thisArg The this binding of callback.
  404. * @return Returns the index of the found element, else -1.
  405. **/
  406. findLastIndex<T>(
  407. array: Array<T>,
  408. callback: ListIterator<T, boolean>,
  409. thisArg?: any): number;
  410. /**
  411. * @see _.findLastIndex
  412. **/
  413. findLastIndex<T>(
  414. array: List<T>,
  415. callback: ListIterator<T, boolean>,
  416. thisArg?: any): number;
  417. /**
  418. * @see _.findLastIndex
  419. **/
  420. findLastIndex<T>(
  421. array: Array<T>,
  422. pluckValue: string): number;
  423. /**
  424. * @see _.findLastIndex
  425. **/
  426. findLastIndex<T>(
  427. array: List<T>,
  428. pluckValue: string): number;
  429. /**
  430. * @see _.findLastIndex
  431. **/
  432. findLastIndex<T>(
  433. array: Array<T>,
  434. whereDictionary: Dictionary<any>): number;
  435. /**
  436. * @see _.findLastIndex
  437. **/
  438. findLastIndex<T>(
  439. array: List<T>,
  440. whereDictionary: Dictionary<any>): number;
  441. }
  442. //_.first
  443. interface LoDashStatic {
  444. /**
  445. * Gets the first element or first n elements of an array. If a callback is provided
  446. * elements at the beginning of the array are returned as long as the callback returns
  447. * truey. The callback is bound to thisArg and invoked with three arguments; (value,
  448. * index, array).
  449. *
  450. * If a property name is provided for callback the created "_.pluck" style callback
  451. * will return the property value of the given element.
  452. *
  453. * If an object is provided for callback the created "_.where" style callback will return ]
  454. * true for elements that have the properties of the given object, else false.
  455. * @param array Retrieves the first element of this array.
  456. * @return Returns the first element of `array`.
  457. **/
  458. first<T>(array?: Array<T>): T;
  459. /**
  460. * @see _.first
  461. **/
  462. first<T>(array?: List<T>): T;
  463. /**
  464. * @see _.first
  465. * @param n The number of elements to return.
  466. **/
  467. first<T>(
  468. array: Array<T>,
  469. n: number): T[];
  470. /**
  471. * @see _.first
  472. * @param n The number of elements to return.
  473. **/
  474. first<T>(
  475. array: List<T>,
  476. n: number): T[];
  477. /**
  478. * @see _.first
  479. * @param callback The function called per element.
  480. * @param [thisArg] The this binding of callback.
  481. **/
  482. first<T>(
  483. array: Array<T>,
  484. callback: ListIterator<T, boolean>,
  485. thisArg?: any): T[];
  486. /**
  487. * @see _.first
  488. * @param callback The function called per element.
  489. * @param [thisArg] The this binding of callback.
  490. **/
  491. first<T>(
  492. array: List<T>,
  493. callback: ListIterator<T, boolean>,
  494. thisArg?: any): T[];
  495. /**
  496. * @see _.first
  497. * @param pluckValue "_.pluck" style callback value
  498. **/
  499. first<T>(
  500. array: Array<T>,
  501. pluckValue: string): T[];
  502. /**
  503. * @see _.first
  504. * @param pluckValue "_.pluck" style callback value
  505. **/
  506. first<T>(
  507. array: List<T>,
  508. pluckValue: string): T[];
  509. /**
  510. * @see _.first
  511. * @param whereValue "_.where" style callback value
  512. **/
  513. first<W, T>(
  514. array: Array<T>,
  515. whereValue: W): T[];
  516. /**
  517. * @see _.first
  518. * @param whereValue "_.where" style callback value
  519. **/
  520. first<W, T>(
  521. array: List<T>,
  522. whereValue: W): T[];
  523. /**
  524. * @see _.first
  525. **/
  526. head<T>(array: Array<T>): T;
  527. /**
  528. * @see _.first
  529. **/
  530. head<T>(array: List<T>): T;
  531. /**
  532. * @see _.first
  533. **/
  534. head<T>(
  535. array: Array<T>,
  536. n: number): T[];
  537. /**
  538. * @see _.first
  539. **/
  540. head<T>(
  541. array: List<T>,
  542. n: number): T[];
  543. /**
  544. * @see _.first
  545. **/
  546. head<T>(
  547. array: Array<T>,
  548. callback: ListIterator<T, boolean>,
  549. thisArg?: any): T[];
  550. /**
  551. * @see _.first
  552. **/
  553. head<T>(
  554. array: List<T>,
  555. callback: ListIterator<T, boolean>,
  556. thisArg?: any): T[];
  557. /**
  558. * @see _.first
  559. **/
  560. head<T>(
  561. array: Array<T>,
  562. pluckValue: string): T[];
  563. /**
  564. * @see _.first
  565. **/
  566. head<T>(
  567. array: List<T>,
  568. pluckValue: string): T[];
  569. /**
  570. * @see _.first
  571. **/
  572. head<W, T>(
  573. array: Array<T>,
  574. whereValue: W): T[];
  575. /**
  576. * @see _.first
  577. **/
  578. head<W, T>(
  579. array: List<T>,
  580. whereValue: W): T[];
  581. /**
  582. * @see _.first
  583. **/
  584. take<T>(array: Array<T>): T[];
  585. /**
  586. * @see _.first
  587. **/
  588. take<T>(array: List<T>): T[];
  589. /**
  590. * @see _.first
  591. **/
  592. take<T>(
  593. array: Array<T>,
  594. n: number): T[];
  595. /**
  596. * @see _.first
  597. **/
  598. take<T>(
  599. array: List<T>,
  600. n: number): T[];
  601. /**
  602. * Takes the first items from an array or list based on a predicate
  603. * @param array The array or list of items on which the result set will be based
  604. * @param predicate A predicate function to determine whether a value will be taken. Optional; defaults to identity.
  605. * @param [thisArg] The this binding of predicate.
  606. */
  607. takeWhile<T>(
  608. array: (Array<T>|List<T>),
  609. predicate?: ListIterator<T, boolean>,
  610. thisArg?: any
  611. ): T[];
  612. /**
  613. * Takes the first items from an array or list based on a predicate
  614. * @param array The array or list of items on which the result set will be based
  615. * @param pluckValue Uses a _.property style callback to return the property value of the given element
  616. */
  617. takeWhile<T>(
  618. array: (Array<T>|List<T>),
  619. pluckValue: string
  620. ): any[];
  621. /**
  622. * Takes the first items from an array or list based on a predicate
  623. * @param array The array or list of items on which the result set will be based
  624. * @param whereValue Uses a _.matches style callback to return the first elements that match the given value
  625. */
  626. takeWhile<W, T>(
  627. array: (Array<T>|List<T>),
  628. whereValue: W
  629. ): T[];
  630. }
  631. interface LoDashArrayWrapper<T> {
  632. /**
  633. * @see _.first
  634. **/
  635. first(): T;
  636. /**
  637. * @see _.first
  638. * @param n The number of elements to return.
  639. **/
  640. first(n: number): LoDashArrayWrapper<T>;
  641. /**
  642. * @see _.first
  643. * @param callback The function called per element.
  644. * @param [thisArg] The this binding of callback.
  645. **/
  646. first(
  647. callback: ListIterator<T, boolean>,
  648. thisArg?: any): LoDashArrayWrapper<T>;
  649. /**
  650. * @see _.first
  651. * @param pluckValue "_.pluck" style callback value
  652. **/
  653. first(pluckValue: string): LoDashArrayWrapper<T>;
  654. /**
  655. * @see _.first
  656. * @param whereValue "_.where" style callback value
  657. **/
  658. first<W>(whereValue: W): LoDashArrayWrapper<T>;
  659. /**
  660. * @see _.first
  661. **/
  662. head(): T;
  663. /**
  664. * @see _.first
  665. * @param n The number of elements to return.
  666. **/
  667. head(n: number): LoDashArrayWrapper<T>;
  668. /**
  669. * @see _.first
  670. * @param callback The function called per element.
  671. * @param [thisArg] The this binding of callback.
  672. **/
  673. head(
  674. callback: ListIterator<T, boolean>,
  675. thisArg?: any): LoDashArrayWrapper<T>;
  676. /**
  677. * @see _.first
  678. * @param pluckValue "_.pluck" style callback value
  679. **/
  680. head(pluckValue: string): LoDashArrayWrapper<T>;
  681. /**
  682. * @see _.first
  683. * @param whereValue "_.where" style callback value
  684. **/
  685. head<W>(whereValue: W): LoDashArrayWrapper<T>;
  686. /**
  687. * @see _.first
  688. **/
  689. take(): LoDashArrayWrapper<T>;
  690. /**
  691. * @see _.first
  692. * @param n The number of elements to return.
  693. **/
  694. take(n: number): LoDashArrayWrapper<T>;
  695. /**
  696. * Takes the first items based on a predicate
  697. * @param predicate The function called per element.
  698. * @param [thisArg] The this binding of callback.
  699. **/
  700. takeWhile(
  701. predicate: ListIterator<T, boolean>,
  702. thisArg?: any): LoDashArrayWrapper<T>;
  703. /**
  704. * Takes the first items based on a predicate
  705. * @param pluckValue Uses a _.property style callback to return the property value of the given element
  706. **/
  707. takeWhile<T>(
  708. pluckValue: string): LoDashArrayWrapper<any>;
  709. /**
  710. * Takes the first items based on a predicate
  711. * @param whereValue Uses a _.matches style callback to return the first elements that match the given value
  712. **/
  713. takeWhile<W, T>(
  714. whereValue: W): LoDashArrayWrapper<T>;
  715. }
  716. interface MaybeNestedList<T> extends List<T|List<T>> { }
  717. interface RecursiveList<T> extends List<T|RecursiveList<T>> { }
  718. //_.flatten
  719. interface LoDashStatic {
  720. /**
  721. * Flattens a nested array a single level.
  722. *
  723. * _.flatten(x) is equivalent to _.flatten(x, false);
  724. *
  725. * @param array The array to flatten.
  726. * @return `array` flattened.
  727. **/
  728. flatten<T>(array: MaybeNestedList<T>): T[];
  729. /**
  730. * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it is only
  731. * flattened a single level.
  732. *
  733. * If you know whether or not this should be recursively at compile time, you typically want to use a
  734. * version without a boolean parameter (i.e. `_.flatten(x)` or `_.flattenDeep(x)`).
  735. *
  736. * @param array The array to flatten.
  737. * @param deep Specify a deep flatten.
  738. * @return `array` flattened.
  739. **/
  740. flatten<T>(array: RecursiveList<T>, isDeep: boolean): List<T> | RecursiveList<T>;
  741. /**
  742. * Recursively flattens a nested array.
  743. *
  744. * _.flattenDeep(x) is equivalent to _.flatten(x, true);
  745. *
  746. * @param array The array to flatten
  747. * @return `array` recursively flattened
  748. */
  749. flattenDeep<T>(array: RecursiveList<T>): List<T>
  750. }
  751. interface LoDashArrayWrapper<T> {
  752. /**
  753. * @see _.flatten
  754. **/
  755. flatten<T>(): LoDashArrayWrapper<any>;
  756. /**
  757. * @see _.flatten
  758. **/
  759. flatten<T>(isShallow: boolean): LoDashArrayWrapper<any>;
  760. /**
  761. * @see _.flattenDeep
  762. */
  763. flattenDeep<T>(): LoDashArrayWrapper<any>;
  764. }
  765. //_.indexOf
  766. interface LoDashStatic {
  767. /**
  768. * Gets the index at which the first occurrence of value is found using strict equality
  769. * for comparisons, i.e. ===. If the array is already sorted providing true for fromIndex
  770. * will run a faster binary search.
  771. * @param array The array to search.
  772. * @param value The value to search for.
  773. * @param fromIndex The index to search from.
  774. * @return The index of `value` within `array`.
  775. **/
  776. indexOf<T>(
  777. array: Array<T>,
  778. value: T): number;
  779. /**
  780. * @see _.indexOf
  781. **/
  782. indexOf<T>(
  783. array: List<T>,
  784. value: T): number;
  785. /**
  786. * @see _.indexOf
  787. * @param fromIndex The index to search from
  788. **/
  789. indexOf<T>(
  790. array: Array<T>,
  791. value: T,
  792. fromIndex: number): number;
  793. /**
  794. * @see _.indexOf
  795. * @param fromIndex The index to search from
  796. **/
  797. indexOf<T>(
  798. array: List<T>,
  799. value: T,
  800. fromIndex: number): number;
  801. /**
  802. * @see _.indexOf
  803. * @param isSorted True to perform a binary search on a sorted array.
  804. **/
  805. indexOf<T>(
  806. array: Array<T>,
  807. value: T,
  808. isSorted: boolean): number;
  809. /**
  810. * @see _.indexOf
  811. * @param isSorted True to perform a binary search on a sorted array.
  812. **/
  813. indexOf<T>(
  814. array: List<T>,
  815. value: T,
  816. isSorted: boolean): number;
  817. }
  818. //_.initial
  819. interface LoDashStatic {
  820. /**
  821. * Gets all but the last element or last n elements of an array. If a callback is provided
  822. * elements at the end of the array are excluded from the result as long as the callback
  823. * returns truey. The callback is bound to thisArg and invoked with three arguments;
  824. * (value, index, array).
  825. *
  826. * If a property name is provided for callback the created "_.pluck" style callback will
  827. * return the property value of the given element.
  828. *
  829. * If an object is provided for callback the created "_.where" style callback will return
  830. * true for elements that have the properties of the given object, else false.
  831. * @param array The array to query.
  832. * @param n Leaves this many elements behind, optional.
  833. * @return Returns everything but the last `n` elements of `array`.
  834. **/
  835. initial<T>(
  836. array: Array<T>): T[];
  837. /**
  838. * @see _.initial
  839. **/
  840. initial<T>(
  841. array: List<T>): T[];
  842. /**
  843. * @see _.initial
  844. * @param n The number of elements to exclude.
  845. **/
  846. initial<T>(
  847. array: Array<T>,
  848. n: number): T[];
  849. /**
  850. * @see _.initial
  851. * @param n The number of elements to exclude.
  852. **/
  853. initial<T>(
  854. array: List<T>,
  855. n: number): T[];
  856. /**
  857. * @see _.initial
  858. * @param callback The function called per element
  859. **/
  860. initial<T>(
  861. array: Array<T>,
  862. callback: ListIterator<T, boolean>): T[];
  863. /**
  864. * @see _.initial
  865. * @param callback The function called per element
  866. **/
  867. initial<T>(
  868. array: List<T>,
  869. callback: ListIterator<T, boolean>): T[];
  870. /**
  871. * @see _.initial
  872. * @param pluckValue _.pluck style callback
  873. **/
  874. initial<T>(
  875. array: Array<T>,
  876. pluckValue: string): T[];
  877. /**
  878. * @see _.initial
  879. * @param pluckValue _.pluck style callback
  880. **/
  881. initial<T>(
  882. array: List<T>,
  883. pluckValue: string): T[];
  884. /**
  885. * @see _.initial
  886. * @param whereValue _.where style callback
  887. **/
  888. initial<W, T>(
  889. array: Array<T>,
  890. whereValue: W): T[];
  891. /**
  892. * @see _.initial
  893. * @param whereValue _.where style callback
  894. **/
  895. initial<W, T>(
  896. array: List<T>,
  897. whereValue: W): T[];
  898. }
  899. //_.intersection
  900. interface LoDashStatic {
  901. /**
  902. * Creates an array of unique values present in all provided arrays using strict
  903. * equality for comparisons, i.e. ===.
  904. * @param arrays The arrays to inspect.
  905. * @return Returns an array of composite values.
  906. **/
  907. intersection<T>(...arrays: Array<T>[]): T[];
  908. /**
  909. * @see _.intersection
  910. **/
  911. intersection<T>(...arrays: List<T>[]): T[];
  912. }
  913. //_.last
  914. interface LoDashStatic {
  915. /**
  916. * Gets the last element of an array.
  917. * @param array The array to query.
  918. * @return Returns the last element of array.
  919. **/
  920. last<T>(array: Array<T>): T;
  921. }
  922. interface LoDashArrayWrapper<T> {
  923. /**
  924. * @see _.last
  925. **/
  926. last(): T;
  927. }
  928. //_.lastIndexOf
  929. interface LoDashStatic {
  930. /**
  931. * Gets the index at which the last occurrence of value is found using strict equality
  932. * for comparisons, i.e. ===. If fromIndex is negative, it is used as the offset from the
  933. * end of the collection.
  934. * @param array The array to search.
  935. * @param value The value to search for.
  936. * @param fromIndex The index to search from.
  937. * @return The index of the matched value or -1.
  938. **/
  939. lastIndexOf<T>(
  940. array: Array<T>,
  941. value: T,
  942. fromIndex?: number): number;
  943. /**
  944. * @see _.lastIndexOf
  945. **/
  946. lastIndexOf<T>(
  947. array: List<T>,
  948. value: T,
  949. fromIndex?: number): number;
  950. }
  951. //_.pull
  952. interface LoDashStatic {
  953. /**
  954. * Removes all provided values from the given array using strict equality for comparisons,
  955. * i.e. ===.
  956. * @param array The array to modify.
  957. * @param values The values to remove.
  958. * @return array.
  959. **/
  960. pull<T>(
  961. array: Array<T>,
  962. ...values: T[]): T[];
  963. /**
  964. * @see _.pull
  965. **/
  966. pull<T>(
  967. array: List<T>,
  968. ...values: T[]): T[];
  969. }
  970. interface LoDashStatic {
  971. /**
  972. * Removes all provided values from the given array using strict equality for comparisons,
  973. * i.e. ===.
  974. * @param array The array to modify.
  975. * @param values The values to remove.
  976. * @return array.
  977. **/
  978. pullAt(
  979. array: Array<any>,
  980. ...values: any[]): any[];
  981. /**
  982. * @see _.pull
  983. **/
  984. pullAt(
  985. array: List<any>,
  986. ...values: any[]): any[];
  987. }
  988. //_.remove
  989. interface LoDashStatic {
  990. /**
  991. * Removes all elements from an array that the callback returns truey for and returns
  992. * an array of removed elements. The callback is bound to thisArg and invoked with three
  993. * arguments; (value, index, array).
  994. *
  995. * If a property name is provided for callback the created "_.pluck" style callback will
  996. * return the property value of the given element.
  997. *
  998. * If an object is provided for callback the created "_.where" style callback will return
  999. * true for elements that have the properties of the given object, else false.
  1000. * @param array The array to modify.
  1001. * @param callback The function called per iteration.
  1002. * @param thisArg The this binding of callback.
  1003. * @return A new array of removed elements.
  1004. **/
  1005. remove<T>(
  1006. array: Array<T>,
  1007. callback?: ListIterator<T, boolean>,
  1008. thisArg?: any): T[];
  1009. /**
  1010. * @see _.remove
  1011. **/
  1012. remove<T>(
  1013. array: List<T>,
  1014. callback?: ListIterator<T, boolean>,
  1015. thisArg?: any): T[];
  1016. /**
  1017. * @see _.remove
  1018. * @param pluckValue _.pluck style callback
  1019. **/
  1020. remove<T>(
  1021. array: Array<T>,
  1022. pluckValue?: string): T[];
  1023. /**
  1024. * @see _.remove
  1025. * @param pluckValue _.pluck style callback
  1026. **/
  1027. remove<T>(
  1028. array: List<T>,
  1029. pluckValue?: string): T[];
  1030. /**
  1031. * @see _.remove
  1032. * @param whereValue _.where style callback
  1033. **/
  1034. remove<W, T>(
  1035. array: Array<T>,
  1036. wherealue?: Dictionary<W>): T[];
  1037. /**
  1038. * @see _.remove
  1039. * @param whereValue _.where style callback
  1040. **/
  1041. remove<W, T>(
  1042. array: List<T>,
  1043. wherealue?: Dictionary<W>): T[];
  1044. /**
  1045. * @see _.remove
  1046. * @param item The item to remove
  1047. **/
  1048. remove<T>(
  1049. array:Array<T>,
  1050. item:T): T[];
  1051. }
  1052. //_.rest
  1053. interface LoDashStatic {
  1054. /**
  1055. * The opposite of _.initial this method gets all but the first element or first n elements of
  1056. * an array. If a callback function is provided elements at the beginning of the array are excluded
  1057. * from the result as long as the callback returns truey. The callback is bound to thisArg and
  1058. * invoked with three arguments; (value, index, array).
  1059. *
  1060. * If a property name is provided for callback the created "_.pluck" style callback will return
  1061. * the property value of the given element.
  1062. *
  1063. * If an object is provided for callback the created "_.where" style callback will return true
  1064. * for elements that have the properties of the given object, else false.
  1065. * @param array The array to query.
  1066. * @param {(Function|Object|number|string)} [callback=1] The function called per element or the number
  1067. * of elements to exclude. If a property name or object is provided it will be used to create a
  1068. * ".pluck" or ".where" style callback, respectively.
  1069. * @param {*} [thisArg] The this binding of callback.
  1070. * @return Returns a slice of array.
  1071. **/
  1072. rest<T>(array: Array<T>): T[];
  1073. /**
  1074. * @see _.rest
  1075. **/
  1076. rest<T>(array: List<T>): T[];
  1077. /**
  1078. * @see _.rest
  1079. **/
  1080. rest<T>(
  1081. array: Array<T>,
  1082. callback: ListIterator<T, boolean>,
  1083. thisArg?: any): T[];
  1084. /**
  1085. * @see _.rest
  1086. **/
  1087. rest<T>(
  1088. array: List<T>,
  1089. callback: ListIterator<T, boolean>,
  1090. thisArg?: any): T[];
  1091. /**
  1092. * @see _.rest
  1093. **/
  1094. rest<T>(
  1095. array: Array<T>,
  1096. n: number): T[];
  1097. /**
  1098. * @see _.rest
  1099. **/
  1100. rest<T>(
  1101. array: List<T>,
  1102. n: number): T[];
  1103. /**
  1104. * @see _.rest
  1105. **/
  1106. rest<T>(
  1107. array: Array<T>,
  1108. pluckValue: string): T[];
  1109. /**
  1110. * @see _.rest
  1111. **/
  1112. rest<T>(
  1113. array: List<T>,
  1114. pluckValue: string): T[];
  1115. /**
  1116. * @see _.rest
  1117. **/
  1118. rest<W, T>(
  1119. array: Array<T>,
  1120. whereValue: W): T[];
  1121. /**
  1122. * @see _.rest
  1123. **/
  1124. rest<W, T>(
  1125. array: List<T>,
  1126. whereValue: W): T[];
  1127. /**
  1128. * @see _.rest
  1129. **/
  1130. drop<T>(array: Array<T>): T[];
  1131. /**
  1132. * @see _.rest
  1133. **/
  1134. drop<T>(array: List<T>): T[];
  1135. /**
  1136. * @see _.rest
  1137. **/
  1138. drop<T>(
  1139. array: Array<T>,
  1140. callback: ListIterator<T, boolean>,
  1141. thisArg?: any): T[];
  1142. /**
  1143. * @see _.rest
  1144. **/
  1145. drop<T>(
  1146. array: List<T>,
  1147. callback: ListIterator<T, boolean>,
  1148. thisArg?: any): T[];
  1149. /**
  1150. * @see _.rest
  1151. **/
  1152. drop<T>(
  1153. array: Array<T>,
  1154. n: number): T[];
  1155. /**
  1156. * @see _.rest
  1157. **/
  1158. drop<T>(
  1159. array: List<T>,
  1160. n: number): T[];
  1161. /**
  1162. * @see _.rest
  1163. **/
  1164. drop<T>(
  1165. array: Array<T>,
  1166. pluckValue: string): T[];
  1167. /**
  1168. * @see _.rest
  1169. **/
  1170. drop<T>(
  1171. array: List<T>,
  1172. pluckValue: string): T[];
  1173. /**
  1174. * @see _.rest
  1175. **/
  1176. drop<W, T>(
  1177. array: Array<T>,
  1178. whereValue: W): T[];
  1179. /**
  1180. * @see _.rest
  1181. **/
  1182. drop<W, T>(
  1183. array: List<T>,
  1184. whereValue: W): T[];
  1185. /**
  1186. * @see _.rest
  1187. **/
  1188. tail<T>(array: Array<T>): T[];
  1189. /**
  1190. * @see _.rest
  1191. **/
  1192. tail<T>(array: List<T>): T[];
  1193. /**
  1194. * @see _.rest
  1195. **/
  1196. tail<T>(
  1197. array: Array<T>,
  1198. callback: ListIterator<T, boolean>,
  1199. thisArg?: any): T[];
  1200. /**
  1201. * @see _.rest
  1202. **/
  1203. tail<T>(
  1204. array: List<T>,
  1205. callback: ListIterator<T, boolean>,
  1206. thisArg?: any): T[];
  1207. /**
  1208. * @see _.rest
  1209. **/
  1210. tail<T>(
  1211. array: Array<T>,
  1212. n: number): T[];
  1213. /**
  1214. * @see _.rest
  1215. **/
  1216. tail<T>(
  1217. array: List<T>,
  1218. n: number): T[];
  1219. /**
  1220. * @see _.rest
  1221. **/
  1222. tail<T>(
  1223. array: Array<T>,
  1224. pluckValue: string): T[];
  1225. /**
  1226. * @see _.rest
  1227. **/
  1228. tail<T>(
  1229. array: List<T>,
  1230. pluckValue: string): T[];
  1231. /**
  1232. * @see _.rest
  1233. **/
  1234. tail<W, T>(
  1235. array: Array<T>,
  1236. whereValue: W): T[];
  1237. /**
  1238. * @see _.rest
  1239. **/
  1240. tail<W, T>(
  1241. array: List<T>,
  1242. whereValue: W): T[];
  1243. }
  1244. //_.sortedIndex
  1245. interface LoDashStatic {
  1246. /**
  1247. * Uses a binary search to determine the smallest index at which a value should be inserted
  1248. * into a given sorted array in order to maintain the sort order of the array. If a callback
  1249. * is provided it will be executed for value and each element of array to compute their sort
  1250. * ranking. The callback is bound to thisArg and invoked with one argument; (value).
  1251. *
  1252. * If a property name is provided for callback the created "_.pluck" style callback will
  1253. * return the property value of the given element.
  1254. *
  1255. * If an object is provided for callback the created "_.where" style callback will return
  1256. * true for elements that have the properties of the given object, else false.
  1257. * @param array The sorted list.
  1258. * @param value The value to determine its index within `list`.
  1259. * @param callback Iterator to compute the sort ranking of each value, optional.
  1260. * @return The index at which value should be inserted into array.
  1261. **/
  1262. sortedIndex<T, TSort>(
  1263. array: Array<T>,
  1264. value: T,
  1265. callback?: (x: T) => TSort,
  1266. thisArg?: any): number;
  1267. /**
  1268. * @see _.sortedIndex
  1269. **/
  1270. sortedIndex<T, TSort>(
  1271. array: List<T>,
  1272. value: T,
  1273. callback?: (x: T) => TSort,
  1274. thisArg?: any): number;
  1275. /**
  1276. * @see _.sortedIndex
  1277. * @param pluckValue the _.pluck style callback
  1278. **/
  1279. sortedIndex<T>(
  1280. array: Array<T>,
  1281. value: T,
  1282. pluckValue: string): number;
  1283. /**
  1284. * @see _.sortedIndex
  1285. * @param pluckValue the _.pluck style callback
  1286. **/
  1287. sortedIndex<T>(
  1288. array: List<T>,
  1289. value: T,
  1290. pluckValue: string): number;
  1291. /**
  1292. * @see _.sortedIndex
  1293. * @param pluckValue the _.where style callback
  1294. **/
  1295. sortedIndex<W, T>(
  1296. array: Array<T>,
  1297. value: T,
  1298. whereValue: W): number;
  1299. /**
  1300. * @see _.sortedIndex
  1301. * @param pluckValue the _.where style callback
  1302. **/
  1303. sortedIndex<W, T>(
  1304. array: List<T>,
  1305. value: T,
  1306. whereValue: W): number;
  1307. }
  1308. //_.union
  1309. interface LoDashStatic {
  1310. /**
  1311. * Creates an array of unique values, in order, of the provided arrays using strict
  1312. * equality for comparisons, i.e. ===.
  1313. * @param arrays The arrays to inspect.
  1314. * @return Returns an array of composite values.
  1315. **/
  1316. union<T>(...arrays: Array<T>[]): T[];
  1317. /**
  1318. * @see _.union
  1319. **/
  1320. union<T>(...arrays: List<T>[]): T[];
  1321. }
  1322. interface LoDashArrayWrapper<T> {
  1323. /**
  1324. * @see _.union
  1325. **/
  1326. union<T>(...arrays: (Array<T>|List<T>)[]): LoDashArrayWrapper<T>;
  1327. }
  1328. //_.uniq
  1329. interface LoDashStatic {
  1330. /**
  1331. * Creates a duplicate-value-free version of an array using strict equality for comparisons,
  1332. * i.e. ===. If the array is sorted, providing true for isSorted will use a faster algorithm.
  1333. * If a callback is provided each element of array is passed through the callback before
  1334. * uniqueness is computed. The callback is bound to thisArg and invoked with three arguments;
  1335. * (value, index, array).
  1336. *
  1337. * If a property name is provided for callback the created "_.pluck" style callback will
  1338. * return the property value of the given element.
  1339. *
  1340. * If an object is provided for callback the created "_.where" style callback will return
  1341. * true for elements that have the properties of the given object, else false.
  1342. * @param array Array to remove duplicates from.
  1343. * @param isSorted True if `array` is already sorted, optiona, default = false.
  1344. * @param iterator Transform the elements of `array` before comparisons for uniqueness.
  1345. * @param context 'this' object in `iterator`, optional.
  1346. * @return Copy of `array` where all elements are unique.
  1347. **/
  1348. uniq<T, TSort>(array: Array<T>, isSorted?: boolean): T[];
  1349. /**
  1350. * @see _.uniq
  1351. **/
  1352. uniq<T, TSort>(array: List<T>, isSorted?: boolean): T[];
  1353. /**
  1354. * @see _.uniq
  1355. **/
  1356. uniq<T, TSort>(
  1357. array: Array<T>,
  1358. isSorted: boolean,
  1359. callback: ListIterator<T, TSort>,
  1360. thisArg?: any): T[];
  1361. /**
  1362. * @see _.uniq
  1363. **/
  1364. uniq<T, TSort>(
  1365. array: List<T>,
  1366. isSorted: boolean,
  1367. callback: ListIterator<T, TSort>,
  1368. thisArg?: any): T[];
  1369. /**
  1370. * @see _.uniq
  1371. **/
  1372. uniq<T, TSort>(
  1373. array: Array<T>,
  1374. callback: ListIterator<T, TSort>,
  1375. thisArg?: any): T[];
  1376. /**
  1377. * @see _.uniq
  1378. **/
  1379. uniq<T, TSort>(
  1380. array: List<T>,
  1381. callback: ListIterator<T, TSort>,
  1382. thisArg?: any): T[];
  1383. /**
  1384. * @see _.uniq
  1385. * @param pluckValue _.pluck style callback
  1386. **/
  1387. uniq<T>(
  1388. array: Array<T>,
  1389. isSorted: boolean,
  1390. pluckValue: string): T[];
  1391. /**
  1392. * @see _.uniq
  1393. * @param pluckValue _.pluck style callback
  1394. **/
  1395. uniq<T>(
  1396. array: List<T>,
  1397. isSorted: boolean,
  1398. pluckValue: string): T[];
  1399. /**
  1400. * @see _.uniq
  1401. * @param pluckValue _.pluck style callback
  1402. **/
  1403. uniq<T>(
  1404. array: Array<T>,
  1405. pluckValue: string): T[];
  1406. /**
  1407. * @see _.uniq
  1408. * @param pluckValue _.pluck style callback
  1409. **/
  1410. uniq<T>(
  1411. array: List<T>,
  1412. pluckValue: string): T[];
  1413. /**
  1414. * @see _.uniq
  1415. * @param whereValue _.where style callback
  1416. **/
  1417. uniq<W, T>(
  1418. array: Array<T>,
  1419. isSorted: boolean,
  1420. whereValue: W): T[];
  1421. /**
  1422. * @see _.uniq
  1423. * @param whereValue _.where style callback
  1424. **/
  1425. uniq<W, T>(
  1426. array: List<T>,
  1427. isSorted: boolean,
  1428. whereValue: W): T[];
  1429. /**
  1430. * @see _.uniq
  1431. * @param whereValue _.where style callback
  1432. **/
  1433. uniq<W, T>(
  1434. array: Array<T>,
  1435. whereValue: W): T[];
  1436. /**
  1437. * @see _.uniq
  1438. * @param whereValue _.where style callback
  1439. **/
  1440. uniq<W, T>(
  1441. array: List<T>,
  1442. whereValue: W): T[];
  1443. /**
  1444. * @see _.uniq
  1445. **/
  1446. unique<T>(array: Array<T>, isSorted?: boolean): T[];
  1447. /**
  1448. * @see _.uniq
  1449. **/
  1450. unique<T>(array: List<T>, isSorted?: boolean): T[];
  1451. /**
  1452. * @see _.uniq
  1453. **/
  1454. unique<T, TSort>(
  1455. array: Array<T>,
  1456. callback: ListIterator<T, TSort>,
  1457. thisArg?: any): T[];
  1458. /**
  1459. * @see _.uniq
  1460. **/
  1461. unique<T, TSort>(
  1462. array: List<T>,
  1463. callback: ListIterator<T, TSort>,
  1464. thisArg?: any): T[];
  1465. /**
  1466. * @see _.uniq
  1467. **/
  1468. unique<T, TSort>(
  1469. array: Array<T>,
  1470. isSorted: boolean,
  1471. callback: ListIterator<T, TSort>,
  1472. thisArg?: any): T[];
  1473. /**
  1474. * @see _.uniq
  1475. **/
  1476. unique<T, TSort>(
  1477. array: List<T>,
  1478. isSorted: boolean,
  1479. callback: ListIterator<T, TSort>,
  1480. thisArg?: any): T[];
  1481. /**
  1482. * @see _.uniq
  1483. * @param pluckValue _.pluck style callback
  1484. **/
  1485. unique<T>(
  1486. array: Array<T>,
  1487. isSorted: boolean,
  1488. pluckValue: string): T[];
  1489. /**
  1490. * @see _.uniq
  1491. * @param pluckValue _.pluck style callback
  1492. **/
  1493. unique<T>(
  1494. array: List<T>,
  1495. isSorted: boolean,
  1496. pluckValue: string): T[];
  1497. /**
  1498. * @see _.uniq
  1499. * @param pluckValue _.pluck style callback
  1500. **/
  1501. unique<T>(
  1502. array: Array<T>,
  1503. pluckValue: string): T[];
  1504. /**
  1505. * @see _.uniq
  1506. * @param pluckValue _.pluck style callback
  1507. **/
  1508. unique<T>(
  1509. array: List<T>,
  1510. pluckValue: string): T[];
  1511. /**
  1512. * @see _.uniq
  1513. * @param whereValue _.where style callback
  1514. **/
  1515. unique<W, T>(
  1516. array: Array<T>,
  1517. whereValue?: W): T[];
  1518. /**
  1519. * @see _.uniq
  1520. * @param whereValue _.where style callback
  1521. **/
  1522. unique<W, T>(
  1523. array: List<T>,
  1524. whereValue?: W): T[];
  1525. /**
  1526. * @see _.uniq
  1527. * @param whereValue _.where style callback
  1528. **/
  1529. unique<W, T>(
  1530. array: Array<T>,
  1531. isSorted: boolean,
  1532. whereValue?: W): T[];
  1533. /**
  1534. * @see _.uniq
  1535. * @param whereValue _.where style callback
  1536. **/
  1537. unique<W, T>(
  1538. array: List<T>,
  1539. isSorted: boolean,
  1540. whereValue?: W): T[];
  1541. }
  1542. interface LoDashArrayWrapper<T> {
  1543. /**
  1544. * @see _.uniq
  1545. **/
  1546. uniq<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
  1547. /**
  1548. * @see _.uniq
  1549. **/
  1550. uniq<TSort>(
  1551. isSorted: boolean,
  1552. callback: ListIterator<T, TSort>,
  1553. thisArg?: any): LoDashArrayWrapper<T>;
  1554. /**
  1555. * @see _.uniq
  1556. **/
  1557. uniq<TSort>(
  1558. callback: ListIterator<T, TSort>,
  1559. thisArg?: any): LoDashArrayWrapper<T>;
  1560. /**
  1561. * @see _.uniq
  1562. * @param pluckValue _.pluck style callback
  1563. **/
  1564. uniq(
  1565. isSorted: boolean,
  1566. pluckValue: string): LoDashArrayWrapper<T>;
  1567. /**
  1568. * @see _.uniq
  1569. * @param pluckValue _.pluck style callback
  1570. **/
  1571. uniq(pluckValue: string): LoDashArrayWrapper<T>;
  1572. /**
  1573. * @see _.uniq
  1574. * @param whereValue _.where style callback
  1575. **/
  1576. uniq<W>(
  1577. isSorted: boolean,
  1578. whereValue: W): LoDashArrayWrapper<T>;
  1579. /**
  1580. * @see _.uniq
  1581. * @param whereValue _.where style callback
  1582. **/
  1583. uniq<W>(
  1584. whereValue: W): LoDashArrayWrapper<T>;
  1585. /**
  1586. * @see _.uniq
  1587. **/
  1588. unique<TSort>(isSorted?: boolean): LoDashArrayWrapper<T>;
  1589. /**
  1590. * @see _.uniq
  1591. **/
  1592. unique<TSort>(
  1593. isSorted: boolean,
  1594. callback: ListIterator<T, TSort>,
  1595. thisArg?: any): LoDashArrayWrapper<T>;
  1596. /**
  1597. * @see _.uniq
  1598. **/
  1599. unique<TSort>(
  1600. callback: ListIterator<T, TSort>,
  1601. thisArg?: any): LoDashArrayWrapper<T>;
  1602. /**
  1603. * @see _.uniq
  1604. * @param pluckValue _.pluck style callback
  1605. **/
  1606. unique(
  1607. isSorted: boolean,
  1608. pluckValue: string): LoDashArrayWrapper<T>;
  1609. /**
  1610. * @see _.uniq
  1611. * @param pluckValue _.pluck style callback
  1612. **/
  1613. unique(pluckValue: string): LoDashArrayWrapper<T>;
  1614. /**
  1615. * @see _.uniq
  1616. * @param whereValue _.where style callback
  1617. **/
  1618. unique<W>(
  1619. isSorted: boolean,
  1620. whereValue: W): LoDashArrayWrapper<T>;
  1621. /**
  1622. * @see _.uniq
  1623. * @param whereValue _.where style callback
  1624. **/
  1625. unique<W>(
  1626. whereValue: W): LoDashArrayWrapper<T>;
  1627. }
  1628. //_.without
  1629. interface LoDashStatic {
  1630. /**
  1631. * Creates an array excluding all provided values using strict equality for comparisons, i.e. ===.
  1632. * @param array The array to filter.
  1633. * @param values The value(s) to exclude.
  1634. * @return A new array of filtered values.
  1635. **/
  1636. without<T>(
  1637. array: Array<T>,
  1638. ...values: T[]): T[];
  1639. /**
  1640. * @see _.without
  1641. **/
  1642. without<T>(
  1643. array: List<T>,
  1644. ...values: T[]): T[];
  1645. }
  1646. //_.xor
  1647. interface LoDashStatic {
  1648. /**
  1649. * Creates an array of unique values that is the symmetric difference of the provided arrays.
  1650. * @param arrays The arrays to inspect.
  1651. * @return Returns the new array of values.
  1652. */
  1653. xor<T>(...arrays: List<T>[]): T[];
  1654. }
  1655. interface LoDashArrayWrapper<T> {
  1656. /**
  1657. * @see _.xor
  1658. */
  1659. xor(...arrays: T[][]): LoDashArrayWrapper<T>;
  1660. }
  1661. interface LoDashObjectWrapper<T> {
  1662. /**
  1663. * @see _.xor
  1664. */
  1665. xor(...arrays: T[]): LoDashObjectWrapper<T>;
  1666. }
  1667. //_.zip
  1668. interface LoDashStatic {
  1669. /**
  1670. * Creates an array of grouped elements, the first of which contains the first
  1671. * elements of the given arrays, the second of which contains the second elements
  1672. * of the given arrays, and so on.
  1673. * @param arrays Arrays to process.
  1674. * @return A new array of grouped elements.
  1675. **/
  1676. zip(...arrays: any[][]): any[][];
  1677. /**
  1678. * @see _.zip
  1679. **/
  1680. zip(...arrays: any[]): any[];
  1681. /**
  1682. * @see _.zip
  1683. **/
  1684. unzip(...arrays: any[][]): any[][];
  1685. /**
  1686. * @see _.zip
  1687. **/
  1688. unzip(...arrays: any[]): any[];
  1689. }
  1690. interface LoDashArrayWrapper<T> {
  1691. /**
  1692. * @see _.zip
  1693. **/
  1694. zip(...arrays: any[][]): _.LoDashArrayWrapper<any[][]>;
  1695. /**
  1696. * @see _.zip
  1697. **/
  1698. unzip(...arrays: any[]): _.LoDashArrayWrapper<any[][]>;
  1699. }
  1700. //_.zipObject
  1701. interface LoDashStatic {
  1702. /**
  1703. * The inverse of _.pairs; this method returns an object composed from arrays of property
  1704. * names and values. Provide either a single two dimensional array, e.g. [[key1, value1],
  1705. * [key2, value2]] or two arrays, one of property names and one of corresponding values.
  1706. * @param props The property names.
  1707. * @param values The property values.
  1708. * @return Returns the new object.
  1709. **/
  1710. zipObject<TResult extends {}>(
  1711. props: List<string>,
  1712. values?: List<any>): TResult;
  1713. /**
  1714. * @see _.zipObject
  1715. **/
  1716. zipObject<TResult extends {}>(props: List<List<any>>): Dictionary<any>;
  1717. /**
  1718. * @see _.zipObject
  1719. **/
  1720. object<TResult extends {}>(
  1721. props: List<string>,
  1722. values?: List<any>): TResult;
  1723. /**
  1724. * @see _.zipObject
  1725. **/
  1726. object<TResult extends {}>(props: List<List<any>>): Dictionary<any>;
  1727. }
  1728. interface LoDashArrayWrapper<T> {
  1729. /**
  1730. * @see _.zipObject
  1731. **/
  1732. zipObject(values?: List<any>): _.LoDashObjectWrapper<Dictionary<any>>;
  1733. /**
  1734. * @see _.zipObject
  1735. **/
  1736. object(values?: List<any>): _.LoDashObjectWrapper<Dictionary<any>>;
  1737. }
  1738. //_.zipWith
  1739. interface LoDashStatic {
  1740. /**
  1741. * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be
  1742. * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
  1743. * group).
  1744. * @param {...Array} [arrays] The arrays to process.
  1745. * @param {Function} [iteratee] The function to combine grouped values.
  1746. * @param {*} [thisArg] The `this` binding of `iteratee`.
  1747. * @return Returns the new array of grouped elements.
  1748. */
  1749. zipWith<TResult>(...args: any[]): TResult[];
  1750. }
  1751. interface LoDashArrayWrapper<T> {
  1752. /**
  1753. * @see _.zipWith
  1754. */
  1755. zipWith<TResult>(...args: any[]): LoDashArrayWrapper<TResult>;
  1756. }
  1757. /*********
  1758. * Chain *
  1759. *********/
  1760. //_.thru
  1761. interface LoDashStatic {
  1762. /**
  1763. * This method is like _.tap except that it returns the result of interceptor.
  1764. * @param value The value to provide to interceptor.
  1765. * @param interceptor The function to invoke.
  1766. * @param thisArg The this binding of interceptor.
  1767. * @return Returns the result of interceptor.
  1768. */
  1769. thru<T, TResult>(
  1770. value: T,
  1771. interceptor: (value: T) => TResult,
  1772. thisArg?: any): TResult;
  1773. }
  1774. interface LoDashWrapperBase<T, TWrapper> {
  1775. /**
  1776. * @see _.thru
  1777. */
  1778. thru<TResult extends number>(
  1779. interceptor: (value: T) => TResult,
  1780. thisArg?: any): LoDashWrapper<TResult>;
  1781. /**
  1782. * @see _.thru
  1783. */
  1784. thru<TResult extends string>(
  1785. interceptor: (value: T) => TResult,
  1786. thisArg?: any): LoDashWrapper<TResult>;
  1787. /**
  1788. * @see _.thru
  1789. */
  1790. thru<TResult extends boolean>(
  1791. interceptor: (value: T) => TResult,
  1792. thisArg?: any): LoDashWrapper<TResult>;
  1793. /**
  1794. * @see _.thru
  1795. */
  1796. thru<TResult extends Object>(
  1797. interceptor: (value: T) => TResult,
  1798. thisArg?: any): LoDashObjectWrapper<TResult>;
  1799. /**
  1800. * @see _.thru
  1801. */
  1802. thru<TResult>(
  1803. interceptor: (value: T) => TResult[],
  1804. thisArg?: any): LoDashArrayWrapper<TResult>;
  1805. }
  1806. /**************
  1807. * Collection *
  1808. **************/
  1809. //_.at
  1810. interface LoDashStatic {
  1811. /**
  1812. * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be
  1813. * specified as individual arguments or as arrays of keys.
  1814. *
  1815. * @param collection The collection to iterate over.
  1816. * @param props The property names or indexes of elements to pick, specified individually or in arrays.
  1817. * @return Returns the new array of picked elements.
  1818. */
  1819. at<T>(
  1820. collection: List<T>|Dictionary<T>,
  1821. ...props: Array<number|string|Array<number|string>>
  1822. ): T[];
  1823. }
  1824. interface LoDashArrayWrapper<T> {
  1825. /**
  1826. * @see _.at
  1827. */
  1828. at(...props: Array<number|string|Array<number|string>>): LoDashArrayWrapper<T>;
  1829. }
  1830. interface LoDashObjectWrapper<T> {
  1831. /**
  1832. * @see _.at
  1833. */
  1834. at<TResult>(...props: Array<number|string|Array<number|string>>): LoDashArrayWrapper<TResult>;
  1835. }
  1836. //_.contains
  1837. interface LoDashStatic {
  1838. /**
  1839. * Checks if a given value is present in a collection using strict equality for comparisons,
  1840. * i.e. ===. If fromIndex is negative, it is used as the offset from the end of the collection.
  1841. * @param collection The collection to iterate over.
  1842. * @param target The value to check for.
  1843. * @param fromIndex The index to search from.
  1844. * @return True if the target element is found, else false.
  1845. **/
  1846. contains<T>(
  1847. collection: Array<T>,
  1848. target: T,
  1849. fromIndex?: number): boolean;
  1850. /**
  1851. * @see _.contains
  1852. **/
  1853. contains<T>(
  1854. collection: List<T>,
  1855. target: T,
  1856. fromIndex?: number): boolean;
  1857. /**
  1858. * @see _.contains
  1859. * @param dictionary The dictionary to iterate over.
  1860. * @param value The value in the dictionary to search for.
  1861. **/
  1862. contains<T>(
  1863. dictionary: Dictionary<T>,
  1864. value: T,
  1865. fromIndex?: number): boolean;
  1866. /**
  1867. * @see _.contains
  1868. * @param searchString the string to search
  1869. * @param targetString the string to search for
  1870. **/
  1871. contains(
  1872. searchString: string,
  1873. targetString: string,
  1874. fromIndex?: number): boolean;
  1875. /**
  1876. * @see _.contains
  1877. **/
  1878. include<T>(
  1879. collection: Array<T>,
  1880. target: T,
  1881. fromIndex?: number): boolean;
  1882. /**
  1883. * @see _.contains
  1884. **/
  1885. include<T>(
  1886. collection: List<T>,
  1887. target: T,
  1888. fromIndex?: number): boolean;
  1889. /**
  1890. * @see _.contains
  1891. **/
  1892. include<T>(
  1893. dictionary: Dictionary<T>,
  1894. value: T,
  1895. fromIndex?: number): boolean;
  1896. /**
  1897. * @see _.contains
  1898. **/
  1899. include(
  1900. searchString: string,
  1901. targetString: string,
  1902. fromIndex?: number): boolean;
  1903. /**
  1904. * @see _.contains
  1905. **/
  1906. includes<T>(
  1907. collection: Array<T>,
  1908. target: T,
  1909. fromIndex?: number): boolean;
  1910. /**
  1911. * @see _.contains
  1912. **/
  1913. includes<T>(
  1914. collection: List<T>,
  1915. target: T,
  1916. fromIndex?: number): boolean;
  1917. /**
  1918. * @see _.contains
  1919. **/
  1920. includes<T>(
  1921. dictionary: Dictionary<T>,
  1922. value: T,
  1923. fromIndex?: number): boolean;
  1924. /**
  1925. * @see _.contains
  1926. **/
  1927. includes(
  1928. searchString: string,
  1929. targetString: string,
  1930. fromIndex?: number): boolean;
  1931. }
  1932. interface LoDashArrayWrapper<T> {
  1933. /**
  1934. * @see _.contains
  1935. **/
  1936. contains(target: T, fromIndex?: number): boolean;
  1937. /**
  1938. * @see _.contains
  1939. **/
  1940. include(target: T, fromIndex?: number): boolean;
  1941. /**
  1942. * @see _.contains
  1943. **/
  1944. includes(target: T, fromIndex?: number): boolean;
  1945. }
  1946. interface LoDashObjectWrapper<T> {
  1947. /**
  1948. * @see _.contains
  1949. **/
  1950. contains<TValue>(target: TValue, fromIndex?: number): boolean;
  1951. /**
  1952. * @see _.contains
  1953. **/
  1954. include<TValue>(target: TValue, fromIndex?: number): boolean;
  1955. /**
  1956. * @see _.contains
  1957. **/
  1958. includes<TValue>(target: TValue, fromIndex?: number): boolean;
  1959. }
  1960. interface LoDashStringWrapper {
  1961. /**
  1962. * @see _.contains
  1963. **/
  1964. contains(target: string, fromIndex?: number): boolean;
  1965. /**
  1966. * @see _.contains
  1967. **/
  1968. include(target: string, fromIndex?: number): boolean;
  1969. /**
  1970. * @see _.contains
  1971. **/
  1972. includes(target: string, fromIndex?: number): boolean;
  1973. }
  1974. //_.countBy
  1975. interface LoDashStatic {
  1976. /**
  1977. * Creates an object composed of keys generated from the results of running each element
  1978. * of collection through the callback. The corresponding value of each key is the number
  1979. * of times the key was returned by the callback. The callback is bound to thisArg and
  1980. * invoked with three arguments; (value, index|key, collection).
  1981. *
  1982. * If a property name is provided for callback the created "_.pluck" style callback will
  1983. * return the property value of the given element.
  1984. *
  1985. * If an object is provided for callback the created "_.where" style callback will return
  1986. * true for elements that have the properties of the given object, else false.
  1987. * @param collection The collection to iterate over.
  1988. * @param callback The function called per iteration.
  1989. * @param thisArg The this binding of callback.
  1990. * @return Returns the composed aggregate object.
  1991. **/
  1992. countBy<T>(
  1993. collection: Array<T>,
  1994. callback?: ListIterator<T, any>,
  1995. thisArg?: any): Dictionary<number>;
  1996. /**
  1997. * @see _.countBy
  1998. * @param callback Function name
  1999. **/
  2000. countBy<T>(
  2001. collection: List<T>,
  2002. callback?: ListIterator<T, any>,
  2003. thisArg?: any): Dictionary<number>;
  2004. /**
  2005. * @see _.countBy
  2006. * @param callback Function name
  2007. **/
  2008. countBy<T>(
  2009. collection: Dictionary<T>,
  2010. callback?: DictionaryIterator<T, any>,
  2011. thisArg?: any): Dictionary<number>;
  2012. /**
  2013. * @see _.countBy
  2014. * @param callback Function name
  2015. **/
  2016. countBy<T>(
  2017. collection: Array<T>,
  2018. callback: string,
  2019. thisArg?: any): Dictionary<number>;
  2020. /**
  2021. * @see _.countBy
  2022. * @param callback Function name
  2023. **/
  2024. countBy<T>(
  2025. collection: List<T>,
  2026. callback: string,
  2027. thisArg?: any): Dictionary<number>;
  2028. /**
  2029. * @see _.countBy
  2030. * @param callback Function name
  2031. **/
  2032. countBy<T>(
  2033. collection: Dictionary<T>,
  2034. callback: string,
  2035. thisArg?: any): Dictionary<number>;
  2036. }
  2037. interface LoDashArrayWrapper<T> {
  2038. /**
  2039. * @see _.countBy
  2040. **/
  2041. countBy(
  2042. callback?: ListIterator<T, any>,
  2043. thisArg?: any): LoDashObjectWrapper<Dictionary<number>>;
  2044. /**
  2045. * @see _.countBy
  2046. * @param callback Function name
  2047. **/
  2048. countBy(
  2049. callback: string,
  2050. thisArg?: any): LoDashObjectWrapper<Dictionary<number>>;
  2051. }
  2052. //_.every
  2053. interface LoDashStatic {
  2054. /**
  2055. * Checks if the given callback returns truey value for all elements of a collection.
  2056. * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
  2057. * collection).
  2058. *
  2059. * If a property name is provided for callback the created "_.pluck" style callback will
  2060. * return the property value of the given element.
  2061. *
  2062. * If an object is provided for callback the created "_.where" style callback will return
  2063. * true for elements that have the properties of the given object, else false.
  2064. * @param collection The collection to iterate over.
  2065. * @param callback The function called per iteration.
  2066. * @param thisArg The this binding of callback.
  2067. * @return True if all elements passed the callback check, else false.
  2068. **/
  2069. every<T>(
  2070. collection: Array<T>,
  2071. callback?: ListIterator<T, boolean>,
  2072. thisArg?: any): boolean;
  2073. /**
  2074. * @see _.every
  2075. * @param pluckValue _.pluck style callback
  2076. **/
  2077. every<T>(
  2078. collection: List<T>,
  2079. callback?: ListIterator<T, boolean>,
  2080. thisArg?: any): boolean;
  2081. /**
  2082. * @see _.every
  2083. * @param pluckValue _.pluck style callback
  2084. **/
  2085. every<T>(
  2086. collection: Dictionary<T>,
  2087. callback?: DictionaryIterator<T, boolean>,
  2088. thisArg?: any): boolean;
  2089. /**
  2090. * @see _.every
  2091. * @param pluckValue _.pluck style callback
  2092. **/
  2093. every<T>(
  2094. collection: Array<T>,
  2095. pluckValue: string): boolean;
  2096. /**
  2097. * @see _.every
  2098. * @param pluckValue _.pluck style callback
  2099. **/
  2100. every<T>(
  2101. collection: List<T>,
  2102. pluckValue: string): boolean;
  2103. /**
  2104. * @see _.every
  2105. * @param pluckValue _.pluck style callback
  2106. **/
  2107. every<T>(
  2108. collection: Dictionary<T>,
  2109. pluckValue: string): boolean;
  2110. /**
  2111. * @see _.every
  2112. * @param whereValue _.where style callback
  2113. **/
  2114. every<W, T>(
  2115. collection: Array<T>,
  2116. whereValue: W): boolean;
  2117. /**
  2118. * @see _.every
  2119. * @param whereValue _.where style callback
  2120. **/
  2121. every<W, T>(
  2122. collection: List<T>,
  2123. whereValue: W): boolean;
  2124. /**
  2125. * @see _.every
  2126. * @param whereValue _.where style callback
  2127. **/
  2128. every<W, T>(
  2129. collection: Dictionary<T>,
  2130. whereValue: W): boolean;
  2131. /**
  2132. * @see _.every
  2133. **/
  2134. all<T>(
  2135. collection: Array<T>,
  2136. callback?: ListIterator<T, boolean>,
  2137. thisArg?: any): boolean;
  2138. /**
  2139. * @see _.every
  2140. **/
  2141. all<T>(
  2142. collection: List<T>,
  2143. callback?: ListIterator<T, boolean>,
  2144. thisArg?: any): boolean;
  2145. /**
  2146. * @see _.every
  2147. **/
  2148. all<T>(
  2149. collection: Dictionary<T>,
  2150. callback?: DictionaryIterator<T, boolean>,
  2151. thisArg?: any): boolean;
  2152. /**
  2153. * @see _.every
  2154. * @param pluckValue _.pluck style callback
  2155. **/
  2156. all<T>(
  2157. collection: Array<T>,
  2158. pluckValue: string): boolean;
  2159. /**
  2160. * @see _.every
  2161. * @param pluckValue _.pluck style callback
  2162. **/
  2163. all<T>(
  2164. collection: List<T>,
  2165. pluckValue: string): boolean;
  2166. /**
  2167. * @see _.every
  2168. * @param pluckValue _.pluck style callback
  2169. **/
  2170. all<T>(
  2171. collection: Dictionary<T>,
  2172. pluckValue: string): boolean;
  2173. /**
  2174. * @see _.every
  2175. * @param whereValue _.where style callback
  2176. **/
  2177. all<W, T>(
  2178. collection: Array<T>,
  2179. whereValue: W): boolean;
  2180. /**
  2181. * @see _.every
  2182. * @param whereValue _.where style callback
  2183. **/
  2184. all<W, T>(
  2185. collection: List<T>,
  2186. whereValue: W): boolean;
  2187. /**
  2188. * @see _.every
  2189. * @param whereValue _.where style callback
  2190. **/
  2191. all<W, T>(
  2192. collection: Dictionary<T>,
  2193. whereValue: W): boolean;
  2194. }
  2195. //_.fill
  2196. interface LoDashStatic {
  2197. /**
  2198. * Fills elements of array with value from start up to, but not including, end.
  2199. *
  2200. * Note: This method mutates array.
  2201. *
  2202. * @param array (Array): The array to fill.
  2203. * @param value (*): The value to fill array with.
  2204. * @param [start=0] (number): The start position.
  2205. * @param [end=array.length] (number): The end position.
  2206. * @return (Array): Returns array.
  2207. */
  2208. fill<TResult>(
  2209. array: any[],
  2210. value: any,
  2211. start?: number,
  2212. end?: number): TResult[];
  2213. /**
  2214. * @see _.fill
  2215. */
  2216. fill<TResult>(
  2217. array: List<any>,
  2218. value: any,
  2219. start?: number,
  2220. end?: number): List<TResult>;
  2221. }
  2222. interface LoDashArrayWrapper<T> {
  2223. /**
  2224. * @see _.fill
  2225. */
  2226. fill<TResult>(
  2227. value: TResult,
  2228. start?: number,
  2229. end?: number): LoDashArrayWrapper<TResult>;
  2230. }
  2231. interface LoDashObjectWrapper<T> {
  2232. /**
  2233. * @see _.fill
  2234. */
  2235. fill<TResult>(
  2236. value: TResult,
  2237. start?: number,
  2238. end?: number): LoDashObjectWrapper<List<TResult>>;
  2239. }
  2240. //_.filter
  2241. interface LoDashStatic {
  2242. /**
  2243. * Iterates over elements of a collection, returning an array of all elements the
  2244. * identity function returns truey for.
  2245. *
  2246. * @param collection The collection to iterate over.
  2247. * @return Returns a new array of elements that passed the callback check.
  2248. **/
  2249. filter<T>(
  2250. collection: (Array<T>|List<T>)): T[];
  2251. /**
  2252. * Iterates over elements of a collection, returning an array of all elements the
  2253. * callback returns truey for. The callback is bound to thisArg and invoked with three
  2254. * arguments; (value, index|key, collection).
  2255. *
  2256. * If a property name is provided for callback the created "_.pluck" style callback will
  2257. * return the property value of the given element.
  2258. *
  2259. * If an object is provided for callback the created "_.where" style callback will return
  2260. * true for elements that have the properties of the given object, else false.
  2261. * @param collection The collection to iterate over.
  2262. * @param callback The function called per iteration.
  2263. * @param context The this binding of callback.
  2264. * @return Returns a new array of elements that passed the callback check.
  2265. **/
  2266. filter<T>(
  2267. collection: Array<T>,
  2268. callback: ListIterator<T, boolean>,
  2269. thisArg?: any): T[];
  2270. /**
  2271. * @see _.filter
  2272. **/
  2273. filter<T>(
  2274. collection: List<T>,
  2275. callback: ListIterator<T, boolean>,
  2276. thisArg?: any): T[];
  2277. /**
  2278. * @see _.filter
  2279. **/
  2280. filter<T>(
  2281. collection: Dictionary<T>,
  2282. callback: DictionaryIterator<T, boolean>,
  2283. thisArg?: any): T[];
  2284. /**
  2285. * @see _.filter
  2286. * @param pluckValue _.pluck style callback
  2287. **/
  2288. filter<T>(
  2289. collection: Array<T>,
  2290. pluckValue: string): T[];
  2291. /**
  2292. * @see _.filter
  2293. * @param pluckValue _.pluck style callback
  2294. **/
  2295. filter<T>(
  2296. collection: List<T>,
  2297. pluckValue: string): T[];
  2298. /**
  2299. * @see _.filter
  2300. * @param pluckValue _.pluck style callback
  2301. **/
  2302. filter<T>(
  2303. collection: Dictionary<T>,
  2304. pluckValue: string): T[];
  2305. /**
  2306. * @see _.filter
  2307. * @param pluckValue _.pluck style callback
  2308. **/
  2309. filter<W, T>(
  2310. collection: Array<T>,
  2311. whereValue: W): T[];
  2312. /**
  2313. * @see _.filter
  2314. * @param pluckValue _.pluck style callback
  2315. **/
  2316. filter<W, T>(
  2317. collection: List<T>,
  2318. whereValue: W): T[];
  2319. /**
  2320. * @see _.filter
  2321. * @param pluckValue _.pluck style callback
  2322. **/
  2323. filter<W, T>(
  2324. collection: Dictionary<T>,
  2325. whereValue: W): T[];
  2326. /**
  2327. * @see _.filter
  2328. **/
  2329. select<T>(
  2330. collection: Array<T>,
  2331. callback: ListIterator<T, boolean>,
  2332. thisArg?: any): T[];
  2333. /**
  2334. * @see _.filter
  2335. **/
  2336. select<T>(
  2337. collection: List<T>,
  2338. callback: ListIterator<T, boolean>,
  2339. thisArg?: any): T[];
  2340. /**
  2341. * @see _.filter
  2342. **/
  2343. select<T>(
  2344. collection: Dictionary<T>,
  2345. callback: DictionaryIterator<T, boolean>,
  2346. thisArg?: any): T[];
  2347. /**
  2348. * @see _.filter
  2349. * @param pluckValue _.pluck style callback
  2350. **/
  2351. select<T>(
  2352. collection: Array<T>,
  2353. pluckValue: string): T[];
  2354. /**
  2355. * @see _.filter
  2356. * @param pluckValue _.pluck style callback
  2357. **/
  2358. select<T>(
  2359. collection: List<T>,
  2360. pluckValue: string): T[];
  2361. /**
  2362. * @see _.filter
  2363. * @param pluckValue _.pluck style callback
  2364. **/
  2365. select<T>(
  2366. collection: Dictionary<T>,
  2367. pluckValue: string): T[];
  2368. /**
  2369. * @see _.filter
  2370. * @param pluckValue _.pluck style callback
  2371. **/
  2372. select<W, T>(
  2373. collection: Array<T>,
  2374. whereValue: W): T[];
  2375. /**
  2376. * @see _.filter
  2377. * @param pluckValue _.pluck style callback
  2378. **/
  2379. select<W, T>(
  2380. collection: List<T>,
  2381. whereValue: W): T[];
  2382. /**
  2383. * @see _.filter
  2384. * @param pluckValue _.pluck style callback
  2385. **/
  2386. select<W, T>(
  2387. collection: Dictionary<T>,
  2388. whereValue: W): T[];
  2389. }
  2390. interface LoDashArrayWrapper<T> {
  2391. /**
  2392. * @see _.filter
  2393. **/
  2394. filter(): LoDashArrayWrapper<T>;
  2395. /**
  2396. * @see _.filter
  2397. **/
  2398. filter(
  2399. callback: ListIterator<T, boolean>,
  2400. thisArg?: any): LoDashArrayWrapper<T>;
  2401. /**
  2402. * @see _.filter
  2403. * @param pluckValue _.pluck style callback
  2404. **/
  2405. filter(
  2406. pluckValue: string): LoDashArrayWrapper<T>;
  2407. /**
  2408. * @see _.filter
  2409. * @param pluckValue _.pluck style callback
  2410. **/
  2411. filter<W>(
  2412. whereValue: W): LoDashArrayWrapper<T>;
  2413. /**
  2414. * @see _.filter
  2415. **/
  2416. select(
  2417. callback: ListIterator<T, boolean>,
  2418. thisArg?: any): LoDashArrayWrapper<T>;
  2419. /**
  2420. * @see _.filter
  2421. * @param pluckValue _.pluck style callback
  2422. **/
  2423. select(
  2424. pluckValue: string): LoDashArrayWrapper<T>;
  2425. /**
  2426. * @see _.filter
  2427. * @param pluckValue _.pluck style callback
  2428. **/
  2429. select<W>(
  2430. whereValue: W): LoDashArrayWrapper<T>;
  2431. }
  2432. interface LoDashObjectWrapper<T> {
  2433. /**
  2434. * @see _.filter
  2435. **/
  2436. filter<T extends {}>(
  2437. callback: ObjectIterator<T, boolean>,
  2438. thisArg?: any): LoDashObjectWrapper<T>;
  2439. }
  2440. //_.find
  2441. interface LoDashStatic {
  2442. /**
  2443. * Iterates over elements of collection, returning the first element predicate returns
  2444. * truthy for. The predicate is bound to thisArg and invoked with three arguments:
  2445. * (value, index|key, collection).
  2446. *
  2447. * If a property name is provided for predicate the created _.property style callback
  2448. * returns the property value of the given element.
  2449. *
  2450. * If a value is also provided for thisArg the created _.matchesProperty style callback
  2451. * returns true for elements that have a matching property value, else false.
  2452. *
  2453. * If an object is provided for predicate the created _.matches style callback returns
  2454. * true for elements that have the properties of the given object, else false.
  2455. *
  2456. * @param collection Searches for a value in this list.
  2457. * @param callback The function called per iteration.
  2458. * @param thisArg The this binding of callback.
  2459. * @return The found element, else undefined.
  2460. **/
  2461. find<T>(
  2462. collection: Array<T>,
  2463. callback: ListIterator<T, boolean>,
  2464. thisArg?: any): T;
  2465. /**
  2466. * Alias of _.find
  2467. * @see _.find
  2468. **/
  2469. detect<T>(
  2470. collection: Array<T>,
  2471. callback: ListIterator<T, boolean>,
  2472. thisArg?: any): T;
  2473. /**
  2474. * @see _.find
  2475. **/
  2476. find<T>(
  2477. collection: List<T>,
  2478. callback: ListIterator<T, boolean>,
  2479. thisArg?: any): T;
  2480. /**
  2481. * Alias of _.find
  2482. * @see _.find
  2483. **/
  2484. detect<T>(
  2485. collection: List<T>,
  2486. callback: ListIterator<T, boolean>,
  2487. thisArg?: any): T;
  2488. /**
  2489. * @see _.find
  2490. **/
  2491. find<T>(
  2492. collection: Dictionary<T>,
  2493. callback: DictionaryIterator<T, boolean>,
  2494. thisArg?: any): T;
  2495. /**
  2496. * Alias of _.find
  2497. * @see _.find
  2498. **/
  2499. detect<T>(
  2500. collection: Dictionary<T>,
  2501. callback: DictionaryIterator<T, boolean>,
  2502. thisArg?: any): T;
  2503. /**
  2504. * @see _.find
  2505. * @param _.matches style callback
  2506. **/
  2507. find<W, T>(
  2508. collection: Array<T>|List<T>|Dictionary<T>,
  2509. whereValue: W): T;
  2510. /**
  2511. * Alias of _.find
  2512. * @see _.find
  2513. * @param _.matches style callback
  2514. **/
  2515. detect<W, T>(
  2516. collection: Array<T>|List<T>|Dictionary<T>,
  2517. whereValue: W): T;
  2518. /**
  2519. * @see _.find
  2520. * @param _.matchesProperty style callback
  2521. **/
  2522. find<T>(
  2523. collection: Array<T>|List<T>|Dictionary<T>,
  2524. path: string,
  2525. srcValue: any): T;
  2526. /**
  2527. * Alias of _.find
  2528. * @see _.find
  2529. * @param _.matchesProperty style callback
  2530. **/
  2531. detect<T>(
  2532. collection: Array<T>|List<T>|Dictionary<T>,
  2533. path: string,
  2534. srcValue: any): T;
  2535. /**
  2536. * @see _.find
  2537. * @param _.property style callback
  2538. **/
  2539. find<T>(
  2540. collection: Array<T>|List<T>|Dictionary<T>,
  2541. pluckValue: string): T;
  2542. /**
  2543. * Alias of _.find
  2544. * @see _.find
  2545. * @param _.property style callback
  2546. **/
  2547. detect<T>(
  2548. collection: Array<T>|List<T>|Dictionary<T>,
  2549. pluckValue: string): T;
  2550. /**
  2551. * @see _.find
  2552. **/
  2553. findWhere<T>(
  2554. collection: Array<T>,
  2555. callback: ListIterator<T, boolean>,
  2556. thisArg?: any): T;
  2557. /**
  2558. * @see _.find
  2559. **/
  2560. findWhere<T>(
  2561. collection: List<T>,
  2562. callback: ListIterator<T, boolean>,
  2563. thisArg?: any): T;
  2564. /**
  2565. * @see _.find
  2566. **/
  2567. findWhere<T>(
  2568. collection: Dictionary<T>,
  2569. callback: DictionaryIterator<T, boolean>,
  2570. thisArg?: any): T;
  2571. /**
  2572. * @see _.find
  2573. * @param _.matches style callback
  2574. **/
  2575. findWhere<W, T>(
  2576. collection: Array<T>,
  2577. whereValue: W): T;
  2578. /**
  2579. * @see _.find
  2580. * @param _.matches style callback
  2581. **/
  2582. findWhere<W, T>(
  2583. collection: List<T>,
  2584. whereValue: W): T;
  2585. /**
  2586. * @see _.find
  2587. * @param _.matches style callback
  2588. **/
  2589. findWhere<W, T>(
  2590. collection: Dictionary<T>,
  2591. whereValue: W): T;
  2592. /**
  2593. * @see _.find
  2594. * @param _.property style callback
  2595. **/
  2596. findWhere<T>(
  2597. collection: Array<T>,
  2598. pluckValue: string): T;
  2599. /**
  2600. * @see _.find
  2601. * @param _.property style callback
  2602. **/
  2603. findWhere<T>(
  2604. collection: List<T>,
  2605. pluckValue: string): T;
  2606. /**
  2607. * @see _.find
  2608. * @param _.property style callback
  2609. **/
  2610. findWhere<T>(
  2611. collection: Dictionary<T>,
  2612. pluckValue: string): T;
  2613. }
  2614. interface LoDashArrayWrapper<T> {
  2615. /**
  2616. * @see _.find
  2617. */
  2618. find(
  2619. callback: ListIterator<T, boolean>,
  2620. thisArg?: any): T;
  2621. /**
  2622. * @see _.find
  2623. * @param _.matches style callback
  2624. */
  2625. find<W>(
  2626. whereValue: W): T;
  2627. /**
  2628. * @see _.find
  2629. * @param _.matchesProperty style callback
  2630. */
  2631. find(
  2632. path: string,
  2633. srcValue: any): T;
  2634. /**
  2635. * @see _.find
  2636. * @param _.property style callback
  2637. */
  2638. find(
  2639. pluckValue: string): T;
  2640. }
  2641. //_.findLast
  2642. interface LoDashStatic {
  2643. /**
  2644. * This method is like _.find except that it iterates over elements of a collection from
  2645. * right to left.
  2646. * @param collection Searches for a value in this list.
  2647. * @param callback The function called per iteration.
  2648. * @param thisArg The this binding of callback.
  2649. * @return The found element, else undefined.
  2650. **/
  2651. findLast<T>(
  2652. collection: Array<T>,
  2653. callback: ListIterator<T, boolean>,
  2654. thisArg?: any): T;
  2655. /**
  2656. * @see _.find
  2657. **/
  2658. findLast<T>(
  2659. collection: List<T>,
  2660. callback: ListIterator<T, boolean>,
  2661. thisArg?: any): T;
  2662. /**
  2663. * @see _.find
  2664. **/
  2665. findLast<T>(
  2666. collection: Dictionary<T>,
  2667. callback: DictionaryIterator<T, boolean>,
  2668. thisArg?: any): T;
  2669. /**
  2670. * @see _.find
  2671. * @param _.pluck style callback
  2672. **/
  2673. findLast<W, T>(
  2674. collection: Array<T>,
  2675. whereValue: W): T;
  2676. /**
  2677. * @see _.find
  2678. * @param _.pluck style callback
  2679. **/
  2680. findLast<W, T>(
  2681. collection: List<T>,
  2682. whereValue: W): T;
  2683. /**
  2684. * @see _.find
  2685. * @param _.pluck style callback
  2686. **/
  2687. findLast<W, T>(
  2688. collection: Dictionary<T>,
  2689. whereValue: W): T;
  2690. /**
  2691. * @see _.find
  2692. * @param _.where style callback
  2693. **/
  2694. findLast<T>(
  2695. collection: Array<T>,
  2696. pluckValue: string): T;
  2697. /**
  2698. * @see _.find
  2699. * @param _.where style callback
  2700. **/
  2701. findLast<T>(
  2702. collection: List<T>,
  2703. pluckValue: string): T;
  2704. /**
  2705. * @see _.find
  2706. * @param _.where style callback
  2707. **/
  2708. findLast<T>(
  2709. collection: Dictionary<T>,
  2710. pluckValue: string): T;
  2711. }
  2712. interface LoDashArrayWrapper<T> {
  2713. /**
  2714. * @see _.findLast
  2715. */
  2716. findLast(
  2717. callback: ListIterator<T, boolean>,
  2718. thisArg?: any): T;
  2719. /**
  2720. * @see _.findLast
  2721. * @param _.where style callback
  2722. */
  2723. findLast<W>(
  2724. whereValue: W): T;
  2725. /**
  2726. * @see _.findLast
  2727. * @param _.where style callback
  2728. */
  2729. findLast(
  2730. pluckValue: string): T;
  2731. }
  2732. //_.forEach
  2733. interface LoDashStatic {
  2734. /**
  2735. * Iterates over elements of a collection, executing the callback for each element.
  2736. * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
  2737. * collection). Callbacks may exit iteration early by explicitly returning false.
  2738. * @param collection The collection to iterate over.
  2739. * @param callback The function called per iteration.
  2740. * @param thisArg The this binding of callback.
  2741. **/
  2742. forEach<T>(
  2743. collection: Array<T>,
  2744. callback: ListIterator<T, void>,
  2745. thisArg?: any): Array<T>;
  2746. /**
  2747. * @see _.forEach
  2748. **/
  2749. forEach<T>(
  2750. collection: List<T>,
  2751. callback: ListIterator<T, void>,
  2752. thisArg?: any): List<T>;
  2753. /**
  2754. * @see _.forEach
  2755. **/
  2756. forEach<T extends {}>(
  2757. object: Dictionary<T>,
  2758. callback: DictionaryIterator<T, void>,
  2759. thisArg?: any): Dictionary<T>;
  2760. /**
  2761. * @see _.each
  2762. **/
  2763. forEach<T extends {}, TValue>(
  2764. object: T,
  2765. callback: ObjectIterator<TValue, void>,
  2766. thisArg?: any): T
  2767. /**
  2768. * @see _.forEach
  2769. **/
  2770. each<T>(
  2771. collection: Array<T>,
  2772. callback: ListIterator<T, void>,
  2773. thisArg?: any): Array<T>;
  2774. /**
  2775. * @see _.forEach
  2776. **/
  2777. each<T>(
  2778. collection: List<T>,
  2779. callback: ListIterator<T, void>,
  2780. thisArg?: any): List<T>;
  2781. /**
  2782. * @see _.forEach
  2783. * @param object The object to iterate over
  2784. * @param callback The function called per iteration.
  2785. * @param thisArg The this binding of callback.
  2786. **/
  2787. each<T extends {}>(
  2788. object: Dictionary<T>,
  2789. callback: DictionaryIterator<T, void>,
  2790. thisArg?: any): Dictionary<T>;
  2791. /**
  2792. * @see _.each
  2793. **/
  2794. each<T extends {}, TValue>(
  2795. object: T,
  2796. callback: ObjectIterator<TValue, void>,
  2797. thisArg?: any): T
  2798. }
  2799. interface LoDashArrayWrapper<T> {
  2800. /**
  2801. * @see _.forEach
  2802. **/
  2803. forEach(
  2804. callback: ListIterator<T, void>,
  2805. thisArg?: any): LoDashArrayWrapper<T>;
  2806. /**
  2807. * @see _.forEach
  2808. **/
  2809. each(
  2810. callback: ListIterator<T, void>,
  2811. thisArg?: any): LoDashArrayWrapper<T>;
  2812. }
  2813. interface LoDashObjectWrapper<T> {
  2814. /**
  2815. * @see _.forEach
  2816. **/
  2817. forEach<T extends {}>(
  2818. callback: ObjectIterator<T, void>,
  2819. thisArg?: any): LoDashObjectWrapper<T>;
  2820. /**
  2821. * @see _.forEach
  2822. **/
  2823. each<T extends {}>(
  2824. callback: ObjectIterator<T, void>,
  2825. thisArg?: any): LoDashObjectWrapper<T>;
  2826. }
  2827. //_.forEachRight
  2828. interface LoDashStatic {
  2829. /**
  2830. * This method is like _.forEach except that it iterates over elements of a
  2831. * collection from right to left.
  2832. * @param collection The collection to iterate over.
  2833. * @param callback The function called per iteration.
  2834. * @param thisArg The this binding of callback.
  2835. **/
  2836. forEachRight<T>(
  2837. collection: Array<T>,
  2838. callback: ListIterator<T, void>,
  2839. thisArg?: any): Array<T>;
  2840. /**
  2841. * @see _.forEachRight
  2842. **/
  2843. forEachRight<T>(
  2844. collection: List<T>,
  2845. callback: ListIterator<T, void>,
  2846. thisArg?: any): List<T>;
  2847. /**
  2848. * @see _.forEachRight
  2849. **/
  2850. forEachRight<T extends {}>(
  2851. object: Dictionary<T>,
  2852. callback: DictionaryIterator<T, void>,
  2853. thisArg?: any): Dictionary<T>;
  2854. /**
  2855. * @see _.forEachRight
  2856. **/
  2857. eachRight<T>(
  2858. collection: Array<T>,
  2859. callback: ListIterator<T, void>,
  2860. thisArg?: any): Array<T>;
  2861. /**
  2862. * @see _.forEachRight
  2863. **/
  2864. eachRight<T>(
  2865. collection: List<T>,
  2866. callback: ListIterator<T, void>,
  2867. thisArg?: any): List<T>;
  2868. /**
  2869. * @see _.forEachRight
  2870. * @param object The object to iterate over
  2871. * @param callback The function called per iteration.
  2872. * @param thisArg The this binding of callback.
  2873. **/
  2874. eachRight<T extends {}>(
  2875. object: Dictionary<T>,
  2876. callback: DictionaryIterator<T, void>,
  2877. thisArg?: any): Dictionary<T>;
  2878. }
  2879. interface LoDashArrayWrapper<T> {
  2880. /**
  2881. * @see _.forEachRight
  2882. **/
  2883. forEachRight(
  2884. callback: ListIterator<T, void>,
  2885. thisArg?: any): LoDashArrayWrapper<T>;
  2886. /**
  2887. * @see _.forEachRight
  2888. **/
  2889. eachRight(
  2890. callback: ListIterator<T, void>,
  2891. thisArg?: any): LoDashArrayWrapper<T>;
  2892. }
  2893. interface LoDashObjectWrapper<T> {
  2894. /**
  2895. * @see _.forEachRight
  2896. **/
  2897. forEachRight<T extends {}>(
  2898. callback: ObjectIterator<T, void>,
  2899. thisArg?: any): LoDashObjectWrapper<Dictionary<T>>;
  2900. /**
  2901. * @see _.forEachRight
  2902. * @param object The object to iterate over
  2903. * @param callback The function called per iteration.
  2904. * @param thisArg The this binding of callback.
  2905. **/
  2906. eachRight<T extends {}>(
  2907. callback: ObjectIterator<T, void>,
  2908. thisArg?: any): LoDashObjectWrapper<Dictionary<T>>;
  2909. }
  2910. //_.groupBy
  2911. interface LoDashStatic {
  2912. /**
  2913. * Creates an object composed of keys generated from the results of running each element
  2914. * of a collection through the callback. The corresponding value of each key is an array
  2915. * of the elements responsible for generating the key. The callback is bound to thisArg
  2916. * and invoked with three arguments; (value, index|key, collection).
  2917. *
  2918. * If a property name is provided for callback the created "_.pluck" style callback will
  2919. * return the property value of the given element.
  2920. * If an object is provided for callback the created "_.where" style callback will return
  2921. * true for elements that have the properties of the given object, else false
  2922. * @param collection The collection to iterate over.
  2923. * @param callback The function called per iteration.
  2924. * @param thisArg The this binding of callback.
  2925. * @return Returns the composed aggregate object.
  2926. **/
  2927. groupBy<T>(
  2928. collection: Array<T>,
  2929. callback?: ListIterator<T, any>,
  2930. thisArg?: any): Dictionary<T[]>;
  2931. /**
  2932. * @see _.groupBy
  2933. **/
  2934. groupBy<T>(
  2935. collection: List<T>,
  2936. callback?: ListIterator<T, any>,
  2937. thisArg?: any): Dictionary<T[]>;
  2938. /**
  2939. * @see _.groupBy
  2940. * @param pluckValue _.pluck style callback
  2941. **/
  2942. groupBy<T>(
  2943. collection: Array<T>,
  2944. pluckValue: string): Dictionary<T[]>;
  2945. /**
  2946. * @see _.groupBy
  2947. * @param pluckValue _.pluck style callback
  2948. **/
  2949. groupBy<T>(
  2950. collection: List<T>,
  2951. pluckValue: string): Dictionary<T[]>;
  2952. /**
  2953. * @see _.groupBy
  2954. * @param whereValue _.where style callback
  2955. **/
  2956. groupBy<W, T>(
  2957. collection: Array<T>,
  2958. whereValue: W): Dictionary<T[]>;
  2959. /**
  2960. * @see _.groupBy
  2961. * @param whereValue _.where style callback
  2962. **/
  2963. groupBy<W, T>(
  2964. collection: List<T>,
  2965. whereValue: W): Dictionary<T[]>;
  2966. /**
  2967. * @see _.groupBy
  2968. **/
  2969. groupBy<T>(
  2970. collection: Dictionary<T>,
  2971. callback?: DictionaryIterator<T, any>,
  2972. thisArg?: any): Dictionary<T[]>;
  2973. /**
  2974. * @see _.groupBy
  2975. * @param pluckValue _.pluck style callback
  2976. **/
  2977. groupBy<TValue>(
  2978. collection: Dictionary<TValue>,
  2979. pluckValue: string): Dictionary<TValue[]>;
  2980. /**
  2981. * @see _.groupBy
  2982. * @param whereValue _.where style callback
  2983. **/
  2984. groupBy<W, TValue>(
  2985. collection: Dictionary<TValue>,
  2986. whereValue: W): Dictionary<TValue[]>;
  2987. }
  2988. interface LoDashArrayWrapper<T> {
  2989. /**
  2990. * @see _.groupBy
  2991. **/
  2992. groupBy(
  2993. callback: ListIterator<T, any>,
  2994. thisArg?: any): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
  2995. /**
  2996. * @see _.groupBy
  2997. **/
  2998. groupBy(
  2999. pluckValue: string): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
  3000. /**
  3001. * @see _.groupBy
  3002. **/
  3003. groupBy<W>(
  3004. whereValue: W): _.LoDashObjectWrapper<_.Dictionary<T[]>>;
  3005. }
  3006. interface LoDashObjectWrapper<T> {
  3007. /**
  3008. * @see _.groupBy
  3009. **/
  3010. groupBy<TValue>(
  3011. callback: ListIterator<TValue, any>,
  3012. thisArg?: any): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
  3013. /**
  3014. * @see _.groupBy
  3015. **/
  3016. groupBy<TValue>(
  3017. pluckValue: string): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
  3018. /**
  3019. * @see _.groupBy
  3020. **/
  3021. groupBy<W, TValue>(
  3022. whereValue: W): _.LoDashObjectWrapper<_.Dictionary<TValue[]>>;
  3023. }
  3024. //_.indexBy
  3025. interface LoDashStatic {
  3026. /**
  3027. * Creates an object composed of keys generated from the results of running each element
  3028. * of the collection through the given callback. The corresponding value of each key is
  3029. * the last element responsible for generating the key. The callback is bound to thisArg
  3030. * and invoked with three arguments; (value, index|key, collection).
  3031. *
  3032. * If a property name is provided for callback the created "_.pluck" style callback will
  3033. * return the property value of the given element.
  3034. *
  3035. * If an object is provided for callback the created "_.where" style callback will return
  3036. * true for elements that have the properties of the given object, else false.
  3037. * @param collection The collection to iterate over.
  3038. * @param callback The function called per iteration.
  3039. * @param thisArg The this binding of callback.
  3040. * @return Returns the composed aggregate object.
  3041. **/
  3042. indexBy<T>(
  3043. list: Array<T>,
  3044. iterator: ListIterator<T, any>,
  3045. context?: any): Dictionary<T>;
  3046. /**
  3047. * @see _.indexBy
  3048. **/
  3049. indexBy<T>(
  3050. list: List<T>,
  3051. iterator: ListIterator<T, any>,
  3052. context?: any): Dictionary<T>;
  3053. /**
  3054. * @see _.indexBy
  3055. * @param pluckValue _.pluck style callback
  3056. **/
  3057. indexBy<T>(
  3058. collection: Array<T>,
  3059. pluckValue: string): Dictionary<T>;
  3060. /**
  3061. * @see _.indexBy
  3062. * @param pluckValue _.pluck style callback
  3063. **/
  3064. indexBy<T>(
  3065. collection: List<T>,
  3066. pluckValue: string): Dictionary<T>;
  3067. /**
  3068. * @see _.indexBy
  3069. * @param whereValue _.where style callback
  3070. **/
  3071. indexBy<W, T>(
  3072. collection: Array<T>,
  3073. whereValue: W): Dictionary<T>;
  3074. /**
  3075. * @see _.indexBy
  3076. * @param whereValue _.where style callback
  3077. **/
  3078. indexBy<W, T>(
  3079. collection: List<T>,
  3080. whereValue: W): Dictionary<T>;
  3081. }
  3082. //_.invoke
  3083. interface LoDashStatic {
  3084. /**
  3085. * Invokes the method named by methodName on each element in the collection returning
  3086. * an array of the results of each invoked method. Additional arguments will be provided
  3087. * to each invoked method. If methodName is a function it will be invoked for, and this
  3088. * bound to, each element in the collection.
  3089. * @param collection The collection to iterate over.
  3090. * @param methodName The name of the method to invoke.
  3091. * @param args Arguments to invoke the method with.
  3092. **/
  3093. invoke<T extends {}>(
  3094. collection: Array<T>,
  3095. methodName: string,
  3096. ...args: any[]): any;
  3097. /**
  3098. * @see _.invoke
  3099. **/
  3100. invoke<T extends {}>(
  3101. collection: List<T>,
  3102. methodName: string,
  3103. ...args: any[]): any;
  3104. /**
  3105. * @see _.invoke
  3106. **/
  3107. invoke<T extends {}>(
  3108. collection: Dictionary<T>,
  3109. methodName: string,
  3110. ...args: any[]): any;
  3111. /**
  3112. * @see _.invoke
  3113. **/
  3114. invoke<T extends {}>(
  3115. collection: Array<T>,
  3116. method: Function,
  3117. ...args: any[]): any;
  3118. /**
  3119. * @see _.invoke
  3120. **/
  3121. invoke<T extends {}>(
  3122. collection: List<T>,
  3123. method: Function,
  3124. ...args: any[]): any;
  3125. /**
  3126. * @see _.invoke
  3127. **/
  3128. invoke<T extends {}>(
  3129. collection: Dictionary<T>,
  3130. method: Function,
  3131. ...args: any[]): any;
  3132. }
  3133. //_.map
  3134. interface LoDashStatic {
  3135. /**
  3136. * Creates an array of values by running each element in the collection through the callback.
  3137. * The callback is bound to thisArg and invoked with three arguments; (value, index|key,
  3138. * collection).
  3139. *
  3140. * If a property name is provided for callback the created "_.pluck" style callback will return
  3141. * the property value of the given element.
  3142. *
  3143. * If an object is provided for callback the created "_.where" style callback will return true
  3144. * for elements that have the properties of the given object, else false.
  3145. * @param collection The collection to iterate over.
  3146. * @param callback The function called per iteration.
  3147. * @param theArg The this binding of callback.
  3148. * @return The mapped array result.
  3149. **/
  3150. map<T, TResult>(
  3151. collection: Array<T>,
  3152. callback: ListIterator<T, TResult>,
  3153. thisArg?: any): TResult[];
  3154. /**
  3155. * @see _.map
  3156. **/
  3157. map<T, TResult>(
  3158. collection: List<T>,
  3159. callback: ListIterator<T, TResult>,
  3160. thisArg?: any): TResult[];
  3161. /**
  3162. * @see _.map
  3163. * @param object The object to iterate over.
  3164. * @param callback The function called per iteration.
  3165. * @param thisArg `this` object in `iterator`, optional.
  3166. * @return The mapped object result.
  3167. **/
  3168. map<T extends {}, TResult>(
  3169. object: Dictionary<T>,
  3170. callback: DictionaryIterator<T, TResult>,
  3171. thisArg?: any): TResult[];
  3172. /**
  3173. * @see _.map
  3174. * @param pluckValue _.pluck style callback
  3175. **/
  3176. map<T, TResult>(
  3177. collection: Array<T>,
  3178. pluckValue: string): TResult[];
  3179. /**
  3180. * @see _.map
  3181. * @param pluckValue _.pluck style callback
  3182. **/
  3183. map<T, TResult>(
  3184. collection: List<T>,
  3185. pluckValue: string): TResult[];
  3186. /**
  3187. * @see _.map
  3188. **/
  3189. collect<T, TResult>(
  3190. collection: Array<T>,
  3191. callback: ListIterator<T, TResult>,
  3192. thisArg?: any): TResult[];
  3193. /**
  3194. * @see _.map
  3195. **/
  3196. collect<T, TResult>(
  3197. collection: List<T>,
  3198. callback: ListIterator<T, TResult>,
  3199. thisArg?: any): TResult[];
  3200. /**
  3201. * @see _.map
  3202. **/
  3203. collect<T extends {}, TResult>(
  3204. object: Dictionary<T>,
  3205. callback: DictionaryIterator<T, TResult>,
  3206. thisArg?: any): TResult[];
  3207. /**
  3208. * @see _.map
  3209. **/
  3210. collect<T, TResult>(
  3211. collection: Array<T>,
  3212. pluckValue: string): TResult[];
  3213. /**
  3214. * @see _.map
  3215. **/
  3216. collect<T, TResult>(
  3217. collection: List<T>,
  3218. pluckValue: string): TResult[];
  3219. }
  3220. interface LoDashArrayWrapper<T> {
  3221. /**
  3222. * @see _.map
  3223. **/
  3224. map<TResult>(
  3225. callback: ListIterator<T, TResult>,
  3226. thisArg?: any): LoDashArrayWrapper<TResult>;
  3227. /**
  3228. * @see _.map
  3229. * @param pluckValue _.pluck style callback
  3230. **/
  3231. map<TResult>(
  3232. pluckValue: string): LoDashArrayWrapper<TResult>;
  3233. /**
  3234. * @see _.map
  3235. **/
  3236. collect<TResult>(
  3237. callback: ListIterator<T, TResult>,
  3238. thisArg?: any): LoDashArrayWrapper<TResult>;
  3239. /**
  3240. * @see _.map
  3241. **/
  3242. collect<TResult>(
  3243. pluckValue: string): LoDashArrayWrapper<TResult>;
  3244. }
  3245. interface LoDashObjectWrapper<T> {
  3246. /**
  3247. * @see _.map
  3248. **/
  3249. map<T extends {}, TResult>(
  3250. callback: ObjectIterator<T, TResult>,
  3251. thisArg?: any): LoDashArrayWrapper<TResult>;
  3252. /**
  3253. * @see _.map
  3254. **/
  3255. collect<T extends {}, TResult>(
  3256. callback: ObjectIterator<T, TResult>,
  3257. thisArg?: any): LoDashArrayWrapper<TResult>;
  3258. }
  3259. //_.ceil
  3260. interface LoDashStatic {
  3261. /**
  3262. * Calculates n rounded up to precision.
  3263. * @param n The number to round up.
  3264. * @param precision The precision to round up to.
  3265. * @return Returns the rounded up number.
  3266. */
  3267. ceil(n: number, precision?: number): number;
  3268. }
  3269. interface LoDashWrapper<T> {
  3270. /**
  3271. * @see _.ceil
  3272. */
  3273. ceil(precision?: number): number;
  3274. }
  3275. //_.floor
  3276. interface LoDashStatic {
  3277. /**
  3278. * Calculates n rounded down to precision.
  3279. * @param n The number to round down.
  3280. * @param precision The precision to round down to.
  3281. * @return Returns the rounded down number.
  3282. */
  3283. floor(n: number, precision?: number): number;
  3284. }
  3285. interface LoDashWrapper<T> {
  3286. /**
  3287. * @see _.floor
  3288. */
  3289. floor(precision?: number): number;
  3290. }
  3291. //_.max
  3292. interface LoDashStatic {
  3293. /**
  3294. * Retrieves the maximum value of a collection. If the collection is empty or falsey -Infinity is
  3295. * returned. If a callback is provided it will be executed for each value in the collection to
  3296. * generate the criterion by which the value is ranked. The callback is bound to thisArg and invoked
  3297. * with three arguments; (value, index, collection).
  3298. *
  3299. * If a property name is provided for callback the created "_.pluck" style callback will return the
  3300. * property value of the given element.
  3301. *
  3302. * If an object is provided for callback the created "_.where" style callback will return true for
  3303. * elements that have the properties of the given object, else false.
  3304. * @param collection The collection to iterate over.
  3305. * @param callback The function called per iteration.
  3306. * @param thisArg The this binding of callback.
  3307. * @return Returns the maximum value.
  3308. **/
  3309. max<T>(
  3310. collection: Array<T>,
  3311. callback?: ListIterator<T, any>,
  3312. thisArg?: any): T;
  3313. /**
  3314. * @see _.max
  3315. **/
  3316. max<T>(
  3317. collection: List<T>,
  3318. callback?: ListIterator<T, any>,
  3319. thisArg?: any): T;
  3320. /**
  3321. * @see _.max
  3322. **/
  3323. max<T>(
  3324. collection: Dictionary<T>,
  3325. callback?: DictionaryIterator<T, any>,
  3326. thisArg?: any): T;
  3327. /**
  3328. * @see _.max
  3329. * @param pluckValue _.pluck style callback
  3330. **/
  3331. max<T>(
  3332. collection: Array<T>,
  3333. pluckValue: string): T;
  3334. /**
  3335. * @see _.max
  3336. * @param pluckValue _.pluck style callback
  3337. **/
  3338. max<T>(
  3339. collection: List<T>,
  3340. pluckValue: string): T;
  3341. /**
  3342. * @see _.max
  3343. * @param pluckValue _.pluck style callback
  3344. **/
  3345. max<T>(
  3346. collection: Dictionary<T>,
  3347. pluckValue: string): T;
  3348. /**
  3349. * @see _.max
  3350. * @param whereValue _.where style callback
  3351. **/
  3352. max<W, T>(
  3353. collection: Array<T>,
  3354. whereValue: W): T;
  3355. /**
  3356. * @see _.max
  3357. * @param whereValue _.where style callback
  3358. **/
  3359. max<W, T>(
  3360. collection: List<T>,
  3361. whereValue: W): T;
  3362. /**
  3363. * @see _.max
  3364. * @param whereValue _.where style callback
  3365. **/
  3366. max<W, T>(
  3367. collection: Dictionary<T>,
  3368. whereValue: W): T;
  3369. }
  3370. interface LoDashArrayWrapper<T> {
  3371. /**
  3372. * @see _.max
  3373. **/
  3374. max(
  3375. callback?: ListIterator<T, any>,
  3376. thisArg?: any): LoDashWrapper<T>;
  3377. /**
  3378. * @see _.max
  3379. * @param pluckValue _.pluck style callback
  3380. **/
  3381. max(
  3382. pluckValue: string): LoDashWrapper<T>;
  3383. /**
  3384. * @see _.max
  3385. * @param whereValue _.where style callback
  3386. **/
  3387. max<W>(
  3388. whereValue: W): LoDashWrapper<T>;
  3389. }
  3390. //_.min
  3391. interface LoDashStatic {
  3392. /**
  3393. * Retrieves the minimum value of a collection. If the collection is empty or falsey
  3394. * Infinity is returned. If a callback is provided it will be executed for each value
  3395. * in the collection to generate the criterion by which the value is ranked. The callback
  3396. * is bound to thisArg and invoked with three arguments; (value, index, collection).
  3397. *
  3398. * If a property name is provided for callback the created "_.pluck" style callback
  3399. * will return the property value of the given element.
  3400. *
  3401. * If an object is provided for callback the created "_.where" style callback will
  3402. * return true for elements that have the properties of the given object, else false.
  3403. * @param collection The collection to iterate over.
  3404. * @param callback The function called per iteration.
  3405. * @param thisArg The this binding of callback.
  3406. * @return Returns the maximum value.
  3407. **/
  3408. min<T>(
  3409. collection: Array<T>,
  3410. callback?: ListIterator<T, any>,
  3411. thisArg?: any): T;
  3412. /**
  3413. * @see _.min
  3414. **/
  3415. min<T>(
  3416. collection: List<T>,
  3417. callback?: ListIterator<T, any>,
  3418. thisArg?: any): T;
  3419. /**
  3420. * @see _.min
  3421. **/
  3422. min<T>(
  3423. collection: Dictionary<T>,
  3424. callback?: ListIterator<T, any>,
  3425. thisArg?: any): T;
  3426. /**
  3427. * @see _.min
  3428. * @param pluckValue _.pluck style callback
  3429. **/
  3430. min<T>(
  3431. collection: Array<T>,
  3432. pluckValue: string): T;
  3433. /**
  3434. * @see _.min
  3435. * @param pluckValue _.pluck style callback
  3436. **/
  3437. min<T>(
  3438. collection: List<T>,
  3439. pluckValue: string): T;
  3440. /**
  3441. * @see _.min
  3442. * @param pluckValue _.pluck style callback
  3443. **/
  3444. min<T>(
  3445. collection: Dictionary<T>,
  3446. pluckValue: string): T;
  3447. /**
  3448. * @see _.min
  3449. * @param whereValue _.where style callback
  3450. **/
  3451. min<W, T>(
  3452. collection: Array<T>,
  3453. whereValue: W): T;
  3454. /**
  3455. * @see _.min
  3456. * @param whereValue _.where style callback
  3457. **/
  3458. min<W, T>(
  3459. collection: List<T>,
  3460. whereValue: W): T;
  3461. /**
  3462. * @see _.min
  3463. * @param whereValue _.where style callback
  3464. **/
  3465. min<W, T>(
  3466. collection: Dictionary<T>,
  3467. whereValue: W): T;
  3468. }
  3469. interface LoDashArrayWrapper<T> {
  3470. /**
  3471. * @see _.min
  3472. **/
  3473. min(
  3474. callback?: ListIterator<T, any>,
  3475. thisArg?: any): LoDashWrapper<T>;
  3476. /**
  3477. * @see _.min
  3478. * @param pluckValue _.pluck style callback
  3479. **/
  3480. min(
  3481. pluckValue: string): LoDashWrapper<T>;
  3482. /**
  3483. * @see _.min
  3484. * @param whereValue _.where style callback
  3485. **/
  3486. min<W>(
  3487. whereValue: W): LoDashWrapper<T>;
  3488. }
  3489. //_.round
  3490. interface LoDashStatic {
  3491. /**
  3492. * Calculates n rounded to precision.
  3493. * @param n The number to round.
  3494. * @param precision The precision to round to.
  3495. * @return Returns the rounded number.
  3496. */
  3497. round(n: number, precision?: number): number;
  3498. }
  3499. interface LoDashWrapper<T> {
  3500. /**
  3501. * @see _.round
  3502. */
  3503. round(precision?: number): number;
  3504. }
  3505. //_.sum
  3506. interface LoDashStatic {
  3507. /**
  3508. * Gets the sum of the values in collection.
  3509. *
  3510. * @param collection The collection to iterate over.
  3511. * @param iteratee The function invoked per iteration.
  3512. * @param thisArg The this binding of iteratee.
  3513. * @return Returns the sum.
  3514. **/
  3515. sum(
  3516. collection: Array<number>): number;
  3517. /**
  3518. * @see _.sum
  3519. **/
  3520. sum(
  3521. collection: List<number>): number;
  3522. /**
  3523. * @see _.sum
  3524. **/
  3525. sum(
  3526. collection: Dictionary<number>): number;
  3527. /**
  3528. * @see _.sum
  3529. **/
  3530. sum<T>(
  3531. collection: Array<T>,
  3532. iteratee: ListIterator<T, number>,
  3533. thisArg?: any): number;
  3534. /**
  3535. * @see _.sum
  3536. **/
  3537. sum<T>(
  3538. collection: List<T>,
  3539. iteratee: ListIterator<T, number>,
  3540. thisArg?: any): number;
  3541. /**
  3542. * @see _.sum
  3543. **/
  3544. sum<T>(
  3545. collection: Dictionary<T>,
  3546. iteratee: ObjectIterator<T, number>,
  3547. thisArg?: any): number;
  3548. /**
  3549. * @see _.sum
  3550. * @param property _.property callback shorthand.
  3551. **/
  3552. sum<T>(
  3553. collection: Array<T>,
  3554. property: string): number;
  3555. /**
  3556. * @see _.sum
  3557. * @param property _.property callback shorthand.
  3558. **/
  3559. sum<T>(
  3560. collection: List<T>,
  3561. property: string): number;
  3562. /**
  3563. * @see _.sum
  3564. * @param property _.property callback shorthand.
  3565. **/
  3566. sum<T>(
  3567. collection: Dictionary<T>,
  3568. property: string): number;
  3569. }
  3570. interface LoDashNumberArrayWrapper {
  3571. /**
  3572. * @see _.sum
  3573. **/
  3574. sum(): number;
  3575. /**
  3576. * @see _.sum
  3577. **/
  3578. sum(
  3579. iteratee: ListIterator<number, number>,
  3580. thisArg?: any): number;
  3581. }
  3582. interface LoDashArrayWrapper<T> {
  3583. /**
  3584. * @see _.sum
  3585. **/
  3586. sum(): number;
  3587. /**
  3588. * @see _.sum
  3589. **/
  3590. sum(
  3591. iteratee: ListIterator<T, number>,
  3592. thisArg?: any): number;
  3593. /**
  3594. * @see _.sum
  3595. * @param property _.property callback shorthand.
  3596. **/
  3597. sum(
  3598. property: string): number;
  3599. }
  3600. interface LoDashObjectWrapper<T> {
  3601. /**
  3602. * @see _.sum
  3603. **/
  3604. sum(): number;
  3605. /**
  3606. * @see _.sum
  3607. **/
  3608. sum(
  3609. iteratee: ObjectIterator<any, number>,
  3610. thisArg?: any): number;
  3611. /**
  3612. * @see _.sum
  3613. * @param property _.property callback shorthand.
  3614. **/
  3615. sum(
  3616. property: string): number;
  3617. }
  3618. //_.pluck
  3619. interface LoDashStatic {
  3620. /**
  3621. * Retrieves the value of a specified property from all elements in the collection.
  3622. * @param collection The collection to iterate over.
  3623. * @param property The property to pluck.
  3624. * @return A new array of property values.
  3625. **/
  3626. pluck<T extends {}>(
  3627. collection: Array<T>,
  3628. property: string|string[]): any[];
  3629. /**
  3630. * @see _.pluck
  3631. **/
  3632. pluck<T extends {}>(
  3633. collection: List<T>,
  3634. property: string|string[]): any[];
  3635. /**
  3636. * @see _.pluck
  3637. **/
  3638. pluck<T extends {}>(
  3639. collection: Dictionary<T>,
  3640. property: string|string[]): any[];
  3641. }
  3642. interface LoDashArrayWrapper<T> {
  3643. /**
  3644. * @see _.pluck
  3645. **/
  3646. pluck<TResult>(
  3647. property: string): LoDashArrayWrapper<TResult>;
  3648. }
  3649. interface LoDashObjectWrapper<T> {
  3650. /**
  3651. * @see _.pluck
  3652. **/
  3653. pluck<TResult>(
  3654. property: string): LoDashArrayWrapper<TResult>;
  3655. }
  3656. //_.partition
  3657. interface LoDashStatic {
  3658. /**
  3659. * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for,
  3660. * while the second of which contains elements predicate returns falsey for.
  3661. * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
  3662. *
  3663. * If a property name is provided for predicate the created _.property style callback
  3664. * returns the property value of the given element.
  3665. *
  3666. * If a value is also provided for thisArg the created _.matchesProperty style callback
  3667. * returns true for elements that have a matching property value, else false.
  3668. *
  3669. * If an object is provided for predicate the created _.matches style callback returns
  3670. * true for elements that have the properties of the given object, else false.
  3671. *
  3672. * @param collection The collection to iterate over.
  3673. * @param callback The function called per iteration.
  3674. * @param thisArg The this binding of predicate.
  3675. * @return Returns the array of grouped elements.
  3676. **/
  3677. partition<T>(
  3678. collection: List<T>,
  3679. callback: ListIterator<T, boolean>,
  3680. thisArg?: any): T[][];
  3681. /**
  3682. * @see _.partition
  3683. **/
  3684. partition<T>(
  3685. collection: Dictionary<T>,
  3686. callback: DictionaryIterator<T, boolean>,
  3687. thisArg?: any): T[][];
  3688. /**
  3689. * @see _.partition
  3690. **/
  3691. partition<W, T>(
  3692. collection: List<T>,
  3693. whereValue: W): T[][];
  3694. /**
  3695. * @see _.partition
  3696. **/
  3697. partition<W, T>(
  3698. collection: Dictionary<T>,
  3699. whereValue: W): T[][];
  3700. /**
  3701. * @see _.partition
  3702. **/
  3703. partition<T>(
  3704. collection: List<T>,
  3705. path: string,
  3706. srcValue: any): T[][];
  3707. /**
  3708. * @see _.partition
  3709. **/
  3710. partition<T>(
  3711. collection: Dictionary<T>,
  3712. path: string,
  3713. srcValue: any): T[][];
  3714. /**
  3715. * @see _.partition
  3716. **/
  3717. partition<T>(
  3718. collection: List<T>,
  3719. pluckValue: string): T[][];
  3720. /**
  3721. * @see _.partition
  3722. **/
  3723. partition<T>(
  3724. collection: Dictionary<T>,
  3725. pluckValue: string): T[][];
  3726. }
  3727. interface LoDashStringWrapper {
  3728. /**
  3729. * @see _.partition
  3730. */
  3731. partition(
  3732. callback: ListIterator<string, boolean>,
  3733. thisArg?: any): LoDashArrayWrapper<string[]>;
  3734. }
  3735. interface LoDashArrayWrapper<T> {
  3736. /**
  3737. * @see _.partition
  3738. */
  3739. partition(
  3740. callback: ListIterator<T, boolean>,
  3741. thisArg?: any): LoDashArrayWrapper<T[]>;
  3742. /**
  3743. * @see _.partition
  3744. */
  3745. partition<W>(
  3746. whereValue: W): LoDashArrayWrapper<T[]>;
  3747. /**
  3748. * @see _.partition
  3749. */
  3750. partition(
  3751. path: string,
  3752. srcValue: any): LoDashArrayWrapper<T[]>;
  3753. /**
  3754. * @see _.partition
  3755. */
  3756. partition(
  3757. pluckValue: string): LoDashArrayWrapper<T[]>;
  3758. }
  3759. interface LoDashObjectWrapper<T> {
  3760. /**
  3761. * @see _.partition
  3762. */
  3763. partition<TResult>(
  3764. callback: ListIterator<TResult, boolean>,
  3765. thisArg?: any): LoDashArrayWrapper<TResult[]>;
  3766. /**
  3767. * @see _.partition
  3768. */
  3769. partition<TResult>(
  3770. callback: DictionaryIterator<TResult, boolean>,
  3771. thisArg?: any): LoDashArrayWrapper<TResult[]>;
  3772. /**
  3773. * @see _.partition
  3774. */
  3775. partition<W, TResult>(
  3776. whereValue: W): LoDashArrayWrapper<TResult[]>;
  3777. /**
  3778. * @see _.partition
  3779. */
  3780. partition<TResult>(
  3781. path: string,
  3782. srcValue: any): LoDashArrayWrapper<TResult[]>;
  3783. /**
  3784. * @see _.partition
  3785. */
  3786. partition<TResult>(
  3787. pluckValue: string): LoDashArrayWrapper<TResult[]>;
  3788. }
  3789. //_.reduce
  3790. interface LoDashStatic {
  3791. /**
  3792. * Reduces a collection to a value which is the accumulated result of running each
  3793. * element in the collection through the callback, where each successive callback execution
  3794. * consumes the return value of the previous execution. If accumulator is not provided the
  3795. * first element of the collection will be used as the initial accumulator value. The callback
  3796. * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
  3797. * @param collection The collection to iterate over.
  3798. * @param callback The function called per iteration.
  3799. * @param accumulator Initial value of the accumulator.
  3800. * @param thisArg The this binding of callback.
  3801. * @return Returns the accumulated value.
  3802. **/
  3803. reduce<T, TResult>(
  3804. collection: Array<T>,
  3805. callback: MemoIterator<T, TResult>,
  3806. accumulator: TResult,
  3807. thisArg?: any): TResult;
  3808. /**
  3809. * @see _.reduce
  3810. **/
  3811. reduce<T, TResult>(
  3812. collection: List<T>,
  3813. callback: MemoIterator<T, TResult>,
  3814. accumulator: TResult,
  3815. thisArg?: any): TResult;
  3816. /**
  3817. * @see _.reduce
  3818. **/
  3819. reduce<T, TResult>(
  3820. collection: Dictionary<T>,
  3821. callback: MemoIterator<T, TResult>,
  3822. accumulator: TResult,
  3823. thisArg?: any): TResult;
  3824. /**
  3825. * @see _.reduce
  3826. **/
  3827. reduce<T, TResult>(
  3828. collection: Array<T>,
  3829. callback: MemoIterator<T, TResult>,
  3830. thisArg?: any): TResult;
  3831. /**
  3832. * @see _.reduce
  3833. **/
  3834. reduce<T, TResult>(
  3835. collection: List<T>,
  3836. callback: MemoIterator<T, TResult>,
  3837. thisArg?: any): TResult;
  3838. /**
  3839. * @see _.reduce
  3840. **/
  3841. reduce<T, TResult>(
  3842. collection: Dictionary<T>,
  3843. callback: MemoIterator<T, TResult>,
  3844. thisArg?: any): TResult;
  3845. /**
  3846. * @see _.reduce
  3847. **/
  3848. inject<T, TResult>(
  3849. collection: Array<T>,
  3850. callback: MemoIterator<T, TResult>,
  3851. accumulator: TResult,
  3852. thisArg?: any): TResult;
  3853. /**
  3854. * @see _.reduce
  3855. **/
  3856. inject<T, TResult>(
  3857. collection: List<T>,
  3858. callback: MemoIterator<T, TResult>,
  3859. accumulator: TResult,
  3860. thisArg?: any): TResult;
  3861. /**
  3862. * @see _.reduce
  3863. **/
  3864. inject<T, TResult>(
  3865. collection: Dictionary<T>,
  3866. callback: MemoIterator<T, TResult>,
  3867. accumulator: TResult,
  3868. thisArg?: any): TResult;
  3869. /**
  3870. * @see _.reduce
  3871. **/
  3872. inject<T, TResult>(
  3873. collection: Array<T>,
  3874. callback: MemoIterator<T, TResult>,
  3875. thisArg?: any): TResult;
  3876. /**
  3877. * @see _.reduce
  3878. **/
  3879. inject<T, TResult>(
  3880. collection: List<T>,
  3881. callback: MemoIterator<T, TResult>,
  3882. thisArg?: any): TResult;
  3883. /**
  3884. * @see _.reduce
  3885. **/
  3886. inject<T, TResult>(
  3887. collection: Dictionary<T>,
  3888. callback: MemoIterator<T, TResult>,
  3889. thisArg?: any): TResult;
  3890. /**
  3891. * @see _.reduce
  3892. **/
  3893. foldl<T, TResult>(
  3894. collection: Array<T>,
  3895. callback: MemoIterator<T, TResult>,
  3896. accumulator: TResult,
  3897. thisArg?: any): TResult;
  3898. /**
  3899. * @see _.reduce
  3900. **/
  3901. foldl<T, TResult>(
  3902. collection: List<T>,
  3903. callback: MemoIterator<T, TResult>,
  3904. accumulator: TResult,
  3905. thisArg?: any): TResult;
  3906. /**
  3907. * @see _.reduce
  3908. **/
  3909. foldl<T, TResult>(
  3910. collection: Dictionary<T>,
  3911. callback: MemoIterator<T, TResult>,
  3912. accumulator: TResult,
  3913. thisArg?: any): TResult;
  3914. /**
  3915. * @see _.reduce
  3916. **/
  3917. foldl<T, TResult>(
  3918. collection: Array<T>,
  3919. callback: MemoIterator<T, TResult>,
  3920. thisArg?: any): TResult;
  3921. /**
  3922. * @see _.reduce
  3923. **/
  3924. foldl<T, TResult>(
  3925. collection: List<T>,
  3926. callback: MemoIterator<T, TResult>,
  3927. thisArg?: any): TResult;
  3928. /**
  3929. * @see _.reduce
  3930. **/
  3931. foldl<T, TResult>(
  3932. collection: Dictionary<T>,
  3933. callback: MemoIterator<T, TResult>,
  3934. thisArg?: any): TResult;
  3935. }
  3936. interface LoDashArrayWrapper<T> {
  3937. /**
  3938. * @see _.reduce
  3939. **/
  3940. reduce<TResult>(
  3941. callback: MemoIterator<T, TResult>,
  3942. accumulator: TResult,
  3943. thisArg?: any): TResult;
  3944. /**
  3945. * @see _.reduce
  3946. **/
  3947. reduce<TResult>(
  3948. callback: MemoIterator<T, TResult>,
  3949. thisArg?: any): TResult;
  3950. /**
  3951. * @see _.reduce
  3952. **/
  3953. inject<TResult>(
  3954. callback: MemoIterator<T, TResult>,
  3955. accumulator: TResult,
  3956. thisArg?: any): TResult;
  3957. /**
  3958. * @see _.reduce
  3959. **/
  3960. inject<TResult>(
  3961. callback: MemoIterator<T, TResult>,
  3962. thisArg?: any): TResult;
  3963. /**
  3964. * @see _.reduce
  3965. **/
  3966. foldl<TResult>(
  3967. callback: MemoIterator<T, TResult>,
  3968. accumulator: TResult,
  3969. thisArg?: any): TResult;
  3970. /**
  3971. * @see _.reduce
  3972. **/
  3973. foldl<TResult>(
  3974. callback: MemoIterator<T, TResult>,
  3975. thisArg?: any): TResult;
  3976. }
  3977. interface LoDashObjectWrapper<T> {
  3978. /**
  3979. * @see _.reduce
  3980. **/
  3981. reduce<TValue, TResult>(
  3982. callback: MemoIterator<TValue, TResult>,
  3983. accumulator: TResult,
  3984. thisArg?: any): TResult;
  3985. /**
  3986. * @see _.reduce
  3987. **/
  3988. reduce<TValue, TResult>(
  3989. callback: MemoIterator<TValue, TResult>,
  3990. thisArg?: any): TResult;
  3991. /**
  3992. * @see _.reduce
  3993. **/
  3994. inject<TValue, TResult>(
  3995. callback: MemoIterator<TValue, TResult>,
  3996. accumulator: TResult,
  3997. thisArg?: any): TResult;
  3998. /**
  3999. * @see _.reduce
  4000. **/
  4001. inject<TValue, TResult>(
  4002. callback: MemoIterator<TValue, TResult>,
  4003. thisArg?: any): TResult;
  4004. /**
  4005. * @see _.reduce
  4006. **/
  4007. foldl<TValue, TResult>(
  4008. callback: MemoIterator<TValue, TResult>,
  4009. accumulator: TResult,
  4010. thisArg?: any): TResult;
  4011. /**
  4012. * @see _.reduce
  4013. **/
  4014. foldl<TValue, TResult>(
  4015. callback: MemoIterator<TValue, TResult>,
  4016. thisArg?: any): TResult;
  4017. }
  4018. //_.reduceRight
  4019. interface LoDashStatic {
  4020. /**
  4021. * This method is like _.reduce except that it iterates over elements of a collection from
  4022. * right to left.
  4023. * @param collection The collection to iterate over.
  4024. * @param callback The function called per iteration.
  4025. * @param accumulator Initial value of the accumulator.
  4026. * @param thisArg The this binding of callback.
  4027. * @return The accumulated value.
  4028. **/
  4029. reduceRight<T, TResult>(
  4030. collection: Array<T>,
  4031. callback: MemoIterator<T, TResult>,
  4032. accumulator: TResult,
  4033. thisArg?: any): TResult;
  4034. /**
  4035. * @see _.reduceRight
  4036. **/
  4037. reduceRight<T, TResult>(
  4038. collection: List<T>,
  4039. callback: MemoIterator<T, TResult>,
  4040. accumulator: TResult,
  4041. thisArg?: any): TResult;
  4042. /**
  4043. * @see _.reduceRight
  4044. **/
  4045. reduceRight<T, TResult>(
  4046. collection: Dictionary<T>,
  4047. callback: MemoIterator<T, TResult>,
  4048. accumulator: TResult,
  4049. thisArg?: any): TResult;
  4050. /**
  4051. * @see _.reduceRight
  4052. **/
  4053. reduceRight<T, TResult>(
  4054. collection: Array<T>,
  4055. callback: MemoIterator<T, TResult>,
  4056. thisArg?: any): TResult;
  4057. /**
  4058. * @see _.reduceRight
  4059. **/
  4060. reduceRight<T, TResult>(
  4061. collection: List<T>,
  4062. callback: MemoIterator<T, TResult>,
  4063. thisArg?: any): TResult;
  4064. /**
  4065. * @see _.reduceRight
  4066. **/
  4067. reduceRight<T, TResult>(
  4068. collection: Dictionary<T>,
  4069. callback: MemoIterator<T, TResult>,
  4070. thisArg?: any): TResult;
  4071. /**
  4072. * @see _.reduceRight
  4073. **/
  4074. foldr<T, TResult>(
  4075. collection: Array<T>,
  4076. callback: MemoIterator<T, TResult>,
  4077. accumulator: TResult,
  4078. thisArg?: any): TResult;
  4079. /**
  4080. * @see _.reduceRight
  4081. **/
  4082. foldr<T, TResult>(
  4083. collection: List<T>,
  4084. callback: MemoIterator<T, TResult>,
  4085. accumulator: TResult,
  4086. thisArg?: any): TResult;
  4087. /**
  4088. * @see _.reduceRight
  4089. **/
  4090. foldr<T, TResult>(
  4091. collection: Dictionary<T>,
  4092. callback: MemoIterator<T, TResult>,
  4093. accumulator: TResult,
  4094. thisArg?: any): TResult;
  4095. /**
  4096. * @see _.reduceRight
  4097. **/
  4098. foldr<T, TResult>(
  4099. collection: Array<T>,
  4100. callback: MemoIterator<T, TResult>,
  4101. thisArg?: any): TResult;
  4102. /**
  4103. * @see _.reduceRight
  4104. **/
  4105. foldr<T, TResult>(
  4106. collection: List<T>,
  4107. callback: MemoIterator<T, TResult>,
  4108. thisArg?: any): TResult;
  4109. /**
  4110. * @see _.reduceRight
  4111. **/
  4112. foldr<T, TResult>(
  4113. collection: Dictionary<T>,
  4114. callback: MemoIterator<T, TResult>,
  4115. thisArg?: any): TResult;
  4116. }
  4117. //_.reject
  4118. interface LoDashStatic {
  4119. /**
  4120. * The opposite of _.filter this method returns the elements of a collection that
  4121. * the callback does not return truey for.
  4122. *
  4123. * If a property name is provided for callback the created "_.pluck" style callback
  4124. * will return the property value of the given element.
  4125. *
  4126. * If an object is provided for callback the created "_.where" style callback will
  4127. * return true for elements that have the properties of the given object, else false.
  4128. * @param collection The collection to iterate over.
  4129. * @param callback The function called per iteration.
  4130. * @param thisArg The this binding of callback.
  4131. * @return A new array of elements that failed the callback check.
  4132. **/
  4133. reject<T>(
  4134. collection: Array<T>,
  4135. callback: ListIterator<T, boolean>,
  4136. thisArg?: any): T[];
  4137. /**
  4138. * @see _.reject
  4139. **/
  4140. reject<T>(
  4141. collection: List<T>,
  4142. callback: ListIterator<T, boolean>,
  4143. thisArg?: any): T[];
  4144. /**
  4145. * @see _.reject
  4146. **/
  4147. reject<T>(
  4148. collection: Dictionary<T>,
  4149. callback: DictionaryIterator<T, boolean>,
  4150. thisArg?: any): T[];
  4151. /**
  4152. * @see _.reject
  4153. * @param pluckValue _.pluck style callback
  4154. **/
  4155. reject<T>(
  4156. collection: Array<T>,
  4157. pluckValue: string): T[];
  4158. /**
  4159. * @see _.reject
  4160. * @param pluckValue _.pluck style callback
  4161. **/
  4162. reject<T>(
  4163. collection: List<T>,
  4164. pluckValue: string): T[];
  4165. /**
  4166. * @see _.reject
  4167. * @param pluckValue _.pluck style callback
  4168. **/
  4169. reject<T>(
  4170. collection: Dictionary<T>,
  4171. pluckValue: string): T[];
  4172. /**
  4173. * @see _.reject
  4174. * @param whereValue _.where style callback
  4175. **/
  4176. reject<W, T>(
  4177. collection: Array<T>,
  4178. whereValue: W): T[];
  4179. /**
  4180. * @see _.reject
  4181. * @param whereValue _.where style callback
  4182. **/
  4183. reject<W, T>(
  4184. collection: List<T>,
  4185. whereValue: W): T[];
  4186. /**
  4187. * @see _.reject
  4188. * @param whereValue _.where style callback
  4189. **/
  4190. reject<W, T>(
  4191. collection: Dictionary<T>,
  4192. whereValue: W): T[];
  4193. }
  4194. interface LoDashArrayWrapper<T> {
  4195. /**
  4196. * @see _.reject
  4197. **/
  4198. reject(
  4199. callback: ListIterator<T, boolean>,
  4200. thisArg?: any): LoDashArrayWrapper<T>;
  4201. /**
  4202. * @see _.reject
  4203. * @param pluckValue _.pluck style callback
  4204. **/
  4205. reject(pluckValue: string): LoDashArrayWrapper<T>;
  4206. /**
  4207. * @see _.reject
  4208. * @param whereValue _.where style callback
  4209. **/
  4210. reject<W>(whereValue: W): LoDashArrayWrapper<T>;
  4211. }
  4212. //_.sample
  4213. interface LoDashStatic {
  4214. /**
  4215. * Retrieves a random element or n random elements from a collection.
  4216. * @param collection The collection to sample.
  4217. * @return Returns the random sample(s) of collection.
  4218. **/
  4219. sample<T>(collection: Array<T>): T;
  4220. /**
  4221. * @see _.sample
  4222. **/
  4223. sample<T>(collection: List<T>): T;
  4224. /**
  4225. * @see _.sample
  4226. **/
  4227. sample<T>(collection: Dictionary<T>): T;
  4228. /**
  4229. * @see _.sample
  4230. * @param n The number of elements to sample.
  4231. **/
  4232. sample<T>(collection: Array<T>, n: number): T[];
  4233. /**
  4234. * @see _.sample
  4235. * @param n The number of elements to sample.
  4236. **/
  4237. sample<T>(collection: List<T>, n: number): T[];
  4238. /**
  4239. * @see _.sample
  4240. * @param n The number of elements to sample.
  4241. **/
  4242. sample<T>(collection: Dictionary<T>, n: number): T[];
  4243. }
  4244. interface LoDashArrayWrapper<T> {
  4245. /**
  4246. * @see _.sample
  4247. **/
  4248. sample(n: number): LoDashArrayWrapper<T>;
  4249. /**
  4250. * @see _.sample
  4251. **/
  4252. sample(): LoDashWrapper<T>;
  4253. }
  4254. //_.shuffle
  4255. interface LoDashStatic {
  4256. /**
  4257. * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
  4258. * See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle.
  4259. * @param collection The collection to shuffle.
  4260. * @return Returns a new shuffled collection.
  4261. **/
  4262. shuffle<T>(collection: Array<T>): T[];
  4263. /**
  4264. * @see _.shuffle
  4265. **/
  4266. shuffle<T>(collection: List<T>): T[];
  4267. /**
  4268. * @see _.shuffle
  4269. **/
  4270. shuffle<T>(collection: Dictionary<T>): T[];
  4271. }
  4272. interface LoDashArrayWrapper<T> {
  4273. /**
  4274. * @see _.shuffle
  4275. **/
  4276. shuffle(): LoDashArrayWrapper<T>;
  4277. }
  4278. interface LoDashObjectWrapper<T> {
  4279. /**
  4280. * @see _.shuffle
  4281. **/
  4282. shuffle(): LoDashArrayWrapper<T>;
  4283. }
  4284. //_.size
  4285. interface LoDashStatic {
  4286. /**
  4287. * Gets the size of the collection by returning collection.length for arrays and array-like
  4288. * objects or the number of own enumerable properties for objects.
  4289. * @param collection The collection to inspect.
  4290. * @return collection.length
  4291. **/
  4292. size<T>(collection: Array<T>): number;
  4293. /**
  4294. * @see _.size
  4295. **/
  4296. size<T>(collection: List<T>): number;
  4297. /**
  4298. * @see _.size
  4299. * @param object The object to inspect
  4300. * @return The number of own enumerable properties.
  4301. **/
  4302. size<T extends {}>(object: T): number;
  4303. /**
  4304. * @see _.size
  4305. * @param aString The string to inspect
  4306. * @return The length of aString
  4307. **/
  4308. size(aString: string): number;
  4309. }
  4310. interface LoDashArrayWrapper<T> {
  4311. /**
  4312. * @see _.size
  4313. **/
  4314. size(): number;
  4315. }
  4316. interface LoDashObjectWrapper<T> {
  4317. /**
  4318. * @see _.size
  4319. **/
  4320. size(): number;
  4321. }
  4322. //_.some
  4323. interface LoDashStatic {
  4324. /**
  4325. * Checks if the callback returns a truey value for any element of a collection. The function
  4326. * returns as soon as it finds a passing value and does not iterate over the entire collection.
  4327. * The callback is bound to thisArg and invoked with three arguments; (value, index|key, collection).
  4328. *
  4329. * If a property name is provided for callback the created "_.pluck" style callback will return
  4330. * the property value of the given element.
  4331. *
  4332. * If an object is provided for callback the created "_.where" style callback will return true for
  4333. * elements that have the properties of the given object, else false.
  4334. * @param collection The collection to iterate over.
  4335. * @param callback The function called per iteration.
  4336. * @param thisArg The this binding of callback.
  4337. * @return True if any element passed the callback check, else false.
  4338. **/
  4339. some<T>(
  4340. collection: Array<T>,
  4341. callback?: ListIterator<T, boolean>,
  4342. thisArg?: any): boolean;
  4343. /**
  4344. * @see _.some
  4345. **/
  4346. some<T>(
  4347. collection: List<T>,
  4348. callback?: ListIterator<T, boolean>,
  4349. thisArg?: any): boolean;
  4350. /**
  4351. * @see _.some
  4352. **/
  4353. some<T>(
  4354. collection: Dictionary<T>,
  4355. callback?: DictionaryIterator<T, boolean>,
  4356. thisArg?: any): boolean;
  4357. /**
  4358. * @see _.some
  4359. **/
  4360. some(
  4361. collection: {},
  4362. callback?: ListIterator<{}, boolean>,
  4363. thisArg?: any): boolean;
  4364. /**
  4365. * @see _.some
  4366. * @param pluckValue _.pluck style callback
  4367. **/
  4368. some<T>(
  4369. collection: Array<T>,
  4370. pluckValue: string): boolean;
  4371. /**
  4372. * @see _.some
  4373. * @param pluckValue _.pluck style callback
  4374. **/
  4375. some<T>(
  4376. collection: List<T>,
  4377. pluckValue: string): boolean;
  4378. /**
  4379. * @see _.some
  4380. * @param pluckValue _.pluck style callback
  4381. **/
  4382. some<T>(
  4383. collection: Dictionary<T>,
  4384. pluckValue: string): boolean;
  4385. /**
  4386. * @see _.some
  4387. * @param whereValue _.where style callback
  4388. **/
  4389. some<W, T>(
  4390. collection: Array<T>,
  4391. whereValue: W): boolean;
  4392. /**
  4393. * @see _.some
  4394. * @param whereValue _.where style callback
  4395. **/
  4396. some<W, T>(
  4397. collection: List<T>,
  4398. whereValue: W): boolean;
  4399. /**
  4400. * @see _.some
  4401. * @param whereValue _.where style callback
  4402. **/
  4403. some<W, T>(
  4404. collection: Dictionary<T>,
  4405. whereValue: W): boolean;
  4406. /**
  4407. * @see _.some
  4408. **/
  4409. any<T>(
  4410. collection: Array<T>,
  4411. callback?: ListIterator<T, boolean>,
  4412. thisArg?: any): boolean;
  4413. /**
  4414. * @see _.some
  4415. **/
  4416. any<T>(
  4417. collection: List<T>,
  4418. callback?: ListIterator<T, boolean>,
  4419. thisArg?: any): boolean;
  4420. /**
  4421. * @see _.some
  4422. **/
  4423. any<T>(
  4424. collection: Dictionary<T>,
  4425. callback?: DictionaryIterator<T, boolean>,
  4426. thisArg?: any): boolean;
  4427. /**
  4428. * @see _.some
  4429. **/
  4430. any(
  4431. collection: {},
  4432. callback?: ListIterator<{}, boolean>,
  4433. thisArg?: any): boolean;
  4434. /**
  4435. * @see _.some
  4436. * @param pluckValue _.pluck style callback
  4437. **/
  4438. any<T>(
  4439. collection: Array<T>,
  4440. pluckValue: string): boolean;
  4441. /**
  4442. * @see _.some
  4443. * @param pluckValue _.pluck style callback
  4444. **/
  4445. any<T>(
  4446. collection: List<T>,
  4447. pluckValue: string): boolean;
  4448. /**
  4449. * @see _.some
  4450. * @param pluckValue _.pluck style callback
  4451. **/
  4452. any<T>(
  4453. collection: Dictionary<T>,
  4454. pluckValue: string): boolean;
  4455. /**
  4456. * @see _.some
  4457. * @param whereValue _.where style callback
  4458. **/
  4459. any<W, T>(
  4460. collection: Array<T>,
  4461. whereValue: W): boolean;
  4462. /**
  4463. * @see _.some
  4464. * @param whereValue _.where style callback
  4465. **/
  4466. any<W, T>(
  4467. collection: List<T>,
  4468. whereValue: W): boolean;
  4469. /**
  4470. * @see _.some
  4471. * @param whereValue _.where style callback
  4472. **/
  4473. any<W, T>(
  4474. collection: Dictionary<T>,
  4475. whereValue: W): boolean;
  4476. }
  4477. //_.sortBy
  4478. interface LoDashStatic {
  4479. /**
  4480. * Creates an array of elements, sorted in ascending order by the results of running each
  4481. * element in a collection through the callback. This method performs a stable sort, that
  4482. * is, it will preserve the original sort order of equal elements. The callback is bound
  4483. * to thisArg and invoked with three arguments; (value, index|key, collection).
  4484. *
  4485. * If a property name is provided for callback the created "_.pluck" style callback will
  4486. * return the property value of the given element.
  4487. *
  4488. * If a value is also provided for thisArg the created "_.matchesProperty" style callback
  4489. * returns true for elements that have a matching property value, else false.
  4490. *
  4491. * If an object is provided for an iteratee the created "_.matches" style callback returns
  4492. * true for elements that have the properties of the given object, else false.
  4493. * @param collection The collection to iterate over.
  4494. * @param callback The function called per iteration.
  4495. * @param thisArg The this binding of callback.
  4496. * @return A new array of sorted elements.
  4497. **/
  4498. sortBy<T, TSort>(
  4499. collection: Array<T>,
  4500. iteratee?: ListIterator<T, TSort>,
  4501. thisArg?: any): T[];
  4502. /**
  4503. * @see _.sortBy
  4504. **/
  4505. sortBy<T, TSort>(
  4506. collection: List<T>,
  4507. iteratee?: ListIterator<T, TSort>,
  4508. thisArg?: any): T[];
  4509. /**
  4510. * @see _.sortBy
  4511. * @param pluckValue _.pluck style callback
  4512. **/
  4513. sortBy<T>(
  4514. collection: Array<T>,
  4515. pluckValue: string): T[];
  4516. /**
  4517. * @see _.sortBy
  4518. * @param pluckValue _.pluck style callback
  4519. **/
  4520. sortBy<T>(
  4521. collection: List<T>,
  4522. pluckValue: string): T[];
  4523. /**
  4524. * @see _.sortBy
  4525. * @param whereValue _.where style callback
  4526. **/
  4527. sortBy<W, T>(
  4528. collection: Array<T>,
  4529. whereValue: W): T[];
  4530. /**
  4531. * @see _.sortBy
  4532. * @param whereValue _.where style callback
  4533. **/
  4534. sortBy<W, T>(
  4535. collection: List<T>,
  4536. whereValue: W): T[];
  4537. /**
  4538. * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
  4539. * @param args The rules by which to sort
  4540. */
  4541. sortByAll<T>(
  4542. collection: (Array<T>|List<T>),
  4543. ...args: (ListIterator<T, boolean>|Object|string)[]
  4544. ): T[];
  4545. }
  4546. interface LoDashArrayWrapper<T> {
  4547. /**
  4548. * @see _.sortBy
  4549. **/
  4550. sortBy<TSort>(
  4551. iteratee?: ListIterator<T, TSort>,
  4552. thisArg?: any): LoDashArrayWrapper<T>;
  4553. /**
  4554. * @see _.sortBy
  4555. * @param pluckValue _.pluck style callback
  4556. **/
  4557. sortBy(pluckValue: string): LoDashArrayWrapper<T>;
  4558. /**
  4559. * @see _.sortBy
  4560. * @param whereValue _.where style callback
  4561. **/
  4562. sortBy<W>(whereValue: W): LoDashArrayWrapper<T>;
  4563. /**
  4564. * Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
  4565. * @param args The rules by which to sort
  4566. */
  4567. sortByAll(...args: (ListIterator<T, boolean>|Object|string)[]): LoDashArrayWrapper<T>;
  4568. }
  4569. //_.sortByAll
  4570. interface LoDashStatic {
  4571. /**
  4572. * This method is like "_.sortBy" except that it can sort by multiple iteratees or
  4573. * property names.
  4574. *
  4575. * If a property name is provided for an iteratee the created "_.property" style callback
  4576. * returns the property value of the given element.
  4577. *
  4578. * If a value is also provided for thisArg the created "_.matchesProperty" style callback
  4579. * returns true for elements that have a matching property value, else false.
  4580. *
  4581. * If an object is provided for an iteratee the created "_.matches" style callback returns
  4582. * true for elements that have the properties of the given object, else false.
  4583. *
  4584. * @param collection The collection to iterate over.
  4585. * @param callback The function called per iteration.
  4586. * @param thisArg The this binding of callback.
  4587. * @return A new array of sorted elements.
  4588. **/
  4589. sortByAll<T>(
  4590. collection: Array<T>,
  4591. iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  4592. /**
  4593. * @see _.sortByAll
  4594. **/
  4595. sortByAll<T>(
  4596. collection: List<T>,
  4597. iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  4598. /**
  4599. * @see _.sortByAll
  4600. **/
  4601. sortByAll<T>(
  4602. collection: Array<T>,
  4603. ...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  4604. /**
  4605. * @see _.sortByAll
  4606. **/
  4607. sortByAll<T>(
  4608. collection: List<T>,
  4609. ...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
  4610. }
  4611. interface LoDashArrayWrapper<T> {
  4612. /**
  4613. * @see _.sortByAll
  4614. **/
  4615. sortByAll(
  4616. iteratees: (ListIterator<T, any>|string|Object)[]): LoDashArrayWrapper<T>;
  4617. /**
  4618. * @see _.sortByAll
  4619. **/
  4620. sortByAll(
  4621. ...iteratees: (ListIterator<T, any>|string|Object)[]): LoDashArrayWrapper<T>;
  4622. }
  4623. //_.sortByOrder
  4624. interface LoDashStatic {
  4625. /**
  4626. * This method is like "_.sortByAll" except that it allows specifying the sort orders of the
  4627. * iteratees to sort by. If orders is unspecified, all values are sorted in ascending order.
  4628. * Otherwise, a value is sorted in ascending order if its corresponding order is "asc", and
  4629. * descending if "desc".
  4630. *
  4631. * If a property name is provided for an iteratee the created "_.property" style callback
  4632. * returns the property value of the given element.
  4633. *
  4634. * If an object is provided for an iteratee the created "_.matches" style callback returns
  4635. * true for elements that have the properties of the given object, else false.
  4636. *
  4637. * @param collection The collection to iterate over.
  4638. * @param callback The function called per iteration.
  4639. * @param thisArg The this binding of callback.
  4640. * @return A new array of sorted elements.
  4641. **/
  4642. sortByOrder<T>(
  4643. collection: Array<T>,
  4644. iteratees: (ListIterator<T, any>|string|Object)[],
  4645. orders?: boolean[]): T[];
  4646. /**
  4647. * @see _.sortByOrder
  4648. **/
  4649. sortByOrder<T>(
  4650. collection: List<T>,
  4651. iteratees: (ListIterator<T, any>|string|Object)[],
  4652. orders?: boolean[]): T[];
  4653. /**
  4654. * @see _.sortByOrder
  4655. **/
  4656. sortByOrder<T>(
  4657. collection: Array<T>,
  4658. iteratees: (ListIterator<T, any>|string|Object)[],
  4659. orders?: string[]): T[];
  4660. /**
  4661. * @see _.sortByOrder
  4662. **/
  4663. sortByOrder<T>(
  4664. collection: List<T>,
  4665. iteratees: (ListIterator<T, any>|string|Object)[],
  4666. orders?: string[]): T[];
  4667. }
  4668. interface LoDashArrayWrapper<T> {
  4669. /**
  4670. * @see _.sortByOrder
  4671. **/
  4672. sortByOrder(
  4673. iteratees: (ListIterator<T, any>|string|Object)[],
  4674. orders?: boolean[]): LoDashArrayWrapper<T>;
  4675. /**
  4676. * @see _.sortByOrder
  4677. **/
  4678. sortByOrder(
  4679. iteratees: (ListIterator<T, any>|string|Object)[],
  4680. orders?: string[]): LoDashArrayWrapper<T>;
  4681. }
  4682. //_.toArray
  4683. interface LoDashStatic {
  4684. /**
  4685. * Converts the collection to an array.
  4686. * @param collection The collection to convert.
  4687. * @return The new converted array.
  4688. **/
  4689. toArray<T>(collection: Array<T>): T[];
  4690. /**
  4691. * @see _.toArray
  4692. **/
  4693. toArray<T>(collection: List<T>): T[];
  4694. /**
  4695. * @see _.toArray
  4696. **/
  4697. toArray<T>(collection: Dictionary<T>): T[];
  4698. }
  4699. interface LoDashArrayWrapper<T> {
  4700. /**
  4701. * @see _.toArray
  4702. **/
  4703. toArray(): LoDashArrayWrapper<T>;
  4704. }
  4705. interface LoDashObjectWrapper<T> {
  4706. /**
  4707. * @see _.toArray
  4708. **/
  4709. toArray<TValue>(): LoDashArrayWrapper<TValue>;
  4710. }
  4711. //_.where
  4712. interface LoDashStatic {
  4713. /**
  4714. * Performs a deep comparison of each element in a collection to the given properties
  4715. * object, returning an array of all elements that have equivalent property values.
  4716. * @param collection The collection to iterate over.
  4717. * @param properties The object of property values to filter by.
  4718. * @return A new array of elements that have the given properties.
  4719. **/
  4720. where<T, U extends {}>(
  4721. list: Array<T>,
  4722. properties: U): T[];
  4723. /**
  4724. * @see _.where
  4725. **/
  4726. where<T, U extends {}>(
  4727. list: List<T>,
  4728. properties: U): T[];
  4729. /**
  4730. * @see _.where
  4731. **/
  4732. where<T, U extends {}>(
  4733. list: Dictionary<T>,
  4734. properties: U): T[];
  4735. }
  4736. interface LoDashArrayWrapper<T> {
  4737. /**
  4738. * @see _.where
  4739. **/
  4740. where<U extends {}>(properties: U): LoDashArrayWrapper<T>;
  4741. }
  4742. /********
  4743. * Date *
  4744. ********/
  4745. //_.now
  4746. interface LoDashStatic {
  4747. /**
  4748. * Gets the number of milliseconds that have elapsed since the Unix epoch
  4749. * (1 January 1970 00:00:00 UTC).
  4750. * @return The number of milliseconds.
  4751. **/
  4752. now(): number;
  4753. }
  4754. /*************
  4755. * Functions *
  4756. *************/
  4757. //_.after
  4758. interface LoDashStatic {
  4759. /**
  4760. * Creates a function that executes func, with the this binding and arguments of the
  4761. * created function, only after being called n times.
  4762. * @param n The number of times the function must be called before func is executed.
  4763. * @param func The function to restrict.
  4764. * @return The new restricted function.
  4765. **/
  4766. after(
  4767. n: number,
  4768. func: Function): Function;
  4769. }
  4770. interface LoDashWrapper<T> {
  4771. /**
  4772. * @see _.after
  4773. **/
  4774. after(func: Function): LoDashObjectWrapper<Function>;
  4775. }
  4776. //_.ary
  4777. interface LoDashStatic {
  4778. /**
  4779. * Creates a function that accepts up to n arguments ignoring any additional arguments.
  4780. * @param func The function to cap arguments for.
  4781. * @param n The arity cap.
  4782. * @param guard Enables use as a callback for functions like `_.map`.
  4783. * @returns Returns the new function.
  4784. */
  4785. ary<TResult extends Function>(func: Function, n?: number, guard?: Object): TResult;
  4786. }
  4787. interface LoDashObjectWrapper<T> {
  4788. /**
  4789. * @see _.ary
  4790. */
  4791. ary<TResult extends Function>(n?: number, guard?: Object): LoDashObjectWrapper<TResult>;
  4792. }
  4793. //_.backflow
  4794. interface LoDashStatic {
  4795. /**
  4796. * @see _.flowRight
  4797. */
  4798. backflow<TResult extends Function>(...funcs: Function[]): TResult;
  4799. }
  4800. interface LoDashObjectWrapper<T> {
  4801. /**
  4802. * @see _.flowRight
  4803. **/
  4804. backflow<TResult extends Function>(...funcs: Function[]): LoDashObjectWrapper<TResult>;
  4805. }
  4806. //_.before
  4807. interface LoDashStatic {
  4808. /**
  4809. * Creates a function that invokes func, with the this binding and arguments of the created function, while
  4810. * it is called less than n times. Subsequent calls to the created function return the result of the last func
  4811. * invocation.
  4812. * @param n The number of calls at which func is no longer invoked.
  4813. * @param func The function to restrict.
  4814. * @return Returns the new restricted function.
  4815. */
  4816. before<TFunc extends Function>(n: number, func: TFunc): TFunc;
  4817. }
  4818. interface LoDashWrapper<T> {
  4819. /**
  4820. * @sed _.before
  4821. */
  4822. before<TFunc extends Function>(func: TFunc): TFunc;
  4823. }
  4824. //_.bind
  4825. interface LoDashStatic {
  4826. /**
  4827. * Creates a function that, when called, invokes func with the this binding of thisArg
  4828. * and prepends any additional bind arguments to those provided to the bound function.
  4829. * @param func The function to bind.
  4830. * @param thisArg The this binding of func.
  4831. * @param args Arguments to be partially applied.
  4832. * @return The new bound function.
  4833. **/
  4834. bind(
  4835. func: Function,
  4836. thisArg: any,
  4837. ...args: any[]): (...args: any[]) => any;
  4838. }
  4839. interface LoDashObjectWrapper<T> {
  4840. /**
  4841. * @see _.bind
  4842. **/
  4843. bind(
  4844. thisArg: any,
  4845. ...args: any[]): LoDashObjectWrapper<(...args: any[]) => any>;
  4846. }
  4847. //_.bindAll
  4848. interface LoDashStatic {
  4849. /**
  4850. * Binds methods of an object to the object itself, overwriting the existing method. Method
  4851. * names may be specified as individual arguments or as arrays of method names. If no method
  4852. * names are provided all the function properties of object will be bound.
  4853. * @param object The object to bind and assign the bound methods to.
  4854. * @param methodNames The object method names to bind, specified as individual method names
  4855. * or arrays of method names.
  4856. * @return object
  4857. **/
  4858. bindAll<T>(
  4859. object: T,
  4860. ...methodNames: string[]): T;
  4861. }
  4862. interface LoDashObjectWrapper<T> {
  4863. /**
  4864. * @see _.bindAll
  4865. **/
  4866. bindAll(...methodNames: string[]): LoDashWrapper<T>;
  4867. }
  4868. //_.bindKey
  4869. interface LoDashStatic {
  4870. /**
  4871. * Creates a function that, when called, invokes the method at object[key] and prepends any
  4872. * additional bindKey arguments to those provided to the bound function. This method differs
  4873. * from _.bind by allowing bound functions to reference methods that will be redefined or don't
  4874. * yet exist. See http://michaux.ca/articles/lazy-function-definition-pattern.
  4875. * @param object The object the method belongs to.
  4876. * @param key The key of the method.
  4877. * @param args Arguments to be partially applied.
  4878. * @return The new bound function.
  4879. **/
  4880. bindKey<T>(
  4881. object: T,
  4882. key: string,
  4883. ...args: any[]): Function;
  4884. }
  4885. interface LoDashObjectWrapper<T> {
  4886. /**
  4887. * @see _.bindKey
  4888. **/
  4889. bindKey(
  4890. key: string,
  4891. ...args: any[]): LoDashObjectWrapper<Function>;
  4892. }
  4893. //_.compose
  4894. interface LoDashStatic {
  4895. /**
  4896. * @see _.flowRight
  4897. */
  4898. compose<TResult extends Function>(...funcs: Function[]): TResult;
  4899. }
  4900. interface LoDashObjectWrapper<T> {
  4901. /**
  4902. * @see _.flowRight
  4903. */
  4904. compose<TResult extends Function>(...funcs: Function[]): LoDashObjectWrapper<TResult>;
  4905. }
  4906. //_.createCallback
  4907. interface LoDashStatic {
  4908. /**
  4909. * Produces a callback bound to an optional thisArg. If func is a property name the created
  4910. * callback will return the property value for a given element. If func is an object the created
  4911. * callback will return true for elements that contain the equivalent object properties,
  4912. * otherwise it will return false.
  4913. * @param func The value to convert to a callback.
  4914. * @param thisArg The this binding of the created callback.
  4915. * @param argCount The number of arguments the callback accepts.
  4916. * @return A callback function.
  4917. **/
  4918. createCallback(
  4919. func: string,
  4920. thisArg?: any,
  4921. argCount?: number): () => any;
  4922. /**
  4923. * @see _.createCallback
  4924. **/
  4925. createCallback(
  4926. func: Dictionary<any>,
  4927. thisArg?: any,
  4928. argCount?: number): () => boolean;
  4929. }
  4930. interface LoDashWrapper<T> {
  4931. /**
  4932. * @see _.createCallback
  4933. **/
  4934. createCallback(
  4935. thisArg?: any,
  4936. argCount?: number): LoDashObjectWrapper<() => any>;
  4937. }
  4938. interface LoDashObjectWrapper<T> {
  4939. /**
  4940. * @see _.createCallback
  4941. **/
  4942. createCallback(
  4943. thisArg?: any,
  4944. argCount?: number): LoDashObjectWrapper<() => any>;
  4945. }
  4946. //_.curry
  4947. interface LoDashStatic {
  4948. /**
  4949. * Creates a function that accepts one or more arguments of func that when called either invokes func returning
  4950. * its result, if all func arguments have been provided, or returns a function that accepts one or more of the
  4951. * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
  4952. * @param func The function to curry.
  4953. * @param arity The arity of func.
  4954. * @return Returns the new curried function.
  4955. */
  4956. curry<TResult extends Function>(
  4957. func: Function,
  4958. arity?: number): TResult;
  4959. }
  4960. interface LoDashObjectWrapper<T> {
  4961. /**
  4962. * @see _.curry
  4963. **/
  4964. curry<TResult extends Function>(arity?: number): LoDashObjectWrapper<TResult>;
  4965. }
  4966. //_.curryRight
  4967. interface LoDashStatic {
  4968. /**
  4969. * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
  4970. * instead of _.partial.
  4971. * @param func The function to curry.
  4972. * @param arity The arity of func.
  4973. * @return Returns the new curried function.
  4974. */
  4975. curryRight<TResult extends Function>(
  4976. func: Function,
  4977. arity?: number): TResult;
  4978. }
  4979. interface LoDashObjectWrapper<T> {
  4980. /**
  4981. * @see _.curryRight
  4982. **/
  4983. curryRight<TResult extends Function>(arity?: number): LoDashObjectWrapper<TResult>;
  4984. }
  4985. //_.debounce
  4986. interface LoDashStatic {
  4987. /**
  4988. * Creates a function that will delay the execution of func until after wait milliseconds have
  4989. * elapsed since the last time it was invoked. Provide an options object to indicate that func
  4990. * should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls
  4991. * to the debounced function will return the result of the last func call.
  4992. *
  4993. * Note: If leading and trailing options are true func will be called on the trailing edge of
  4994. * the timeout only if the the debounced function is invoked more than once during the wait
  4995. * timeout.
  4996. * @param func The function to debounce.
  4997. * @param wait The number of milliseconds to delay.
  4998. * @param options The options object.
  4999. * @param options.leading Specify execution on the leading edge of the timeout.
  5000. * @param options.maxWait The maximum time func is allowed to be delayed before it's called.
  5001. * @param options.trailing Specify execution on the trailing edge of the timeout.
  5002. * @return The new debounced function.
  5003. **/
  5004. debounce<T extends Function>(
  5005. func: T,
  5006. wait: number,
  5007. options?: DebounceSettings): T;
  5008. }
  5009. interface LoDashObjectWrapper<T> {
  5010. /**
  5011. * @see _.debounce
  5012. **/
  5013. debounce(
  5014. wait: number,
  5015. options?: DebounceSettings): LoDashObjectWrapper<Function>;
  5016. }
  5017. interface DebounceSettings {
  5018. /**
  5019. * Specify execution on the leading edge of the timeout.
  5020. **/
  5021. leading?: boolean;
  5022. /**
  5023. * The maximum time func is allowed to be delayed before it's called.
  5024. **/
  5025. maxWait?: number;
  5026. /**
  5027. * Specify execution on the trailing edge of the timeout.
  5028. **/
  5029. trailing?: boolean;
  5030. }
  5031. //_.defer
  5032. interface LoDashStatic {
  5033. /**
  5034. * Defers executing the func function until the current call stack has cleared. Additional
  5035. * arguments will be provided to func when it is invoked.
  5036. * @param func The function to defer.
  5037. * @param args Arguments to invoke the function with.
  5038. * @return The timer id.
  5039. **/
  5040. defer(
  5041. func: Function,
  5042. ...args: any[]): number;
  5043. }
  5044. interface LoDashObjectWrapper<T> {
  5045. /**
  5046. * @see _.defer
  5047. **/
  5048. defer(...args: any[]): LoDashWrapper<number>;
  5049. }
  5050. //_.delay
  5051. interface LoDashStatic {
  5052. /**
  5053. * Executes the func function after wait milliseconds. Additional arguments will be provided
  5054. * to func when it is invoked.
  5055. * @param func The function to delay.
  5056. * @param wait The number of milliseconds to delay execution.
  5057. * @param args Arguments to invoke the function with.
  5058. * @return The timer id.
  5059. **/
  5060. delay(
  5061. func: Function,
  5062. wait: number,
  5063. ...args: any[]): number;
  5064. }
  5065. interface LoDashObjectWrapper<T> {
  5066. /**
  5067. * @see _.delay
  5068. **/
  5069. delay(
  5070. wait: number,
  5071. ...args: any[]): LoDashWrapper<number>;
  5072. }
  5073. //_.flow
  5074. interface LoDashStatic {
  5075. /**
  5076. * Creates a function that returns the result of invoking the provided functions with the this binding of the
  5077. * created function, where each successive invocation is supplied the return value of the previous.
  5078. * @param funcs Functions to invoke.
  5079. * @return Returns the new function.
  5080. */
  5081. flow<TResult extends Function>(...funcs: Function[]): TResult;
  5082. }
  5083. interface LoDashObjectWrapper<T> {
  5084. /**
  5085. * @see _.flow
  5086. **/
  5087. flow<TResult extends Function>(...funcs: Function[]): LoDashObjectWrapper<TResult>;
  5088. }
  5089. //_.flowRight
  5090. interface LoDashStatic {
  5091. /**
  5092. * This method is like _.flow except that it creates a function that invokes the provided functions from right
  5093. * to left.
  5094. * @param funcs Functions to invoke.
  5095. * @return Returns the new function.
  5096. */
  5097. flowRight<TResult extends Function>(...funcs: Function[]): TResult;
  5098. }
  5099. interface LoDashObjectWrapper<T> {
  5100. /**
  5101. * @see _.flowRight
  5102. **/
  5103. flowRight<TResult extends Function>(...funcs: Function[]): LoDashObjectWrapper<TResult>;
  5104. }
  5105. //_.memoize
  5106. interface MemoizedFunction extends Function {
  5107. cache: MapCache;
  5108. }
  5109. interface LoDashStatic {
  5110. /**
  5111. * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for
  5112. * storing the result based on the arguments provided to the memoized function. By default, the first argument
  5113. * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with
  5114. * the this binding of the memoized function.
  5115. * @param func The function to have its output memoized.
  5116. * @param resolver The function to resolve the cache key.
  5117. * @return Returns the new memoizing function.
  5118. */
  5119. memoize<TResult extends MemoizedFunction>(
  5120. func: Function,
  5121. resolver?: Function): TResult;
  5122. }
  5123. interface LoDashObjectWrapper<T> {
  5124. /**
  5125. * @see _.memoize
  5126. */
  5127. memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashObjectWrapper<TResult>;
  5128. }
  5129. //_.modArgs
  5130. interface LoDashStatic {
  5131. /**
  5132. * Creates a function that runs each argument through a corresponding transform function.
  5133. * @param func The function to wrap.
  5134. * @param transforms The functions to transform arguments, specified as individual functions or arrays
  5135. * of functions.
  5136. * @return Returns the new function.
  5137. */
  5138. modArgs<T extends Function, TResult extends Function>(
  5139. func: T,
  5140. ...transforms: Function[]
  5141. ): TResult;
  5142. /**
  5143. * @see _.modArgs
  5144. */
  5145. modArgs<T extends Function, TResult extends Function>(
  5146. func: T,
  5147. transforms: Function[]
  5148. ): TResult;
  5149. }
  5150. interface LoDashObjectWrapper<T> {
  5151. /**
  5152. * @see _.modArgs
  5153. */
  5154. modArgs<TResult extends Function>(...transforms: Function[]): LoDashObjectWrapper<TResult>;
  5155. /**
  5156. * @see _.modArgs
  5157. */
  5158. modArgs<TResult extends Function>(transforms: Function[]): LoDashObjectWrapper<TResult>;
  5159. }
  5160. //_.negate
  5161. interface LoDashStatic {
  5162. /**
  5163. * Creates a function that negates the result of the predicate func. The func predicate is invoked with
  5164. * the this binding and arguments of the created function.
  5165. * @param predicate The predicate to negate.
  5166. * @return Returns the new function.
  5167. */
  5168. negate<T extends Function>(predicate: T): (...args: any[]) => boolean;
  5169. /**
  5170. * @see _.negate
  5171. */
  5172. negate<T extends Function, TResult extends Function>(predicate: T): TResult;
  5173. }
  5174. interface LoDashObjectWrapper<T> {
  5175. /**
  5176. * @see _.negate
  5177. */
  5178. negate(): LoDashObjectWrapper<(...args: any[]) => boolean>;
  5179. /**
  5180. * @see _.negate
  5181. */
  5182. negate<TResult extends Function>(): LoDashObjectWrapper<TResult>;
  5183. }
  5184. //_.once
  5185. interface LoDashStatic {
  5186. /**
  5187. * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value
  5188. * of the first call. The func is invoked with the this binding and arguments of the created function.
  5189. * @param func The function to restrict.
  5190. * @return Returns the new restricted function.
  5191. */
  5192. once<T extends Function>(func: T): T;
  5193. }
  5194. interface LoDashObjectWrapper<T> {
  5195. /**
  5196. * @see _.once
  5197. */
  5198. once(): LoDashObjectWrapper<T>;
  5199. }
  5200. //_.partial
  5201. interface LoDashStatic {
  5202. /**
  5203. * Creates a function that, when called, invokes func with any additional partial arguments
  5204. * prepended to those provided to the new function. This method is similar to _.bind except
  5205. * it does not alter the this binding.
  5206. * @param func The function to partially apply arguments to.
  5207. * @param args Arguments to be partially applied.
  5208. * @return The new partially applied function.
  5209. **/
  5210. partial(
  5211. func: Function,
  5212. ...args: any[]): Function;
  5213. }
  5214. //_.partialRight
  5215. interface LoDashStatic {
  5216. /**
  5217. * This method is like _.partial except that partial arguments are appended to those provided
  5218. * to the new function.
  5219. * @param func The function to partially apply arguments to.
  5220. * @param args Arguments to be partially applied.
  5221. * @return The new partially applied function.
  5222. **/
  5223. partialRight(
  5224. func: Function,
  5225. ...args: any[]): Function;
  5226. }
  5227. //_.rearg
  5228. interface LoDashStatic {
  5229. /**
  5230. * Creates a function that invokes func with arguments arranged according to the specified indexes where the
  5231. * argument value at the first index is provided as the first argument, the argument value at the second index
  5232. * is provided as the second argument, and so on.
  5233. * @param func The function to rearrange arguments for.
  5234. * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes.
  5235. * @return Returns the new function.
  5236. */
  5237. rearg<TResult extends Function>(func: Function, indexes: number[]): TResult;
  5238. /**
  5239. * @see _.rearg
  5240. */
  5241. rearg<TResult extends Function>(func: Function, ...indexes: number[]): TResult;
  5242. }
  5243. interface LoDashObjectWrapper<T> {
  5244. /**
  5245. * @see _.rearg
  5246. */
  5247. rearg<TResult extends Function>(indexes: number[]): LoDashObjectWrapper<TResult>;
  5248. /**
  5249. * @see _.rearg
  5250. */
  5251. rearg<TResult extends Function>(...indexes: number[]): LoDashObjectWrapper<TResult>;
  5252. }
  5253. //_.restParam
  5254. interface LoDashStatic {
  5255. /**
  5256. * Creates a function that invokes func with the this binding of the created function and arguments from start
  5257. * and beyond provided as an array.
  5258. * @param func The function to apply a rest parameter to.
  5259. * @param start The start position of the rest parameter.
  5260. * @return Returns the new function.
  5261. */
  5262. restParam<TResult extends Function>(func: Function, start?: number): TResult;
  5263. /**
  5264. * @see _.restParam
  5265. */
  5266. restParam<TResult extends Function, TFunc extends Function>(func: TFunc, start?: number): TResult;
  5267. }
  5268. interface LoDashObjectWrapper<T> {
  5269. /**
  5270. * @see _.restParam
  5271. */
  5272. restParam<TResult extends Function>(start?: number): LoDashObjectWrapper<TResult>;
  5273. }
  5274. //_.spread
  5275. interface LoDashStatic {
  5276. /**
  5277. * Creates a function that invokes func with the this binding of the created function and an array of arguments
  5278. * much like Function#apply.
  5279. * @param func The function to spread arguments over.
  5280. * @return Returns the new function.
  5281. */
  5282. spread<TResult extends Function>(func: Function): TResult;
  5283. }
  5284. interface LoDashObjectWrapper<T> {
  5285. /**
  5286. * @see _.spread
  5287. */
  5288. spread<TResult extends Function>(): LoDashObjectWrapper<TResult>;
  5289. }
  5290. //_.throttle
  5291. interface LoDashStatic {
  5292. /**
  5293. * Creates a function that, when executed, will only call the func function at most once per
  5294. * every wait milliseconds. Provide an options object to indicate that func should be invoked
  5295. * on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled
  5296. * function will return the result of the last func call.
  5297. *
  5298. * Note: If leading and trailing options are true func will be called on the trailing edge of
  5299. * the timeout only if the the throttled function is invoked more than once during the wait timeout.
  5300. * @param func The function to throttle.
  5301. * @param wait The number of milliseconds to throttle executions to.
  5302. * @param options The options object.
  5303. * @param options.leading Specify execution on the leading edge of the timeout.
  5304. * @param options.trailing Specify execution on the trailing edge of the timeout.
  5305. * @return The new throttled function.
  5306. **/
  5307. throttle<T extends Function>(
  5308. func: T,
  5309. wait: number,
  5310. options?: ThrottleSettings): T;
  5311. }
  5312. interface ThrottleSettings {
  5313. /**
  5314. * If you'd like to disable the leading-edge call, pass this as false.
  5315. **/
  5316. leading?: boolean;
  5317. /**
  5318. * If you'd like to disable the execution on the trailing-edge, pass false.
  5319. **/
  5320. trailing?: boolean;
  5321. }
  5322. //_.wrap
  5323. interface LoDashStatic {
  5324. /**
  5325. * Creates a function that provides value to the wrapper function as its first argument.
  5326. * Additional arguments provided to the function are appended to those provided to the
  5327. * wrapper function. The wrapper is executed with the this binding of the created function.
  5328. * @param value The value to wrap.
  5329. * @param wrapper The wrapper function.
  5330. * @return The new function.
  5331. **/
  5332. wrap(
  5333. value: any,
  5334. wrapper: (func: Function, ...args: any[]) => any): Function;
  5335. }
  5336. /********
  5337. * Lang *
  5338. ********/
  5339. //_.clone
  5340. interface LoDashStatic {
  5341. /**
  5342. * Creates a clone of value. If isDeep is true nested objects are cloned, otherwise they are assigned by
  5343. * reference. If customizer is provided it’s invoked to produce the cloned values. If customizer returns
  5344. * undefined cloning is handled by the method instead. The customizer is bound to thisArg and invoked with up
  5345. * to three argument; (value [, index|key, object]).
  5346. * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
  5347. * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
  5348. * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
  5349. * @param value The value to clone.
  5350. * @param isDeep Specify a deep clone.
  5351. * @param customizer The function to customize cloning values.
  5352. * @param thisArg The this binding of customizer.
  5353. * @return Returns the cloned value.
  5354. */
  5355. clone<T>(
  5356. value: T,
  5357. isDeep?: boolean,
  5358. customizer?: (value: any) => any,
  5359. thisArg?: any): T;
  5360. /**
  5361. * @see _.clone
  5362. */
  5363. clone<T>(
  5364. value: T,
  5365. customizer?: (value: any) => any,
  5366. thisArg?: any): T;
  5367. }
  5368. interface LoDashWrapper<T> {
  5369. /**
  5370. * @see _.clone
  5371. */
  5372. clone(
  5373. isDeep?: boolean,
  5374. customizer?: (value: any) => any,
  5375. thisArg?: any): T;
  5376. /**
  5377. * @see _.clone
  5378. */
  5379. clone(
  5380. customizer?: (value: any) => any,
  5381. thisArg?: any): T;
  5382. }
  5383. interface LoDashArrayWrapper<T> {
  5384. /**
  5385. * @see _.clone
  5386. */
  5387. clone(
  5388. isDeep?: boolean,
  5389. customizer?: (value: any) => any,
  5390. thisArg?: any): T[];
  5391. /**
  5392. * @see _.clone
  5393. */
  5394. clone(
  5395. customizer?: (value: any) => any,
  5396. thisArg?: any): T[];
  5397. }
  5398. interface LoDashObjectWrapper<T> {
  5399. /**
  5400. * @see _.clone
  5401. */
  5402. clone(
  5403. isDeep?: boolean,
  5404. customizer?: (value: any) => any,
  5405. thisArg?: any): T;
  5406. /**
  5407. * @see _.clone
  5408. */
  5409. clone(
  5410. customizer?: (value: any) => any,
  5411. thisArg?: any): T;
  5412. }
  5413. //_.cloneDeep
  5414. interface LoDashStatic {
  5415. /**
  5416. * Creates a deep clone of value. If customizer is provided it’s invoked to produce the cloned values. If
  5417. * customizer returns undefined cloning is handled by the method instead. The customizer is bound to thisArg
  5418. * and invoked with up to three argument; (value [, index|key, object]).
  5419. * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
  5420. * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
  5421. * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
  5422. * @param value The value to deep clone.
  5423. * @param customizer The function to customize cloning values.
  5424. * @param thisArg The this binding of customizer.
  5425. * @return Returns the deep cloned value.
  5426. */
  5427. cloneDeep<T>(
  5428. value: T,
  5429. customizer?: (value: any) => any,
  5430. thisArg?: any): T;
  5431. }
  5432. interface LoDashWrapper<T> {
  5433. /**
  5434. * @see _.cloneDeep
  5435. */
  5436. cloneDeep(
  5437. customizer?: (value: any) => any,
  5438. thisArg?: any): T;
  5439. }
  5440. interface LoDashArrayWrapper<T> {
  5441. /**
  5442. * @see _.cloneDeep
  5443. */
  5444. cloneDeep(
  5445. customizer?: (value: any) => any,
  5446. thisArg?: any): T[];
  5447. }
  5448. interface LoDashObjectWrapper<T> {
  5449. /**
  5450. * @see _.cloneDeep
  5451. */
  5452. cloneDeep(
  5453. customizer?: (value: any) => any,
  5454. thisArg?: any): T;
  5455. }
  5456. //_.gt
  5457. interface LoDashStatic {
  5458. /**
  5459. * Checks if value is greater than other.
  5460. * @param value The value to compare.
  5461. * @param other The other value to compare.
  5462. * @return Returns true if value is greater than other, else false.
  5463. */
  5464. gt(value: any, other: any): boolean;
  5465. }
  5466. interface LoDashWrapperBase<T,TWrapper> {
  5467. /**
  5468. * @see _.gt
  5469. */
  5470. gt(other: any): boolean;
  5471. }
  5472. //_.gte
  5473. interface LoDashStatic {
  5474. /**
  5475. * Checks if value is greater than or equal to other.
  5476. * @param value The value to compare.
  5477. * @param other The other value to compare.
  5478. * @return Returns true if value is greater than or equal to other, else false.
  5479. */
  5480. gte(value: any, other: any): boolean;
  5481. }
  5482. interface LoDashWrapperBase<T,TWrapper> {
  5483. /**
  5484. * @see _.gte
  5485. */
  5486. gte(other: any): boolean;
  5487. }
  5488. //_.isArguments
  5489. interface LoDashStatic {
  5490. /**
  5491. * Checks if value is classified as an arguments object.
  5492. * @param value The value to check.
  5493. * @return Returns true if value is correctly classified, else false.
  5494. */
  5495. isArguments(value?: any): boolean;
  5496. }
  5497. interface LoDashWrapperBase<T, TWrapper> {
  5498. /**
  5499. * @see _.isArguments
  5500. */
  5501. isArguments(): boolean;
  5502. }
  5503. //_.isArray
  5504. interface LoDashStatic {
  5505. /**
  5506. * Checks if value is classified as an Array object.
  5507. * @param value The value to check.
  5508. * @return Returns true if value is correctly classified, else false.
  5509. **/
  5510. isArray(value?: any): boolean;
  5511. }
  5512. interface LoDashWrapperBase<T,TWrapper> {
  5513. /**
  5514. * @see _.isArray
  5515. */
  5516. isArray(): boolean;
  5517. }
  5518. //_.isBoolean
  5519. interface LoDashStatic {
  5520. /**
  5521. * Checks if value is classified as a boolean primitive or object.
  5522. * @param value The value to check.
  5523. * @return Returns true if value is correctly classified, else false.
  5524. **/
  5525. isBoolean(value?: any): boolean;
  5526. }
  5527. interface LoDashWrapperBase<T, TWrapper> {
  5528. /**
  5529. * @see _.isBoolean
  5530. */
  5531. isBoolean(): boolean;
  5532. }
  5533. //_.isDate
  5534. interface LoDashStatic {
  5535. /**
  5536. * Checks if value is classified as a Date object.
  5537. * @param value The value to check.
  5538. * @return Returns true if value is correctly classified, else false.
  5539. **/
  5540. isDate(value?: any): boolean;
  5541. }
  5542. interface LoDashWrapperBase<T, TWrapper> {
  5543. /**
  5544. * @see _.isDate
  5545. */
  5546. isDate(): boolean;
  5547. }
  5548. //_.isElement
  5549. interface LoDashStatic {
  5550. /**
  5551. * Checks if value is a DOM element.
  5552. * @param value The value to check.
  5553. * @return Returns true if value is a DOM element, else false.
  5554. */
  5555. isElement(value?: any): boolean;
  5556. }
  5557. interface LoDashWrapperBase<T, TWrapper> {
  5558. /**
  5559. * @see _.isElement
  5560. */
  5561. isElement(): boolean;
  5562. }
  5563. //_.isEmpty
  5564. interface LoDashStatic {
  5565. /**
  5566. * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
  5567. * jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
  5568. * @param value The value to inspect.
  5569. * @return Returns true if value is empty, else false.
  5570. **/
  5571. isEmpty(value?: any[]|Dictionary<any>|string|any): boolean;
  5572. }
  5573. interface LoDashWrapperBase<T,TWrapper> {
  5574. /**
  5575. * @see _.isEmpty
  5576. */
  5577. isEmpty(): boolean;
  5578. }
  5579. //_.isError
  5580. interface LoDashStatic {
  5581. /**
  5582. * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
  5583. * object.
  5584. * @param value The value to check.
  5585. * @return Returns true if value is an error object, else false.
  5586. */
  5587. isError(value: any): boolean;
  5588. }
  5589. interface LoDashWrapperBase<T, TWrapper> {
  5590. /**
  5591. * @see _.isError
  5592. */
  5593. isError(): boolean;
  5594. }
  5595. //_.isFinite
  5596. interface LoDashStatic {
  5597. /**
  5598. * Checks if value is a finite primitive number.
  5599. * Note: This method is based on Number.isFinite.
  5600. * @param value The value to check.
  5601. * @return Returns true if value is a finite number, else false.
  5602. **/
  5603. isFinite(value?: any): boolean;
  5604. }
  5605. interface LoDashWrapperBase<T, TWrapper> {
  5606. /**
  5607. * @see _.isFinite
  5608. */
  5609. isFinite(): boolean;
  5610. }
  5611. //_.isFunction
  5612. interface LoDashStatic {
  5613. /**
  5614. * Checks if value is classified as a Function object.
  5615. * @param value The value to check.
  5616. * @return Returns true if value is correctly classified, else false.
  5617. **/
  5618. isFunction(value?: any): boolean;
  5619. }
  5620. interface LoDashWrapperBase<T, TWrapper> {
  5621. /**
  5622. * @see _.isFunction
  5623. */
  5624. isFunction(): boolean;
  5625. }
  5626. //_.isMatch
  5627. interface isMatchCustomizer {
  5628. (value: any, other: any, indexOrKey?: number|string): boolean;
  5629. }
  5630. interface LoDashStatic {
  5631. /**
  5632. * Performs a deep comparison between object and source to determine if object contains equivalent property
  5633. * values. If customizer is provided it’s invoked to compare values. If customizer returns undefined
  5634. * comparisons are handled by the method instead. The customizer is bound to thisArg and invoked with three
  5635. * arguments: (value, other, index|key).
  5636. * @param object The object to inspect.
  5637. * @param source The object of property values to match.
  5638. * @param customizer The function to customize value comparisons.
  5639. * @param thisArg The this binding of customizer.
  5640. * @return Returns true if object is a match, else false.
  5641. */
  5642. isMatch(object: Object, source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
  5643. }
  5644. interface LoDashObjectWrapper<T> {
  5645. /**
  5646. * @see _.isMatch
  5647. */
  5648. isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
  5649. }
  5650. //_.isNaN
  5651. interface LoDashStatic {
  5652. /**
  5653. * Checks if value is NaN.
  5654. * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
  5655. * @param value The value to check.
  5656. * @return Returns true if value is NaN, else false.
  5657. */
  5658. isNaN(value?: any): boolean;
  5659. }
  5660. interface LoDashWrapperBase<T, TWrapper> {
  5661. /**
  5662. * @see _.isNaN
  5663. */
  5664. isNaN(): boolean;
  5665. }
  5666. //_.isNative
  5667. interface LoDashStatic {
  5668. /**
  5669. * Checks if value is a native function.
  5670. * @param value The value to check.
  5671. * @retrun Returns true if value is a native function, else false.
  5672. */
  5673. isNative(value: any): boolean;
  5674. }
  5675. interface LoDashWrapperBase<T, TWrapper> {
  5676. /**
  5677. * see _.isNative
  5678. */
  5679. isNative(): boolean;
  5680. }
  5681. //_.isNull
  5682. interface LoDashStatic {
  5683. /**
  5684. * Checks if value is null.
  5685. * @param value The value to check.
  5686. * @return Returns true if value is null, else false.
  5687. **/
  5688. isNull(value?: any): boolean;
  5689. }
  5690. interface LoDashWrapperBase<T, TWrapper> {
  5691. /**
  5692. * see _.isNull
  5693. */
  5694. isNull(): boolean;
  5695. }
  5696. //_.isNumber
  5697. interface LoDashStatic {
  5698. /**
  5699. * Checks if value is classified as a Number primitive or object.
  5700. * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
  5701. * @param value The value to check.
  5702. * @return Returns true if value is correctly classified, else false.
  5703. */
  5704. isNumber(value?: any): boolean;
  5705. }
  5706. interface LoDashWrapperBase<T, TWrapper> {
  5707. /**
  5708. * see _.isNumber
  5709. */
  5710. isNumber(): boolean;
  5711. }
  5712. //_.isObject
  5713. interface LoDashStatic {
  5714. /**
  5715. * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
  5716. * and new String(''))
  5717. * @param value The value to check.
  5718. * @return Returns true if value is an object, else false.
  5719. **/
  5720. isObject(value?: any): boolean;
  5721. }
  5722. interface LoDashWrapperBase<T, TWrapper> {
  5723. /**
  5724. * see _.isObject
  5725. */
  5726. isObject(): boolean;
  5727. }
  5728. //_.isPlainObject
  5729. interface LoDashStatic {
  5730. /**
  5731. * Checks if value is a plain object, that is, an object created by the Object constructor or one with a
  5732. * [[Prototype]] of null.
  5733. *
  5734. * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
  5735. *
  5736. * @param value The value to check.
  5737. * @return Returns true if value is a plain object, else false.
  5738. */
  5739. isPlainObject(value?: any): boolean;
  5740. }
  5741. interface LoDashWrapperBase<T, TWrapper> {
  5742. /**
  5743. * see _.isPlainObject
  5744. */
  5745. isPlainObject(): boolean;
  5746. }
  5747. //_.isRegExp
  5748. interface LoDashStatic {
  5749. /**
  5750. * Checks if value is classified as a RegExp object.
  5751. * @param value The value to check.
  5752. * @return Returns true if value is correctly classified, else false.
  5753. */
  5754. isRegExp(value?: any): boolean;
  5755. }
  5756. interface LoDashWrapperBase<T, TWrapper> {
  5757. /**
  5758. * see _.isRegExp
  5759. */
  5760. isRegExp(): boolean;
  5761. }
  5762. //_.isString
  5763. interface LoDashStatic {
  5764. /**
  5765. * Checks if value is classified as a String primitive or object.
  5766. * @param value The value to check.
  5767. * @return Returns true if value is correctly classified, else false.
  5768. **/
  5769. isString(value?: any): boolean;
  5770. }
  5771. interface LoDashWrapperBase<T, TWrapper> {
  5772. /**
  5773. * see _.isString
  5774. */
  5775. isString(): boolean;
  5776. }
  5777. //_.isTypedArray
  5778. interface LoDashStatic {
  5779. /**
  5780. * Checks if value is classified as a typed array.
  5781. * @param value The value to check.
  5782. * @return Returns true if value is correctly classified, else false.
  5783. */
  5784. isTypedArray(value: any): boolean;
  5785. }
  5786. interface LoDashWrapperBase<T, TWrapper> {
  5787. /**
  5788. * see _.isTypedArray
  5789. */
  5790. isTypedArray(): boolean;
  5791. }
  5792. //_.isUndefined
  5793. interface LoDashStatic {
  5794. /**
  5795. * Checks if value is undefined.
  5796. * @param value The value to check.
  5797. * @return Returns true if value is undefined, else false.
  5798. **/
  5799. isUndefined(value: any): boolean;
  5800. }
  5801. interface LoDashWrapperBase<T, TWrapper> {
  5802. /**
  5803. * see _.isUndefined
  5804. */
  5805. isUndefined(): boolean;
  5806. }
  5807. //_.lt
  5808. interface LoDashStatic {
  5809. /**
  5810. * Checks if value is less than other.
  5811. * @param value The value to compare.
  5812. * @param other The other value to compare.
  5813. * @return Returns true if value is less than other, else false.
  5814. */
  5815. lt(value: any, other: any): boolean;
  5816. }
  5817. interface LoDashWrapperBase<T,TWrapper> {
  5818. /**
  5819. * @see _.lt
  5820. */
  5821. lt(other: any): boolean;
  5822. }
  5823. //_.lte
  5824. interface LoDashStatic {
  5825. /**
  5826. * Checks if value is less than or equal to other.
  5827. * @param value The value to compare.
  5828. * @param other The other value to compare.
  5829. * @return Returns true if value is less than or equal to other, else false.
  5830. */
  5831. lte(value: any, other: any): boolean;
  5832. }
  5833. interface LoDashWrapperBase<T,TWrapper> {
  5834. /**
  5835. * @see _.lte
  5836. */
  5837. lte(other: any): boolean;
  5838. }
  5839. //_.toPlainObject
  5840. interface LoDashStatic {
  5841. /**
  5842. * Converts value to a plain object flattening inherited enumerable properties of value to own properties
  5843. * of the plain object.
  5844. * @param value The value to convert.
  5845. * @return Returns the converted plain object.
  5846. */
  5847. toPlainObject(value?: any): Object;
  5848. }
  5849. /********
  5850. * Math *
  5851. ********/
  5852. //_.add
  5853. interface LoDashStatic {
  5854. /**
  5855. * Adds two numbers.
  5856. * @param augend The first number to add.
  5857. * @param addend The second number to add.
  5858. * @return Returns the sum.
  5859. */
  5860. add(augend: number, addend: number): number;
  5861. }
  5862. interface LoDashWrapper<T> {
  5863. /**
  5864. * @see _.add
  5865. */
  5866. add(addend: number): number;
  5867. }
  5868. /**********
  5869. * Number *
  5870. **********/
  5871. //_.inRange
  5872. interface LoDashStatic {
  5873. /**
  5874. * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start
  5875. * with start then set to 0.
  5876. * @param n The number to check.
  5877. * @param start The start of the range.
  5878. * @param end The end of the range.
  5879. * @return Returns true if n is in the range, else false.
  5880. */
  5881. inRange(n: number, start: number, end: number): boolean;
  5882. /**
  5883. * @see _.inRange
  5884. */
  5885. inRange(n: number, end: number): boolean;
  5886. }
  5887. interface LoDashWrapper<T> {
  5888. /**
  5889. * @see _.inRange
  5890. */
  5891. inRange(start: number, end: number): boolean;
  5892. /**
  5893. * @see _.inRange
  5894. */
  5895. inRange(end: number): boolean;
  5896. }
  5897. /**********
  5898. * Object *
  5899. **********/
  5900. //_.assign
  5901. interface LoDashStatic {
  5902. /**
  5903. * Assigns own enumerable properties of source object(s) to the destination object. Subsequent
  5904. * sources will overwrite property assignments of previous sources. If a callback is provided
  5905. * it will be executed to produce the assigned values. The callback is bound to thisArg and
  5906. * invoked with two arguments; (objectValue, sourceValue).
  5907. * @param object The destination object.
  5908. * @param s1-8 The source object(s)
  5909. * @param callback The function to customize merging properties.
  5910. * @param thisArg The this binding of callback.
  5911. * @return The destination object.
  5912. **/
  5913. assign<P, T, S1, Value, Result>(
  5914. object: T,
  5915. s1: S1,
  5916. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5917. thisArg?: any): Result;
  5918. /**
  5919. * @see _.assign
  5920. **/
  5921. assign<P, T, S1, S2, Value, Result>(
  5922. object: T,
  5923. s1: S1,
  5924. s2: S2,
  5925. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5926. thisArg?: any): Result;
  5927. /**
  5928. * @see _.assign
  5929. **/
  5930. assign<P, T, S1, S2, S3, Value, Result>(
  5931. object: T,
  5932. s1: S1,
  5933. s2: S2,
  5934. s3: S3,
  5935. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5936. thisArg?: any): Result;
  5937. /**
  5938. * @see _.assign
  5939. **/
  5940. assign<P, T, S1, S2, S3, S4, Value, Result>(
  5941. object: T,
  5942. s1: S1,
  5943. s2: S2,
  5944. s3: S3,
  5945. s4: S4,
  5946. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5947. thisArg?: any): Result;
  5948. /**
  5949. * @see _.assign
  5950. **/
  5951. extend<P, T, S1, Value, Result>(
  5952. object: T,
  5953. s1: S1,
  5954. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5955. thisArg?: any): Result;
  5956. /**
  5957. * @see _.assign
  5958. **/
  5959. extend<P, T, S1, S2, Value, Result>(
  5960. object: T,
  5961. s1: S1,
  5962. s2: S2,
  5963. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5964. thisArg?: any): Result;
  5965. /**
  5966. * @see _.assign
  5967. **/
  5968. extend<P, T, S1, S2, S3, Value, Result>(
  5969. object: T,
  5970. s1: S1,
  5971. s2: S2,
  5972. s3: S3,
  5973. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5974. thisArg?: any): Result;
  5975. /**
  5976. * @see _.assign
  5977. **/
  5978. extend<P, T, S1, S2, S3, S4, Value, Result>(
  5979. object: T,
  5980. s1: S1,
  5981. s2: S2,
  5982. s3: S3,
  5983. s4: S4,
  5984. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5985. thisArg?: any): Result;
  5986. }
  5987. interface LoDashObjectWrapper<T> {
  5988. /**
  5989. * @see _.assign
  5990. **/
  5991. assign<S1, Value, TResult>(
  5992. s1: S1,
  5993. callback?: (objectValue: Value, sourceValue: Value) => Value,
  5994. thisArg?: any): TResult;
  5995. /**
  5996. * @see _.assign
  5997. **/
  5998. assign<S1, S2, Value, TResult>(
  5999. s1: S1,
  6000. s2: S2,
  6001. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6002. thisArg?: any): TResult;
  6003. /**
  6004. * @see _.assign
  6005. **/
  6006. assign<S1, S2, S3, Value, TResult>(
  6007. s1: S1,
  6008. s2: S2,
  6009. s3: S3,
  6010. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6011. thisArg?: any): TResult;
  6012. /**
  6013. * @see _.assign
  6014. **/
  6015. assign<S1, S2, S3, S4, Value, TResult>(
  6016. s1: S1,
  6017. s2: S2,
  6018. s3: S3,
  6019. s4: S4,
  6020. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6021. thisArg?: any): TResult;
  6022. /**
  6023. * @see _.assign
  6024. **/
  6025. assign<S1, S2, S3, S4, S5, Value, TResult>(
  6026. s1: S1,
  6027. s2: S2,
  6028. s3: S3,
  6029. s4: S4,
  6030. s5: S5,
  6031. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6032. thisArg?: any): TResult;
  6033. /**
  6034. * @see _.assign
  6035. **/
  6036. extend<S1, Value, TResult>(
  6037. s1: S1,
  6038. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6039. thisArg?: any): TResult;
  6040. /**
  6041. * @see _.assign
  6042. **/
  6043. extend<S1, S2, Value, TResult>(
  6044. s1: S1,
  6045. s2: S2,
  6046. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6047. thisArg?: any): TResult;
  6048. /**
  6049. * @see _.assign
  6050. **/
  6051. extend<S1, S2, S3, Value, TResult>(
  6052. s1: S1,
  6053. s2: S2,
  6054. s3: S3,
  6055. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6056. thisArg?: any): TResult;
  6057. /**
  6058. * @see _.assign
  6059. **/
  6060. extend<S1, S2, S3, S4, Value, TResult>(
  6061. s1: S1,
  6062. s2: S2,
  6063. s3: S3,
  6064. s4: S4,
  6065. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6066. thisArg?: any): TResult;
  6067. /**
  6068. * @see _.assign
  6069. **/
  6070. extend<S1, S2, S3, S4, S5, Value, TResult>(
  6071. s1: S1,
  6072. s2: S2,
  6073. s3: S3,
  6074. s4: S4,
  6075. s5: S5,
  6076. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6077. thisArg?: any): TResult;
  6078. }
  6079. //_.create
  6080. interface LoDashStatic {
  6081. /**
  6082. * Creates an object that inherits from the given prototype object. If a properties object is provided its own
  6083. * enumerable properties are assigned to the created object.
  6084. * @param prototype The object to inherit from.
  6085. * @param properties The properties to assign to the object.
  6086. * @return Returns the new object.
  6087. */
  6088. create<TResult extends {}>(prototype: Object, properties?: Object): TResult;
  6089. }
  6090. interface LoDashObjectWrapper<T> {
  6091. /**
  6092. * @see _.create
  6093. */
  6094. create<TResult extends {}>(properties?: Object): LoDashObjectWrapper<TResult>;
  6095. }
  6096. //_.defaults
  6097. interface LoDashStatic {
  6098. /**
  6099. * Assigns own enumerable properties of source object(s) to the destination object for all
  6100. * destination properties that resolve to undefined. Once a property is set, additional defaults
  6101. * of the same property will be ignored.
  6102. * @param object The destination object.
  6103. * @param sources The source objects.
  6104. * @return The destination object.
  6105. **/
  6106. defaults<T, TResult>(
  6107. object: T,
  6108. ...sources: any[]): TResult;
  6109. }
  6110. interface LoDashObjectWrapper<T> {
  6111. /**
  6112. * @see _.defaults
  6113. **/
  6114. defaults<T, TResult>(...sources: any[]): LoDashObjectWrapper<TResult>
  6115. }
  6116. //_.defaultsDeep
  6117. interface LoDashStatic {
  6118. /**
  6119. * This method is like _.defaults except that it recursively assigns default properties.
  6120. * @param object The destination object.
  6121. * @param sources The source objects.
  6122. * @return Returns object.
  6123. **/
  6124. defaultsDeep<T, TResult>(
  6125. object: T,
  6126. ...sources: any[]): TResult;
  6127. }
  6128. interface LoDashObjectWrapper<T> {
  6129. /**
  6130. * @see _.defaultsDeep
  6131. **/
  6132. defaultsDeep<TResult>(...sources: any[]): LoDashObjectWrapper<TResult>
  6133. }
  6134. //_.findKey
  6135. interface LoDashStatic {
  6136. /**
  6137. * This method is like _.findIndex except that it returns the key of the first element that
  6138. * passes the callback check, instead of the element itself.
  6139. * @param object The object to search.
  6140. * @param callback The function called per iteration.
  6141. * @param thisArg The this binding of callback.
  6142. * @return The key of the found element, else undefined.
  6143. **/
  6144. findKey(
  6145. object: any,
  6146. callback: (value: any) => boolean,
  6147. thisArg?: any): string;
  6148. /**
  6149. * @see _.findKey
  6150. * @param pluckValue _.pluck style callback
  6151. **/
  6152. findKey(
  6153. object: any,
  6154. pluckValue: string): string;
  6155. /**
  6156. * @see _.findKey
  6157. * @param whereValue _.where style callback
  6158. **/
  6159. findKey<W extends Dictionary<any>, T>(
  6160. object: T,
  6161. whereValue: W): string;
  6162. }
  6163. //_.findLastKey
  6164. interface LoDashStatic {
  6165. /**
  6166. * This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
  6167. * @param object The object to search.
  6168. * @param callback The function called per iteration.
  6169. * @param thisArg The this binding of callback.
  6170. * @return The key of the found element, else undefined.
  6171. **/
  6172. findLastKey(
  6173. object: any,
  6174. callback: (value: any) => boolean,
  6175. thisArg?: any): string;
  6176. /**
  6177. * @see _.findLastKey
  6178. * @param pluckValue _.pluck style callback
  6179. **/
  6180. findLastKey(
  6181. object: any,
  6182. pluckValue: string): string;
  6183. /**
  6184. * @see _.findLastKey
  6185. * @param whereValue _.where style callback
  6186. **/
  6187. findLastKey<W extends Dictionary<any>, T>(
  6188. object: T,
  6189. whereValue: W): string;
  6190. }
  6191. //_.forIn
  6192. interface LoDashStatic {
  6193. /**
  6194. * Iterates over own and inherited enumerable properties of an object, executing the callback for
  6195. * each property. The callback is bound to thisArg and invoked with three arguments; (value, key,
  6196. * object). Callbacks may exit iteration early by explicitly returning false.
  6197. * @param object The object to iterate over.
  6198. * @param callback The function called per iteration.
  6199. * @param thisArg The this binding of callback.
  6200. * @return object
  6201. **/
  6202. forIn<T>(
  6203. object: Dictionary<T>,
  6204. callback?: DictionaryIterator<T, void>,
  6205. thisArg?: any): Dictionary<T>;
  6206. /**
  6207. * @see _.forIn
  6208. **/
  6209. forIn<T>(
  6210. object: T,
  6211. callback?: ObjectIterator<any, void>,
  6212. thisArg?: any): T;
  6213. }
  6214. interface LoDashObjectWrapper<T> {
  6215. /**
  6216. * @see _.forIn
  6217. **/
  6218. forIn<T extends {}>(
  6219. callback: ObjectIterator<T, void>,
  6220. thisArg?: any): _.LoDashObjectWrapper<T>;
  6221. }
  6222. //_.forInRight
  6223. interface LoDashStatic {
  6224. /**
  6225. * This method is like _.forIn except that it iterates over elements of a collection in the
  6226. * opposite order.
  6227. * @param object The object to iterate over.
  6228. * @param callback The function called per iteration.
  6229. * @param thisArg The this binding of callback.
  6230. * @return object
  6231. **/
  6232. forInRight<T extends {}>(
  6233. object: Dictionary<T>,
  6234. callback?: DictionaryIterator<T, void>,
  6235. thisArg?: any): Dictionary<T>;
  6236. /**
  6237. * @see _.forInRight
  6238. **/
  6239. forInRight<T extends {}>(
  6240. object: T,
  6241. callback?: ObjectIterator<T, void>,
  6242. thisArg?: any): T;
  6243. }
  6244. interface LoDashObjectWrapper<T> {
  6245. /**
  6246. * @see _.forInRight
  6247. **/
  6248. forInRight<T extends {}>(
  6249. callback: ObjectIterator<T, void>,
  6250. thisArg?: any): _.LoDashObjectWrapper<T>;
  6251. }
  6252. //_.forOwn
  6253. interface LoDashStatic {
  6254. /**
  6255. * Iterates over own enumerable properties of an object, executing the callback for each
  6256. * property. The callback is bound to thisArg and invoked with three arguments; (value, key,
  6257. * object). Callbacks may exit iteration early by explicitly returning false.
  6258. * @param object The object to iterate over.
  6259. * @param callback The function called per iteration.
  6260. * @param thisArg The this binding of callback.
  6261. * @return object
  6262. **/
  6263. forOwn<T extends {}>(
  6264. object: Dictionary<T>,
  6265. callback?: DictionaryIterator<T, void>,
  6266. thisArg?: any): Dictionary<T>;
  6267. /**
  6268. * @see _.forOwn
  6269. **/
  6270. forOwn<T extends {}>(
  6271. object: T,
  6272. callback?: ObjectIterator<any, void>,
  6273. thisArg?: any): T;
  6274. }
  6275. interface LoDashObjectWrapper<T> {
  6276. /**
  6277. * @see _.forOwn
  6278. **/
  6279. forOwn<T extends {}>(
  6280. callback: ObjectIterator<T, void>,
  6281. thisArg?: any): _.LoDashObjectWrapper<T>;
  6282. }
  6283. //_.forOwnRight
  6284. interface LoDashStatic {
  6285. /**
  6286. * This method is like _.forOwn except that it iterates over elements of a collection in the
  6287. * opposite order.
  6288. * @param object The object to iterate over.
  6289. * @param callback The function called per iteration.
  6290. * @param thisArg The this binding of callback.
  6291. * @return object
  6292. **/
  6293. forOwnRight<T extends {}>(
  6294. object: Dictionary<T>,
  6295. callback?: DictionaryIterator<T, void>,
  6296. thisArg?: any): Dictionary<T>;
  6297. /**
  6298. * @see _.forOwnRight
  6299. **/
  6300. forOwnRight<T extends {}>(
  6301. object: T,
  6302. callback?: ObjectIterator<any, void>,
  6303. thisArg?: any): T;
  6304. }
  6305. interface LoDashObjectWrapper<T> {
  6306. /**
  6307. * @see _.forOwnRight
  6308. **/
  6309. forOwnRight<T extends {}>(
  6310. callback: ObjectIterator<T, void>,
  6311. thisArg?: any): _.LoDashObjectWrapper<T>;
  6312. }
  6313. //_.functions
  6314. interface LoDashStatic {
  6315. /**
  6316. * Creates a sorted array of property names of all enumerable properties, own and inherited, of
  6317. * object that have function values.
  6318. * @param object The object to inspect.
  6319. * @return An array of property names that have function values.
  6320. **/
  6321. functions(object: any): string[];
  6322. /**
  6323. * @see _functions
  6324. **/
  6325. methods(object: any): string[];
  6326. }
  6327. interface LoDashObjectWrapper<T> {
  6328. /**
  6329. * @see _.functions
  6330. **/
  6331. functions(): _.LoDashArrayWrapper<string>;
  6332. /**
  6333. * @see _.functions
  6334. **/
  6335. methods(): _.LoDashArrayWrapper<string>;
  6336. }
  6337. //_.get
  6338. interface LoDashStatic {
  6339. /**
  6340. * Gets the property value at path of object. If the resolved
  6341. * value is undefined the defaultValue is used in its place.
  6342. * @param object The object to query.
  6343. * @param path The path of the property to get.
  6344. * @param defaultValue The value returned if the resolved value is undefined.
  6345. * @return Returns the resolved value.
  6346. **/
  6347. get<TResult>(object: Object,
  6348. path: string|number|boolean|Array<string|number|boolean>,
  6349. defaultValue?:TResult
  6350. ): TResult;
  6351. }
  6352. interface LoDashObjectWrapper<T> {
  6353. /**
  6354. * @see _.get
  6355. **/
  6356. get<TResult>(path: string|number|boolean|Array<string|number|boolean>,
  6357. defaultValue?: TResult
  6358. ): TResult;
  6359. }
  6360. //_.has
  6361. interface LoDashStatic {
  6362. /**
  6363. * Checks if path is a direct property.
  6364. *
  6365. * @param object The object to query.
  6366. * @param path The path to check.
  6367. * @return Returns true if path is a direct property, else false.
  6368. */
  6369. has(object: any, path: string|number|boolean|Array<string|number|boolean>): boolean;
  6370. }
  6371. interface LoDashObjectWrapper<T> {
  6372. /**
  6373. * @see _.has
  6374. */
  6375. has(path: string|number|boolean|Array<string|number|boolean>): boolean;
  6376. }
  6377. //_.invert
  6378. interface LoDashStatic {
  6379. /**
  6380. * Creates an object composed of the inverted keys and values of the given object.
  6381. * @param object The object to invert.
  6382. * @return The created inverted object.
  6383. **/
  6384. invert(object: any): any;
  6385. }
  6386. //_.isEqual
  6387. interface EqCustomizer {
  6388. (value: any, other: any, indexOrKey?: number|string): boolean;
  6389. }
  6390. interface LoDashStatic {
  6391. /**
  6392. * Performs a deep comparison between two values to determine if they are equivalent. If customizer is
  6393. * provided it is invoked to compare values. If customizer returns undefined comparisons are handled
  6394. * by the method instead. The customizer is bound to thisArg and invoked with three
  6395. * arguments: (value, other [, index|key]).
  6396. * @param value The value to compare.
  6397. * @param other The other value to compare.
  6398. * @param callback The function to customize value comparisons.
  6399. * @param thisArg The this binding of customizer.
  6400. * @return True if the values are equivalent, else false.
  6401. */
  6402. isEqual(value?: any,
  6403. other?: any,
  6404. callback?: EqCustomizer,
  6405. thisArg?: any): boolean;
  6406. /**
  6407. * @see _.isEqual
  6408. */
  6409. eq(value?: any,
  6410. other?: any,
  6411. callback?: EqCustomizer,
  6412. thisArg?: any): boolean;
  6413. }
  6414. interface LoDashWrapper<T> {
  6415. /**
  6416. * @see _.isEqual
  6417. */
  6418. isEqual(other?: any,
  6419. callback?: EqCustomizer,
  6420. thisArg?: any): boolean;
  6421. /**
  6422. * @see _.isEqual
  6423. */
  6424. eq(other?: any,
  6425. callback?: EqCustomizer,
  6426. thisArg?: any): boolean;
  6427. }
  6428. interface LoDashArrayWrapper<T> {
  6429. /**
  6430. * @see _.isEqual
  6431. */
  6432. isEqual(other?: any,
  6433. callback?: EqCustomizer,
  6434. thisArg?: any): boolean;
  6435. /**
  6436. * @see _.isEqual
  6437. */
  6438. eq(other?: any,
  6439. callback?: EqCustomizer,
  6440. thisArg?: any): boolean;
  6441. }
  6442. interface LoDashObjectWrapper<T> {
  6443. /**
  6444. * @see _.isEqual
  6445. */
  6446. isEqual(other?: any,
  6447. callback?: EqCustomizer,
  6448. thisArg?: any): boolean;
  6449. /**
  6450. * @see _.isEqual
  6451. */
  6452. eq(other?: any,
  6453. callback?: EqCustomizer,
  6454. thisArg?: any): boolean;
  6455. }
  6456. //_.keys
  6457. interface LoDashStatic {
  6458. /**
  6459. * Creates an array composed of the own enumerable property names of an object.
  6460. * @param object The object to inspect.
  6461. * @return An array of property names.
  6462. **/
  6463. keys(object?: any): string[];
  6464. }
  6465. interface LoDashObjectWrapper<T> {
  6466. /**
  6467. * @see _.keys
  6468. **/
  6469. keys(): LoDashArrayWrapper<string>
  6470. }
  6471. //_.keysIn
  6472. interface LoDashStatic {
  6473. /**
  6474. * Creates an array of the own and inherited enumerable property names of object.
  6475. * @param object The object to query.
  6476. * @return An array of property names.
  6477. **/
  6478. keysIn(object?: any): string[];
  6479. }
  6480. interface LoDashObjectWrapper<T> {
  6481. /**
  6482. * @see _.keysIn
  6483. **/
  6484. keysIn(): LoDashArrayWrapper<string>
  6485. }
  6486. //_.mapValues
  6487. interface LoDashStatic {
  6488. /**
  6489. * Creates an object with the same keys as object and values generated by running each own
  6490. * enumerable property of object through iteratee. The iteratee function is bound to thisArg
  6491. * and invoked with three arguments: (value, key, object).
  6492. *
  6493. * If a property name is provided iteratee the created "_.property" style callback returns
  6494. * the property value of the given element.
  6495. *
  6496. * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns
  6497. * true for elements that have a matching property value, else false;.
  6498. *
  6499. * If an object is provided for iteratee the created "_.matches" style callback returns true
  6500. * for elements that have the properties of the given object, else false.
  6501. *
  6502. * @param {Object} object The object to iterate over.
  6503. * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
  6504. * @param {Object} [thisArg] The `this` binding of `iteratee`.
  6505. * @return {Object} Returns the new mapped object.
  6506. */
  6507. mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>;
  6508. mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>;
  6509. mapValues<T, TMapped>(obj: T, pluck: string): TMapped;
  6510. mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T;
  6511. }
  6512. interface LoDashObjectWrapper<T> {
  6513. /**
  6514. * @see _.mapValues
  6515. * TValue is the type of the property values of T.
  6516. * TResult is the type output by the ObjectIterator function
  6517. */
  6518. mapValues<TValue, TResult>(callback: ObjectIterator<TValue, TResult>, thisArg?: any): LoDashObjectWrapper<Dictionary<TResult>>;
  6519. /**
  6520. * @see _.mapValues
  6521. * TResult is the type of the property specified by pluck.
  6522. * T should be a Dictionary<Dictionary<TResult>>
  6523. */
  6524. mapValues<TResult>(pluck: string): LoDashObjectWrapper<Dictionary<TResult>>;
  6525. /**
  6526. * @see _.mapValues
  6527. * TResult is the type of the properties on the object specified by pluck.
  6528. * T should be a Dictionary<Dictionary<Dictionary<TResult>>>
  6529. */
  6530. mapValues<TResult>(pluck: string, where: Dictionary<TResult>): LoDashArrayWrapper<Dictionary<boolean>>;
  6531. /**
  6532. * @see _.mapValues
  6533. * TResult is the type of the properties of each object in the values of T
  6534. * T should be a Dictionary<Dictionary<TResult>>
  6535. */
  6536. mapValues<TResult>(where: Dictionary<TResult>): LoDashArrayWrapper<boolean>;
  6537. }
  6538. //_.merge
  6539. interface LoDashStatic {
  6540. /**
  6541. * Recursively merges own enumerable properties of the source object(s), that don't resolve
  6542. * to undefined into the destination object. Subsequent sources will overwrite property
  6543. * assignments of previous sources. If a callback is provided it will be executed to produce
  6544. * the merged values of the destination and source properties. If the callback returns undefined
  6545. * merging will be handled by the method instead. The callback is bound to thisArg and invoked
  6546. * with two arguments; (objectValue, sourceValue).
  6547. * @param object The destination object.
  6548. * @param s1-8 The source object(s)
  6549. * @param callback The function to customize merging properties.
  6550. * @param thisArg The this binding of callback.
  6551. * @return The destination object.
  6552. **/
  6553. merge<P, T, S1, Value, Result>(
  6554. object: T,
  6555. s1: S1,
  6556. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6557. thisArg?: any): Result;
  6558. /**
  6559. * @see _.merge
  6560. **/
  6561. merge<P, T, S1, S2, Value, Result>(
  6562. object: T,
  6563. s1: S1,
  6564. s2: S2,
  6565. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6566. thisArg?: any): Result;
  6567. /**
  6568. * @see _.merge
  6569. **/
  6570. merge<P, T, S1, S2, S3, Value, Result>(
  6571. object: T,
  6572. s1: S1,
  6573. s2: S2,
  6574. s3: S3,
  6575. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6576. thisArg?: any): Result;
  6577. /**
  6578. * @see _.merge
  6579. **/
  6580. merge<P, T, S1, S2, S3, S4, Value, Result>(
  6581. object: T,
  6582. s1: S1,
  6583. s2: S2,
  6584. s3: S3,
  6585. s4: S4,
  6586. callback?: (objectValue: Value, sourceValue: Value) => Value,
  6587. thisArg?: any): Result;
  6588. }
  6589. //_.omit
  6590. interface LoDashStatic {
  6591. /**
  6592. * Creates a shallow clone of object excluding the specified properties. Property names may be
  6593. * specified as individual arguments or as arrays of property names. If a callback is provided
  6594. * it will be executed for each property of object omitting the properties the callback returns
  6595. * truey for. The callback is bound to thisArg and invoked with three arguments; (value, key,
  6596. * object).
  6597. * @param object The source object.
  6598. * @param keys The properties to omit.
  6599. * @return An object without the omitted properties.
  6600. **/
  6601. omit<Omitted, T>(
  6602. object: T,
  6603. ...keys: string[]): Omitted;
  6604. /**
  6605. * @see _.omit
  6606. **/
  6607. omit<Omitted, T>(
  6608. object: T,
  6609. keys: string[]): Omitted;
  6610. /**
  6611. * @see _.omit
  6612. **/
  6613. omit<Omitted, T>(
  6614. object: T,
  6615. callback: ObjectIterator<any, boolean>,
  6616. thisArg?: any): Omitted;
  6617. }
  6618. interface LoDashObjectWrapper<T> {
  6619. /**
  6620. * @see _.omit
  6621. **/
  6622. omit<Omitted>(
  6623. ...keys: string[]): LoDashObjectWrapper<Omitted>;
  6624. /**
  6625. * @see _.omit
  6626. **/
  6627. omit<Omitted>(
  6628. keys: string[]): LoDashObjectWrapper<Omitted>;
  6629. /**
  6630. * @see _.omit
  6631. **/
  6632. omit<Omitted>(
  6633. callback: ObjectIterator<any, boolean>,
  6634. thisArg?: any): LoDashObjectWrapper<Omitted>;
  6635. }
  6636. //_.pairs
  6637. interface LoDashStatic {
  6638. /**
  6639. * Creates a two dimensional array of an object's key-value pairs,
  6640. * i.e. [[key1, value1], [key2, value2]].
  6641. * @param object The object to inspect.
  6642. * @return Aew array of key-value pairs.
  6643. **/
  6644. pairs(object?: any): any[][];
  6645. }
  6646. interface LoDashObjectWrapper<T> {
  6647. /**
  6648. * @see _.pairs
  6649. **/
  6650. pairs(): LoDashArrayWrapper<any[]>;
  6651. }
  6652. //_.pick
  6653. interface LoDashStatic {
  6654. /**
  6655. * Creates an object composed of the picked object properties. Property names may be specified as individual
  6656. * arguments or as arrays of property names. If predicate is provided it’s invoked for each property of object
  6657. * picking the properties predicate returns truthy for. The predicate is bound to thisArg and invoked with
  6658. * three arguments: (value, key, object).
  6659. *
  6660. * @param object The source object.
  6661. * @param predicate The function invoked per iteration or property names to pick, specified as individual
  6662. * property names or arrays of property names.
  6663. * @param thisArg The this binding of predicate.
  6664. * @return An object composed of the picked properties.
  6665. */
  6666. pick<TResult extends Object, T extends Object>(
  6667. object: T,
  6668. predicate: ObjectIterator<any, boolean>,
  6669. thisArg?: any
  6670. ): TResult;
  6671. /**
  6672. * @see _.pick
  6673. */
  6674. pick<TResult extends Object, T extends Object>(
  6675. object: T,
  6676. ...predicate: Array<string|number|boolean|Array<string|number|boolean>>
  6677. ): TResult;
  6678. }
  6679. interface LoDashObjectWrapper<T> {
  6680. /**
  6681. * @see _.pick
  6682. */
  6683. pick<TResult extends Object>(
  6684. predicate: ObjectIterator<any, boolean>,
  6685. thisArg?: any
  6686. ): LoDashObjectWrapper<TResult>;
  6687. /**
  6688. * @see _.pick
  6689. */
  6690. pick<TResult extends Object>(
  6691. ...predicate: Array<string|number|boolean|Array<string|number|boolean>>
  6692. ): LoDashObjectWrapper<TResult>;
  6693. }
  6694. //_.set
  6695. interface LoDashStatic {
  6696. /**
  6697. * Sets the property value of path on object. If a portion of path does not exist it is created.
  6698. * @param object The object to augment.
  6699. * @param path The path of the property to set.
  6700. * @param value The value to set.
  6701. * @return Returns object.
  6702. **/
  6703. set<T>(object: T,
  6704. path: string|string[],
  6705. value: any): T;
  6706. }
  6707. interface LoDashObjectWrapper<T> {
  6708. /**
  6709. * @see _.set
  6710. **/
  6711. set(path: string|string[],
  6712. value: any): LoDashObjectWrapper<T>;
  6713. }
  6714. //_.transform
  6715. interface LoDashStatic {
  6716. /**
  6717. * An alternative to _.reduce this method transforms object to a new accumulator object which is
  6718. * the result of running each of its elements through a callback, with each callback execution
  6719. * potentially mutating the accumulator object. The callback is bound to thisArg and invoked with
  6720. * four arguments; (accumulator, value, key, object). Callbacks may exit iteration early by
  6721. * explicitly returning false.
  6722. * @param collection The collection to iterate over.
  6723. * @param callback The function called per iteration.
  6724. * @param accumulator The custom accumulator value.
  6725. * @param thisArg The this binding of callback.
  6726. * @return The accumulated value.
  6727. **/
  6728. transform<T, Acc>(
  6729. collection: Array<T>,
  6730. callback: MemoVoidIterator<T, Acc>,
  6731. accumulator: Acc,
  6732. thisArg?: any): Acc;
  6733. /**
  6734. * @see _.transform
  6735. **/
  6736. transform<T, Acc>(
  6737. collection: List<T>,
  6738. callback: MemoVoidIterator<T, Acc>,
  6739. accumulator: Acc,
  6740. thisArg?: any): Acc;
  6741. /**
  6742. * @see _.transform
  6743. **/
  6744. transform<T, Acc>(
  6745. collection: Dictionary<T>,
  6746. callback: MemoVoidIterator<T, Acc>,
  6747. accumulator: Acc,
  6748. thisArg?: any): Acc;
  6749. /**
  6750. * @see _.transform
  6751. **/
  6752. transform<T, Acc>(
  6753. collection: Array<T>,
  6754. callback?: MemoVoidIterator<T, Acc>,
  6755. thisArg?: any): Acc;
  6756. /**
  6757. * @see _.transform
  6758. **/
  6759. transform<T, Acc>(
  6760. collection: List<T>,
  6761. callback?: MemoVoidIterator<T, Acc>,
  6762. thisArg?: any): Acc;
  6763. /**
  6764. * @see _.transform
  6765. **/
  6766. transform<T, Acc>(
  6767. collection: Dictionary<T>,
  6768. callback?: MemoVoidIterator<T, Acc>,
  6769. thisArg?: any): Acc;
  6770. }
  6771. //_.values
  6772. interface LoDashStatic {
  6773. /**
  6774. * Creates an array of the own enumerable property values of object.
  6775. * @param object The object to query.
  6776. * @return Returns an array of property values.
  6777. **/
  6778. values<T>(object?: any): T[];
  6779. }
  6780. interface LoDashObjectWrapper<T> {
  6781. /**
  6782. * @see _.values
  6783. **/
  6784. values<TResult>(): LoDashObjectWrapper<TResult[]>;
  6785. }
  6786. //_.valuesIn
  6787. interface LoDashStatic {
  6788. /**
  6789. * Creates an array of the own and inherited enumerable property values of object.
  6790. * @param object The object to query.
  6791. * @return Returns the array of property values.
  6792. **/
  6793. valuesIn<T>(object?: any): T[];
  6794. }
  6795. interface LoDashObjectWrapper<T> {
  6796. /**
  6797. * @see _.valuesIn
  6798. **/
  6799. valuesIn<TResult>(): LoDashObjectWrapper<TResult[]>;
  6800. }
  6801. /**********
  6802. * String *
  6803. **********/
  6804. //_.camelCase
  6805. interface LoDashStatic {
  6806. /**
  6807. * Converts string to camel case.
  6808. * @param string The string to convert.
  6809. * @return Returns the camel cased string.
  6810. */
  6811. camelCase(string?: string): string;
  6812. }
  6813. interface LoDashWrapper<T> {
  6814. /**
  6815. * @see _.camelCase
  6816. */
  6817. camelCase(): string;
  6818. }
  6819. //_.capitalize
  6820. interface LoDashStatic {
  6821. capitalize(string?: string): string;
  6822. }
  6823. interface LoDashWrapper<T> {
  6824. /**
  6825. * @see _.capitalize
  6826. */
  6827. capitalize(): string;
  6828. }
  6829. //_.deburr
  6830. interface LoDashStatic {
  6831. /**
  6832. * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining
  6833. * diacritical marks.
  6834. * @param string The string to deburr.
  6835. * @return Returns the deburred string.
  6836. */
  6837. deburr(string?: string): string;
  6838. }
  6839. interface LoDashWrapper<T> {
  6840. /**
  6841. * @see _.deburr
  6842. */
  6843. deburr(): string;
  6844. }
  6845. //_.endsWith
  6846. interface LoDashStatic {
  6847. /**
  6848. * Checks if string ends with the given target string.
  6849. * @param string The string to search.
  6850. * @param target The string to search for.
  6851. * @param position The position to search from.
  6852. * @return Returns true if string ends with target, else false.
  6853. */
  6854. endsWith(string?: string, target?: string, position?: number): boolean;
  6855. }
  6856. interface LoDashWrapper<T> {
  6857. /**
  6858. * @see _.endsWith
  6859. */
  6860. endsWith(target?: string, position?: number): boolean;
  6861. }
  6862. // _.escape
  6863. interface LoDashStatic {
  6864. /**
  6865. * Converts the characters "&", "<", ">", '"', "'", and "`", in string to their corresponding HTML entities.
  6866. * @param string The string to escape.
  6867. * @return Returns the escaped string.
  6868. */
  6869. escape(string?: string): string;
  6870. }
  6871. interface LoDashWrapper<T> {
  6872. /**
  6873. * @see _.escape
  6874. */
  6875. escape(): string;
  6876. }
  6877. // _.escapeRegExp
  6878. interface LoDashStatic {
  6879. /**
  6880. * Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]",
  6881. * "{" and "}" in string.
  6882. * @param string The string to escape.
  6883. * @return Returns the escaped string.
  6884. */
  6885. escapeRegExp(string?: string): string;
  6886. }
  6887. interface LoDashWrapper<T> {
  6888. /**
  6889. * @see _.escapeRegExp
  6890. */
  6891. escapeRegExp(): string;
  6892. }
  6893. //_.kebabCase
  6894. interface LoDashStatic {
  6895. /**
  6896. * Converts string to kebab case.
  6897. * @param string The string to convert.
  6898. * @return Returns the kebab cased string.
  6899. */
  6900. kebabCase(string?: string): string;
  6901. }
  6902. interface LoDashWrapper<T> {
  6903. /**
  6904. * @see _.kebabCase
  6905. */
  6906. kebabCase(): string;
  6907. }
  6908. interface LoDashStatic {
  6909. /**
  6910. *
  6911. * @param string The string to pad.
  6912. * @param length The padding length.
  6913. * @param chars The string used as padding.
  6914. * @return Returns the padded string.
  6915. */
  6916. pad(string?: string, length?: number, chars?: string): string;
  6917. }
  6918. //_.pad
  6919. interface LoDashWrapper<T> {
  6920. /**
  6921. * @see _.pad
  6922. */
  6923. pad(length?: number, chars?: string): string;
  6924. }
  6925. //_.padLeft
  6926. interface LoDashStatic {
  6927. /**
  6928. * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed
  6929. * length.
  6930. * @param string The string to pad.
  6931. * @param length The padding length.
  6932. * @param chars The string used as padding.
  6933. * @return Returns the padded string.
  6934. */
  6935. padLeft(string?: string, length?: number, chars?: string): string;
  6936. }
  6937. //_.padLeft
  6938. interface LoDashWrapper<T> {
  6939. /**
  6940. * @see _.padLeft
  6941. */
  6942. padLeft(length?: number, chars?: string): string;
  6943. }
  6944. //_.padRight
  6945. interface LoDashStatic {
  6946. /**
  6947. * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed
  6948. * length.
  6949. * @param string The string to pad.
  6950. * @param length The padding length.
  6951. * @param chars The string used as padding.
  6952. * @return Returns the padded string.
  6953. */
  6954. padRight(string?: string, length?: number, chars?: string): string;
  6955. }
  6956. //_.padRight
  6957. interface LoDashWrapper<T> {
  6958. /**
  6959. * @see _.padRight
  6960. */
  6961. padRight(length?: number, chars?: string): string;
  6962. }
  6963. //_.parseInt
  6964. interface LoDashStatic {
  6965. /**
  6966. * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
  6967. * unless value is a hexadecimal, in which case a radix of 16 is used.
  6968. * Note: This method aligns with the ES5 implementation of parseInt.
  6969. * @param string The string to convert.
  6970. * @param radix The radix to interpret value by.
  6971. * @return Returns the converted integer.
  6972. */
  6973. parseInt(string: string, radix?: number): number;
  6974. }
  6975. interface LoDashWrapper<T> {
  6976. /**
  6977. * @see _.parseInt
  6978. */
  6979. parseInt(radix?: number): number;
  6980. }
  6981. //_.repeat
  6982. interface LoDashStatic {
  6983. /**
  6984. * Repeats the given string n times.
  6985. * @param string The string to repeat.
  6986. * @param n The number of times to repeat the string.
  6987. * @return Returns the repeated string.
  6988. */
  6989. repeat(string?: string, n?: number): string;
  6990. }
  6991. interface LoDashWrapper<T> {
  6992. /**
  6993. * @see _.repeat
  6994. */
  6995. repeat(n?: number): string;
  6996. }
  6997. //_.snakeCase
  6998. interface LoDashStatic {
  6999. /**
  7000. * Converts string to snake case.
  7001. * @param string The string to convert.
  7002. * @return Returns the snake cased string.
  7003. */
  7004. snakeCase(string?: string): string;
  7005. }
  7006. interface LoDashWrapper<T> {
  7007. /**
  7008. * @see _.snakeCase
  7009. */
  7010. snakeCase(): string;
  7011. }
  7012. //_.startCase
  7013. interface LoDashStatic {
  7014. /**
  7015. * Converts string to start case.
  7016. * @param string The string to convert.
  7017. * @return Returns the start cased string.
  7018. */
  7019. startCase(string?: string): string;
  7020. }
  7021. interface LoDashWrapper<T> {
  7022. /**
  7023. * @see _.startCase
  7024. */
  7025. startCase(): string;
  7026. }
  7027. //_.startsWith
  7028. interface LoDashStatic {
  7029. /**
  7030. * Checks if string starts with the given target string.
  7031. * @param string The string to search.
  7032. * @param target The string to search for.
  7033. * @param position The position to search from.
  7034. * @return Returns true if string starts with target, else false.
  7035. */
  7036. startsWith(string?: string, target?: string, position?: number): boolean;
  7037. }
  7038. interface LoDashWrapper<T> {
  7039. /**
  7040. * @see _.startsWith
  7041. */
  7042. startsWith(target?: string, position?: number): boolean;
  7043. }
  7044. //_.template
  7045. interface TemplateExecutor {
  7046. (data?: Object): string;
  7047. source: string;
  7048. }
  7049. interface LoDashStatic {
  7050. /**
  7051. * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters,
  7052. * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate"
  7053. * delimiters. Data properties may be accessed as free variables in the template. If a setting object is
  7054. * provided it takes precedence over _.templateSettings values.
  7055. *
  7056. * Note: In the development build _.template utilizes
  7057. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier
  7058. * debugging.
  7059. *
  7060. * For more information on precompiling templates see
  7061. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  7062. *
  7063. * For more information on Chrome extension sandboxes see
  7064. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  7065. *
  7066. * @param string The template string.
  7067. * @param options The options object.
  7068. * @param options.escape The HTML "escape" delimiter.
  7069. * @param options.evaluate The "evaluate" delimiter.
  7070. * @param options.imports An object to import into the template as free variables.
  7071. * @param options.interpolate The "interpolate" delimiter.
  7072. * @param options.variable The data object variable name.
  7073. * @return Returns the compiled template function.
  7074. */
  7075. template(
  7076. string: string,
  7077. options?: TemplateSettings): TemplateExecutor;
  7078. }
  7079. interface LoDashWrapper<T> {
  7080. /**
  7081. * @see _.template
  7082. */
  7083. template(options?: TemplateSettings): TemplateExecutor;
  7084. }
  7085. //_.trim
  7086. interface LoDashStatic {
  7087. /**
  7088. * Removes leading and trailing whitespace or specified characters from string.
  7089. * @param string The string to trim.
  7090. * @param chars The characters to trim.
  7091. * @return Returns the trimmed string.
  7092. */
  7093. trim(string?: string, chars?: string): string;
  7094. }
  7095. interface LoDashWrapper<T> {
  7096. /**
  7097. * @see _.trim
  7098. */
  7099. trim(chars?: string): string;
  7100. }
  7101. //_.trimLeft
  7102. interface LoDashStatic {
  7103. /**
  7104. * Removes leading whitespace or specified characters from string.
  7105. * @param string The string to trim.
  7106. * @param chars The characters to trim.
  7107. * @return Returns the trimmed string.
  7108. */
  7109. trimLeft(string?: string, chars?: string): string;
  7110. }
  7111. interface LoDashWrapper<T> {
  7112. /**
  7113. * @see _.trimLeft
  7114. */
  7115. trimLeft(chars?: string): string;
  7116. }
  7117. //_.trimRight
  7118. interface LoDashStatic {
  7119. /**
  7120. * Removes trailing whitespace or specified characters from string.
  7121. * @param string The string to trim.
  7122. * @param chars The characters to trim.
  7123. * @return Returns the trimmed string.
  7124. */
  7125. trimRight(string?: string, chars?: string): string;
  7126. }
  7127. interface LoDashWrapper<T> {
  7128. /**
  7129. * @see _.trimRight
  7130. */
  7131. trimRight(chars?: string): string;
  7132. }
  7133. //_.trunc
  7134. interface TruncOptions {
  7135. /** The maximum string length. */
  7136. length?: number;
  7137. /** The string to indicate text is omitted. */
  7138. omission?: string;
  7139. /** The separator pattern to truncate to. */
  7140. separator?: string|RegExp;
  7141. }
  7142. interface LoDashStatic {
  7143. /**
  7144. * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated
  7145. * string are replaced with the omission string which defaults to "…".
  7146. * @param string The string to truncate.
  7147. * @param options The options object or maximum string length.
  7148. * @return Returns the truncated string.
  7149. */
  7150. trunc(string?: string, options?: TruncOptions|number): string;
  7151. }
  7152. interface LoDashWrapper<T> {
  7153. /**
  7154. * @see _.trunc
  7155. */
  7156. trunc(options?: TruncOptions|number): string;
  7157. }
  7158. //_.unescape
  7159. interface LoDashStatic {
  7160. /**
  7161. * The inverse of _.escape; this method converts the HTML entities &amp;, &lt;, &gt;, &quot;, &#39;, and &#96;
  7162. * in string to their corresponding characters.
  7163. * @param string The string to unescape.
  7164. * @return Returns the unescaped string.
  7165. */
  7166. unescape(string?: string): string;
  7167. }
  7168. interface LoDashWrapper<T> {
  7169. /**
  7170. * @see _.unescape
  7171. */
  7172. unescape(): string;
  7173. }
  7174. //_.words
  7175. interface LoDashStatic {
  7176. /**
  7177. * Splits string into an array of its words.
  7178. * @param string The string to inspect.
  7179. * @param pattern The pattern to match words.
  7180. * @return Returns the words of string.
  7181. */
  7182. words(string?: string, pattern?: string|RegExp): string[];
  7183. }
  7184. interface LoDashWrapper<T> {
  7185. /**
  7186. * @see _.words
  7187. */
  7188. words(pattern?: string|RegExp): string[];
  7189. }
  7190. /***********
  7191. * Utility *
  7192. ***********/
  7193. //_.attempt
  7194. interface LoDashStatic {
  7195. /**
  7196. * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments
  7197. * are provided to func when it’s invoked.
  7198. * @param func The function to attempt.
  7199. * @return Returns the func result or error object.
  7200. */
  7201. attempt<TResult>(func: (...args: any[]) => TResult): TResult|Error;
  7202. }
  7203. interface LoDashObjectWrapper<T> {
  7204. /**
  7205. * @see _.attempt
  7206. */
  7207. attempt<TResult>(): TResult|Error;
  7208. }
  7209. //_.identity
  7210. interface LoDashStatic {
  7211. /**
  7212. * This method returns the first argument provided to it.
  7213. * @param value Any value.
  7214. * @return Returns value.
  7215. */
  7216. identity<T>(value?: T): T;
  7217. }
  7218. interface LoDashWrapper<T> {
  7219. /**
  7220. * @see _.identity
  7221. */
  7222. identity(): T;
  7223. }
  7224. interface LoDashArrayWrapper<T> {
  7225. /**
  7226. * @see _.identity
  7227. */
  7228. identity(): T[];
  7229. }
  7230. interface LoDashObjectWrapper<T> {
  7231. /**
  7232. * @see _.identity
  7233. */
  7234. identity(): T;
  7235. }
  7236. //_.method
  7237. interface LoDashStatic {
  7238. /**
  7239. * Creates a function that invokes the method at path on a given object. Any additional arguments are provided
  7240. * to the invoked method.
  7241. * @param path The path of the method to invoke.
  7242. * @param args The arguments to invoke the method with.
  7243. * @return Returns the new function.
  7244. */
  7245. method<TResult>(path: string, ...args: any[]): (object: any) => TResult;
  7246. /**
  7247. * @see _.method
  7248. */
  7249. method<TResult>(path: any[], ...args: any[]): (object: any) => TResult;
  7250. }
  7251. interface LoDashWrapper<T> {
  7252. /**
  7253. * @see _.method
  7254. */
  7255. method<TResult>(...args: any[]): LoDashWrapper<(object: any) => TResult>;
  7256. /**
  7257. * @see _.method
  7258. */
  7259. method<TResult>(...args: any[]): LoDashWrapper<(object: any) => TResult>;
  7260. }
  7261. interface LoDashArrayWrapper<T> {
  7262. /**
  7263. * @see _.method
  7264. */
  7265. method<TResult>(...args: any[]): LoDashWrapper<(object: any) => TResult>;
  7266. /**
  7267. * @see _.method
  7268. */
  7269. method<TResult>(...args: any[]): LoDashWrapper<(object: any) => TResult>;
  7270. }
  7271. //_.methodOf
  7272. interface LoDashStatic {
  7273. /**
  7274. * The opposite of _.method; this method creates a function that invokes the method at a given path on object.
  7275. * Any additional arguments are provided to the invoked method.
  7276. * @param object The object to query.
  7277. * @param args The arguments to invoke the method with.
  7278. * @return Returns the new function.
  7279. */
  7280. methodOf<TResult>(object: Object, ...args: any[]): (path: string | any[]) => TResult;
  7281. }
  7282. interface LoDashObjectWrapper<T> {
  7283. /**
  7284. * @see _.methodOf
  7285. */
  7286. methodOf<TResult>(...args: any[]): LoDashObjectWrapper<(path: string | any[]) => TResult>;
  7287. }
  7288. //_.mixin
  7289. interface MixinOptions {
  7290. chain?: boolean;
  7291. }
  7292. interface LoDashStatic {
  7293. /**
  7294. * Adds all own enumerable function properties of a source object to the destination object. If object is a
  7295. * function then methods are added to its prototype as well.
  7296. *
  7297. * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying
  7298. * the original.
  7299. *
  7300. * @param object The destination object.
  7301. * @param source The object of functions to add.
  7302. * @param options The options object.
  7303. * @param options.chain Specify whether the functions added are chainable.
  7304. * @return Returns object.
  7305. */
  7306. mixin<TResult, TObject>(
  7307. object: TObject,
  7308. source: Dictionary<Function>,
  7309. options?: MixinOptions
  7310. ): TResult;
  7311. /**
  7312. * @see _.mixin
  7313. */
  7314. mixin<TResult>(
  7315. source: Dictionary<Function>,
  7316. options?: MixinOptions
  7317. ): TResult;
  7318. }
  7319. interface LoDashObjectWrapper<T> {
  7320. /**
  7321. * @see _.mixin
  7322. */
  7323. mixin<TResult>(
  7324. source: Dictionary<Function>,
  7325. options?: MixinOptions
  7326. ): LoDashObjectWrapper<TResult>;
  7327. /**
  7328. * @see _.mixin
  7329. */
  7330. mixin<TResult>(
  7331. options?: MixinOptions
  7332. ): LoDashObjectWrapper<TResult>;
  7333. }
  7334. //_.noConflict
  7335. interface LoDashStatic {
  7336. /**
  7337. * Reverts the '_' variable to its previous value and returns a reference to the lodash function.
  7338. * @return The lodash function.
  7339. **/
  7340. noConflict(): typeof _;
  7341. }
  7342. //_.noop
  7343. interface LoDashStatic {
  7344. /**
  7345. * A no-operation function that returns undefined regardless of the arguments it receives.
  7346. * @return undefined
  7347. */
  7348. noop(...args: any[]): void;
  7349. }
  7350. interface LoDashWrapperBase<T, TWrapper> {
  7351. /**
  7352. * @see _.noop
  7353. */
  7354. noop(...args: any[]): void;
  7355. }
  7356. //_.property
  7357. interface LoDashStatic {
  7358. /**
  7359. * Creates a function that returns the property value at path on a given object.
  7360. * @param path The path of the property to get.
  7361. * @return Returns the new function.
  7362. */
  7363. property<TObj, TResult>(path: string|string[]): (obj: TObj) => TResult;
  7364. }
  7365. interface LoDashStringWrapper {
  7366. /**
  7367. * @see _.property
  7368. */
  7369. property<TObj, TResult>(): LoDashObjectWrapper<(obj: TObj) => TResult>;
  7370. }
  7371. interface LoDashArrayWrapper<T> {
  7372. /**
  7373. * @see _.property
  7374. */
  7375. property<TObj, TResult>(): LoDashObjectWrapper<(obj: TObj) => TResult>;
  7376. }
  7377. //_.propertyOf
  7378. interface LoDashStatic {
  7379. /**
  7380. * The opposite of _.property; this method creates a function that returns the property value at a given path
  7381. * on object.
  7382. * @param object The object to query.
  7383. * @return Returns the new function.
  7384. */
  7385. propertyOf<T extends {}>(object: T): (path: string|string[]) => any;
  7386. }
  7387. interface LoDashObjectWrapper<T> {
  7388. /**
  7389. * @see _.propertyOf
  7390. */
  7391. propertyOf(): LoDashObjectWrapper<(path: string|string[]) => any>;
  7392. }
  7393. //_.range
  7394. interface LoDashStatic {
  7395. /**
  7396. * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
  7397. * 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
  7398. * range is created unless a negative step is specified.
  7399. * @param start The start of the range.
  7400. * @param end The end of the range.
  7401. * @param step The value to increment or decrement by.
  7402. * @return Returns a new range array.
  7403. */
  7404. range(
  7405. start: number,
  7406. end: number,
  7407. step?: number): number[];
  7408. /**
  7409. * @see _.range
  7410. */
  7411. range(
  7412. end: number,
  7413. step?: number): number[];
  7414. }
  7415. interface LoDashWrapper<T> {
  7416. /**
  7417. * @see _.range
  7418. */
  7419. range(
  7420. end?: number,
  7421. step?: number): LoDashArrayWrapper<number>;
  7422. }
  7423. //_.random
  7424. interface LoDashStatic {
  7425. /**
  7426. * Produces a random number between min and max (inclusive). If only one argument is provided a
  7427. * number between 0 and the given number will be returned. If floating is truey or either min or
  7428. * max are floats a floating-point number will be returned instead of an integer.
  7429. * @param max The maximum possible value.
  7430. * @param floating Specify returning a floating-point number.
  7431. * @return A random number.
  7432. **/
  7433. random(max: number, floating?: boolean): number;
  7434. /**
  7435. * @see _.random
  7436. * @param min The minimum possible value.
  7437. * @return A random number between `min` and `max`.
  7438. **/
  7439. random(min: number, max: number, floating?: boolean): number;
  7440. }
  7441. //_.result
  7442. interface LoDashStatic {
  7443. /**
  7444. * Resolves the value of property on object. If property is a function it will be invoked with
  7445. * the this binding of object and its result returned, else the property value is returned. If
  7446. * object is false then undefined is returned.
  7447. * @param object The object to query.
  7448. * @param path The path of the property to resolve.
  7449. * @param defaultValue The value returned if the resolved value is undefined.
  7450. * @return The resolved value.
  7451. **/
  7452. result<T>(object: any, path: string|string[], defaultValue?: T): T;
  7453. }
  7454. //_.runInContext
  7455. interface LoDashStatic {
  7456. /**
  7457. * Create a new lodash function using the given context object.
  7458. * @param context The context object
  7459. * @returns The lodash function.
  7460. **/
  7461. runInContext(context: any): typeof _;
  7462. }
  7463. //_.times
  7464. interface LoDashStatic {
  7465. /**
  7466. * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is
  7467. * bound to thisArg and invoked with one argument; (index).
  7468. *
  7469. * @param n The number of times to invoke iteratee.
  7470. * @param iteratee The function invoked per iteration.
  7471. * @param thisArg The this binding of iteratee.
  7472. * @return Returns the array of results.
  7473. */
  7474. times<TResult>(
  7475. n: number,
  7476. iteratee: (num: number) => TResult,
  7477. thisArg?: any
  7478. ): TResult[];
  7479. /**
  7480. * @see _.times
  7481. */
  7482. times(n: number): number[];
  7483. }
  7484. interface LoDashWrapper<T> {
  7485. /**
  7486. * @see _.times
  7487. */
  7488. times<TResult>(
  7489. iteratee: (num: number) => TResult,
  7490. thisArgs?: any
  7491. ): LoDashArrayWrapper<TResult>;
  7492. /**
  7493. * @see _.times
  7494. */
  7495. times(): LoDashArrayWrapper<number>;
  7496. }
  7497. //_.uniqueId
  7498. interface LoDashStatic {
  7499. /**
  7500. * Generates a unique ID. If prefix is provided the ID is appended to it.
  7501. * @param prefix The value to prefix the ID with.
  7502. * @return Returns the unique ID.
  7503. */
  7504. uniqueId(prefix?: string): string;
  7505. }
  7506. interface LoDashWrapper<T> {
  7507. /**
  7508. * @see _.uniqueId
  7509. */
  7510. uniqueId(): string;
  7511. }
  7512. //_.constant
  7513. interface LoDashStatic {
  7514. /**
  7515. * Creates a function that returns value.
  7516. * @param value The value to return from the new function.
  7517. * @return Returns the new function.
  7518. */
  7519. constant<T>(value: T): () => T;
  7520. }
  7521. interface LoDashWrapperBase<T, TWrapper> {
  7522. /**
  7523. * @see _.constant
  7524. */
  7525. constant<TResult>(): () => TResult;
  7526. }
  7527. interface ListIterator<T, TResult> {
  7528. (value: T, index: number, collection: T[]): TResult;
  7529. }
  7530. interface DictionaryIterator<T, TResult> {
  7531. (value: T, key: string, collection: Dictionary<T>): TResult;
  7532. }
  7533. interface ObjectIterator<T, TResult> {
  7534. (element: T, key: string, collection: any): TResult;
  7535. }
  7536. interface MemoVoidIterator<T, TResult> {
  7537. (prev: TResult, curr: T, indexOrKey: any, list?: T[]): void;
  7538. }
  7539. interface MemoIterator<T, TResult> {
  7540. (prev: TResult, curr: T, indexOrKey: any, list?: T[]): TResult;
  7541. }
  7542. /*
  7543. interface MemoListIterator<T, TResult> {
  7544. (prev: TResult, curr: T, index: number, list?: T[]): TResult;
  7545. }
  7546. interface MemoObjectIterator<T, TResult> {
  7547. (prev: TResult, curr: T, index: string, object?: Dictionary<T>): TResult;
  7548. }
  7549. */
  7550. //interface Collection<T> {}
  7551. // Common interface between Arrays and jQuery objects
  7552. interface List<T> {
  7553. [index: number]: T;
  7554. length: number;
  7555. }
  7556. interface Dictionary<T> {
  7557. [index: string]: T;
  7558. }
  7559. }
  7560. declare module "lodash" {
  7561. export = _;
  7562. }