Skip to main content
Module

x/rambda/files/index.d.ts

Faster and smaller alternative to Ramda
Go to Latest
File
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933
export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol" | "Set" | "Error";
export type IndexedIterator<T, U> = (x: T, i: number) => U;export type Iterator<T, U> = (x: T) => U;export type ObjectIterator<T, U> = (x: T, prop: string, inputObj: Dictionary<T>) => U;type Ord = number | string | boolean | Date;type Path = string | (number | string)[];type Predicate<T> = (x: T) => boolean;export type IndexedPredicate<T> = (x: T, i: number) => boolean;export type ObjectPredicate<T> = (x: T, prop: string, inputObj: Dictionary<T>) => boolean;export type RamdaPath = (number | string)[];type CondPair<T extends any[], R> = [(...val: T) => boolean, (...val: T) => R]
type ValueOfRecord<R> = R extends Record<any, infer T> ? T : never;interface KeyValuePair<K, V> extends Array<K | V> { 0: K; 1: V;}
export interface Lens { <T, U>(obj: T): U; set<T, U>(str: string, obj: T): U;}
type Arity1Fn = (x: any) => any;type Arity2Fn = (x: any, y: any) => any;
type Pred = (...x: any[]) => boolean;type SafePred<T> = (...x: T[]) => boolean;
export interface Dictionary<T> {[index: string]: T}type Partial<T> = { [P in keyof T]?: T[P]};
type Evolvable<E extends Evolver> = { [P in keyof E]?: Evolved<E[P]>;};
type Evolver<T extends Evolvable<any> = any> = { [key in keyof Partial<T>]: ((value: T[key]) => T[key]) | (T[key] extends Evolvable<any> ? Evolver<T[key]> : never);};
type Evolve<O extends Evolvable<E>, E extends Evolver> = { [P in keyof O]: P extends keyof E ? EvolveValue<O[P], E[P]> : O[P];};
type Evolved<A> = A extends (value: infer V) => any ? V : A extends Evolver ? Evolvable<A> : never;type EvolveNestedValue<O, E extends Evolver> = O extends object ? O extends Evolvable<E> ? Evolve<O, E> : never : never;type EvolveValue<V, E> = E extends (value: V) => any ? ReturnType<E> : E extends Evolver ? EvolveNestedValue<V, E> : never;interface AssocPartialOne<K extends keyof any> { <T>(val: T): <U>(obj: U) => Record<K, T> & U; <T, U>(val: T, obj: U): Record<K, T> & U;}
// RAMBDAX INTERFACES// ============================================type Func<T> = (input: any) => T;type VoidInputFunc<T> = () => T;type Fn<In, Out> = (x: In) => Out;type SortObjectPredicate<T> = (aProp: string, bProp: string, aValue: T, bValue: T) => number;
type IdentityFunction<T> = (x: T) => T;
interface Filter<T> { (list: T[]): T[]; (obj: Dictionary<T>): Dictionary<T>;}
type ArgumentTypes<T> = T extends (...args: infer U) => infer R ? U : never;type isfn<T> = (x: any, y: any) => T;
interface Switchem<T> { is: isfn<Switchem<T>>; default: IdentityFunction<T>;}
interface Schema { [key: string]: any;}
interface SchemaAsync { [key: string]: Promise<boolean>;}
interface IsValid { input: object; schema: Schema;}
interface IsValidAsync { input: object; schema: Schema | SchemaAsync;}
type ProduceRules<Output,K extends keyof Output, Input> = { [P in K]: (input: Input) => Output[P];};type ProduceAsyncRules<Output,K extends keyof Output, Input> = { [P in K]: (input: Input) => Promise<Output[P]>;};type ProduceAsyncRule<Input> = (input: Input) => Promise<any>;type Async<T> = (x: any) => Promise<T>;type AsyncIterable<T, K> = (x: T) => Promise<K>;type AsyncIterableIndexed<T, K> = (x: T, i: number) => Promise<K>;type AsyncPredicate<T> = (x: T) => Promise<boolean>;type AsyncPredicateIndexed<T> = (x: T, i: number) => Promise<boolean>;type AsyncWithProp<T> = (x: any, prop?: string) => Promise<T>;
type ApplyDiffUpdate = {op:'update', path: string, value: any};type ApplyDiffAdd = {op:'add', path: string, value: any};type ApplyDiffRemove = {op:'remove', path: string};type ApplyDiffRule = ApplyDiffUpdate | ApplyDiffAdd | ApplyDiffRemove;
// API_MARKER
/*Method: add
Explanation:
It adds `a` and `b`.
Example:
```R.add(2, 3) // => 5```
Categories: Number
Notes: It doesn't work with strings, as the inputs are parsed to numbers before calculation.
*/// @SINGLE_MARKERexport function add(a: number, b: number): number;export function add(a: number): (b: number) => number;
/*Method: adjust
Explanation:
It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
Example:
```R.adjust( 0, a => a + 1, [0, 100]) // => [1, 100]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function adjust<T>(index: number, replaceFn: (x: T) => T, list: T[]): T[];export function adjust<T>(index: number, replaceFn: (x: T) => T): (list: T[]) => T[];
/*Method: all
Explanation: It returns `true`, if all members of array `list` returns `true`, when applied as argument to `predicate` function.
Example:
```const list = [ 0, 1, 2, 3, 4 ]const predicate = x => x > -1
const result = R.all(predicate, list)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function all<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function all<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: allPass
Explanation: It returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.
Example:
```const input = { a : 1, b : 2,}const predicates = [ x => x.a === 1, x => x.b === 2,]const result = R.allPass(predicates)(input) // => true```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
/*Method: always
Explanation: It returns function that always returns `x`.
Example:
```const fn = R.always(7)
const result = fn()// => 7```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function always<T>(x: T): (...args: unknown[]) => T;
/*Method: and
Explanation: Logical AND
Example:
```R.and(true, true); // => trueR.and(false, true); // => falseR.and(true, 'foo'); // => 'foo'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function and<T, U>(x: T, y: U): T | U;export function and<T>(x: T): <U>(y: U) => T | U;
/*Method: or
Explanation: Logical OR
Example:
```R.or(false, true); // => trueR.or(false, false); // => falseR.or(false, 'foo'); // => 'foo'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function or<T, U>(a: T, b: U): T | U;export function or<T>(a: T): <U>(b: U) => T | U;
/*Method: any
Explanation: It returns `true`, if at least one member of `list` returns true, when passed to a `predicate` function.
Example:
```const list = [1, 2, 3]const predicate = x => x * x > 8R.any(fn, list)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function any<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function any<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: anyPass
Explanation: It accepts list of `predicates` and returns a function. This function with its `input` will return `true`, if any of `predicates` returns `true` for this `input`.
Example:
```const isBig = x => x > 20const isOdd = x => x % 2 === 1const input = 11
const fn = R.anyPass( [isBig, isOdd])
const result = fn(input) // => true```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function anyPass<T>(predicates: SafePred<T>[]): SafePred<T>;
/*Method: append
Explanation: It adds element `x` at the end of `list`.
Example:
```const x = 'foo'
const result = R.append(x, ['bar', 'baz'])// => ['bar', 'baz', 'foo']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function append<T>(x: T, list: T[]): T[];export function append<T>(x: T): <T>(list: T[]) => T[];
/*Method: applySpec
Explanation:
Example:
```const fn = R.applySpec({ sum: R.add, nested: { mul: R.multiply }})const result = fn(2, 4) // => { sum: 6, nested: { mul: 8 } }```
Categories: Function
Notes: The currying in this function works best with functions with 4 arguments or less. (arity of 4)
*/// @SINGLE_MARKERexport function applySpec<Spec extends Record<string, (...args: any[]) => any>>( spec: Spec): ( ...args: Parameters<ValueOfRecord<Spec>>) => { [Key in keyof Spec]: ReturnType<Spec[Key]> };export function applySpec<T>(spec: any): (...args: any[]) => T;
/*Method: assoc
Explanation: It makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.
Example:
```R.assoc('c', 3, {a: 1, b: 2})// => {a: 1, b: 2, c: 3}```
Categories: Object
Notes: This copies and flattens prototype propertiesonto the new object as well. All non-primitive properties are copied byreference.
*/// @SINGLE_MARKERexport function assoc<T, U, K extends string>(prop: K, val: T, obj: U): Record<K, T> & Omit<U, K>;export function assoc<T, K extends string>(prop: K, val: T): <U>(obj: U) => Record<K, T> & Omit<U, K>;export function assoc<K extends string>(prop: K): AssocPartialOne<K>;
/*Method: assocPath
Explanation: It makes a shallow clone of `obj` with setting or overriding with `newValue` the property found with `path`.
Example:
```const path = 'b.c'const newValue = 2const obj = { a: 1 }
R.assocPath(path, newValue, obj)// => { a : 1, b : { c : 2 }}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function assocPath<Output>(path: Path, newValue: any, obj: object): Output;export function assocPath<Output>(path: Path, newValue: any): (obj: object) => Output;export function assocPath<Output>(path: Path): (newValue: any) => (obj: object) => Output;
/*Method: both
Explanation: It returns a function with `input` argument.
This function will return `true`, if both `firstCondition` and `secondCondition` return `true` when `input` is passed as their argument.
Example:
```const firstCondition = x => x > 10const secondCondition = x => x < 20const fn = R.both(secondCondition)
const result = [fn(15), fn(30)]// => [true, false]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function both(pred1: Pred, pred2: Pred): Pred;export function both<T>(pred1: Predicate<T>, pred2: Predicate<T>): Predicate<T>;export function both<T>(pred1: Predicate<T>): (pred2: Predicate<T>) => Predicate<T>;export function both(pred1: Pred): (pred2: Pred) => Pred;
/*Method: chain
Explanation: The method is also known as `flatMap`.
Example:
```const duplicate = n => [ n, n ]const list = [ 1, 2, 3 ]
const result = chain(duplicate, list)// => [ 1, 1, 2, 2, 3, 3 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function chain<T, U>(fn: (n: T) => U[], list: T[]): U[];export function chain<T, U>(fn: (n: T) => U[]): (list: T[]) => U[];
/*Method: clamp
Explanation: Restrict a number `input` to be within `min` and `max` limits.
If `input` is bigger than `max`, then the result is `max`.
If `input` is smaller than `min`, then the result is `min`.
Example:
```const result = [ R.clamp(0, 10, 5), R.clamp(0, 10, -1), R.clamp(0, 10, 11)]// => [5, 0, 10]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function clamp(min: number, max: number, input: number): number;export function clamp(min: number, max: number): (input: number) => number;
/*Method: clone
Explanation: It creates a deep copy of the `input`, which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates.
Example:
```const objects = [{a: 1}, {b: 2}];const objectsClone = R.clone(objects);
const result = [ R.equals(objects, objectsClone), R.equals(objects[0], objectsClone[0]),] // => [ true, true ]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function clone<T>(input: T): T;export function clone<T>(input: T[]): T[];
/*Method: complement
Explanation: It returns `inverted` version of `origin` function that accept `input` as argument.
The return value of `inverted` is the negative boolean value of `origin(input)`.
Example:
```const origin = x => x > 5const inverted = complement(origin)
const result = [ origin(7), inverted(7)] => [ true, false ]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function complement<T extends any[]>(predicate: (...args: T) => unknown): (...args: T) => boolean;
/*Method: compose
Explanation: It performs right-to-left function composition.
Example:
```const result = R.compose( R.map(x => x * 2), R.filter(x => x > 2))([1, 2, 3, 4])
// => [6, 8]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( ...func: [ fnLast: (a: any) => TResult, ...func: Array<(a: any) => any>, f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1 ]): (...args: TArgs) => TResult; // fallback overload if number of composed functions greater than 7export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R7;export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>( f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R7;export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6>( f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R6;export function compose<TArgs extends any[], R1, R2, R3, R4, R5>( f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R5;export function compose<TArgs extends any[], R1, R2, R3, R4>( f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R4;export function compose<TArgs extends any[], R1, R2, R3>( f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R3;export function compose<TArgs extends any[], R1, R2>( f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R2;export function compose<TArgs extends any[], R1>( f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
/*Method: concat
Explanation: It returns a new string or array, which is the result of merging `x` and `y`.
Example:
```R.concat([1, 2])([3, 4]) // => [1, 2, 3, 4]R.concat('foo', 'bar') // => 'foobar'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function concat<T>(x: T[], y: T[]): T[];export function concat<T>(x: T[]): (y: T[]) => T[];export function concat(x: string, y: string): string;export function concat(x: string): (y: string) => string;
/*Method: cond
Explanation: It takes list with `conditions` and returns a new function `fn` that expects `input` as argument.
This function will start evaluating the `conditions` in order to find the first winner(order of conditions matter).
The winner is this condition, which left side returns `true` when `input` is its argument. Then the evaluation of the right side of the winner will be the final result.
If no winner is found, then `fn` returns `undefined`.
Example:
```const fn = R.cond([ [ x => x > 25, R.always('more than 25') ], [ x => x > 15, R.always('more than 15') ], [ R.T, x => `${x} is nothing special` ],])
const result = [ fn(30), fn(20), fn(10),] // => ['more than 25', 'more than 15', '10 is nothing special']```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function cond<T extends any[], R>(conditions: Array<CondPair<T, R>>): (...args: T) => R;
/*Method: converge
Explanation: Accepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value.
Example:
```const result = R.converge(R.multiply)([ R.add(1), R.add(3) ])(2)// => 15```
Categories: Function
Notes: Explanation is taken from `Ramda` documentation
*/// @SINGLE_MARKERexport function converge(after: ((...a: any[]) => any), fns: ((...x: any[]) => any)[]): (...y: any[]) => any;
/*Method: curry
Explanation: It expects a function as input and returns its curried version.
Example:
```const fn = (a, b, c) => a + b + cconst curried = R.curry(fn)const sum = curried(1,2)
const result = sum(3) // => 6```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function curry(fn: (...args: any[]) => any): (...a: any[]) => any;
/*Method: curryN
Explanation: It returns a curried equivalent of the provided function, with the specified arity.
Example:
```
```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function curryN(length: number, fn: (...args: any[]) => any): (...a: any[]) => any;
/*Method: dec
Explanation: It decrements a number.
Example:
```
```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function dec(x: number): number;
/*Method: defaultTo
Explanation:It returns `defaultValue`, if all of `inputArguments` are `undefined`, `null` or `NaN`.
Else, it returns the first truthy `inputArguments` instance(from left to right).
Example:
```R.defaultTo('foo', 'bar') // => 'bar'R.defaultTo('foo', undefined) // => 'foo'
// Important - emtpy string is not falsy value(same as Ramda)R.defaultTo('foo', '') // => 'foo'```
Categories: Logic
Notes: Rambda's **defaultTo** accept indefinite number of arguments when non curried, i.e. `R.defaultTo(2, foo, bar, baz)`.
*/// @SINGLE_MARKERexport function defaultTo<T>(defaultValue: T, input: T | null | undefined): T;export function defaultTo<T>(defaultValue: T): (input: T | null | undefined) => T;
/*Method: difference
Explanation: It returns the uniq set of all elements in the first list `a` not contained in the second list `b`.
`R.equals` is used to determine equality.
Example:
```const a = [ 1, 2, 3, 4 ]const b = [ 3, 4, 5, 6 ]
const result = difference(a, b)// => [ 1, 2 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function difference<T>(a: T[], b: T[]): T[];export function difference<T>(a: T[]): (b: T[]) => T[];
/*Method: dissoc
Explanation: It returns a new object that does not contain property `prop`.
Example:
```R.dissoc('b', {a: 1, b: 2, c: 3})// => {a: 1, c: 3}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;export function dissoc<K extends string | number>(prop: K): <T extends object>(obj: T) => Omit<T, K>;
/*Method: divide
Explanation:
Example:
```R.divide(71, 100) // => 0.71```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function divide(x: number, y: number): number;export function divide(x: number): (y: number) => number;
/*Method: drop
Explanation: It returns `howMany` items dropped from beginning of list or string `input`.
Example:
```R.drop(2, ['foo', 'bar', 'baz']) // => ['baz']R.drop(2, 'foobar') // => 'obar'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function drop<T>(howMany: number, input: T[]): T[];export function drop(howMany: number, input: string): string;export function drop<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: dropLast
Explanation: It returns `howMany` items dropped from the end of list or string `input`.
Example:
```R.dropLast(2, ['foo', 'bar', 'baz']) // => ['foo']R.dropLast(2, 'foobar') // => 'foob'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropLast<T>(howMany: number, input: T[]): T[];export function dropLast(howMany: number, input: string): string;export function dropLast<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: either
Explanation: It returns a new `predicate` function from `firstPredicate` and `secondPredicate` inputs.
This `predicate` function will return `true`, if any of the two input predicates return `true`.
Example:
```const firstPredicate = x => x > 10const secondPredicate = x => x % 2 === 0const predicate = R.either(firstPredicate, secondPredicate)
const result = [ predicate(15), predicate(8), predicate(7),]// => [true, true, false]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function either(firstPredicate: Pred, secondPredicate: Pred): Pred;export function either<T>(firstPredicate: Predicate<T>, secondPredicate: Predicate<T>): Predicate<T>;export function either<T>(firstPredicate: Predicate<T>): (secondPredicate: Predicate<T>) => Predicate<T>;export function either(firstPredicate: Pred): (secondPredicate: Pred) => Pred;
/*Method: endsWith
Explanation: When iterable is a string, then it behaves as `String.prototype.endsWith`.When iterable is a list, then it uses R.equals to determine if the target list ends in the same way as the given target.
Example:
```const str = 'foo-bar'const list = [{a:1}, {a:2}, {a:3}]
const result = [ R.endsWith('bar', str), R.endsWith([{a:1}, {a:2}], list)]// => [true, true]```
Categories: String, List
Notes:
*/// @SINGLE_MARKERexport function endsWith(target: string, iterable: string): boolean;export function endsWith(target: string): (iterable: string) => boolean;export function endsWith<T>(target: T[], list: T[]): boolean;export function endsWith<T>(target: T[]): (list: T[]) => boolean;
/*Method: equals
Explanation: It deeply compares `x` and `y` and returns `true` if they are equal.
Example:
```R.equals( [1, {a:2}, [{b: 3}]], [1, {a:2}, [{b: 3}]]) // => true```
Categories: Logic
Notes: It doesn't handle cyclical data structures and functions
*/// @SINGLE_MARKERexport function equals<T>(x: T, y: T): boolean;export function equals<T>(x: T): (y: T) => boolean;
/*Method: F
Explanation:
Example:
```F() // => false```
Categories:
Notes:
*/// @SINGLE_MARKERexport function F(): boolean;
/*Method: filter
Explanation: It filters list or object `input` using a `predicate` function.
Example:
```const list = [3, 4, 3, 2]const listPredicate = x => x > 2
const object = {abc: 'fo', xyz: 'bar', baz: 'foo'}const objectPredicate = (x, prop) => x.length + prop.length > 5
const result = [ R.filter(listPredicate, list), R.filter(objectPredicate, object)]// => [ [3, 4], { xyz: 'bar', baz: 'foo'} ]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function filter<T>(predicate: Predicate<T>): (input: T[]) => T[];export function filter<T>(predicate: Predicate<T>, input: T[]): T[];export function filter<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filter<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: find
Explanation: It returns the first element of `list` that satisfy the `predicate`.
If there is no such element, it returns `undefined`.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 'bar'}, {foo: 1}]
const result = R.find(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function find<T>(predicate: (x: T) => boolean, list: T[]): T | undefined;export function find<T>(predicate: (x: T) => boolean): (list: T[]) => T | undefined;
/*Method: findIndex
Explanation: It returns the index of the first element of `list` satisfying the `predicate` function.
If there is no such element, then `-1` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 'bar'}, {foo: 1}]
const result = R.findIndex(predicate, list)// => 1```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findIndex<T>(predicate: (x: T) => boolean, list: T[]): number;export function findIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
/*Method: findLast
Explanation: It returns the last element of `list` satisfying the `predicate` function.
If there is no such element, then `undefined` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 0}, {foo: 1}]
const result = R.findLast(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findLast<T>(fn: (x: T) => boolean, list: T[]): T | undefined;export function findLast<T>(fn: (x: T) => boolean): (list: T[]) => T | undefined;
/*Method: findLastIndex
Explanation: It returns the index of the last element of `list` satisfying the `predicate` function.
If there is no such element, then `-1` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 0}, {foo: 1}]
const result = R.findLastIndex(predicate, list)// => 1```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findLastIndex<T>(predicate: (x: T) => boolean, list: T[]): number;export function findLastIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
/*Method: flatten
Explanation: It deeply flattens an array.
Example:
```const result = R.flatten([ 1, 2, [3, 30, [300]], [4]])// => [ 1, 2, 3, 30, 300, 4 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function flatten<T>(list: any[]): T[];
/*Method: flip
Explanation: It returns function which calls `fn` with exchanged first and second argument.
Example:
```const subtractFlip = R.flip(R.subtract)
const result = [ subtractFlip(1,7), R.subtract(1, 6)] // => [6, -6]```
Categories: Function
Notes: Rambda's **flip** will throw if the arity of the input function is greater or equal to 5.
*/// @SINGLE_MARKERexport function flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
/*Method: forEach
Explanation: It applies `iterable` function over all members of `list` and returns `list`.
Example:
```const sideEffect = {}const result = R.forEach( x => sideEffect[`foo${x}`] = x)([1, 2])
sideEffect // => {foo1: 1, foo2: 2}result // => [1, 2]```
Categories: List, Object
Notes: It works with objects, unlike `Ramda`.
*/// @SINGLE_MARKERexport function forEach<T>(fn: Iterator<T, void>, list: T[]): T[];export function forEach<T>(fn: Iterator<T, void>): (list: T[]) => T[];export function forEach<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;export function forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
/*Method: fromPairs
Explanation: It transforms a `listOfPairs` to an object.
Example:
```const listOfPairs = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]const expected = { a : 1, b : 2, c : [ 3, 4 ],}
const result = R.fromPairs(listOfPairs)// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function fromPairs<V>(listOfPairs: ([number, V])[]): { [index: number]: V };export function fromPairs<V>(listOfPairs: ([string, V])[]): { [index: string]: V };
/*Method: groupBy
Explanation: It splits `list` according to a provided `groupFn` function and returns an object.
Example:
```const list = [ 'a', 'b', 'aa', 'bb' ]const groupFn = x => x.length
const result = R.groupBy(groupFn, list)// => { '1': ['a', 'b'], '2': ['aa', 'bb'] }```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function groupBy<T>(groupFn: (x: T) => string, list: T[]): { [index: string]: T[] };export function groupBy<T>(groupFn: (x: T) => string): (list: T[]) => { [index: string]: T[] };export function groupBy<T, U>(groupFn: (x: T) => string, list: T[]): U;export function groupBy<T, U>(groupFn: (x: T) => string): (list: T[]) => U;
/*Method: groupWith
Explanation: It returns separated version of list or string `input`, where separation is done with equality `compareFn` function.
Example:
```const compareFn = (x, y) => x === yconst list = [1, 2, 2, 1, 1, 2]
const result = R.groupWith(isConsecutive, list)// => [[1], [2,2], [1,1], [2]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function groupWith<T>(compareFn: (x: T, y: T) => boolean): (input: T[]) => (T[])[];export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: T[]): (T[])[];export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: string): string[];
/*Method: has
Explanation: It returns `true` if `obj` has property `prop`.
Example:
```const obj = {a: 1}
const result = [ R.has('a', obj), R.has('b', obj)]// => [true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function has<T>(prop: string, obj: T): boolean;export function has(prop: string): <T>(obj: T) => boolean;
/*Method: hasPath
Explanation: It will return true, if `input` object has truthy `path`(calculated with `R.path`).
Example:
```const path = 'a.b'const pathAsArray = ['a', 'b']const obj = {a: {b: []}}
const result = [ R.hasPath(path, obj), R.hasPath(pathAsArray, obj), R.hasPath('a.c', obj),]// => [true, true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function hasPath<T>( path: string | string[], input: object): boolean;export function hasPath<T>( path: string | string[]): (input: object) => boolean;
/*Method: head
Explanation: It returns the first element of list or string `input`.
Example:
```const result = [ R.head([1, 2, 3]), R.head('foo') ]// => [1, 'f']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function head(input: string): string;export function head(emptyList: []): undefined;export function head<T>(input: T[]): T | undefined;
/*Method: identical
Explanation: It returns `true` if its arguments `a` and `b` are identical.
Otherwise, it returns `false`.
Example:
```const objA = {a: 1};const objB = {a: 1};R.identical(objA, objA); // => trueR.identical(objA, objB); // => falseR.identical(1, 1); // => trueR.identical(1, '1'); // => falseR.identical([], []); // => falseR.identical(0, -0); // => falseR.identical(NaN, NaN); // => true```
Categories: Logic
Notes: Values are identical if they reference the same memory. `NaN` is identical to `NaN`; `0` and `-0` are not identical.
*/// @SINGLE_MARKERexport function identical<T>(x: T, y: T): boolean;export function identical<T>(x: T): (y: T) => boolean;
/*Method: identity
Explanation: It just passes back the supplied `input` argument.
Example:
```R.identity(7) // => 7```
Categories:
Notes: Logic
*/// @SINGLE_MARKERexport function identity<T>(input: T): T;
/*Method: ifElse
Explanation: It expects `condition`, `onTrue` and `onFalse` functions as inputs and it returns a new function with example name of `fn`.
When `fn`` is called with `input` argument, it will return either `onTrue(input)` or `onFalse(input)` depending on `condition(input)` evaluation.
Example:
```const fn = R.ifElse( x => x>10, x => x*2, x => x*10)
const result = [ fn(8), fn(18) ]// => [80, 36]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function ifElse<TArgs extends any[], TOnTrueResult, TOnFalseResult>(fn: (...args: TArgs) => boolean, onTrue: (...args: TArgs) => TOnTrueResult, onFalse: (...args: TArgs) => TOnFalseResult): (...args: TArgs) => TOnTrueResult | TOnFalseResult;
/*Method: inc
Explanation: It increments a number.
Example:
```R.inc(1) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function inc(x: number): number;
/*Method: includes
Explanation: If `input` is string, then this method work as native `String.includes`.
If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
Example:
```const result = [ R.includes('oo', 'foo'), R.includes({a: 1}, [{a: 1}])]// => [true, true ]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function includes(valueToFind: string, input: string[] | string): boolean;export function includes(valueToFind: string): (input: string[] | string) => boolean;export function includes<T>(valueToFind: T, input: T[]): boolean;export function includes<T>(valueToFind: T): (input: T[]) => boolean;
/*Method: indexBy
Explanation: It generates object with properties provided by `condition` and values provided by `list` array.
If `condition` is a function, then all list members are passed through it.
If `condition` is a string, then all list members are passed through `R.path(condition)`.
Example:
```const list = [ {id: 10}, {id: 20} ]
const withFunction = R.indexBy( x => x.id, list)const withString = R.indexBy( 'id', list)const result = [ withFunction, R.equals(withFunction, withString)]// => [ { 10: {id: 10}, 20: {id: 20} }, true ]```
Categories: List Notes:
*/// @SINGLE_MARKERexport function indexBy<T, K extends string | number = string>(condition: (key: T) => K, list: T[]): { [key in K]: T };export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K, list: T[]): { [key in NonNullable<K>]?: T };export function indexBy<T, K extends string | number = string>(condition: (key: T) => K): (list: T[]) => { [key in K]: T };export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K | undefined): (list: T[]) => { [key in NonNullable<K>]?: T };export function indexBy<T>(condition: string, list: T[]): { [key: string]: T };export function indexBy<T>(condition: string): (list: T[]) => { [key: string]: T };
/*Method: indexOf
Explanation: It returns the index of the first element of `list` equals to `valueToFind`.
If there is no such element, it returns `-1`.
Example:
```const list = [0, 1, 2, 3]
const result = [ R.indexOf(2, list), R.indexOf(0, list)]// => [2, -1]```
Categories: List
Notes: It uses `R.equals` for list of objects/arrays or native `indexOf` for any other case.
*/// @SINGLE_MARKERexport function indexOf<T>(valueToFind: T, list: T[]): number;export function indexOf<T>(valueToFind: T): (list: T[]) => number;
/*Method: init
Explanation: It returns all but the last element of list or string `input`.
Example:
```const result = [ R.init([1, 2, 3]) , R.init('foo') // => 'fo']// => [[1, 2], 'fo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function init<T>(input: T[]): T[];export function init(input: string): string;
/*Method: intersection
Explanation: It loops throw `listA` and `listB` and returns the intersection of the two according to `R.equals`.
Example:
```const listA = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]const listB = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]
const result = intersection(listA, listB)// => [{ id : 3 }, { id : 4 }]```
Categories: List
*/// @SINGLE_MARKERexport function intersection<T>(listA: T[], listB: T[]): T[];export function intersection<T>(listA: T[]): (listB: T[]) => T[];
/*Method: intersperse
Explanation: It adds a `separator` between members of `list`.
Example:
```const list = [ 0, 1, 2, 3 ]const separator = '|'const result = intersperse(separator, list)// => [0, '|', 1, '|', 2, '|', 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function intersperse<T>(separator: T, list: T[]): T[];export function intersperse<T>(separator: T): (list: T[]) => T[];
/*Method: is
Explanation: It returns `true` if `x` is instance of `targetPrototype`.
Example:
```const result = [ R.is(String, 'foo'), R.is(Array, 1)]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function is<C extends () => any>(targetPrototype: C, val: any): val is ReturnType<C>;export function is<C extends new () => any>(targetPrototype: C, val: any): val is InstanceType<C>;export function is<C extends () => any>(targetPrototype: C): (val: any) => val is ReturnType<C>;export function is<C extends new () => any>(targetPrototype: C): (val: any) => val is InstanceType<C>;
/*Method: isEmpty
Explanation: It returns `true` if `x` is `empty`.
Example:
```const result = [ R.isEmpty(''), R.isEmpty({ x : 0 })]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isEmpty<T>(x: T): boolean;
/*Method: isNil
Explanation: It returns `true` if `x` is either `null` or `undefined`.
Example:
```const result = [ R.isNil(null), R.isNil(1),]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isNil(x: any): x is null | undefined;
/*Method: join
Explanation: It returns a string of all `list` instances joined with a `glue`.
Example:
```R.join('-', [1, 2, 3]) // => '1-2-3'```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function join<T>(glue: string, list: T[]): string;export function join<T>(glue: string): (list: T[]) => string;
/*Method: keys
Explanation: It applies `Object.keys` over `x` and returns its keys.
Example:
```R.keys({a:1, b:2}) // => ['a', 'b']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function keys<T extends object>(x: T): (keyof T)[];export function keys<T>(x: T): string[];
/*Method: last
Explanation: It returns the last element of `input`, as the `input` can be either a string or an array.
Example:
```const result = [ R.last([1, 2, 3]), R.last('foo'),]// => [3, 'o']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function last(str: string): string;export function last(emptyList: []): undefined;export function last<T extends any>(list: T[]): T | undefined;
/*Method: lastIndexOf
Explanation: It returns the last index of `target` in `list` array.
`R.equals` is used to determine equality between `target` and members of `list`.
If there is no such index, then `-1` is returned.
Example:
```const list = [1, 2, 3, 1, 2, 3]const result = [ R.lastIndexOf(2, list), R.lastIndexOf(4, list),]// => [4, -1]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function lastIndexOf<T>(target: T, list: T[]): number;export function lastIndexOf<T>(target: T): (list: T[]) => number;
/*Method: length
Explanation: It returns the `length` property of list or string `input`.
Example:
```const result = [ R.length([1, 2, 3, 4]), R.length('foo'),]// => [4, 3]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function length<T>(input: T[]): number;
/*Method: lens
Explanation: It returns a `lens` for the given `getter` and `setter` functions.
The `getter` **gets** the value of the focus; the `setter` **sets** the value of the focus.
The setter should not mutate the data structure.
Example:
```const xLens = R.lens(R.prop('x'), R.assoc('x'));
R.view(xLens, {x: 1, y: 2}) // => 1R.set(xLens, 4, {x: 1, y: 2}) // => {x: 4, y: 2}R.over(xLens, R.negate, {x: 1, y: 2}) // => {x: -1, y: 2}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lens<T, U, V>(getter: (s: T) => U, setter: (a: U, s: T) => V): Lens;
/*Method: lensIndex
Explanation: It returns a lens that focuses on specified `index`.
Example:
```const list = ['a', 'b', 'c']const headLens = R.lensIndex(0)
R.view(headLens, list) // => 'a'R.set(headLens, 'x', list) // => ['x', 'b', 'c']R.over(headLens, R.toUpper, list) // => ['A', 'b', 'c']```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensIndex(index: number): Lens;
/*Method: lensPath
Explanation: It returns a lens that focuses on specified `path`.
Example:
```const lensPath = R.lensPath(['x', 0, 'y'])const input = {x: [{y: 2, z: 3}, {y: 4, z: 5}]}
R.view(lensPath, input) // => 2
R.set(lensPath, 1, input) // => {x: [{y: 1, z: 3}, {y: 4, z: 5}]}
R.over(xHeadYLens, R.negate, input) // => {x: [{y: -2, z: 3}, {y: 4, z: 5}]}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensPath(path: RamdaPath): Lens;export function lensPath(path: string): Lens;
/*Method: lensProp
Explanation: It returns a lens that focuses on specified property `prop`.
Example:
```const xLens = R.lensProp('x');const input = {x: 1, y: 2}
R.view(xLens, input) // => 1
R.set(xLens, 4, input) // => {x: 4, y: 2}
R.over(xLens, R.negate, input) // => {x: -1, y: 2}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensProp(prop: string): { <T, U>(obj: T): U; set<T, U, V>(val: T, obj: U): V;};
/*Method: over
Explanation: It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
Example:
```const headLens = R.lensIndex(0) R.over(headLens, R.toUpper, ['foo', 'bar', 'baz']) // => ['FOO', 'bar', 'baz']```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function over<T>(lens: Lens, fn: Arity1Fn, value: T): T;export function over<T>(lens: Lens, fn: Arity1Fn, value: T[]): T[];export function over(lens: Lens, fn: Arity1Fn): <T>(value: T) => T;export function over(lens: Lens, fn: Arity1Fn): <T>(value: T[]) => T[];export function over(lens: Lens): <T>(fn: Arity1Fn, value: T) => T;export function over(lens: Lens): <T>(fn: Arity1Fn, value: T[]) => T[];
/*Method: set
Explanation: It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
Example:
```const input = {x: 1, y: 2}const xLens = R.lensProp('x')
const result = [ R.set(xLens, 4, input), R.set(xLens, 8, input) ]// => [{x: 4, y: 2}, {x: 8, y: 2}]```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function set<T, U>(lens: Lens, replacer: U, obj: T): T;export function set<U>(lens: Lens, replacer: U): <T>(obj: T) => T;export function set(lens: Lens): <T, U>(replacer: U, obj: T) => T;
/*Method: view
Explanation: It returns the value of `lens` focus over `target` object.
Example:
```const lens = R.lensProp('x')
R.view(lens, {x: 1, y: 2}) // => 1R.view(lens, {x: 4, y: 2}) // => 4```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function view<T, U>(lens: Lens): (target: T) => U;export function view<T, U>(lens: Lens, target: T): U;
/*Method: map
Explanation: It returns the result of looping through `iterable` with `fn`.
It works with both array and object.
Example:
```const fn = x => x * 2const fnWhenObject = (val, prop)=>{ return `${prop}-${val}`}
const iterable = [1, 2]const obj = {a: 1, b: 2}
const result = [ R.map(fn, list), R.map(fnWhenObject, obj)]// => [ [1, 4], {a: 'a-1', b: 'b-2'}] ```
Categories: List, Object
Notes: Unlike Ramda's `map`, here property and input object are passed as arguments to `fn`, when `iterable` is an object.
*/// @SINGLE_MARKERexport function map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function map<T, U>(fn: Iterator<T, U>, iterable: T[]): U[];export function map<T, U>(fn: Iterator<T, U>): (iterable: T[]) => U[];export function map<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;export function map<T>(fn: Iterator<T, T>): (iterable: T[]) => T[];export function map<T>(fn: Iterator<T, T>, iterable: T[]): T[];
/*Method: mapObjIndexed
Explanation: It works the same way as `R.map` does for objects. It is added as Ramda also has this method.
Example:
```const fn = (val, prop) => { return `${prop}-${val}`}
const obj = {a: 1, b: 2}
const result = R.map(mapObjIndexed, obj)// => {a: 'a-1', b: 'b-2'}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapObjIndexed<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
/*Method: match
Explanation: Curried version of `String.prototype.match` which returns empty array, when there is no match.
Example:
```const result = [ R.match('a', 'foo'), R.match(/([a-z]a)/g, 'bananas')]// => [[], ['ba', 'na', 'na']]```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function match(regExpression: RegExp, str: string): string[];export function match(regExpression: RegExp): (str: string) => string[];
/*Method: mathMod
Explanation: `R.mathMod` behaves like the modulo operator should mathematically, unlike the `%` operator (and by extension, `R.modulo`). So while `-17 % 5` is `-2`, `mathMod(-17, 5)` is `3`.
Example:
```const result = [ R.mathMod(-17, 5), R.mathMod(17, 5), R.mathMod(17, -5), R.mathMod(17, 0) ]// => [3, 2, NaN, NaN]```
Categories: Number
Notes: Explanation is taken from `Ramda` documentation site.
*/// @SINGLE_MARKERexport function mathMod(x: number, y: number): number;export function mathMod(x: number): (y: number) => number;
/*Method: max
Explanation: It returns the greater value between `x` and `y`.
Example:
```const result = [ R.max(5, 7), R.max('bar', 'foo'), ]// => [7, 'foo']```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function max<T extends Ord>(x: T, y: T): T;export function max<T extends Ord>(x: T): (y: T) => T;
/*Method: maxBy
Explanation: It returns the greater value between `x` and `y` according to `compareFn` function.
Example:
```const compareFn = Math.abs
R.maxBy(compareFn, 5, -7) // => -7```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function maxBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;export function maxBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;export function maxBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;
/*Method: mean
Explanation: It returns the mean value of `list` input.
Example:
```R.mean([ 2, 7 ])// => 4.5```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mean(list: number[]): number;
/*Method: median
Explanation: It returns the median value of `list` input.
Example:
```R.median([ 7, 2, 10, 9 ]) // => 8```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function median(list: number[]): number;
/*Method: merge
Explanation: It creates a copy of `target` object with overidden `newProps` properties.
Example:
```const target = { 'foo': 0, 'bar': 1 }const newProps = { 'foo': 7 }
const result = R.merge(target, newProps)// => { 'foo': 7, 'bar': 1 }```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function merge<A, B>(target: A, newProps: B): A & Bexport function merge<Output>(target: any): (newProps: any) => Output;
/*Method: mergeAll
Explanation: It merges all objects of `list` array sequentially and returns the result.
Example:
```const list = [ {a: 1}, {b: 2}, {c: 3}]const result = R.mergeAll(list)const expected = { a: 1, b: 2, c: 3}// => `result` is equal to `expected````
Categories:
Notes:
*/// @SINGLE_MARKERexport function mergeAll<T>(list: object[]): T;export function mergeAll(list: object[]): object;
/*Method: mergeDeepRight
Explanation: Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
- and both values are objects, the two values will be recursively merged - otherwise the value from the second object will be used.Example:
```const x = { name: 'fred', age: 10, contact: { email: 'moo@example.com' }}const y = { age: 40, contact: { email: 'baa@example.com' }}
const result = R.mergeDeepRight(x, y)const expected = { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}// => `result` is equal to `expected````
Categories: Object
Notes: Explanation and example are taken from `Ramda` documentation.
*/// @SINGLE_MARKERexport function mergeDeepRight<Output>(target: object, newProps: object): Output;export function mergeDeepRight<Output>(target: object): (newProps: object) => Output;

/*Method: mergeLeft
Explanation: Same as `R.merge`, but in opposite direction.
Example:
```const result = R.mergeLeft( {a: 10}, {a: 1, b: 2})// => {a:10, b: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mergeLeft<Output>(newProps: object, target: object): Output;export function mergeLeft<Output>(newProps: object): (target: object) => Output;
/*Method: min
Explanation: It returns the lesser value between `x` and `y`.
Example:
```const result = [ R.min(5, 7), R.min('bar', 'foo'), ]// => [5, 'bar']```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function min<T extends Ord>(x: T, y: T): T;export function min<T extends Ord>(x: T): (y: T) => T;
/*Method: minBy
Explanation: It returns the lesser value between `x` and `y` according to `compareFn` function.
Example:
```const compareFn = Math.abs
R.minBy(compareFn, -5, 2) // => -5```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function minBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;export function minBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;export function minBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;

/*Method: modulo
Explanation: Curried version of `x%y`.
Example:
```R.modulo(17, 3) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function modulo(x: number, y: number): number;export function modulo(x: number): (y: number) => number;
/*Method: move
Explanation: It returns a copy of `list` with exchanged `fromIndex` and `toIndex` elements.
Example:
```const list = [1, 2, 3]const result = R.move(0, 1, list)// => [2, 1, 3]```
Categories: List
Notes: Rambda.move doesn't support negative indexes - it throws an error.
*/// @SINGLE_MARKERexport function move<T>(fromIndex: number, toIndex: number, list: T[]): T[];export function move(fromIndex: number, toIndex: number): <T>(list: T[]) => T[];export function move(fromIndex: number): { <T>(toIndex: number, list: T[]): T[]; (toIndex: number): <T>(list: T[]) => T[];};
/*Method: multiply
Explanation: Curried version of `x*y`.

Example:
```R.multiply(2, 4) // => 8```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function multiply(x: number, y: number): number;export function multiply(x: number): (y: number) => number;
/*Method: negate
Explanation:
Example:
```R.negate(420)// => -420```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function negate(x: number): number;
/*Method: none
Explanation: It returns `true`, if all members of array `list` returns `false`, when applied as argument to `predicate` function.
Example:
```const list = [ 0, 1, 2, 3, 4 ]const predicate = x => x > 6
const result = R.none(predicate, arr)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function none<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function none<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: not
Explanation: It returns a boolean negated version of `input`.
Example:
```R.not(false) // true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function not(input: any): boolean;

/*Method: nth
Explanation: Curried version of `list[index]`.
Example:
```const list = [1, 2, 3]const str = 'foo'
const result = [ R.nth(2, list), R.nth(6, list), R.nth(0, str),]// => [3, undefined, 'f']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function nth<T>(index: number, list: T[]): T | undefined; export function nth(index: number): <T>(list: T[]) => T | undefined;
/*Method: objOf
Explanation: It creates an object with a single key-value pair.
Example:
```const result = R.objOf('foo', 'bar')// => {foo: 'bar'}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function objOf<T, K extends string>(key: K, value: T): Record<K, T>;export function objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
/*Method: once
Explanation: It returns a function, which invokes only once `fn` function.
Example:
```let result = 0const addOnce = R.once((x) => result = result + x)
addOnce(1)addOnce(1)// => 1```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function once<T extends (...args: any[]) => any>(func: T): T;
/*Method: omit
Explanation: It returns a partial copy of an `obj` without `propsToOmit` properties.
Example:
```const obj = {a: 1, b: 2, c: 3}const propsToOmit = 'a,c,d'const propsToOmitList = ['a', 'c', 'd']
const result = [ R.omit(propsToOmit, obj), R.omit(propsToOmitList, obj) ]// => [{b: 2}, {b: 2}]```
Categories: Object
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToOmit` as an array. If passing a string, you will need to explicitly declare the output type.
*/// @SINGLE_MARKERexport function omit<T, K extends string>(propsToOmit: K[], obj: T): Omit<T, K>;export function omit<K extends string>(propsToOmit: K[]): <T>(obj: T) => Omit<T, K>;export function omit<T, U>(propsToOmit: string, obj: T): U;export function omit<T, U>(propsToOmit: string): (obj: T) => U;export function omit<T>(propsToOmit: string, obj: object): T;export function omit<T>(propsToOmit: string): (obj: object) => T;
/*Method: of
Explanation:
Example:
```R.of(null); // => [null]R.of([42]); // => [[42]]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function of<T>(x: T): T[];
/*Method: partial
Explanation: It is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.
`R.partial` will keep returning a function until all the arguments that the function `fn` expects are passed.The name comes from the fact that you partially inject the inputs.
Example:
```const fn = (title, firstName, lastName) => { return title + ' ' + firstName + ' ' + lastName + '!'}
const canPassAnyNumberOfArguments = R.partial(fn, 'Hello')const ramdaStyle = R.partial(fn, ['Hello'])
const finalFn = canPassAnyNumberOfArguments('Foo')
finalFn('Bar') // => 'Hello, Foo Bar!'```
Categories: Logic
Notes: Rambda's partial doesn't need the input arguments to be wrapped as array.
*/// @SINGLE_MARKERexport function partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0, V1]): (x2: V2) => T;export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0]): (x1: V1, x2: V2) => T;export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1, V2]): (x2: V3) => T;export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1]): (x2: V2, x3: V3) => T;export function partial<V0, V1, V2, V3, T>(fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0]): (x1: V1, x2: V2, x3: V3) => T;export function partial<T>(fn: (...a: any[]) => T, args: any[]): (...x: any[]) => T;
/*Method: partition
Explanation: It will return array of two objects/arrays according to `predicate` function. The first member holds all instances of `input` that pass the `predicate` function, while the second member - those who doesn't.
Example:
```const list = [1, 2, 3]const obj = {a: 1, b: 2, c: 3}const predicate = x => x > 2
const result = [ R.partition(predicate, list), R.partition(predicate, obj)]const expected = [ [[3], [1, 2]], [{c: 3}, {a: 1, b: 2}],]// `result` is equal to `expected````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function partition<T>( predicate: Predicate<T>, input: T[]): [T[], T[]];export function partition<T>( predicate: Predicate<T>): (input: T[]) => [T[], T[]];export function partition<T>( predicate: (x: T, prop?: string) => boolean, input: { [key: string]: T}): [{ [key: string]: T}, { [key: string]: T}];export function partition<T>( predicate: (x: T, prop?: string) => boolean): (input: { [key: string]: T}) => [{ [key: string]: T}, { [key: string]: T}];
/*Method: path
Explanation: If `pathToSearch` is `'a.b'` then it will return `1` if `obj` is `{a:{b:1}}`.
It will return `undefined`, if such path is not found.
Example:
```const obj = {a: {b: 1}}const pathToSearch = 'a.b'const pathToSearchList = ['a', 'b']
const result = [ R.path(pathToSearch, obj), R.path(pathToSearchList, obj), R.path('a.b.c.d', obj)]// => [1, 1, undefined]```
Categories: Object
Notes: String anotation of `pathToSearch` is one of the differences between `Rambda` and `Ramda`.
*/// @SINGLE_MARKERexport function path<Input, T>(pathToSearch: Path, obj: Input): T | undefined;export function path<T>(pathToSearch: Path, obj: any): T | undefined;export function path<T>(pathToSearch: Path): (obj: any) => T | undefined;export function path<Input, T>(pathToSearch: Path): (obj: Input) => T | undefined;
/*Method: pathEq
Explanation: It returns `true` if `pathToSearch` of `input` object is equal to `target` value.
`pathToSearch` is passed to `R.path`, which means that it can be either a string or an array. Also equality between `target` and the found value is determined by `R.equals`.
Example:
```const path = 'a.b'const target = {c: 1}const input = {a: {b: {c: 1}}}
const result = R.pathEq( path, target, input)// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function pathEq(pathToSearch: Path, target: any, input: any): boolean;export function pathEq(pathToSearch: Path, target: any): (input: any) => boolean;export function pathEq(pathToSearch: Path): (target: any) => (input: any) => boolean;
/*Method: paths
Explanation: It loops over members of `pathsToSearch` as `singlePath` and returns the array produced by `R.path(singlePath, obj)`.
Because it calls `R.path`, then `singlePath` can be either string or a list.
Example:
```const obj = { a : { b : { c : 1, d : 2 } }}
const result = R.paths([ 'a.b.c', 'a.b.d', 'a.b.c.d.e',], obj)// => [1, 2, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function paths<Input, T>(pathsToSearch: Path[], obj: Input): (T | undefined)[];export function paths<Input, T>(pathsToSearch: Path[]): (obj: Input) => (T | undefined)[];export function paths<T>(pathsToSearch: Path[], obj: any): (T | undefined)[];export function paths<T>(pathsToSearch: Path[]): (obj: any) => (T | undefined)[];
/*Method: pathOr
Explanation: It reads `obj` input and returns either `R.path(pathToSearch, obj)` result or `defaultValue` input.
Example:
```const defaultValue = 'DEFAULT_VALUE'const pathToSearch = 'a.b'const pathToSearchList = ['a', 'b']
const obj = { a : { b : 1 }}
const result = [ R.pathOr(DEFAULT_VALUE, pathToSearch, obj), R.pathOr(DEFAULT_VALUE, pathToSearchList, obj), R.pathOr(DEFAULT_VALUE, 'a.b.c', obj)]// => [1, 1, 'DEFAULT_VALUE']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;export function pathOr<T>(defaultValue: T, pathToSearch: Path): (obj: any) => T;export function pathOr<T>(defaultValue: T): (pathToSearch: Path) => (obj: any) => T;
/*Method: pick
Explanation: It returns a partial copy of an `input` containing only `propsToPick` properties.
`input` can be either an object or an array.
String anotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
Example:
```const obj = { a : 1, b : false, foo: 'cherry'}const list = [1, 2, 3, 4]const propsToPick = 'a,foo'const propsToPickList = ['a', 'foo']
const result = [ R.pick(propsToPick, obj), R.pick(propsToPickList, obj), R.pick('a,bar', obj), R.pick('bar', obj), R.pick([0, 3, 5], list), R.pick('0,3,5', list),]
const expected = [ {a:1, foo: 'cherry'}, {a:1, foo: 'cherry'}, {a:1}, {}, {0: 1, 3: 4}, {0: 1, 3: 4},]// => `result` is equal to `expected````
Categories: Object, List
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.*/// @SINGLE_MARKERexport function pick<T, K extends string | number | symbol>(propsToPick: K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;export function pick<K extends string | number | symbol>(propsToPick: K[]): <T>(input: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;export function pick<T, U>(propsToPick: string, input: T): U;export function pick<T, U>(propsToPick: string): (input: T) => U;export function pick<T>(propsToPick: string, input: object): T;export function pick<T>(propsToPick: string): (input: object) => T;
/*Method: pickAll
Explanation: Same as `R.pick` but it won't skip the missing props, i.e. it will assign them to `undefined`.
Example:
```const obj = { a : 1, b : false, foo: 'cherry'}const propsToPick = 'a,foo,bar'const propsToPickList = ['a', 'foo', 'bar']
const result = [ R.pickAll(propsToPick, obj), R.pickAll(propsToPickList, obj), R.pickAll('a,bar', obj), R.pickAll('bar', obj),]const expected = [ {a:1, foo: 'cherry', bar: undefined}, {a:1, foo: 'cherry', bar: undefined}, {a:1, bar: undefined}, {bar: undefined}]// => `result` is equal to `expected````
Categories: Object
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.
*/// @SINGLE_MARKERexport function pickAll<T, U>(propsToPick: string[], input: T): U;export function pickAll<T, U>(propsToPick: string[]): (input: T) => U;export function pickAll<T, U>(propsToPick: string, input: T): U;export function pickAll<T, U>(propsToPick: string): (input: T) => U;
/*Method: pipe
Explanation: It performs left-to-right function composition.
Example:
```const result = R.pipe( R.filter(val => val > 2), R.map(a => a * 2))([1, 2, 3, 4])
// => [6, 8]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( ...funcs: [ f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...func: Array<(a: any) => any>, fnLast: (a: any) => TResult ]): (...args: TArgs) => TResult; // fallback overload if number of piped functions greater than 7export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (...args: TArgs) => R7;export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (...args: TArgs) => R6;export function pipe<TArgs extends any[], R1, R2, R3, R4, R5>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (...args: TArgs) => R5;export function pipe<TArgs extends any[], R1, R2, R3, R4>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (...args: TArgs) => R4;export function pipe<TArgs extends any[], R1, R2, R3>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (...args: TArgs) => R3;export function pipe<TArgs extends any[], R1, R2>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2): (...args: TArgs) => R2;export function pipe<TArgs extends any[], R1>( f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
/*Method: pluck
Explanation: It returns list of the values of `property` taken from the all objects inside `list`.
Example:
```const list = [{a: 1}, {a: 2}, {b: 3}]const property = 'a'
const result = R.pluck(property, list) // => [1, 2]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function pluck<K extends keyof T, T>(property: K, list: T[]): T[K][];export function pluck<T>(property: number, list: { [k: number]: T }[]): T[];export function pluck<P extends string>(property: P): <T>(list: Record<P, T>[]) => T[];export function pluck(property: number): <T>(list: { [k: number]: T }[]) => T[];
/*Method: prepend
Explanation: It adds element `x` at the beginning of `list`.
Example:
```const result = R.prepend('foo', ['bar', 'baz'])// => ['foo', 'bar', 'baz']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function prepend<T>(x: T, input: T[]): T[];export function prepend<T>(x: T): (input: T[]) => T[];
/*Method: product
Explanation:
Example:
```R.product([ 2, 3, 4 ])// => 24)```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function product(list: number[]): number;
/*Method: prop
Explanation: It returns the value of property `propToFind` in `obj`.
If there is no such property, it returns `undefined`.
Example:
```const result = [ R.prop('x', {x: 100}), R.prop('x', {a: 1}) ]// => [100, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function prop<P extends keyof T, T>(propToFind: P, obj: T): T[P];export function prop<P extends string | number>(p: P): <T>(propToFind: Record<P, T>) => T;export function prop<P extends keyof T, T>(p: P): (propToFind: Record<P, T>) => T;
/*Method: propEq
Explanation: It returns true if `obj` has property `propToFind` and its value is equal to `valueToMatch`.
Example:
```const obj = { foo: 'bar' }const secondObj = { foo: 1 }
const propToFind = 'foo'const valueToMatch = 'bar'
const result = [ R.propEq(propToFind, valueToMatch, obj), R.propEq(propToFind, valueToMatch, secondObj)]// => [true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propEq<K extends string | number>(propToFind: K, valueToMatch: any, obj: Record<K, any>): boolean;export function propEq<K extends string | number>(propToFind: K, valueToMatch: any): (obj: Record<K, any>) => boolean;export function propEq<K extends string | number>(propToFind: K): { (valueToMatch: any, obj: Record<K, any>): boolean; (valueToMatch: any): (obj: Record<K, any>) => boolean;};
/*Method: propIs
Explanation: It returns `true` if `property` of `obj` is from `target` type.
Example:
```const obj = {a:1, b: 'foo'}
const result = [ R.propIs(Number, 'a', obj), R.propIs(String, 'b', obj), R.propIs(Number, 'b', obj),]// => [true, true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propIs<C extends (...args: any[]) => any, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;export function propIs<C extends new (...args: any[]) => any, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, InstanceType<C>>;export function propIs<C extends (...args: any[]) => any, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, ReturnType<C>>;export function propIs<C extends new (...args: any[]) => any, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, InstanceType<C>>;export function propIs<C extends (...args: any[]) => any>(type: C): { <K extends keyof any>(name: K, obj: any): obj is Record<K, ReturnType<C>>; <K extends keyof any>(name: K): (obj: any) => obj is Record<K, ReturnType<C>>;};export function propIs<C extends new (...args: any[]) => any>(type: C): { <K extends keyof any>(name: K, obj: any): obj is Record<K, InstanceType<C>>; <K extends keyof any>(name: K): (obj: any) => obj is Record<K, InstanceType<C>>;};
/*Method: propOr
Explanation: It returns either `defaultValue` or the value of `property` in `obj`.
Example:
```const obj = {a: 1}const defaultValue = 'DEFAULT_VALUE'const property = 'a'
const result = [ R.propOr(defaultValue, property, obj), R.propOr(defaultValue, 'foo', obj)]// => [1, 'DEFAULT_VALUE']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>> | undefined) => T;export function propOr<T>(defaultValue: T): { <P extends string>(property: P, obj: Partial<Record<P, T>> | undefined): T; <P extends string>(property: P): (obj: Partial<Record<P, T>> | undefined) => T;}
/*Method: range
Explanation: It returns list of numbers between `startInclusive` to `endExclusive` markers.
Example:
```R.range(0, 5)// => [0, 1, 2, 3, 4]```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function range(startInclusive: number, endExclusive: number): number[];export function range(startInclusive: number): (endExclusive: number) => number[];
/*Method: reduce
Explanation:
Example:
```const list = [1, 2, 3]const initialValue = 10const reducer = (prev, current) => prev * current
const result = R.reduce(reducer, initialValue, list)// => 60```
Categories: List
Notes: It passes index of the list as third argument to `reducer` function.
*/// @SINGLE_MARKERexport function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult, list: T[]): TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T) => TResult, initialValue: TResult, list: T[]): TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i?: number) => TResult): (initialValue: TResult, list: T[]) => TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i?: number) => TResult, initialValue: TResult): (list: T[]) => TResult;
/*Method: reject
Explanation: It has the opposite effect of `R.filter`.
Example:
```const list = [1, 2, 3, 4]const obj = {a: 1, b: 2}const predicate = x => x > 1
const result = [ R.reject(predicate, list), R.reject(predicate, obj)]// => [[1], {a: 1}]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function reject<T>(predicate: Predicate<T>, list: T[]): T[];export function reject<T>(predicate: Predicate<T>): (list: T[]) => T[];export function reject<T>(predicate: Predicate<T>, obj: Dictionary<T>): Dictionary<T>;export function reject<T, U>(predicate: Predicate<T>): (obj: Dictionary<T>) => Dictionary<T>;
/*Method: repeat
Explanation:
Example:
```R.repeat('foo', 3)// => ['foo', 'foo', 'foo']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function repeat<T>(x: T): (timesToRepeat: number) => T[];export function repeat<T>(x: T, timesToRepeat: number): T[];
/*Method: replace Explanation: It replaces `strOrRegex` found in `str` with `replacer`.
Example:
```const strOrRegex = /o/g
const result = R.replace(strOrRegex, '|0|', 'foo')// => 'f|0||0|'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function replace(strOrRegex: RegExp | string, replacer: string, str: string): string;export function replace(strOrRegex: RegExp | string, replacer: string): (str: string) => string;export function replace(strOrRegex: RegExp | string): (replacer: string) => (str: string) => string;
/*Method: reverse
Explanation: It returns a reversed copy of list or string `input`.
Example:
```const result = [ R.reverse('foo'), R.reverse([1, 2, 3])]// => ['oof', [3, 2, 1]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function reverse<T>(input: T[]): T[];export function reverse(input: string): string;
/*Method: slice
Explanation:
Example:
```const list = [0, 1, 2, 3, 4, 5]const str = 'FOO_BAR'const from = 1const to = 4
const result = [ R.slice(from, to, str), R.slice(from, to, list)]// => ['OO_', [1, 2, 3]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function slice(from: number, to: number, input: string): string;export function slice<T>(from: number, to: number, input: T[]): T[];export function slice(from: number, to: number): { (input: string): string; <T>(input: T[]): T[];};export function slice(from: number): { (to: number, input: string): string; <T>(to: number, input: T[]): T[];};
/*Method: sort
Explanation: It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to return only `-1`, `0` or `1`.
Example:
```const list = [ {a: 2}, {a: 3}, {a: 1}]const sortFn = (x, y) => { return x.a > y.a ? 1 : -1}
const result = R.sort(sortFn, list)const expected = [ {a: 1}, {a: 2}, {a: 3}]// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sort<T>(sortFn: (a: T, b: T) => number, list: T[]): T[];export function sort<T>(sortFn: (a: T, b: T) => number): (list: T[]) => T[];
/*Method: sortBy
Explanation: It returns copy of `list` sorted by `sortFn` function, where `sortFn` function returns a value to compare, i.e. it doesn't need to return only `-1`, `0` or `1`.
Example:
```const list = [ {a: 2}, {a: 3}, {a: 1}]const sortFn = x => x.a
const result = R.sortBy(sortFn, list)const expected = [ {a: 1}, {a: 2}, {a: 3}]// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sortBy<T>(sortFn: (a: T) => Ord, list: T[]): T[];export function sortBy<T>(sortFn: (a: T) => Ord): (list: T[]) => T[];export function sortBy(sortFn: (a: any) => Ord): <T>(list: T[]) => T[];
/*Method: split
Explanation: Curried version of `String.prototype.split`
Example:
```const str = 'foo|bar|baz'const separator = '|'const result = R.split(separator, str)// => [ 'foo', 'bar', 'baz' ]```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function split(separator: string | RegExp): (str: string) => string[];export function split(separator: string | RegExp, str: string): string[];
/*Method: splitEvery
Explanation: It splits `input` into slices of `sliceLength`.
Example:
```const result = [ R.splitEvery(2, [1, 2, 3]), R.splitEvery(3, 'foobar') ]
const expected = [ [[1, 2], [3]], ['foo', 'bar']]// => `result` is equal to `expected````
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function splitEvery<T>(sliceLength: number, input: T[]): (T[])[];export function splitEvery(sliceLength: number, input: string): string[];export function splitEvery(sliceLength: number): { (input: string): string[]; <T>(input: T[]): (T[])[];};
/*Method: startsWith
Explanation: When iterable is a string, then it behaves as `String.prototype.startsWith`.When iterable is a list, then it uses R.equals to determine if the target list starts in the same way as the given target.
Example:
```const str = 'foo-bar'const list = [{a:1}, {a:2}, {a:3}]
const result = [ R.startsWith('foo', str), R.startsWith([{a:1}, {a:2}], list)]// => [true, true]```
Categories: String, List
Notes: It doesn't work with arrays unlike its corresponding **Ramda** method.
*/// @SINGLE_MARKERexport function startsWith(target: string, str: string): boolean;export function startsWith(target: string): (str: string) => boolean;export function startsWith<T>(target: T[], list: T[]): boolean;export function startsWith<T>(target: T[]): (list: T[]) => boolean;
/*Method: subtract
Explanation: Curried version of `x - y`
Example:
```const x = 3const y = 1
const result = R.subtract(x, y) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function subtract(x: number, y: number): number;export function subtract(x: number): (y: number) => number;
/*Method: sum
Explanation:
Example:
```R.sum([1, 2, 3, 4, 5]) // => 15```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sum(list: number[]): number;
/*Method: symmetricDifference
Explanation: It returns a merged list of `x` and `y` with all equal elements removed.
`R.equals` is used to determine equality.
Example:
```const x = [ 1, 2, 3, 4 ]const y = [ 3, 4, 5, 6 ]
const result = R.symmetricDifference(x, y)// => [ 1, 2, 5, 6 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function symmetricDifference<T>(x: T[], y: T[]): T[];export function symmetricDifference<T>(x: T[]): <T>(y: T[]) => T[];
/*Method: T
Explanation:


Example:
```R.T() // => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function T(): boolean;
/*Method: tail
Explanation: It returns all but the first element of `input`.
Example:
```const result = [ R.tail([1, 2, 3]), R.tail('foo') ]// => [[2, 3], 'oo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function tail<T>(input: T[]): T[];export function tail(input: string): string;
/*Method: take
Explanation: It returns the first `howMany` elements of `input`.

Example:
```const howMany = 2
const result = [ R.take(howMany, [1, 2, 3]), R.take(howMany, 'foobar'),]// => [[1, 2], 'fo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function take<T>(howMany: number, input: T[]): T[];export function take(howMany: number, input: string): string;export function take<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: takeLast
Explanation: It returns the last `howMany` elements of `input`.
Example:
```const howMany = 2
const result = [ R.takeLast(howMany, [1, 2, 3]), R.takeLast(howMany, 'foobar'),]// => [[2, 3], 'ar']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeLast<T>(howMany: number, input: T[]): T[];export function takeLast(howMany: number, input: string): string;export function takeLast<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: tap
Explanation: It applies function `fn` to input `x` and returns `x`.
One use case is debuging in the middle of `R.compose`.
Example:
```const list = [1, 2, 3]
R.compose( R.map(x => x * 2) R.tap(console.log), R.filter(x => x > 1))(list)// => `2` and `3` will be logged```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function tap<T>(fn: (x: T) => void, input: T): T;export function tap<T>(fn: (x: T) => void): (input: T) => T;
/*Method: test
Explanation: It determines whether `str` matches `regExpression`.
Example:
```R.test(/^f/, 'foo')// => true```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function test(regExpression: RegExp): (str: string) => boolean;export function test(regExpression: RegExp, str: string): boolean;
/*Method: times
Explanation: It returns the result of applying function `fn` over members of range array.
The range array includes numbers between `0` and `howMany`(exclusive).
Example:
```const fn = x => x * 2const howMany = 5
R.times(fn, howMany)// => [0, 2, 4, 6, 8]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function times<T>(fn: (i: number) => T, howMany: number): T[];export function times<T>(fn: (i: number) => T): (howMany: number) => T[];
/*Method: toLower
Explanation:
Example:
```R.toLower('FOO')// => 'foo'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toLower<S extends string>(str: S): Lowercase<S>;export function toLower(str: string): string;
/*Method: toUpper
Explanation:
Example:
```R.toUpper('foo')// => 'FOO'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toUpper<S extends string>(str: S): Uppercase<S>;export function toUpper(str: string): string;
/*Method: toPairs
Explanation: It transforms an object to a list.

Example:
```const list = { a : 1, b : 2, c : [ 3, 4 ],}const expected = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]
const result = R.toPairs(list)// => `result` is equal to `expected````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;export function toPairs<S>(obj: Record<string | number, S>): Array<[string, S]>;
/*Method: toString
Explanation:
Example:
```R.toString([1, 2]) // => '1,2'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toString(x: unknown): string;
/*Method: transpose
Explanation:
Example:
```const list = [[10, 11], [20], [], [30, 31, 32]]const expected = [[10, 20, 30], [11, 31], [32]]
const result = R.transpose(list)// => `result` is equal to `expected````
Categories:
Notes:
*/// @SINGLE_MARKERexport function transpose<T>(list: (T[])[]): (T[])[];
/*Method: trim
Explanation:
Example:
```R.trim(' foo ') // => 'foo'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function trim(str: string): string;
/*Method: tryCatch
Explanation: It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result. Note that `fn` can be value or asynchronous/synchronous function(unlike `Ramda` where fallback can only be a synchronous function).
Example:
```const fn = x => x.foo
const result = [ R.tryCatch(fn, false)(null), R.tryCatch(fn, false)({foo: 'bar'})]// => [false, 'bar']```
Categories: Function
Notes: Please check the tests of `R.tryCatch` to fully understand how this method works.
*/// @SINGLE_MARKERexport function tryCatch<T, U>( fn: (input: T) => U, fallback: U): (input: T) => U;export function tryCatch<T, U>( fn: (input: T) => U, fallback: (input: T) => U): (input: T) => U;export function tryCatch<T>( fn: (input: any) => Promise<any>, fallback: T): (input: any) => Promise<T>;export function tryCatch<T>( fn: (input: any) => Promise<any>, fallback: (input: any) => Promise<any>,): (input: any) => Promise<T>;
/*Method: type
Explanation: It accepts any input and it returns its type.
Example:
```R.type(() => {}) // => 'Function'R.type(async () => {}) // => 'Async'R.type([]) // => 'Array'R.type({}) // => 'Object'R.type('foo') // => 'String'R.type(1) // => 'Number'R.type(true) // => 'Boolean'R.type(null) // => 'Null'R.type(/[A-z]/) // => 'RegExp'R.type('foo'*1) // => 'NaN'
const delay = ms => new Promise(resolve => { setTimeout(function () { resolve() }, ms)})R.type(delay) // => 'Promise'```
Categories: Logic
Notes: `NaN`, `Promise` and `Async` are types specific for **Rambda**.
*/// @SINGLE_MARKERexport function type(x: any): RambdaTypes;
/*Method: union
Explanation: It takes two lists and return a new list containing a merger of both list with removed duplicates.
`R.equals` is used to compare for duplication.
Example:
```const result = R.union([1,2,3], [3,4,5]);// => [1, 2, 3, 4, 5]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function union<T>(x: T[], y: T[]): T[];export function union<T>(x: T[]): (y: T[]) => T[];
/*Method: uniq
Explanation: It returns a new array containing only one copy of each element of `list`.
`R.equals` is used to determine equality.
Example:
```const list = [1, 1, {a: 1}, {a: 2}, {a:1}]
R.uniq(list)// => [1, {a: 1}, {a: 2}]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function uniq<T>(list: T[]): T[];
/*Method: uniqWith
Explanation: It returns a new array containing only one copy of each element in `list` according to `predicate` function.
This predicate should return true, if two elements are equal.
Example:
```const list = [ {id: 0, title:'foo'}, {id: 1, title:'bar'}, {id: 2, title:'baz'}, {id: 3, title:'foo'}, {id: 4, title:'bar'},]
const expected = [ {id: 0, title:'foo'}, {id: 1, title:'bar'}, {id: 2, title:'baz'},]
const predicate = (x,y) => x.title === y.title
const result = R.uniqWith(predicate, list)// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: T[]): T[];export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
/*Method: unless
Explanation: The method returns function that will be called with argument `input`.
If `predicate(input)` returns `false`, then the end result will be the outcome of `whenFalse(input)`.
In the other case, the final output will be the `input` itself.
Example:
```const fn = R.unless( x => x > 2, x => x + 10)
const result = [ fn(1), fn(5)]// => [11, 5]```
Categories: Logic, Function
Notes:
*/// @SINGLE_MARKERexport function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U): (x: T) => T | U;export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T, x: T): T;export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T): (x: T) => T;
/*Method: update
Explanation: It returns a copy of `list` with updated element at `index` with `newValue`.
Example:
```const index = 2const newValue = 88const list = [1, 2, 3, 4, 5]
const result = R.update(index, newValue, list)// => [1, 2, 88, 4, 5]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function update<T>(index: number, newValue: T, list: T[]): T[];export function update<T>(index: number, newValue: T): (list: T[]) => T[];
/*Method: values
Explanation: With correct input, this is nothing more than `Object.values(obj)`. If `obj` is not an object, then it returns an empty array.
Example:
```const obj = {a:1, b:2}
R.values(obj)// => [1, 2]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function values<T extends object, K extends keyof T>(obj: T): T[K][];
/*Method: when
Explanation: It pass `input` to `predicate` function and if the result is `true`, it will return the result of `whenTrueFn(input)`.
If the `predicate` returns `false`, then it will simply return `input`.
```const predicate = x => typeof x === 'number'const whenTrueFn = R.add(11)
const fn = when(predicate, whenTrueResult)
const positiveInput = 88const negativeInput = 'foo'
const result = [ fn(positiveInput), fn(positiveInput),]
const expected = [ 99, 'foo',]// => `result` is equal to `expected````
Categories: Logic, Function
Notes:
*/// @SINGLE_MARKERexport function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U): (input: T) => T | U;export function when<T, U>(predicate: (x: T) => boolean): ((whenTrueFn: (a: T) => U) => (input: T) => T | U);
/*Method: where
Explanation: It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.
Example:
```const condition = R.where({ a : x => typeof x === "string", b : x => x === 4})const input = { a : "foo", b : 4, c : 11,}
const result = condition(input) // => true```
Categories: Object, Logic
Notes:
*/// @SINGLE_MARKERexport function where<T, U>(conditions: T, input: U): boolean;export function where<T>(conditions: T): <U>(input: U) => boolean;export function where<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;export function where<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
/*Method: whereEq
Explanation: It will return `true` if all of `input` object fully or partially include `rule` object.
`R.equals` is used to determine equality.
Example:
```const condition = { a : { b : 1 } }const input = { a : { b : 1 }, c : 2}
const result = whereEq(condition, input)// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function whereEq<T, U>(condition: T, input: U): boolean;export function whereEq<T>(condition: T): <U>(input: U) => boolean;
/*Method: without
Explanation: It will return a new array, based on all members of `source` list that are not part of `matchAgainst` list.
`R.equals` is used to determine equality.
Example:
```const source = [1, 2, 3, 4]const matchAgainst = [2, 3]
const result = R.without(matchAgainst, source)// => [1, 4]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function without<T>(matchAgainst: T[], source: T[]): T[];export function without<T>(matchAgainst: T[]): (source: T[]) => T[];
/*Method: xor
Explanation: Logical XOR
Example:
```const result = [ xor(true, true), xor(false, false), xor(false, true),]// => [false, false, true]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function xor(x: boolean, y: boolean): boolean;export function xor(y: boolean): (y: boolean) => boolean;
/*Method: zip
Explanation: It will return a new array containing tuples of equally positions items from both `x` and `y` lists.
The returned list will be truncated to match the length of the shortest supplied list.
Example:
```const x = [1, 2]const y = ['A', 'B']R.zip(x, y)// => [[1, 'A'], [2, 'B']]
// truncates to shortest listR.zip([...x, 3], ['A', 'B'])// => [[1, 'A'], [2, 'B']]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zip<K, V>(x: K[], y: V[]): KeyValuePair<K, V>[];export function zip<K>(x: K[]): <V>(y: V[]) => KeyValuePair<K, V>[];
/*Method: zipObj
Explanation: It will return a new object with keys of `keys` array and values of `values` array.
Example:
```const keys = ['a', 'b', 'c']
R.zipObj(keys, [1, 2, 3])// => {a: 1, b: 2, c: 3}
// truncates to shortest listR.zipObj(keys, [1, 2])// => {a: 1, b: 2}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zipObj<T, K extends string>(keys: K[], values: T[]): { [P in K]: T };export function zipObj<K extends string>(keys: K[]): <T>(values: T[]) => { [P in K]: T };export function zipObj<T, K extends number>(keys: K[], values: T[]): { [P in K]: T };export function zipObj<K extends number>(keys: K[]): <T>(values: T[]) => { [P in K]: T };
/*Method: props
Explanation: It takes list with properties `propsToPick` and returns a list with property values in `obj`.
Example:
```const result = R.props( ['a', 'b'], {a:1, c:3})// => [1, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function props<P extends string, T>(propsToPick: P[], obj: Record<P, T>): T[];export function props<P extends string>(propsToPick: P[]): <T>(obj: Record<P, T>) => T[];export function props<P extends string, T>(propsToPick: P[]): (obj: Record<P, T>) => T[];
/*Method: zipWith
Explanation:
Example:
```const list1 = [ 10, 20, 30, 40 ]const list2 = [ 100, 200 ]
const result = R.zipWith( R.add, list1, list2)// => [110, 220]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TResult[];export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[]): (list2: U[]) => TResult[];export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult): (list1: T[], list2: U[]) => TResult[];
/*Method: splitAt
Explanation: It splits string or array at a given index.
Example:
```const list = [ 1, 2, 3 ]const result = R.splitAt(2, list)// => [[ 1, 2 ], [ 3 ]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function splitAt<T>(index: number, input: T[]): [T[], T[]];export function splitAt(index: number, input: string): [string, string];export function splitAt(index: number): { <T>(input: T[]): [T[], T[]]; (input: string): [string, string];};
/*Method: splitWhen
Explanation: It splits `list` to two arrays according to a `predicate` function.
The first array contains all members of `list` before `predicate` returns `true`.
Example:
```const list = [1, 2, 1, 2]const result = R.splitWhen(R.equals(2), list)// => [[1], [2, 1, 2]]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function splitWhen<T, U>(predicate: Predicate<T>, list: U[]): (U[])[];export function splitWhen<T>(predicate: Predicate<T>): <U>(list: U[]) => (U[])[];
/*Method: takeLastWhile
Explanation:
Example:
```const result = R.takeLastWhile( x => x > 2, [1, 2, 3, 4])// => [3, 4]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeLastWhile(predicate: (x: string) => boolean, input: string): string;export function takeLastWhile(predicate: (x: string) => boolean): (input: string) => string;export function takeLastWhile<T>(predicate: (x: T) => boolean, input: T[]): T[];export function takeLastWhile<T>(predicate: (x: T) => boolean): <T>(input: T[]) => T[];
/*Method: evolve
Explanation: It takes object or array of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.
Example:
```const rules = { foo : add(1), bar : add(-1),}const input = { a : 1, foo : 2, bar : 3,}const result = evolve(rules, input)const expected = { a : 1, foo : 3, bar : 2,})// => `result` is equal to `expected````
Categories: Object, List
Notes: Error handling of this method differs between Ramda and Rambda. Ramda for some wrong inputs returns result and for other - it returns one of the inputs. Rambda simply throws when inputs are not correct. Full details for this mismatch are listed in `source/_snapshots/evolve.spec.js.snap` file.
*/// @SINGLE_MARKERexport function evolve<T, U>(rules: ((x: T) => U)[], list: T[]): U[];export function evolve<T, U>(rules: ((x: T) => U)[]) : (list: T[]) => U[];export function evolve<E extends Evolver, V extends Evolvable<E>>(rules: E, obj: V): Evolve<V, E>;export function evolve<E extends Evolver>(rules: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
/*Method: dropLastWhile
Explanation:
Example:
```const list = [1, 2, 3, 4, 5];const predicate = x => x >= 3
const result = dropLastWhile(predicate, list);// => [1, 2]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropLastWhile(predicate: (x: string) => boolean, iterable: string): string;export function dropLastWhile(predicate: (x: string) => boolean): (iterable: string) => string;export function dropLastWhile<T>(predicate: (x: T) => boolean, iterable: T[]): T[];export function dropLastWhile<T>(predicate: (x: T) => boolean): <T>(iterable: T[]) => T[];
/*Method: dropRepeats
Explanation: It removes any successive duplicates according to `R.equals`.
Example:
```const result = R.dropRepeats([ 1, 1, {a: 1}, {a:1}, 1])// => [1, {a: 1}, 1]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function dropRepeats<T>(list: T[]): T[];
/*Method: dropRepeatsWith
Explanation:
Example:
```const list = [{a:1,b:2}, {a:1,b:3}, {a:2, b:4}]const result = R.dropRepeatsWith(R.prop('a'), list)
// => [{a:1,b:2}, {a:2, b:4}]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean, list: T[]): T[];export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
/*Method: dropWhile
Explanation:
Example:
```const list = [1, 2, 3, 4]const predicate = x => x < 3const result = R.dropWhile(predicate, list)// => [3, 4]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropWhile(fn: Predicate<string>, iterable: string): string;export function dropWhile(fn: Predicate<string>): (iterable: string) => string;export function dropWhile<T>(fn: Predicate<T>, iterable: T[]): T[];export function dropWhile<T>(fn: Predicate<T>): (iterable: T[]) => T[];
/*Method: takeWhile
Explanation:
Example:
```const list = [1, 2, 3, 4]const predicate = x => x < 3
const result = R.takeWhile(predicate, list)// => [1, 2]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeWhile(fn: Predicate<string>, iterable: string): string;export function takeWhile(fn: Predicate<string>): (iterable: string) => string;export function takeWhile<T>(fn: Predicate<T>, iterable: T[]): T[];export function takeWhile<T>(fn: Predicate<T>): (iterable: T[]) => T[];
/*Method: eqProps
Explanation: It returns `true` if property `prop` in `obj1` is equal to property `prop` in `obj2` according to `R.equals`.
Example:
```const obj1 = {a: 1, b:2}const obj2 = {a: 1, b:3}const result = R.eqProps('a', obj1, obj2)// => true ```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
/*Method: unapply
Explanation: It calls a function `fn` with the list of values of the returned function.
`R.unapply` is the opposite of `R.apply` method.
Example:
```R.unapply(JSON.stringify)(1, 2, 3)//=> '[1,2,3]'```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function unapply<T = any>(fn: (args: any[]) => T): (...args: any[]) => T;
/*Method: apply
Explanation: It applies function `fn` to the list of arguments.
This is useful for creating a fixed-arity function from a variadic function. `fn` should be a bound function if context is significant.
Example:
```const result = R.apply(Math.max, [42, -Infinity, 1337])// => 1337```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function apply<T = any>(fn: (...args: any[]) => T, args: any[]): T;export function apply<T = any>(fn: (...args: any[]) => T): (args: any[]) => T;
/*Method: bind
Explanation: Creates a function that is bound to a context.
Example:
```const log = R.bind(console.log, console)const result = R.pipe( R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); // => result - `{a: 3}`// => console log - `{a: 2}````
Categories: Function
Notes: R.bind does not provide the additional argument-binding capabilities of [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
*/// @SINGLE_MARKERexport function bind<F extends (...args: any[]) => any, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;export function bind<F extends (...args: any[]) => any, T>(fn: F): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
// RAMBDAX_MARKER_START
/*Method: allFalse
Explanation: It returns `true` if all `inputs` arguments are falsy(empty objects and empty arrays are considered falsy).
Functions are valid inputs, but these functions cannot have their own arguments.
This method is very similar to `R.anyFalse`, `R.anyTrue` and `R.allTrue`
Example:
```R.allFalse(0, null, [], {}, '', () => false)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function allFalse(...inputs: any[]): boolean;
/*Method: anyFalse
Explanation: It returns `true` if any of `inputs` is falsy(empty objects and empty arrays are considered falsy).
Example:
```R.anyFalse(1, {a: 1}, [1], () => false)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function anyFalse(...input: any[]): boolean;
/*Method: allTrue
Explanation: It returns `true` if all `inputs` arguments are truthy(empty objects and empty arrays are considered falsy).
Example:
```R.allTrue(1, true, {a: 1}, [1], 'foo', () => true)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function allTrue(...input: any[]): boolean;
/*Method: anyTrue
Explanation: It returns `true` if any of `inputs` arguments are truthy(empty objects and empty arrays are considered falsy).
Example:
```R.anyTrue(0, null, [], {}, '', () => true)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function anyTrue(...input: any[]): boolean;
/*Method: allType
Explanation: It returns a function which will return `true` if all of its `inputs` arguments belong to `targetType`.
Example:
```const targetType = 'String'
const result = R.allType( targetType)('foo', 'bar', 'baz')// => true```
Categories: Logic
Notes: `targetType` is one of the possible returns of `R.type`
*/// @SINGLE_MARKERexport function allType(targetType: RambdaTypes): (...input: any[]) => boolean;
/*Method: anyType
Explanation: It returns a function which will return `true` if at least one of its `inputs` arguments belongs to `targetType`.
`targetType` is one of the possible returns of `R.type`
Example:
```const targetType = 'String'
const result = R.anyType( targetType)(1, {}, 'foo')// => true```
Categories: Logic
Notes: `targetType` is one of the possible returns of `R.type`
*/// @SINGLE_MARKERexport function anyType(targetType: RambdaTypes): (...input: any[]) => boolean;
/*Method: composeAsync
Explanation: Asynchronous version of `R.compose`
Example:
```const add = async x => { await R.delay(100) return x + 1}const multiply = async x => { await R.delay(100) return x * 2 }
const result = await R.composeAsync( add, multiply)(1)// `result` resolves to `3````
Categories: Function, Async
Notes: It doesn't work with promises or function returning promises such as `const foo = input => new Promise(...)`.
*/// @SINGLE_MARKERexport function composeAsync<Out>( ...fns: (Async<any> | Func<any>)[]): (input: any) => Promise<Out>;export function composeAsync<Out>( ...fns: (Async<any> | Func<any>)[]): (input: any) => Promise<Out>;
/*Method: pipeAsync
Explanation: Asynchronous version of `R.pipe`
Example:
```const add = async x => { await R.delay(100) return x + 1}const multiply = async x => { await R.delay(100) return x * 2 }
const result = await R.pipeAsync( add, multiply)(1)// `result` resolves to `4````
Categories: Function, Async
Notes: It doesn't work with promises or function returning promises such as `const foo = input => new Promise(...)`.
*/// @SINGLE_MARKERexport function pipeAsync<Out>( ...fns: (Async<any> | Func<any>)[]): (input: any) => Promise<Out>;export function pipeAsync<Out>( ...fns: (Async<any> | Func<any>)[]): (input: any) => Promise<Out>;
/*Method: count
Explanation: It counts how many times `searchFor` is within `list` according to `R.equals`.
Example:
```const list = [1, {a:1}, 1, 'foo']const searchFor = 1
const result = R.count(searchFor, list)// => 2```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function count<T>(searchFor: T, list: any[]): number;export function count<T>(searchFor: T): (list: any[]) => number;
/*Method: debounce
Explanation: It creates a debounced function that delays invoking `fn` until after wait milliseconds `ms` have elapsed since the last time the debounced function was invoked.
Example:
```let counter = 0const increment = () => { counter++}
const debounced = R.debounce(increment, 1000)
const result = async function(){ debounced() await R.delay(500) debounced() await R.delay(800) console.log(counter) // => 0 await R.delay(1200) console.log(counter) // => 1 return counter}// `result` resolves to `1````
Categories: Function
Notes: Description is taken from `Lodash` docs
*/// @SINGLE_MARKERexport function debounce<T, U>(fn: (input: T) => U, ms: number): (input: T) => void;export function debounce<T, Q, U>(fn: (input1: T, input2: Q) => U, ms: number): (input1: T, input2: Q) => void;export function debounce<T, Q, Z, U>(fn: (input1: T, input2: Q, input3: Z) => U, ms: number): (input1: T, input2: Q, input3: Z) => void;
/*Method: delay
Explanation: `setTimeout` as a promise that resolves to `R.DELAY` variable after `ms` milliseconds.
Example:
```const result = R.delay(1000)// `result` resolves to `RAMBDAX_DELAY````
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function delay(ms: number): Promise<'RAMBDAX_DELAY'>;
/*Method: filterAsync
Explanation: Asynchronous version of `R.filter`
Example:
```const predicate = async x => { await R.delay(100) return x % 2 === 1}const result = await R.filterAsync(predicate, [ 1, 2, 3 ])// => [ 1, 3 ]```
Categories: List, Object, Async
Notes:
*/// @SINGLE_MARKERexport function filterAsync<T>(fn: AsyncPredicate<T>, list: T[]): Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicateIndexed<T>, list: T[]): Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicate<T>) : ( list: T[]) => Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicateIndexed<T>) : ( list: T[]) => Promise<T[]>;
/*Method: glue
Explanation: It transforms multiline string to single line by gluing together the separate lines with the `glueString` and removing the empty spaces. By default `glueString` is equal to single space, so if that is what you need, then you can just pass a single argument.
Example:
```const result = R.glue(` foo bar baz`)// => 'foo bar baz'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function glue(input: string, glueString?: string): string;
/*Method: getter
Explanation: The set of methods `R.setter`, `R.getter` and `R.reset` allow different parts of your logic to access comminicate indirectly via shared cache object.
Usually these methods show that you might need to refactor to classes. Still, they can be helpful meanwhile.
`R.getter`: It provides access to the cache object. If `undefined` is used as a key, this method will return the whole cache object. If `string` is passed, then it will return cache value for this key. If array of `string` is passed, then it assume that this is array of keys and it will return the corresponding cache values for these keys.
`R.setter`: It allows cache object's keys to be changed. You can either set individual key-value pairs with `R.setter(key, value)` or you pass directly object, which will be merged with the cache object.
`R.reset`: It resets the cache object.
Example:
```R.setter('foo','bar')R.setter('a', 1)R.getter(['foo','a']) // => {foo: 'bar', a: 1}
R.setter('a', 2)R.getter('a') // => 2R.reset()R.getter('a') // => undefined```
Categories:
Notes:
*/// @SINGLE_MARKERexport function getter<T>(keyOrKeys: string | string[] | undefined): T;
/*Method: setter
Explanation:
Example:
```
```
Categories:
Notes: `R.getter` method contains explanations, tests and source information of `R.reset`, `R.setter` and `R.getter` methods.
*/// @SINGLE_MARKERexport function setter(keyOrObject: string | object, value?: any): void;
/*Method: reset
Explanation:
Example:
```
```
Categories:
Notes: `R.getter` method contains explanations, tests and source information of `R.reset`, `R.setter` and `R.getter` methods.
*/// @SINGLE_MARKERexport function reset(): void;
/*Method: interpolate
Explanation: It generages a new string from `inputWithTags` by replacing all `{{x}}` occurances with values provided by `templateArguments`.
Example:
```const inputWithTags = 'foo is {{bar}} even {{a}} more'const templateArguments = {"bar":"BAR", a: 1}
const result = R.interpolate(inputWithTags, templateArguments)const expected = 'foo is BAR even 1 more'// => `result` is equal to `expected````
Categories: String
Notes:
*/// @SINGLE_MARKERexport function interpolate(inputWithTags: string, templateArguments: object): string;export function interpolate(inputWithTags: string): (templateArguments: object) => string;
/*Method: ifElseAsync
Explanation: Asynchronous version of `R.ifElse`. Any of `condition`, `ifFn` and `elseFn` can be either asynchronous or synchronous function.
Example:
```const condition = async x => { await R.delay(100) return x > 1}const ifFn = async x => { await R.delay(100) return x + 1}const elseFn = async x => { await R.delay(100) return x - 1}
const result = await R.ifElseAsync( condition, ifFn, elseFn )(1)// => 0```
Categories: Async, Logic
Notes:
*/// @SINGLE_MARKERexport function ifElseAsync<T, U>( condition: (x: T) => Promise<boolean>, onTrue: (x: T) => U, onFalse: (x: T) => U, ): (x: T) => Promise<U>;export function ifElseAsync<T, U>( condition: (x: T) => boolean, onTrue: (x: T) => Promise<U>, onFalse: (x: T) => Promise<U>, ): (x: T) => Promise<U>;export function ifElseAsync<T, U>( condition: (x: T) => Promise<boolean>, onTrue: (x: T) => Promise<U>, onFalse: (x: T) => Promise<U>, ): (x: T) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => Promise<boolean>, onTrue: (x: T, y: K) => U, onFalse: (x: T, y: K) => U, ): (x: T, y: K) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => boolean, onTrue: (x: T, y: K) => Promise<U>, onFalse: (x: T, y: K) => Promise<U>, ): (x: T, y: K) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => Promise<boolean>, onTrue: (x: T, y: K) => Promise<U>, onFalse: (x: T, y: K) => Promise<U>, ): (x: T, y: K) => Promise<U>;
/*Method: isFunction
Explanation: It returns `true` if **R.type** of `input` is `Async` or `Function`.
Example:
```const result = [ R.isFunction(R.mapAsync), R.isFunction(R.add),]// => [true, true]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isFunction(input: any): boolean;
/*Method:
Explanation: It returns true if `input` is either asynchronous function or unresolved promise.
Example:
```R.isPromise(R.delay(1000))// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isPromise(input: any): boolean;
/*Method: isType
Explanation: It returns true if `targetType` is equal to type of `input` according to `R.type`.
Example:
```R.isType('Async',R.delay(1000))// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isType(targetType: RambdaTypes, input: any): boolean;export function isType(targetType: RambdaTypes): (input: any) => boolean;
/*Method: isValid
Explanation: It checks if `input` is following `schema` specifications.
If validation fails, it returns `false`.
Please [check the detailed explanation](https://github.com/selfrefactor/rambdax/blob/master/files/isValid.md) as it is hard to write a short description for this method.
Example:
```const input = {a: ['foo', 'bar']}const invalidInput = {a: ['foo', 'bar', 1]}const schema = {a: [String]}const result = [ R.isValid({schema, input}), R.isValid({schema, input: invalidInput})]// => [true, false]```
Categories: Logic
Notes: Independently, somebody else came with very similar idea called [superstruct](https://github.com/ianstormtaylor/superstruct)
*/// @SINGLE_MARKERexport function isValid({input: object, schema: Schema}: IsValid): boolean;
/*Method: isValidAsync
Explanation: Asynchronous version of `R.isValid`
Example:
```const input = {a: 1, b: 2}const invalidInput = {a: 1, b: 'foo'}const schema = {a: Number, b: async x => { await R.delay(100) return typeof x === 'number'}}
const result = await Promise.all([ R.isValidAsync({schema, input}), R.isValidAsync({schema, input: invalidInput})])// => [true, false]```
Categories: Logic, Async
Notes:
*/// @SINGLE_MARKERexport function isValidAsync(x: IsValidAsync): Promise<boolean>;
/*Method: mapAsync
Explanation: Sequential asynchronous mapping with `fn` over members of `list`.
Example:
```async function fn(x){ await R.delay(1000) return x+1}
const result = R.mapAsync(fn, [1, 2, 3])// `result` resolves after 3 seconds to `[2, 3, 4]````
Categories: Async, List
Notes:
*/// @SINGLE_MARKERexport function mapAsync<T, K>(fn: AsyncIterable<T, K>, list: T[]): Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterableIndexed<T, K>, list: T[]): Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterable<T, K>) : ( list: T[]) => Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterableIndexed<T, K>) : ( list: T[]) => Promise<K[]>;
/*Method: mapFastAsync
Explanation: Parrallel asynchronous mapping with `fn` over members of `list`.
Example:
```async function fn(x){ await R.delay(1000) return x+1}
const result = R.mapFastAsync(fn, [1, 2, 3])// `result` resolves after 1 second to `[2, 3, 4]````
Categories: Async, List
Notes:
*/// @SINGLE_MARKERexport function mapFastAsync<T, K>(fn: AsyncIterable<T, K>, list: T[]): Promise<K[]>;export function mapFastAsync<T, K>(fn: AsyncIterableIndexed<T, K>, list: T[]): Promise<K[]>;export function mapFastAsync<T, K>(fn: AsyncIterable<T, K>) : ( list: T[]) => Promise<K[]>;export function mapFastAsync<T, K>(fn: AsyncIterableIndexed<T, K>) : ( list: T[]) => Promise<K[]>;
/*Method: mapAsyncLimit
Explanation: It is similar to `R.mapFastAsync` in that it uses `Promise.all` but not over the whole list, rather than with only slice from `list` with length `limit`.
Example:
```
```
Categories: Async, List
Notes: For example usage, please check `R.mapAsyncLimit` tests.
*/// @SINGLE_MARKERexport function mapAsyncLimit<T, K>(fn: AsyncIterable<T, K>, limit: number, list: T[]): Promise<K[]>;export function mapAsyncLimit<T, K>(fn: AsyncIterable<T, K>, limit: number): (list: T[]) => Promise<K[]>;export function mapAsyncLimit<T, K>(fn: AsyncIterableIndexed<T, K>, limit: number, list: T[]): Promise<K[]>;export function mapAsyncLimit<T, K>(fn: AsyncIterableIndexed<T, K>, limit: number): (list: T[]) => Promise<K[]>;
/*Method: mapToObject
Explanation: This method allows to generate an object from a list using input function `fn`.
This function must return either an object or `false` for every member of `list` input.
If `false` is returned, then this element of `list` will be skipped in the calculation of the result.
All of returned objects will be merged to generate the final result.
Example:
```const list = [1, 2, 3, 12]const fn = x => { if(x > 10) return false return x % 2 ? {[x]: x + 1}: {[x]: x + 10}}
const result = mapToObject(fn, list)const expected = {'1': 2, '2': 12, '3': 4}// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mapToObject<T, U>(fn: (input: T) => object|false, list: T[]): U;export function mapToObject<T, U>(fn: (input: T) => object|false): (list: T[]) => U;
/*Method: mapToObjectAsync
Explanation: Asynchronous version of `R.mapToObject`
Example:
```
```
Categories: List, Async
Notes:
*/// @SINGLE_MARKERexport function mapToObjectAsync<T, U>(fn: (input: T) => Promise<object|false>, list: T[]): Promise<U>;export function mapToObjectAsync<T, U>(fn: (input: T) => Promise<object|false>): (list: T[]) => Promise<U>;
/*Method: mapKeys
Explanation: It takes an object and returns a new object with changed keys according to `changeKeyFn` function.
Example:
```const obj = {a: 1, b: 2}const changeKeyFn = prop => `{prop}_foo`const result = R.mapKeys(changeKeyFn, obj)// => {a_foo: 1, b_foo: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapKeys<T, U>(changeKeyFn: (x: string) => string, obj: { [key: string]: T}): U;export function mapKeys<T, U>(changeKeyFn: (x: string) => string): (obj: { [key: string]: T}) => U;
/*Method: maybe
Explanation: It acts as ternary operator and it is helpful when we have nested ternaries.
All of the inputs can be either direct values or anonymous functions. This is helpful if we don't want to evaluate certain paths as we can wrap this logic in a function.
Example:
```const x = 4const y = 8
const ifRule = x > 2const whenIf = y > 10 ? 3 : 7const whenElse = () => { // just to show that it won't be evaluated return JSON.parse('{a:')}
const result = R.maybe( ifRule, whenIf, whenElse,)// `result` is `7````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function maybe<T>(ifRule: boolean, whenIf: T | Func<T>, whenElse: T | Func<T>): T;export function maybe<T>(ifRule: VoidInputFunc<boolean>, whenIf: T | Func<T>, whenElse: T | Func<T>): T;
/*Method: memoize
Explanation: When `fn` is called for a second time with the same input, then the cache result is returned instead of calling again `fn`.
Example:
```let result = 0const fn = (a,b) =>{ result++ return a + b}const memoized = R.memoize(fn)memoized(1, 2)memoized(1, 2)
// => `result` is equal to `1````
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function memoize<T, K extends any[]>(fn: (...inputs: K) => T): (...inputs: K) => T;
/*Method: nextIndex
Explanation: It returns the next index of the list.
If we have reached the end of the list, then it will return `0`.
Example:
```const list = [1, 2, 3]
const result = [ R.nextIndex(0, list), R.nextIndex(1, list), R.nextIndex(2, list), R.nextIndex(10, list)]// => [1, 2, 0, 0]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function nextIndex(index: number, list: any[]): number;
/*Method: prevIndex
Explanation: It returns the next index of the list when the order is descending.
If we have reached the beginning of the list, then it will return the last index of the list.
Example:
```const list = [1, 2, 3]
const result = [ R.prevIndex(0, list), R.prevIndex(1, list), R.prevIndex(2, list),]// => [2, 0, 1]```
Categories: List
Notes: Unlike `R.nextIndex`, which safeguards against index out of bounds, this method does not.
*/// @SINGLE_MARKERexport function prevIndex(index: number, list: any[]): number;
/*Method: ok
Explanation: It checks if `inputs` are following `schemas` specifications according to `R.isValid`.
If validation fails, it throws.
Example:
```const result = R.ok( 1, ['foo', 'bar'])( Number, [String])// => undefined```
Categories:
Notes: It is same as `R.pass` but instead of returning `false`, it throws an error.
*/// @SINGLE_MARKERexport function ok(...inputs: any[]): (...schemas: any[]) => void | never;
/*Method: pass
Explanation: It checks if `inputs` are following `schemas` specifications according to `R.isValid`.
Example:
```const result = R.pass( 1, ['foo','bar'])( Number, [String])// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function pass(...inputs: any[]): (...rules: any[]) => boolean;
/*Method: partialCurry
Explanation: `R.partialCurry` is a curry helper designed specifically for functions accepting object as a single argument.
Initially the function knows only a part from the whole input object and then `R.partialCurry` helps in preparing the function for the second part, when it receives the rest of the input.
Example:
```const fn = ({ a, b, c }) => a + b + cconst curried = R.partialCurry(fn, { a : 1 })const result = curried({ b : 2, c : 3,})// => 6```
Categories: Function, Async
Notes: Curried function can be asynchronous
*/// @SINGLE_MARKERexport function partialCurry<Input, PartialInput, Output>( fn: (input: Input) => Output, partialInput: PartialInput,): (input: Pick<Input, Exclude<keyof Input, keyof PartialInput>>) => Output;
/*Method: piped
Explanation: It is basically `R.pipe`, but instead of passing `input` argument as `R.pipe(...)(input)`, you pass it as the first argument.
Example:
```const result = R.piped( [1, 2, 3], R.filter(x => x > 1), R.map(x => x*10),)// => [20, 30]```
Categories: Function
Notes: Independently, similar method is implemented in `Ramada` library, but there the name of the method is `pipe` - [Remeda.pipe](https://remedajs.com/docs#pipe)
*/// @SINGLE_MARKERexport function piped<A, B>(input: A, fn0: (x: A) => B) : B;export function piped<A, B, C>(input: A, fn0: (x: A) => B, fn1: (x: B) => C) : C;export function piped<A, B, C, D>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D) : D;export function piped<A, B, C, D, E>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E) : E;export function piped<A, B, C, D, E, F>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F) : F;export function piped<A, B, C, D, E, F, G>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G) : G;export function piped<A, B, C, D, E, F, G, H>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G, fn6: (x: G) => H) : H;export function piped<A, B, C, D, E, F, G, H, I>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G, fn6: (x: G) => H, fn7: (x: H) => I) : I;
/*Method: pipedAsync
Explanation: It accepts input as first argument and series of functions as next arguments. It is same as `R.pipe` but with support for asynchronous functions.
Example:
```const result = R.pipedAsync( 100, async x => { await R.delay(100) return x + 2 }, R.add(2), async x => { const delayed = await R.delay(100) return delayed + x })const expected = 'RAMBDAX_DELAY104'// `result` resolves to `expected````
Categories: Async
Notes: Functions that return `Promise` will be handled as regular function not asynchronous. Such example is `const foo = input => new Promise(...)`.
*/// @SINGLE_MARKERexport function pipedAsync<T>( input: any, ...fns: (Func<any> | Async<any>)[]): Promise<T>;
/*Method: produce
Explanation: It returns an object created by applying each value of `rules` to `input` argument.
Example:
```const rules = { foo: R.pipe(R.add(1), R.add(2)), a: {b: R.add(3)}}const result = R.produce(rules, 1)
const expected = { foo: 4, a: {b: 4}}// => `result` is equal to `expected````
Categories: Object
Notes: In Typescript context, `rules` functions can be only 1 level deep. In Javascript context, there is no such restriction.
*/// @SINGLE_MARKERexport function produce<Input extends any, Output>( rules: ProduceRules<Output, keyof Output, Input>, input: Input): Output;export function produce<Input extends any, Output>( rules: ProduceRules<Output, keyof Output, Input>): <Input>( input: Input) => Output;
/*Method: produceAsync
Explanation: It returns an object created by applying each value of `rules` to `input` argument.
`rules` input is an object with synchronous or asynchronous functions as values.
The return value is wrapped in a promise, even if all `rules` are synchronous functions.
Example:
```const rules = { foo: async x => { await R.delay(100) return x > 1 }, bar: x => ({baz: x})}const input = 2const result = await R.produceAsync(rules, input)
const expected = { foo: true, bar: {baz: 2}}// => `result` is equal to `expected````
Categories: Function, Async
Notes:
*/// @SINGLE_MARKERexport function produceAsync<Input extends any, Output>( rules: ProduceAsyncRules<Output, keyof Output, Input>, input: Input): Promise<Output>;export function produceAsync<Input extends any, Output>( rules: ProduceAsyncRules<Output, keyof Output, Input>): <Input>( input: Input) => Promise<Output>;

/*Method: random
Explanation: It returns a random number between `min` inclusive and `max` inclusive.
Example:
```
```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function random(minInclusive: number, maxInclusive: number): number;
/*Method: remove
Explanation: It will remove all `toRemove` entries from `text` sequentially.
`toRemove` argument can be either a list of strings/regular expressions or a single string/regular expression.
Example:
```const result = R.remove( ['foo','bar'], 'foo bar baz foo')// => 'baz foo'```
Categories: String
Notes: This is the only case where Rambdax exports clashes with Ramda API, as Ramda has `remove` method. If `Rambda.remove` is introduced, then this method will be renamed.
*/// @SINGLE_MARKERexport function remove( toRemove: string | RegExp | (string | RegExp)[], text: string): string;export function remove( toRemove: string | RegExp | (string | RegExp)[]): (text: string) => string;
/*Method: renameProps
Explanation: If property `prop` of `rules` is also a property in `input`, then rename `input` property to `rules[prop]`.
Example:
```
```
Categories:
Notes:
*/// @SINGLE_MARKERexport function renameProps(rules: object, input: object): object;export function renameProps(rules: object): (input: object) => object;export function renameProps<Output>(rules: object, input: object): Output;export function renameProps<Output>(rules: object): (input: object) => Output;

/*Method: replaceAll Explanation: Same as `R.replace` but it accepts array of string and regular expressions instead of a single value.
Example:
```const replacer = '|'const patterns = [ /foo/g, 'bar' ]const input = 'foo bar baz foo bar'
const result = R.replaceAll(patterns, replacer, input)// => '| | baz | bar'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function replaceAll(patterns: (RegExp | string)[], replacer: string, input: string): string;export function replaceAll(patterns: (RegExp | string)[], replacer: string): (input: string) => string;export function replaceAll(patterns: (RegExp | string)[]): (replacer: string) => (input: string) => string;
/*Method: shuffle
Explanation: It returns a randomized copy of array.
Example:
```
```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function shuffle<T>(list: T[]): T[];
/*Method: sortObject
Explanation: It returns a sorted version of `input` object.
Example:
```const predicate = (propA, propB, valueA, valueB) => valueA > valueB ? -1 : 1
const result = R.sortObject(predicate, {a:1, b: 4, c: 2})// => {b: 4, c: 2, a: 1}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function sortObject<T>(predicate: SortObjectPredicate<T>, input: { [key: string]: T }): { [keyOutput: string]: T };export function sortObject<T>(predicate: SortObjectPredicate<T>): (input: { [key: string]: T }) => { [keyOutput: string]: T };
/*Method: switcher
Explanation: Edited fork of [Switchem](https://github.com/planttheidea/switchem) library.
The method return a value if the matched option is a value.
If the matched option is a function, then `R.switcher` returns a function which expects input. Tests of the method explain it better than this short description.
`R.equals` is used to determine equality.
Example:
```const valueToMatch = {foo: 1}
const result = R.switcher(valueToMatch) .is('baz', 'is baz') .is(x => typeof x === 'boolean', 'is boolean') .is({foo: 1}, 'Property foo is 1') .default('is bar')// => 'Property foo is 1'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function switcher<T>(valueToMatch: any): Switchem<T>;
/*Method: tapAsync
Explanation: Asynchronous version of `R.tap`.
Example:
```
```
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function tapAsync<T>(fn: Func<any> | Promise<any>, input: T): T;export function tapAsync<T>(fn: Func<any> | Promise<any>): (input: T) => T;
/*Method: throttle
Explanation: It creates a throttled function that invokes `fn` maximum once for a `period` of milliseconds.
Example:
```let counter = 0const inc = () => { counter++}
const throttledInc = R.throttle(inc, 800)
const result = async () => { throttledInc() await R.delay(500) throttledInc() return counter}// `result` resolves to `1````
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function throttle<T, U>(fn: (input: T) => U, ms: number): (input: T) => U;export function throttle<T, Q, U>(fn: (input1: T, input2: Q) => U, ms: number): (input1: T, input2: Q) => U;export function throttle<T, Q, Z, U>(fn: (input1: T, input2: Q, input3: Z) => U, ms: number): (input1: T, input2: Q, input3: Z) => U;
/*Method: toDecimal
Explanation:
Example:
```R.toDecimal(2.45464,2) // => 2.45```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function toDecimal(num: number, charsAfterDecimalPoint?: number): number;
/*Method: wait
Explanation: It provides `Golang`-like interface for handling promises.
Example:
```const [result, err] = await R.wait(R.delay(1000))// => err is undefined// => result is `RAMBDAX_DELAY````
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function wait<T>(fn: Promise<T>): Promise<[T, Error|undefined]>;export function wait<T>(fn: (x: any) => Promise<T>): Promise<[T, Error|undefined]>;
/*Method: waitFor
Explanation: It returns `true`, if `condition` returns `true` within `howLong` milisececonds time period.
The method accepts an optional third argument `loops`(default to 10), which is the number of times `waitForTrueCondition` will be evaluated for `howLong` period. Once this function returns a value different from `false`, this value will be the final result.
Otherwise, `R.waitFor` will return `false`.
Example:
```const howLong = 1000let counter = 0const waitForTrueCondition = async x => { await R.delay(100) counter = counter + x return counter > 10}
const result = await R.waitFor(waitForTrueCondition, howLong)(2)// => true```
Categories: Async, Logic
Notes:
*/// @SINGLE_MARKERexport function waitFor( waitForTrueCondition: () => boolean, howLong: number, loops?: number): () => Promise<boolean>;export function waitFor( waitForTrueCondition: () => Promise<boolean>, howLong: number, loops?: number): () => Promise<boolean>;export function waitFor<T>( waitForTrueCondition: (input: T) => Promise<boolean>, howLong: number, loops?: number): (input: T) => Promise<boolean>;export function waitFor<T>( waitForTrueCondition: (input: T) => boolean, howLong: number, loops?: number): (input: T) => Promise<boolean>;
/*Method: lensEq
Explanation: It returns `true` if data structure focused by the given lens equals to the `target` value.
`R.equals` is used to determine equality.
Example:
```const list = [ 1, 2, 3 ]const lens = R.lensIndex(0)const result = R.lensEq( lens, 1, list)// => true```
Categories: Lenses
Notes: Idea for this method comes from `ramda-adjunct` library
*/// @SINGLE_MARKERexport function lensEq<T, U>(lens: Lens, target: T, input: U): boolean;export function lensEq<T, U>(lens: Lens, target: T): (input: U) => boolean;export function lensEq<T>(lens: Lens, target: T, input: T[]): boolean;export function lensEq<T>(lens: Lens, target: T): (input: T[]) => boolean;
/*Method: lensSatisfies
Explanation: It returns `true` if data structure focused by the given lens satisfies the predicate.
Example:
```const fn = R.lensSatisfies(x => x > 5, R.lensIndex(0))const result = [ fn([10, 20, 30]), fn([1, 2, 3]),]// => [true, false]```
Categories: Lenses
Notes: Idea for this method comes from `ramda-adjunct` library
*/// @SINGLE_MARKERexport function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens, input: U): boolean;export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens): (input: U) => boolean;export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens, input: T[]): boolean;export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens): (input: T[]) => boolean;
/*Method: viewOr
Explanation: A combination between `R.defaultTo` and `R.view.
Example:
```const lens = R.lensProp('a');const input = {a: 'foo'}const fallbackInput = {b: 'bar'}const fallback = 'FALLBACK'
const result = [ R.viewOr(fallback, lens, input), R.viewOr(fallback, lens, fallbackInput)]// => ['foo', 'FALLBACK']```
Categories: Lenses
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function viewOr<Input, Output>(fallback: Output, lens: Lens, input: Input): Output;export function viewOr<Input, Output>(fallback: Output, lens: Lens): (input: Input) => Output;export function viewOr<Input, Output>(fallback: Output): (lens: Lens) => (input: Input) => Output;
/*Method: sortByPath
Explanation: It returns copy of `list` sorted by `sortPath` value.
As `sortPath` is passed to `R.path`, it can be either a string or an array of strings.
Example:
```const list = [ {a: {b: 2}}, {a: {b: 1}}, {a: {b: 3}}]const result = R.sortByPath('a.b', list)const expected = [ {a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}]// => `result` is equal to `expected````
Categories: List
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function sortByPath<T>(sortPath: Path, list: T[]): T[];export function sortByPath(sortPath: Path): <T>(list: T[]) => T[];
/*Method: sortByProps
Explanation: It returns sorted copy of `list` of objects.
Sorting is done using a list of strings, each representing a path. Two members `a` and `b` from `list` can be sorted if both return a value for a given path. If the value is equal, then the next member of `sortPaths`(if there is such) will be used in order to find difference between `a` and `b`.
Example:
```const list = [ {a: {b: 2}}, {a: {b: 1}}, {a: {b: 3}}]const result = R.sortByProps(['a.b'], list)const expected = [ {a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}]// => `result` is equal to `expected````
Categories: List
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function sortByProps<T>(sortPaths: string[], list: T[]): T[];export function sortByProps(sortPaths: string[]): <T>(list: T[]) => T[];
/*Method: removeIndex
Explanation: It returns a copy of `list` input with removed `index`.
Example:
```const list = [1, 2, 3, 4]const result = R.removeIndex(1, list)// => [1, 3, 4]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function removeIndex<T>(index: number, list: T[]): T[];export function removeIndex(index: number): <T>(list: T[]) => T[];

/*Method: excludes
Explanation: Opposite of `R.includes`
`R.equals` is used to determine equality.
Example:
```const result = [ R.excludes('ar', 'foo'), R.excludes({a: 2}, [{a: 1}])]// => [true, true ]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function excludes(valueToFind: string, input: string[] | string): boolean;export function excludes(valueToFind: string): (input: string[] | string) => boolean;export function excludes<T>(valueToFind: T, input: T[]): boolean;export function excludes<T>(valueToFind: T): (input: T[]) => boolean;
/*Method: updateObject
Explanation: Very similar to `R.assocPath` but it applies list of updates instead of only a single update.
It return a copy of `obj` input with changed properties according to `rules` input.
Each instance of `rules` is a tuple of object path and the new value for this path. If such object path does not exist, then such object path is created.
As it uses `R.path` underneath, object path can be either string or array of strings(in Typescript object path can be only a string).
Example:
```const obj = { a: {b: 1}, foo: {bar: 10},}const rules = [ ['a.b', 2], ['foo.bar', 20], ['q.z', 300],]const result = R.updateObject(rules, obj)
const expected = { a: {b: 2}, foo: {bar: 20}, q: {z: 300},}// => `result` is equal to `expected````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function updateObject<Output>(rules: ([string, any])[], input: object): Output;export function updateObject<Output>(rules: ([string, any])[]): (input: object) => Output;
/*Method: takeUntil
Explanation:
Example:
```const list = [1, 2, 3, 4, 5]const predicate = x => x > 3const result = R.takeUntil(predicate, list)
// => [1, 2, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function takeUntil<T>(predicate: (x: T) => boolean, list: T[]): T[];export function takeUntil<T>(predicate: (x: T) => boolean): (list: T[]) => T[];
/*Method: applyDiff
Explanation: It changes paths in an object according to a list of operations. Valid operations are `add`, `update` and `delete`. Its use-case is while writing tests and you need to change the test data.
Note, that you cannot use `update` operation, if the object path is missing in the input object.Also, you cannot use `add` operation, if the object path has a value.
Example:
```const obj = {a: {b:1, c:2}}const rules = [ {op: 'remove', path: 'a.c'}, {op: 'add', path: 'a.d', value: 4}, {op: 'update', path: 'a.b', value: 2},]const result = R.applyDiff(rules, obj)const expected = {a: {b: 2, d: 4}}
// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function applyDiff<Output>(rules: ApplyDiffRule[], obj: object): Output;export function applyDiff<Output>(rules: ApplyDiffRule[]): ( obj: object) => Output;
/*Method: mapIndexed
Explanation: Same as `R.map`, but it passes index as second argument to the iterator, when looping over arrays.
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function mapIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapIndexed<T, U>(fn: IndexedIterator<T, U>, iterable: T[]): U[];export function mapIndexed<T, U>(fn: IndexedIterator<T, U>): (iterable: T[]) => U[];export function mapIndexed<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;export function mapIndexed<T>(fn: IndexedIterator<T, T>): (iterable: T[]) => T[];export function mapIndexed<T>(fn: IndexedIterator<T, T>, iterable: T[]): T[];
/*Method: mapArray
Explanation:
Example:
```const result = R.mapArray(x => x + 1, [1, 2])// => [2, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mapArray<T>(fn: Iterator<T, T>, iterable: T[]): T[];export function mapArray<T, U>(fn: Iterator<T, U>, iterable: T[]): U[];export function mapArray<T, U>(fn: Iterator<T, U>): (iterable: T[]) => U[];export function mapArray<T>(fn: Iterator<T, T>): (iterable: T[]) => T[];
/*Method: filterIndexed
Explanation: Same as `R.filter`, but it passes index/property as second argument to the predicate, when looping over arrays/objects.
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function filterIndexed<T>(predicate: IndexedPredicate<T>): (x: T[]) => T[];export function filterIndexed<T>(predicate: IndexedPredicate<T>, x: T[]): T[];export function filterIndexed<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filterIndexed<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: rejectIndexed
Explanation: Same as `R.reject`, but it passes index/property as second argument to the predicate, when looping over arrays/objects.
Example:
```const list = [1, 2, 3, 4]const obj = {a: 1, b: 2}
const result = [ R.reject((x, index) => x > 1, list) R.reject((x, property) => x > 1, obj)]// => [[1], {a: 1}]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function rejectIndexed<T>(predicate: IndexedPredicate<T>): (x: T[]) => T[];export function rejectIndexed<T>(predicate: IndexedPredicate<T>, x: T[]): T[];export function rejectIndexed<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function rejectIndexed<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;

/*Method: partitionIndexed
Explanation:
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function partitionIndexed<T>( predicate: IndexedPredicate<T>, input: T[]): [T[], T[]];export function partitionIndexed<T>( predicate: IndexedPredicate<T>): (input: T[]) => [T[], T[]];export function partitionIndexed<T>( predicate: (x: T, prop?: string) => boolean, input: { [key: string]: T}): [{ [key: string]: T}, { [key: string]: T}];export function partitionIndexed<T>( predicate: (x: T, prop?: string) => boolean): (input: { [key: string]: T}) => [{ [key: string]: T}, { [key: string]: T}];
/*Method: filterObject
Explanation:
Example:
```const obj = {a: 1, b:2}const result = R.filterObject( x => x > 1, obj)// => {b: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function filterObject<T>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filterObject<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: filterArray
Explanation:
Example:
```const result = R.filterArray( x => x > 1, [1, 2, 3])// => [1, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function filterArray<T>(predicate: Predicate<T>): (input: T[]) => T[];export function filterArray<T>(predicate: Predicate<T>, input: T[]): T[];
/*Method: forEachIndexed
Explanation:
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function forEachIndexed<T>(fn: IndexedIterator<T, void>, list: T[]): T[];export function forEachIndexed<T>(fn: IndexedIterator<T, void>): (list: T[]) => T[];export function forEachIndexed<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;export function forEachIndexed<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
/*Method: mapObject
Explanation:
Example:
```const result = R.mapObject(x => x + 1, {a:1, b:2})// => {a:2, b:3}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapObject<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;export function mapObject<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapObject<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;export function mapObject<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
/*Method: tryCatchAsync
Explanation: It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result.
Example:
```const x = {foo: 1}const fnFoo = async () => x.fooconst fnBar = async () => x.bar
const result = await Promise.all([ R.tryCatchAsync (fnFoo, false)(), R.tryCatchAsync(fnBar, false)()])// => [1, false]```
Categories: Async, Function
Notes:
*/// @SINGLE_MARKERexport function tryCatchAsync<T>( fn: (input: any) => Promise<T>, fallback: T): (input: any) => Promise<T>;export function tryCatchAsync<T>( fn: (input: any) => Promise<T>, fallback: (input: any) => Promise<T>,): (input: any) => Promise<T>;
export const DELAY: 'RAMBDAX_DELAY';
/*Method: findAsync
Explanation: Asynchronous version of `R.find`.
Example:
```const predicate = x => { await R.delay(100) return R.type(x.foo) === 'Number'}
const list = [{foo: 'bar'}, {foo: 1}]
const result = await R.findAsync(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findAsync<T>(predicate: (x: T) => Promise<boolean>, list: T[]): T | undefined;export function findAsync<T>(predicate: (x: T) => Promise<boolean>): (list: T[]) => T | undefined;
/*Method: xnor
Explanation: Logical XNOR
Example:
```const result = [ R.xnor(1, 0), R.xnor(0, 1), R.xnor(0, 0), R.xnor(1, 1),]// => [true, false, false, true]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function xnor(x: boolean, y: boolean): boolean;export function xnor(y: boolean): (y: boolean) => boolean;
// RAMBDAX_MARKER_END// ============================================
export as namespace R