types.d.ts 354 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn special-lint-fix` to update
  5. */
  6. import { Buffer } from "buffer";
  7. import {
  8. ArrayExpression,
  9. ArrayPattern,
  10. ArrowFunctionExpression,
  11. AssignmentExpression,
  12. AssignmentPattern,
  13. AssignmentProperty,
  14. AwaitExpression,
  15. BigIntLiteral,
  16. BinaryExpression,
  17. BlockStatement,
  18. BreakStatement,
  19. CatchClause,
  20. ChainExpression,
  21. ClassBody,
  22. ClassDeclaration,
  23. ClassExpression,
  24. Comment,
  25. ConditionalExpression,
  26. ContinueStatement,
  27. DebuggerStatement,
  28. Directive,
  29. DoWhileStatement,
  30. EmptyStatement,
  31. ExportAllDeclaration,
  32. ExportDefaultDeclaration,
  33. ExportNamedDeclaration,
  34. ExportSpecifier,
  35. ExpressionStatement,
  36. ForInStatement,
  37. ForOfStatement,
  38. ForStatement,
  39. FunctionDeclaration,
  40. FunctionExpression,
  41. Identifier,
  42. IfStatement,
  43. ImportDeclaration,
  44. ImportDefaultSpecifier,
  45. ImportExpression,
  46. ImportNamespaceSpecifier,
  47. ImportSpecifier,
  48. LabeledStatement,
  49. LogicalExpression,
  50. MemberExpression,
  51. MetaProperty,
  52. MethodDefinition,
  53. NewExpression,
  54. ObjectExpression,
  55. ObjectPattern,
  56. PrivateIdentifier,
  57. Program,
  58. Property,
  59. PropertyDefinition,
  60. RegExpLiteral,
  61. RestElement,
  62. ReturnStatement,
  63. SequenceExpression,
  64. SimpleCallExpression,
  65. SimpleLiteral,
  66. SpreadElement,
  67. StaticBlock,
  68. Super,
  69. SwitchCase,
  70. SwitchStatement,
  71. TaggedTemplateExpression,
  72. TemplateElement,
  73. TemplateLiteral,
  74. ThisExpression,
  75. ThrowStatement,
  76. TryStatement,
  77. UnaryExpression,
  78. UpdateExpression,
  79. VariableDeclaration,
  80. VariableDeclarator,
  81. WhileStatement,
  82. WithStatement,
  83. YieldExpression
  84. } from "estree";
  85. import { Dirent } from "fs";
  86. import {
  87. IncomingMessage,
  88. ServerOptions as ServerOptionsImport,
  89. ServerResponse
  90. } from "http";
  91. import { ListenOptions, Server } from "net";
  92. import { validate as validateFunction } from "schema-utils";
  93. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  94. import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
  95. import {
  96. AsArray,
  97. AsyncParallelHook,
  98. AsyncSeriesBailHook,
  99. AsyncSeriesHook,
  100. AsyncSeriesWaterfallHook,
  101. HookMap,
  102. MultiHook,
  103. SyncBailHook,
  104. SyncHook,
  105. SyncWaterfallHook
  106. } from "tapable";
  107. import { SecureContextOptions, TlsOptions } from "tls";
  108. declare class AbstractLibraryPlugin<T> {
  109. constructor(__0: {
  110. /**
  111. * name of the plugin
  112. */
  113. pluginName: string;
  114. /**
  115. * used library type
  116. */
  117. type: string;
  118. });
  119. /**
  120. * Apply the plugin
  121. */
  122. apply(compiler: Compiler): void;
  123. parseOptions(library: LibraryOptions): false | T;
  124. finishEntryModule(
  125. module: Module,
  126. entryName: string,
  127. libraryContext: LibraryContext<T>
  128. ): void;
  129. embedInRuntimeBailout(
  130. module: Module,
  131. renderContext: RenderContext,
  132. libraryContext: LibraryContext<T>
  133. ): undefined | string;
  134. strictRuntimeBailout(
  135. renderContext: RenderContext,
  136. libraryContext: LibraryContext<T>
  137. ): undefined | string;
  138. runtimeRequirements(
  139. chunk: Chunk,
  140. set: Set<string>,
  141. libraryContext: LibraryContext<T>
  142. ): void;
  143. render(
  144. source: Source,
  145. renderContext: RenderContext,
  146. libraryContext: LibraryContext<T>
  147. ): Source;
  148. renderStartup(
  149. source: Source,
  150. module: Module,
  151. renderContext: StartupRenderContext,
  152. libraryContext: LibraryContext<T>
  153. ): Source;
  154. chunkHash(
  155. chunk: Chunk,
  156. hash: Hash,
  157. chunkHashContext: ChunkHashContext,
  158. libraryContext: LibraryContext<T>
  159. ): void;
  160. static COMMON_LIBRARY_NAME_MESSAGE: string;
  161. }
  162. declare interface AdditionalData {
  163. [index: string]: any;
  164. webpackAST: object;
  165. }
  166. declare class AggressiveMergingPlugin {
  167. constructor(options?: AggressiveMergingPluginOptions);
  168. options: AggressiveMergingPluginOptions;
  169. /**
  170. * Apply the plugin
  171. */
  172. apply(compiler: Compiler): void;
  173. }
  174. declare interface AggressiveMergingPluginOptions {
  175. /**
  176. * minimal size reduction to trigger merging
  177. */
  178. minSizeReduce?: number;
  179. }
  180. declare class AggressiveSplittingPlugin {
  181. constructor(options?: AggressiveSplittingPluginOptions);
  182. options: AggressiveSplittingPluginOptions;
  183. /**
  184. * Apply the plugin
  185. */
  186. apply(compiler: Compiler): void;
  187. static wasChunkRecorded(chunk: Chunk): boolean;
  188. }
  189. declare interface AggressiveSplittingPluginOptions {
  190. /**
  191. * Extra cost for each chunk (Default: 9.8kiB).
  192. */
  193. chunkOverhead?: number;
  194. /**
  195. * Extra cost multiplicator for entry chunks (Default: 10).
  196. */
  197. entryChunkMultiplicator?: number;
  198. /**
  199. * Byte, max size of per file (Default: 50kiB).
  200. */
  201. maxSize?: number;
  202. /**
  203. * Byte, split point. (Default: 30kiB).
  204. */
  205. minSize?: number;
  206. }
  207. type Alias = string | false | string[];
  208. declare interface AliasOption {
  209. alias: Alias;
  210. name: string;
  211. onlyModule?: boolean;
  212. }
  213. type AliasOptionNewRequest = string | false | string[];
  214. declare interface AliasOptions {
  215. [index: string]: AliasOptionNewRequest;
  216. }
  217. declare interface Argument {
  218. description: string;
  219. simpleType: "string" | "number" | "boolean";
  220. multiple: boolean;
  221. configs: ArgumentConfig[];
  222. }
  223. declare interface ArgumentConfig {
  224. description: string;
  225. negatedDescription?: string;
  226. path: string;
  227. multiple: boolean;
  228. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  229. values?: any[];
  230. }
  231. declare interface Assertions {
  232. [index: string]: any;
  233. }
  234. declare interface Asset {
  235. /**
  236. * the filename of the asset
  237. */
  238. name: string;
  239. /**
  240. * source of the asset
  241. */
  242. source: Source;
  243. /**
  244. * info about the asset
  245. */
  246. info: AssetInfo;
  247. }
  248. declare interface AssetEmittedInfo {
  249. content: Buffer;
  250. source: Source;
  251. compilation: Compilation;
  252. outputPath: string;
  253. targetPath: string;
  254. }
  255. type AssetFilterItemTypes =
  256. | string
  257. | RegExp
  258. | ((name: string, asset: StatsAsset) => boolean);
  259. /**
  260. * Options object for data url generation.
  261. */
  262. declare interface AssetGeneratorDataUrlOptions {
  263. /**
  264. * Asset encoding (defaults to base64).
  265. */
  266. encoding?: false | "base64";
  267. /**
  268. * Asset mimetype (getting from file extension by default).
  269. */
  270. mimetype?: string;
  271. }
  272. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  273. AssetResourceGeneratorOptions;
  274. type AssetInfo = KnownAssetInfo & Record<string, any>;
  275. /**
  276. * Generator options for asset/inline modules.
  277. */
  278. declare interface AssetInlineGeneratorOptions {
  279. /**
  280. * The options for data url generator.
  281. */
  282. dataUrl?:
  283. | AssetGeneratorDataUrlOptions
  284. | ((
  285. source: string | Buffer,
  286. context: { filename: string; module: Module }
  287. ) => string);
  288. }
  289. /**
  290. * Options object for DataUrl condition.
  291. */
  292. declare interface AssetParserDataUrlOptions {
  293. /**
  294. * Maximum size of asset that should be inline as modules. Default: 8kb.
  295. */
  296. maxSize?: number;
  297. }
  298. /**
  299. * Parser options for asset modules.
  300. */
  301. declare interface AssetParserOptions {
  302. /**
  303. * The condition for inlining the asset as DataUrl.
  304. */
  305. dataUrlCondition?:
  306. | AssetParserDataUrlOptions
  307. | ((
  308. source: string | Buffer,
  309. context: { filename: string; module: Module }
  310. ) => boolean);
  311. }
  312. /**
  313. * Generator options for asset/resource modules.
  314. */
  315. declare interface AssetResourceGeneratorOptions {
  316. /**
  317. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  318. */
  319. emit?: boolean;
  320. /**
  321. * Specifies the filename template of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  322. */
  323. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  324. /**
  325. * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
  326. */
  327. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  328. /**
  329. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  330. */
  331. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  332. }
  333. declare class AsyncDependenciesBlock extends DependenciesBlock {
  334. constructor(
  335. groupOptions:
  336. | null
  337. | (RawChunkGroupOptions & { name?: string } & {
  338. entryOptions?: EntryOptions;
  339. }),
  340. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  341. request?: null | string
  342. );
  343. groupOptions: RawChunkGroupOptions & { name?: string } & {
  344. entryOptions?: EntryOptions;
  345. };
  346. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  347. request?: null | string;
  348. chunkName?: string;
  349. module: any;
  350. }
  351. declare abstract class AsyncQueue<T, K, R> {
  352. hooks: {
  353. beforeAdd: AsyncSeriesHook<[T]>;
  354. added: SyncHook<[T]>;
  355. beforeStart: AsyncSeriesHook<[T]>;
  356. started: SyncHook<[T]>;
  357. result: SyncHook<[T, Error, R]>;
  358. };
  359. add(item: T, callback: CallbackAsyncQueue<R>): void;
  360. invalidate(item: T): void;
  361. /**
  362. * Waits for an already started item
  363. */
  364. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  365. stop(): void;
  366. increaseParallelism(): void;
  367. decreaseParallelism(): void;
  368. isProcessing(item: T): boolean;
  369. isQueued(item: T): boolean;
  370. isDone(item: T): boolean;
  371. clear(): void;
  372. }
  373. declare class AsyncWebAssemblyModulesPlugin {
  374. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  375. options: AsyncWebAssemblyModulesPluginOptions;
  376. /**
  377. * Apply the plugin
  378. */
  379. apply(compiler: Compiler): void;
  380. renderModule(
  381. module: Module,
  382. renderContext: WebAssemblyRenderContext,
  383. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  384. ): Source;
  385. static getCompilationHooks(
  386. compilation: Compilation
  387. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  388. }
  389. declare interface AsyncWebAssemblyModulesPluginOptions {
  390. /**
  391. * mangle imports
  392. */
  393. mangleImports?: boolean;
  394. }
  395. declare class AutomaticPrefetchPlugin {
  396. constructor();
  397. /**
  398. * Apply the plugin
  399. */
  400. apply(compiler: Compiler): void;
  401. }
  402. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  403. declare interface BackendApi {
  404. dispose: (arg0?: Error) => void;
  405. module: (arg0: Module) => { client: string; data: string; active: boolean };
  406. }
  407. declare class BannerPlugin {
  408. constructor(options: BannerPluginArgument);
  409. options: BannerPluginOptions;
  410. banner: (data: { hash: string; chunk: Chunk; filename: string }) => string;
  411. /**
  412. * Apply the plugin
  413. */
  414. apply(compiler: Compiler): void;
  415. }
  416. type BannerPluginArgument =
  417. | string
  418. | BannerPluginOptions
  419. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  420. declare interface BannerPluginOptions {
  421. /**
  422. * Specifies the banner.
  423. */
  424. banner:
  425. | string
  426. | ((data: { hash: string; chunk: Chunk; filename: string }) => string);
  427. /**
  428. * If true, the banner will only be added to the entry chunks.
  429. */
  430. entryOnly?: boolean;
  431. /**
  432. * Exclude all modules matching any of these conditions.
  433. */
  434. exclude?: string | RegExp | Rule[];
  435. /**
  436. * If true, banner will be placed at the end of the output.
  437. */
  438. footer?: boolean;
  439. /**
  440. * Include all modules matching any of these conditions.
  441. */
  442. include?: string | RegExp | Rule[];
  443. /**
  444. * If true, banner will not be wrapped in a comment.
  445. */
  446. raw?: boolean;
  447. /**
  448. * Include all modules that pass test assertion.
  449. */
  450. test?: string | RegExp | Rule[];
  451. }
  452. declare interface BaseResolveRequest {
  453. path: string | false;
  454. context?: object;
  455. descriptionFilePath?: string;
  456. descriptionFileRoot?: string;
  457. descriptionFileData?: JsonObject;
  458. relativePath?: string;
  459. ignoreSymlinks?: boolean;
  460. fullySpecified?: boolean;
  461. __innerRequest?: string;
  462. __innerRequest_request?: string;
  463. __innerRequest_relativePath?: string;
  464. }
  465. declare abstract class BasicEvaluatedExpression {
  466. type: number;
  467. range?: [number, number];
  468. falsy: boolean;
  469. truthy: boolean;
  470. nullish?: boolean;
  471. sideEffects: boolean;
  472. bool?: boolean;
  473. number?: number;
  474. bigint?: bigint;
  475. regExp?: RegExp;
  476. string?: string;
  477. quasis?: BasicEvaluatedExpression[];
  478. parts?: BasicEvaluatedExpression[];
  479. array?: any[];
  480. items?: BasicEvaluatedExpression[];
  481. options?: BasicEvaluatedExpression[];
  482. prefix?: null | BasicEvaluatedExpression;
  483. postfix?: null | BasicEvaluatedExpression;
  484. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  485. identifier?: string | VariableInfoInterface;
  486. rootInfo?: string | VariableInfoInterface;
  487. getMembers?: () => string[];
  488. getMembersOptionals?: () => boolean[];
  489. getMemberRanges?: () => [number, number][];
  490. expression?:
  491. | UnaryExpression
  492. | ArrayExpression
  493. | ArrowFunctionExpression
  494. | AssignmentExpression
  495. | AwaitExpression
  496. | BinaryExpression
  497. | SimpleCallExpression
  498. | NewExpression
  499. | ChainExpression
  500. | ClassExpression
  501. | ConditionalExpression
  502. | FunctionExpression
  503. | Identifier
  504. | ImportExpression
  505. | SimpleLiteral
  506. | RegExpLiteral
  507. | BigIntLiteral
  508. | LogicalExpression
  509. | MemberExpression
  510. | MetaProperty
  511. | ObjectExpression
  512. | SequenceExpression
  513. | TaggedTemplateExpression
  514. | TemplateLiteral
  515. | ThisExpression
  516. | UpdateExpression
  517. | YieldExpression
  518. | FunctionDeclaration
  519. | VariableDeclaration
  520. | ClassDeclaration
  521. | PrivateIdentifier
  522. | ExpressionStatement
  523. | BlockStatement
  524. | StaticBlock
  525. | EmptyStatement
  526. | DebuggerStatement
  527. | WithStatement
  528. | ReturnStatement
  529. | LabeledStatement
  530. | BreakStatement
  531. | ContinueStatement
  532. | IfStatement
  533. | SwitchStatement
  534. | ThrowStatement
  535. | TryStatement
  536. | WhileStatement
  537. | DoWhileStatement
  538. | ForStatement
  539. | ForInStatement
  540. | ForOfStatement
  541. | ImportDeclaration
  542. | ExportNamedDeclaration
  543. | ExportDefaultDeclaration
  544. | ExportAllDeclaration
  545. | MethodDefinition
  546. | PropertyDefinition
  547. | VariableDeclarator
  548. | Program
  549. | SwitchCase
  550. | CatchClause
  551. | ObjectPattern
  552. | ArrayPattern
  553. | RestElement
  554. | AssignmentPattern
  555. | SpreadElement
  556. | Property
  557. | AssignmentProperty
  558. | ClassBody
  559. | ImportSpecifier
  560. | ImportDefaultSpecifier
  561. | ImportNamespaceSpecifier
  562. | ExportSpecifier
  563. | Super
  564. | TemplateElement;
  565. isUnknown(): boolean;
  566. isNull(): boolean;
  567. isUndefined(): boolean;
  568. isString(): boolean;
  569. isNumber(): boolean;
  570. isBigInt(): boolean;
  571. isBoolean(): boolean;
  572. isRegExp(): boolean;
  573. isConditional(): boolean;
  574. isArray(): boolean;
  575. isConstArray(): boolean;
  576. isIdentifier(): boolean;
  577. isWrapped(): boolean;
  578. isTemplateString(): boolean;
  579. /**
  580. * Is expression a primitive or an object type value?
  581. */
  582. isPrimitiveType(): undefined | boolean;
  583. /**
  584. * Is expression a runtime or compile-time value?
  585. */
  586. isCompileTimeValue(): boolean;
  587. /**
  588. * Gets the compile-time value of the expression
  589. */
  590. asCompileTimeValue(): any;
  591. isTruthy(): boolean;
  592. isFalsy(): boolean;
  593. isNullish(): undefined | boolean;
  594. /**
  595. * Can this expression have side effects?
  596. */
  597. couldHaveSideEffects(): boolean;
  598. /**
  599. * Creates a boolean representation of this evaluated expression.
  600. */
  601. asBool(): undefined | boolean;
  602. /**
  603. * Creates a nullish coalescing representation of this evaluated expression.
  604. */
  605. asNullish(): undefined | boolean;
  606. /**
  607. * Creates a string representation of this evaluated expression.
  608. */
  609. asString(): undefined | string;
  610. setString(string: string): BasicEvaluatedExpression;
  611. setUndefined(): BasicEvaluatedExpression;
  612. setNull(): BasicEvaluatedExpression;
  613. /**
  614. * Set's the value of this expression to a number
  615. */
  616. setNumber(number: number): BasicEvaluatedExpression;
  617. /**
  618. * Set's the value of this expression to a BigInt
  619. */
  620. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  621. /**
  622. * Set's the value of this expression to a boolean
  623. */
  624. setBoolean(bool: boolean): BasicEvaluatedExpression;
  625. /**
  626. * Set's the value of this expression to a regular expression
  627. */
  628. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  629. /**
  630. * Set's the value of this expression to a particular identifier and its members.
  631. */
  632. setIdentifier(
  633. identifier: string | VariableInfoInterface,
  634. rootInfo: string | VariableInfoInterface,
  635. getMembers: () => string[],
  636. getMembersOptionals?: () => boolean[],
  637. getMemberRanges?: () => [number, number][]
  638. ): BasicEvaluatedExpression;
  639. /**
  640. * Wraps an array of expressions with a prefix and postfix expression.
  641. */
  642. setWrapped(
  643. prefix: undefined | null | BasicEvaluatedExpression,
  644. postfix: undefined | null | BasicEvaluatedExpression,
  645. innerExpressions: BasicEvaluatedExpression[]
  646. ): BasicEvaluatedExpression;
  647. /**
  648. * Stores the options of a conditional expression.
  649. */
  650. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  651. /**
  652. * Adds options to a conditional expression.
  653. */
  654. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  655. /**
  656. * Set's the value of this expression to an array of expressions.
  657. */
  658. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  659. /**
  660. * Set's the value of this expression to an array of strings.
  661. */
  662. setArray(array: string[]): BasicEvaluatedExpression;
  663. /**
  664. * Set's the value of this expression to a processed/unprocessed template string. Used
  665. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  666. */
  667. setTemplateString(
  668. quasis: BasicEvaluatedExpression[],
  669. parts: BasicEvaluatedExpression[],
  670. kind: "raw" | "cooked"
  671. ): BasicEvaluatedExpression;
  672. templateStringKind?: "raw" | "cooked";
  673. setTruthy(): BasicEvaluatedExpression;
  674. setFalsy(): BasicEvaluatedExpression;
  675. /**
  676. * Set's the value of the expression to nullish.
  677. */
  678. setNullish(value: boolean): BasicEvaluatedExpression;
  679. /**
  680. * Set's the range for the expression.
  681. */
  682. setRange(range: [number, number]): BasicEvaluatedExpression;
  683. /**
  684. * Set whether or not the expression has side effects.
  685. */
  686. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  687. /**
  688. * Set the expression node for the expression.
  689. */
  690. setExpression(
  691. expression?:
  692. | UnaryExpression
  693. | ArrayExpression
  694. | ArrowFunctionExpression
  695. | AssignmentExpression
  696. | AwaitExpression
  697. | BinaryExpression
  698. | SimpleCallExpression
  699. | NewExpression
  700. | ChainExpression
  701. | ClassExpression
  702. | ConditionalExpression
  703. | FunctionExpression
  704. | Identifier
  705. | ImportExpression
  706. | SimpleLiteral
  707. | RegExpLiteral
  708. | BigIntLiteral
  709. | LogicalExpression
  710. | MemberExpression
  711. | MetaProperty
  712. | ObjectExpression
  713. | SequenceExpression
  714. | TaggedTemplateExpression
  715. | TemplateLiteral
  716. | ThisExpression
  717. | UpdateExpression
  718. | YieldExpression
  719. | FunctionDeclaration
  720. | VariableDeclaration
  721. | ClassDeclaration
  722. | PrivateIdentifier
  723. | ExpressionStatement
  724. | BlockStatement
  725. | StaticBlock
  726. | EmptyStatement
  727. | DebuggerStatement
  728. | WithStatement
  729. | ReturnStatement
  730. | LabeledStatement
  731. | BreakStatement
  732. | ContinueStatement
  733. | IfStatement
  734. | SwitchStatement
  735. | ThrowStatement
  736. | TryStatement
  737. | WhileStatement
  738. | DoWhileStatement
  739. | ForStatement
  740. | ForInStatement
  741. | ForOfStatement
  742. | ImportDeclaration
  743. | ExportNamedDeclaration
  744. | ExportDefaultDeclaration
  745. | ExportAllDeclaration
  746. | MethodDefinition
  747. | PropertyDefinition
  748. | VariableDeclarator
  749. | Program
  750. | SwitchCase
  751. | CatchClause
  752. | ObjectPattern
  753. | ArrayPattern
  754. | RestElement
  755. | AssignmentPattern
  756. | SpreadElement
  757. | Property
  758. | AssignmentProperty
  759. | ClassBody
  760. | ImportSpecifier
  761. | ImportDefaultSpecifier
  762. | ImportNamespaceSpecifier
  763. | ExportSpecifier
  764. | Super
  765. | TemplateElement
  766. ): BasicEvaluatedExpression;
  767. }
  768. declare interface BuildInfo {
  769. [index: string]: any;
  770. }
  771. type BuildMeta = KnownBuildMeta & Record<string, any>;
  772. declare abstract class ByTypeGenerator extends Generator {
  773. map: Record<string, Generator>;
  774. }
  775. declare const CIRCULAR_CONNECTION: unique symbol;
  776. declare class Cache {
  777. constructor();
  778. hooks: {
  779. get: AsyncSeriesBailHook<
  780. [
  781. string,
  782. null | Etag,
  783. ((result: any, callback: (arg0?: Error) => void) => void)[]
  784. ],
  785. any
  786. >;
  787. store: AsyncParallelHook<[string, null | Etag, any]>;
  788. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  789. beginIdle: SyncHook<[]>;
  790. endIdle: AsyncParallelHook<[]>;
  791. shutdown: AsyncParallelHook<[]>;
  792. };
  793. get<T>(
  794. identifier: string,
  795. etag: null | Etag,
  796. callback: CallbackCache<T>
  797. ): void;
  798. store<T>(
  799. identifier: string,
  800. etag: null | Etag,
  801. data: T,
  802. callback: CallbackCache<void>
  803. ): void;
  804. /**
  805. * After this method has succeeded the cache can only be restored when build dependencies are
  806. */
  807. storeBuildDependencies(
  808. dependencies: Iterable<string>,
  809. callback: CallbackCache<void>
  810. ): void;
  811. beginIdle(): void;
  812. endIdle(callback: CallbackCache<void>): void;
  813. shutdown(callback: CallbackCache<void>): void;
  814. static STAGE_MEMORY: number;
  815. static STAGE_DEFAULT: number;
  816. static STAGE_DISK: number;
  817. static STAGE_NETWORK: number;
  818. }
  819. declare abstract class CacheFacade {
  820. getChildCache(name: string): CacheFacade;
  821. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  822. getLazyHashedEtag(obj: HashableObject): Etag;
  823. mergeEtags(a: Etag, b: Etag): Etag;
  824. get<T>(
  825. identifier: string,
  826. etag: null | Etag,
  827. callback: CallbackCache<T>
  828. ): void;
  829. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  830. store<T>(
  831. identifier: string,
  832. etag: null | Etag,
  833. data: T,
  834. callback: CallbackCache<void>
  835. ): void;
  836. storePromise<T>(
  837. identifier: string,
  838. etag: null | Etag,
  839. data: T
  840. ): Promise<void>;
  841. provide<T>(
  842. identifier: string,
  843. etag: null | Etag,
  844. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  845. callback: CallbackNormalErrorCache<T>
  846. ): void;
  847. providePromise<T>(
  848. identifier: string,
  849. etag: null | Etag,
  850. computer: () => T | Promise<T>
  851. ): Promise<T>;
  852. }
  853. declare interface CacheGroupSource {
  854. key?: string;
  855. priority?: number;
  856. getName?: (
  857. module?: Module,
  858. chunks?: Chunk[],
  859. key?: string
  860. ) => undefined | string;
  861. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  862. enforce?: boolean;
  863. minSize: SplitChunksSizes;
  864. minSizeReduction: SplitChunksSizes;
  865. minRemainingSize: SplitChunksSizes;
  866. enforceSizeThreshold: SplitChunksSizes;
  867. maxAsyncSize: SplitChunksSizes;
  868. maxInitialSize: SplitChunksSizes;
  869. minChunks?: number;
  870. maxAsyncRequests?: number;
  871. maxInitialRequests?: number;
  872. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  873. idHint?: string;
  874. automaticNameDelimiter?: string;
  875. reuseExistingChunk?: boolean;
  876. usedExports?: boolean;
  877. }
  878. declare interface CacheGroupsContext {
  879. moduleGraph: ModuleGraph;
  880. chunkGraph: ChunkGraph;
  881. }
  882. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  883. declare class CachedSource extends Source {
  884. constructor(source: Source);
  885. constructor(source: Source | (() => Source), cachedData?: any);
  886. original(): Source;
  887. originalLazy(): Source | (() => Source);
  888. getCachedData(): any;
  889. }
  890. type CallExpression = SimpleCallExpression | NewExpression;
  891. declare interface CallExpressionInfo {
  892. type: "call";
  893. call: CallExpression;
  894. calleeName: string;
  895. rootInfo: string | VariableInfo;
  896. getCalleeMembers: () => string[];
  897. name: string;
  898. getMembers: () => string[];
  899. getMembersOptionals: () => boolean[];
  900. getMemberRanges: () => [number, number][];
  901. }
  902. declare interface CallbackAsyncQueue<T> {
  903. (err?: null | WebpackError, result?: T): any;
  904. }
  905. declare interface CallbackCache<T> {
  906. (err?: null | WebpackError, result?: T): void;
  907. }
  908. declare interface CallbackFunction<T> {
  909. (err?: null | Error, result?: T): any;
  910. }
  911. declare interface CallbackNormalErrorCache<T> {
  912. (err?: null | Error, result?: T): void;
  913. }
  914. declare interface CallbackWebpack<T> {
  915. (err?: Error, stats?: T): void;
  916. }
  917. type Cell<T> = undefined | T;
  918. declare class Chunk {
  919. constructor(name?: string, backCompat?: boolean);
  920. id: null | string | number;
  921. ids: null | ChunkId[];
  922. debugId: number;
  923. name?: string;
  924. idNameHints: SortableSet<string>;
  925. preventIntegration: boolean;
  926. filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  927. cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  928. runtime: RuntimeSpec;
  929. files: Set<string>;
  930. auxiliaryFiles: Set<string>;
  931. rendered: boolean;
  932. hash?: string;
  933. contentHash: Record<string, string>;
  934. renderedHash?: string;
  935. chunkReason?: string;
  936. extraAsync: boolean;
  937. get entryModule(): Module;
  938. hasEntryModule(): boolean;
  939. addModule(module: Module): boolean;
  940. removeModule(module: Module): void;
  941. getNumberOfModules(): number;
  942. get modulesIterable(): Iterable<Module>;
  943. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  944. containsModule(module: Module): boolean;
  945. getModules(): Module[];
  946. remove(): void;
  947. moveModule(module: Module, otherChunk: Chunk): void;
  948. integrate(otherChunk: Chunk): boolean;
  949. canBeIntegrated(otherChunk: Chunk): boolean;
  950. isEmpty(): boolean;
  951. modulesSize(): number;
  952. size(options?: ChunkSizeOptions): number;
  953. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  954. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  955. hasModuleInGraph(
  956. filterFn: (m: Module) => boolean,
  957. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  958. ): boolean;
  959. getChunkMaps(realHash: boolean): ChunkMaps;
  960. hasRuntime(): boolean;
  961. canBeInitial(): boolean;
  962. isOnlyInitial(): boolean;
  963. getEntryOptions(): undefined | EntryOptions;
  964. addGroup(chunkGroup: ChunkGroup): void;
  965. removeGroup(chunkGroup: ChunkGroup): void;
  966. isInGroup(chunkGroup: ChunkGroup): boolean;
  967. getNumberOfGroups(): number;
  968. get groupsIterable(): SortableSet<ChunkGroup>;
  969. disconnectFromGroups(): void;
  970. split(newChunk: Chunk): void;
  971. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  972. getAllAsyncChunks(): Set<Chunk>;
  973. getAllInitialChunks(): Set<Chunk>;
  974. getAllReferencedChunks(): Set<Chunk>;
  975. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  976. hasAsyncChunks(): boolean;
  977. getChildIdsByOrders(
  978. chunkGraph: ChunkGraph,
  979. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  980. ): Record<string, (string | number)[]>;
  981. getChildrenOfTypeInOrder(
  982. chunkGraph: ChunkGraph,
  983. type: string
  984. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  985. getChildIdsByOrdersMap(
  986. chunkGraph: ChunkGraph,
  987. includeDirectChildren?: boolean,
  988. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  989. ): Record<string | number, Record<string, (string | number)[]>>;
  990. }
  991. declare class ChunkGraph {
  992. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  993. moduleGraph: ModuleGraph;
  994. connectChunkAndModule(chunk: Chunk, module: Module): void;
  995. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  996. disconnectChunk(chunk: Chunk): void;
  997. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  998. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  999. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1000. attachDependentHashModules(
  1001. chunk: Chunk,
  1002. modules: Iterable<RuntimeModule>
  1003. ): void;
  1004. replaceModule(oldModule: Module, newModule: Module): void;
  1005. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1006. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1007. isEntryModule(module: Module): boolean;
  1008. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1009. getOrderedModuleChunksIterable(
  1010. module: Module,
  1011. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  1012. ): Iterable<Chunk>;
  1013. getModuleChunks(module: Module): Chunk[];
  1014. getNumberOfModuleChunks(module: Module): number;
  1015. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1016. getNumberOfChunkModules(chunk: Chunk): number;
  1017. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1018. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1019. getChunkModulesIterableBySourceType(
  1020. chunk: Chunk,
  1021. sourceType: string
  1022. ): undefined | Iterable<Module>;
  1023. setChunkModuleSourceTypes(
  1024. chunk: Chunk,
  1025. module: Module,
  1026. sourceTypes: Set<string>
  1027. ): void;
  1028. getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
  1029. getModuleSourceTypes(module: Module): Set<string>;
  1030. getOrderedChunkModulesIterable(
  1031. chunk: Chunk,
  1032. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1033. ): Iterable<Module>;
  1034. getOrderedChunkModulesIterableBySourceType(
  1035. chunk: Chunk,
  1036. sourceType: string,
  1037. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1038. ): undefined | Iterable<Module>;
  1039. getChunkModules(chunk: Chunk): Module[];
  1040. getOrderedChunkModules(
  1041. chunk: Chunk,
  1042. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1043. ): Module[];
  1044. getChunkModuleIdMap(
  1045. chunk: Chunk,
  1046. filterFn: (m: Module) => boolean,
  1047. includeAllChunks?: boolean
  1048. ): Record<string | number, (string | number)[]>;
  1049. getChunkModuleRenderedHashMap(
  1050. chunk: Chunk,
  1051. filterFn: (m: Module) => boolean,
  1052. hashLength?: number,
  1053. includeAllChunks?: boolean
  1054. ): Record<string | number, Record<string | number, string>>;
  1055. getChunkConditionMap(
  1056. chunk: Chunk,
  1057. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1058. ): Record<string | number, boolean>;
  1059. hasModuleInGraph(
  1060. chunk: Chunk,
  1061. filterFn: (m: Module) => boolean,
  1062. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1063. ): boolean;
  1064. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1065. getChunkModulesSize(chunk: Chunk): number;
  1066. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1067. getChunkRootModules(chunk: Chunk): Module[];
  1068. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1069. getIntegratedChunksSize(
  1070. chunkA: Chunk,
  1071. chunkB: Chunk,
  1072. options?: ChunkSizeOptions
  1073. ): number;
  1074. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1075. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1076. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1077. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1078. connectChunkAndEntryModule(
  1079. chunk: Chunk,
  1080. module: Module,
  1081. entrypoint?: Entrypoint
  1082. ): void;
  1083. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1084. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1085. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1086. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1087. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1088. disconnectEntryModule(module: Module): void;
  1089. disconnectEntries(chunk: Chunk): void;
  1090. getNumberOfEntryModules(chunk: Chunk): number;
  1091. getNumberOfRuntimeModules(chunk: Chunk): number;
  1092. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1093. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1094. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1095. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1096. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1097. getChunkFullHashModulesIterable(
  1098. chunk: Chunk
  1099. ): undefined | Iterable<RuntimeModule>;
  1100. getChunkFullHashModulesSet(
  1101. chunk: Chunk
  1102. ): undefined | ReadonlySet<RuntimeModule>;
  1103. getChunkDependentHashModulesIterable(
  1104. chunk: Chunk
  1105. ): undefined | Iterable<RuntimeModule>;
  1106. getChunkEntryModulesWithChunkGroupIterable(
  1107. chunk: Chunk
  1108. ): Iterable<[Module, undefined | Entrypoint]>;
  1109. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): ChunkGroup;
  1110. connectBlockAndChunkGroup(
  1111. depBlock: AsyncDependenciesBlock,
  1112. chunkGroup: ChunkGroup
  1113. ): void;
  1114. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1115. getModuleId(module: Module): string | number;
  1116. setModuleId(module: Module, id: string | number): void;
  1117. getRuntimeId(runtime: string): string | number;
  1118. setRuntimeId(runtime: string, id: string | number): void;
  1119. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1120. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1121. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1122. setModuleHashes(
  1123. module: Module,
  1124. runtime: RuntimeSpec,
  1125. hash: string,
  1126. renderedHash: string
  1127. ): void;
  1128. addModuleRuntimeRequirements(
  1129. module: Module,
  1130. runtime: RuntimeSpec,
  1131. items: Set<string>,
  1132. transferOwnership?: boolean
  1133. ): void;
  1134. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1135. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1136. getModuleRuntimeRequirements(
  1137. module: Module,
  1138. runtime: RuntimeSpec
  1139. ): ReadonlySet<string>;
  1140. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1141. getModuleGraphHash(
  1142. module: Module,
  1143. runtime: RuntimeSpec,
  1144. withConnections?: boolean
  1145. ): string;
  1146. getModuleGraphHashBigInt(
  1147. module: Module,
  1148. runtime: RuntimeSpec,
  1149. withConnections?: boolean
  1150. ): bigint;
  1151. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1152. static getChunkGraphForModule(
  1153. module: Module,
  1154. deprecateMessage: string,
  1155. deprecationCode: string
  1156. ): ChunkGraph;
  1157. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1158. static clearChunkGraphForModule(module: Module): void;
  1159. static getChunkGraphForChunk(
  1160. chunk: Chunk,
  1161. deprecateMessage: string,
  1162. deprecationCode: string
  1163. ): ChunkGraph;
  1164. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1165. static clearChunkGraphForChunk(chunk: Chunk): void;
  1166. }
  1167. declare abstract class ChunkGroup {
  1168. groupDebugId: number;
  1169. options: ChunkGroupOptions;
  1170. chunks: Chunk[];
  1171. origins: OriginRecord[];
  1172. index?: number;
  1173. /**
  1174. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1175. */
  1176. addOptions(options: ChunkGroupOptions): void;
  1177. /**
  1178. * returns the name of current ChunkGroup
  1179. * sets a new name for current ChunkGroup
  1180. */
  1181. name?: string;
  1182. /**
  1183. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1184. */
  1185. get debugId(): string;
  1186. /**
  1187. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1188. */
  1189. get id(): string;
  1190. /**
  1191. * Performs an unshift of a specific chunk
  1192. */
  1193. unshiftChunk(chunk: Chunk): boolean;
  1194. /**
  1195. * inserts a chunk before another existing chunk in group
  1196. */
  1197. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1198. /**
  1199. * add a chunk into ChunkGroup. Is pushed on or prepended
  1200. */
  1201. pushChunk(chunk: Chunk): boolean;
  1202. replaceChunk(oldChunk: Chunk, newChunk: Chunk): boolean;
  1203. removeChunk(chunk: Chunk): boolean;
  1204. isInitial(): boolean;
  1205. addChild(group: ChunkGroup): boolean;
  1206. getChildren(): ChunkGroup[];
  1207. getNumberOfChildren(): number;
  1208. get childrenIterable(): SortableSet<ChunkGroup>;
  1209. removeChild(group: ChunkGroup): boolean;
  1210. addParent(parentChunk: ChunkGroup): boolean;
  1211. getParents(): ChunkGroup[];
  1212. getNumberOfParents(): number;
  1213. hasParent(parent: ChunkGroup): boolean;
  1214. get parentsIterable(): SortableSet<ChunkGroup>;
  1215. removeParent(chunkGroup: ChunkGroup): boolean;
  1216. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1217. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1218. getBlocks(): AsyncDependenciesBlock[];
  1219. getNumberOfBlocks(): number;
  1220. hasBlock(block: AsyncDependenciesBlock): boolean;
  1221. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1222. addBlock(block: AsyncDependenciesBlock): boolean;
  1223. addOrigin(module: Module, loc: DependencyLocation, request: string): void;
  1224. getFiles(): string[];
  1225. remove(): void;
  1226. sortItems(): void;
  1227. /**
  1228. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1229. * Sorting values are based off of number of chunks in ChunkGroup.
  1230. */
  1231. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1232. getChildrenByOrders(
  1233. moduleGraph: ModuleGraph,
  1234. chunkGraph: ChunkGraph
  1235. ): Record<string, ChunkGroup[]>;
  1236. /**
  1237. * Sets the top-down index of a module in this ChunkGroup
  1238. */
  1239. setModulePreOrderIndex(module: Module, index: number): void;
  1240. /**
  1241. * Gets the top-down index of a module in this ChunkGroup
  1242. */
  1243. getModulePreOrderIndex(module: Module): undefined | number;
  1244. /**
  1245. * Sets the bottom-up index of a module in this ChunkGroup
  1246. */
  1247. setModulePostOrderIndex(module: Module, index: number): void;
  1248. /**
  1249. * Gets the bottom-up index of a module in this ChunkGroup
  1250. */
  1251. getModulePostOrderIndex(module: Module): undefined | number;
  1252. checkConstraints(): void;
  1253. getModuleIndex: (module: Module) => undefined | number;
  1254. getModuleIndex2: (module: Module) => undefined | number;
  1255. }
  1256. type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
  1257. declare interface ChunkHashContext {
  1258. /**
  1259. * results of code generation
  1260. */
  1261. codeGenerationResults: CodeGenerationResults;
  1262. /**
  1263. * the runtime template
  1264. */
  1265. runtimeTemplate: RuntimeTemplate;
  1266. /**
  1267. * the module graph
  1268. */
  1269. moduleGraph: ModuleGraph;
  1270. /**
  1271. * the chunk graph
  1272. */
  1273. chunkGraph: ChunkGraph;
  1274. }
  1275. type ChunkId = string | number;
  1276. declare interface ChunkMaps {
  1277. hash: Record<string | number, string>;
  1278. contentHash: Record<string | number, Record<string, string>>;
  1279. name: Record<string | number, string>;
  1280. }
  1281. declare class ChunkModuleIdRangePlugin {
  1282. constructor(options: ChunkModuleIdRangePluginOptions);
  1283. options: ChunkModuleIdRangePluginOptions;
  1284. /**
  1285. * Apply the plugin
  1286. */
  1287. apply(compiler: Compiler): void;
  1288. }
  1289. declare interface ChunkModuleIdRangePluginOptions {
  1290. /**
  1291. * the chunk name
  1292. */
  1293. name: string;
  1294. /**
  1295. * order
  1296. */
  1297. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1298. /**
  1299. * start id
  1300. */
  1301. start?: number;
  1302. /**
  1303. * end id
  1304. */
  1305. end?: number;
  1306. }
  1307. declare interface ChunkModuleMaps {
  1308. id: Record<string | number, (string | number)[]>;
  1309. hash: Record<string | number, string>;
  1310. }
  1311. declare interface ChunkPathData {
  1312. id: string | number;
  1313. name?: string;
  1314. hash: string;
  1315. hashWithLength?: (arg0: number) => string;
  1316. contentHash?: Record<string, string>;
  1317. contentHashWithLength?: Record<string, (length: number) => string>;
  1318. }
  1319. declare class ChunkPrefetchPreloadPlugin {
  1320. constructor();
  1321. apply(compiler: Compiler): void;
  1322. }
  1323. declare interface ChunkRenderContext {
  1324. /**
  1325. * the chunk
  1326. */
  1327. chunk: Chunk;
  1328. /**
  1329. * the dependency templates
  1330. */
  1331. dependencyTemplates: DependencyTemplates;
  1332. /**
  1333. * the runtime template
  1334. */
  1335. runtimeTemplate: RuntimeTemplate;
  1336. /**
  1337. * the module graph
  1338. */
  1339. moduleGraph: ModuleGraph;
  1340. /**
  1341. * the chunk graph
  1342. */
  1343. chunkGraph: ChunkGraph;
  1344. /**
  1345. * results of code generation
  1346. */
  1347. codeGenerationResults: CodeGenerationResults;
  1348. /**
  1349. * init fragments for the chunk
  1350. */
  1351. chunkInitFragments: InitFragment<ChunkRenderContext>[];
  1352. /**
  1353. * rendering in strict context
  1354. */
  1355. strictMode: boolean;
  1356. }
  1357. declare interface ChunkSizeOptions {
  1358. /**
  1359. * constant overhead for a chunk
  1360. */
  1361. chunkOverhead?: number;
  1362. /**
  1363. * multiplicator for initial chunks
  1364. */
  1365. entryChunkMultiplicator?: number;
  1366. }
  1367. declare abstract class ChunkTemplate {
  1368. hooks: Readonly<{
  1369. renderManifest: { tap: (options?: any, fn?: any) => void };
  1370. modules: { tap: (options?: any, fn?: any) => void };
  1371. render: { tap: (options?: any, fn?: any) => void };
  1372. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  1373. hash: { tap: (options?: any, fn?: any) => void };
  1374. hashForChunk: { tap: (options?: any, fn?: any) => void };
  1375. }>;
  1376. get outputOptions(): Output;
  1377. }
  1378. /**
  1379. * Advanced options for cleaning assets.
  1380. */
  1381. declare interface CleanOptions {
  1382. /**
  1383. * Log the assets that should be removed instead of deleting them.
  1384. */
  1385. dry?: boolean;
  1386. /**
  1387. * Keep these assets.
  1388. */
  1389. keep?: string | RegExp | ((filename: string) => boolean);
  1390. }
  1391. declare class CleanPlugin {
  1392. constructor(options?: CleanOptions);
  1393. options: {
  1394. /**
  1395. * Log the assets that should be removed instead of deleting them.
  1396. */
  1397. dry: boolean;
  1398. /**
  1399. * Keep these assets.
  1400. */
  1401. keep?: string | RegExp | ((filename: string) => boolean);
  1402. };
  1403. /**
  1404. * Apply the plugin
  1405. */
  1406. apply(compiler: Compiler): void;
  1407. static getCompilationHooks(
  1408. compilation: Compilation
  1409. ): CleanPluginCompilationHooks;
  1410. }
  1411. declare interface CleanPluginCompilationHooks {
  1412. /**
  1413. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1414. */
  1415. keep: SyncBailHook<[string], boolean>;
  1416. }
  1417. declare interface CodeGenerationContext {
  1418. /**
  1419. * the dependency templates
  1420. */
  1421. dependencyTemplates: DependencyTemplates;
  1422. /**
  1423. * the runtime template
  1424. */
  1425. runtimeTemplate: RuntimeTemplate;
  1426. /**
  1427. * the module graph
  1428. */
  1429. moduleGraph: ModuleGraph;
  1430. /**
  1431. * the chunk graph
  1432. */
  1433. chunkGraph: ChunkGraph;
  1434. /**
  1435. * the runtimes code should be generated for
  1436. */
  1437. runtime: RuntimeSpec;
  1438. /**
  1439. * when in concatenated module, information about other concatenated modules
  1440. */
  1441. concatenationScope?: ConcatenationScope;
  1442. /**
  1443. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1444. */
  1445. codeGenerationResults: CodeGenerationResults;
  1446. /**
  1447. * the compilation
  1448. */
  1449. compilation?: Compilation;
  1450. /**
  1451. * source types
  1452. */
  1453. sourceTypes?: ReadonlySet<string>;
  1454. }
  1455. declare interface CodeGenerationResult {
  1456. /**
  1457. * the resulting sources for all source types
  1458. */
  1459. sources: Map<string, Source>;
  1460. /**
  1461. * the resulting data for all source types
  1462. */
  1463. data?: Map<string, any>;
  1464. /**
  1465. * the runtime requirements
  1466. */
  1467. runtimeRequirements: ReadonlySet<string>;
  1468. /**
  1469. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1470. */
  1471. hash?: string;
  1472. }
  1473. declare abstract class CodeGenerationResults {
  1474. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1475. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1476. has(module: Module, runtime: RuntimeSpec): boolean;
  1477. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1478. getRuntimeRequirements(
  1479. module: Module,
  1480. runtime: RuntimeSpec
  1481. ): ReadonlySet<string>;
  1482. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1483. getHash(module: Module, runtime: RuntimeSpec): any;
  1484. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1485. }
  1486. type CodeValue =
  1487. | undefined
  1488. | null
  1489. | string
  1490. | number
  1491. | bigint
  1492. | boolean
  1493. | Function
  1494. | RegExp
  1495. | RuntimeValue
  1496. | {
  1497. [index: string]: RecursiveArrayOrRecord<
  1498. | undefined
  1499. | null
  1500. | string
  1501. | number
  1502. | bigint
  1503. | boolean
  1504. | Function
  1505. | RegExp
  1506. | RuntimeValue
  1507. >;
  1508. }
  1509. | RecursiveArrayOrRecord<
  1510. | undefined
  1511. | null
  1512. | string
  1513. | number
  1514. | bigint
  1515. | boolean
  1516. | Function
  1517. | RegExp
  1518. | RuntimeValue
  1519. >[];
  1520. type CodeValuePrimitive =
  1521. | undefined
  1522. | null
  1523. | string
  1524. | number
  1525. | bigint
  1526. | boolean
  1527. | Function
  1528. | RegExp;
  1529. declare interface Comparator<T> {
  1530. (arg0: T, arg1: T): 0 | 1 | -1;
  1531. }
  1532. declare class CompatSource extends Source {
  1533. constructor(sourceLike: SourceLike);
  1534. static from(sourceLike: SourceLike): Source;
  1535. }
  1536. declare class Compilation {
  1537. /**
  1538. * Creates an instance of Compilation.
  1539. */
  1540. constructor(compiler: Compiler, params: CompilationParams);
  1541. hooks: Readonly<{
  1542. buildModule: SyncHook<[Module]>;
  1543. rebuildModule: SyncHook<[Module]>;
  1544. failedModule: SyncHook<[Module, WebpackError]>;
  1545. succeedModule: SyncHook<[Module]>;
  1546. stillValidModule: SyncHook<[Module]>;
  1547. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1548. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1549. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1550. dependencyReferencedExports: SyncWaterfallHook<
  1551. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1552. >;
  1553. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1554. prepareModuleExecution: AsyncParallelHook<
  1555. [ExecuteModuleArgument, ExecuteModuleContext]
  1556. >;
  1557. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1558. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1559. unseal: SyncHook<[]>;
  1560. seal: SyncHook<[]>;
  1561. beforeChunks: SyncHook<[]>;
  1562. /**
  1563. * The `afterChunks` hook is called directly after the chunks and module graph have
  1564. * been created and before the chunks and modules have been optimized. This hook is useful to
  1565. * inspect, analyze, and/or modify the chunk graph.
  1566. */
  1567. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1568. optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
  1569. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1570. optimize: SyncHook<[]>;
  1571. optimizeModules: SyncBailHook<[Iterable<Module>], any>;
  1572. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1573. optimizeChunks: SyncBailHook<[Iterable<Chunk>, ChunkGroup[]], any>;
  1574. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1575. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1576. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1577. optimizeChunkModules: AsyncSeriesBailHook<
  1578. [Iterable<Chunk>, Iterable<Module>],
  1579. any
  1580. >;
  1581. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1582. shouldRecord: SyncBailHook<[], undefined | boolean>;
  1583. additionalChunkRuntimeRequirements: SyncHook<
  1584. [Chunk, Set<string>, RuntimeRequirementsContext]
  1585. >;
  1586. runtimeRequirementInChunk: HookMap<
  1587. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1588. >;
  1589. additionalModuleRuntimeRequirements: SyncHook<
  1590. [Module, Set<string>, RuntimeRequirementsContext]
  1591. >;
  1592. runtimeRequirementInModule: HookMap<
  1593. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
  1594. >;
  1595. additionalTreeRuntimeRequirements: SyncHook<
  1596. [Chunk, Set<string>, RuntimeRequirementsContext]
  1597. >;
  1598. runtimeRequirementInTree: HookMap<
  1599. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1600. >;
  1601. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1602. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1603. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1604. moduleIds: SyncHook<[Iterable<Module>]>;
  1605. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1606. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1607. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1608. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1609. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1610. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1611. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1612. recordModules: SyncHook<[Iterable<Module>, any]>;
  1613. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1614. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1615. beforeModuleHash: SyncHook<[]>;
  1616. afterModuleHash: SyncHook<[]>;
  1617. beforeCodeGeneration: SyncHook<[]>;
  1618. afterCodeGeneration: SyncHook<[]>;
  1619. beforeRuntimeRequirements: SyncHook<[]>;
  1620. afterRuntimeRequirements: SyncHook<[]>;
  1621. beforeHash: SyncHook<[]>;
  1622. contentHash: SyncHook<[Chunk]>;
  1623. afterHash: SyncHook<[]>;
  1624. recordHash: SyncHook<[any]>;
  1625. record: SyncHook<[Compilation, any]>;
  1626. beforeModuleAssets: SyncHook<[]>;
  1627. shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
  1628. beforeChunkAssets: SyncHook<[]>;
  1629. additionalChunkAssets: FakeHook<
  1630. Pick<
  1631. AsyncSeriesHook<[Set<Chunk>]>,
  1632. "name" | "tap" | "tapAsync" | "tapPromise"
  1633. >
  1634. >;
  1635. additionalAssets: FakeHook<
  1636. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1637. >;
  1638. optimizeChunkAssets: FakeHook<
  1639. Pick<
  1640. AsyncSeriesHook<[Set<Chunk>]>,
  1641. "name" | "tap" | "tapAsync" | "tapPromise"
  1642. >
  1643. >;
  1644. afterOptimizeChunkAssets: FakeHook<
  1645. Pick<
  1646. AsyncSeriesHook<[Set<Chunk>]>,
  1647. "name" | "tap" | "tapAsync" | "tapPromise"
  1648. >
  1649. >;
  1650. optimizeAssets: AsyncSeriesHook<
  1651. [CompilationAssets],
  1652. ProcessAssetsAdditionalOptions
  1653. >;
  1654. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1655. processAssets: AsyncSeriesHook<
  1656. [CompilationAssets],
  1657. ProcessAssetsAdditionalOptions
  1658. >;
  1659. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1660. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1661. needAdditionalSeal: SyncBailHook<[], boolean>;
  1662. afterSeal: AsyncSeriesHook<[]>;
  1663. renderManifest: SyncWaterfallHook<
  1664. [RenderManifestEntry[], RenderManifestOptions]
  1665. >;
  1666. fullHash: SyncHook<[Hash]>;
  1667. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1668. moduleAsset: SyncHook<[Module, string]>;
  1669. chunkAsset: SyncHook<[Chunk, string]>;
  1670. assetPath: SyncWaterfallHook<[string, object, AssetInfo]>;
  1671. needAdditionalPass: SyncBailHook<[], boolean>;
  1672. childCompiler: SyncHook<[Compiler, string, number]>;
  1673. log: SyncBailHook<[string, LogEntry], true>;
  1674. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1675. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1676. statsPreset: HookMap<
  1677. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1678. >;
  1679. statsNormalize: SyncHook<
  1680. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1681. >;
  1682. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1683. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1684. get normalModuleLoader(): SyncHook<[object, NormalModule]>;
  1685. }>;
  1686. name?: string;
  1687. startTime: any;
  1688. endTime: any;
  1689. compiler: Compiler;
  1690. resolverFactory: ResolverFactory;
  1691. inputFileSystem: InputFileSystem;
  1692. fileSystemInfo: FileSystemInfo;
  1693. valueCacheVersions: Map<string, string | Set<string>>;
  1694. requestShortener: RequestShortener;
  1695. compilerPath: string;
  1696. logger: WebpackLogger;
  1697. options: WebpackOptionsNormalized;
  1698. outputOptions: OutputNormalized;
  1699. bail: boolean;
  1700. profile: boolean;
  1701. params: CompilationParams;
  1702. mainTemplate: MainTemplate;
  1703. chunkTemplate: ChunkTemplate;
  1704. runtimeTemplate: RuntimeTemplate;
  1705. moduleTemplates: { javascript: ModuleTemplate };
  1706. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1707. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1708. moduleGraph: ModuleGraph;
  1709. chunkGraph: ChunkGraph;
  1710. codeGenerationResults: CodeGenerationResults;
  1711. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1712. addModuleQueue: AsyncQueue<Module, string, Module>;
  1713. factorizeQueue: AsyncQueue<
  1714. FactorizeModuleOptions,
  1715. string,
  1716. Module | ModuleFactoryResult
  1717. >;
  1718. buildQueue: AsyncQueue<Module, Module, Module>;
  1719. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1720. /**
  1721. * Modules in value are building during the build of Module in key.
  1722. * Means value blocking key from finishing.
  1723. * Needed to detect build cycles.
  1724. */
  1725. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1726. entries: Map<string, EntryData>;
  1727. globalEntry: EntryData;
  1728. entrypoints: Map<string, Entrypoint>;
  1729. asyncEntrypoints: Entrypoint[];
  1730. chunks: Set<Chunk>;
  1731. chunkGroups: ChunkGroup[];
  1732. namedChunkGroups: Map<string, ChunkGroup>;
  1733. namedChunks: Map<string, Chunk>;
  1734. modules: Set<Module>;
  1735. records: any;
  1736. additionalChunkAssets: string[];
  1737. assets: CompilationAssets;
  1738. assetsInfo: Map<string, AssetInfo>;
  1739. errors: WebpackError[];
  1740. warnings: WebpackError[];
  1741. children: Compilation[];
  1742. logging: Map<string, LogEntry[]>;
  1743. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1744. dependencyTemplates: DependencyTemplates;
  1745. childrenCounters: object;
  1746. usedChunkIds: Set<string | number>;
  1747. usedModuleIds: Set<number>;
  1748. needAdditionalPass: boolean;
  1749. builtModules: WeakSet<Module>;
  1750. codeGeneratedModules: WeakSet<Module>;
  1751. buildTimeExecutedModules: WeakSet<Module>;
  1752. emittedAssets: Set<string>;
  1753. comparedForEmitAssets: Set<string>;
  1754. fileDependencies: LazySet<string>;
  1755. contextDependencies: LazySet<string>;
  1756. missingDependencies: LazySet<string>;
  1757. buildDependencies: LazySet<string>;
  1758. compilationDependencies: { add: (item?: any) => LazySet<string> };
  1759. getStats(): Stats;
  1760. createStatsOptions(
  1761. optionsOrPreset: string | StatsOptions,
  1762. context?: CreateStatsOptionsContext
  1763. ): NormalizedStatsOptions;
  1764. createStatsFactory(options?: any): StatsFactory;
  1765. createStatsPrinter(options?: any): StatsPrinter;
  1766. getCache(name: string): CacheFacade;
  1767. getLogger(name: string | (() => string)): WebpackLogger;
  1768. addModule(
  1769. module: Module,
  1770. callback: (err?: null | WebpackError, result?: Module) => void
  1771. ): void;
  1772. /**
  1773. * Fetches a module from a compilation by its identifier
  1774. */
  1775. getModule(module: Module): Module;
  1776. /**
  1777. * Attempts to search for a module by its identifier
  1778. */
  1779. findModule(identifier: string): undefined | Module;
  1780. /**
  1781. * Schedules a build of the module object
  1782. */
  1783. buildModule(
  1784. module: Module,
  1785. callback: (err?: null | WebpackError, result?: Module) => void
  1786. ): void;
  1787. processModuleDependencies(
  1788. module: Module,
  1789. callback: (err?: null | WebpackError, result?: Module) => void
  1790. ): void;
  1791. processModuleDependenciesNonRecursive(module: Module): void;
  1792. handleModuleCreation(
  1793. __0: HandleModuleCreationOptions,
  1794. callback: (err?: null | WebpackError, result?: Module) => void
  1795. ): void;
  1796. addModuleChain(
  1797. context: string,
  1798. dependency: Dependency,
  1799. callback: (err?: null | WebpackError, result?: Module) => void
  1800. ): void;
  1801. addModuleTree(
  1802. __0: {
  1803. /**
  1804. * context string path
  1805. */
  1806. context: string;
  1807. /**
  1808. * dependency used to create Module chain
  1809. */
  1810. dependency: Dependency;
  1811. /**
  1812. * additional context info for the root module
  1813. */
  1814. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1815. },
  1816. callback: (err?: null | WebpackError, result?: Module) => void
  1817. ): void;
  1818. addEntry(
  1819. context: string,
  1820. entry: Dependency,
  1821. optionsOrName: string | EntryOptions,
  1822. callback: (err?: null | WebpackError, result?: Module) => void
  1823. ): void;
  1824. addInclude(
  1825. context: string,
  1826. dependency: Dependency,
  1827. options: EntryOptions,
  1828. callback: (err?: null | WebpackError, result?: Module) => void
  1829. ): void;
  1830. rebuildModule(
  1831. module: Module,
  1832. callback: (err?: null | WebpackError, result?: Module) => void
  1833. ): void;
  1834. finish(callback?: any): void;
  1835. unseal(): void;
  1836. seal(callback: (err?: null | WebpackError) => void): void;
  1837. reportDependencyErrorsAndWarnings(
  1838. module: Module,
  1839. blocks: DependenciesBlock[]
  1840. ): boolean;
  1841. codeGeneration(callback?: any): void;
  1842. processRuntimeRequirements(__0?: {
  1843. /**
  1844. * the chunk graph
  1845. */
  1846. chunkGraph?: ChunkGraph;
  1847. /**
  1848. * modules
  1849. */
  1850. modules?: Iterable<Module>;
  1851. /**
  1852. * chunks
  1853. */
  1854. chunks?: Iterable<Chunk>;
  1855. /**
  1856. * codeGenerationResults
  1857. */
  1858. codeGenerationResults?: CodeGenerationResults;
  1859. /**
  1860. * chunkGraphEntries
  1861. */
  1862. chunkGraphEntries?: Iterable<Chunk>;
  1863. }): void;
  1864. addRuntimeModule(
  1865. chunk: Chunk,
  1866. module: RuntimeModule,
  1867. chunkGraph?: ChunkGraph
  1868. ): void;
  1869. /**
  1870. * If `module` is passed, `loc` and `request` must also be passed.
  1871. */
  1872. addChunkInGroup(
  1873. groupOptions: string | ChunkGroupOptions,
  1874. module?: Module,
  1875. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  1876. request?: string
  1877. ): ChunkGroup;
  1878. addAsyncEntrypoint(
  1879. options: EntryOptions,
  1880. module: Module,
  1881. loc: DependencyLocation,
  1882. request: string
  1883. ): Entrypoint;
  1884. /**
  1885. * This method first looks to see if a name is provided for a new chunk,
  1886. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  1887. */
  1888. addChunk(name?: string): Chunk;
  1889. assignDepth(module: Module): void;
  1890. assignDepths(modules: Set<Module>): void;
  1891. getDependencyReferencedExports(
  1892. dependency: Dependency,
  1893. runtime: RuntimeSpec
  1894. ): (string[] | ReferencedExport)[];
  1895. removeReasonsOfDependencyBlock(
  1896. module: Module,
  1897. block: DependenciesBlockLike
  1898. ): void;
  1899. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  1900. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  1901. assignRuntimeIds(): void;
  1902. sortItemsWithChunkIds(): void;
  1903. summarizeDependencies(): void;
  1904. createModuleHashes(): void;
  1905. createHash(): {
  1906. module: Module;
  1907. hash: string;
  1908. runtime: RuntimeSpec;
  1909. runtimes: RuntimeSpec[];
  1910. }[];
  1911. fullHash?: string;
  1912. hash?: string;
  1913. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  1914. updateAsset(
  1915. file: string,
  1916. newSourceOrFunction: Source | ((arg0: Source) => Source),
  1917. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  1918. ): void;
  1919. renameAsset(file?: any, newFile?: any): void;
  1920. deleteAsset(file: string): void;
  1921. getAssets(): Readonly<Asset>[];
  1922. getAsset(name: string): undefined | Readonly<Asset>;
  1923. clearAssets(): void;
  1924. createModuleAssets(): void;
  1925. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  1926. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  1927. getPath(
  1928. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1929. data?: PathData
  1930. ): string;
  1931. getPathWithInfo(
  1932. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1933. data?: PathData
  1934. ): { path: string; info: AssetInfo };
  1935. getAssetPath(
  1936. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1937. data: PathData
  1938. ): string;
  1939. getAssetPathWithInfo(
  1940. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1941. data: PathData
  1942. ): { path: string; info: AssetInfo };
  1943. getWarnings(): WebpackError[];
  1944. getErrors(): WebpackError[];
  1945. /**
  1946. * This function allows you to run another instance of webpack inside of webpack however as
  1947. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  1948. * from parent (or top level compiler) and creates a child Compilation
  1949. */
  1950. createChildCompiler(
  1951. name: string,
  1952. outputOptions?: OutputNormalized,
  1953. plugins?: (
  1954. | ((this: Compiler, compiler: Compiler) => void)
  1955. | WebpackPluginInstance
  1956. )[]
  1957. ): Compiler;
  1958. executeModule(
  1959. module: Module,
  1960. options: ExecuteModuleOptions,
  1961. callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
  1962. ): void;
  1963. checkConstraints(): void;
  1964. factorizeModule: {
  1965. (
  1966. options: FactorizeModuleOptions & { factoryResult?: false },
  1967. callback: (err?: null | WebpackError, result?: Module) => void
  1968. ): void;
  1969. (
  1970. options: FactorizeModuleOptions & { factoryResult: true },
  1971. callback: (
  1972. err?: null | WebpackError,
  1973. result?: ModuleFactoryResult
  1974. ) => void
  1975. ): void;
  1976. };
  1977. /**
  1978. * Add additional assets to the compilation.
  1979. */
  1980. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  1981. /**
  1982. * Basic preprocessing of assets.
  1983. */
  1984. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  1985. /**
  1986. * Derive new assets from existing assets.
  1987. * Existing assets should not be treated as complete.
  1988. */
  1989. static PROCESS_ASSETS_STAGE_DERIVED: number;
  1990. /**
  1991. * Add additional sections to existing assets, like a banner or initialization code.
  1992. */
  1993. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  1994. /**
  1995. * Optimize existing assets in a general way.
  1996. */
  1997. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  1998. /**
  1999. * Optimize the count of existing assets, e. g. by merging them.
  2000. * Only assets of the same type should be merged.
  2001. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2002. */
  2003. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2004. /**
  2005. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2006. */
  2007. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2008. /**
  2009. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2010. */
  2011. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2012. /**
  2013. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2014. */
  2015. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2016. /**
  2017. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2018. * Only assets of different types should be inlined.
  2019. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2020. */
  2021. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2022. /**
  2023. * Summarize the list of existing assets
  2024. * e. g. creating an assets manifest of Service Workers.
  2025. */
  2026. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2027. /**
  2028. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2029. */
  2030. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2031. /**
  2032. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2033. */
  2034. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2035. /**
  2036. * Analyse existing assets.
  2037. */
  2038. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2039. /**
  2040. * Creating assets for reporting purposes.
  2041. */
  2042. static PROCESS_ASSETS_STAGE_REPORT: number;
  2043. }
  2044. declare interface CompilationAssets {
  2045. [index: string]: Source;
  2046. }
  2047. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2048. renderModuleContent: SyncWaterfallHook<
  2049. [Source, Module, WebAssemblyRenderContext]
  2050. >;
  2051. }
  2052. declare interface CompilationHooksJavascriptModulesPlugin {
  2053. renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2054. renderModuleContainer: SyncWaterfallHook<
  2055. [Source, Module, ChunkRenderContext]
  2056. >;
  2057. renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2058. renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
  2059. renderMain: SyncWaterfallHook<[Source, RenderContext]>;
  2060. renderContent: SyncWaterfallHook<[Source, RenderContext]>;
  2061. render: SyncWaterfallHook<[Source, RenderContext]>;
  2062. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  2063. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  2064. inlineInRuntimeBailout: SyncBailHook<
  2065. [Module, RenderBootstrapContext],
  2066. string
  2067. >;
  2068. embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
  2069. strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
  2070. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2071. useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
  2072. }
  2073. declare interface CompilationHooksRealContentHashPlugin {
  2074. updateHash: SyncBailHook<[Buffer[], string], string>;
  2075. }
  2076. declare interface CompilationParams {
  2077. normalModuleFactory: NormalModuleFactory;
  2078. contextModuleFactory: ContextModuleFactory;
  2079. }
  2080. declare class Compiler {
  2081. constructor(context: string, options?: WebpackOptionsNormalized);
  2082. hooks: Readonly<{
  2083. initialize: SyncHook<[]>;
  2084. shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
  2085. done: AsyncSeriesHook<[Stats]>;
  2086. afterDone: SyncHook<[Stats]>;
  2087. additionalPass: AsyncSeriesHook<[]>;
  2088. beforeRun: AsyncSeriesHook<[Compiler]>;
  2089. run: AsyncSeriesHook<[Compiler]>;
  2090. emit: AsyncSeriesHook<[Compilation]>;
  2091. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2092. afterEmit: AsyncSeriesHook<[Compilation]>;
  2093. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2094. compilation: SyncHook<[Compilation, CompilationParams]>;
  2095. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2096. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2097. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2098. compile: SyncHook<[CompilationParams]>;
  2099. make: AsyncParallelHook<[Compilation]>;
  2100. finishMake: AsyncParallelHook<[Compilation]>;
  2101. afterCompile: AsyncSeriesHook<[Compilation]>;
  2102. readRecords: AsyncSeriesHook<[]>;
  2103. emitRecords: AsyncSeriesHook<[]>;
  2104. watchRun: AsyncSeriesHook<[Compiler]>;
  2105. failed: SyncHook<[Error]>;
  2106. invalid: SyncHook<[null | string, number]>;
  2107. watchClose: SyncHook<[]>;
  2108. shutdown: AsyncSeriesHook<[]>;
  2109. infrastructureLog: SyncBailHook<[string, string, any[]], true>;
  2110. environment: SyncHook<[]>;
  2111. afterEnvironment: SyncHook<[]>;
  2112. afterPlugins: SyncHook<[Compiler]>;
  2113. afterResolvers: SyncHook<[Compiler]>;
  2114. entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
  2115. }>;
  2116. webpack: typeof exports;
  2117. name?: string;
  2118. parentCompilation?: Compilation;
  2119. root: Compiler;
  2120. outputPath: string;
  2121. watching?: Watching;
  2122. outputFileSystem: OutputFileSystem;
  2123. intermediateFileSystem: IntermediateFileSystem;
  2124. inputFileSystem: InputFileSystem;
  2125. watchFileSystem: WatchFileSystem;
  2126. recordsInputPath: null | string;
  2127. recordsOutputPath: null | string;
  2128. records: object;
  2129. managedPaths: Set<string | RegExp>;
  2130. immutablePaths: Set<string | RegExp>;
  2131. modifiedFiles?: ReadonlySet<string>;
  2132. removedFiles?: ReadonlySet<string>;
  2133. fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  2134. contextTimestamps?: ReadonlyMap<
  2135. string,
  2136. null | FileSystemInfoEntry | "ignore"
  2137. >;
  2138. fsStartTime?: number;
  2139. resolverFactory: ResolverFactory;
  2140. infrastructureLogger: any;
  2141. options: WebpackOptionsNormalized;
  2142. context: string;
  2143. requestShortener: RequestShortener;
  2144. cache: Cache;
  2145. moduleMemCaches?: Map<
  2146. Module,
  2147. {
  2148. buildInfo: object;
  2149. references: WeakMap<Dependency, Module>;
  2150. memCache: WeakTupleMap<any, any>;
  2151. }
  2152. >;
  2153. compilerPath: string;
  2154. running: boolean;
  2155. idle: boolean;
  2156. watchMode: boolean;
  2157. getCache(name: string): CacheFacade;
  2158. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2159. watch(watchOptions: WatchOptions, handler: CallbackFunction<Stats>): Watching;
  2160. run(callback: CallbackFunction<Stats>): void;
  2161. runAsChild(
  2162. callback: (
  2163. err?: null | Error,
  2164. entries?: Chunk[],
  2165. compilation?: Compilation
  2166. ) => any
  2167. ): void;
  2168. purgeInputFileSystem(): void;
  2169. emitAssets(compilation: Compilation, callback: CallbackFunction<void>): void;
  2170. emitRecords(callback: CallbackFunction<void>): void;
  2171. readRecords(callback: CallbackFunction<void>): void;
  2172. createChildCompiler(
  2173. compilation: Compilation,
  2174. compilerName: string,
  2175. compilerIndex: number,
  2176. outputOptions?: OutputNormalized,
  2177. plugins?: WebpackPluginInstance[]
  2178. ): Compiler;
  2179. isChild(): boolean;
  2180. createCompilation(params?: any): Compilation;
  2181. newCompilation(params: CompilationParams): Compilation;
  2182. createNormalModuleFactory(): NormalModuleFactory;
  2183. createContextModuleFactory(): ContextModuleFactory;
  2184. newCompilationParams(): {
  2185. normalModuleFactory: NormalModuleFactory;
  2186. contextModuleFactory: ContextModuleFactory;
  2187. };
  2188. compile(callback: CallbackFunction<Compilation>): void;
  2189. close(callback: CallbackFunction<void>): void;
  2190. }
  2191. declare class ConcatSource extends Source {
  2192. constructor(...args: (string | Source)[]);
  2193. getChildren(): Source[];
  2194. add(item: string | Source): void;
  2195. addAllSkipOptimizing(items: Source[]): void;
  2196. }
  2197. declare interface ConcatenatedModuleInfo {
  2198. index: number;
  2199. module: Module;
  2200. /**
  2201. * mapping from export name to symbol
  2202. */
  2203. exportMap: Map<string, string>;
  2204. /**
  2205. * mapping from export name to symbol
  2206. */
  2207. rawExportMap: Map<string, string>;
  2208. namespaceExportSymbol?: string;
  2209. }
  2210. declare interface ConcatenationBailoutReasonContext {
  2211. /**
  2212. * the module graph
  2213. */
  2214. moduleGraph: ModuleGraph;
  2215. /**
  2216. * the chunk graph
  2217. */
  2218. chunkGraph: ChunkGraph;
  2219. }
  2220. declare class ConcatenationScope {
  2221. constructor(
  2222. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2223. currentModule: ConcatenatedModuleInfo
  2224. );
  2225. isModuleInScope(module: Module): boolean;
  2226. registerExport(exportName: string, symbol: string): void;
  2227. registerRawExport(exportName: string, expression: string): void;
  2228. registerNamespaceExport(symbol: string): void;
  2229. createModuleReference(
  2230. module: Module,
  2231. __1: Partial<ModuleReferenceOptions>
  2232. ): string;
  2233. static isModuleReference(name: string): boolean;
  2234. static matchModuleReference(
  2235. name: string
  2236. ): null | (ModuleReferenceOptions & { index: number });
  2237. static DEFAULT_EXPORT: string;
  2238. static NAMESPACE_OBJECT_EXPORT: string;
  2239. }
  2240. /**
  2241. * Options object as provided by the user.
  2242. */
  2243. declare interface Configuration {
  2244. /**
  2245. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2246. */
  2247. amd?: false | { [index: string]: any };
  2248. /**
  2249. * Report the first error as a hard error instead of tolerating it.
  2250. */
  2251. bail?: boolean;
  2252. /**
  2253. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2254. */
  2255. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2256. /**
  2257. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2258. */
  2259. context?: string;
  2260. /**
  2261. * References to other configurations to depend on.
  2262. */
  2263. dependencies?: string[];
  2264. /**
  2265. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2266. */
  2267. devtool?: string | false;
  2268. /**
  2269. * The entry point(s) of the compilation.
  2270. */
  2271. entry?:
  2272. | string
  2273. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2274. | EntryObject
  2275. | string[];
  2276. /**
  2277. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2278. */
  2279. experiments?: Experiments;
  2280. /**
  2281. * Extend configuration from another configuration (only works when using webpack-cli).
  2282. */
  2283. extends?: string | string[];
  2284. /**
  2285. * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
  2286. */
  2287. externals?:
  2288. | string
  2289. | RegExp
  2290. | ExternalItem[]
  2291. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2292. | ((
  2293. data: ExternalItemFunctionData,
  2294. callback: (
  2295. err?: null | Error,
  2296. result?: string | boolean | string[] | { [index: string]: any }
  2297. ) => void
  2298. ) => void)
  2299. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2300. /**
  2301. * Enable presets of externals for specific targets.
  2302. */
  2303. externalsPresets?: ExternalsPresets;
  2304. /**
  2305. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2306. */
  2307. externalsType?:
  2308. | "import"
  2309. | "var"
  2310. | "module"
  2311. | "assign"
  2312. | "this"
  2313. | "window"
  2314. | "self"
  2315. | "global"
  2316. | "commonjs"
  2317. | "commonjs2"
  2318. | "commonjs-module"
  2319. | "commonjs-static"
  2320. | "amd"
  2321. | "amd-require"
  2322. | "umd"
  2323. | "umd2"
  2324. | "jsonp"
  2325. | "system"
  2326. | "promise"
  2327. | "script"
  2328. | "node-commonjs";
  2329. /**
  2330. * Ignore specific warnings.
  2331. */
  2332. ignoreWarnings?: (
  2333. | RegExp
  2334. | {
  2335. /**
  2336. * A RegExp to select the origin file for the warning.
  2337. */
  2338. file?: RegExp;
  2339. /**
  2340. * A RegExp to select the warning message.
  2341. */
  2342. message?: RegExp;
  2343. /**
  2344. * A RegExp to select the origin module for the warning.
  2345. */
  2346. module?: RegExp;
  2347. }
  2348. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2349. )[];
  2350. /**
  2351. * Options for infrastructure level logging.
  2352. */
  2353. infrastructureLogging?: InfrastructureLogging;
  2354. /**
  2355. * Custom values available in the loader context.
  2356. */
  2357. loader?: Loader;
  2358. /**
  2359. * Enable production optimizations or development hints.
  2360. */
  2361. mode?: "none" | "development" | "production";
  2362. /**
  2363. * Options affecting the normal modules (`NormalModuleFactory`).
  2364. */
  2365. module?: ModuleOptions;
  2366. /**
  2367. * Name of the configuration. Used when loading multiple configurations.
  2368. */
  2369. name?: string;
  2370. /**
  2371. * Include polyfills or mocks for various node stuff.
  2372. */
  2373. node?: false | NodeOptions;
  2374. /**
  2375. * Enables/Disables integrated optimizations.
  2376. */
  2377. optimization?: Optimization;
  2378. /**
  2379. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2380. */
  2381. output?: Output;
  2382. /**
  2383. * The number of parallel processed modules in the compilation.
  2384. */
  2385. parallelism?: number;
  2386. /**
  2387. * Configuration for web performance recommendations.
  2388. */
  2389. performance?: false | PerformanceOptions;
  2390. /**
  2391. * Add additional plugins to the compiler.
  2392. */
  2393. plugins?: (
  2394. | undefined
  2395. | null
  2396. | false
  2397. | ""
  2398. | 0
  2399. | ((this: Compiler, compiler: Compiler) => void)
  2400. | WebpackPluginInstance
  2401. )[];
  2402. /**
  2403. * Capture timing information for each module.
  2404. */
  2405. profile?: boolean;
  2406. /**
  2407. * Store compiler state to a json file.
  2408. */
  2409. recordsInputPath?: string | false;
  2410. /**
  2411. * Load compiler state from a json file.
  2412. */
  2413. recordsOutputPath?: string | false;
  2414. /**
  2415. * Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. `recordsPath` is used for `recordsInputPath` and `recordsOutputPath` if they left undefined.
  2416. */
  2417. recordsPath?: string | false;
  2418. /**
  2419. * Options for the resolver.
  2420. */
  2421. resolve?: ResolveOptionsWebpackOptions;
  2422. /**
  2423. * Options for the resolver when resolving loaders.
  2424. */
  2425. resolveLoader?: ResolveOptionsWebpackOptions;
  2426. /**
  2427. * Options affecting how file system snapshots are created and validated.
  2428. */
  2429. snapshot?: SnapshotOptionsWebpackOptions;
  2430. /**
  2431. * Stats options object or preset name.
  2432. */
  2433. stats?:
  2434. | boolean
  2435. | StatsOptions
  2436. | "none"
  2437. | "verbose"
  2438. | "summary"
  2439. | "errors-only"
  2440. | "errors-warnings"
  2441. | "minimal"
  2442. | "normal"
  2443. | "detailed";
  2444. /**
  2445. * Environment to build for. An array of environments to build for all of them when possible.
  2446. */
  2447. target?: string | false | string[];
  2448. /**
  2449. * Enter watch mode, which rebuilds on file change.
  2450. */
  2451. watch?: boolean;
  2452. /**
  2453. * Options for the watcher.
  2454. */
  2455. watchOptions?: WatchOptions;
  2456. }
  2457. type ConnectionState =
  2458. | boolean
  2459. | typeof TRANSITIVE_ONLY
  2460. | typeof CIRCULAR_CONNECTION;
  2461. declare class ConstDependency extends NullDependency {
  2462. constructor(
  2463. expression: string,
  2464. range: number | [number, number],
  2465. runtimeRequirements?: null | string[]
  2466. );
  2467. expression: string;
  2468. range: number | [number, number];
  2469. runtimeRequirements: null | Set<string>;
  2470. static Template: typeof ConstDependencyTemplate;
  2471. static NO_EXPORTS_REFERENCED: string[][];
  2472. static EXPORTS_OBJECT_REFERENCED: string[][];
  2473. static TRANSITIVE: typeof TRANSITIVE;
  2474. }
  2475. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2476. constructor();
  2477. }
  2478. declare interface Constructor {
  2479. new (...params: any[]): any;
  2480. }
  2481. declare class ConsumeSharedPlugin {
  2482. constructor(options: ConsumeSharedPluginOptions);
  2483. /**
  2484. * Apply the plugin
  2485. */
  2486. apply(compiler: Compiler): void;
  2487. }
  2488. /**
  2489. * Options for consuming shared modules.
  2490. */
  2491. declare interface ConsumeSharedPluginOptions {
  2492. /**
  2493. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2494. */
  2495. consumes: Consumes;
  2496. /**
  2497. * Share scope name used for all consumed modules (defaults to 'default').
  2498. */
  2499. shareScope?: string;
  2500. }
  2501. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2502. /**
  2503. * Advanced configuration for modules that should be consumed from share scope.
  2504. */
  2505. declare interface ConsumesConfig {
  2506. /**
  2507. * Include the fallback module directly instead behind an async request. This allows to use fallback module in initial load too. All possible shared modules need to be eager too.
  2508. */
  2509. eager?: boolean;
  2510. /**
  2511. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2512. */
  2513. import?: string | false;
  2514. /**
  2515. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2516. */
  2517. packageName?: string;
  2518. /**
  2519. * Version requirement from module in share scope.
  2520. */
  2521. requiredVersion?: string | false;
  2522. /**
  2523. * Module is looked up under this key from the share scope.
  2524. */
  2525. shareKey?: string;
  2526. /**
  2527. * Share scope name.
  2528. */
  2529. shareScope?: string;
  2530. /**
  2531. * Allow only a single version of the shared module in share scope (disabled by default).
  2532. */
  2533. singleton?: boolean;
  2534. /**
  2535. * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
  2536. */
  2537. strictVersion?: boolean;
  2538. }
  2539. /**
  2540. * Modules that should be consumed from share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
  2541. */
  2542. declare interface ConsumesObject {
  2543. [index: string]: string | ConsumesConfig;
  2544. }
  2545. type ContainerOptionsFormat<T> =
  2546. | Record<string, string | string[] | T>
  2547. | (string | Record<string, string | string[] | T>)[];
  2548. declare class ContainerPlugin {
  2549. constructor(options: ContainerPluginOptions);
  2550. /**
  2551. * Apply the plugin
  2552. */
  2553. apply(compiler: Compiler): void;
  2554. }
  2555. declare interface ContainerPluginOptions {
  2556. /**
  2557. * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
  2558. */
  2559. exposes: Exposes;
  2560. /**
  2561. * The filename for this container relative path inside the `output.path` directory.
  2562. */
  2563. filename?: string;
  2564. /**
  2565. * Options for library.
  2566. */
  2567. library?: LibraryOptions;
  2568. /**
  2569. * The name for this container.
  2570. */
  2571. name: string;
  2572. /**
  2573. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2574. */
  2575. runtime?: string | false;
  2576. /**
  2577. * The name of the share scope which is shared with the host (defaults to 'default').
  2578. */
  2579. shareScope?: string;
  2580. }
  2581. declare class ContainerReferencePlugin {
  2582. constructor(options: ContainerReferencePluginOptions);
  2583. /**
  2584. * Apply the plugin
  2585. */
  2586. apply(compiler: Compiler): void;
  2587. }
  2588. declare interface ContainerReferencePluginOptions {
  2589. /**
  2590. * The external type of the remote containers.
  2591. */
  2592. remoteType: ExternalsType;
  2593. /**
  2594. * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
  2595. */
  2596. remotes: Remotes;
  2597. /**
  2598. * The name of the share scope shared with all remotes (defaults to 'default').
  2599. */
  2600. shareScope?: string;
  2601. }
  2602. declare abstract class ContextElementDependency extends ModuleDependency {
  2603. referencedExports?: string[][];
  2604. }
  2605. declare class ContextExclusionPlugin {
  2606. constructor(negativeMatcher: RegExp);
  2607. negativeMatcher: RegExp;
  2608. /**
  2609. * Apply the plugin
  2610. */
  2611. apply(compiler: Compiler): void;
  2612. }
  2613. declare interface ContextFileSystemInfoEntry {
  2614. safeTime: number;
  2615. timestampHash?: string;
  2616. resolved?: ResolvedContextFileSystemInfoEntry;
  2617. symlinks?: Set<string>;
  2618. }
  2619. declare interface ContextHash {
  2620. hash: string;
  2621. resolved?: string;
  2622. symlinks?: Set<string>;
  2623. }
  2624. type ContextMode =
  2625. | "weak"
  2626. | "eager"
  2627. | "lazy"
  2628. | "lazy-once"
  2629. | "sync"
  2630. | "async-weak";
  2631. declare abstract class ContextModuleFactory extends ModuleFactory {
  2632. hooks: Readonly<{
  2633. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2634. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2635. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2636. alternatives: FakeHook<
  2637. Pick<
  2638. AsyncSeriesWaterfallHook<[any[]]>,
  2639. "name" | "tap" | "tapAsync" | "tapPromise"
  2640. >
  2641. >;
  2642. alternativeRequests: AsyncSeriesWaterfallHook<
  2643. [any[], ContextModuleOptions]
  2644. >;
  2645. }>;
  2646. resolverFactory: ResolverFactory;
  2647. resolveDependencies(
  2648. fs: InputFileSystem,
  2649. options: ContextModuleOptions,
  2650. callback: (
  2651. err?: null | Error,
  2652. dependencies?: ContextElementDependency[]
  2653. ) => any
  2654. ): void;
  2655. }
  2656. declare interface ContextModuleOptions {
  2657. mode: ContextMode;
  2658. recursive: boolean;
  2659. regExp: RegExp;
  2660. namespaceObject?: boolean | "strict";
  2661. addon?: string;
  2662. chunkName?: string;
  2663. include?: RegExp;
  2664. exclude?: RegExp;
  2665. groupOptions?: RawChunkGroupOptions;
  2666. typePrefix?: string;
  2667. category?: string;
  2668. /**
  2669. * exports referenced from modules (won't be mangled)
  2670. */
  2671. referencedExports?: null | string[][];
  2672. layer?: string;
  2673. resource: string | false | string[];
  2674. resourceQuery?: string;
  2675. resourceFragment?: string;
  2676. resolveOptions: any;
  2677. }
  2678. declare class ContextReplacementPlugin {
  2679. constructor(
  2680. resourceRegExp: RegExp,
  2681. newContentResource?: any,
  2682. newContentRecursive?: any,
  2683. newContentRegExp?: any
  2684. );
  2685. resourceRegExp: RegExp;
  2686. newContentCallback: any;
  2687. newContentResource: any;
  2688. newContentCreateContextMap: any;
  2689. newContentRecursive: any;
  2690. newContentRegExp: any;
  2691. /**
  2692. * Apply the plugin
  2693. */
  2694. apply(compiler: Compiler): void;
  2695. }
  2696. declare interface ContextTimestampAndHash {
  2697. safeTime: number;
  2698. timestampHash?: string;
  2699. hash: string;
  2700. resolved?: ResolvedContextTimestampAndHash;
  2701. symlinks?: Set<string>;
  2702. }
  2703. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2704. Record<string, any>;
  2705. /**
  2706. * Options for css handling.
  2707. */
  2708. declare interface CssExperimentOptions {
  2709. /**
  2710. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2711. */
  2712. exportsOnly?: boolean;
  2713. }
  2714. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  2715. declare class DefinePlugin {
  2716. /**
  2717. * Create a new define plugin
  2718. */
  2719. constructor(definitions: Record<string, CodeValue>);
  2720. definitions: Record<string, CodeValue>;
  2721. /**
  2722. * Apply the plugin
  2723. */
  2724. apply(compiler: Compiler): void;
  2725. static runtimeValue(
  2726. fn: (arg0: {
  2727. module: NormalModule;
  2728. key: string;
  2729. readonly version?: string;
  2730. }) => CodeValuePrimitive,
  2731. options?: true | string[] | RuntimeValueOptions
  2732. ): RuntimeValue;
  2733. }
  2734. declare class DelegatedPlugin {
  2735. constructor(options?: any);
  2736. options: any;
  2737. /**
  2738. * Apply the plugin
  2739. */
  2740. apply(compiler: Compiler): void;
  2741. }
  2742. declare interface DepConstructor {
  2743. new (...args: any[]): Dependency;
  2744. }
  2745. declare abstract class DependenciesBlock {
  2746. dependencies: Dependency[];
  2747. blocks: AsyncDependenciesBlock[];
  2748. parent?: DependenciesBlock;
  2749. getRootBlock(): DependenciesBlock;
  2750. /**
  2751. * Adds a DependencyBlock to DependencyBlock relationship.
  2752. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  2753. */
  2754. addBlock(block: AsyncDependenciesBlock): void;
  2755. addDependency(dependency: Dependency): void;
  2756. removeDependency(dependency: Dependency): void;
  2757. /**
  2758. * Removes all dependencies and blocks
  2759. */
  2760. clearDependenciesAndBlocks(): void;
  2761. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2762. serialize(__0: ObjectSerializerContext): void;
  2763. deserialize(__0: ObjectDeserializerContext): void;
  2764. }
  2765. declare interface DependenciesBlockLike {
  2766. dependencies: Dependency[];
  2767. blocks: AsyncDependenciesBlock[];
  2768. }
  2769. declare class Dependency {
  2770. constructor();
  2771. weak: boolean;
  2772. optional: boolean;
  2773. get type(): string;
  2774. get category(): string;
  2775. loc: DependencyLocation;
  2776. setLoc(
  2777. startLine: number,
  2778. startColumn: number,
  2779. endLine: number,
  2780. endColumn: number
  2781. ): void;
  2782. getContext(): undefined | string;
  2783. getResourceIdentifier(): null | string;
  2784. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  2785. /**
  2786. * Returns the referenced module and export
  2787. */
  2788. getReference(moduleGraph: ModuleGraph): never;
  2789. /**
  2790. * Returns list of exports referenced by this dependency
  2791. */
  2792. getReferencedExports(
  2793. moduleGraph: ModuleGraph,
  2794. runtime: RuntimeSpec
  2795. ): (string[] | ReferencedExport)[];
  2796. getCondition(
  2797. moduleGraph: ModuleGraph
  2798. ):
  2799. | null
  2800. | false
  2801. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  2802. /**
  2803. * Returns the exported names
  2804. */
  2805. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  2806. /**
  2807. * Returns warnings
  2808. */
  2809. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  2810. /**
  2811. * Returns errors
  2812. */
  2813. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  2814. /**
  2815. * Update the hash
  2816. */
  2817. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2818. /**
  2819. * implement this method to allow the occurrence order plugin to count correctly
  2820. */
  2821. getNumberOfIdOccurrences(): number;
  2822. getModuleEvaluationSideEffectsState(
  2823. moduleGraph: ModuleGraph
  2824. ): ConnectionState;
  2825. createIgnoredModule(context: string): null | Module;
  2826. serialize(__0: ObjectSerializerContext): void;
  2827. deserialize(__0: ObjectDeserializerContext): void;
  2828. module: any;
  2829. get disconnect(): any;
  2830. static NO_EXPORTS_REFERENCED: string[][];
  2831. static EXPORTS_OBJECT_REFERENCED: string[][];
  2832. static TRANSITIVE: typeof TRANSITIVE;
  2833. }
  2834. declare interface DependencyConstructor {
  2835. new (...args: any[]): Dependency;
  2836. }
  2837. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  2838. declare class DependencyTemplate {
  2839. constructor();
  2840. apply(
  2841. dependency: Dependency,
  2842. source: ReplaceSource,
  2843. templateContext: DependencyTemplateContext
  2844. ): void;
  2845. }
  2846. declare interface DependencyTemplateContext {
  2847. /**
  2848. * the runtime template
  2849. */
  2850. runtimeTemplate: RuntimeTemplate;
  2851. /**
  2852. * the dependency templates
  2853. */
  2854. dependencyTemplates: DependencyTemplates;
  2855. /**
  2856. * the module graph
  2857. */
  2858. moduleGraph: ModuleGraph;
  2859. /**
  2860. * the chunk graph
  2861. */
  2862. chunkGraph: ChunkGraph;
  2863. /**
  2864. * the requirements for runtime
  2865. */
  2866. runtimeRequirements: Set<string>;
  2867. /**
  2868. * current module
  2869. */
  2870. module: Module;
  2871. /**
  2872. * current runtimes, for which code is generated
  2873. */
  2874. runtime: RuntimeSpec;
  2875. /**
  2876. * mutable array of init fragments for the current module
  2877. */
  2878. initFragments: InitFragment<GenerateContext>[];
  2879. /**
  2880. * when in a concatenated module, information about other concatenated modules
  2881. */
  2882. concatenationScope?: ConcatenationScope;
  2883. /**
  2884. * the code generation results
  2885. */
  2886. codeGenerationResults: CodeGenerationResults;
  2887. }
  2888. declare abstract class DependencyTemplates {
  2889. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  2890. set(
  2891. dependency: DependencyConstructor,
  2892. dependencyTemplate: DependencyTemplate
  2893. ): void;
  2894. updateHash(part: string): void;
  2895. getHash(): string;
  2896. clone(): DependencyTemplates;
  2897. }
  2898. declare class DeterministicChunkIdsPlugin {
  2899. constructor(options?: DeterministicChunkIdsPluginOptions);
  2900. options: DeterministicChunkIdsPluginOptions;
  2901. /**
  2902. * Apply the plugin
  2903. */
  2904. apply(compiler: Compiler): void;
  2905. }
  2906. declare interface DeterministicChunkIdsPluginOptions {
  2907. /**
  2908. * context for ids
  2909. */
  2910. context?: string;
  2911. /**
  2912. * maximum length of ids
  2913. */
  2914. maxLength?: number;
  2915. }
  2916. declare class DeterministicModuleIdsPlugin {
  2917. constructor(options?: DeterministicModuleIdsPluginOptions);
  2918. options: DeterministicModuleIdsPluginOptions;
  2919. /**
  2920. * Apply the plugin
  2921. */
  2922. apply(compiler: Compiler): void;
  2923. }
  2924. declare interface DeterministicModuleIdsPluginOptions {
  2925. /**
  2926. * context relative to which module identifiers are computed
  2927. */
  2928. context?: string;
  2929. /**
  2930. * selector function for modules
  2931. */
  2932. test?: (arg0: Module) => boolean;
  2933. /**
  2934. * maximum id length in digits (used as starting point)
  2935. */
  2936. maxLength?: number;
  2937. /**
  2938. * hash salt for ids
  2939. */
  2940. salt?: number;
  2941. /**
  2942. * do not increase the maxLength to find an optimal id space size
  2943. */
  2944. fixedLength?: boolean;
  2945. /**
  2946. * throw an error when id conflicts occur (instead of rehashing)
  2947. */
  2948. failOnConflict?: boolean;
  2949. }
  2950. /**
  2951. * Options for the webpack-dev-server.
  2952. */
  2953. declare interface DevServer {
  2954. [index: string]: any;
  2955. }
  2956. declare class DllPlugin {
  2957. constructor(options: DllPluginOptions);
  2958. options: {
  2959. entryOnly: boolean;
  2960. /**
  2961. * Context of requests in the manifest file (defaults to the webpack context).
  2962. */
  2963. context?: string;
  2964. /**
  2965. * If true, manifest json file (output) will be formatted.
  2966. */
  2967. format?: boolean;
  2968. /**
  2969. * Name of the exposed dll function (external name, use value of 'output.library').
  2970. */
  2971. name?: string;
  2972. /**
  2973. * Absolute path to the manifest json file (output).
  2974. */
  2975. path: string;
  2976. /**
  2977. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  2978. */
  2979. type?: string;
  2980. };
  2981. /**
  2982. * Apply the plugin
  2983. */
  2984. apply(compiler: Compiler): void;
  2985. }
  2986. declare interface DllPluginOptions {
  2987. /**
  2988. * Context of requests in the manifest file (defaults to the webpack context).
  2989. */
  2990. context?: string;
  2991. /**
  2992. * If true, only entry points will be exposed (default: true).
  2993. */
  2994. entryOnly?: boolean;
  2995. /**
  2996. * If true, manifest json file (output) will be formatted.
  2997. */
  2998. format?: boolean;
  2999. /**
  3000. * Name of the exposed dll function (external name, use value of 'output.library').
  3001. */
  3002. name?: string;
  3003. /**
  3004. * Absolute path to the manifest json file (output).
  3005. */
  3006. path: string;
  3007. /**
  3008. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3009. */
  3010. type?: string;
  3011. }
  3012. declare class DllReferencePlugin {
  3013. constructor(options: DllReferencePluginOptions);
  3014. options: DllReferencePluginOptions;
  3015. /**
  3016. * Apply the plugin
  3017. */
  3018. apply(compiler: Compiler): void;
  3019. }
  3020. type DllReferencePluginOptions =
  3021. | {
  3022. /**
  3023. * Context of requests in the manifest (or content property) as absolute path.
  3024. */
  3025. context?: string;
  3026. /**
  3027. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3028. */
  3029. extensions?: string[];
  3030. /**
  3031. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  3032. */
  3033. manifest: string | DllReferencePluginOptionsManifest;
  3034. /**
  3035. * The name where the dll is exposed (external name, defaults to manifest.name).
  3036. */
  3037. name?: string;
  3038. /**
  3039. * Prefix which is used for accessing the content of the dll.
  3040. */
  3041. scope?: string;
  3042. /**
  3043. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  3044. */
  3045. sourceType?:
  3046. | "var"
  3047. | "assign"
  3048. | "this"
  3049. | "window"
  3050. | "global"
  3051. | "commonjs"
  3052. | "commonjs2"
  3053. | "commonjs-module"
  3054. | "amd"
  3055. | "amd-require"
  3056. | "umd"
  3057. | "umd2"
  3058. | "jsonp"
  3059. | "system";
  3060. /**
  3061. * The way how the export of the dll bundle is used.
  3062. */
  3063. type?: "object" | "require";
  3064. }
  3065. | {
  3066. /**
  3067. * The mappings from request to module info.
  3068. */
  3069. content: DllReferencePluginOptionsContent;
  3070. /**
  3071. * Context of requests in the manifest (or content property) as absolute path.
  3072. */
  3073. context?: string;
  3074. /**
  3075. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3076. */
  3077. extensions?: string[];
  3078. /**
  3079. * The name where the dll is exposed (external name).
  3080. */
  3081. name: string;
  3082. /**
  3083. * Prefix which is used for accessing the content of the dll.
  3084. */
  3085. scope?: string;
  3086. /**
  3087. * How the dll is exposed (libraryTarget).
  3088. */
  3089. sourceType?:
  3090. | "var"
  3091. | "assign"
  3092. | "this"
  3093. | "window"
  3094. | "global"
  3095. | "commonjs"
  3096. | "commonjs2"
  3097. | "commonjs-module"
  3098. | "amd"
  3099. | "amd-require"
  3100. | "umd"
  3101. | "umd2"
  3102. | "jsonp"
  3103. | "system";
  3104. /**
  3105. * The way how the export of the dll bundle is used.
  3106. */
  3107. type?: "object" | "require";
  3108. };
  3109. /**
  3110. * The mappings from request to module info.
  3111. */
  3112. declare interface DllReferencePluginOptionsContent {
  3113. [index: string]: {
  3114. /**
  3115. * Meta information about the module.
  3116. */
  3117. buildMeta?: { [index: string]: any };
  3118. /**
  3119. * Information about the provided exports of the module.
  3120. */
  3121. exports?: true | string[];
  3122. /**
  3123. * Module ID.
  3124. */
  3125. id: string | number;
  3126. };
  3127. }
  3128. /**
  3129. * An object containing content, name and type.
  3130. */
  3131. declare interface DllReferencePluginOptionsManifest {
  3132. /**
  3133. * The mappings from request to module info.
  3134. */
  3135. content: DllReferencePluginOptionsContent;
  3136. /**
  3137. * The name where the dll is exposed (external name).
  3138. */
  3139. name?: string;
  3140. /**
  3141. * The type how the dll is exposed (external type).
  3142. */
  3143. type?:
  3144. | "var"
  3145. | "assign"
  3146. | "this"
  3147. | "window"
  3148. | "global"
  3149. | "commonjs"
  3150. | "commonjs2"
  3151. | "commonjs-module"
  3152. | "amd"
  3153. | "amd-require"
  3154. | "umd"
  3155. | "umd2"
  3156. | "jsonp"
  3157. | "system";
  3158. }
  3159. declare class DynamicEntryPlugin {
  3160. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  3161. context: string;
  3162. entry: () => Promise<EntryStaticNormalized>;
  3163. /**
  3164. * Apply the plugin
  3165. */
  3166. apply(compiler: Compiler): void;
  3167. }
  3168. declare interface Effect {
  3169. type: string;
  3170. value: any;
  3171. }
  3172. declare class ElectronTargetPlugin {
  3173. constructor(context?: "main" | "preload" | "renderer");
  3174. /**
  3175. * Apply the plugin
  3176. */
  3177. apply(compiler: Compiler): void;
  3178. }
  3179. /**
  3180. * No generator options are supported for this module type.
  3181. */
  3182. declare interface EmptyGeneratorOptions {}
  3183. /**
  3184. * No parser options are supported for this module type.
  3185. */
  3186. declare interface EmptyParserOptions {}
  3187. declare class EnableChunkLoadingPlugin {
  3188. constructor(type: string);
  3189. type: string;
  3190. /**
  3191. * Apply the plugin
  3192. */
  3193. apply(compiler: Compiler): void;
  3194. static setEnabled(compiler: Compiler, type: string): void;
  3195. static checkEnabled(compiler: Compiler, type: string): void;
  3196. }
  3197. declare class EnableLibraryPlugin {
  3198. constructor(type: string);
  3199. type: string;
  3200. /**
  3201. * Apply the plugin
  3202. */
  3203. apply(compiler: Compiler): void;
  3204. static setEnabled(compiler: Compiler, type: string): void;
  3205. static checkEnabled(compiler: Compiler, type: string): void;
  3206. }
  3207. declare class EnableWasmLoadingPlugin {
  3208. constructor(type: string);
  3209. type: string;
  3210. /**
  3211. * Apply the plugin
  3212. */
  3213. apply(compiler: Compiler): void;
  3214. static setEnabled(compiler: Compiler, type: string): void;
  3215. static checkEnabled(compiler: Compiler, type: string): void;
  3216. }
  3217. type Entry =
  3218. | string
  3219. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  3220. | EntryObject
  3221. | string[];
  3222. declare interface EntryData {
  3223. /**
  3224. * dependencies of the entrypoint that should be evaluated at startup
  3225. */
  3226. dependencies: Dependency[];
  3227. /**
  3228. * dependencies of the entrypoint that should be included but not evaluated
  3229. */
  3230. includeDependencies: Dependency[];
  3231. /**
  3232. * options of the entrypoint
  3233. */
  3234. options: EntryOptions;
  3235. }
  3236. declare abstract class EntryDependency extends ModuleDependency {}
  3237. /**
  3238. * An object with entry point description.
  3239. */
  3240. declare interface EntryDescription {
  3241. /**
  3242. * Enable/disable creating async chunks that are loaded on demand.
  3243. */
  3244. asyncChunks?: boolean;
  3245. /**
  3246. * Base uri for this entry.
  3247. */
  3248. baseUri?: string;
  3249. /**
  3250. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  3251. */
  3252. chunkLoading?: string | false;
  3253. /**
  3254. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3255. */
  3256. dependOn?: string | string[];
  3257. /**
  3258. * Specifies the filename of the output file on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  3259. */
  3260. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3261. /**
  3262. * Module(s) that are loaded upon startup.
  3263. */
  3264. import: EntryItem;
  3265. /**
  3266. * Specifies the layer in which modules of this entrypoint are placed.
  3267. */
  3268. layer?: null | string;
  3269. /**
  3270. * Options for library.
  3271. */
  3272. library?: LibraryOptions;
  3273. /**
  3274. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3275. */
  3276. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3277. /**
  3278. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3279. */
  3280. runtime?: string | false;
  3281. /**
  3282. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  3283. */
  3284. wasmLoading?: string | false;
  3285. }
  3286. /**
  3287. * An object with entry point description.
  3288. */
  3289. declare interface EntryDescriptionNormalized {
  3290. /**
  3291. * Enable/disable creating async chunks that are loaded on demand.
  3292. */
  3293. asyncChunks?: boolean;
  3294. /**
  3295. * Base uri for this entry.
  3296. */
  3297. baseUri?: string;
  3298. /**
  3299. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  3300. */
  3301. chunkLoading?: string | false;
  3302. /**
  3303. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3304. */
  3305. dependOn?: string[];
  3306. /**
  3307. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  3308. */
  3309. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3310. /**
  3311. * Module(s) that are loaded upon startup. The last one is exported.
  3312. */
  3313. import?: string[];
  3314. /**
  3315. * Specifies the layer in which modules of this entrypoint are placed.
  3316. */
  3317. layer?: null | string;
  3318. /**
  3319. * Options for library.
  3320. */
  3321. library?: LibraryOptions;
  3322. /**
  3323. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3324. */
  3325. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3326. /**
  3327. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3328. */
  3329. runtime?: string | false;
  3330. /**
  3331. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  3332. */
  3333. wasmLoading?: string | false;
  3334. }
  3335. type EntryItem = string | string[];
  3336. type EntryNormalized =
  3337. | (() => Promise<EntryStaticNormalized>)
  3338. | EntryStaticNormalized;
  3339. /**
  3340. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3341. */
  3342. declare interface EntryObject {
  3343. [index: string]: string | string[] | EntryDescription;
  3344. }
  3345. declare class EntryOptionPlugin {
  3346. constructor();
  3347. apply(compiler: Compiler): void;
  3348. static applyEntryOption(
  3349. compiler: Compiler,
  3350. context: string,
  3351. entry: EntryNormalized
  3352. ): void;
  3353. static entryDescriptionToOptions(
  3354. compiler: Compiler,
  3355. name: string,
  3356. desc: EntryDescriptionNormalized
  3357. ): EntryOptions;
  3358. }
  3359. type EntryOptions = { name?: string } & Omit<
  3360. EntryDescriptionNormalized,
  3361. "import"
  3362. >;
  3363. declare class EntryPlugin {
  3364. /**
  3365. * An entry plugin which will handle
  3366. * creation of the EntryDependency
  3367. */
  3368. constructor(context: string, entry: string, options?: string | EntryOptions);
  3369. context: string;
  3370. entry: string;
  3371. options: string | EntryOptions;
  3372. /**
  3373. * Apply the plugin
  3374. */
  3375. apply(compiler: Compiler): void;
  3376. static createDependency(
  3377. entry: string,
  3378. options: string | EntryOptions
  3379. ): EntryDependency;
  3380. }
  3381. type EntryStatic = string | EntryObject | string[];
  3382. /**
  3383. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3384. */
  3385. declare interface EntryStaticNormalized {
  3386. [index: string]: EntryDescriptionNormalized;
  3387. }
  3388. declare abstract class Entrypoint extends ChunkGroup {
  3389. /**
  3390. * Sets the runtimeChunk for an entrypoint.
  3391. */
  3392. setRuntimeChunk(chunk: Chunk): void;
  3393. /**
  3394. * Fetches the chunk reference containing the webpack bootstrap code
  3395. */
  3396. getRuntimeChunk(): null | Chunk;
  3397. /**
  3398. * Sets the chunk with the entrypoint modules for an entrypoint.
  3399. */
  3400. setEntrypointChunk(chunk: Chunk): void;
  3401. /**
  3402. * Returns the chunk which contains the entrypoint modules
  3403. * (or at least the execution of them)
  3404. */
  3405. getEntrypointChunk(): Chunk;
  3406. }
  3407. /**
  3408. * The abilities of the environment where the webpack generated code should run.
  3409. */
  3410. declare interface Environment {
  3411. /**
  3412. * The environment supports arrow functions ('() => { ... }').
  3413. */
  3414. arrowFunction?: boolean;
  3415. /**
  3416. * The environment supports BigInt as literal (123n).
  3417. */
  3418. bigIntLiteral?: boolean;
  3419. /**
  3420. * The environment supports const and let for variable declarations.
  3421. */
  3422. const?: boolean;
  3423. /**
  3424. * The environment supports destructuring ('{ a, b } = obj').
  3425. */
  3426. destructuring?: boolean;
  3427. /**
  3428. * The environment supports an async import() function to import EcmaScript modules.
  3429. */
  3430. dynamicImport?: boolean;
  3431. /**
  3432. * The environment supports an async import() is available when creating a worker.
  3433. */
  3434. dynamicImportInWorker?: boolean;
  3435. /**
  3436. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3437. */
  3438. forOf?: boolean;
  3439. /**
  3440. * The environment supports 'globalThis'.
  3441. */
  3442. globalThis?: boolean;
  3443. /**
  3444. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3445. */
  3446. module?: boolean;
  3447. /**
  3448. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3449. */
  3450. optionalChaining?: boolean;
  3451. /**
  3452. * The environment supports template literals.
  3453. */
  3454. templateLiteral?: boolean;
  3455. }
  3456. declare class EnvironmentPlugin {
  3457. constructor(...keys: any[]);
  3458. keys: any[];
  3459. defaultValues: any;
  3460. /**
  3461. * Apply the plugin
  3462. */
  3463. apply(compiler: Compiler): void;
  3464. }
  3465. type ErrorWithDetail = Error & { details?: string };
  3466. declare interface Etag {
  3467. toString: () => string;
  3468. }
  3469. declare class EvalDevToolModulePlugin {
  3470. constructor(options?: any);
  3471. namespace: any;
  3472. sourceUrlComment: any;
  3473. moduleFilenameTemplate: any;
  3474. /**
  3475. * Apply the plugin
  3476. */
  3477. apply(compiler: Compiler): void;
  3478. }
  3479. declare class EvalSourceMapDevToolPlugin {
  3480. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3481. sourceMapComment: string;
  3482. moduleFilenameTemplate: string | Function;
  3483. namespace: string;
  3484. options: SourceMapDevToolPluginOptions;
  3485. /**
  3486. * Apply the plugin
  3487. */
  3488. apply(compiler: Compiler): void;
  3489. }
  3490. declare interface ExecuteModuleArgument {
  3491. module: Module;
  3492. moduleObject?: { id: string; exports: any; loaded: boolean };
  3493. preparedInfo: any;
  3494. codeGenerationResult: CodeGenerationResult;
  3495. }
  3496. declare interface ExecuteModuleContext {
  3497. assets: Map<string, { source: Source; info: AssetInfo }>;
  3498. chunk: Chunk;
  3499. chunkGraph: ChunkGraph;
  3500. __webpack_require__?: (arg0: string) => any;
  3501. }
  3502. declare interface ExecuteModuleOptions {
  3503. entryOptions?: EntryOptions;
  3504. }
  3505. declare interface ExecuteModuleResult {
  3506. exports: any;
  3507. cacheable: boolean;
  3508. assets: Map<string, { source: Source; info: AssetInfo }>;
  3509. fileDependencies: LazySet<string>;
  3510. contextDependencies: LazySet<string>;
  3511. missingDependencies: LazySet<string>;
  3512. buildDependencies: LazySet<string>;
  3513. }
  3514. type Experiments = ExperimentsCommon & ExperimentsExtra;
  3515. /**
  3516. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3517. */
  3518. declare interface ExperimentsCommon {
  3519. /**
  3520. * Support WebAssembly as asynchronous EcmaScript Module.
  3521. */
  3522. asyncWebAssembly?: boolean;
  3523. /**
  3524. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  3525. */
  3526. backCompat?: boolean;
  3527. /**
  3528. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  3529. */
  3530. cacheUnaffected?: boolean;
  3531. /**
  3532. * Apply defaults of next major version.
  3533. */
  3534. futureDefaults?: boolean;
  3535. /**
  3536. * Enable module layers.
  3537. */
  3538. layers?: boolean;
  3539. /**
  3540. * Allow output javascript files as module source type.
  3541. */
  3542. outputModule?: boolean;
  3543. /**
  3544. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  3545. */
  3546. syncWebAssembly?: boolean;
  3547. /**
  3548. * Allow using top-level-await in EcmaScript Modules.
  3549. */
  3550. topLevelAwait?: boolean;
  3551. }
  3552. /**
  3553. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3554. */
  3555. declare interface ExperimentsExtra {
  3556. /**
  3557. * Build http(s): urls using a lockfile and resource content cache.
  3558. */
  3559. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  3560. /**
  3561. * Enable css support.
  3562. */
  3563. css?: boolean | CssExperimentOptions;
  3564. /**
  3565. * Compile entrypoints and import()s only when they are accessed.
  3566. */
  3567. lazyCompilation?: boolean | LazyCompilationOptions;
  3568. }
  3569. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  3570. /**
  3571. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3572. */
  3573. declare interface ExperimentsNormalizedExtra {
  3574. /**
  3575. * Build http(s): urls using a lockfile and resource content cache.
  3576. */
  3577. buildHttp?: HttpUriOptions;
  3578. /**
  3579. * Enable css support.
  3580. */
  3581. css?: false | CssExperimentOptions;
  3582. /**
  3583. * Compile entrypoints and import()s only when they are accessed.
  3584. */
  3585. lazyCompilation?: false | LazyCompilationOptions;
  3586. }
  3587. declare abstract class ExportInfo {
  3588. name: string;
  3589. /**
  3590. * true: it is provided
  3591. * false: it is not provided
  3592. * null: only the runtime knows if it is provided
  3593. * undefined: it was not determined if it is provided
  3594. */
  3595. provided?: null | boolean;
  3596. /**
  3597. * is the export a terminal binding that should be checked for export star conflicts
  3598. */
  3599. terminalBinding: boolean;
  3600. /**
  3601. * true: it can be mangled
  3602. * false: is can not be mangled
  3603. * undefined: it was not determined if it can be mangled
  3604. */
  3605. canMangleProvide?: boolean;
  3606. /**
  3607. * true: it can be mangled
  3608. * false: is can not be mangled
  3609. * undefined: it was not determined if it can be mangled
  3610. */
  3611. canMangleUse?: boolean;
  3612. exportsInfoOwned: boolean;
  3613. exportsInfo?: ExportsInfo;
  3614. get canMangle(): boolean;
  3615. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3616. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3617. setHasUseInfo(): void;
  3618. setUsedConditionally(
  3619. condition: (arg0: UsageStateType) => boolean,
  3620. newValue: UsageStateType,
  3621. runtime: RuntimeSpec
  3622. ): boolean;
  3623. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  3624. unsetTarget(key?: any): boolean;
  3625. setTarget(
  3626. key: any,
  3627. connection: ModuleGraphConnection,
  3628. exportName?: string[],
  3629. priority?: number
  3630. ): boolean;
  3631. getUsed(runtime: RuntimeSpec): UsageStateType;
  3632. /**
  3633. * get used name
  3634. */
  3635. getUsedName(
  3636. fallbackName: undefined | string,
  3637. runtime: RuntimeSpec
  3638. ): string | false;
  3639. hasUsedName(): boolean;
  3640. /**
  3641. * Sets the mangled name of this export
  3642. */
  3643. setUsedName(name: string): void;
  3644. getTerminalBinding(
  3645. moduleGraph: ModuleGraph,
  3646. resolveTargetFilter?: (arg0: {
  3647. module: Module;
  3648. export?: string[];
  3649. }) => boolean
  3650. ): undefined | ExportsInfo | ExportInfo;
  3651. isReexport(): undefined | boolean;
  3652. findTarget(
  3653. moduleGraph: ModuleGraph,
  3654. validTargetModuleFilter: (arg0: Module) => boolean
  3655. ): undefined | false | { module: Module; export?: string[] };
  3656. getTarget(
  3657. moduleGraph: ModuleGraph,
  3658. resolveTargetFilter?: (arg0: {
  3659. module: Module;
  3660. export?: string[];
  3661. }) => boolean
  3662. ): undefined | { module: Module; export?: string[] };
  3663. /**
  3664. * Move the target forward as long resolveTargetFilter is fulfilled
  3665. */
  3666. moveTarget(
  3667. moduleGraph: ModuleGraph,
  3668. resolveTargetFilter: (arg0: {
  3669. module: Module;
  3670. export?: string[];
  3671. }) => boolean,
  3672. updateOriginalConnection?: (arg0: {
  3673. module: Module;
  3674. export?: string[];
  3675. }) => ModuleGraphConnection
  3676. ): undefined | { module: Module; export?: string[] };
  3677. createNestedExportsInfo(): undefined | ExportsInfo;
  3678. getNestedExportsInfo(): undefined | ExportsInfo;
  3679. hasInfo(baseInfo?: any, runtime?: any): boolean;
  3680. updateHash(hash?: any, runtime?: any): void;
  3681. getUsedInfo(): string;
  3682. getProvidedInfo():
  3683. | "no provided info"
  3684. | "maybe provided (runtime-defined)"
  3685. | "provided"
  3686. | "not provided";
  3687. getRenameInfo(): string;
  3688. }
  3689. declare interface ExportSpec {
  3690. /**
  3691. * the name of the export
  3692. */
  3693. name: string;
  3694. /**
  3695. * can the export be renamed (defaults to true)
  3696. */
  3697. canMangle?: boolean;
  3698. /**
  3699. * is the export a terminal binding that should be checked for export star conflicts
  3700. */
  3701. terminalBinding?: boolean;
  3702. /**
  3703. * nested exports
  3704. */
  3705. exports?: (string | ExportSpec)[];
  3706. /**
  3707. * when reexported: from which module
  3708. */
  3709. from?: ModuleGraphConnection;
  3710. /**
  3711. * when reexported: from which export
  3712. */
  3713. export?: null | string[];
  3714. /**
  3715. * when reexported: with which priority
  3716. */
  3717. priority?: number;
  3718. /**
  3719. * export is not visible, because another export blends over it
  3720. */
  3721. hidden?: boolean;
  3722. }
  3723. type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
  3724. declare abstract class ExportsInfo {
  3725. get ownedExports(): Iterable<ExportInfo>;
  3726. get orderedOwnedExports(): Iterable<ExportInfo>;
  3727. get exports(): Iterable<ExportInfo>;
  3728. get orderedExports(): Iterable<ExportInfo>;
  3729. get otherExportsInfo(): ExportInfo;
  3730. setRedirectNamedTo(exportsInfo?: any): boolean;
  3731. setHasProvideInfo(): void;
  3732. setHasUseInfo(): void;
  3733. getOwnExportInfo(name: string): ExportInfo;
  3734. getExportInfo(name: string): ExportInfo;
  3735. getReadOnlyExportInfo(name: string): ExportInfo;
  3736. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  3737. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  3738. setUnknownExportsProvided(
  3739. canMangle?: boolean,
  3740. excludeExports?: Set<string>,
  3741. targetKey?: any,
  3742. targetModule?: ModuleGraphConnection,
  3743. priority?: number
  3744. ): boolean;
  3745. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3746. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3747. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  3748. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  3749. isUsed(runtime: RuntimeSpec): boolean;
  3750. isModuleUsed(runtime: RuntimeSpec): boolean;
  3751. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  3752. getProvidedExports(): null | true | string[];
  3753. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  3754. isExportProvided(name: string | string[]): undefined | null | boolean;
  3755. getUsageKey(runtime: RuntimeSpec): string;
  3756. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  3757. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  3758. getUsedName(
  3759. name: string | string[],
  3760. runtime: RuntimeSpec
  3761. ): string | false | string[];
  3762. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  3763. getRestoreProvidedData(): any;
  3764. restoreProvided(__0: {
  3765. otherProvided: any;
  3766. otherCanMangleProvide: any;
  3767. otherTerminalBinding: any;
  3768. exports: any;
  3769. }): void;
  3770. }
  3771. declare interface ExportsSpec {
  3772. /**
  3773. * exported names, true for unknown exports or null for no exports
  3774. */
  3775. exports: null | true | (string | ExportSpec)[];
  3776. /**
  3777. * when exports = true, list of unaffected exports
  3778. */
  3779. excludeExports?: Set<string>;
  3780. /**
  3781. * list of maybe prior exposed, but now hidden exports
  3782. */
  3783. hideExports?: Set<string>;
  3784. /**
  3785. * when reexported: from which module
  3786. */
  3787. from?: ModuleGraphConnection;
  3788. /**
  3789. * when reexported: with which priority
  3790. */
  3791. priority?: number;
  3792. /**
  3793. * can the export be renamed (defaults to true)
  3794. */
  3795. canMangle?: boolean;
  3796. /**
  3797. * are the exports terminal bindings that should be checked for export star conflicts
  3798. */
  3799. terminalBinding?: boolean;
  3800. /**
  3801. * module on which the result depends on
  3802. */
  3803. dependencies?: Module[];
  3804. }
  3805. type Exposes = (string | ExposesObject)[] | ExposesObject;
  3806. /**
  3807. * Advanced configuration for modules that should be exposed by this container.
  3808. */
  3809. declare interface ExposesConfig {
  3810. /**
  3811. * Request to a module that should be exposed by this container.
  3812. */
  3813. import: string | string[];
  3814. /**
  3815. * Custom chunk name for the exposed module.
  3816. */
  3817. name?: string;
  3818. }
  3819. /**
  3820. * Modules that should be exposed by this container. Property names are used as public paths.
  3821. */
  3822. declare interface ExposesObject {
  3823. [index: string]: string | ExposesConfig | string[];
  3824. }
  3825. type Expression =
  3826. | UnaryExpression
  3827. | ArrayExpression
  3828. | ArrowFunctionExpression
  3829. | AssignmentExpression
  3830. | AwaitExpression
  3831. | BinaryExpression
  3832. | SimpleCallExpression
  3833. | NewExpression
  3834. | ChainExpression
  3835. | ClassExpression
  3836. | ConditionalExpression
  3837. | FunctionExpression
  3838. | Identifier
  3839. | ImportExpression
  3840. | SimpleLiteral
  3841. | RegExpLiteral
  3842. | BigIntLiteral
  3843. | LogicalExpression
  3844. | MemberExpression
  3845. | MetaProperty
  3846. | ObjectExpression
  3847. | SequenceExpression
  3848. | TaggedTemplateExpression
  3849. | TemplateLiteral
  3850. | ThisExpression
  3851. | UpdateExpression
  3852. | YieldExpression;
  3853. declare interface ExpressionExpressionInfo {
  3854. type: "expression";
  3855. rootInfo: string | VariableInfo;
  3856. name: string;
  3857. getMembers: () => string[];
  3858. getMembersOptionals: () => boolean[];
  3859. getMemberRanges: () => [number, number][];
  3860. }
  3861. declare interface ExtensionAliasOption {
  3862. alias: string | string[];
  3863. extension: string;
  3864. }
  3865. declare interface ExtensionAliasOptions {
  3866. [index: string]: string | string[];
  3867. }
  3868. type ExternalItem =
  3869. | string
  3870. | RegExp
  3871. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3872. | ((
  3873. data: ExternalItemFunctionData,
  3874. callback: (
  3875. err?: null | Error,
  3876. result?: string | boolean | string[] | { [index: string]: any }
  3877. ) => void
  3878. ) => void)
  3879. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3880. /**
  3881. * Data object passed as argument when a function is set for 'externals'.
  3882. */
  3883. declare interface ExternalItemFunctionData {
  3884. /**
  3885. * The directory in which the request is placed.
  3886. */
  3887. context?: string;
  3888. /**
  3889. * Contextual information.
  3890. */
  3891. contextInfo?: ModuleFactoryCreateDataContextInfo;
  3892. /**
  3893. * The category of the referencing dependencies.
  3894. */
  3895. dependencyType?: string;
  3896. /**
  3897. * Get a resolve function with the current resolver options.
  3898. */
  3899. getResolve?: (
  3900. options?: ResolveOptionsWebpackOptions
  3901. ) =>
  3902. | ((
  3903. context: string,
  3904. request: string,
  3905. callback: (err?: Error, result?: string) => void
  3906. ) => void)
  3907. | ((context: string, request: string) => Promise<string>);
  3908. /**
  3909. * The request as written by the user in the require/import expression/statement.
  3910. */
  3911. request?: string;
  3912. }
  3913. /**
  3914. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3915. */
  3916. declare interface ExternalItemObjectKnown {
  3917. /**
  3918. * Specify externals depending on the layer.
  3919. */
  3920. byLayer?:
  3921. | { [index: string]: ExternalItem }
  3922. | ((layer: null | string) => ExternalItem);
  3923. }
  3924. /**
  3925. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  3926. */
  3927. declare interface ExternalItemObjectUnknown {
  3928. [index: string]: ExternalItemValue;
  3929. }
  3930. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  3931. declare class ExternalModule extends Module {
  3932. constructor(
  3933. request: string | string[] | Record<string, string | string[]>,
  3934. type: any,
  3935. userRequest: string
  3936. );
  3937. request: string | string[] | Record<string, string | string[]>;
  3938. externalType: string;
  3939. userRequest: string;
  3940. restoreFromUnsafeCache(
  3941. unsafeCacheData?: any,
  3942. normalModuleFactory?: any
  3943. ): void;
  3944. }
  3945. declare interface ExternalModuleInfo {
  3946. index: number;
  3947. module: Module;
  3948. }
  3949. type Externals =
  3950. | string
  3951. | RegExp
  3952. | ExternalItem[]
  3953. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  3954. | ((
  3955. data: ExternalItemFunctionData,
  3956. callback: (
  3957. err?: null | Error,
  3958. result?: string | boolean | string[] | { [index: string]: any }
  3959. ) => void
  3960. ) => void)
  3961. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  3962. declare class ExternalsPlugin {
  3963. constructor(type: undefined | string, externals: Externals);
  3964. type?: string;
  3965. externals: Externals;
  3966. /**
  3967. * Apply the plugin
  3968. */
  3969. apply(compiler: Compiler): void;
  3970. }
  3971. /**
  3972. * Enable presets of externals for specific targets.
  3973. */
  3974. declare interface ExternalsPresets {
  3975. /**
  3976. * Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
  3977. */
  3978. electron?: boolean;
  3979. /**
  3980. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  3981. */
  3982. electronMain?: boolean;
  3983. /**
  3984. * Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
  3985. */
  3986. electronPreload?: boolean;
  3987. /**
  3988. * Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.
  3989. */
  3990. electronRenderer?: boolean;
  3991. /**
  3992. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  3993. */
  3994. node?: boolean;
  3995. /**
  3996. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  3997. */
  3998. nwjs?: boolean;
  3999. /**
  4000. * Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).
  4001. */
  4002. web?: boolean;
  4003. /**
  4004. * Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).
  4005. */
  4006. webAsync?: boolean;
  4007. }
  4008. type ExternalsType =
  4009. | "import"
  4010. | "var"
  4011. | "module"
  4012. | "assign"
  4013. | "this"
  4014. | "window"
  4015. | "self"
  4016. | "global"
  4017. | "commonjs"
  4018. | "commonjs2"
  4019. | "commonjs-module"
  4020. | "commonjs-static"
  4021. | "amd"
  4022. | "amd-require"
  4023. | "umd"
  4024. | "umd2"
  4025. | "jsonp"
  4026. | "system"
  4027. | "promise"
  4028. | "script"
  4029. | "node-commonjs";
  4030. declare interface FactorizeModuleOptions {
  4031. currentProfile: ModuleProfile;
  4032. factory: ModuleFactory;
  4033. dependencies: Dependency[];
  4034. /**
  4035. * return full ModuleFactoryResult instead of only module
  4036. */
  4037. factoryResult?: boolean;
  4038. originModule: null | Module;
  4039. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4040. context?: string;
  4041. }
  4042. declare interface FactoryMeta {
  4043. sideEffectFree?: boolean;
  4044. }
  4045. type FakeHook<T> = T & FakeHookMarker;
  4046. declare interface FakeHookMarker {}
  4047. declare interface FallbackCacheGroup {
  4048. chunksFilter: (chunk: Chunk) => undefined | boolean;
  4049. minSize: SplitChunksSizes;
  4050. maxAsyncSize: SplitChunksSizes;
  4051. maxInitialSize: SplitChunksSizes;
  4052. automaticNameDelimiter: string;
  4053. }
  4054. declare class FetchCompileAsyncWasmPlugin {
  4055. constructor();
  4056. /**
  4057. * Apply the plugin
  4058. */
  4059. apply(compiler: Compiler): void;
  4060. }
  4061. declare class FetchCompileWasmPlugin {
  4062. constructor(options?: FetchCompileWasmPluginOptions);
  4063. options: FetchCompileWasmPluginOptions;
  4064. /**
  4065. * Apply the plugin
  4066. */
  4067. apply(compiler: Compiler): void;
  4068. }
  4069. declare interface FetchCompileWasmPluginOptions {
  4070. /**
  4071. * mangle imports
  4072. */
  4073. mangleImports?: boolean;
  4074. }
  4075. /**
  4076. * Options object for persistent file-based caching.
  4077. */
  4078. declare interface FileCacheOptions {
  4079. /**
  4080. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  4081. */
  4082. allowCollectingMemory?: boolean;
  4083. /**
  4084. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  4085. */
  4086. buildDependencies?: { [index: string]: string[] };
  4087. /**
  4088. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  4089. */
  4090. cacheDirectory?: string;
  4091. /**
  4092. * Locations for the cache (defaults to cacheDirectory / name).
  4093. */
  4094. cacheLocation?: string;
  4095. /**
  4096. * Compression type used for the cache files.
  4097. */
  4098. compression?: false | "gzip" | "brotli";
  4099. /**
  4100. * Algorithm used for generation the hash (see node.js crypto package).
  4101. */
  4102. hashAlgorithm?: string;
  4103. /**
  4104. * Time in ms after which idle period the cache storing should happen.
  4105. */
  4106. idleTimeout?: number;
  4107. /**
  4108. * Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
  4109. */
  4110. idleTimeoutAfterLargeChanges?: number;
  4111. /**
  4112. * Time in ms after which idle period the initial cache storing should happen.
  4113. */
  4114. idleTimeoutForInitialStore?: number;
  4115. /**
  4116. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  4117. */
  4118. immutablePaths?: (string | RegExp)[];
  4119. /**
  4120. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  4121. */
  4122. managedPaths?: (string | RegExp)[];
  4123. /**
  4124. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  4125. */
  4126. maxAge?: number;
  4127. /**
  4128. * Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.
  4129. */
  4130. maxMemoryGenerations?: number;
  4131. /**
  4132. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  4133. */
  4134. memoryCacheUnaffected?: boolean;
  4135. /**
  4136. * Name for the cache. Different names will lead to different coexisting caches.
  4137. */
  4138. name?: string;
  4139. /**
  4140. * Track and log detailed timing information for individual cache items.
  4141. */
  4142. profile?: boolean;
  4143. /**
  4144. * Enable/disable readonly mode.
  4145. */
  4146. readonly?: boolean;
  4147. /**
  4148. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  4149. */
  4150. store?: "pack";
  4151. /**
  4152. * Filesystem caching.
  4153. */
  4154. type: "filesystem";
  4155. /**
  4156. * Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.
  4157. */
  4158. version?: string;
  4159. }
  4160. declare interface FileSystem {
  4161. readFile: {
  4162. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  4163. (
  4164. arg0: string,
  4165. arg1: object,
  4166. arg2: FileSystemCallback<string | Buffer>
  4167. ): void;
  4168. };
  4169. readdir: (
  4170. arg0: string,
  4171. arg1?:
  4172. | null
  4173. | "ascii"
  4174. | "utf8"
  4175. | "utf16le"
  4176. | "ucs2"
  4177. | "latin1"
  4178. | "binary"
  4179. | ((
  4180. arg0?: null | NodeJS.ErrnoException,
  4181. arg1?: (string | Buffer)[] | (typeof Dirent)[]
  4182. ) => void)
  4183. | ReaddirOptions
  4184. | "utf-8"
  4185. | "ucs-2"
  4186. | "base64"
  4187. | "base64url"
  4188. | "hex"
  4189. | "buffer",
  4190. arg2?: (
  4191. arg0?: null | NodeJS.ErrnoException,
  4192. arg1?: (string | Buffer)[] | (typeof Dirent)[]
  4193. ) => void
  4194. ) => void;
  4195. readJson?: {
  4196. (arg0: string, arg1: FileSystemCallback<object>): void;
  4197. (arg0: string, arg1: object, arg2: FileSystemCallback<object>): void;
  4198. };
  4199. readlink: {
  4200. (arg0: string, arg1: FileSystemCallback<string | Buffer>): void;
  4201. (
  4202. arg0: string,
  4203. arg1: object,
  4204. arg2: FileSystemCallback<string | Buffer>
  4205. ): void;
  4206. };
  4207. lstat?: {
  4208. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  4209. (
  4210. arg0: string,
  4211. arg1: object,
  4212. arg2: FileSystemCallback<string | Buffer>
  4213. ): void;
  4214. };
  4215. stat: {
  4216. (arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
  4217. (
  4218. arg0: string,
  4219. arg1: object,
  4220. arg2: FileSystemCallback<string | Buffer>
  4221. ): void;
  4222. };
  4223. }
  4224. declare interface FileSystemCallback<T> {
  4225. (err?: null | (PossibleFileSystemError & Error), result?: T): any;
  4226. }
  4227. declare abstract class FileSystemInfo {
  4228. fs: InputFileSystem;
  4229. logger?: WebpackLogger;
  4230. fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
  4231. fileHashQueue: AsyncQueue<string, string, null | string>;
  4232. contextTimestampQueue: AsyncQueue<
  4233. string,
  4234. string,
  4235. null | ContextFileSystemInfoEntry
  4236. >;
  4237. contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
  4238. contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
  4239. managedItemQueue: AsyncQueue<string, string, null | string>;
  4240. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  4241. managedPaths: (string | RegExp)[];
  4242. managedPathsWithSlash: string[];
  4243. managedPathsRegExps: RegExp[];
  4244. immutablePaths: (string | RegExp)[];
  4245. immutablePathsWithSlash: string[];
  4246. immutablePathsRegExps: RegExp[];
  4247. logStatistics(): void;
  4248. clear(): void;
  4249. addFileTimestamps(
  4250. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4251. immutable?: boolean
  4252. ): void;
  4253. addContextTimestamps(
  4254. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4255. immutable?: boolean
  4256. ): void;
  4257. getFileTimestamp(
  4258. path: string,
  4259. callback: (
  4260. arg0?: null | WebpackError,
  4261. arg1?: null | FileSystemInfoEntry | "ignore"
  4262. ) => void
  4263. ): void;
  4264. getContextTimestamp(
  4265. path: string,
  4266. callback: (
  4267. arg0?: null | WebpackError,
  4268. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  4269. ) => void
  4270. ): void;
  4271. getFileHash(
  4272. path: string,
  4273. callback: (arg0?: null | WebpackError, arg1?: null | string) => void
  4274. ): void;
  4275. getContextHash(
  4276. path: string,
  4277. callback: (arg0?: null | WebpackError, arg1?: string) => void
  4278. ): void;
  4279. getContextTsh(
  4280. path: string,
  4281. callback: (
  4282. arg0?: null | WebpackError,
  4283. arg1?: ResolvedContextTimestampAndHash
  4284. ) => void
  4285. ): void;
  4286. resolveBuildDependencies(
  4287. context: string,
  4288. deps: Iterable<string>,
  4289. callback: (
  4290. arg0?: null | Error,
  4291. arg1?: ResolveBuildDependenciesResult
  4292. ) => void
  4293. ): void;
  4294. checkResolveResultsValid(
  4295. resolveResults: Map<string, string | false>,
  4296. callback: (arg0?: null | Error, arg1?: boolean) => void
  4297. ): void;
  4298. createSnapshot(
  4299. startTime: undefined | null | number,
  4300. files: Iterable<string>,
  4301. directories: Iterable<string>,
  4302. missing: Iterable<string>,
  4303. options: undefined | null | SnapshotOptionsFileSystemInfo,
  4304. callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
  4305. ): void;
  4306. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4307. checkSnapshotValid(
  4308. snapshot: Snapshot,
  4309. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  4310. ): void;
  4311. getDeprecatedFileTimestamps(): Map<any, any>;
  4312. getDeprecatedContextTimestamps(): Map<any, any>;
  4313. }
  4314. declare interface FileSystemInfoEntry {
  4315. safeTime: number;
  4316. timestamp?: number;
  4317. }
  4318. declare interface FileSystemStats {
  4319. isDirectory: () => boolean;
  4320. isFile: () => boolean;
  4321. }
  4322. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4323. declare interface GenerateContext {
  4324. /**
  4325. * mapping from dependencies to templates
  4326. */
  4327. dependencyTemplates: DependencyTemplates;
  4328. /**
  4329. * the runtime template
  4330. */
  4331. runtimeTemplate: RuntimeTemplate;
  4332. /**
  4333. * the module graph
  4334. */
  4335. moduleGraph: ModuleGraph;
  4336. /**
  4337. * the chunk graph
  4338. */
  4339. chunkGraph: ChunkGraph;
  4340. /**
  4341. * the requirements for runtime
  4342. */
  4343. runtimeRequirements: Set<string>;
  4344. /**
  4345. * the runtime
  4346. */
  4347. runtime: RuntimeSpec;
  4348. /**
  4349. * when in concatenated module, information about other concatenated modules
  4350. */
  4351. concatenationScope?: ConcatenationScope;
  4352. /**
  4353. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4354. */
  4355. codeGenerationResults?: CodeGenerationResults;
  4356. /**
  4357. * which kind of code should be generated
  4358. */
  4359. type: string;
  4360. /**
  4361. * get access to the code generation data
  4362. */
  4363. getData?: () => Map<string, any>;
  4364. }
  4365. declare class Generator {
  4366. constructor();
  4367. getTypes(module: NormalModule): Set<string>;
  4368. getSize(module: NormalModule, type?: string): number;
  4369. generate(module: NormalModule, __1: GenerateContext): Source;
  4370. getConcatenationBailoutReason(
  4371. module: NormalModule,
  4372. context: ConcatenationBailoutReasonContext
  4373. ): undefined | string;
  4374. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4375. static byType(map: Record<string, Generator>): ByTypeGenerator;
  4376. }
  4377. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4378. GeneratorOptionsByModuleTypeUnknown;
  4379. /**
  4380. * Specify options for each generator.
  4381. */
  4382. declare interface GeneratorOptionsByModuleTypeKnown {
  4383. /**
  4384. * Generator options for asset modules.
  4385. */
  4386. asset?: AssetGeneratorOptions;
  4387. /**
  4388. * Generator options for asset/inline modules.
  4389. */
  4390. "asset/inline"?: AssetInlineGeneratorOptions;
  4391. /**
  4392. * Generator options for asset/resource modules.
  4393. */
  4394. "asset/resource"?: AssetResourceGeneratorOptions;
  4395. /**
  4396. * No generator options are supported for this module type.
  4397. */
  4398. javascript?: EmptyGeneratorOptions;
  4399. /**
  4400. * No generator options are supported for this module type.
  4401. */
  4402. "javascript/auto"?: EmptyGeneratorOptions;
  4403. /**
  4404. * No generator options are supported for this module type.
  4405. */
  4406. "javascript/dynamic"?: EmptyGeneratorOptions;
  4407. /**
  4408. * No generator options are supported for this module type.
  4409. */
  4410. "javascript/esm"?: EmptyGeneratorOptions;
  4411. }
  4412. /**
  4413. * Specify options for each generator.
  4414. */
  4415. declare interface GeneratorOptionsByModuleTypeUnknown {
  4416. [index: string]: { [index: string]: any };
  4417. }
  4418. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4419. constructor(
  4420. contentType: string,
  4421. name: string,
  4422. global: string,
  4423. getFilenameForChunk: (
  4424. arg0: Chunk
  4425. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
  4426. allChunks: boolean
  4427. );
  4428. contentType: string;
  4429. global: string;
  4430. getFilenameForChunk: (
  4431. arg0: Chunk
  4432. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
  4433. allChunks: boolean;
  4434. /**
  4435. * Runtime modules without any dependencies to other runtime modules
  4436. */
  4437. static STAGE_NORMAL: number;
  4438. /**
  4439. * Runtime modules with simple dependencies on other runtime modules
  4440. */
  4441. static STAGE_BASIC: number;
  4442. /**
  4443. * Runtime modules which attach to handlers of other runtime modules
  4444. */
  4445. static STAGE_ATTACH: number;
  4446. /**
  4447. * Runtime modules which trigger actions on bootstrap
  4448. */
  4449. static STAGE_TRIGGER: number;
  4450. }
  4451. declare interface GroupConfig {
  4452. getKeys: (arg0?: any) => string[];
  4453. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4454. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4455. }
  4456. declare interface GroupOptions {
  4457. groupChildren?: boolean;
  4458. force?: boolean;
  4459. targetGroupCount?: number;
  4460. }
  4461. declare interface HMRJavascriptParserHooks {
  4462. hotAcceptCallback: SyncBailHook<[any, string[]], void>;
  4463. hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
  4464. }
  4465. declare interface HandleModuleCreationOptions {
  4466. factory: ModuleFactory;
  4467. dependencies: Dependency[];
  4468. originModule: null | Module;
  4469. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4470. context?: string;
  4471. /**
  4472. * recurse into dependencies of the created module
  4473. */
  4474. recursive?: boolean;
  4475. /**
  4476. * connect the resolved module with the origin module
  4477. */
  4478. connectOrigin?: boolean;
  4479. }
  4480. declare class HarmonyImportDependency extends ModuleDependency {
  4481. constructor(request: string, sourceOrder: number, assertions?: Assertions);
  4482. sourceOrder: number;
  4483. getImportVar(moduleGraph: ModuleGraph): string;
  4484. getImportStatement(
  4485. update: boolean,
  4486. __1: DependencyTemplateContext
  4487. ): [string, string];
  4488. getLinkingErrors(
  4489. moduleGraph: ModuleGraph,
  4490. ids: string[],
  4491. additionalMessage: string
  4492. ): undefined | WebpackError[];
  4493. static Template: typeof HarmonyImportDependencyTemplate;
  4494. static ExportPresenceModes: {
  4495. NONE: 0;
  4496. WARN: 1;
  4497. AUTO: 2;
  4498. ERROR: 3;
  4499. fromUserOption(str?: any): 0 | 1 | 2 | 3;
  4500. };
  4501. static NO_EXPORTS_REFERENCED: string[][];
  4502. static EXPORTS_OBJECT_REFERENCED: string[][];
  4503. static TRANSITIVE: typeof TRANSITIVE;
  4504. }
  4505. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  4506. constructor();
  4507. static getImportEmittedRuntime(
  4508. module: Module,
  4509. referencedModule: Module
  4510. ): undefined | string | boolean | SortableSet<string>;
  4511. }
  4512. declare class Hash {
  4513. constructor();
  4514. /**
  4515. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  4516. */
  4517. update(data: string | Buffer, inputEncoding?: string): Hash;
  4518. /**
  4519. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  4520. */
  4521. digest(encoding?: string): string | Buffer;
  4522. }
  4523. declare interface HashableObject {
  4524. updateHash: (arg0: Hash) => void;
  4525. }
  4526. declare class HashedModuleIdsPlugin {
  4527. constructor(options?: HashedModuleIdsPluginOptions);
  4528. options: HashedModuleIdsPluginOptions;
  4529. /**
  4530. * Apply the plugin
  4531. */
  4532. apply(compiler: Compiler): void;
  4533. }
  4534. declare interface HashedModuleIdsPluginOptions {
  4535. /**
  4536. * The context directory for creating names.
  4537. */
  4538. context?: string;
  4539. /**
  4540. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  4541. */
  4542. hashDigest?: "latin1" | "base64" | "hex";
  4543. /**
  4544. * The prefix length of the hash digest to use, defaults to 4.
  4545. */
  4546. hashDigestLength?: number;
  4547. /**
  4548. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  4549. */
  4550. hashFunction?: string | typeof Hash;
  4551. }
  4552. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  4553. declare class HotModuleReplacementPlugin {
  4554. constructor(options?: any);
  4555. options: any;
  4556. /**
  4557. * Apply the plugin
  4558. */
  4559. apply(compiler: Compiler): void;
  4560. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  4561. }
  4562. /**
  4563. * These properties are added by the HotModuleReplacementPlugin
  4564. */
  4565. declare interface HotModuleReplacementPluginLoaderContext {
  4566. hot?: boolean;
  4567. }
  4568. declare class HotUpdateChunk extends Chunk {
  4569. constructor();
  4570. }
  4571. /**
  4572. * Options for building http resources.
  4573. */
  4574. declare interface HttpUriOptions {
  4575. /**
  4576. * List of allowed URIs (resp. the beginning of them).
  4577. */
  4578. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  4579. /**
  4580. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  4581. */
  4582. cacheLocation?: string | false;
  4583. /**
  4584. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  4585. */
  4586. frozen?: boolean;
  4587. /**
  4588. * Location of the lockfile.
  4589. */
  4590. lockfileLocation?: string;
  4591. /**
  4592. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  4593. */
  4594. proxy?: string;
  4595. /**
  4596. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  4597. */
  4598. upgrade?: boolean;
  4599. }
  4600. declare class HttpUriPlugin {
  4601. constructor(options: HttpUriOptions);
  4602. /**
  4603. * Apply the plugin
  4604. */
  4605. apply(compiler: Compiler): void;
  4606. }
  4607. declare interface IDirent {
  4608. isFile: () => boolean;
  4609. isDirectory: () => boolean;
  4610. isBlockDevice: () => boolean;
  4611. isCharacterDevice: () => boolean;
  4612. isSymbolicLink: () => boolean;
  4613. isFIFO: () => boolean;
  4614. isSocket: () => boolean;
  4615. name: string | Buffer;
  4616. }
  4617. declare interface IStats {
  4618. isFile: () => boolean;
  4619. isDirectory: () => boolean;
  4620. isBlockDevice: () => boolean;
  4621. isCharacterDevice: () => boolean;
  4622. isSymbolicLink: () => boolean;
  4623. isFIFO: () => boolean;
  4624. isSocket: () => boolean;
  4625. dev: number | bigint;
  4626. ino: number | bigint;
  4627. mode: number | bigint;
  4628. nlink: number | bigint;
  4629. uid: number | bigint;
  4630. gid: number | bigint;
  4631. rdev: number | bigint;
  4632. size: number | bigint;
  4633. blksize: number | bigint;
  4634. blocks: number | bigint;
  4635. atimeMs: number | bigint;
  4636. mtimeMs: number | bigint;
  4637. ctimeMs: number | bigint;
  4638. birthtimeMs: number | bigint;
  4639. atime: Date;
  4640. mtime: Date;
  4641. ctime: Date;
  4642. birthtime: Date;
  4643. }
  4644. declare class IgnorePlugin {
  4645. constructor(options: IgnorePluginOptions);
  4646. options: IgnorePluginOptions;
  4647. /**
  4648. * Note that if "contextRegExp" is given, both the "resourceRegExp"
  4649. * and "contextRegExp" have to match.
  4650. */
  4651. checkIgnore(resolveData: ResolveData): undefined | false;
  4652. /**
  4653. * Apply the plugin
  4654. */
  4655. apply(compiler: Compiler): void;
  4656. }
  4657. type IgnorePluginOptions =
  4658. | {
  4659. /**
  4660. * A RegExp to test the context (directory) against.
  4661. */
  4662. contextRegExp?: RegExp;
  4663. /**
  4664. * A RegExp to test the request against.
  4665. */
  4666. resourceRegExp: RegExp;
  4667. }
  4668. | {
  4669. /**
  4670. * A filter function for resource and context.
  4671. */
  4672. checkResource: (resource: string, context: string) => boolean;
  4673. };
  4674. declare interface ImportModuleOptions {
  4675. /**
  4676. * the target layer
  4677. */
  4678. layer?: string;
  4679. /**
  4680. * the target public path
  4681. */
  4682. publicPath?: string;
  4683. /**
  4684. * target base uri
  4685. */
  4686. baseUri?: string;
  4687. }
  4688. type ImportSource =
  4689. | undefined
  4690. | null
  4691. | string
  4692. | SimpleLiteral
  4693. | RegExpLiteral
  4694. | BigIntLiteral;
  4695. /**
  4696. * Options for infrastructure level logging.
  4697. */
  4698. declare interface InfrastructureLogging {
  4699. /**
  4700. * Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.
  4701. */
  4702. appendOnly?: boolean;
  4703. /**
  4704. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  4705. */
  4706. colors?: boolean;
  4707. /**
  4708. * Custom console used for logging.
  4709. */
  4710. console?: Console;
  4711. /**
  4712. * Enable debug logging for specific loggers.
  4713. */
  4714. debug?:
  4715. | string
  4716. | boolean
  4717. | RegExp
  4718. | FilterItemTypes[]
  4719. | ((value: string) => boolean);
  4720. /**
  4721. * Log level.
  4722. */
  4723. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  4724. /**
  4725. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  4726. */
  4727. stream?: NodeJS.WritableStream;
  4728. }
  4729. declare abstract class InitFragment<Context> {
  4730. content: string | Source;
  4731. stage: number;
  4732. position: number;
  4733. key?: string;
  4734. endContent?: string | Source;
  4735. getContent(context: Context): string | Source;
  4736. getEndContent(context: Context): undefined | string | Source;
  4737. serialize(context: ObjectSerializerContext): void;
  4738. deserialize(context: ObjectDeserializerContext): void;
  4739. merge: any;
  4740. }
  4741. declare interface InputFileSystem {
  4742. readFile: (
  4743. arg0: string,
  4744. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4745. ) => void;
  4746. readJson?: (
  4747. arg0: string,
  4748. arg1: (arg0?: null | Error | NodeJS.ErrnoException, arg1?: any) => void
  4749. ) => void;
  4750. readlink: (
  4751. arg0: string,
  4752. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4753. ) => void;
  4754. readdir: (
  4755. arg0: string,
  4756. arg1: (
  4757. arg0?: null | NodeJS.ErrnoException,
  4758. arg1?: (string | Buffer)[] | IDirent[]
  4759. ) => void
  4760. ) => void;
  4761. stat: (
  4762. arg0: string,
  4763. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4764. ) => void;
  4765. lstat?: (
  4766. arg0: string,
  4767. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  4768. ) => void;
  4769. realpath?: (
  4770. arg0: string,
  4771. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  4772. ) => void;
  4773. purge?: (arg0?: string) => void;
  4774. join?: (arg0: string, arg1: string) => string;
  4775. relative?: (arg0: string, arg1: string) => string;
  4776. dirname?: (arg0: string) => string;
  4777. }
  4778. type IntermediateFileSystem = InputFileSystem &
  4779. OutputFileSystem &
  4780. IntermediateFileSystemExtras;
  4781. declare interface IntermediateFileSystemExtras {
  4782. mkdirSync: (arg0: string) => void;
  4783. createWriteStream: (arg0: string) => NodeJS.WritableStream;
  4784. open: (
  4785. arg0: string,
  4786. arg1: string,
  4787. arg2: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4788. ) => void;
  4789. read: (
  4790. arg0: number,
  4791. arg1: Buffer,
  4792. arg2: number,
  4793. arg3: number,
  4794. arg4: number,
  4795. arg5: (arg0?: null | NodeJS.ErrnoException, arg1?: number) => void
  4796. ) => void;
  4797. close: (
  4798. arg0: number,
  4799. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  4800. ) => void;
  4801. rename: (
  4802. arg0: string,
  4803. arg1: string,
  4804. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  4805. ) => void;
  4806. }
  4807. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  4808. declare abstract class ItemCacheFacade {
  4809. get<T>(callback: CallbackCache<T>): void;
  4810. getPromise<T>(): Promise<T>;
  4811. store<T>(data: T, callback: CallbackCache<void>): void;
  4812. storePromise<T>(data: T): Promise<void>;
  4813. provide<T>(
  4814. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  4815. callback: CallbackNormalErrorCache<T>
  4816. ): void;
  4817. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  4818. }
  4819. declare class JavascriptModulesPlugin {
  4820. constructor(options?: object);
  4821. options: object;
  4822. /**
  4823. * Apply the plugin
  4824. */
  4825. apply(compiler: Compiler): void;
  4826. renderModule(
  4827. module: Module,
  4828. renderContext: ChunkRenderContext,
  4829. hooks: CompilationHooksJavascriptModulesPlugin,
  4830. factory: boolean
  4831. ): Source;
  4832. renderChunk(
  4833. renderContext: RenderContext,
  4834. hooks: CompilationHooksJavascriptModulesPlugin
  4835. ): Source;
  4836. renderMain(
  4837. renderContext: MainRenderContext,
  4838. hooks: CompilationHooksJavascriptModulesPlugin,
  4839. compilation: Compilation
  4840. ): Source;
  4841. updateHashWithBootstrap(
  4842. hash: Hash,
  4843. renderContext: RenderBootstrapContext,
  4844. hooks: CompilationHooksJavascriptModulesPlugin
  4845. ): void;
  4846. renderBootstrap(
  4847. renderContext: RenderBootstrapContext,
  4848. hooks: CompilationHooksJavascriptModulesPlugin
  4849. ): {
  4850. header: string[];
  4851. beforeStartup: string[];
  4852. startup: string[];
  4853. afterStartup: string[];
  4854. allowInlineStartup: boolean;
  4855. };
  4856. renderRequire(
  4857. renderContext: RenderBootstrapContext,
  4858. hooks: CompilationHooksJavascriptModulesPlugin
  4859. ): string;
  4860. static getCompilationHooks(
  4861. compilation: Compilation
  4862. ): CompilationHooksJavascriptModulesPlugin;
  4863. static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
  4864. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  4865. }
  4866. declare class JavascriptParser extends Parser {
  4867. constructor(sourceType?: "module" | "auto" | "script");
  4868. hooks: Readonly<{
  4869. evaluateTypeof: HookMap<
  4870. SyncBailHook<
  4871. [UnaryExpression],
  4872. undefined | null | BasicEvaluatedExpression
  4873. >
  4874. >;
  4875. evaluate: HookMap<
  4876. SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
  4877. >;
  4878. evaluateIdentifier: HookMap<
  4879. SyncBailHook<
  4880. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  4881. undefined | null | BasicEvaluatedExpression
  4882. >
  4883. >;
  4884. evaluateDefinedIdentifier: HookMap<
  4885. SyncBailHook<
  4886. [Identifier | MemberExpression | ThisExpression],
  4887. undefined | null | BasicEvaluatedExpression
  4888. >
  4889. >;
  4890. evaluateNewExpression: HookMap<
  4891. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  4892. >;
  4893. evaluateCallExpression: HookMap<
  4894. SyncBailHook<
  4895. [CallExpression],
  4896. undefined | null | BasicEvaluatedExpression
  4897. >
  4898. >;
  4899. evaluateCallExpressionMember: HookMap<
  4900. SyncBailHook<
  4901. [CallExpression, undefined | BasicEvaluatedExpression],
  4902. undefined | null | BasicEvaluatedExpression
  4903. >
  4904. >;
  4905. isPure: HookMap<
  4906. SyncBailHook<
  4907. [
  4908. (
  4909. | UnaryExpression
  4910. | ArrayExpression
  4911. | ArrowFunctionExpression
  4912. | AssignmentExpression
  4913. | AwaitExpression
  4914. | BinaryExpression
  4915. | SimpleCallExpression
  4916. | NewExpression
  4917. | ChainExpression
  4918. | ClassExpression
  4919. | ConditionalExpression
  4920. | FunctionExpression
  4921. | Identifier
  4922. | ImportExpression
  4923. | SimpleLiteral
  4924. | RegExpLiteral
  4925. | BigIntLiteral
  4926. | LogicalExpression
  4927. | MemberExpression
  4928. | MetaProperty
  4929. | ObjectExpression
  4930. | SequenceExpression
  4931. | TaggedTemplateExpression
  4932. | TemplateLiteral
  4933. | ThisExpression
  4934. | UpdateExpression
  4935. | YieldExpression
  4936. | FunctionDeclaration
  4937. | VariableDeclaration
  4938. | ClassDeclaration
  4939. | PrivateIdentifier
  4940. ),
  4941. number
  4942. ],
  4943. boolean | void
  4944. >
  4945. >;
  4946. preStatement: SyncBailHook<
  4947. [
  4948. | FunctionDeclaration
  4949. | VariableDeclaration
  4950. | ClassDeclaration
  4951. | ExpressionStatement
  4952. | BlockStatement
  4953. | StaticBlock
  4954. | EmptyStatement
  4955. | DebuggerStatement
  4956. | WithStatement
  4957. | ReturnStatement
  4958. | LabeledStatement
  4959. | BreakStatement
  4960. | ContinueStatement
  4961. | IfStatement
  4962. | SwitchStatement
  4963. | ThrowStatement
  4964. | TryStatement
  4965. | WhileStatement
  4966. | DoWhileStatement
  4967. | ForStatement
  4968. | ForInStatement
  4969. | ForOfStatement
  4970. | ImportDeclaration
  4971. | ExportNamedDeclaration
  4972. | ExportDefaultDeclaration
  4973. | ExportAllDeclaration
  4974. ],
  4975. boolean | void
  4976. >;
  4977. blockPreStatement: SyncBailHook<
  4978. [
  4979. | FunctionDeclaration
  4980. | VariableDeclaration
  4981. | ClassDeclaration
  4982. | ExpressionStatement
  4983. | BlockStatement
  4984. | StaticBlock
  4985. | EmptyStatement
  4986. | DebuggerStatement
  4987. | WithStatement
  4988. | ReturnStatement
  4989. | LabeledStatement
  4990. | BreakStatement
  4991. | ContinueStatement
  4992. | IfStatement
  4993. | SwitchStatement
  4994. | ThrowStatement
  4995. | TryStatement
  4996. | WhileStatement
  4997. | DoWhileStatement
  4998. | ForStatement
  4999. | ForInStatement
  5000. | ForOfStatement
  5001. | ImportDeclaration
  5002. | ExportNamedDeclaration
  5003. | ExportDefaultDeclaration
  5004. | ExportAllDeclaration
  5005. ],
  5006. boolean | void
  5007. >;
  5008. statement: SyncBailHook<
  5009. [
  5010. | FunctionDeclaration
  5011. | VariableDeclaration
  5012. | ClassDeclaration
  5013. | ExpressionStatement
  5014. | BlockStatement
  5015. | StaticBlock
  5016. | EmptyStatement
  5017. | DebuggerStatement
  5018. | WithStatement
  5019. | ReturnStatement
  5020. | LabeledStatement
  5021. | BreakStatement
  5022. | ContinueStatement
  5023. | IfStatement
  5024. | SwitchStatement
  5025. | ThrowStatement
  5026. | TryStatement
  5027. | WhileStatement
  5028. | DoWhileStatement
  5029. | ForStatement
  5030. | ForInStatement
  5031. | ForOfStatement
  5032. | ImportDeclaration
  5033. | ExportNamedDeclaration
  5034. | ExportDefaultDeclaration
  5035. | ExportAllDeclaration
  5036. ],
  5037. boolean | void
  5038. >;
  5039. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  5040. classExtendsExpression: SyncBailHook<
  5041. [Expression, ClassExpression | ClassDeclaration],
  5042. boolean | void
  5043. >;
  5044. classBodyElement: SyncBailHook<
  5045. [
  5046. StaticBlock | MethodDefinition | PropertyDefinition,
  5047. ClassExpression | ClassDeclaration
  5048. ],
  5049. boolean | void
  5050. >;
  5051. classBodyValue: SyncBailHook<
  5052. [
  5053. Expression,
  5054. MethodDefinition | PropertyDefinition,
  5055. ClassExpression | ClassDeclaration
  5056. ],
  5057. boolean | void
  5058. >;
  5059. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  5060. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  5061. importSpecifier: SyncBailHook<
  5062. [ImportDeclaration, ImportSource, string, string],
  5063. boolean | void
  5064. >;
  5065. export: SyncBailHook<
  5066. [ExportNamedDeclaration | ExportAllDeclaration],
  5067. boolean | void
  5068. >;
  5069. exportImport: SyncBailHook<
  5070. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  5071. boolean | void
  5072. >;
  5073. exportDeclaration: SyncBailHook<
  5074. [ExportNamedDeclaration | ExportAllDeclaration, Declaration],
  5075. boolean | void
  5076. >;
  5077. exportExpression: SyncBailHook<
  5078. [ExportDefaultDeclaration, Declaration],
  5079. boolean | void
  5080. >;
  5081. exportSpecifier: SyncBailHook<
  5082. [
  5083. ExportNamedDeclaration | ExportAllDeclaration,
  5084. string,
  5085. string,
  5086. undefined | number
  5087. ],
  5088. boolean | void
  5089. >;
  5090. exportImportSpecifier: SyncBailHook<
  5091. [
  5092. ExportNamedDeclaration | ExportAllDeclaration,
  5093. ImportSource,
  5094. string,
  5095. string,
  5096. undefined | number
  5097. ],
  5098. boolean | void
  5099. >;
  5100. preDeclarator: SyncBailHook<
  5101. [VariableDeclarator, Statement],
  5102. boolean | void
  5103. >;
  5104. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  5105. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5106. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5107. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5108. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5109. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  5110. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5111. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5112. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  5113. assignMemberChain: HookMap<
  5114. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  5115. >;
  5116. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5117. importCall: SyncBailHook<[ImportExpression], boolean | void>;
  5118. topLevelAwait: SyncBailHook<[Expression], boolean | void>;
  5119. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  5120. callMemberChain: HookMap<
  5121. SyncBailHook<
  5122. [CallExpression, string[], boolean[], [number, number][]],
  5123. boolean | void
  5124. >
  5125. >;
  5126. memberChainOfCallMemberChain: HookMap<
  5127. SyncBailHook<
  5128. [Expression, string[], CallExpression, string[]],
  5129. boolean | void
  5130. >
  5131. >;
  5132. callMemberChainOfCallMemberChain: HookMap<
  5133. SyncBailHook<
  5134. [CallExpression, string[], CallExpression, string[]],
  5135. boolean | void
  5136. >
  5137. >;
  5138. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  5139. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  5140. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  5141. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5142. expressionMemberChain: HookMap<
  5143. SyncBailHook<
  5144. [MemberExpression, string[], boolean[], [number, number][]],
  5145. boolean | void
  5146. >
  5147. >;
  5148. unhandledExpressionMemberChain: HookMap<
  5149. SyncBailHook<[MemberExpression, string[]], boolean | void>
  5150. >;
  5151. expressionConditionalOperator: SyncBailHook<
  5152. [ConditionalExpression],
  5153. boolean | void
  5154. >;
  5155. expressionLogicalOperator: SyncBailHook<
  5156. [LogicalExpression],
  5157. boolean | void
  5158. >;
  5159. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  5160. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  5161. }>;
  5162. sourceType: "module" | "auto" | "script";
  5163. scope: ScopeInfo;
  5164. state: ParserState;
  5165. comments: any;
  5166. semicolons: any;
  5167. statementPath: (
  5168. | UnaryExpression
  5169. | ArrayExpression
  5170. | ArrowFunctionExpression
  5171. | AssignmentExpression
  5172. | AwaitExpression
  5173. | BinaryExpression
  5174. | SimpleCallExpression
  5175. | NewExpression
  5176. | ChainExpression
  5177. | ClassExpression
  5178. | ConditionalExpression
  5179. | FunctionExpression
  5180. | Identifier
  5181. | ImportExpression
  5182. | SimpleLiteral
  5183. | RegExpLiteral
  5184. | BigIntLiteral
  5185. | LogicalExpression
  5186. | MemberExpression
  5187. | MetaProperty
  5188. | ObjectExpression
  5189. | SequenceExpression
  5190. | TaggedTemplateExpression
  5191. | TemplateLiteral
  5192. | ThisExpression
  5193. | UpdateExpression
  5194. | YieldExpression
  5195. | FunctionDeclaration
  5196. | VariableDeclaration
  5197. | ClassDeclaration
  5198. | ExpressionStatement
  5199. | BlockStatement
  5200. | StaticBlock
  5201. | EmptyStatement
  5202. | DebuggerStatement
  5203. | WithStatement
  5204. | ReturnStatement
  5205. | LabeledStatement
  5206. | BreakStatement
  5207. | ContinueStatement
  5208. | IfStatement
  5209. | SwitchStatement
  5210. | ThrowStatement
  5211. | TryStatement
  5212. | WhileStatement
  5213. | DoWhileStatement
  5214. | ForStatement
  5215. | ForInStatement
  5216. | ForOfStatement
  5217. | ImportDeclaration
  5218. | ExportNamedDeclaration
  5219. | ExportDefaultDeclaration
  5220. | ExportAllDeclaration
  5221. )[];
  5222. prevStatement?:
  5223. | UnaryExpression
  5224. | ArrayExpression
  5225. | ArrowFunctionExpression
  5226. | AssignmentExpression
  5227. | AwaitExpression
  5228. | BinaryExpression
  5229. | SimpleCallExpression
  5230. | NewExpression
  5231. | ChainExpression
  5232. | ClassExpression
  5233. | ConditionalExpression
  5234. | FunctionExpression
  5235. | Identifier
  5236. | ImportExpression
  5237. | SimpleLiteral
  5238. | RegExpLiteral
  5239. | BigIntLiteral
  5240. | LogicalExpression
  5241. | MemberExpression
  5242. | MetaProperty
  5243. | ObjectExpression
  5244. | SequenceExpression
  5245. | TaggedTemplateExpression
  5246. | TemplateLiteral
  5247. | ThisExpression
  5248. | UpdateExpression
  5249. | YieldExpression
  5250. | FunctionDeclaration
  5251. | VariableDeclaration
  5252. | ClassDeclaration
  5253. | ExpressionStatement
  5254. | BlockStatement
  5255. | StaticBlock
  5256. | EmptyStatement
  5257. | DebuggerStatement
  5258. | WithStatement
  5259. | ReturnStatement
  5260. | LabeledStatement
  5261. | BreakStatement
  5262. | ContinueStatement
  5263. | IfStatement
  5264. | SwitchStatement
  5265. | ThrowStatement
  5266. | TryStatement
  5267. | WhileStatement
  5268. | DoWhileStatement
  5269. | ForStatement
  5270. | ForInStatement
  5271. | ForOfStatement
  5272. | ImportDeclaration
  5273. | ExportNamedDeclaration
  5274. | ExportDefaultDeclaration
  5275. | ExportAllDeclaration;
  5276. destructuringAssignmentProperties: WeakMap<Expression, Set<string>>;
  5277. currentTagData: any;
  5278. destructuringAssignmentPropertiesFor(
  5279. node: Expression
  5280. ): undefined | Set<string>;
  5281. getRenameIdentifier(
  5282. expr: Expression
  5283. ): undefined | string | VariableInfoInterface;
  5284. walkClass(classy: ClassExpression | ClassDeclaration): void;
  5285. /**
  5286. * Pre walking iterates the scope for variable declarations
  5287. */
  5288. preWalkStatements(
  5289. statements: (
  5290. | FunctionDeclaration
  5291. | VariableDeclaration
  5292. | ClassDeclaration
  5293. | ExpressionStatement
  5294. | BlockStatement
  5295. | StaticBlock
  5296. | EmptyStatement
  5297. | DebuggerStatement
  5298. | WithStatement
  5299. | ReturnStatement
  5300. | LabeledStatement
  5301. | BreakStatement
  5302. | ContinueStatement
  5303. | IfStatement
  5304. | SwitchStatement
  5305. | ThrowStatement
  5306. | TryStatement
  5307. | WhileStatement
  5308. | DoWhileStatement
  5309. | ForStatement
  5310. | ForInStatement
  5311. | ForOfStatement
  5312. | ImportDeclaration
  5313. | ExportNamedDeclaration
  5314. | ExportDefaultDeclaration
  5315. | ExportAllDeclaration
  5316. )[]
  5317. ): void;
  5318. /**
  5319. * Block pre walking iterates the scope for block variable declarations
  5320. */
  5321. blockPreWalkStatements(
  5322. statements: (
  5323. | FunctionDeclaration
  5324. | VariableDeclaration
  5325. | ClassDeclaration
  5326. | ExpressionStatement
  5327. | BlockStatement
  5328. | StaticBlock
  5329. | EmptyStatement
  5330. | DebuggerStatement
  5331. | WithStatement
  5332. | ReturnStatement
  5333. | LabeledStatement
  5334. | BreakStatement
  5335. | ContinueStatement
  5336. | IfStatement
  5337. | SwitchStatement
  5338. | ThrowStatement
  5339. | TryStatement
  5340. | WhileStatement
  5341. | DoWhileStatement
  5342. | ForStatement
  5343. | ForInStatement
  5344. | ForOfStatement
  5345. | ImportDeclaration
  5346. | ExportNamedDeclaration
  5347. | ExportDefaultDeclaration
  5348. | ExportAllDeclaration
  5349. )[]
  5350. ): void;
  5351. /**
  5352. * Walking iterates the statements and expressions and processes them
  5353. */
  5354. walkStatements(
  5355. statements: (
  5356. | FunctionDeclaration
  5357. | VariableDeclaration
  5358. | ClassDeclaration
  5359. | ExpressionStatement
  5360. | BlockStatement
  5361. | StaticBlock
  5362. | EmptyStatement
  5363. | DebuggerStatement
  5364. | WithStatement
  5365. | ReturnStatement
  5366. | LabeledStatement
  5367. | BreakStatement
  5368. | ContinueStatement
  5369. | IfStatement
  5370. | SwitchStatement
  5371. | ThrowStatement
  5372. | TryStatement
  5373. | WhileStatement
  5374. | DoWhileStatement
  5375. | ForStatement
  5376. | ForInStatement
  5377. | ForOfStatement
  5378. | ImportDeclaration
  5379. | ExportNamedDeclaration
  5380. | ExportDefaultDeclaration
  5381. | ExportAllDeclaration
  5382. )[]
  5383. ): void;
  5384. /**
  5385. * Walking iterates the statements and expressions and processes them
  5386. */
  5387. preWalkStatement(
  5388. statement:
  5389. | FunctionDeclaration
  5390. | VariableDeclaration
  5391. | ClassDeclaration
  5392. | ExpressionStatement
  5393. | BlockStatement
  5394. | StaticBlock
  5395. | EmptyStatement
  5396. | DebuggerStatement
  5397. | WithStatement
  5398. | ReturnStatement
  5399. | LabeledStatement
  5400. | BreakStatement
  5401. | ContinueStatement
  5402. | IfStatement
  5403. | SwitchStatement
  5404. | ThrowStatement
  5405. | TryStatement
  5406. | WhileStatement
  5407. | DoWhileStatement
  5408. | ForStatement
  5409. | ForInStatement
  5410. | ForOfStatement
  5411. | ImportDeclaration
  5412. | ExportNamedDeclaration
  5413. | ExportDefaultDeclaration
  5414. | ExportAllDeclaration
  5415. ): void;
  5416. blockPreWalkStatement(
  5417. statement:
  5418. | FunctionDeclaration
  5419. | VariableDeclaration
  5420. | ClassDeclaration
  5421. | ExpressionStatement
  5422. | BlockStatement
  5423. | StaticBlock
  5424. | EmptyStatement
  5425. | DebuggerStatement
  5426. | WithStatement
  5427. | ReturnStatement
  5428. | LabeledStatement
  5429. | BreakStatement
  5430. | ContinueStatement
  5431. | IfStatement
  5432. | SwitchStatement
  5433. | ThrowStatement
  5434. | TryStatement
  5435. | WhileStatement
  5436. | DoWhileStatement
  5437. | ForStatement
  5438. | ForInStatement
  5439. | ForOfStatement
  5440. | ImportDeclaration
  5441. | ExportNamedDeclaration
  5442. | ExportDefaultDeclaration
  5443. | ExportAllDeclaration
  5444. ): void;
  5445. walkStatement(
  5446. statement:
  5447. | FunctionDeclaration
  5448. | VariableDeclaration
  5449. | ClassDeclaration
  5450. | ExpressionStatement
  5451. | BlockStatement
  5452. | StaticBlock
  5453. | EmptyStatement
  5454. | DebuggerStatement
  5455. | WithStatement
  5456. | ReturnStatement
  5457. | LabeledStatement
  5458. | BreakStatement
  5459. | ContinueStatement
  5460. | IfStatement
  5461. | SwitchStatement
  5462. | ThrowStatement
  5463. | TryStatement
  5464. | WhileStatement
  5465. | DoWhileStatement
  5466. | ForStatement
  5467. | ForInStatement
  5468. | ForOfStatement
  5469. | ImportDeclaration
  5470. | ExportNamedDeclaration
  5471. | ExportDefaultDeclaration
  5472. | ExportAllDeclaration
  5473. ): void;
  5474. /**
  5475. * Walks a statements that is nested within a parent statement
  5476. * and can potentially be a non-block statement.
  5477. * This enforces the nested statement to never be in ASI position.
  5478. */
  5479. walkNestedStatement(statement: Statement): void;
  5480. preWalkBlockStatement(statement: BlockStatement): void;
  5481. walkBlockStatement(statement: BlockStatement): void;
  5482. walkExpressionStatement(statement: ExpressionStatement): void;
  5483. preWalkIfStatement(statement: IfStatement): void;
  5484. walkIfStatement(statement: IfStatement): void;
  5485. preWalkLabeledStatement(statement: LabeledStatement): void;
  5486. walkLabeledStatement(statement: LabeledStatement): void;
  5487. preWalkWithStatement(statement: WithStatement): void;
  5488. walkWithStatement(statement: WithStatement): void;
  5489. preWalkSwitchStatement(statement: SwitchStatement): void;
  5490. walkSwitchStatement(statement: SwitchStatement): void;
  5491. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  5492. walkReturnStatement(statement: ReturnStatement): void;
  5493. walkThrowStatement(statement: ThrowStatement): void;
  5494. preWalkTryStatement(statement: TryStatement): void;
  5495. walkTryStatement(statement: TryStatement): void;
  5496. preWalkWhileStatement(statement: WhileStatement): void;
  5497. walkWhileStatement(statement: WhileStatement): void;
  5498. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  5499. walkDoWhileStatement(statement: DoWhileStatement): void;
  5500. preWalkForStatement(statement: ForStatement): void;
  5501. walkForStatement(statement: ForStatement): void;
  5502. preWalkForInStatement(statement: ForInStatement): void;
  5503. walkForInStatement(statement: ForInStatement): void;
  5504. preWalkForOfStatement(statement?: any): void;
  5505. walkForOfStatement(statement: ForOfStatement): void;
  5506. preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
  5507. walkFunctionDeclaration(statement: FunctionDeclaration): void;
  5508. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  5509. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  5510. blockPreWalkImportDeclaration(statement?: any): void;
  5511. enterDeclaration(declaration?: any, onIdent?: any): void;
  5512. blockPreWalkExportNamedDeclaration(statement?: any): void;
  5513. walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  5514. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  5515. walkExportDefaultDeclaration(statement?: any): void;
  5516. blockPreWalkExportAllDeclaration(statement?: any): void;
  5517. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  5518. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  5519. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  5520. walkVariableDeclaration(statement: VariableDeclaration): void;
  5521. blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
  5522. walkClassDeclaration(statement: ClassDeclaration): void;
  5523. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  5524. walkSwitchCases(switchCases: SwitchCase[]): void;
  5525. preWalkCatchClause(catchClause: CatchClause): void;
  5526. walkCatchClause(catchClause: CatchClause): void;
  5527. walkPattern(pattern: Pattern): void;
  5528. walkAssignmentPattern(pattern: AssignmentPattern): void;
  5529. walkObjectPattern(pattern?: any): void;
  5530. walkArrayPattern(pattern: ArrayPattern): void;
  5531. walkRestElement(pattern: RestElement): void;
  5532. walkExpressions(
  5533. expressions: (
  5534. | null
  5535. | UnaryExpression
  5536. | ArrayExpression
  5537. | ArrowFunctionExpression
  5538. | AssignmentExpression
  5539. | AwaitExpression
  5540. | BinaryExpression
  5541. | SimpleCallExpression
  5542. | NewExpression
  5543. | ChainExpression
  5544. | ClassExpression
  5545. | ConditionalExpression
  5546. | FunctionExpression
  5547. | Identifier
  5548. | ImportExpression
  5549. | SimpleLiteral
  5550. | RegExpLiteral
  5551. | BigIntLiteral
  5552. | LogicalExpression
  5553. | MemberExpression
  5554. | MetaProperty
  5555. | ObjectExpression
  5556. | SequenceExpression
  5557. | TaggedTemplateExpression
  5558. | TemplateLiteral
  5559. | ThisExpression
  5560. | UpdateExpression
  5561. | YieldExpression
  5562. | SpreadElement
  5563. )[]
  5564. ): void;
  5565. walkExpression(expression?: any): void;
  5566. walkAwaitExpression(expression: AwaitExpression): void;
  5567. walkArrayExpression(expression: ArrayExpression): void;
  5568. walkSpreadElement(expression: SpreadElement): void;
  5569. walkObjectExpression(expression: ObjectExpression): void;
  5570. walkProperty(prop: SpreadElement | Property): void;
  5571. walkFunctionExpression(expression: FunctionExpression): void;
  5572. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  5573. walkSequenceExpression(expression: SequenceExpression): void;
  5574. walkUpdateExpression(expression: UpdateExpression): void;
  5575. walkUnaryExpression(expression: UnaryExpression): void;
  5576. walkLeftRightExpression(
  5577. expression: BinaryExpression | LogicalExpression
  5578. ): void;
  5579. walkBinaryExpression(expression: BinaryExpression): void;
  5580. walkLogicalExpression(expression: LogicalExpression): void;
  5581. walkAssignmentExpression(expression: AssignmentExpression): void;
  5582. walkConditionalExpression(expression: ConditionalExpression): void;
  5583. walkNewExpression(expression: NewExpression): void;
  5584. walkYieldExpression(expression: YieldExpression): void;
  5585. walkTemplateLiteral(expression: TemplateLiteral): void;
  5586. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  5587. walkClassExpression(expression: ClassExpression): void;
  5588. walkChainExpression(expression: ChainExpression): void;
  5589. walkImportExpression(expression: ImportExpression): void;
  5590. walkCallExpression(expression?: any): void;
  5591. walkMemberExpression(expression: MemberExpression): void;
  5592. walkMemberExpressionWithExpressionName(
  5593. expression?: any,
  5594. name?: any,
  5595. rootInfo?: any,
  5596. members?: any,
  5597. onUnhandled?: any
  5598. ): void;
  5599. walkThisExpression(expression: ThisExpression): void;
  5600. walkIdentifier(expression: Identifier): void;
  5601. walkMetaProperty(metaProperty: MetaProperty): void;
  5602. callHooksForExpression(hookMap: any, expr: any, ...args: any[]): any;
  5603. callHooksForExpressionWithFallback<T, R>(
  5604. hookMap: HookMap<SyncBailHook<T, R>>,
  5605. expr: MemberExpression,
  5606. fallback:
  5607. | undefined
  5608. | ((
  5609. arg0: string,
  5610. arg1: string | ScopeInfo | VariableInfo,
  5611. arg2: () => string[]
  5612. ) => any),
  5613. defined: undefined | ((arg0: string) => any),
  5614. ...args: AsArray<T>
  5615. ): undefined | R;
  5616. callHooksForName<T, R>(
  5617. hookMap: HookMap<SyncBailHook<T, R>>,
  5618. name: string,
  5619. ...args: AsArray<T>
  5620. ): undefined | R;
  5621. callHooksForInfo<T, R>(
  5622. hookMap: HookMap<SyncBailHook<T, R>>,
  5623. info: ExportedVariableInfo,
  5624. ...args: AsArray<T>
  5625. ): undefined | R;
  5626. callHooksForInfoWithFallback<T, R>(
  5627. hookMap: HookMap<SyncBailHook<T, R>>,
  5628. info: ExportedVariableInfo,
  5629. fallback: undefined | ((arg0: string) => any),
  5630. defined: undefined | (() => any),
  5631. ...args: AsArray<T>
  5632. ): undefined | R;
  5633. callHooksForNameWithFallback<T, R>(
  5634. hookMap: HookMap<SyncBailHook<T, R>>,
  5635. name: string,
  5636. fallback: undefined | ((arg0: string) => any),
  5637. defined: undefined | (() => any),
  5638. ...args: AsArray<T>
  5639. ): undefined | R;
  5640. inScope(params: any, fn: () => void): void;
  5641. inClassScope(hasThis: boolean, params: any, fn: () => void): void;
  5642. inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
  5643. inBlockScope(fn: () => void): void;
  5644. detectMode(
  5645. statements: (
  5646. | FunctionDeclaration
  5647. | VariableDeclaration
  5648. | ClassDeclaration
  5649. | ExpressionStatement
  5650. | BlockStatement
  5651. | StaticBlock
  5652. | EmptyStatement
  5653. | DebuggerStatement
  5654. | WithStatement
  5655. | ReturnStatement
  5656. | LabeledStatement
  5657. | BreakStatement
  5658. | ContinueStatement
  5659. | IfStatement
  5660. | SwitchStatement
  5661. | ThrowStatement
  5662. | TryStatement
  5663. | WhileStatement
  5664. | DoWhileStatement
  5665. | ForStatement
  5666. | ForInStatement
  5667. | ForOfStatement
  5668. | ImportDeclaration
  5669. | ExportNamedDeclaration
  5670. | ExportDefaultDeclaration
  5671. | ExportAllDeclaration
  5672. | Directive
  5673. )[]
  5674. ): void;
  5675. enterPatterns(patterns?: any, onIdent?: any): void;
  5676. enterPattern(pattern?: any, onIdent?: any): void;
  5677. enterIdentifier(pattern: Identifier, onIdent?: any): void;
  5678. enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
  5679. enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
  5680. enterRestElement(pattern: RestElement, onIdent?: any): void;
  5681. enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
  5682. evaluateExpression(expression?: any): BasicEvaluatedExpression;
  5683. parseString(expression: Expression): string;
  5684. parseCalculatedString(expression?: any): any;
  5685. evaluate(source: string): BasicEvaluatedExpression;
  5686. isPure(
  5687. expr:
  5688. | undefined
  5689. | null
  5690. | UnaryExpression
  5691. | ArrayExpression
  5692. | ArrowFunctionExpression
  5693. | AssignmentExpression
  5694. | AwaitExpression
  5695. | BinaryExpression
  5696. | SimpleCallExpression
  5697. | NewExpression
  5698. | ChainExpression
  5699. | ClassExpression
  5700. | ConditionalExpression
  5701. | FunctionExpression
  5702. | Identifier
  5703. | ImportExpression
  5704. | SimpleLiteral
  5705. | RegExpLiteral
  5706. | BigIntLiteral
  5707. | LogicalExpression
  5708. | MemberExpression
  5709. | MetaProperty
  5710. | ObjectExpression
  5711. | SequenceExpression
  5712. | TaggedTemplateExpression
  5713. | TemplateLiteral
  5714. | ThisExpression
  5715. | UpdateExpression
  5716. | YieldExpression
  5717. | FunctionDeclaration
  5718. | VariableDeclaration
  5719. | ClassDeclaration
  5720. | PrivateIdentifier,
  5721. commentsStartPos: number
  5722. ): boolean;
  5723. getComments(range: [number, number]): any[];
  5724. isAsiPosition(pos: number): boolean;
  5725. unsetAsiPosition(pos: number): void;
  5726. isStatementLevelExpression(expr: Expression): boolean;
  5727. getTagData(name?: any, tag?: any): any;
  5728. tagVariable(name?: any, tag?: any, data?: any): void;
  5729. defineVariable(name: string): void;
  5730. undefineVariable(name: string): void;
  5731. isVariableDefined(name: string): boolean;
  5732. getVariableInfo(name: string): ExportedVariableInfo;
  5733. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  5734. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  5735. parseCommentOptions(range: [number, number]): any;
  5736. extractMemberExpressionChain(expression: MemberExpression): {
  5737. members: string[];
  5738. object:
  5739. | UnaryExpression
  5740. | ArrayExpression
  5741. | ArrowFunctionExpression
  5742. | AssignmentExpression
  5743. | AwaitExpression
  5744. | BinaryExpression
  5745. | SimpleCallExpression
  5746. | NewExpression
  5747. | ChainExpression
  5748. | ClassExpression
  5749. | ConditionalExpression
  5750. | FunctionExpression
  5751. | Identifier
  5752. | ImportExpression
  5753. | SimpleLiteral
  5754. | RegExpLiteral
  5755. | BigIntLiteral
  5756. | LogicalExpression
  5757. | MemberExpression
  5758. | MetaProperty
  5759. | ObjectExpression
  5760. | SequenceExpression
  5761. | TaggedTemplateExpression
  5762. | TemplateLiteral
  5763. | ThisExpression
  5764. | UpdateExpression
  5765. | YieldExpression
  5766. | Super;
  5767. membersOptionals: boolean[];
  5768. memberRanges: [number, number][];
  5769. };
  5770. getFreeInfoFromVariable(
  5771. varName: string
  5772. ): undefined | { name: string; info: string | VariableInfo };
  5773. getMemberExpressionInfo(
  5774. expression: MemberExpression,
  5775. allowedTypes: number
  5776. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  5777. getNameForExpression(
  5778. expression: MemberExpression
  5779. ):
  5780. | undefined
  5781. | {
  5782. name: string;
  5783. rootInfo: ExportedVariableInfo;
  5784. getMembers: () => string[];
  5785. };
  5786. static ALLOWED_MEMBER_TYPES_ALL: 3;
  5787. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  5788. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  5789. }
  5790. /**
  5791. * Parser options for javascript modules.
  5792. */
  5793. declare interface JavascriptParserOptions {
  5794. [index: string]: any;
  5795. /**
  5796. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  5797. */
  5798. amd?: false | { [index: string]: any };
  5799. /**
  5800. * Enable/disable special handling for browserify bundles.
  5801. */
  5802. browserify?: boolean;
  5803. /**
  5804. * Enable/disable parsing of CommonJs syntax.
  5805. */
  5806. commonjs?: boolean;
  5807. /**
  5808. * Enable/disable parsing of magic comments in CommonJs syntax.
  5809. */
  5810. commonjsMagicComments?: boolean;
  5811. /**
  5812. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  5813. */
  5814. createRequire?: string | boolean;
  5815. /**
  5816. * Specifies global fetchPriority for dynamic import.
  5817. */
  5818. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  5819. /**
  5820. * Specifies global mode for dynamic import.
  5821. */
  5822. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  5823. /**
  5824. * Specifies global prefetch for dynamic import.
  5825. */
  5826. dynamicImportPrefetch?: number | boolean;
  5827. /**
  5828. * Specifies global preload for dynamic import.
  5829. */
  5830. dynamicImportPreload?: number | boolean;
  5831. /**
  5832. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  5833. */
  5834. exportsPresence?: false | "auto" | "error" | "warn";
  5835. /**
  5836. * Enable warnings for full dynamic dependencies.
  5837. */
  5838. exprContextCritical?: boolean;
  5839. /**
  5840. * Enable recursive directory lookup for full dynamic dependencies.
  5841. */
  5842. exprContextRecursive?: boolean;
  5843. /**
  5844. * Sets the default regular expression for full dynamic dependencies.
  5845. */
  5846. exprContextRegExp?: boolean | RegExp;
  5847. /**
  5848. * Set the default request for full dynamic dependencies.
  5849. */
  5850. exprContextRequest?: string;
  5851. /**
  5852. * Enable/disable parsing of EcmaScript Modules syntax.
  5853. */
  5854. harmony?: boolean;
  5855. /**
  5856. * Enable/disable parsing of import() syntax.
  5857. */
  5858. import?: boolean;
  5859. /**
  5860. * Specifies the behavior of invalid export names in "import ... from ...".
  5861. */
  5862. importExportsPresence?: false | "auto" | "error" | "warn";
  5863. /**
  5864. * Enable/disable evaluating import.meta.
  5865. */
  5866. importMeta?: boolean;
  5867. /**
  5868. * Enable/disable evaluating import.meta.webpackContext.
  5869. */
  5870. importMetaContext?: boolean;
  5871. /**
  5872. * Include polyfills or mocks for various node stuff.
  5873. */
  5874. node?: false | NodeOptions;
  5875. /**
  5876. * Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
  5877. */
  5878. reexportExportsPresence?: false | "auto" | "error" | "warn";
  5879. /**
  5880. * Enable/disable parsing of require.context syntax.
  5881. */
  5882. requireContext?: boolean;
  5883. /**
  5884. * Enable/disable parsing of require.ensure syntax.
  5885. */
  5886. requireEnsure?: boolean;
  5887. /**
  5888. * Enable/disable parsing of require.include syntax.
  5889. */
  5890. requireInclude?: boolean;
  5891. /**
  5892. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  5893. */
  5894. requireJs?: boolean;
  5895. /**
  5896. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  5897. */
  5898. strictExportPresence?: boolean;
  5899. /**
  5900. * Handle the this context correctly according to the spec for namespace objects.
  5901. */
  5902. strictThisContextOnImports?: boolean;
  5903. /**
  5904. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  5905. */
  5906. system?: boolean;
  5907. /**
  5908. * Enable warnings when using the require function in a not statically analyse-able way.
  5909. */
  5910. unknownContextCritical?: boolean;
  5911. /**
  5912. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  5913. */
  5914. unknownContextRecursive?: boolean;
  5915. /**
  5916. * Sets the regular expression when using the require function in a not statically analyse-able way.
  5917. */
  5918. unknownContextRegExp?: boolean | RegExp;
  5919. /**
  5920. * Sets the request when using the require function in a not statically analyse-able way.
  5921. */
  5922. unknownContextRequest?: string;
  5923. /**
  5924. * Enable/disable parsing of new URL() syntax.
  5925. */
  5926. url?: boolean | "relative";
  5927. /**
  5928. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  5929. */
  5930. worker?: boolean | string[];
  5931. /**
  5932. * Enable warnings for partial dynamic dependencies.
  5933. */
  5934. wrappedContextCritical?: boolean;
  5935. /**
  5936. * Enable recursive directory lookup for partial dynamic dependencies.
  5937. */
  5938. wrappedContextRecursive?: boolean;
  5939. /**
  5940. * Set the inner regular expression for partial dynamic dependencies.
  5941. */
  5942. wrappedContextRegExp?: RegExp;
  5943. }
  5944. type JsonObject = { [index: string]: JsonValue } & {
  5945. [index: string]:
  5946. | undefined
  5947. | null
  5948. | string
  5949. | number
  5950. | boolean
  5951. | JsonObject
  5952. | JsonValue[];
  5953. };
  5954. type JsonValue = null | string | number | boolean | JsonObject | JsonValue[];
  5955. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  5956. constructor(runtimeRequirements: Set<string>);
  5957. static getCompilationHooks(
  5958. compilation: Compilation
  5959. ): JsonpCompilationPluginHooks;
  5960. /**
  5961. * Runtime modules without any dependencies to other runtime modules
  5962. */
  5963. static STAGE_NORMAL: number;
  5964. /**
  5965. * Runtime modules with simple dependencies on other runtime modules
  5966. */
  5967. static STAGE_BASIC: number;
  5968. /**
  5969. * Runtime modules which attach to handlers of other runtime modules
  5970. */
  5971. static STAGE_ATTACH: number;
  5972. /**
  5973. * Runtime modules which trigger actions on bootstrap
  5974. */
  5975. static STAGE_TRIGGER: number;
  5976. }
  5977. declare interface JsonpCompilationPluginHooks {
  5978. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  5979. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  5980. }
  5981. declare class JsonpTemplatePlugin {
  5982. constructor();
  5983. /**
  5984. * Apply the plugin
  5985. */
  5986. apply(compiler: Compiler): void;
  5987. static getCompilationHooks(
  5988. compilation: Compilation
  5989. ): JsonpCompilationPluginHooks;
  5990. }
  5991. declare interface KnownAssetInfo {
  5992. /**
  5993. * true, if the asset can be long term cached forever (contains a hash)
  5994. */
  5995. immutable?: boolean;
  5996. /**
  5997. * whether the asset is minimized
  5998. */
  5999. minimized?: boolean;
  6000. /**
  6001. * the value(s) of the full hash used for this asset
  6002. */
  6003. fullhash?: string | string[];
  6004. /**
  6005. * the value(s) of the chunk hash used for this asset
  6006. */
  6007. chunkhash?: string | string[];
  6008. /**
  6009. * the value(s) of the module hash used for this asset
  6010. */
  6011. modulehash?: string | string[];
  6012. /**
  6013. * the value(s) of the content hash used for this asset
  6014. */
  6015. contenthash?: string | string[];
  6016. /**
  6017. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  6018. */
  6019. sourceFilename?: string;
  6020. /**
  6021. * size in bytes, only set after asset has been emitted
  6022. */
  6023. size?: number;
  6024. /**
  6025. * true, when asset is only used for development and doesn't count towards user-facing assets
  6026. */
  6027. development?: boolean;
  6028. /**
  6029. * true, when asset ships data for updating an existing application (HMR)
  6030. */
  6031. hotModuleReplacement?: boolean;
  6032. /**
  6033. * true, when asset is javascript and an ESM
  6034. */
  6035. javascriptModule?: boolean;
  6036. /**
  6037. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  6038. */
  6039. related?: Record<string, string | string[]>;
  6040. }
  6041. declare interface KnownBuildMeta {
  6042. moduleArgument?: string;
  6043. exportsArgument?: string;
  6044. strict?: boolean;
  6045. moduleConcatenationBailout?: string;
  6046. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  6047. defaultObject?: false | "redirect" | "redirect-warn";
  6048. strictHarmonyModule?: boolean;
  6049. async?: boolean;
  6050. sideEffectFree?: boolean;
  6051. }
  6052. declare interface KnownCreateStatsOptionsContext {
  6053. forToString?: boolean;
  6054. }
  6055. declare interface KnownHooks {
  6056. resolveStep: SyncHook<
  6057. [
  6058. AsyncSeriesBailHook<
  6059. [ResolveRequest, ResolveContext],
  6060. null | ResolveRequest
  6061. >,
  6062. ResolveRequest
  6063. ]
  6064. >;
  6065. noResolve: SyncHook<[ResolveRequest, Error]>;
  6066. resolve: AsyncSeriesBailHook<
  6067. [ResolveRequest, ResolveContext],
  6068. null | ResolveRequest
  6069. >;
  6070. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  6071. }
  6072. declare interface KnownNormalizedStatsOptions {
  6073. context: string;
  6074. requestShortener: RequestShortener;
  6075. chunksSort: string;
  6076. modulesSort: string;
  6077. chunkModulesSort: string;
  6078. nestedModulesSort: string;
  6079. assetsSort: string;
  6080. ids: boolean;
  6081. cachedAssets: boolean;
  6082. groupAssetsByEmitStatus: boolean;
  6083. groupAssetsByPath: boolean;
  6084. groupAssetsByExtension: boolean;
  6085. assetsSpace: number;
  6086. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  6087. excludeModules: ((
  6088. name: string,
  6089. module: StatsModule,
  6090. type: "module" | "chunk" | "root-of-chunk" | "nested"
  6091. ) => boolean)[];
  6092. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  6093. cachedModules: boolean;
  6094. orphanModules: boolean;
  6095. dependentModules: boolean;
  6096. runtimeModules: boolean;
  6097. groupModulesByCacheStatus: boolean;
  6098. groupModulesByLayer: boolean;
  6099. groupModulesByAttributes: boolean;
  6100. groupModulesByPath: boolean;
  6101. groupModulesByExtension: boolean;
  6102. groupModulesByType: boolean;
  6103. entrypoints: boolean | "auto";
  6104. chunkGroups: boolean;
  6105. chunkGroupAuxiliary: boolean;
  6106. chunkGroupChildren: boolean;
  6107. chunkGroupMaxAssets: number;
  6108. modulesSpace: number;
  6109. chunkModulesSpace: number;
  6110. nestedModulesSpace: number;
  6111. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  6112. loggingDebug: ((value: string) => boolean)[];
  6113. loggingTrace: boolean;
  6114. }
  6115. declare interface KnownStatsAsset {
  6116. type: string;
  6117. name: string;
  6118. info: AssetInfo;
  6119. size: number;
  6120. emitted: boolean;
  6121. comparedForEmit: boolean;
  6122. cached: boolean;
  6123. related?: StatsAsset[];
  6124. chunkNames?: (string | number)[];
  6125. chunkIdHints?: (string | number)[];
  6126. chunks?: (string | number)[];
  6127. auxiliaryChunkNames?: (string | number)[];
  6128. auxiliaryChunks?: (string | number)[];
  6129. auxiliaryChunkIdHints?: (string | number)[];
  6130. filteredRelated?: number;
  6131. isOverSizeLimit?: boolean;
  6132. }
  6133. declare interface KnownStatsChunk {
  6134. rendered: boolean;
  6135. initial: boolean;
  6136. entry: boolean;
  6137. recorded: boolean;
  6138. reason?: string;
  6139. size: number;
  6140. sizes?: Record<string, number>;
  6141. names?: string[];
  6142. idHints?: string[];
  6143. runtime?: string[];
  6144. files?: string[];
  6145. auxiliaryFiles?: string[];
  6146. hash: string;
  6147. childrenByOrder?: Record<string, (string | number)[]>;
  6148. id?: string | number;
  6149. siblings?: (string | number)[];
  6150. parents?: (string | number)[];
  6151. children?: (string | number)[];
  6152. modules?: StatsModule[];
  6153. filteredModules?: number;
  6154. origins?: StatsChunkOrigin[];
  6155. }
  6156. declare interface KnownStatsChunkGroup {
  6157. name?: string;
  6158. chunks?: (string | number)[];
  6159. assets?: { name: string; size?: number }[];
  6160. filteredAssets?: number;
  6161. assetsSize?: number;
  6162. auxiliaryAssets?: { name: string; size?: number }[];
  6163. filteredAuxiliaryAssets?: number;
  6164. auxiliaryAssetsSize?: number;
  6165. children?: { [index: string]: StatsChunkGroup[] };
  6166. childAssets?: { [index: string]: string[] };
  6167. isOverSizeLimit?: boolean;
  6168. }
  6169. declare interface KnownStatsChunkOrigin {
  6170. module?: string;
  6171. moduleIdentifier?: string;
  6172. moduleName?: string;
  6173. loc?: string;
  6174. request?: string;
  6175. moduleId?: string | number;
  6176. }
  6177. declare interface KnownStatsCompilation {
  6178. env?: any;
  6179. name?: string;
  6180. hash?: string;
  6181. version?: string;
  6182. time?: number;
  6183. builtAt?: number;
  6184. needAdditionalPass?: boolean;
  6185. publicPath?: string;
  6186. outputPath?: string;
  6187. assetsByChunkName?: Record<string, string[]>;
  6188. assets?: StatsAsset[];
  6189. filteredAssets?: number;
  6190. chunks?: StatsChunk[];
  6191. modules?: StatsModule[];
  6192. filteredModules?: number;
  6193. entrypoints?: Record<string, StatsChunkGroup>;
  6194. namedChunkGroups?: Record<string, StatsChunkGroup>;
  6195. errors?: StatsError[];
  6196. errorsCount?: number;
  6197. warnings?: StatsError[];
  6198. warningsCount?: number;
  6199. children?: StatsCompilation[];
  6200. logging?: Record<string, StatsLogging>;
  6201. }
  6202. declare interface KnownStatsError {
  6203. message: string;
  6204. chunkName?: string;
  6205. chunkEntry?: boolean;
  6206. chunkInitial?: boolean;
  6207. file?: string;
  6208. moduleIdentifier?: string;
  6209. moduleName?: string;
  6210. loc?: string;
  6211. chunkId?: string | number;
  6212. moduleId?: string | number;
  6213. moduleTrace?: StatsModuleTraceItem[];
  6214. details?: any;
  6215. stack?: string;
  6216. }
  6217. declare interface KnownStatsFactoryContext {
  6218. type: string;
  6219. makePathsRelative?: (arg0: string) => string;
  6220. compilation?: Compilation;
  6221. rootModules?: Set<Module>;
  6222. compilationFileToChunks?: Map<string, Chunk[]>;
  6223. compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
  6224. runtime?: RuntimeSpec;
  6225. cachedGetErrors?: (arg0: Compilation) => WebpackError[];
  6226. cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
  6227. }
  6228. declare interface KnownStatsLogging {
  6229. entries: StatsLoggingEntry[];
  6230. filteredEntries: number;
  6231. debug: boolean;
  6232. }
  6233. declare interface KnownStatsLoggingEntry {
  6234. type: string;
  6235. message: string;
  6236. trace?: string[];
  6237. children?: StatsLoggingEntry[];
  6238. args?: any[];
  6239. time?: number;
  6240. }
  6241. declare interface KnownStatsModule {
  6242. type?: string;
  6243. moduleType?: string;
  6244. layer?: string;
  6245. identifier?: string;
  6246. name?: string;
  6247. nameForCondition?: string;
  6248. index?: number;
  6249. preOrderIndex?: number;
  6250. index2?: number;
  6251. postOrderIndex?: number;
  6252. size?: number;
  6253. sizes?: { [index: string]: number };
  6254. cacheable?: boolean;
  6255. built?: boolean;
  6256. codeGenerated?: boolean;
  6257. buildTimeExecuted?: boolean;
  6258. cached?: boolean;
  6259. optional?: boolean;
  6260. orphan?: boolean;
  6261. id?: string | number;
  6262. issuerId?: string | number;
  6263. chunks?: (string | number)[];
  6264. assets?: (string | number)[];
  6265. dependent?: boolean;
  6266. issuer?: string;
  6267. issuerName?: string;
  6268. issuerPath?: StatsModuleIssuer[];
  6269. failed?: boolean;
  6270. errors?: number;
  6271. warnings?: number;
  6272. profile?: StatsProfile;
  6273. reasons?: StatsModuleReason[];
  6274. usedExports?: boolean | string[];
  6275. providedExports?: string[];
  6276. optimizationBailout?: string[];
  6277. depth?: number;
  6278. modules?: StatsModule[];
  6279. filteredModules?: number;
  6280. source?: string | Buffer;
  6281. }
  6282. declare interface KnownStatsModuleIssuer {
  6283. identifier?: string;
  6284. name?: string;
  6285. id?: string | number;
  6286. profile?: StatsProfile;
  6287. }
  6288. declare interface KnownStatsModuleReason {
  6289. moduleIdentifier?: string;
  6290. module?: string;
  6291. moduleName?: string;
  6292. resolvedModuleIdentifier?: string;
  6293. resolvedModule?: string;
  6294. type?: string;
  6295. active: boolean;
  6296. explanation?: string;
  6297. userRequest?: string;
  6298. loc?: string;
  6299. moduleId?: string | number;
  6300. resolvedModuleId?: string | number;
  6301. }
  6302. declare interface KnownStatsModuleTraceDependency {
  6303. loc?: string;
  6304. }
  6305. declare interface KnownStatsModuleTraceItem {
  6306. originIdentifier?: string;
  6307. originName?: string;
  6308. moduleIdentifier?: string;
  6309. moduleName?: string;
  6310. dependencies?: StatsModuleTraceDependency[];
  6311. originId?: string | number;
  6312. moduleId?: string | number;
  6313. }
  6314. declare interface KnownStatsPrinterContext {
  6315. type?: string;
  6316. compilation?: StatsCompilation;
  6317. chunkGroup?: StatsChunkGroup;
  6318. asset?: StatsAsset;
  6319. module?: StatsModule;
  6320. chunk?: StatsChunk;
  6321. moduleReason?: StatsModuleReason;
  6322. bold?: (str: string) => string;
  6323. yellow?: (str: string) => string;
  6324. red?: (str: string) => string;
  6325. green?: (str: string) => string;
  6326. magenta?: (str: string) => string;
  6327. cyan?: (str: string) => string;
  6328. formatFilename?: (file: string, oversize?: boolean) => string;
  6329. formatModuleId?: (id: string) => string;
  6330. formatChunkId?: (
  6331. id: string,
  6332. direction?: "parent" | "child" | "sibling"
  6333. ) => string;
  6334. formatSize?: (size: number) => string;
  6335. formatDateTime?: (dateTime: number) => string;
  6336. formatFlag?: (flag: string) => string;
  6337. formatTime?: (time: number, boldQuantity?: boolean) => string;
  6338. chunkGroupKind?: string;
  6339. }
  6340. declare interface KnownStatsProfile {
  6341. total: number;
  6342. resolving: number;
  6343. restoring: number;
  6344. building: number;
  6345. integration: number;
  6346. storing: number;
  6347. additionalResolving: number;
  6348. additionalIntegration: number;
  6349. factory: number;
  6350. dependencies: number;
  6351. }
  6352. /**
  6353. * Options for the default backend.
  6354. */
  6355. declare interface LazyCompilationDefaultBackendOptions {
  6356. /**
  6357. * A custom client.
  6358. */
  6359. client?: string;
  6360. /**
  6361. * Specifies where to listen to from the server.
  6362. */
  6363. listen?: number | ListenOptions | ((server: typeof Server) => void);
  6364. /**
  6365. * Specifies the protocol the client should use to connect to the server.
  6366. */
  6367. protocol?: "http" | "https";
  6368. /**
  6369. * Specifies how to create the server handling the EventSource requests.
  6370. */
  6371. server?:
  6372. | ServerOptionsImport<typeof IncomingMessage>
  6373. | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
  6374. | (() => typeof Server);
  6375. }
  6376. /**
  6377. * Options for compiling entrypoints and import()s only when they are accessed.
  6378. */
  6379. declare interface LazyCompilationOptions {
  6380. /**
  6381. * Specifies the backend that should be used for handling client keep alive.
  6382. */
  6383. backend?:
  6384. | ((
  6385. compiler: Compiler,
  6386. callback: (err?: Error, api?: BackendApi) => void
  6387. ) => void)
  6388. | ((compiler: Compiler) => Promise<BackendApi>)
  6389. | LazyCompilationDefaultBackendOptions;
  6390. /**
  6391. * Enable/disable lazy compilation for entries.
  6392. */
  6393. entries?: boolean;
  6394. /**
  6395. * Enable/disable lazy compilation for import() modules.
  6396. */
  6397. imports?: boolean;
  6398. /**
  6399. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  6400. */
  6401. test?: string | RegExp | ((module: Module) => boolean);
  6402. }
  6403. declare class LazySet<T> {
  6404. constructor(iterable?: Iterable<T>);
  6405. get size(): number;
  6406. add(item: T): LazySet<T>;
  6407. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  6408. clear(): void;
  6409. delete(value: T): boolean;
  6410. entries(): IterableIterator<[T, T]>;
  6411. forEach(
  6412. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  6413. thisArg?: any
  6414. ): void;
  6415. has(item: T): boolean;
  6416. keys(): IterableIterator<T>;
  6417. values(): IterableIterator<T>;
  6418. serialize(__0: ObjectSerializerContext): void;
  6419. [Symbol.iterator](): IterableIterator<T>;
  6420. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  6421. }
  6422. declare interface LibIdentOptions {
  6423. /**
  6424. * absolute context path to which lib ident is relative to
  6425. */
  6426. context: string;
  6427. /**
  6428. * object for caching
  6429. */
  6430. associatedObjectForCache?: Object;
  6431. }
  6432. declare class LibManifestPlugin {
  6433. constructor(options: LibManifestPluginOptions);
  6434. options: LibManifestPluginOptions;
  6435. /**
  6436. * Apply the plugin
  6437. */
  6438. apply(compiler: Compiler): void;
  6439. }
  6440. declare interface LibManifestPluginOptions {
  6441. /**
  6442. * Context of requests in the manifest file (defaults to the webpack context).
  6443. */
  6444. context?: string;
  6445. /**
  6446. * If true, only entry points will be exposed (default: true).
  6447. */
  6448. entryOnly?: boolean;
  6449. /**
  6450. * If true, manifest json file (output) will be formatted.
  6451. */
  6452. format?: boolean;
  6453. /**
  6454. * Name of the exposed dll function (external name, use value of 'output.library').
  6455. */
  6456. name?: string;
  6457. /**
  6458. * Absolute path to the manifest json file (output).
  6459. */
  6460. path: string;
  6461. /**
  6462. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  6463. */
  6464. type?: string;
  6465. }
  6466. declare interface LibraryContext<T> {
  6467. compilation: Compilation;
  6468. chunkGraph: ChunkGraph;
  6469. options: T;
  6470. }
  6471. /**
  6472. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  6473. */
  6474. declare interface LibraryCustomUmdCommentObject {
  6475. /**
  6476. * Set comment for `amd` section in UMD.
  6477. */
  6478. amd?: string;
  6479. /**
  6480. * Set comment for `commonjs` (exports) section in UMD.
  6481. */
  6482. commonjs?: string;
  6483. /**
  6484. * Set comment for `commonjs2` (module.exports) section in UMD.
  6485. */
  6486. commonjs2?: string;
  6487. /**
  6488. * Set comment for `root` (global variable) section in UMD.
  6489. */
  6490. root?: string;
  6491. }
  6492. /**
  6493. * Description object for all UMD variants of the library name.
  6494. */
  6495. declare interface LibraryCustomUmdObject {
  6496. /**
  6497. * Name of the exposed AMD library in the UMD.
  6498. */
  6499. amd?: string;
  6500. /**
  6501. * Name of the exposed commonjs export in the UMD.
  6502. */
  6503. commonjs?: string;
  6504. /**
  6505. * Name of the property exposed globally by a UMD library.
  6506. */
  6507. root?: string | string[];
  6508. }
  6509. type LibraryExport = string | string[];
  6510. type LibraryName = string | string[] | LibraryCustomUmdObject;
  6511. /**
  6512. * Options for library.
  6513. */
  6514. declare interface LibraryOptions {
  6515. /**
  6516. * Add a container for define/require functions in the AMD module.
  6517. */
  6518. amdContainer?: string;
  6519. /**
  6520. * Add a comment in the UMD wrapper.
  6521. */
  6522. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  6523. /**
  6524. * Specify which export should be exposed as library.
  6525. */
  6526. export?: string | string[];
  6527. /**
  6528. * The name of the library (some types allow unnamed libraries too).
  6529. */
  6530. name?: string | string[] | LibraryCustomUmdObject;
  6531. /**
  6532. * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
  6533. */
  6534. type: string;
  6535. /**
  6536. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  6537. */
  6538. umdNamedDefine?: boolean;
  6539. }
  6540. declare class LibraryTemplatePlugin {
  6541. constructor(
  6542. name: LibraryName,
  6543. target: string,
  6544. umdNamedDefine: boolean,
  6545. auxiliaryComment: AuxiliaryComment,
  6546. exportProperty: LibraryExport
  6547. );
  6548. library: {
  6549. type: string;
  6550. name: LibraryName;
  6551. umdNamedDefine: boolean;
  6552. auxiliaryComment: AuxiliaryComment;
  6553. export: LibraryExport;
  6554. };
  6555. /**
  6556. * Apply the plugin
  6557. */
  6558. apply(compiler: Compiler): void;
  6559. }
  6560. declare class LimitChunkCountPlugin {
  6561. constructor(options?: LimitChunkCountPluginOptions);
  6562. options?: LimitChunkCountPluginOptions;
  6563. apply(compiler: Compiler): void;
  6564. }
  6565. declare interface LimitChunkCountPluginOptions {
  6566. /**
  6567. * Constant overhead for a chunk.
  6568. */
  6569. chunkOverhead?: number;
  6570. /**
  6571. * Multiplicator for initial chunks.
  6572. */
  6573. entryChunkMultiplicator?: number;
  6574. /**
  6575. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  6576. */
  6577. maxChunks: number;
  6578. }
  6579. declare interface LoadScriptCompilationHooks {
  6580. createScript: SyncWaterfallHook<[string, Chunk]>;
  6581. }
  6582. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  6583. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  6584. static getCompilationHooks(
  6585. compilation: Compilation
  6586. ): LoadScriptCompilationHooks;
  6587. /**
  6588. * Runtime modules without any dependencies to other runtime modules
  6589. */
  6590. static STAGE_NORMAL: number;
  6591. /**
  6592. * Runtime modules with simple dependencies on other runtime modules
  6593. */
  6594. static STAGE_BASIC: number;
  6595. /**
  6596. * Runtime modules which attach to handlers of other runtime modules
  6597. */
  6598. static STAGE_ATTACH: number;
  6599. /**
  6600. * Runtime modules which trigger actions on bootstrap
  6601. */
  6602. static STAGE_TRIGGER: number;
  6603. }
  6604. /**
  6605. * Custom values available in the loader context.
  6606. */
  6607. declare interface Loader {
  6608. [index: string]: any;
  6609. }
  6610. type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
  6611. LoaderRunnerLoaderContext<OptionsType> &
  6612. LoaderPluginLoaderContext &
  6613. HotModuleReplacementPluginLoaderContext;
  6614. type LoaderDefinition<
  6615. OptionsType = {},
  6616. ContextAdditions = {}
  6617. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  6618. raw?: false;
  6619. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  6620. };
  6621. declare interface LoaderDefinitionFunction<
  6622. OptionsType = {},
  6623. ContextAdditions = {}
  6624. > {
  6625. (
  6626. this: NormalModuleLoaderContext<OptionsType> &
  6627. LoaderRunnerLoaderContext<OptionsType> &
  6628. LoaderPluginLoaderContext &
  6629. HotModuleReplacementPluginLoaderContext &
  6630. ContextAdditions,
  6631. content: string,
  6632. sourceMap?: string | SourceMap,
  6633. additionalData?: AdditionalData
  6634. ): string | void | Buffer | Promise<string | Buffer>;
  6635. }
  6636. declare interface LoaderItem {
  6637. loader: string;
  6638. options: any;
  6639. ident: null | string;
  6640. type: null | string;
  6641. }
  6642. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  6643. default?:
  6644. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  6645. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  6646. raw?: false;
  6647. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  6648. }
  6649. declare class LoaderOptionsPlugin {
  6650. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  6651. options: LoaderOptionsPluginOptions & MatchObject;
  6652. /**
  6653. * Apply the plugin
  6654. */
  6655. apply(compiler: Compiler): void;
  6656. }
  6657. declare interface LoaderOptionsPluginOptions {
  6658. [index: string]: any;
  6659. /**
  6660. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  6661. */
  6662. debug?: boolean;
  6663. /**
  6664. * Where loaders can be switched to minimize mode.
  6665. */
  6666. minimize?: boolean;
  6667. /**
  6668. * A configuration object that can be used to configure older loaders.
  6669. */
  6670. options?: {
  6671. [index: string]: any;
  6672. /**
  6673. * The context that can be used to configure older loaders.
  6674. */
  6675. context?: string;
  6676. };
  6677. }
  6678. /**
  6679. * These properties are added by the LoaderPlugin
  6680. */
  6681. declare interface LoaderPluginLoaderContext {
  6682. /**
  6683. * Resolves the given request to a module, applies all configured loaders and calls
  6684. * back with the generated source, the sourceMap and the module instance (usually an
  6685. * instance of NormalModule). Use this function if you need to know the source code
  6686. * of another module to generate the result.
  6687. */
  6688. loadModule(
  6689. request: string,
  6690. callback: (
  6691. err: null | Error,
  6692. source: string,
  6693. sourceMap: any,
  6694. module: NormalModule
  6695. ) => void
  6696. ): void;
  6697. importModule(
  6698. request: string,
  6699. options: ImportModuleOptions,
  6700. callback: (err?: null | Error, exports?: any) => any
  6701. ): void;
  6702. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  6703. }
  6704. /**
  6705. * The properties are added by https://github.com/webpack/loader-runner
  6706. */
  6707. declare interface LoaderRunnerLoaderContext<OptionsType> {
  6708. /**
  6709. * Add a directory as dependency of the loader result.
  6710. */
  6711. addContextDependency(context: string): void;
  6712. /**
  6713. * Adds a file as dependency of the loader result in order to make them watchable.
  6714. * For example, html-loader uses this technique as it finds src and src-set attributes.
  6715. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  6716. */
  6717. addDependency(file: string): void;
  6718. addMissingDependency(context: string): void;
  6719. /**
  6720. * Make this loader async.
  6721. */
  6722. async(): (
  6723. err?: null | Error,
  6724. content?: string | Buffer,
  6725. sourceMap?: string | SourceMap,
  6726. additionalData?: AdditionalData
  6727. ) => void;
  6728. /**
  6729. * Make this loader result cacheable. By default it's cacheable.
  6730. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  6731. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  6732. * Most loaders are deterministic and cacheable.
  6733. */
  6734. cacheable(flag?: boolean): void;
  6735. callback: (
  6736. err?: null | Error,
  6737. content?: string | Buffer,
  6738. sourceMap?: string | SourceMap,
  6739. additionalData?: AdditionalData
  6740. ) => void;
  6741. /**
  6742. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  6743. */
  6744. clearDependencies(): void;
  6745. /**
  6746. * The directory of the module. Can be used as context for resolving other stuff.
  6747. * eg '/workspaces/ts-loader/examples/vanilla/src'
  6748. */
  6749. context: string;
  6750. readonly currentRequest: string;
  6751. readonly data: any;
  6752. /**
  6753. * alias of addDependency
  6754. * Adds a file as dependency of the loader result in order to make them watchable.
  6755. * For example, html-loader uses this technique as it finds src and src-set attributes.
  6756. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  6757. */
  6758. dependency(file: string): void;
  6759. getContextDependencies(): string[];
  6760. getDependencies(): string[];
  6761. getMissingDependencies(): string[];
  6762. /**
  6763. * The index in the loaders array of the current loader.
  6764. * In the example: in loader1: 0, in loader2: 1
  6765. */
  6766. loaderIndex: number;
  6767. readonly previousRequest: string;
  6768. readonly query: string | OptionsType;
  6769. readonly remainingRequest: string;
  6770. readonly request: string;
  6771. /**
  6772. * An array of all the loaders. It is writeable in the pitch phase.
  6773. * loaders = [{request: string, path: string, query: string, module: function}]
  6774. * In the example:
  6775. * [
  6776. * { request: "/abc/loader1.js?xyz",
  6777. * path: "/abc/loader1.js",
  6778. * query: "?xyz",
  6779. * module: [Function]
  6780. * },
  6781. * { request: "/abc/node_modules/loader2/index.js",
  6782. * path: "/abc/node_modules/loader2/index.js",
  6783. * query: "",
  6784. * module: [Function]
  6785. * }
  6786. * ]
  6787. */
  6788. loaders: {
  6789. request: string;
  6790. path: string;
  6791. query: string;
  6792. fragment: string;
  6793. options?: string | object;
  6794. ident: string;
  6795. normal?: Function;
  6796. pitch?: Function;
  6797. raw?: boolean;
  6798. data?: object;
  6799. pitchExecuted: boolean;
  6800. normalExecuted: boolean;
  6801. type?: "module" | "commonjs";
  6802. }[];
  6803. /**
  6804. * The resource path.
  6805. * In the example: "/abc/resource.js"
  6806. */
  6807. resourcePath: string;
  6808. /**
  6809. * The resource query string.
  6810. * Example: "?query"
  6811. */
  6812. resourceQuery: string;
  6813. /**
  6814. * The resource fragment.
  6815. * Example: "#frag"
  6816. */
  6817. resourceFragment: string;
  6818. /**
  6819. * The resource inclusive query and fragment.
  6820. * Example: "/abc/resource.js?query#frag"
  6821. */
  6822. resource: string;
  6823. /**
  6824. * Target of compilation.
  6825. * Example: "web"
  6826. */
  6827. target: string;
  6828. /**
  6829. * Tell what kind of ES-features may be used in the generated runtime-code.
  6830. * Example: { arrowFunction: true }
  6831. */
  6832. environment: Environment;
  6833. }
  6834. declare class LoaderTargetPlugin {
  6835. constructor(target: string);
  6836. target: string;
  6837. /**
  6838. * Apply the plugin
  6839. */
  6840. apply(compiler: Compiler): void;
  6841. }
  6842. declare interface LogEntry {
  6843. type: string;
  6844. args: any[];
  6845. time: number;
  6846. trace?: string[];
  6847. }
  6848. declare const MEASURE_END_OPERATION: unique symbol;
  6849. declare const MEASURE_START_OPERATION: unique symbol;
  6850. declare interface MainRenderContext {
  6851. /**
  6852. * the chunk
  6853. */
  6854. chunk: Chunk;
  6855. /**
  6856. * the dependency templates
  6857. */
  6858. dependencyTemplates: DependencyTemplates;
  6859. /**
  6860. * the runtime template
  6861. */
  6862. runtimeTemplate: RuntimeTemplate;
  6863. /**
  6864. * the module graph
  6865. */
  6866. moduleGraph: ModuleGraph;
  6867. /**
  6868. * the chunk graph
  6869. */
  6870. chunkGraph: ChunkGraph;
  6871. /**
  6872. * results of code generation
  6873. */
  6874. codeGenerationResults: CodeGenerationResults;
  6875. /**
  6876. * hash to be used for render call
  6877. */
  6878. hash: string;
  6879. /**
  6880. * rendering in strict context
  6881. */
  6882. strictMode: boolean;
  6883. }
  6884. declare abstract class MainTemplate {
  6885. hooks: Readonly<{
  6886. renderManifest: { tap: (options?: any, fn?: any) => void };
  6887. modules: { tap: () => never };
  6888. moduleObj: { tap: () => never };
  6889. require: { tap: (options?: any, fn?: any) => void };
  6890. beforeStartup: { tap: () => never };
  6891. startup: { tap: () => never };
  6892. afterStartup: { tap: () => never };
  6893. render: { tap: (options?: any, fn?: any) => void };
  6894. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  6895. assetPath: {
  6896. tap: (options?: any, fn?: any) => void;
  6897. call: (filename?: any, options?: any) => string;
  6898. };
  6899. hash: { tap: (options?: any, fn?: any) => void };
  6900. hashForChunk: { tap: (options?: any, fn?: any) => void };
  6901. globalHashPaths: { tap: () => void };
  6902. globalHash: { tap: () => void };
  6903. hotBootstrap: { tap: () => never };
  6904. bootstrap: SyncWaterfallHook<
  6905. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  6906. >;
  6907. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  6908. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  6909. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  6910. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  6911. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  6912. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  6913. }>;
  6914. renderCurrentHashCode: (hash: string, length?: number) => string;
  6915. getPublicPath: (options: object) => string;
  6916. getAssetPath: (path?: any, options?: any) => string;
  6917. getAssetPathWithInfo: (
  6918. path?: any,
  6919. options?: any
  6920. ) => { path: string; info: AssetInfo };
  6921. get requireFn(): "__webpack_require__";
  6922. get outputOptions(): Output;
  6923. }
  6924. declare interface MapOptions {
  6925. columns?: boolean;
  6926. module?: boolean;
  6927. }
  6928. declare interface MatchObject {
  6929. test?: string | RegExp | (string | RegExp)[];
  6930. include?: string | RegExp | (string | RegExp)[];
  6931. exclude?: string | RegExp | (string | RegExp)[];
  6932. }
  6933. type Matcher = string | RegExp | (string | RegExp)[];
  6934. /**
  6935. * Options object for in-memory caching.
  6936. */
  6937. declare interface MemoryCacheOptions {
  6938. /**
  6939. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  6940. */
  6941. cacheUnaffected?: boolean;
  6942. /**
  6943. * Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever).
  6944. */
  6945. maxGenerations?: number;
  6946. /**
  6947. * In memory caching.
  6948. */
  6949. type: "memory";
  6950. }
  6951. declare class MemoryCachePlugin {
  6952. constructor();
  6953. /**
  6954. * Apply the plugin
  6955. */
  6956. apply(compiler: Compiler): void;
  6957. }
  6958. declare class MinChunkSizePlugin {
  6959. constructor(options: MinChunkSizePluginOptions);
  6960. options: MinChunkSizePluginOptions;
  6961. /**
  6962. * Apply the plugin
  6963. */
  6964. apply(compiler: Compiler): void;
  6965. }
  6966. declare interface MinChunkSizePluginOptions {
  6967. /**
  6968. * Constant overhead for a chunk.
  6969. */
  6970. chunkOverhead?: number;
  6971. /**
  6972. * Multiplicator for initial chunks.
  6973. */
  6974. entryChunkMultiplicator?: number;
  6975. /**
  6976. * Minimum number of characters.
  6977. */
  6978. minChunkSize: number;
  6979. }
  6980. declare class Module extends DependenciesBlock {
  6981. constructor(type: string, context?: null | string, layer?: null | string);
  6982. type: string;
  6983. context: null | string;
  6984. layer: null | string;
  6985. needId: boolean;
  6986. debugId: number;
  6987. resolveOptions?: ResolveOptionsWebpackOptions;
  6988. factoryMeta?: FactoryMeta;
  6989. useSourceMap: boolean;
  6990. useSimpleSourceMap: boolean;
  6991. buildMeta?: BuildMeta;
  6992. buildInfo?: BuildInfo;
  6993. presentationalDependencies?: Dependency[];
  6994. codeGenerationDependencies?: Dependency[];
  6995. id: string | number;
  6996. get hash(): string;
  6997. get renderedHash(): string;
  6998. profile: null | ModuleProfile;
  6999. index: null | number;
  7000. index2: null | number;
  7001. depth: null | number;
  7002. issuer: null | Module;
  7003. get usedExports(): null | boolean | SortableSet<string>;
  7004. get optimizationBailout(): (
  7005. | string
  7006. | ((requestShortener: RequestShortener) => string)
  7007. )[];
  7008. get optional(): boolean;
  7009. addChunk(chunk: Chunk): boolean;
  7010. removeChunk(chunk: Chunk): void;
  7011. isInChunk(chunk: Chunk): boolean;
  7012. isEntryModule(): boolean;
  7013. getChunks(): Chunk[];
  7014. getNumberOfChunks(): number;
  7015. get chunksIterable(): Iterable<Chunk>;
  7016. isProvided(exportName: string): null | boolean;
  7017. get exportsArgument(): string;
  7018. get moduleArgument(): string;
  7019. getExportsType(
  7020. moduleGraph: ModuleGraph,
  7021. strict?: boolean
  7022. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  7023. addPresentationalDependency(presentationalDependency: Dependency): void;
  7024. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  7025. addWarning(warning: WebpackError): void;
  7026. getWarnings(): undefined | Iterable<WebpackError>;
  7027. getNumberOfWarnings(): number;
  7028. addError(error: WebpackError): void;
  7029. getErrors(): undefined | Iterable<WebpackError>;
  7030. getNumberOfErrors(): number;
  7031. /**
  7032. * removes all warnings and errors
  7033. */
  7034. clearWarningsAndErrors(): void;
  7035. isOptional(moduleGraph: ModuleGraph): boolean;
  7036. isAccessibleInChunk(
  7037. chunkGraph: ChunkGraph,
  7038. chunk: Chunk,
  7039. ignoreChunk?: Chunk
  7040. ): boolean;
  7041. isAccessibleInChunkGroup(
  7042. chunkGraph: ChunkGraph,
  7043. chunkGroup: ChunkGroup,
  7044. ignoreChunk?: Chunk
  7045. ): boolean;
  7046. hasReasonForChunk(
  7047. chunk: Chunk,
  7048. moduleGraph: ModuleGraph,
  7049. chunkGraph: ChunkGraph
  7050. ): boolean;
  7051. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  7052. needBuild(
  7053. context: NeedBuildContext,
  7054. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  7055. ): void;
  7056. needRebuild(
  7057. fileTimestamps: Map<string, null | number>,
  7058. contextTimestamps: Map<string, null | number>
  7059. ): boolean;
  7060. invalidateBuild(): void;
  7061. identifier(): string;
  7062. readableIdentifier(requestShortener: RequestShortener): string;
  7063. build(
  7064. options: WebpackOptionsNormalized,
  7065. compilation: Compilation,
  7066. resolver: ResolverWithOptions,
  7067. fs: InputFileSystem,
  7068. callback: (arg0?: WebpackError) => void
  7069. ): void;
  7070. getSourceTypes(): Set<string>;
  7071. source(
  7072. dependencyTemplates: DependencyTemplates,
  7073. runtimeTemplate: RuntimeTemplate,
  7074. type?: string
  7075. ): Source;
  7076. size(type?: string): number;
  7077. libIdent(options: LibIdentOptions): null | string;
  7078. nameForCondition(): null | string;
  7079. getConcatenationBailoutReason(
  7080. context: ConcatenationBailoutReasonContext
  7081. ): undefined | string;
  7082. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  7083. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  7084. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  7085. hasChunkCondition(): boolean;
  7086. /**
  7087. * Assuming this module is in the cache. Update the (cached) module with
  7088. * the fresh module from the factory. Usually updates internal references
  7089. * and properties.
  7090. */
  7091. updateCacheModule(module: Module): void;
  7092. /**
  7093. * Module should be unsafe cached. Get data that's needed for that.
  7094. * This data will be passed to restoreFromUnsafeCache later.
  7095. */
  7096. getUnsafeCacheData(): object;
  7097. /**
  7098. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  7099. */
  7100. cleanupForCache(): void;
  7101. originalSource(): null | Source;
  7102. addCacheDependencies(
  7103. fileDependencies: LazySet<string>,
  7104. contextDependencies: LazySet<string>,
  7105. missingDependencies: LazySet<string>,
  7106. buildDependencies: LazySet<string>
  7107. ): void;
  7108. get hasEqualsChunks(): any;
  7109. get isUsed(): any;
  7110. get errors(): any;
  7111. get warnings(): any;
  7112. used: any;
  7113. }
  7114. declare class ModuleConcatenationPlugin {
  7115. constructor(options?: any);
  7116. options: any;
  7117. /**
  7118. * Apply the plugin
  7119. */
  7120. apply(compiler: Compiler): void;
  7121. }
  7122. declare class ModuleDependency extends Dependency {
  7123. constructor(request: string);
  7124. request: string;
  7125. userRequest: string;
  7126. range: any;
  7127. assertions?: Record<string, any>;
  7128. static Template: typeof DependencyTemplate;
  7129. static NO_EXPORTS_REFERENCED: string[][];
  7130. static EXPORTS_OBJECT_REFERENCED: string[][];
  7131. static TRANSITIVE: typeof TRANSITIVE;
  7132. }
  7133. declare abstract class ModuleFactory {
  7134. create(
  7135. data: ModuleFactoryCreateData,
  7136. callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
  7137. ): void;
  7138. }
  7139. declare interface ModuleFactoryCreateData {
  7140. contextInfo: ModuleFactoryCreateDataContextInfo;
  7141. resolveOptions?: ResolveOptionsWebpackOptions;
  7142. context: string;
  7143. dependencies: Dependency[];
  7144. }
  7145. declare interface ModuleFactoryCreateDataContextInfo {
  7146. issuer: string;
  7147. issuerLayer?: null | string;
  7148. compiler: string;
  7149. }
  7150. declare interface ModuleFactoryResult {
  7151. /**
  7152. * the created module or unset if no module was created
  7153. */
  7154. module?: Module;
  7155. fileDependencies?: Set<string>;
  7156. contextDependencies?: Set<string>;
  7157. missingDependencies?: Set<string>;
  7158. /**
  7159. * allow to use the unsafe cache
  7160. */
  7161. cacheable?: boolean;
  7162. }
  7163. declare class ModuleFederationPlugin {
  7164. constructor(options: ModuleFederationPluginOptions);
  7165. /**
  7166. * Apply the plugin
  7167. */
  7168. apply(compiler: Compiler): void;
  7169. }
  7170. declare interface ModuleFederationPluginOptions {
  7171. /**
  7172. * Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
  7173. */
  7174. exposes?: (string | ExposesObject)[] | ExposesObject;
  7175. /**
  7176. * The filename of the container as relative path inside the `output.path` directory.
  7177. */
  7178. filename?: string;
  7179. /**
  7180. * Options for library.
  7181. */
  7182. library?: LibraryOptions;
  7183. /**
  7184. * The name of the container.
  7185. */
  7186. name?: string;
  7187. /**
  7188. * The external type of the remote containers.
  7189. */
  7190. remoteType?:
  7191. | "import"
  7192. | "var"
  7193. | "module"
  7194. | "assign"
  7195. | "this"
  7196. | "window"
  7197. | "self"
  7198. | "global"
  7199. | "commonjs"
  7200. | "commonjs2"
  7201. | "commonjs-module"
  7202. | "commonjs-static"
  7203. | "amd"
  7204. | "amd-require"
  7205. | "umd"
  7206. | "umd2"
  7207. | "jsonp"
  7208. | "system"
  7209. | "promise"
  7210. | "script"
  7211. | "node-commonjs";
  7212. /**
  7213. * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
  7214. */
  7215. remotes?: (string | RemotesObject)[] | RemotesObject;
  7216. /**
  7217. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  7218. */
  7219. runtime?: string | false;
  7220. /**
  7221. * Share scope name used for all shared modules (defaults to 'default').
  7222. */
  7223. shareScope?: string;
  7224. /**
  7225. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  7226. */
  7227. shared?: (string | SharedObject)[] | SharedObject;
  7228. }
  7229. type ModuleFilterItemTypes =
  7230. | string
  7231. | RegExp
  7232. | ((
  7233. name: string,
  7234. module: StatsModule,
  7235. type: "module" | "chunk" | "root-of-chunk" | "nested"
  7236. ) => boolean);
  7237. declare class ModuleGraph {
  7238. constructor();
  7239. setParents(
  7240. dependency: Dependency,
  7241. block: DependenciesBlock,
  7242. module: Module,
  7243. indexInBlock?: number
  7244. ): void;
  7245. getParentModule(dependency: Dependency): Module;
  7246. getParentBlock(dependency: Dependency): DependenciesBlock;
  7247. getParentBlockIndex(dependency: Dependency): number;
  7248. setResolvedModule(
  7249. originModule: Module,
  7250. dependency: Dependency,
  7251. module: Module
  7252. ): void;
  7253. updateModule(dependency: Dependency, module: Module): void;
  7254. removeConnection(dependency: Dependency): void;
  7255. addExplanation(dependency: Dependency, explanation: string): void;
  7256. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  7257. removeModuleAttributes(module: Module): void;
  7258. removeAllModuleAttributes(): void;
  7259. moveModuleConnections(
  7260. oldModule: Module,
  7261. newModule: Module,
  7262. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7263. ): void;
  7264. copyOutgoingModuleConnections(
  7265. oldModule: Module,
  7266. newModule: Module,
  7267. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7268. ): void;
  7269. addExtraReason(module: Module, explanation: string): void;
  7270. getResolvedModule(dependency: Dependency): null | Module;
  7271. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  7272. getModule(dependency: Dependency): null | Module;
  7273. getOrigin(dependency: Dependency): null | Module;
  7274. getResolvedOrigin(dependency: Dependency): null | Module;
  7275. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7276. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7277. getIncomingConnectionsByOriginModule(
  7278. module: Module
  7279. ): Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  7280. getOutgoingConnectionsByModule(
  7281. module: Module
  7282. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  7283. getProfile(module: Module): null | ModuleProfile;
  7284. setProfile(module: Module, profile: null | ModuleProfile): void;
  7285. getIssuer(module: Module): null | Module;
  7286. setIssuer(module: Module, issuer: null | Module): void;
  7287. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  7288. getOptimizationBailout(
  7289. module: Module
  7290. ): (string | ((requestShortener: RequestShortener) => string))[];
  7291. getProvidedExports(module: Module): null | true | string[];
  7292. isExportProvided(
  7293. module: Module,
  7294. exportName: string | string[]
  7295. ): null | boolean;
  7296. getExportsInfo(module: Module): ExportsInfo;
  7297. getExportInfo(module: Module, exportName: string): ExportInfo;
  7298. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  7299. getUsedExports(
  7300. module: Module,
  7301. runtime: RuntimeSpec
  7302. ): null | boolean | SortableSet<string>;
  7303. getPreOrderIndex(module: Module): null | number;
  7304. getPostOrderIndex(module: Module): null | number;
  7305. setPreOrderIndex(module: Module, index: number): void;
  7306. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  7307. setPostOrderIndex(module: Module, index: number): void;
  7308. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  7309. getDepth(module: Module): null | number;
  7310. setDepth(module: Module, depth: number): void;
  7311. setDepthIfLower(module: Module, depth: number): boolean;
  7312. isAsync(module: Module): boolean;
  7313. setAsync(module: Module): void;
  7314. getMeta(thing?: any): Object;
  7315. getMetaIfExisting(thing?: any): undefined | Object;
  7316. freeze(cacheStage?: string): void;
  7317. unfreeze(): void;
  7318. cached<T extends any[], V>(
  7319. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  7320. ...args: T
  7321. ): V;
  7322. setModuleMemCaches(
  7323. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  7324. ): void;
  7325. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  7326. static getModuleGraphForModule(
  7327. module: Module,
  7328. deprecateMessage: string,
  7329. deprecationCode: string
  7330. ): ModuleGraph;
  7331. static setModuleGraphForModule(
  7332. module: Module,
  7333. moduleGraph: ModuleGraph
  7334. ): void;
  7335. static clearModuleGraphForModule(module: Module): void;
  7336. static ModuleGraphConnection: typeof ModuleGraphConnection;
  7337. }
  7338. declare class ModuleGraphConnection {
  7339. constructor(
  7340. originModule: null | Module,
  7341. dependency: null | Dependency,
  7342. module: Module,
  7343. explanation?: string,
  7344. weak?: boolean,
  7345. condition?:
  7346. | false
  7347. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  7348. );
  7349. originModule: null | Module;
  7350. resolvedOriginModule: null | Module;
  7351. dependency: null | Dependency;
  7352. resolvedModule: Module;
  7353. module: Module;
  7354. weak: boolean;
  7355. conditional: boolean;
  7356. condition?: (
  7357. arg0: ModuleGraphConnection,
  7358. arg1: RuntimeSpec
  7359. ) => ConnectionState;
  7360. explanations?: Set<string>;
  7361. clone(): ModuleGraphConnection;
  7362. addCondition(
  7363. condition: (
  7364. arg0: ModuleGraphConnection,
  7365. arg1: RuntimeSpec
  7366. ) => ConnectionState
  7367. ): void;
  7368. addExplanation(explanation: string): void;
  7369. get explanation(): string;
  7370. active: void;
  7371. isActive(runtime: RuntimeSpec): boolean;
  7372. isTargetActive(runtime: RuntimeSpec): boolean;
  7373. getActiveState(runtime: RuntimeSpec): ConnectionState;
  7374. setActive(value: boolean): void;
  7375. static addConnectionStates: (
  7376. a: ConnectionState,
  7377. b: ConnectionState
  7378. ) => ConnectionState;
  7379. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  7380. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  7381. }
  7382. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  7383. /**
  7384. * Options affecting the normal modules (`NormalModuleFactory`).
  7385. */
  7386. declare interface ModuleOptions {
  7387. /**
  7388. * An array of rules applied by default for modules.
  7389. */
  7390. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7391. /**
  7392. * Enable warnings for full dynamic dependencies.
  7393. */
  7394. exprContextCritical?: boolean;
  7395. /**
  7396. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  7397. */
  7398. exprContextRecursive?: boolean;
  7399. /**
  7400. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  7401. */
  7402. exprContextRegExp?: boolean | RegExp;
  7403. /**
  7404. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  7405. */
  7406. exprContextRequest?: string;
  7407. /**
  7408. * Specify options for each generator.
  7409. */
  7410. generator?: GeneratorOptionsByModuleType;
  7411. /**
  7412. * Don't parse files matching. It's matched against the full resolved request.
  7413. */
  7414. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7415. /**
  7416. * Specify options for each parser.
  7417. */
  7418. parser?: ParserOptionsByModuleType;
  7419. /**
  7420. * An array of rules applied for modules.
  7421. */
  7422. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7423. /**
  7424. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  7425. */
  7426. strictExportPresence?: boolean;
  7427. /**
  7428. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  7429. */
  7430. strictThisContextOnImports?: boolean;
  7431. /**
  7432. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  7433. */
  7434. unknownContextCritical?: boolean;
  7435. /**
  7436. * Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.
  7437. */
  7438. unknownContextRecursive?: boolean;
  7439. /**
  7440. * Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.
  7441. */
  7442. unknownContextRegExp?: boolean | RegExp;
  7443. /**
  7444. * Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.
  7445. */
  7446. unknownContextRequest?: string;
  7447. /**
  7448. * Cache the resolving of module requests.
  7449. */
  7450. unsafeCache?: boolean | Function;
  7451. /**
  7452. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  7453. */
  7454. wrappedContextCritical?: boolean;
  7455. /**
  7456. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  7457. */
  7458. wrappedContextRecursive?: boolean;
  7459. /**
  7460. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  7461. */
  7462. wrappedContextRegExp?: RegExp;
  7463. }
  7464. /**
  7465. * Options affecting the normal modules (`NormalModuleFactory`).
  7466. */
  7467. declare interface ModuleOptionsNormalized {
  7468. /**
  7469. * An array of rules applied by default for modules.
  7470. */
  7471. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7472. /**
  7473. * Specify options for each generator.
  7474. */
  7475. generator: GeneratorOptionsByModuleType;
  7476. /**
  7477. * Don't parse files matching. It's matched against the full resolved request.
  7478. */
  7479. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7480. /**
  7481. * Specify options for each parser.
  7482. */
  7483. parser: ParserOptionsByModuleType;
  7484. /**
  7485. * An array of rules applied for modules.
  7486. */
  7487. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7488. /**
  7489. * Cache the resolving of module requests.
  7490. */
  7491. unsafeCache?: boolean | Function;
  7492. }
  7493. declare interface ModulePathData {
  7494. id: string | number;
  7495. hash: string;
  7496. hashWithLength?: (arg0: number) => string;
  7497. }
  7498. declare abstract class ModuleProfile {
  7499. startTime: number;
  7500. factoryStartTime: number;
  7501. factoryEndTime: number;
  7502. factory: number;
  7503. factoryParallelismFactor: number;
  7504. restoringStartTime: number;
  7505. restoringEndTime: number;
  7506. restoring: number;
  7507. restoringParallelismFactor: number;
  7508. integrationStartTime: number;
  7509. integrationEndTime: number;
  7510. integration: number;
  7511. integrationParallelismFactor: number;
  7512. buildingStartTime: number;
  7513. buildingEndTime: number;
  7514. building: number;
  7515. buildingParallelismFactor: number;
  7516. storingStartTime: number;
  7517. storingEndTime: number;
  7518. storing: number;
  7519. storingParallelismFactor: number;
  7520. additionalFactoryTimes?: { start: number; end: number }[];
  7521. additionalFactories: number;
  7522. additionalFactoriesParallelismFactor: number;
  7523. additionalIntegration: number;
  7524. markFactoryStart(): void;
  7525. markFactoryEnd(): void;
  7526. markRestoringStart(): void;
  7527. markRestoringEnd(): void;
  7528. markIntegrationStart(): void;
  7529. markIntegrationEnd(): void;
  7530. markBuildingStart(): void;
  7531. markBuildingEnd(): void;
  7532. markStoringStart(): void;
  7533. markStoringEnd(): void;
  7534. /**
  7535. * Merge this profile into another one
  7536. */
  7537. mergeInto(realProfile: ModuleProfile): void;
  7538. }
  7539. declare interface ModuleReferenceOptions {
  7540. /**
  7541. * the properties/exports of the module
  7542. */
  7543. ids: string[];
  7544. /**
  7545. * true, when this referenced export is called
  7546. */
  7547. call: boolean;
  7548. /**
  7549. * true, when this referenced export is directly imported (not via property access)
  7550. */
  7551. directImport: boolean;
  7552. /**
  7553. * if the position is ASI safe or unknown
  7554. */
  7555. asiSafe?: boolean;
  7556. }
  7557. declare interface ModuleSettings {
  7558. /**
  7559. * Specifies the layer in which the module should be placed in.
  7560. */
  7561. layer?: string;
  7562. /**
  7563. * Module type to use for the module.
  7564. */
  7565. type?: string;
  7566. /**
  7567. * Options for the resolver.
  7568. */
  7569. resolve?: ResolveOptionsWebpackOptions;
  7570. /**
  7571. * Options for parsing.
  7572. */
  7573. parser?: { [index: string]: any };
  7574. /**
  7575. * The options for the module generator.
  7576. */
  7577. generator?: { [index: string]: any };
  7578. /**
  7579. * Flags a module as with or without side effects.
  7580. */
  7581. sideEffects?: boolean;
  7582. }
  7583. declare abstract class ModuleTemplate {
  7584. type: string;
  7585. hooks: Readonly<{
  7586. content: { tap: (options?: any, fn?: any) => void };
  7587. module: { tap: (options?: any, fn?: any) => void };
  7588. render: { tap: (options?: any, fn?: any) => void };
  7589. package: { tap: (options?: any, fn?: any) => void };
  7590. hash: { tap: (options?: any, fn?: any) => void };
  7591. }>;
  7592. get runtimeTemplate(): any;
  7593. }
  7594. declare class MultiCompiler {
  7595. constructor(
  7596. compilers: Compiler[] | Record<string, Compiler>,
  7597. options: MultiCompilerOptions
  7598. );
  7599. hooks: Readonly<{
  7600. done: SyncHook<[MultiStats]>;
  7601. invalid: MultiHook<SyncHook<[null | string, number]>>;
  7602. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  7603. watchClose: SyncHook<[]>;
  7604. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  7605. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  7606. }>;
  7607. compilers: Compiler[];
  7608. dependencies: WeakMap<Compiler, string[]>;
  7609. running: boolean;
  7610. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  7611. get outputPath(): string;
  7612. inputFileSystem: InputFileSystem;
  7613. outputFileSystem: OutputFileSystem;
  7614. watchFileSystem: WatchFileSystem;
  7615. intermediateFileSystem: IntermediateFileSystem;
  7616. getInfrastructureLogger(name?: any): WebpackLogger;
  7617. setDependencies(compiler: Compiler, dependencies: string[]): void;
  7618. validateDependencies(callback: CallbackFunction<MultiStats>): boolean;
  7619. runWithDependencies(
  7620. compilers: Compiler[],
  7621. fn: (compiler: Compiler, callback: CallbackFunction<MultiStats>) => any,
  7622. callback: CallbackFunction<MultiStats>
  7623. ): void;
  7624. watch(
  7625. watchOptions: WatchOptions | WatchOptions[],
  7626. handler: CallbackFunction<MultiStats>
  7627. ): MultiWatching;
  7628. run(callback: CallbackFunction<MultiStats>): void;
  7629. purgeInputFileSystem(): void;
  7630. close(callback: CallbackFunction<void>): void;
  7631. }
  7632. declare interface MultiCompilerOptions {
  7633. /**
  7634. * how many Compilers are allows to run at the same time in parallel
  7635. */
  7636. parallelism?: number;
  7637. }
  7638. declare abstract class MultiStats {
  7639. stats: Stats[];
  7640. get hash(): string;
  7641. hasErrors(): boolean;
  7642. hasWarnings(): boolean;
  7643. toJson(options?: any): StatsCompilation;
  7644. toString(options?: any): string;
  7645. }
  7646. declare abstract class MultiWatching {
  7647. watchings: Watching[];
  7648. compiler: MultiCompiler;
  7649. invalidate(callback?: CallbackFunction<void>): void;
  7650. suspend(): void;
  7651. resume(): void;
  7652. close(callback: CallbackFunction<void>): void;
  7653. }
  7654. declare class NamedChunkIdsPlugin {
  7655. constructor(options?: NamedChunkIdsPluginOptions);
  7656. delimiter: string;
  7657. context?: string;
  7658. /**
  7659. * Apply the plugin
  7660. */
  7661. apply(compiler: Compiler): void;
  7662. }
  7663. declare interface NamedChunkIdsPluginOptions {
  7664. /**
  7665. * context
  7666. */
  7667. context?: string;
  7668. /**
  7669. * delimiter
  7670. */
  7671. delimiter?: string;
  7672. }
  7673. declare class NamedModuleIdsPlugin {
  7674. constructor(options?: NamedModuleIdsPluginOptions);
  7675. options: NamedModuleIdsPluginOptions;
  7676. /**
  7677. * Apply the plugin
  7678. */
  7679. apply(compiler: Compiler): void;
  7680. }
  7681. declare interface NamedModuleIdsPluginOptions {
  7682. /**
  7683. * context
  7684. */
  7685. context?: string;
  7686. }
  7687. declare class NaturalModuleIdsPlugin {
  7688. constructor();
  7689. /**
  7690. * Apply the plugin
  7691. */
  7692. apply(compiler: Compiler): void;
  7693. }
  7694. declare interface NeedBuildContext {
  7695. compilation: Compilation;
  7696. fileSystemInfo: FileSystemInfo;
  7697. valueCacheVersions: Map<string, string | Set<string>>;
  7698. }
  7699. declare class NoEmitOnErrorsPlugin {
  7700. constructor();
  7701. /**
  7702. * Apply the plugin
  7703. */
  7704. apply(compiler: Compiler): void;
  7705. }
  7706. type Node = false | NodeOptions;
  7707. declare class NodeEnvironmentPlugin {
  7708. constructor(options: {
  7709. /**
  7710. * infrastructure logging options
  7711. */
  7712. infrastructureLogging: InfrastructureLogging;
  7713. });
  7714. options: {
  7715. /**
  7716. * infrastructure logging options
  7717. */
  7718. infrastructureLogging: InfrastructureLogging;
  7719. };
  7720. /**
  7721. * Apply the plugin
  7722. */
  7723. apply(compiler: Compiler): void;
  7724. }
  7725. /**
  7726. * Options object for node compatibility features.
  7727. */
  7728. declare interface NodeOptions {
  7729. /**
  7730. * Include a polyfill for the '__dirname' variable.
  7731. */
  7732. __dirname?: boolean | "warn-mock" | "mock" | "eval-only";
  7733. /**
  7734. * Include a polyfill for the '__filename' variable.
  7735. */
  7736. __filename?: boolean | "warn-mock" | "mock" | "eval-only";
  7737. /**
  7738. * Include a polyfill for the 'global' variable.
  7739. */
  7740. global?: boolean | "warn";
  7741. }
  7742. declare class NodeSourcePlugin {
  7743. constructor();
  7744. /**
  7745. * Apply the plugin
  7746. */
  7747. apply(compiler: Compiler): void;
  7748. }
  7749. declare class NodeTargetPlugin {
  7750. constructor();
  7751. /**
  7752. * Apply the plugin
  7753. */
  7754. apply(compiler: Compiler): void;
  7755. }
  7756. declare class NodeTemplatePlugin {
  7757. constructor(options?: NodeTemplatePluginOptions);
  7758. /**
  7759. * Apply the plugin
  7760. */
  7761. apply(compiler: Compiler): void;
  7762. }
  7763. declare interface NodeTemplatePluginOptions {
  7764. /**
  7765. * enable async chunk loading
  7766. */
  7767. asyncChunkLoading?: boolean;
  7768. }
  7769. declare class NormalModule extends Module {
  7770. constructor(__0: NormalModuleCreateData);
  7771. request: string;
  7772. userRequest: string;
  7773. rawRequest: string;
  7774. binary: boolean;
  7775. parser: Parser;
  7776. parserOptions?: Record<string, any>;
  7777. generator: Generator;
  7778. generatorOptions?: Record<string, any>;
  7779. resource: string;
  7780. resourceResolveData?: Record<string, any>;
  7781. matchResource?: string;
  7782. loaders: LoaderItem[];
  7783. error?: null | WebpackError;
  7784. restoreFromUnsafeCache(
  7785. unsafeCacheData?: any,
  7786. normalModuleFactory?: any
  7787. ): void;
  7788. createSourceForAsset(
  7789. context: string,
  7790. name: string,
  7791. content: string,
  7792. sourceMap?: any,
  7793. associatedObjectForCache?: Object
  7794. ): Source;
  7795. getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
  7796. createSource(
  7797. context: string,
  7798. content: string | Buffer,
  7799. sourceMap?: any,
  7800. associatedObjectForCache?: Object
  7801. ): Source;
  7802. markModuleAsErrored(error: WebpackError): void;
  7803. applyNoParseRule(rule?: any, content?: any): any;
  7804. shouldPreventParsing(noParseRule?: any, request?: any): any;
  7805. static getCompilationHooks(
  7806. compilation: Compilation
  7807. ): NormalModuleCompilationHooks;
  7808. static deserialize(context?: any): NormalModule;
  7809. }
  7810. declare interface NormalModuleCompilationHooks {
  7811. loader: SyncHook<[object, NormalModule]>;
  7812. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
  7813. beforeParse: SyncHook<[NormalModule]>;
  7814. beforeSnapshot: SyncHook<[NormalModule]>;
  7815. readResourceForScheme: HookMap<
  7816. AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
  7817. >;
  7818. readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
  7819. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  7820. }
  7821. declare interface NormalModuleCreateData {
  7822. /**
  7823. * an optional layer in which the module is
  7824. */
  7825. layer?: string;
  7826. /**
  7827. * module type. When deserializing, this is set to an empty string "".
  7828. */
  7829. type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
  7830. /**
  7831. * request string
  7832. */
  7833. request: string;
  7834. /**
  7835. * request intended by user (without loaders from config)
  7836. */
  7837. userRequest: string;
  7838. /**
  7839. * request without resolving
  7840. */
  7841. rawRequest: string;
  7842. /**
  7843. * list of loaders
  7844. */
  7845. loaders: LoaderItem[];
  7846. /**
  7847. * path + query of the real resource
  7848. */
  7849. resource: string;
  7850. /**
  7851. * resource resolve data
  7852. */
  7853. resourceResolveData?: Record<string, any>;
  7854. /**
  7855. * context directory for resolving
  7856. */
  7857. context: string;
  7858. /**
  7859. * path + query of the matched resource (virtual)
  7860. */
  7861. matchResource?: string;
  7862. /**
  7863. * the parser used
  7864. */
  7865. parser: Parser;
  7866. /**
  7867. * the options of the parser used
  7868. */
  7869. parserOptions?: Record<string, any>;
  7870. /**
  7871. * the generator used
  7872. */
  7873. generator: Generator;
  7874. /**
  7875. * the options of the generator used
  7876. */
  7877. generatorOptions?: Record<string, any>;
  7878. /**
  7879. * options used for resolving requests from this module
  7880. */
  7881. resolveOptions?: ResolveOptionsWebpackOptions;
  7882. }
  7883. declare abstract class NormalModuleFactory extends ModuleFactory {
  7884. hooks: Readonly<{
  7885. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  7886. resolveForScheme: HookMap<
  7887. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7888. >;
  7889. resolveInScheme: HookMap<
  7890. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  7891. >;
  7892. factorize: AsyncSeriesBailHook<[ResolveData], Module>;
  7893. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7894. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  7895. createModule: AsyncSeriesBailHook<
  7896. [
  7897. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7898. ResolveData
  7899. ],
  7900. void | Module
  7901. >;
  7902. module: SyncWaterfallHook<
  7903. [
  7904. Module,
  7905. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  7906. ResolveData
  7907. ],
  7908. Module
  7909. >;
  7910. createParser: HookMap<SyncBailHook<any, any>>;
  7911. parser: HookMap<SyncHook<any>>;
  7912. createGenerator: HookMap<SyncBailHook<any, any>>;
  7913. generator: HookMap<SyncHook<any>>;
  7914. createModuleClass: HookMap<SyncBailHook<any, any>>;
  7915. }>;
  7916. resolverFactory: ResolverFactory;
  7917. ruleSet: RuleSet;
  7918. context: string;
  7919. fs: InputFileSystem;
  7920. parserCache: Map<string, WeakMap<Object, any>>;
  7921. generatorCache: Map<string, WeakMap<Object, Generator>>;
  7922. cleanupForCache(): void;
  7923. resolveResource(
  7924. contextInfo?: any,
  7925. context?: any,
  7926. unresolvedResource?: any,
  7927. resolver?: any,
  7928. resolveContext?: any,
  7929. callback?: any
  7930. ): void;
  7931. resolveRequestArray(
  7932. contextInfo?: any,
  7933. context?: any,
  7934. array?: any,
  7935. resolver?: any,
  7936. resolveContext?: any,
  7937. callback?: any
  7938. ): any;
  7939. getParser(type?: any, parserOptions?: object): any;
  7940. createParser(type: string, parserOptions?: { [index: string]: any }): Parser;
  7941. getGenerator(type?: any, generatorOptions?: object): undefined | Generator;
  7942. createGenerator(type?: any, generatorOptions?: object): any;
  7943. getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
  7944. }
  7945. /**
  7946. * These properties are added by the NormalModule
  7947. */
  7948. declare interface NormalModuleLoaderContext<OptionsType> {
  7949. version: number;
  7950. getOptions(): OptionsType;
  7951. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  7952. emitWarning(warning: Error): void;
  7953. emitError(error: Error): void;
  7954. getLogger(name?: string): WebpackLogger;
  7955. resolve(
  7956. context: string,
  7957. request: string,
  7958. callback: (
  7959. err: null | ErrorWithDetail,
  7960. res?: string | false,
  7961. req?: ResolveRequest
  7962. ) => void
  7963. ): any;
  7964. getResolve(options?: ResolveOptionsWithDependencyType): {
  7965. (
  7966. context: string,
  7967. request: string,
  7968. callback: (
  7969. err: null | ErrorWithDetail,
  7970. res?: string | false,
  7971. req?: ResolveRequest
  7972. ) => void
  7973. ): void;
  7974. (context: string, request: string): Promise<string>;
  7975. };
  7976. emitFile(
  7977. name: string,
  7978. content: string | Buffer,
  7979. sourceMap?: string,
  7980. assetInfo?: AssetInfo
  7981. ): void;
  7982. addBuildDependency(dep: string): void;
  7983. utils: {
  7984. absolutify: (context: string, request: string) => string;
  7985. contextify: (context: string, request: string) => string;
  7986. createHash: (algorithm?: string) => Hash;
  7987. };
  7988. rootContext: string;
  7989. fs: InputFileSystem;
  7990. sourceMap?: boolean;
  7991. mode: "none" | "development" | "production";
  7992. webpack?: boolean;
  7993. _module?: NormalModule;
  7994. _compilation?: Compilation;
  7995. _compiler?: Compiler;
  7996. }
  7997. declare class NormalModuleReplacementPlugin {
  7998. /**
  7999. * Create an instance of the plugin
  8000. */
  8001. constructor(
  8002. resourceRegExp: RegExp,
  8003. newResource: string | ((arg0: ResolveData) => void)
  8004. );
  8005. resourceRegExp: RegExp;
  8006. newResource: string | ((arg0: ResolveData) => void);
  8007. /**
  8008. * Apply the plugin
  8009. */
  8010. apply(compiler: Compiler): void;
  8011. }
  8012. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  8013. Omit<
  8014. StatsOptions,
  8015. | "context"
  8016. | "chunkGroups"
  8017. | "requestShortener"
  8018. | "chunksSort"
  8019. | "modulesSort"
  8020. | "chunkModulesSort"
  8021. | "nestedModulesSort"
  8022. | "assetsSort"
  8023. | "ids"
  8024. | "cachedAssets"
  8025. | "groupAssetsByEmitStatus"
  8026. | "groupAssetsByPath"
  8027. | "groupAssetsByExtension"
  8028. | "assetsSpace"
  8029. | "excludeAssets"
  8030. | "excludeModules"
  8031. | "warningsFilter"
  8032. | "cachedModules"
  8033. | "orphanModules"
  8034. | "dependentModules"
  8035. | "runtimeModules"
  8036. | "groupModulesByCacheStatus"
  8037. | "groupModulesByLayer"
  8038. | "groupModulesByAttributes"
  8039. | "groupModulesByPath"
  8040. | "groupModulesByExtension"
  8041. | "groupModulesByType"
  8042. | "entrypoints"
  8043. | "chunkGroupAuxiliary"
  8044. | "chunkGroupChildren"
  8045. | "chunkGroupMaxAssets"
  8046. | "modulesSpace"
  8047. | "chunkModulesSpace"
  8048. | "nestedModulesSpace"
  8049. | "logging"
  8050. | "loggingDebug"
  8051. | "loggingTrace"
  8052. | "_env"
  8053. > &
  8054. Record<string, any>;
  8055. declare class NullDependency extends Dependency {
  8056. constructor();
  8057. static Template: typeof NullDependencyTemplate;
  8058. static NO_EXPORTS_REFERENCED: string[][];
  8059. static EXPORTS_OBJECT_REFERENCED: string[][];
  8060. static TRANSITIVE: typeof TRANSITIVE;
  8061. }
  8062. declare class NullDependencyTemplate extends DependencyTemplate {
  8063. constructor();
  8064. }
  8065. declare interface ObjectDeserializerContext {
  8066. read: () => any;
  8067. setCircularReference: (arg0?: any) => void;
  8068. }
  8069. declare interface ObjectSerializer {
  8070. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  8071. deserialize: (arg0: ObjectDeserializerContext) => any;
  8072. }
  8073. declare interface ObjectSerializerContext {
  8074. write: (arg0?: any) => void;
  8075. setCircularReference: (arg0?: any) => void;
  8076. }
  8077. declare class OccurrenceChunkIdsPlugin {
  8078. constructor(options?: OccurrenceChunkIdsPluginOptions);
  8079. options: OccurrenceChunkIdsPluginOptions;
  8080. /**
  8081. * Apply the plugin
  8082. */
  8083. apply(compiler: Compiler): void;
  8084. }
  8085. declare interface OccurrenceChunkIdsPluginOptions {
  8086. /**
  8087. * Prioritise initial size over total size.
  8088. */
  8089. prioritiseInitial?: boolean;
  8090. }
  8091. declare class OccurrenceModuleIdsPlugin {
  8092. constructor(options?: OccurrenceModuleIdsPluginOptions);
  8093. options: OccurrenceModuleIdsPluginOptions;
  8094. /**
  8095. * Apply the plugin
  8096. */
  8097. apply(compiler: Compiler): void;
  8098. }
  8099. declare interface OccurrenceModuleIdsPluginOptions {
  8100. /**
  8101. * Prioritise initial size over total size.
  8102. */
  8103. prioritiseInitial?: boolean;
  8104. }
  8105. /**
  8106. * Enables/Disables integrated optimizations.
  8107. */
  8108. declare interface Optimization {
  8109. /**
  8110. * Check for incompatible wasm types when importing/exporting from/to ESM.
  8111. */
  8112. checkWasmTypes?: boolean;
  8113. /**
  8114. * Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).
  8115. */
  8116. chunkIds?:
  8117. | false
  8118. | "natural"
  8119. | "named"
  8120. | "deterministic"
  8121. | "size"
  8122. | "total-size";
  8123. /**
  8124. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  8125. */
  8126. concatenateModules?: boolean;
  8127. /**
  8128. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  8129. */
  8130. emitOnErrors?: boolean;
  8131. /**
  8132. * Also flag chunks as loaded which contain a subset of the modules.
  8133. */
  8134. flagIncludedChunks?: boolean;
  8135. /**
  8136. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  8137. */
  8138. innerGraph?: boolean;
  8139. /**
  8140. * Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/"deterministic": generate short deterministic names optimized for caching, "size": generate the shortest possible names).
  8141. */
  8142. mangleExports?: boolean | "deterministic" | "size";
  8143. /**
  8144. * Reduce size of WASM by changing imports to shorter strings.
  8145. */
  8146. mangleWasmImports?: boolean;
  8147. /**
  8148. * Merge chunks which contain the same modules.
  8149. */
  8150. mergeDuplicateChunks?: boolean;
  8151. /**
  8152. * Enable minimizing the output. Uses optimization.minimizer.
  8153. */
  8154. minimize?: boolean;
  8155. /**
  8156. * Minimizer(s) to use for minimizing the output.
  8157. */
  8158. minimizer?: (
  8159. | undefined
  8160. | null
  8161. | false
  8162. | ""
  8163. | 0
  8164. | ((this: Compiler, compiler: Compiler) => void)
  8165. | WebpackPluginInstance
  8166. | "..."
  8167. )[];
  8168. /**
  8169. * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).
  8170. */
  8171. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  8172. /**
  8173. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  8174. */
  8175. noEmitOnErrors?: boolean;
  8176. /**
  8177. * Set process.env.NODE_ENV to a specific value.
  8178. */
  8179. nodeEnv?: string | false;
  8180. /**
  8181. * Generate records with relative paths to be able to move the context folder.
  8182. */
  8183. portableRecords?: boolean;
  8184. /**
  8185. * Figure out which exports are provided by modules to generate more efficient code.
  8186. */
  8187. providedExports?: boolean;
  8188. /**
  8189. * Use real [contenthash] based on final content of the assets.
  8190. */
  8191. realContentHash?: boolean;
  8192. /**
  8193. * Removes modules from chunks when these modules are already included in all parents.
  8194. */
  8195. removeAvailableModules?: boolean;
  8196. /**
  8197. * Remove chunks which are empty.
  8198. */
  8199. removeEmptyChunks?: boolean;
  8200. /**
  8201. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  8202. */
  8203. runtimeChunk?:
  8204. | boolean
  8205. | "single"
  8206. | "multiple"
  8207. | {
  8208. /**
  8209. * The name or name factory for the runtime chunks.
  8210. */
  8211. name?: string | Function;
  8212. };
  8213. /**
  8214. * Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).
  8215. */
  8216. sideEffects?: boolean | "flag";
  8217. /**
  8218. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  8219. */
  8220. splitChunks?: false | OptimizationSplitChunksOptions;
  8221. /**
  8222. * Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, "global": analyse exports globally for all runtimes combined).
  8223. */
  8224. usedExports?: boolean | "global";
  8225. }
  8226. /**
  8227. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  8228. */
  8229. declare interface OptimizationSplitChunksCacheGroup {
  8230. /**
  8231. * Sets the name delimiter for created chunks.
  8232. */
  8233. automaticNameDelimiter?: string;
  8234. /**
  8235. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  8236. */
  8237. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8238. /**
  8239. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  8240. */
  8241. enforce?: boolean;
  8242. /**
  8243. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8244. */
  8245. enforceSizeThreshold?: number | { [index: string]: number };
  8246. /**
  8247. * Sets the template for the filename for created chunks.
  8248. */
  8249. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8250. /**
  8251. * Sets the hint for chunk id.
  8252. */
  8253. idHint?: string;
  8254. /**
  8255. * Assign modules to a cache group by module layer.
  8256. */
  8257. layer?: string | Function | RegExp;
  8258. /**
  8259. * Maximum number of requests which are accepted for on-demand loading.
  8260. */
  8261. maxAsyncRequests?: number;
  8262. /**
  8263. * Maximal size hint for the on-demand chunks.
  8264. */
  8265. maxAsyncSize?: number | { [index: string]: number };
  8266. /**
  8267. * Maximum number of initial chunks which are accepted for an entry point.
  8268. */
  8269. maxInitialRequests?: number;
  8270. /**
  8271. * Maximal size hint for the initial chunks.
  8272. */
  8273. maxInitialSize?: number | { [index: string]: number };
  8274. /**
  8275. * Maximal size hint for the created chunks.
  8276. */
  8277. maxSize?: number | { [index: string]: number };
  8278. /**
  8279. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8280. */
  8281. minChunks?: number;
  8282. /**
  8283. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8284. */
  8285. minRemainingSize?: number | { [index: string]: number };
  8286. /**
  8287. * Minimal size for the created chunk.
  8288. */
  8289. minSize?: number | { [index: string]: number };
  8290. /**
  8291. * Minimum size reduction due to the created chunk.
  8292. */
  8293. minSizeReduction?: number | { [index: string]: number };
  8294. /**
  8295. * Give chunks for this cache group a name (chunks with equal name are merged).
  8296. */
  8297. name?: string | false | Function;
  8298. /**
  8299. * Priority of this cache group.
  8300. */
  8301. priority?: number;
  8302. /**
  8303. * Try to reuse existing chunk (with name) when it has matching modules.
  8304. */
  8305. reuseExistingChunk?: boolean;
  8306. /**
  8307. * Assign modules to a cache group by module name.
  8308. */
  8309. test?: string | Function | RegExp;
  8310. /**
  8311. * Assign modules to a cache group by module type.
  8312. */
  8313. type?: string | Function | RegExp;
  8314. /**
  8315. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8316. */
  8317. usedExports?: boolean;
  8318. }
  8319. /**
  8320. * Options object for splitting chunks into smaller chunks.
  8321. */
  8322. declare interface OptimizationSplitChunksOptions {
  8323. /**
  8324. * Sets the name delimiter for created chunks.
  8325. */
  8326. automaticNameDelimiter?: string;
  8327. /**
  8328. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  8329. */
  8330. cacheGroups?: {
  8331. [index: string]:
  8332. | string
  8333. | false
  8334. | Function
  8335. | RegExp
  8336. | OptimizationSplitChunksCacheGroup;
  8337. };
  8338. /**
  8339. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8340. */
  8341. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8342. /**
  8343. * Sets the size types which are used when a number is used for sizes.
  8344. */
  8345. defaultSizeTypes?: string[];
  8346. /**
  8347. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8348. */
  8349. enforceSizeThreshold?: number | { [index: string]: number };
  8350. /**
  8351. * Options for modules not selected by any other cache group.
  8352. */
  8353. fallbackCacheGroup?: {
  8354. /**
  8355. * Sets the name delimiter for created chunks.
  8356. */
  8357. automaticNameDelimiter?: string;
  8358. /**
  8359. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8360. */
  8361. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8362. /**
  8363. * Maximal size hint for the on-demand chunks.
  8364. */
  8365. maxAsyncSize?: number | { [index: string]: number };
  8366. /**
  8367. * Maximal size hint for the initial chunks.
  8368. */
  8369. maxInitialSize?: number | { [index: string]: number };
  8370. /**
  8371. * Maximal size hint for the created chunks.
  8372. */
  8373. maxSize?: number | { [index: string]: number };
  8374. /**
  8375. * Minimal size for the created chunk.
  8376. */
  8377. minSize?: number | { [index: string]: number };
  8378. /**
  8379. * Minimum size reduction due to the created chunk.
  8380. */
  8381. minSizeReduction?: number | { [index: string]: number };
  8382. };
  8383. /**
  8384. * Sets the template for the filename for created chunks.
  8385. */
  8386. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8387. /**
  8388. * Prevents exposing path info when creating names for parts splitted by maxSize.
  8389. */
  8390. hidePathInfo?: boolean;
  8391. /**
  8392. * Maximum number of requests which are accepted for on-demand loading.
  8393. */
  8394. maxAsyncRequests?: number;
  8395. /**
  8396. * Maximal size hint for the on-demand chunks.
  8397. */
  8398. maxAsyncSize?: number | { [index: string]: number };
  8399. /**
  8400. * Maximum number of initial chunks which are accepted for an entry point.
  8401. */
  8402. maxInitialRequests?: number;
  8403. /**
  8404. * Maximal size hint for the initial chunks.
  8405. */
  8406. maxInitialSize?: number | { [index: string]: number };
  8407. /**
  8408. * Maximal size hint for the created chunks.
  8409. */
  8410. maxSize?: number | { [index: string]: number };
  8411. /**
  8412. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8413. */
  8414. minChunks?: number;
  8415. /**
  8416. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8417. */
  8418. minRemainingSize?: number | { [index: string]: number };
  8419. /**
  8420. * Minimal size for the created chunks.
  8421. */
  8422. minSize?: number | { [index: string]: number };
  8423. /**
  8424. * Minimum size reduction due to the created chunk.
  8425. */
  8426. minSizeReduction?: number | { [index: string]: number };
  8427. /**
  8428. * Give chunks created a name (chunks with equal name are merged).
  8429. */
  8430. name?: string | false | Function;
  8431. /**
  8432. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8433. */
  8434. usedExports?: boolean;
  8435. }
  8436. declare abstract class OptionsApply {
  8437. process(options?: any, compiler?: any): void;
  8438. }
  8439. declare interface OriginRecord {
  8440. module: Module;
  8441. loc: DependencyLocation;
  8442. request: string;
  8443. }
  8444. declare class OriginalSource extends Source {
  8445. constructor(source: string | Buffer, name: string);
  8446. getName(): string;
  8447. }
  8448. /**
  8449. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  8450. */
  8451. declare interface Output {
  8452. /**
  8453. * Add a container for define/require functions in the AMD module.
  8454. */
  8455. amdContainer?: string;
  8456. /**
  8457. * The filename of asset modules as relative path inside the 'output.path' directory.
  8458. */
  8459. assetModuleFilename?:
  8460. | string
  8461. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8462. /**
  8463. * Enable/disable creating async chunks that are loaded on demand.
  8464. */
  8465. asyncChunks?: boolean;
  8466. /**
  8467. * Add a comment in the UMD wrapper.
  8468. */
  8469. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  8470. /**
  8471. * Add charset attribute for script tag.
  8472. */
  8473. charset?: boolean;
  8474. /**
  8475. * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8476. */
  8477. chunkFilename?:
  8478. | string
  8479. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8480. /**
  8481. * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
  8482. */
  8483. chunkFormat?: string | false;
  8484. /**
  8485. * Number of milliseconds before chunk request expires.
  8486. */
  8487. chunkLoadTimeout?: number;
  8488. /**
  8489. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8490. */
  8491. chunkLoading?: string | false;
  8492. /**
  8493. * The global variable used by webpack for loading of chunks.
  8494. */
  8495. chunkLoadingGlobal?: string;
  8496. /**
  8497. * Clean the output directory before emit.
  8498. */
  8499. clean?: boolean | CleanOptions;
  8500. /**
  8501. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  8502. */
  8503. compareBeforeEmit?: boolean;
  8504. /**
  8505. * This option enables cross-origin loading of chunks.
  8506. */
  8507. crossOriginLoading?: false | "anonymous" | "use-credentials";
  8508. /**
  8509. * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8510. */
  8511. cssChunkFilename?:
  8512. | string
  8513. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8514. /**
  8515. * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8516. */
  8517. cssFilename?:
  8518. | string
  8519. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8520. /**
  8521. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  8522. */
  8523. devtoolFallbackModuleFilenameTemplate?: string | Function;
  8524. /**
  8525. * Filename template string of function for the sources array in a generated SourceMap.
  8526. */
  8527. devtoolModuleFilenameTemplate?: string | Function;
  8528. /**
  8529. * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
  8530. */
  8531. devtoolNamespace?: string;
  8532. /**
  8533. * List of chunk loading types enabled for use by entry points.
  8534. */
  8535. enabledChunkLoadingTypes?: string[];
  8536. /**
  8537. * List of library types enabled for use by entry points.
  8538. */
  8539. enabledLibraryTypes?: string[];
  8540. /**
  8541. * List of wasm loading types enabled for use by entry points.
  8542. */
  8543. enabledWasmLoadingTypes?: string[];
  8544. /**
  8545. * The abilities of the environment where the webpack generated code should run.
  8546. */
  8547. environment?: Environment;
  8548. /**
  8549. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8550. */
  8551. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8552. /**
  8553. * An expression which is used to address the global object/scope in runtime code.
  8554. */
  8555. globalObject?: string;
  8556. /**
  8557. * Digest type used for the hash.
  8558. */
  8559. hashDigest?: string;
  8560. /**
  8561. * Number of chars which are used for the hash.
  8562. */
  8563. hashDigestLength?: number;
  8564. /**
  8565. * Algorithm used for generation the hash (see node.js crypto package).
  8566. */
  8567. hashFunction?: string | typeof Hash;
  8568. /**
  8569. * Any string which is added to the hash to salt it.
  8570. */
  8571. hashSalt?: string;
  8572. /**
  8573. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  8574. */
  8575. hotUpdateChunkFilename?: string;
  8576. /**
  8577. * The global variable used by webpack for loading of hot update chunks.
  8578. */
  8579. hotUpdateGlobal?: string;
  8580. /**
  8581. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  8582. */
  8583. hotUpdateMainFilename?: string;
  8584. /**
  8585. * Ignore warnings in the browser.
  8586. */
  8587. ignoreBrowserWarnings?: boolean;
  8588. /**
  8589. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  8590. */
  8591. iife?: boolean;
  8592. /**
  8593. * The name of the native import() function (can be exchanged for a polyfill).
  8594. */
  8595. importFunctionName?: string;
  8596. /**
  8597. * The name of the native import.meta object (can be exchanged for a polyfill).
  8598. */
  8599. importMetaName?: string;
  8600. /**
  8601. * Make the output files a library, exporting the exports of the entry point.
  8602. */
  8603. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  8604. /**
  8605. * Specify which export should be exposed as library.
  8606. */
  8607. libraryExport?: string | string[];
  8608. /**
  8609. * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
  8610. */
  8611. libraryTarget?: string;
  8612. /**
  8613. * Output javascript files as module source type.
  8614. */
  8615. module?: boolean;
  8616. /**
  8617. * The output directory as **absolute path** (required).
  8618. */
  8619. path?: string;
  8620. /**
  8621. * Include comments with information about the modules.
  8622. */
  8623. pathinfo?: boolean | "verbose";
  8624. /**
  8625. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  8626. */
  8627. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8628. /**
  8629. * This option enables loading async chunks via a custom script type, such as script type="module".
  8630. */
  8631. scriptType?: false | "module" | "text/javascript";
  8632. /**
  8633. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  8634. */
  8635. sourceMapFilename?: string;
  8636. /**
  8637. * Prefixes every line of the source in the bundle with this string.
  8638. */
  8639. sourcePrefix?: string;
  8640. /**
  8641. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  8642. */
  8643. strictModuleErrorHandling?: boolean;
  8644. /**
  8645. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  8646. */
  8647. strictModuleExceptionHandling?: boolean;
  8648. /**
  8649. * Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.
  8650. */
  8651. trustedTypes?: string | true | TrustedTypes;
  8652. /**
  8653. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  8654. */
  8655. umdNamedDefine?: boolean;
  8656. /**
  8657. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  8658. */
  8659. uniqueName?: string;
  8660. /**
  8661. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8662. */
  8663. wasmLoading?: string | false;
  8664. /**
  8665. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  8666. */
  8667. webassemblyModuleFilename?: string;
  8668. /**
  8669. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8670. */
  8671. workerChunkLoading?: string | false;
  8672. /**
  8673. * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
  8674. */
  8675. workerPublicPath?: string;
  8676. /**
  8677. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8678. */
  8679. workerWasmLoading?: string | false;
  8680. }
  8681. declare interface OutputFileSystem {
  8682. writeFile: (
  8683. arg0: string,
  8684. arg1: string | Buffer,
  8685. arg2: (arg0?: null | NodeJS.ErrnoException) => void
  8686. ) => void;
  8687. mkdir: (
  8688. arg0: string,
  8689. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8690. ) => void;
  8691. readdir?: (
  8692. arg0: string,
  8693. arg1: (
  8694. arg0?: null | NodeJS.ErrnoException,
  8695. arg1?: (string | Buffer)[] | IDirent[]
  8696. ) => void
  8697. ) => void;
  8698. rmdir?: (
  8699. arg0: string,
  8700. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8701. ) => void;
  8702. unlink?: (
  8703. arg0: string,
  8704. arg1: (arg0?: null | NodeJS.ErrnoException) => void
  8705. ) => void;
  8706. stat: (
  8707. arg0: string,
  8708. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  8709. ) => void;
  8710. lstat?: (
  8711. arg0: string,
  8712. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: IStats) => void
  8713. ) => void;
  8714. readFile: (
  8715. arg0: string,
  8716. arg1: (arg0?: null | NodeJS.ErrnoException, arg1?: string | Buffer) => void
  8717. ) => void;
  8718. join?: (arg0: string, arg1: string) => string;
  8719. relative?: (arg0: string, arg1: string) => string;
  8720. dirname?: (arg0: string) => string;
  8721. }
  8722. /**
  8723. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  8724. */
  8725. declare interface OutputNormalized {
  8726. /**
  8727. * The filename of asset modules as relative path inside the 'output.path' directory.
  8728. */
  8729. assetModuleFilename?:
  8730. | string
  8731. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8732. /**
  8733. * Enable/disable creating async chunks that are loaded on demand.
  8734. */
  8735. asyncChunks?: boolean;
  8736. /**
  8737. * Add charset attribute for script tag.
  8738. */
  8739. charset?: boolean;
  8740. /**
  8741. * Specifies the filename template of output files of non-initial chunks on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8742. */
  8743. chunkFilename?:
  8744. | string
  8745. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8746. /**
  8747. * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
  8748. */
  8749. chunkFormat?: string | false;
  8750. /**
  8751. * Number of milliseconds before chunk request expires.
  8752. */
  8753. chunkLoadTimeout?: number;
  8754. /**
  8755. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8756. */
  8757. chunkLoading?: string | false;
  8758. /**
  8759. * The global variable used by webpack for loading of chunks.
  8760. */
  8761. chunkLoadingGlobal?: string;
  8762. /**
  8763. * Clean the output directory before emit.
  8764. */
  8765. clean?: boolean | CleanOptions;
  8766. /**
  8767. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  8768. */
  8769. compareBeforeEmit?: boolean;
  8770. /**
  8771. * This option enables cross-origin loading of chunks.
  8772. */
  8773. crossOriginLoading?: false | "anonymous" | "use-credentials";
  8774. /**
  8775. * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8776. */
  8777. cssChunkFilename?:
  8778. | string
  8779. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8780. /**
  8781. * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8782. */
  8783. cssFilename?:
  8784. | string
  8785. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8786. /**
  8787. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  8788. */
  8789. devtoolFallbackModuleFilenameTemplate?: string | Function;
  8790. /**
  8791. * Filename template string of function for the sources array in a generated SourceMap.
  8792. */
  8793. devtoolModuleFilenameTemplate?: string | Function;
  8794. /**
  8795. * Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to `output.library` if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.
  8796. */
  8797. devtoolNamespace?: string;
  8798. /**
  8799. * List of chunk loading types enabled for use by entry points.
  8800. */
  8801. enabledChunkLoadingTypes?: string[];
  8802. /**
  8803. * List of library types enabled for use by entry points.
  8804. */
  8805. enabledLibraryTypes?: string[];
  8806. /**
  8807. * List of wasm loading types enabled for use by entry points.
  8808. */
  8809. enabledWasmLoadingTypes?: string[];
  8810. /**
  8811. * The abilities of the environment where the webpack generated code should run.
  8812. */
  8813. environment?: Environment;
  8814. /**
  8815. * Specifies the filename of output files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
  8816. */
  8817. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8818. /**
  8819. * An expression which is used to address the global object/scope in runtime code.
  8820. */
  8821. globalObject?: string;
  8822. /**
  8823. * Digest type used for the hash.
  8824. */
  8825. hashDigest?: string;
  8826. /**
  8827. * Number of chars which are used for the hash.
  8828. */
  8829. hashDigestLength?: number;
  8830. /**
  8831. * Algorithm used for generation the hash (see node.js crypto package).
  8832. */
  8833. hashFunction?: string | typeof Hash;
  8834. /**
  8835. * Any string which is added to the hash to salt it.
  8836. */
  8837. hashSalt?: string;
  8838. /**
  8839. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  8840. */
  8841. hotUpdateChunkFilename?: string;
  8842. /**
  8843. * The global variable used by webpack for loading of hot update chunks.
  8844. */
  8845. hotUpdateGlobal?: string;
  8846. /**
  8847. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  8848. */
  8849. hotUpdateMainFilename?: string;
  8850. /**
  8851. * Ignore warnings in the browser.
  8852. */
  8853. ignoreBrowserWarnings?: boolean;
  8854. /**
  8855. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  8856. */
  8857. iife?: boolean;
  8858. /**
  8859. * The name of the native import() function (can be exchanged for a polyfill).
  8860. */
  8861. importFunctionName?: string;
  8862. /**
  8863. * The name of the native import.meta object (can be exchanged for a polyfill).
  8864. */
  8865. importMetaName?: string;
  8866. /**
  8867. * Options for library.
  8868. */
  8869. library?: LibraryOptions;
  8870. /**
  8871. * Output javascript files as module source type.
  8872. */
  8873. module?: boolean;
  8874. /**
  8875. * The output directory as **absolute path** (required).
  8876. */
  8877. path?: string;
  8878. /**
  8879. * Include comments with information about the modules.
  8880. */
  8881. pathinfo?: boolean | "verbose";
  8882. /**
  8883. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  8884. */
  8885. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8886. /**
  8887. * This option enables loading async chunks via a custom script type, such as script type="module".
  8888. */
  8889. scriptType?: false | "module" | "text/javascript";
  8890. /**
  8891. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  8892. */
  8893. sourceMapFilename?: string;
  8894. /**
  8895. * Prefixes every line of the source in the bundle with this string.
  8896. */
  8897. sourcePrefix?: string;
  8898. /**
  8899. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  8900. */
  8901. strictModuleErrorHandling?: boolean;
  8902. /**
  8903. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  8904. */
  8905. strictModuleExceptionHandling?: boolean;
  8906. /**
  8907. * Use a Trusted Types policy to create urls for chunks.
  8908. */
  8909. trustedTypes?: TrustedTypes;
  8910. /**
  8911. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  8912. */
  8913. uniqueName?: string;
  8914. /**
  8915. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8916. */
  8917. wasmLoading?: string | false;
  8918. /**
  8919. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  8920. */
  8921. webassemblyModuleFilename?: string;
  8922. /**
  8923. * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
  8924. */
  8925. workerChunkLoading?: string | false;
  8926. /**
  8927. * Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.
  8928. */
  8929. workerPublicPath?: string;
  8930. /**
  8931. * The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
  8932. */
  8933. workerWasmLoading?: string | false;
  8934. }
  8935. declare interface ParameterizedComparator<TArg, T> {
  8936. (arg0: TArg): Comparator<T>;
  8937. }
  8938. declare interface ParsedIdentifier {
  8939. request: string;
  8940. query: string;
  8941. fragment: string;
  8942. directory: boolean;
  8943. module: boolean;
  8944. file: boolean;
  8945. internal: boolean;
  8946. }
  8947. declare class Parser {
  8948. constructor();
  8949. parse(
  8950. source: string | Buffer | PreparsedAst,
  8951. state: ParserState
  8952. ): ParserState;
  8953. }
  8954. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  8955. ParserOptionsByModuleTypeUnknown;
  8956. /**
  8957. * Specify options for each parser.
  8958. */
  8959. declare interface ParserOptionsByModuleTypeKnown {
  8960. /**
  8961. * Parser options for asset modules.
  8962. */
  8963. asset?: AssetParserOptions;
  8964. /**
  8965. * No parser options are supported for this module type.
  8966. */
  8967. "asset/inline"?: EmptyParserOptions;
  8968. /**
  8969. * No parser options are supported for this module type.
  8970. */
  8971. "asset/resource"?: EmptyParserOptions;
  8972. /**
  8973. * No parser options are supported for this module type.
  8974. */
  8975. "asset/source"?: EmptyParserOptions;
  8976. /**
  8977. * Parser options for javascript modules.
  8978. */
  8979. javascript?: JavascriptParserOptions;
  8980. /**
  8981. * Parser options for javascript modules.
  8982. */
  8983. "javascript/auto"?: JavascriptParserOptions;
  8984. /**
  8985. * Parser options for javascript modules.
  8986. */
  8987. "javascript/dynamic"?: JavascriptParserOptions;
  8988. /**
  8989. * Parser options for javascript modules.
  8990. */
  8991. "javascript/esm"?: JavascriptParserOptions;
  8992. }
  8993. /**
  8994. * Specify options for each parser.
  8995. */
  8996. declare interface ParserOptionsByModuleTypeUnknown {
  8997. [index: string]: { [index: string]: any };
  8998. }
  8999. type ParserState = Record<string, any> & ParserStateBase;
  9000. declare interface ParserStateBase {
  9001. source: string | Buffer;
  9002. current: NormalModule;
  9003. module: NormalModule;
  9004. compilation: Compilation;
  9005. options: { [index: string]: any };
  9006. }
  9007. declare interface PathData {
  9008. chunkGraph?: ChunkGraph;
  9009. hash?: string;
  9010. hashWithLength?: (arg0: number) => string;
  9011. chunk?: Chunk | ChunkPathData;
  9012. module?: Module | ModulePathData;
  9013. runtime?: RuntimeSpec;
  9014. filename?: string;
  9015. basename?: string;
  9016. query?: string;
  9017. contentHashType?: string;
  9018. contentHash?: string;
  9019. contentHashWithLength?: (arg0: number) => string;
  9020. noChunkHash?: boolean;
  9021. url?: string;
  9022. }
  9023. type Pattern =
  9024. | Identifier
  9025. | MemberExpression
  9026. | ObjectPattern
  9027. | ArrayPattern
  9028. | RestElement
  9029. | AssignmentPattern;
  9030. /**
  9031. * Configuration object for web performance recommendations.
  9032. */
  9033. declare interface PerformanceOptions {
  9034. /**
  9035. * Filter function to select assets that are checked.
  9036. */
  9037. assetFilter?: Function;
  9038. /**
  9039. * Sets the format of the hints: warnings, errors or nothing at all.
  9040. */
  9041. hints?: false | "error" | "warning";
  9042. /**
  9043. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  9044. */
  9045. maxAssetSize?: number;
  9046. /**
  9047. * Total size of an entry point (in bytes).
  9048. */
  9049. maxEntrypointSize?: number;
  9050. }
  9051. declare interface PitchLoaderDefinitionFunction<
  9052. OptionsType = {},
  9053. ContextAdditions = {}
  9054. > {
  9055. (
  9056. this: NormalModuleLoaderContext<OptionsType> &
  9057. LoaderRunnerLoaderContext<OptionsType> &
  9058. LoaderPluginLoaderContext &
  9059. HotModuleReplacementPluginLoaderContext &
  9060. ContextAdditions,
  9061. remainingRequest: string,
  9062. previousRequest: string,
  9063. data: object
  9064. ): string | void | Buffer | Promise<string | Buffer>;
  9065. }
  9066. type Plugin =
  9067. | undefined
  9068. | null
  9069. | false
  9070. | ""
  9071. | 0
  9072. | { apply: (arg0: Resolver) => void }
  9073. | ((this: Resolver, arg1: Resolver) => void);
  9074. declare interface PnpApiImpl {
  9075. resolveToUnqualified: (arg0: string, arg1: string, arg2: object) => string;
  9076. }
  9077. declare interface PossibleFileSystemError {
  9078. code?: string;
  9079. errno?: number;
  9080. path?: string;
  9081. syscall?: string;
  9082. }
  9083. declare class PrefetchPlugin {
  9084. constructor(context: string, request?: string);
  9085. context: null | string;
  9086. request: string;
  9087. /**
  9088. * Apply the plugin
  9089. */
  9090. apply(compiler: Compiler): void;
  9091. }
  9092. declare class PrefixSource extends Source {
  9093. constructor(prefix: string, source: string | Source);
  9094. original(): Source;
  9095. getPrefix(): string;
  9096. }
  9097. declare interface PreparsedAst {
  9098. [index: string]: any;
  9099. }
  9100. declare interface PrintedElement {
  9101. element: string;
  9102. content: string;
  9103. }
  9104. declare interface Problem {
  9105. type: ProblemType;
  9106. path: string;
  9107. argument: string;
  9108. value?: any;
  9109. index?: number;
  9110. expected?: string;
  9111. }
  9112. type ProblemType =
  9113. | "unknown-argument"
  9114. | "unexpected-non-array-in-path"
  9115. | "unexpected-non-object-in-path"
  9116. | "multiple-values-unexpected"
  9117. | "invalid-value";
  9118. declare interface ProcessAssetsAdditionalOptions {
  9119. additionalAssets?: true | Function;
  9120. }
  9121. declare class Profiler {
  9122. constructor(inspector?: any);
  9123. session: any;
  9124. inspector: any;
  9125. hasSession(): boolean;
  9126. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  9127. sendCommand(method: string, params?: object): Promise<any>;
  9128. destroy(): Promise<void>;
  9129. stopProfiling(): Promise<{ profile: any }>;
  9130. }
  9131. declare class ProfilingPlugin {
  9132. constructor(options?: ProfilingPluginOptions);
  9133. outputPath: string;
  9134. /**
  9135. * Apply the plugin
  9136. */
  9137. apply(compiler: Compiler): void;
  9138. static Profiler: typeof Profiler;
  9139. }
  9140. declare interface ProfilingPluginOptions {
  9141. /**
  9142. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  9143. */
  9144. outputPath?: string;
  9145. }
  9146. declare class ProgressPlugin {
  9147. constructor(options?: ProgressPluginArgument);
  9148. profile?: null | boolean;
  9149. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9150. modulesCount?: number;
  9151. dependenciesCount?: number;
  9152. showEntries?: boolean;
  9153. showModules?: boolean;
  9154. showDependencies?: boolean;
  9155. showActiveModules?: boolean;
  9156. percentBy?: null | "entries" | "modules" | "dependencies";
  9157. apply(compiler: Compiler | MultiCompiler): void;
  9158. static getReporter(
  9159. compiler: Compiler
  9160. ): undefined | ((p: number, ...args: string[]) => void);
  9161. static defaultOptions: {
  9162. profile: boolean;
  9163. modulesCount: number;
  9164. dependenciesCount: number;
  9165. modules: boolean;
  9166. dependencies: boolean;
  9167. activeModules: boolean;
  9168. entries: boolean;
  9169. };
  9170. static createDefaultHandler: (
  9171. profile: undefined | null | boolean,
  9172. logger: WebpackLogger
  9173. ) => (percentage: number, msg: string, ...args: string[]) => void;
  9174. }
  9175. type ProgressPluginArgument =
  9176. | ProgressPluginOptions
  9177. | ((percentage: number, msg: string, ...args: string[]) => void);
  9178. /**
  9179. * Options object for the ProgressPlugin.
  9180. */
  9181. declare interface ProgressPluginOptions {
  9182. /**
  9183. * Show active modules count and one active module in progress message.
  9184. */
  9185. activeModules?: boolean;
  9186. /**
  9187. * Show dependencies count in progress message.
  9188. */
  9189. dependencies?: boolean;
  9190. /**
  9191. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  9192. */
  9193. dependenciesCount?: number;
  9194. /**
  9195. * Show entries count in progress message.
  9196. */
  9197. entries?: boolean;
  9198. /**
  9199. * Function that executes for every progress step.
  9200. */
  9201. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9202. /**
  9203. * Show modules count in progress message.
  9204. */
  9205. modules?: boolean;
  9206. /**
  9207. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  9208. */
  9209. modulesCount?: number;
  9210. /**
  9211. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  9212. */
  9213. percentBy?: null | "entries" | "modules" | "dependencies";
  9214. /**
  9215. * Collect profile data for progress steps. Default: false.
  9216. */
  9217. profile?: null | boolean;
  9218. }
  9219. declare class ProvidePlugin {
  9220. constructor(definitions: Record<string, string | string[]>);
  9221. definitions: Record<string, string | string[]>;
  9222. /**
  9223. * Apply the plugin
  9224. */
  9225. apply(compiler: Compiler): void;
  9226. }
  9227. declare class ProvideSharedPlugin {
  9228. constructor(options: ProvideSharedPluginOptions);
  9229. /**
  9230. * Apply the plugin
  9231. */
  9232. apply(compiler: Compiler): void;
  9233. }
  9234. declare interface ProvideSharedPluginOptions {
  9235. /**
  9236. * Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.
  9237. */
  9238. provides: Provides;
  9239. /**
  9240. * Share scope name used for all provided modules (defaults to 'default').
  9241. */
  9242. shareScope?: string;
  9243. }
  9244. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  9245. /**
  9246. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  9247. */
  9248. declare interface ProvidesConfig {
  9249. /**
  9250. * Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
  9251. */
  9252. eager?: boolean;
  9253. /**
  9254. * Key in the share scope under which the shared modules should be stored.
  9255. */
  9256. shareKey?: string;
  9257. /**
  9258. * Share scope name.
  9259. */
  9260. shareScope?: string;
  9261. /**
  9262. * Version of the provided module. Will replace lower matching versions, but not higher.
  9263. */
  9264. version?: string | false;
  9265. }
  9266. /**
  9267. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  9268. */
  9269. declare interface ProvidesObject {
  9270. [index: string]: string | ProvidesConfig;
  9271. }
  9272. declare interface RawChunkGroupOptions {
  9273. preloadOrder?: number;
  9274. prefetchOrder?: number;
  9275. fetchPriority?: "auto" | "low" | "high";
  9276. }
  9277. type RawLoaderDefinition<
  9278. OptionsType = {},
  9279. ContextAdditions = {}
  9280. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  9281. raw: true;
  9282. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9283. };
  9284. declare interface RawLoaderDefinitionFunction<
  9285. OptionsType = {},
  9286. ContextAdditions = {}
  9287. > {
  9288. (
  9289. this: NormalModuleLoaderContext<OptionsType> &
  9290. LoaderRunnerLoaderContext<OptionsType> &
  9291. LoaderPluginLoaderContext &
  9292. HotModuleReplacementPluginLoaderContext &
  9293. ContextAdditions,
  9294. content: Buffer,
  9295. sourceMap?: string | SourceMap,
  9296. additionalData?: AdditionalData
  9297. ): string | void | Buffer | Promise<string | Buffer>;
  9298. }
  9299. declare class RawSource extends Source {
  9300. constructor(source: string | Buffer, convertToString?: boolean);
  9301. isBuffer(): boolean;
  9302. }
  9303. declare interface RawSourceMap {
  9304. version: number;
  9305. sources: string[];
  9306. names: string[];
  9307. sourceRoot?: string;
  9308. sourcesContent?: string[];
  9309. mappings: string;
  9310. file: string;
  9311. }
  9312. declare class ReadFileCompileWasmPlugin {
  9313. constructor(options?: ReadFileCompileWasmPluginOptions);
  9314. options: ReadFileCompileWasmPluginOptions;
  9315. /**
  9316. * Apply the plugin
  9317. */
  9318. apply(compiler: Compiler): void;
  9319. }
  9320. declare interface ReadFileCompileWasmPluginOptions {
  9321. /**
  9322. * mangle imports
  9323. */
  9324. mangleImports?: boolean;
  9325. }
  9326. declare interface ReaddirOptions {
  9327. encoding?:
  9328. | null
  9329. | "ascii"
  9330. | "utf8"
  9331. | "utf16le"
  9332. | "ucs2"
  9333. | "latin1"
  9334. | "binary"
  9335. | "utf-8"
  9336. | "ucs-2"
  9337. | "base64"
  9338. | "base64url"
  9339. | "hex"
  9340. | "buffer";
  9341. withFileTypes?: boolean;
  9342. }
  9343. declare class RealContentHashPlugin {
  9344. constructor(__0: {
  9345. /**
  9346. * the hash function to use
  9347. */
  9348. hashFunction: string | typeof Hash;
  9349. /**
  9350. * the hash digest to use
  9351. */
  9352. hashDigest: string;
  9353. });
  9354. /**
  9355. * Apply the plugin
  9356. */
  9357. apply(compiler: Compiler): void;
  9358. static getCompilationHooks(
  9359. compilation: Compilation
  9360. ): CompilationHooksRealContentHashPlugin;
  9361. }
  9362. declare interface RealDependencyLocation {
  9363. start: SourcePosition;
  9364. end?: SourcePosition;
  9365. index?: number;
  9366. }
  9367. type RecursiveArrayOrRecord<T> =
  9368. | { [index: string]: RecursiveArrayOrRecord<T> }
  9369. | RecursiveArrayOrRecord<T>[]
  9370. | T;
  9371. declare interface ReferencedExport {
  9372. /**
  9373. * name of the referenced export
  9374. */
  9375. name: string[];
  9376. /**
  9377. * when false, referenced export can not be mangled, defaults to true
  9378. */
  9379. canMangle?: boolean;
  9380. }
  9381. type Remotes = (string | RemotesObject)[] | RemotesObject;
  9382. /**
  9383. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  9384. */
  9385. declare interface RemotesConfig {
  9386. /**
  9387. * Container locations from which modules should be resolved and loaded at runtime.
  9388. */
  9389. external: string | string[];
  9390. /**
  9391. * The name of the share scope shared with this remote.
  9392. */
  9393. shareScope?: string;
  9394. }
  9395. /**
  9396. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  9397. */
  9398. declare interface RemotesObject {
  9399. [index: string]: string | RemotesConfig | string[];
  9400. }
  9401. declare interface RenderBootstrapContext {
  9402. /**
  9403. * the chunk
  9404. */
  9405. chunk: Chunk;
  9406. /**
  9407. * results of code generation
  9408. */
  9409. codeGenerationResults: CodeGenerationResults;
  9410. /**
  9411. * the runtime template
  9412. */
  9413. runtimeTemplate: RuntimeTemplate;
  9414. /**
  9415. * the module graph
  9416. */
  9417. moduleGraph: ModuleGraph;
  9418. /**
  9419. * the chunk graph
  9420. */
  9421. chunkGraph: ChunkGraph;
  9422. /**
  9423. * hash to be used for render call
  9424. */
  9425. hash: string;
  9426. }
  9427. declare interface RenderContext {
  9428. /**
  9429. * the chunk
  9430. */
  9431. chunk: Chunk;
  9432. /**
  9433. * the dependency templates
  9434. */
  9435. dependencyTemplates: DependencyTemplates;
  9436. /**
  9437. * the runtime template
  9438. */
  9439. runtimeTemplate: RuntimeTemplate;
  9440. /**
  9441. * the module graph
  9442. */
  9443. moduleGraph: ModuleGraph;
  9444. /**
  9445. * the chunk graph
  9446. */
  9447. chunkGraph: ChunkGraph;
  9448. /**
  9449. * results of code generation
  9450. */
  9451. codeGenerationResults: CodeGenerationResults;
  9452. /**
  9453. * rendering in strict context
  9454. */
  9455. strictMode: boolean;
  9456. }
  9457. type RenderManifestEntry =
  9458. | RenderManifestEntryTemplated
  9459. | RenderManifestEntryStatic;
  9460. declare interface RenderManifestEntryStatic {
  9461. render: () => Source;
  9462. filename: string;
  9463. info: AssetInfo;
  9464. identifier: string;
  9465. hash?: string;
  9466. auxiliary?: boolean;
  9467. }
  9468. declare interface RenderManifestEntryTemplated {
  9469. render: () => Source;
  9470. filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  9471. pathOptions?: PathData;
  9472. info?: AssetInfo;
  9473. identifier: string;
  9474. hash?: string;
  9475. auxiliary?: boolean;
  9476. }
  9477. declare interface RenderManifestOptions {
  9478. /**
  9479. * the chunk used to render
  9480. */
  9481. chunk: Chunk;
  9482. hash: string;
  9483. fullHash: string;
  9484. outputOptions: Output;
  9485. codeGenerationResults: CodeGenerationResults;
  9486. moduleTemplates: { javascript: ModuleTemplate };
  9487. dependencyTemplates: DependencyTemplates;
  9488. runtimeTemplate: RuntimeTemplate;
  9489. moduleGraph: ModuleGraph;
  9490. chunkGraph: ChunkGraph;
  9491. }
  9492. declare class ReplaceSource extends Source {
  9493. constructor(source: Source, name?: string);
  9494. replace(start: number, end: number, newValue: string, name?: string): void;
  9495. insert(pos: number, newValue: string, name?: string): void;
  9496. getName(): string;
  9497. original(): string;
  9498. getReplacements(): {
  9499. start: number;
  9500. end: number;
  9501. content: string;
  9502. insertIndex: number;
  9503. name: string;
  9504. }[];
  9505. }
  9506. declare abstract class RequestShortener {
  9507. contextify: (arg0: string) => string;
  9508. shorten(request?: null | string): undefined | null | string;
  9509. }
  9510. declare interface ResolveBuildDependenciesResult {
  9511. /**
  9512. * list of files
  9513. */
  9514. files: Set<string>;
  9515. /**
  9516. * list of directories
  9517. */
  9518. directories: Set<string>;
  9519. /**
  9520. * list of missing entries
  9521. */
  9522. missing: Set<string>;
  9523. /**
  9524. * stored resolve results
  9525. */
  9526. resolveResults: Map<string, string | false>;
  9527. /**
  9528. * dependencies of the resolving
  9529. */
  9530. resolveDependencies: {
  9531. /**
  9532. * list of files
  9533. */
  9534. files: Set<string>;
  9535. /**
  9536. * list of directories
  9537. */
  9538. directories: Set<string>;
  9539. /**
  9540. * list of missing entries
  9541. */
  9542. missing: Set<string>;
  9543. };
  9544. }
  9545. /**
  9546. * Resolve context
  9547. */
  9548. declare interface ResolveContext {
  9549. contextDependencies?: WriteOnlySet<string>;
  9550. /**
  9551. * files that was found on file system
  9552. */
  9553. fileDependencies?: WriteOnlySet<string>;
  9554. /**
  9555. * dependencies that was not found on file system
  9556. */
  9557. missingDependencies?: WriteOnlySet<string>;
  9558. /**
  9559. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  9560. */
  9561. stack?: Set<string>;
  9562. /**
  9563. * log function
  9564. */
  9565. log?: (arg0: string) => void;
  9566. /**
  9567. * yield result, if provided plugins can return several results
  9568. */
  9569. yield?: (arg0: ResolveRequest) => void;
  9570. }
  9571. declare interface ResolveData {
  9572. contextInfo: ModuleFactoryCreateDataContextInfo;
  9573. resolveOptions?: ResolveOptionsWebpackOptions;
  9574. context: string;
  9575. request: string;
  9576. assertions?: Record<string, any>;
  9577. dependencies: ModuleDependency[];
  9578. dependencyType: string;
  9579. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  9580. fileDependencies: LazySet<string>;
  9581. missingDependencies: LazySet<string>;
  9582. contextDependencies: LazySet<string>;
  9583. /**
  9584. * allow to use the unsafe cache
  9585. */
  9586. cacheable: boolean;
  9587. }
  9588. declare interface ResolveOptionsTypes {
  9589. alias: AliasOption[];
  9590. fallback: AliasOption[];
  9591. aliasFields: Set<string | string[]>;
  9592. extensionAlias: ExtensionAliasOption[];
  9593. cachePredicate: (arg0: ResolveRequest) => boolean;
  9594. cacheWithContext: boolean;
  9595. /**
  9596. * A list of exports field condition names.
  9597. */
  9598. conditionNames: Set<string>;
  9599. descriptionFiles: string[];
  9600. enforceExtension: boolean;
  9601. exportsFields: Set<string | string[]>;
  9602. importsFields: Set<string | string[]>;
  9603. extensions: Set<string>;
  9604. fileSystem: FileSystem;
  9605. unsafeCache: false | object;
  9606. symlinks: boolean;
  9607. resolver?: Resolver;
  9608. modules: (string | string[])[];
  9609. mainFields: { name: string[]; forceRelative: boolean }[];
  9610. mainFiles: Set<string>;
  9611. plugins: Plugin[];
  9612. pnpApi: null | PnpApiImpl;
  9613. roots: Set<string>;
  9614. fullySpecified: boolean;
  9615. resolveToContext: boolean;
  9616. restrictions: Set<string | RegExp>;
  9617. preferRelative: boolean;
  9618. preferAbsolute: boolean;
  9619. }
  9620. /**
  9621. * Options object for resolving requests.
  9622. */
  9623. declare interface ResolveOptionsWebpackOptions {
  9624. /**
  9625. * Redirect module requests.
  9626. */
  9627. alias?:
  9628. | {
  9629. /**
  9630. * New request.
  9631. */
  9632. alias: string | false | string[];
  9633. /**
  9634. * Request to be redirected.
  9635. */
  9636. name: string;
  9637. /**
  9638. * Redirect only exact matching request.
  9639. */
  9640. onlyModule?: boolean;
  9641. }[]
  9642. | { [index: string]: string | false | string[] };
  9643. /**
  9644. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  9645. */
  9646. aliasFields?: (string | string[])[];
  9647. /**
  9648. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  9649. */
  9650. byDependency?: { [index: string]: ResolveOptionsWebpackOptions };
  9651. /**
  9652. * Enable caching of successfully resolved requests (cache entries are revalidated).
  9653. */
  9654. cache?: boolean;
  9655. /**
  9656. * Predicate function to decide which requests should be cached.
  9657. */
  9658. cachePredicate?: (request: ResolveRequest) => boolean;
  9659. /**
  9660. * Include the context information in the cache identifier when caching.
  9661. */
  9662. cacheWithContext?: boolean;
  9663. /**
  9664. * Condition names for exports field entry point.
  9665. */
  9666. conditionNames?: string[];
  9667. /**
  9668. * Filenames used to find a description file (like a package.json).
  9669. */
  9670. descriptionFiles?: string[];
  9671. /**
  9672. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  9673. */
  9674. enforceExtension?: boolean;
  9675. /**
  9676. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  9677. */
  9678. exportsFields?: string[];
  9679. /**
  9680. * An object which maps extension to extension aliases.
  9681. */
  9682. extensionAlias?: { [index: string]: string | string[] };
  9683. /**
  9684. * Extensions added to the request when trying to find the file.
  9685. */
  9686. extensions?: string[];
  9687. /**
  9688. * Redirect module requests when normal resolving fails.
  9689. */
  9690. fallback?:
  9691. | {
  9692. /**
  9693. * New request.
  9694. */
  9695. alias: string | false | string[];
  9696. /**
  9697. * Request to be redirected.
  9698. */
  9699. name: string;
  9700. /**
  9701. * Redirect only exact matching request.
  9702. */
  9703. onlyModule?: boolean;
  9704. }[]
  9705. | { [index: string]: string | false | string[] };
  9706. /**
  9707. * Filesystem for the resolver.
  9708. */
  9709. fileSystem?: InputFileSystem;
  9710. /**
  9711. * Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).
  9712. */
  9713. fullySpecified?: boolean;
  9714. /**
  9715. * Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).
  9716. */
  9717. importsFields?: string[];
  9718. /**
  9719. * Field names from the description file (package.json) which are used to find the default entry point.
  9720. */
  9721. mainFields?: (string | string[])[];
  9722. /**
  9723. * Filenames used to find the default entry point if there is no description file or main field.
  9724. */
  9725. mainFiles?: string[];
  9726. /**
  9727. * Folder names or directory paths where to find modules.
  9728. */
  9729. modules?: string[];
  9730. /**
  9731. * Plugins for the resolver.
  9732. */
  9733. plugins?: (
  9734. | undefined
  9735. | null
  9736. | false
  9737. | ""
  9738. | 0
  9739. | ResolvePluginInstance
  9740. | "..."
  9741. )[];
  9742. /**
  9743. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  9744. */
  9745. preferAbsolute?: boolean;
  9746. /**
  9747. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  9748. */
  9749. preferRelative?: boolean;
  9750. /**
  9751. * Custom resolver.
  9752. */
  9753. resolver?: Resolver;
  9754. /**
  9755. * A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.
  9756. */
  9757. restrictions?: (string | RegExp)[];
  9758. /**
  9759. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  9760. */
  9761. roots?: string[];
  9762. /**
  9763. * Enable resolving symlinks to the original location.
  9764. */
  9765. symlinks?: boolean;
  9766. /**
  9767. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  9768. */
  9769. unsafeCache?: boolean | { [index: string]: any };
  9770. /**
  9771. * Use synchronous filesystem calls for the resolver.
  9772. */
  9773. useSyncFileSystemCalls?: boolean;
  9774. }
  9775. type ResolveOptionsWithDependencyType = ResolveOptionsWebpackOptions & {
  9776. dependencyType?: string;
  9777. resolveToContext?: boolean;
  9778. };
  9779. /**
  9780. * Plugin instance.
  9781. */
  9782. declare interface ResolvePluginInstance {
  9783. [index: string]: any;
  9784. /**
  9785. * The run point of the plugin, required method.
  9786. */
  9787. apply: (resolver: Resolver) => void;
  9788. }
  9789. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  9790. declare interface ResolvedContextFileSystemInfoEntry {
  9791. safeTime: number;
  9792. timestampHash?: string;
  9793. }
  9794. declare interface ResolvedContextTimestampAndHash {
  9795. safeTime: number;
  9796. timestampHash?: string;
  9797. hash: string;
  9798. }
  9799. declare abstract class Resolver {
  9800. fileSystem: FileSystem;
  9801. options: ResolveOptionsTypes;
  9802. hooks: KnownHooks;
  9803. ensureHook(
  9804. name:
  9805. | string
  9806. | AsyncSeriesBailHook<
  9807. [ResolveRequest, ResolveContext],
  9808. null | ResolveRequest
  9809. >
  9810. ): AsyncSeriesBailHook<
  9811. [ResolveRequest, ResolveContext],
  9812. null | ResolveRequest
  9813. >;
  9814. getHook(
  9815. name:
  9816. | string
  9817. | AsyncSeriesBailHook<
  9818. [ResolveRequest, ResolveContext],
  9819. null | ResolveRequest
  9820. >
  9821. ): AsyncSeriesBailHook<
  9822. [ResolveRequest, ResolveContext],
  9823. null | ResolveRequest
  9824. >;
  9825. resolveSync(context: object, path: string, request: string): string | false;
  9826. resolve(
  9827. context: object,
  9828. path: string,
  9829. request: string,
  9830. resolveContext: ResolveContext,
  9831. callback: (
  9832. err: null | ErrorWithDetail,
  9833. res?: string | false,
  9834. req?: ResolveRequest
  9835. ) => void
  9836. ): void;
  9837. doResolve(
  9838. hook: AsyncSeriesBailHook<
  9839. [ResolveRequest, ResolveContext],
  9840. null | ResolveRequest
  9841. >,
  9842. request: ResolveRequest,
  9843. message: null | string,
  9844. resolveContext: ResolveContext,
  9845. callback: (err?: null | Error, result?: ResolveRequest) => void
  9846. ): void;
  9847. parse(identifier: string): ParsedIdentifier;
  9848. isModule(path: string): boolean;
  9849. isPrivate(path: string): boolean;
  9850. isDirectory(path: string): boolean;
  9851. join(path: string, request: string): string;
  9852. normalize(path: string): string;
  9853. }
  9854. declare interface ResolverCache {
  9855. direct: WeakMap<Object, ResolverWithOptions>;
  9856. stringified: Map<string, ResolverWithOptions>;
  9857. }
  9858. declare abstract class ResolverFactory {
  9859. hooks: Readonly<{
  9860. resolveOptions: HookMap<
  9861. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  9862. >;
  9863. resolver: HookMap<
  9864. SyncHook<[Resolver, UserResolveOptions, ResolveOptionsWithDependencyType]>
  9865. >;
  9866. }>;
  9867. cache: Map<string, ResolverCache>;
  9868. get(
  9869. type: string,
  9870. resolveOptions?: ResolveOptionsWithDependencyType
  9871. ): ResolverWithOptions;
  9872. }
  9873. type ResolverWithOptions = Resolver & WithOptions;
  9874. declare interface ResourceDataWithData {
  9875. resource: string;
  9876. path: string;
  9877. query: string;
  9878. fragment: string;
  9879. context?: string;
  9880. data: Record<string, any>;
  9881. }
  9882. type Rule = string | RegExp;
  9883. declare interface RuleSet {
  9884. /**
  9885. * map of references in the rule set (may grow over time)
  9886. */
  9887. references: Map<string, any>;
  9888. /**
  9889. * execute the rule set
  9890. */
  9891. exec: (arg0: object) => Effect[];
  9892. }
  9893. type RuleSetCondition =
  9894. | string
  9895. | RegExp
  9896. | ((value: string) => boolean)
  9897. | RuleSetLogicalConditions
  9898. | RuleSetCondition[];
  9899. type RuleSetConditionAbsolute =
  9900. | string
  9901. | RegExp
  9902. | ((value: string) => boolean)
  9903. | RuleSetLogicalConditionsAbsolute
  9904. | RuleSetConditionAbsolute[];
  9905. type RuleSetConditionOrConditions =
  9906. | string
  9907. | RegExp
  9908. | ((value: string) => boolean)
  9909. | RuleSetLogicalConditions
  9910. | RuleSetCondition[];
  9911. /**
  9912. * Logic operators used in a condition matcher.
  9913. */
  9914. declare interface RuleSetLogicalConditions {
  9915. /**
  9916. * Logical AND.
  9917. */
  9918. and?: RuleSetCondition[];
  9919. /**
  9920. * Logical NOT.
  9921. */
  9922. not?:
  9923. | string
  9924. | RegExp
  9925. | ((value: string) => boolean)
  9926. | RuleSetLogicalConditions
  9927. | RuleSetCondition[];
  9928. /**
  9929. * Logical OR.
  9930. */
  9931. or?: RuleSetCondition[];
  9932. }
  9933. /**
  9934. * Logic operators used in a condition matcher.
  9935. */
  9936. declare interface RuleSetLogicalConditionsAbsolute {
  9937. /**
  9938. * Logical AND.
  9939. */
  9940. and?: RuleSetConditionAbsolute[];
  9941. /**
  9942. * Logical NOT.
  9943. */
  9944. not?:
  9945. | string
  9946. | RegExp
  9947. | ((value: string) => boolean)
  9948. | RuleSetLogicalConditionsAbsolute
  9949. | RuleSetConditionAbsolute[];
  9950. /**
  9951. * Logical OR.
  9952. */
  9953. or?: RuleSetConditionAbsolute[];
  9954. }
  9955. /**
  9956. * A rule description with conditions and effects for modules.
  9957. */
  9958. declare interface RuleSetRule {
  9959. /**
  9960. * Match on import assertions of the dependency.
  9961. */
  9962. assert?: { [index: string]: RuleSetConditionOrConditions };
  9963. /**
  9964. * Match the child compiler name.
  9965. */
  9966. compiler?:
  9967. | string
  9968. | RegExp
  9969. | ((value: string) => boolean)
  9970. | RuleSetLogicalConditions
  9971. | RuleSetCondition[];
  9972. /**
  9973. * Match dependency type.
  9974. */
  9975. dependency?:
  9976. | string
  9977. | RegExp
  9978. | ((value: string) => boolean)
  9979. | RuleSetLogicalConditions
  9980. | RuleSetCondition[];
  9981. /**
  9982. * Match values of properties in the description file (usually package.json).
  9983. */
  9984. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  9985. /**
  9986. * Enforce this rule as pre or post step.
  9987. */
  9988. enforce?: "pre" | "post";
  9989. /**
  9990. * Shortcut for resource.exclude.
  9991. */
  9992. exclude?:
  9993. | string
  9994. | RegExp
  9995. | ((value: string) => boolean)
  9996. | RuleSetLogicalConditionsAbsolute
  9997. | RuleSetConditionAbsolute[];
  9998. /**
  9999. * The options for the module generator.
  10000. */
  10001. generator?: { [index: string]: any };
  10002. /**
  10003. * Shortcut for resource.include.
  10004. */
  10005. include?:
  10006. | string
  10007. | RegExp
  10008. | ((value: string) => boolean)
  10009. | RuleSetLogicalConditionsAbsolute
  10010. | RuleSetConditionAbsolute[];
  10011. /**
  10012. * Match the issuer of the module (The module pointing to this module).
  10013. */
  10014. issuer?:
  10015. | string
  10016. | RegExp
  10017. | ((value: string) => boolean)
  10018. | RuleSetLogicalConditionsAbsolute
  10019. | RuleSetConditionAbsolute[];
  10020. /**
  10021. * Match layer of the issuer of this module (The module pointing to this module).
  10022. */
  10023. issuerLayer?:
  10024. | string
  10025. | RegExp
  10026. | ((value: string) => boolean)
  10027. | RuleSetLogicalConditions
  10028. | RuleSetCondition[];
  10029. /**
  10030. * Specifies the layer in which the module should be placed in.
  10031. */
  10032. layer?: string;
  10033. /**
  10034. * Shortcut for use.loader.
  10035. */
  10036. loader?: string;
  10037. /**
  10038. * Match module mimetype when load from Data URI.
  10039. */
  10040. mimetype?:
  10041. | string
  10042. | RegExp
  10043. | ((value: string) => boolean)
  10044. | RuleSetLogicalConditions
  10045. | RuleSetCondition[];
  10046. /**
  10047. * Only execute the first matching rule in this array.
  10048. */
  10049. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  10050. /**
  10051. * Shortcut for use.options.
  10052. */
  10053. options?: string | { [index: string]: any };
  10054. /**
  10055. * Options for parsing.
  10056. */
  10057. parser?: { [index: string]: any };
  10058. /**
  10059. * Match the real resource path of the module.
  10060. */
  10061. realResource?:
  10062. | string
  10063. | RegExp
  10064. | ((value: string) => boolean)
  10065. | RuleSetLogicalConditionsAbsolute
  10066. | RuleSetConditionAbsolute[];
  10067. /**
  10068. * Options for the resolver.
  10069. */
  10070. resolve?: ResolveOptionsWebpackOptions;
  10071. /**
  10072. * Match the resource path of the module.
  10073. */
  10074. resource?:
  10075. | string
  10076. | RegExp
  10077. | ((value: string) => boolean)
  10078. | RuleSetLogicalConditionsAbsolute
  10079. | RuleSetConditionAbsolute[];
  10080. /**
  10081. * Match the resource fragment of the module.
  10082. */
  10083. resourceFragment?:
  10084. | string
  10085. | RegExp
  10086. | ((value: string) => boolean)
  10087. | RuleSetLogicalConditions
  10088. | RuleSetCondition[];
  10089. /**
  10090. * Match the resource query of the module.
  10091. */
  10092. resourceQuery?:
  10093. | string
  10094. | RegExp
  10095. | ((value: string) => boolean)
  10096. | RuleSetLogicalConditions
  10097. | RuleSetCondition[];
  10098. /**
  10099. * Match and execute these rules when this rule is matched.
  10100. */
  10101. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  10102. /**
  10103. * Match module scheme.
  10104. */
  10105. scheme?:
  10106. | string
  10107. | RegExp
  10108. | ((value: string) => boolean)
  10109. | RuleSetLogicalConditions
  10110. | RuleSetCondition[];
  10111. /**
  10112. * Flags a module as with or without side effects.
  10113. */
  10114. sideEffects?: boolean;
  10115. /**
  10116. * Shortcut for resource.test.
  10117. */
  10118. test?:
  10119. | string
  10120. | RegExp
  10121. | ((value: string) => boolean)
  10122. | RuleSetLogicalConditionsAbsolute
  10123. | RuleSetConditionAbsolute[];
  10124. /**
  10125. * Module type to use for the module.
  10126. */
  10127. type?: string;
  10128. /**
  10129. * Modifiers applied to the module when rule is matched.
  10130. */
  10131. use?:
  10132. | string
  10133. | (
  10134. | undefined
  10135. | null
  10136. | string
  10137. | false
  10138. | 0
  10139. | {
  10140. /**
  10141. * Unique loader options identifier.
  10142. */
  10143. ident?: string;
  10144. /**
  10145. * Loader name.
  10146. */
  10147. loader?: string;
  10148. /**
  10149. * Loader options.
  10150. */
  10151. options?: string | { [index: string]: any };
  10152. }
  10153. | ((data: object) =>
  10154. | string
  10155. | {
  10156. /**
  10157. * Unique loader options identifier.
  10158. */
  10159. ident?: string;
  10160. /**
  10161. * Loader name.
  10162. */
  10163. loader?: string;
  10164. /**
  10165. * Loader options.
  10166. */
  10167. options?: string | { [index: string]: any };
  10168. }
  10169. | __TypeWebpackOptions
  10170. | __Type_2[])
  10171. )[]
  10172. | ((data: {
  10173. resource: string;
  10174. realResource: string;
  10175. resourceQuery: string;
  10176. issuer: string;
  10177. compiler: string;
  10178. }) => __Type_2[])
  10179. | {
  10180. /**
  10181. * Unique loader options identifier.
  10182. */
  10183. ident?: string;
  10184. /**
  10185. * Loader name.
  10186. */
  10187. loader?: string;
  10188. /**
  10189. * Loader options.
  10190. */
  10191. options?: string | { [index: string]: any };
  10192. }
  10193. | __TypeWebpackOptions;
  10194. }
  10195. type RuleSetUse =
  10196. | string
  10197. | (
  10198. | undefined
  10199. | null
  10200. | string
  10201. | false
  10202. | 0
  10203. | {
  10204. /**
  10205. * Unique loader options identifier.
  10206. */
  10207. ident?: string;
  10208. /**
  10209. * Loader name.
  10210. */
  10211. loader?: string;
  10212. /**
  10213. * Loader options.
  10214. */
  10215. options?: string | { [index: string]: any };
  10216. }
  10217. | ((data: object) =>
  10218. | string
  10219. | {
  10220. /**
  10221. * Unique loader options identifier.
  10222. */
  10223. ident?: string;
  10224. /**
  10225. * Loader name.
  10226. */
  10227. loader?: string;
  10228. /**
  10229. * Loader options.
  10230. */
  10231. options?: string | { [index: string]: any };
  10232. }
  10233. | __TypeWebpackOptions
  10234. | __Type_2[])
  10235. )[]
  10236. | ((data: {
  10237. resource: string;
  10238. realResource: string;
  10239. resourceQuery: string;
  10240. issuer: string;
  10241. compiler: string;
  10242. }) => __Type_2[])
  10243. | {
  10244. /**
  10245. * Unique loader options identifier.
  10246. */
  10247. ident?: string;
  10248. /**
  10249. * Loader name.
  10250. */
  10251. loader?: string;
  10252. /**
  10253. * Loader options.
  10254. */
  10255. options?: string | { [index: string]: any };
  10256. }
  10257. | __TypeWebpackOptions;
  10258. type RuleSetUseItem =
  10259. | string
  10260. | {
  10261. /**
  10262. * Unique loader options identifier.
  10263. */
  10264. ident?: string;
  10265. /**
  10266. * Loader name.
  10267. */
  10268. loader?: string;
  10269. /**
  10270. * Loader options.
  10271. */
  10272. options?: string | { [index: string]: any };
  10273. }
  10274. | __TypeWebpackOptions;
  10275. declare class RuntimeChunkPlugin {
  10276. constructor(options?: any);
  10277. options: any;
  10278. /**
  10279. * Apply the plugin
  10280. */
  10281. apply(compiler: Compiler): void;
  10282. }
  10283. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  10284. declare class RuntimeModule extends Module {
  10285. constructor(name: string, stage?: number);
  10286. name: string;
  10287. stage: number;
  10288. compilation?: Compilation;
  10289. chunk?: Chunk;
  10290. chunkGraph?: ChunkGraph;
  10291. fullHash: boolean;
  10292. dependentHash: boolean;
  10293. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  10294. generate(): null | string;
  10295. getGeneratedCode(): null | string;
  10296. shouldIsolate(): boolean;
  10297. /**
  10298. * Runtime modules without any dependencies to other runtime modules
  10299. */
  10300. static STAGE_NORMAL: number;
  10301. /**
  10302. * Runtime modules with simple dependencies on other runtime modules
  10303. */
  10304. static STAGE_BASIC: number;
  10305. /**
  10306. * Runtime modules which attach to handlers of other runtime modules
  10307. */
  10308. static STAGE_ATTACH: number;
  10309. /**
  10310. * Runtime modules which trigger actions on bootstrap
  10311. */
  10312. static STAGE_TRIGGER: number;
  10313. }
  10314. declare interface RuntimeRequirementsContext {
  10315. /**
  10316. * the chunk graph
  10317. */
  10318. chunkGraph: ChunkGraph;
  10319. /**
  10320. * the code generation results
  10321. */
  10322. codeGenerationResults: CodeGenerationResults;
  10323. }
  10324. type RuntimeSpec = undefined | string | SortableSet<string>;
  10325. declare class RuntimeSpecMap<T> {
  10326. constructor(clone?: RuntimeSpecMap<T>);
  10327. get(runtime: RuntimeSpec): undefined | T;
  10328. has(runtime: RuntimeSpec): boolean;
  10329. set(runtime: RuntimeSpec, value: T): void;
  10330. provide(runtime: RuntimeSpec, computer: () => any): any;
  10331. delete(runtime: RuntimeSpec): void;
  10332. update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
  10333. keys(): RuntimeSpec[];
  10334. values(): IterableIterator<T>;
  10335. get size(): number;
  10336. }
  10337. declare class RuntimeSpecSet {
  10338. constructor(iterable?: Iterable<RuntimeSpec>);
  10339. add(runtime: RuntimeSpec): void;
  10340. has(runtime: RuntimeSpec): boolean;
  10341. get size(): number;
  10342. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  10343. }
  10344. declare abstract class RuntimeTemplate {
  10345. compilation: Compilation;
  10346. outputOptions: OutputNormalized;
  10347. requestShortener: RequestShortener;
  10348. globalObject: string;
  10349. contentHashReplacement: string;
  10350. isIIFE(): undefined | boolean;
  10351. isModule(): undefined | boolean;
  10352. supportsConst(): undefined | boolean;
  10353. supportsArrowFunction(): undefined | boolean;
  10354. supportsOptionalChaining(): undefined | boolean;
  10355. supportsForOf(): undefined | boolean;
  10356. supportsDestructuring(): undefined | boolean;
  10357. supportsBigIntLiteral(): undefined | boolean;
  10358. supportsDynamicImport(): undefined | boolean;
  10359. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  10360. supportTemplateLiteral(): undefined | boolean;
  10361. returningFunction(returnValue?: any, args?: string): string;
  10362. basicFunction(args?: any, body?: any): string;
  10363. concatenation(...args: (string | { expr: string })[]): string;
  10364. expressionFunction(expression?: any, args?: string): string;
  10365. emptyFunction(): "x => {}" | "function() {}";
  10366. destructureArray(items?: any, value?: any): string;
  10367. destructureObject(items?: any, value?: any): string;
  10368. iife(args?: any, body?: any): string;
  10369. forEach(variable?: any, array?: any, body?: any): string;
  10370. /**
  10371. * Add a comment
  10372. */
  10373. comment(__0: {
  10374. /**
  10375. * request string used originally
  10376. */
  10377. request?: string;
  10378. /**
  10379. * name of the chunk referenced
  10380. */
  10381. chunkName?: string;
  10382. /**
  10383. * reason information of the chunk
  10384. */
  10385. chunkReason?: string;
  10386. /**
  10387. * additional message
  10388. */
  10389. message?: string;
  10390. /**
  10391. * name of the export
  10392. */
  10393. exportName?: string;
  10394. }): string;
  10395. throwMissingModuleErrorBlock(__0: {
  10396. /**
  10397. * request string used originally
  10398. */
  10399. request?: string;
  10400. }): string;
  10401. throwMissingModuleErrorFunction(__0: {
  10402. /**
  10403. * request string used originally
  10404. */
  10405. request?: string;
  10406. }): string;
  10407. missingModule(__0: {
  10408. /**
  10409. * request string used originally
  10410. */
  10411. request?: string;
  10412. }): string;
  10413. missingModuleStatement(__0: {
  10414. /**
  10415. * request string used originally
  10416. */
  10417. request?: string;
  10418. }): string;
  10419. missingModulePromise(__0: {
  10420. /**
  10421. * request string used originally
  10422. */
  10423. request?: string;
  10424. }): string;
  10425. weakError(__0: {
  10426. /**
  10427. * the chunk graph
  10428. */
  10429. chunkGraph: ChunkGraph;
  10430. /**
  10431. * the module
  10432. */
  10433. module: Module;
  10434. /**
  10435. * the request that should be printed as comment
  10436. */
  10437. request: string;
  10438. /**
  10439. * expression to use as id expression
  10440. */
  10441. idExpr?: string;
  10442. /**
  10443. * which kind of code should be returned
  10444. */
  10445. type: "promise" | "expression" | "statements";
  10446. }): string;
  10447. moduleId(__0: {
  10448. /**
  10449. * the module
  10450. */
  10451. module: Module;
  10452. /**
  10453. * the chunk graph
  10454. */
  10455. chunkGraph: ChunkGraph;
  10456. /**
  10457. * the request that should be printed as comment
  10458. */
  10459. request: string;
  10460. /**
  10461. * if the dependency is weak (will create a nice error message)
  10462. */
  10463. weak?: boolean;
  10464. }): string;
  10465. moduleRaw(__0: {
  10466. /**
  10467. * the module
  10468. */
  10469. module: null | Module;
  10470. /**
  10471. * the chunk graph
  10472. */
  10473. chunkGraph: ChunkGraph;
  10474. /**
  10475. * the request that should be printed as comment
  10476. */
  10477. request: string;
  10478. /**
  10479. * if the dependency is weak (will create a nice error message)
  10480. */
  10481. weak?: boolean;
  10482. /**
  10483. * if set, will be filled with runtime requirements
  10484. */
  10485. runtimeRequirements: Set<string>;
  10486. }): string;
  10487. moduleExports(__0: {
  10488. /**
  10489. * the module
  10490. */
  10491. module: null | Module;
  10492. /**
  10493. * the chunk graph
  10494. */
  10495. chunkGraph: ChunkGraph;
  10496. /**
  10497. * the request that should be printed as comment
  10498. */
  10499. request: string;
  10500. /**
  10501. * if the dependency is weak (will create a nice error message)
  10502. */
  10503. weak?: boolean;
  10504. /**
  10505. * if set, will be filled with runtime requirements
  10506. */
  10507. runtimeRequirements: Set<string>;
  10508. }): string;
  10509. moduleNamespace(__0: {
  10510. /**
  10511. * the module
  10512. */
  10513. module: Module;
  10514. /**
  10515. * the chunk graph
  10516. */
  10517. chunkGraph: ChunkGraph;
  10518. /**
  10519. * the request that should be printed as comment
  10520. */
  10521. request: string;
  10522. /**
  10523. * if the current module is in strict esm mode
  10524. */
  10525. strict?: boolean;
  10526. /**
  10527. * if the dependency is weak (will create a nice error message)
  10528. */
  10529. weak?: boolean;
  10530. /**
  10531. * if set, will be filled with runtime requirements
  10532. */
  10533. runtimeRequirements: Set<string>;
  10534. }): string;
  10535. moduleNamespacePromise(__0: {
  10536. /**
  10537. * the chunk graph
  10538. */
  10539. chunkGraph: ChunkGraph;
  10540. /**
  10541. * the current dependencies block
  10542. */
  10543. block?: AsyncDependenciesBlock;
  10544. /**
  10545. * the module
  10546. */
  10547. module: Module;
  10548. /**
  10549. * the request that should be printed as comment
  10550. */
  10551. request: string;
  10552. /**
  10553. * a message for the comment
  10554. */
  10555. message: string;
  10556. /**
  10557. * if the current module is in strict esm mode
  10558. */
  10559. strict?: boolean;
  10560. /**
  10561. * if the dependency is weak (will create a nice error message)
  10562. */
  10563. weak?: boolean;
  10564. /**
  10565. * if set, will be filled with runtime requirements
  10566. */
  10567. runtimeRequirements: Set<string>;
  10568. }): string;
  10569. runtimeConditionExpression(__0: {
  10570. /**
  10571. * the chunk graph
  10572. */
  10573. chunkGraph: ChunkGraph;
  10574. /**
  10575. * runtime for which this code will be generated
  10576. */
  10577. runtime?: RuntimeSpec;
  10578. /**
  10579. * only execute the statement in some runtimes
  10580. */
  10581. runtimeCondition?: string | boolean | SortableSet<string>;
  10582. /**
  10583. * if set, will be filled with runtime requirements
  10584. */
  10585. runtimeRequirements: Set<string>;
  10586. }): string;
  10587. importStatement(__0: {
  10588. /**
  10589. * whether a new variable should be created or the existing one updated
  10590. */
  10591. update?: boolean;
  10592. /**
  10593. * the module
  10594. */
  10595. module: Module;
  10596. /**
  10597. * the chunk graph
  10598. */
  10599. chunkGraph: ChunkGraph;
  10600. /**
  10601. * the request that should be printed as comment
  10602. */
  10603. request: string;
  10604. /**
  10605. * name of the import variable
  10606. */
  10607. importVar: string;
  10608. /**
  10609. * module in which the statement is emitted
  10610. */
  10611. originModule: Module;
  10612. /**
  10613. * true, if this is a weak dependency
  10614. */
  10615. weak?: boolean;
  10616. /**
  10617. * if set, will be filled with runtime requirements
  10618. */
  10619. runtimeRequirements: Set<string>;
  10620. }): [string, string];
  10621. exportFromImport(__0: {
  10622. /**
  10623. * the module graph
  10624. */
  10625. moduleGraph: ModuleGraph;
  10626. /**
  10627. * the module
  10628. */
  10629. module: Module;
  10630. /**
  10631. * the request
  10632. */
  10633. request: string;
  10634. /**
  10635. * the export name
  10636. */
  10637. exportName: string | string[];
  10638. /**
  10639. * the origin module
  10640. */
  10641. originModule: Module;
  10642. /**
  10643. * true, if location is safe for ASI, a bracket can be emitted
  10644. */
  10645. asiSafe?: boolean;
  10646. /**
  10647. * true, if expression will be called
  10648. */
  10649. isCall: boolean;
  10650. /**
  10651. * when false, call context will not be preserved
  10652. */
  10653. callContext: null | boolean;
  10654. /**
  10655. * when true and accessing the default exports, interop code will be generated
  10656. */
  10657. defaultInterop: boolean;
  10658. /**
  10659. * the identifier name of the import variable
  10660. */
  10661. importVar: string;
  10662. /**
  10663. * init fragments will be added here
  10664. */
  10665. initFragments: InitFragment<any>[];
  10666. /**
  10667. * runtime for which this code will be generated
  10668. */
  10669. runtime: RuntimeSpec;
  10670. /**
  10671. * if set, will be filled with runtime requirements
  10672. */
  10673. runtimeRequirements: Set<string>;
  10674. }): string;
  10675. blockPromise(__0: {
  10676. /**
  10677. * the async block
  10678. */
  10679. block: AsyncDependenciesBlock;
  10680. /**
  10681. * the message
  10682. */
  10683. message: string;
  10684. /**
  10685. * the chunk graph
  10686. */
  10687. chunkGraph: ChunkGraph;
  10688. /**
  10689. * if set, will be filled with runtime requirements
  10690. */
  10691. runtimeRequirements: Set<string>;
  10692. }): string;
  10693. asyncModuleFactory(__0: {
  10694. /**
  10695. * the async block
  10696. */
  10697. block: AsyncDependenciesBlock;
  10698. /**
  10699. * the chunk graph
  10700. */
  10701. chunkGraph: ChunkGraph;
  10702. /**
  10703. * if set, will be filled with runtime requirements
  10704. */
  10705. runtimeRequirements: Set<string>;
  10706. /**
  10707. * request string used originally
  10708. */
  10709. request?: string;
  10710. }): string;
  10711. syncModuleFactory(__0: {
  10712. /**
  10713. * the dependency
  10714. */
  10715. dependency: Dependency;
  10716. /**
  10717. * the chunk graph
  10718. */
  10719. chunkGraph: ChunkGraph;
  10720. /**
  10721. * if set, will be filled with runtime requirements
  10722. */
  10723. runtimeRequirements: Set<string>;
  10724. /**
  10725. * request string used originally
  10726. */
  10727. request?: string;
  10728. }): string;
  10729. defineEsModuleFlagStatement(__0: {
  10730. /**
  10731. * the name of the exports object
  10732. */
  10733. exportsArgument: string;
  10734. /**
  10735. * if set, will be filled with runtime requirements
  10736. */
  10737. runtimeRequirements: Set<string>;
  10738. }): string;
  10739. assetUrl(__0: {
  10740. /**
  10741. * the module
  10742. */
  10743. module: Module;
  10744. /**
  10745. * the public path
  10746. */
  10747. publicPath: string;
  10748. /**
  10749. * runtime
  10750. */
  10751. runtime?: RuntimeSpec;
  10752. /**
  10753. * the code generation results
  10754. */
  10755. codeGenerationResults: CodeGenerationResults;
  10756. }): string;
  10757. }
  10758. declare abstract class RuntimeValue {
  10759. fn: (arg0: {
  10760. module: NormalModule;
  10761. key: string;
  10762. readonly version?: string;
  10763. }) => CodeValuePrimitive;
  10764. options: true | RuntimeValueOptions;
  10765. get fileDependencies(): true | string[];
  10766. exec(
  10767. parser: JavascriptParser,
  10768. valueCacheVersions: Map<string, string | Set<string>>,
  10769. key: string
  10770. ): CodeValuePrimitive;
  10771. getCacheVersion(): undefined | string;
  10772. }
  10773. declare interface RuntimeValueOptions {
  10774. fileDependencies?: string[];
  10775. contextDependencies?: string[];
  10776. missingDependencies?: string[];
  10777. buildDependencies?: string[];
  10778. version?: string | (() => string);
  10779. }
  10780. /**
  10781. * Helper function for joining two ranges into a single range. This is useful
  10782. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  10783. * to create the range of the _parent node_.
  10784. */
  10785. declare interface ScopeInfo {
  10786. definitions: StackedMap<string, ScopeInfo | VariableInfo>;
  10787. topLevelScope: boolean | "arrow";
  10788. inShorthand: string | boolean;
  10789. inTaggedTemplateTag: boolean;
  10790. inTry: boolean;
  10791. isStrict: boolean;
  10792. isAsmJs: boolean;
  10793. }
  10794. declare interface Selector<A, B> {
  10795. (input: A): B;
  10796. }
  10797. declare abstract class Serializer {
  10798. serializeMiddlewares: any;
  10799. deserializeMiddlewares: any;
  10800. context: any;
  10801. serialize(obj?: any, context?: any): any;
  10802. deserialize(value?: any, context?: any): any;
  10803. }
  10804. type ServerOptionsHttps<
  10805. Request extends typeof IncomingMessage = typeof IncomingMessage,
  10806. Response extends typeof ServerResponse = typeof ServerResponse
  10807. > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
  10808. declare class SharePlugin {
  10809. constructor(options: SharePluginOptions);
  10810. /**
  10811. * Apply the plugin
  10812. */
  10813. apply(compiler: Compiler): void;
  10814. }
  10815. /**
  10816. * Options for shared modules.
  10817. */
  10818. declare interface SharePluginOptions {
  10819. /**
  10820. * Share scope name used for all shared modules (defaults to 'default').
  10821. */
  10822. shareScope?: string;
  10823. /**
  10824. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  10825. */
  10826. shared: Shared;
  10827. }
  10828. type Shared = (string | SharedObject)[] | SharedObject;
  10829. /**
  10830. * Advanced configuration for modules that should be shared in the share scope.
  10831. */
  10832. declare interface SharedConfig {
  10833. /**
  10834. * Include the provided and fallback module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.
  10835. */
  10836. eager?: boolean;
  10837. /**
  10838. * Provided module that should be provided to share scope. Also acts as fallback module if no shared module is found in share scope or version isn't valid. Defaults to the property name.
  10839. */
  10840. import?: string | false;
  10841. /**
  10842. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  10843. */
  10844. packageName?: string;
  10845. /**
  10846. * Version requirement from module in share scope.
  10847. */
  10848. requiredVersion?: string | false;
  10849. /**
  10850. * Module is looked up under this key from the share scope.
  10851. */
  10852. shareKey?: string;
  10853. /**
  10854. * Share scope name.
  10855. */
  10856. shareScope?: string;
  10857. /**
  10858. * Allow only a single version of the shared module in share scope (disabled by default).
  10859. */
  10860. singleton?: boolean;
  10861. /**
  10862. * Do not accept shared module if version is not valid (defaults to yes, if local fallback module is available and shared module is not a singleton, otherwise no, has no effect if there is no required version specified).
  10863. */
  10864. strictVersion?: boolean;
  10865. /**
  10866. * Version of the provided module. Will replace lower matching versions, but not higher.
  10867. */
  10868. version?: string | false;
  10869. }
  10870. /**
  10871. * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
  10872. */
  10873. declare interface SharedObject {
  10874. [index: string]: string | SharedConfig;
  10875. }
  10876. declare class SideEffectsFlagPlugin {
  10877. constructor(analyseSource?: boolean);
  10878. /**
  10879. * Apply the plugin
  10880. */
  10881. apply(compiler: Compiler): void;
  10882. static moduleHasSideEffects(
  10883. moduleName: string,
  10884. flagValue: undefined | string | boolean | string[],
  10885. cache: Map<string, RegExp>
  10886. ): undefined | boolean;
  10887. }
  10888. declare class SizeOnlySource extends Source {
  10889. constructor(size: number);
  10890. }
  10891. declare abstract class Snapshot {
  10892. startTime?: number;
  10893. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  10894. fileHashes?: Map<string, null | string>;
  10895. fileTshs?: Map<string, null | string | TimestampAndHash>;
  10896. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  10897. contextHashes?: Map<string, null | string>;
  10898. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  10899. missingExistence?: Map<string, boolean>;
  10900. managedItemInfo?: Map<string, string>;
  10901. managedFiles?: Set<string>;
  10902. managedContexts?: Set<string>;
  10903. managedMissing?: Set<string>;
  10904. children?: Set<Snapshot>;
  10905. hasStartTime(): boolean;
  10906. setStartTime(value?: any): void;
  10907. setMergedStartTime(value?: any, snapshot?: any): void;
  10908. hasFileTimestamps(): boolean;
  10909. setFileTimestamps(value?: any): void;
  10910. hasFileHashes(): boolean;
  10911. setFileHashes(value?: any): void;
  10912. hasFileTshs(): boolean;
  10913. setFileTshs(value?: any): void;
  10914. hasContextTimestamps(): boolean;
  10915. setContextTimestamps(value?: any): void;
  10916. hasContextHashes(): boolean;
  10917. setContextHashes(value?: any): void;
  10918. hasContextTshs(): boolean;
  10919. setContextTshs(value?: any): void;
  10920. hasMissingExistence(): boolean;
  10921. setMissingExistence(value?: any): void;
  10922. hasManagedItemInfo(): boolean;
  10923. setManagedItemInfo(value?: any): void;
  10924. hasManagedFiles(): boolean;
  10925. setManagedFiles(value?: any): void;
  10926. hasManagedContexts(): boolean;
  10927. setManagedContexts(value?: any): void;
  10928. hasManagedMissing(): boolean;
  10929. setManagedMissing(value?: any): void;
  10930. hasChildren(): boolean;
  10931. setChildren(value?: any): void;
  10932. addChild(child?: any): void;
  10933. serialize(__0: ObjectSerializerContext): void;
  10934. deserialize(__0: ObjectDeserializerContext): void;
  10935. getFileIterable(): Iterable<string>;
  10936. getContextIterable(): Iterable<string>;
  10937. getMissingIterable(): Iterable<string>;
  10938. }
  10939. declare interface SnapshotOptionsFileSystemInfo {
  10940. /**
  10941. * should use hash to snapshot
  10942. */
  10943. hash?: boolean;
  10944. /**
  10945. * should use timestamp to snapshot
  10946. */
  10947. timestamp?: boolean;
  10948. }
  10949. /**
  10950. * Options affecting how file system snapshots are created and validated.
  10951. */
  10952. declare interface SnapshotOptionsWebpackOptions {
  10953. /**
  10954. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  10955. */
  10956. buildDependencies?: {
  10957. /**
  10958. * Use hashes of the content of the files/directories to determine invalidation.
  10959. */
  10960. hash?: boolean;
  10961. /**
  10962. * Use timestamps of the files/directories to determine invalidation.
  10963. */
  10964. timestamp?: boolean;
  10965. };
  10966. /**
  10967. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  10968. */
  10969. immutablePaths?: (string | RegExp)[];
  10970. /**
  10971. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  10972. */
  10973. managedPaths?: (string | RegExp)[];
  10974. /**
  10975. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  10976. */
  10977. module?: {
  10978. /**
  10979. * Use hashes of the content of the files/directories to determine invalidation.
  10980. */
  10981. hash?: boolean;
  10982. /**
  10983. * Use timestamps of the files/directories to determine invalidation.
  10984. */
  10985. timestamp?: boolean;
  10986. };
  10987. /**
  10988. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  10989. */
  10990. resolve?: {
  10991. /**
  10992. * Use hashes of the content of the files/directories to determine invalidation.
  10993. */
  10994. hash?: boolean;
  10995. /**
  10996. * Use timestamps of the files/directories to determine invalidation.
  10997. */
  10998. timestamp?: boolean;
  10999. };
  11000. /**
  11001. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  11002. */
  11003. resolveBuildDependencies?: {
  11004. /**
  11005. * Use hashes of the content of the files/directories to determine invalidation.
  11006. */
  11007. hash?: boolean;
  11008. /**
  11009. * Use timestamps of the files/directories to determine invalidation.
  11010. */
  11011. timestamp?: boolean;
  11012. };
  11013. }
  11014. declare abstract class SortableSet<T> extends Set<T> {
  11015. /**
  11016. * Sort with a comparer function
  11017. */
  11018. sortWith(sortFn: (arg0: T, arg1: T) => number): void;
  11019. sort(): SortableSet<T>;
  11020. /**
  11021. * Get data from cache
  11022. */
  11023. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  11024. /**
  11025. * Get data from cache (ignoring sorting)
  11026. */
  11027. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  11028. toJSON(): T[];
  11029. /**
  11030. * Iterates over values in the set.
  11031. */
  11032. [Symbol.iterator](): IterableIterator<T>;
  11033. }
  11034. declare class Source {
  11035. constructor();
  11036. size(): number;
  11037. map(options?: MapOptions): null | RawSourceMap;
  11038. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  11039. updateHash(hash: Hash): void;
  11040. source(): string | Buffer;
  11041. buffer(): Buffer;
  11042. }
  11043. declare interface SourceLike {
  11044. source(): string | Buffer;
  11045. }
  11046. declare interface SourceMap {
  11047. version: number;
  11048. sources: string[];
  11049. mappings: string;
  11050. file?: string;
  11051. sourceRoot?: string;
  11052. sourcesContent?: string[];
  11053. names?: string[];
  11054. }
  11055. declare class SourceMapDevToolPlugin {
  11056. constructor(options?: SourceMapDevToolPluginOptions);
  11057. sourceMapFilename: string | false;
  11058. sourceMappingURLComment:
  11059. | string
  11060. | false
  11061. | ((arg0: PathData, arg1?: AssetInfo) => string);
  11062. moduleFilenameTemplate: string | Function;
  11063. fallbackModuleFilenameTemplate: string | Function;
  11064. namespace: string;
  11065. options: SourceMapDevToolPluginOptions;
  11066. /**
  11067. * Apply the plugin
  11068. */
  11069. apply(compiler: Compiler): void;
  11070. }
  11071. declare interface SourceMapDevToolPluginOptions {
  11072. /**
  11073. * Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
  11074. */
  11075. append?:
  11076. | null
  11077. | string
  11078. | false
  11079. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  11080. /**
  11081. * Indicates whether column mappings should be used (defaults to true).
  11082. */
  11083. columns?: boolean;
  11084. /**
  11085. * Exclude modules that match the given value from source map generation.
  11086. */
  11087. exclude?: string | RegExp | Rule[];
  11088. /**
  11089. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
  11090. */
  11091. fallbackModuleFilenameTemplate?: string | Function;
  11092. /**
  11093. * Path prefix to which the [file] placeholder is relative to.
  11094. */
  11095. fileContext?: string;
  11096. /**
  11097. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  11098. */
  11099. filename?: null | string | false;
  11100. /**
  11101. * Include source maps for module paths that match the given value.
  11102. */
  11103. include?: string | RegExp | Rule[];
  11104. /**
  11105. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  11106. */
  11107. module?: boolean;
  11108. /**
  11109. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  11110. */
  11111. moduleFilenameTemplate?: string | Function;
  11112. /**
  11113. * Namespace prefix to allow multiple webpack roots in the devtools.
  11114. */
  11115. namespace?: string;
  11116. /**
  11117. * Omit the 'sourceContents' array from the SourceMap.
  11118. */
  11119. noSources?: boolean;
  11120. /**
  11121. * Provide a custom public path for the SourceMapping comment.
  11122. */
  11123. publicPath?: string;
  11124. /**
  11125. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  11126. */
  11127. sourceRoot?: string;
  11128. /**
  11129. * Include source maps for modules based on their extension (defaults to .js and .css).
  11130. */
  11131. test?: string | RegExp | Rule[];
  11132. }
  11133. declare class SourceMapSource extends Source {
  11134. constructor(
  11135. source: string | Buffer,
  11136. name: string,
  11137. sourceMap: string | Object | Buffer,
  11138. originalSource?: string | Buffer,
  11139. innerSourceMap?: string | Object | Buffer,
  11140. removeOriginalSource?: boolean
  11141. );
  11142. getArgsAsBuffers(): [
  11143. Buffer,
  11144. string,
  11145. Buffer,
  11146. undefined | Buffer,
  11147. undefined | Buffer,
  11148. boolean
  11149. ];
  11150. }
  11151. declare interface SourcePosition {
  11152. line: number;
  11153. column?: number;
  11154. }
  11155. declare interface SplitChunksOptions {
  11156. chunksFilter: (chunk: Chunk) => undefined | boolean;
  11157. defaultSizeTypes: string[];
  11158. minSize: SplitChunksSizes;
  11159. minSizeReduction: SplitChunksSizes;
  11160. minRemainingSize: SplitChunksSizes;
  11161. enforceSizeThreshold: SplitChunksSizes;
  11162. maxInitialSize: SplitChunksSizes;
  11163. maxAsyncSize: SplitChunksSizes;
  11164. minChunks: number;
  11165. maxAsyncRequests: number;
  11166. maxInitialRequests: number;
  11167. hidePathInfo: boolean;
  11168. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  11169. automaticNameDelimiter: string;
  11170. getCacheGroups: (
  11171. module: Module,
  11172. context: CacheGroupsContext
  11173. ) => CacheGroupSource[];
  11174. getName: (
  11175. module?: Module,
  11176. chunks?: Chunk[],
  11177. key?: string
  11178. ) => undefined | string;
  11179. usedExports: boolean;
  11180. fallbackCacheGroup: FallbackCacheGroup;
  11181. }
  11182. declare class SplitChunksPlugin {
  11183. constructor(options?: OptimizationSplitChunksOptions);
  11184. options: SplitChunksOptions;
  11185. /**
  11186. * Apply the plugin
  11187. */
  11188. apply(compiler: Compiler): void;
  11189. }
  11190. declare interface SplitChunksSizes {
  11191. [index: string]: number;
  11192. }
  11193. declare abstract class StackedMap<K, V> {
  11194. map: Map<K, InternalCell<V>>;
  11195. stack: Map<K, InternalCell<V>>[];
  11196. set(item: K, value: V): void;
  11197. delete(item: K): void;
  11198. has(item: K): boolean;
  11199. get(item: K): Cell<V>;
  11200. asArray(): K[];
  11201. asSet(): Set<K>;
  11202. asPairArray(): [K, Cell<V>][];
  11203. asMap(): Map<K, Cell<V>>;
  11204. get size(): number;
  11205. createChild(): StackedMap<K, V>;
  11206. }
  11207. type StartupRenderContext = RenderContext & { inlined: boolean };
  11208. type Statement =
  11209. | FunctionDeclaration
  11210. | VariableDeclaration
  11211. | ClassDeclaration
  11212. | ExpressionStatement
  11213. | BlockStatement
  11214. | StaticBlock
  11215. | EmptyStatement
  11216. | DebuggerStatement
  11217. | WithStatement
  11218. | ReturnStatement
  11219. | LabeledStatement
  11220. | BreakStatement
  11221. | ContinueStatement
  11222. | IfStatement
  11223. | SwitchStatement
  11224. | ThrowStatement
  11225. | TryStatement
  11226. | WhileStatement
  11227. | DoWhileStatement
  11228. | ForStatement
  11229. | ForInStatement
  11230. | ForOfStatement;
  11231. declare class Stats {
  11232. constructor(compilation: Compilation);
  11233. compilation: Compilation;
  11234. get hash(): string;
  11235. get startTime(): any;
  11236. get endTime(): any;
  11237. hasWarnings(): boolean;
  11238. hasErrors(): boolean;
  11239. toJson(options?: string | StatsOptions): StatsCompilation;
  11240. toString(options?: any): string;
  11241. }
  11242. type StatsAsset = KnownStatsAsset & Record<string, any>;
  11243. type StatsChunk = KnownStatsChunk & Record<string, any>;
  11244. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  11245. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  11246. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  11247. type StatsError = KnownStatsError & Record<string, any>;
  11248. declare abstract class StatsFactory {
  11249. hooks: Readonly<{
  11250. extract: HookMap<SyncBailHook<[Object, any, StatsFactoryContext], any>>;
  11251. filter: HookMap<
  11252. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  11253. >;
  11254. sort: HookMap<
  11255. SyncBailHook<
  11256. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  11257. any
  11258. >
  11259. >;
  11260. filterSorted: HookMap<
  11261. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  11262. >;
  11263. groupResults: HookMap<
  11264. SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
  11265. >;
  11266. sortResults: HookMap<
  11267. SyncBailHook<
  11268. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  11269. any
  11270. >
  11271. >;
  11272. filterResults: HookMap<
  11273. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  11274. >;
  11275. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  11276. result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  11277. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  11278. getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  11279. }>;
  11280. create(
  11281. type: string,
  11282. data: any,
  11283. baseContext: Omit<StatsFactoryContext, "type">
  11284. ): any;
  11285. }
  11286. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  11287. type StatsLogging = KnownStatsLogging & Record<string, any>;
  11288. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  11289. type StatsModule = KnownStatsModule & Record<string, any>;
  11290. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  11291. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  11292. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  11293. Record<string, any>;
  11294. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  11295. /**
  11296. * Stats options object.
  11297. */
  11298. declare interface StatsOptions {
  11299. /**
  11300. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  11301. */
  11302. all?: boolean;
  11303. /**
  11304. * Add assets information.
  11305. */
  11306. assets?: boolean;
  11307. /**
  11308. * Sort the assets by that field.
  11309. */
  11310. assetsSort?: string;
  11311. /**
  11312. * Space to display assets (groups will be collapsed to fit this space).
  11313. */
  11314. assetsSpace?: number;
  11315. /**
  11316. * Add built at time information.
  11317. */
  11318. builtAt?: boolean;
  11319. /**
  11320. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  11321. */
  11322. cached?: boolean;
  11323. /**
  11324. * Show cached assets (setting this to `false` only shows emitted files).
  11325. */
  11326. cachedAssets?: boolean;
  11327. /**
  11328. * Add information about cached (not built) modules.
  11329. */
  11330. cachedModules?: boolean;
  11331. /**
  11332. * Add children information.
  11333. */
  11334. children?: boolean;
  11335. /**
  11336. * Display auxiliary assets in chunk groups.
  11337. */
  11338. chunkGroupAuxiliary?: boolean;
  11339. /**
  11340. * Display children of chunk groups.
  11341. */
  11342. chunkGroupChildren?: boolean;
  11343. /**
  11344. * Limit of assets displayed in chunk groups.
  11345. */
  11346. chunkGroupMaxAssets?: number;
  11347. /**
  11348. * Display all chunk groups with the corresponding bundles.
  11349. */
  11350. chunkGroups?: boolean;
  11351. /**
  11352. * Add built modules information to chunk information.
  11353. */
  11354. chunkModules?: boolean;
  11355. /**
  11356. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  11357. */
  11358. chunkModulesSpace?: number;
  11359. /**
  11360. * Add the origins of chunks and chunk merging info.
  11361. */
  11362. chunkOrigins?: boolean;
  11363. /**
  11364. * Add information about parent, children and sibling chunks to chunk information.
  11365. */
  11366. chunkRelations?: boolean;
  11367. /**
  11368. * Add chunk information.
  11369. */
  11370. chunks?: boolean;
  11371. /**
  11372. * Sort the chunks by that field.
  11373. */
  11374. chunksSort?: string;
  11375. /**
  11376. * Enables/Disables colorful output.
  11377. */
  11378. colors?:
  11379. | boolean
  11380. | {
  11381. /**
  11382. * Custom color for bold text.
  11383. */
  11384. bold?: string;
  11385. /**
  11386. * Custom color for cyan text.
  11387. */
  11388. cyan?: string;
  11389. /**
  11390. * Custom color for green text.
  11391. */
  11392. green?: string;
  11393. /**
  11394. * Custom color for magenta text.
  11395. */
  11396. magenta?: string;
  11397. /**
  11398. * Custom color for red text.
  11399. */
  11400. red?: string;
  11401. /**
  11402. * Custom color for yellow text.
  11403. */
  11404. yellow?: string;
  11405. };
  11406. /**
  11407. * Context directory for request shortening.
  11408. */
  11409. context?: string;
  11410. /**
  11411. * Show chunk modules that are dependencies of other modules of the chunk.
  11412. */
  11413. dependentModules?: boolean;
  11414. /**
  11415. * Add module depth in module graph.
  11416. */
  11417. depth?: boolean;
  11418. /**
  11419. * Display the entry points with the corresponding bundles.
  11420. */
  11421. entrypoints?: boolean | "auto";
  11422. /**
  11423. * Add --env information.
  11424. */
  11425. env?: boolean;
  11426. /**
  11427. * Add details to errors (like resolving log).
  11428. */
  11429. errorDetails?: boolean | "auto";
  11430. /**
  11431. * Add internal stack trace to errors.
  11432. */
  11433. errorStack?: boolean;
  11434. /**
  11435. * Add errors.
  11436. */
  11437. errors?: boolean;
  11438. /**
  11439. * Add errors count.
  11440. */
  11441. errorsCount?: boolean;
  11442. /**
  11443. * Space to display errors (value is in number of lines).
  11444. */
  11445. errorsSpace?: number;
  11446. /**
  11447. * Please use excludeModules instead.
  11448. */
  11449. exclude?:
  11450. | string
  11451. | boolean
  11452. | RegExp
  11453. | ModuleFilterItemTypes[]
  11454. | ((
  11455. name: string,
  11456. module: StatsModule,
  11457. type: "module" | "chunk" | "root-of-chunk" | "nested"
  11458. ) => boolean);
  11459. /**
  11460. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  11461. */
  11462. excludeAssets?:
  11463. | string
  11464. | RegExp
  11465. | AssetFilterItemTypes[]
  11466. | ((name: string, asset: StatsAsset) => boolean);
  11467. /**
  11468. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  11469. */
  11470. excludeModules?:
  11471. | string
  11472. | boolean
  11473. | RegExp
  11474. | ModuleFilterItemTypes[]
  11475. | ((
  11476. name: string,
  11477. module: StatsModule,
  11478. type: "module" | "chunk" | "root-of-chunk" | "nested"
  11479. ) => boolean);
  11480. /**
  11481. * Group assets by how their are related to chunks.
  11482. */
  11483. groupAssetsByChunk?: boolean;
  11484. /**
  11485. * Group assets by their status (emitted, compared for emit or cached).
  11486. */
  11487. groupAssetsByEmitStatus?: boolean;
  11488. /**
  11489. * Group assets by their extension.
  11490. */
  11491. groupAssetsByExtension?: boolean;
  11492. /**
  11493. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  11494. */
  11495. groupAssetsByInfo?: boolean;
  11496. /**
  11497. * Group assets by their path.
  11498. */
  11499. groupAssetsByPath?: boolean;
  11500. /**
  11501. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  11502. */
  11503. groupModulesByAttributes?: boolean;
  11504. /**
  11505. * Group modules by their status (cached or built and cacheable).
  11506. */
  11507. groupModulesByCacheStatus?: boolean;
  11508. /**
  11509. * Group modules by their extension.
  11510. */
  11511. groupModulesByExtension?: boolean;
  11512. /**
  11513. * Group modules by their layer.
  11514. */
  11515. groupModulesByLayer?: boolean;
  11516. /**
  11517. * Group modules by their path.
  11518. */
  11519. groupModulesByPath?: boolean;
  11520. /**
  11521. * Group modules by their type.
  11522. */
  11523. groupModulesByType?: boolean;
  11524. /**
  11525. * Group reasons by their origin module.
  11526. */
  11527. groupReasonsByOrigin?: boolean;
  11528. /**
  11529. * Add the hash of the compilation.
  11530. */
  11531. hash?: boolean;
  11532. /**
  11533. * Add ids.
  11534. */
  11535. ids?: boolean;
  11536. /**
  11537. * Add logging output.
  11538. */
  11539. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  11540. /**
  11541. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  11542. */
  11543. loggingDebug?:
  11544. | string
  11545. | boolean
  11546. | RegExp
  11547. | FilterItemTypes[]
  11548. | ((value: string) => boolean);
  11549. /**
  11550. * Add stack traces to logging output.
  11551. */
  11552. loggingTrace?: boolean;
  11553. /**
  11554. * Add information about assets inside modules.
  11555. */
  11556. moduleAssets?: boolean;
  11557. /**
  11558. * Add dependencies and origin of warnings/errors.
  11559. */
  11560. moduleTrace?: boolean;
  11561. /**
  11562. * Add built modules information.
  11563. */
  11564. modules?: boolean;
  11565. /**
  11566. * Sort the modules by that field.
  11567. */
  11568. modulesSort?: string;
  11569. /**
  11570. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  11571. */
  11572. modulesSpace?: number;
  11573. /**
  11574. * Add information about modules nested in other modules (like with module concatenation).
  11575. */
  11576. nestedModules?: boolean;
  11577. /**
  11578. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  11579. */
  11580. nestedModulesSpace?: number;
  11581. /**
  11582. * Show reasons why optimization bailed out for modules.
  11583. */
  11584. optimizationBailout?: boolean;
  11585. /**
  11586. * Add information about orphan modules.
  11587. */
  11588. orphanModules?: boolean;
  11589. /**
  11590. * Add output path information.
  11591. */
  11592. outputPath?: boolean;
  11593. /**
  11594. * Add performance hint flags.
  11595. */
  11596. performance?: boolean;
  11597. /**
  11598. * Preset for the default values.
  11599. */
  11600. preset?: string | boolean;
  11601. /**
  11602. * Show exports provided by modules.
  11603. */
  11604. providedExports?: boolean;
  11605. /**
  11606. * Add public path information.
  11607. */
  11608. publicPath?: boolean;
  11609. /**
  11610. * Add information about the reasons why modules are included.
  11611. */
  11612. reasons?: boolean;
  11613. /**
  11614. * Space to display reasons (groups will be collapsed to fit this space).
  11615. */
  11616. reasonsSpace?: number;
  11617. /**
  11618. * Add information about assets that are related to other assets (like SourceMaps for assets).
  11619. */
  11620. relatedAssets?: boolean;
  11621. /**
  11622. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  11623. */
  11624. runtime?: boolean;
  11625. /**
  11626. * Add information about runtime modules.
  11627. */
  11628. runtimeModules?: boolean;
  11629. /**
  11630. * Add the source code of modules.
  11631. */
  11632. source?: boolean;
  11633. /**
  11634. * Add timing information.
  11635. */
  11636. timings?: boolean;
  11637. /**
  11638. * Show exports used by modules.
  11639. */
  11640. usedExports?: boolean;
  11641. /**
  11642. * Add webpack version information.
  11643. */
  11644. version?: boolean;
  11645. /**
  11646. * Add warnings.
  11647. */
  11648. warnings?: boolean;
  11649. /**
  11650. * Add warnings count.
  11651. */
  11652. warningsCount?: boolean;
  11653. /**
  11654. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  11655. */
  11656. warningsFilter?:
  11657. | string
  11658. | RegExp
  11659. | WarningFilterItemTypes[]
  11660. | ((warning: StatsError, value: string) => boolean);
  11661. /**
  11662. * Space to display warnings (value is in number of lines).
  11663. */
  11664. warningsSpace?: number;
  11665. }
  11666. declare abstract class StatsPrinter {
  11667. hooks: Readonly<{
  11668. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
  11669. printElements: HookMap<
  11670. SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
  11671. >;
  11672. sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
  11673. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
  11674. printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
  11675. print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
  11676. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  11677. }>;
  11678. print(type: string, object: Object, baseContext?: Object): string;
  11679. }
  11680. type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
  11681. type StatsProfile = KnownStatsProfile & Record<string, any>;
  11682. type StatsValue =
  11683. | boolean
  11684. | StatsOptions
  11685. | "none"
  11686. | "verbose"
  11687. | "summary"
  11688. | "errors-only"
  11689. | "errors-warnings"
  11690. | "minimal"
  11691. | "normal"
  11692. | "detailed";
  11693. declare class SyncModuleIdsPlugin {
  11694. constructor(__0: {
  11695. /**
  11696. * path to file
  11697. */
  11698. path: string;
  11699. /**
  11700. * context for module names
  11701. */
  11702. context?: string;
  11703. /**
  11704. * selector for modules
  11705. */
  11706. test: (arg0: Module) => boolean;
  11707. /**
  11708. * operation mode (defaults to merge)
  11709. */
  11710. mode?: "read" | "merge" | "create" | "update";
  11711. });
  11712. /**
  11713. * Apply the plugin
  11714. */
  11715. apply(compiler: Compiler): void;
  11716. }
  11717. declare interface SyntheticDependencyLocation {
  11718. name: string;
  11719. index?: number;
  11720. }
  11721. declare const TOMBSTONE: unique symbol;
  11722. declare const TRANSITIVE: unique symbol;
  11723. declare const TRANSITIVE_ONLY: unique symbol;
  11724. /**
  11725. * Helper function for joining two ranges into a single range. This is useful
  11726. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  11727. * to create the range of the _parent node_.
  11728. */
  11729. declare interface TagInfo {
  11730. tag: any;
  11731. data: any;
  11732. next?: TagInfo;
  11733. }
  11734. declare class Template {
  11735. constructor();
  11736. static getFunctionContent(fn: Function): string;
  11737. static toIdentifier(str: string): string;
  11738. static toComment(str: string): string;
  11739. static toNormalComment(str: string): string;
  11740. static toPath(str: string): string;
  11741. static numberToIdentifier(n: number): string;
  11742. static numberToIdentifierContinuation(n: number): string;
  11743. static indent(s: string | string[]): string;
  11744. static prefix(s: string | string[], prefix: string): string;
  11745. static asString(str: string | string[]): string;
  11746. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  11747. static renderChunkModules(
  11748. renderContext: ChunkRenderContext,
  11749. modules: Module[],
  11750. renderModule: (arg0: Module) => Source,
  11751. prefix?: string
  11752. ): null | Source;
  11753. static renderRuntimeModules(
  11754. runtimeModules: RuntimeModule[],
  11755. renderContext: RenderContext & {
  11756. codeGenerationResults?: CodeGenerationResults;
  11757. }
  11758. ): Source;
  11759. static renderChunkRuntimeModules(
  11760. runtimeModules: RuntimeModule[],
  11761. renderContext: RenderContext
  11762. ): Source;
  11763. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  11764. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  11765. }
  11766. declare interface TimestampAndHash {
  11767. safeTime: number;
  11768. timestamp?: number;
  11769. hash: string;
  11770. }
  11771. declare class TopLevelSymbol {
  11772. constructor(name: string);
  11773. name: string;
  11774. }
  11775. /**
  11776. * Use a Trusted Types policy to create urls for chunks.
  11777. */
  11778. declare interface TrustedTypes {
  11779. /**
  11780. * If the call to `trustedTypes.createPolicy(...)` fails -- e.g., due to the policy name missing from the CSP `trusted-types` list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that `require-trusted-types-for 'script'` isn't enforced yet, versus fail immediately. Default behavior is 'stop'.
  11781. */
  11782. onPolicyCreationFailure?: "continue" | "stop";
  11783. /**
  11784. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  11785. */
  11786. policyName?: string;
  11787. }
  11788. declare const UNDEFINED_MARKER: unique symbol;
  11789. declare interface UpdateHashContextDependency {
  11790. chunkGraph: ChunkGraph;
  11791. runtime: RuntimeSpec;
  11792. runtimeTemplate?: RuntimeTemplate;
  11793. }
  11794. declare interface UpdateHashContextGenerator {
  11795. /**
  11796. * the module
  11797. */
  11798. module: NormalModule;
  11799. chunkGraph: ChunkGraph;
  11800. runtime: RuntimeSpec;
  11801. runtimeTemplate?: RuntimeTemplate;
  11802. }
  11803. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  11804. declare interface UserResolveOptions {
  11805. /**
  11806. * A list of module alias configurations or an object which maps key to value
  11807. */
  11808. alias?: AliasOption[] | AliasOptions;
  11809. /**
  11810. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  11811. */
  11812. fallback?: AliasOption[] | AliasOptions;
  11813. /**
  11814. * An object which maps extension to extension aliases
  11815. */
  11816. extensionAlias?: ExtensionAliasOptions;
  11817. /**
  11818. * A list of alias fields in description files
  11819. */
  11820. aliasFields?: (string | string[])[];
  11821. /**
  11822. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  11823. */
  11824. cachePredicate?: (arg0: ResolveRequest) => boolean;
  11825. /**
  11826. * Whether or not the unsafeCache should include request context as part of the cache key.
  11827. */
  11828. cacheWithContext?: boolean;
  11829. /**
  11830. * A list of description files to read from
  11831. */
  11832. descriptionFiles?: string[];
  11833. /**
  11834. * A list of exports field condition names.
  11835. */
  11836. conditionNames?: string[];
  11837. /**
  11838. * Enforce that a extension from extensions must be used
  11839. */
  11840. enforceExtension?: boolean;
  11841. /**
  11842. * A list of exports fields in description files
  11843. */
  11844. exportsFields?: (string | string[])[];
  11845. /**
  11846. * A list of imports fields in description files
  11847. */
  11848. importsFields?: (string | string[])[];
  11849. /**
  11850. * A list of extensions which should be tried for files
  11851. */
  11852. extensions?: string[];
  11853. /**
  11854. * The file system which should be used
  11855. */
  11856. fileSystem: FileSystem;
  11857. /**
  11858. * Use this cache object to unsafely cache the successful requests
  11859. */
  11860. unsafeCache?: boolean | object;
  11861. /**
  11862. * Resolve symlinks to their symlinked location
  11863. */
  11864. symlinks?: boolean;
  11865. /**
  11866. * A prepared Resolver to which the plugins are attached
  11867. */
  11868. resolver?: Resolver;
  11869. /**
  11870. * A list of directories to resolve modules from, can be absolute path or folder name
  11871. */
  11872. modules?: string | string[];
  11873. /**
  11874. * A list of main fields in description files
  11875. */
  11876. mainFields?: (
  11877. | string
  11878. | string[]
  11879. | { name: string | string[]; forceRelative: boolean }
  11880. )[];
  11881. /**
  11882. * A list of main files in directories
  11883. */
  11884. mainFiles?: string[];
  11885. /**
  11886. * A list of additional resolve plugins which should be applied
  11887. */
  11888. plugins?: Plugin[];
  11889. /**
  11890. * A PnP API that should be used - null is "never", undefined is "auto"
  11891. */
  11892. pnpApi?: null | PnpApiImpl;
  11893. /**
  11894. * A list of root paths
  11895. */
  11896. roots?: string[];
  11897. /**
  11898. * The request is already fully specified and no extensions or directories are resolved for it
  11899. */
  11900. fullySpecified?: boolean;
  11901. /**
  11902. * Resolve to a context instead of a file
  11903. */
  11904. resolveToContext?: boolean;
  11905. /**
  11906. * A list of resolve restrictions
  11907. */
  11908. restrictions?: (string | RegExp)[];
  11909. /**
  11910. * Use only the sync constraints of the file system calls
  11911. */
  11912. useSyncFileSystemCalls?: boolean;
  11913. /**
  11914. * Prefer to resolve module requests as relative requests before falling back to modules
  11915. */
  11916. preferRelative?: boolean;
  11917. /**
  11918. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  11919. */
  11920. preferAbsolute?: boolean;
  11921. }
  11922. declare abstract class VariableInfo {
  11923. declaredScope: ScopeInfo;
  11924. freeName?: string | true;
  11925. tagInfo?: TagInfo;
  11926. }
  11927. declare interface VariableInfoInterface {
  11928. declaredScope: ScopeInfo;
  11929. freeName: string | true;
  11930. tagInfo?: TagInfo;
  11931. }
  11932. type WarningFilterItemTypes =
  11933. | string
  11934. | RegExp
  11935. | ((warning: StatsError, value: string) => boolean);
  11936. declare interface WatchFileSystem {
  11937. watch: (
  11938. files: Iterable<string>,
  11939. directories: Iterable<string>,
  11940. missing: Iterable<string>,
  11941. startTime: number,
  11942. options: WatchOptions,
  11943. callback: (
  11944. arg0: undefined | Error,
  11945. arg1: Map<string, FileSystemInfoEntry | "ignore">,
  11946. arg2: Map<string, FileSystemInfoEntry | "ignore">,
  11947. arg3: Set<string>,
  11948. arg4: Set<string>
  11949. ) => void,
  11950. callbackUndelayed: (arg0: string, arg1: number) => void
  11951. ) => Watcher;
  11952. }
  11953. declare class WatchIgnorePlugin {
  11954. constructor(options: WatchIgnorePluginOptions);
  11955. paths: (string | RegExp)[];
  11956. /**
  11957. * Apply the plugin
  11958. */
  11959. apply(compiler: Compiler): void;
  11960. }
  11961. declare interface WatchIgnorePluginOptions {
  11962. /**
  11963. * A list of RegExps or absolute paths to directories or files that should be ignored.
  11964. */
  11965. paths: (string | RegExp)[];
  11966. }
  11967. /**
  11968. * Options for the watcher.
  11969. */
  11970. declare interface WatchOptions {
  11971. /**
  11972. * Delay the rebuilt after the first change. Value is a time in ms.
  11973. */
  11974. aggregateTimeout?: number;
  11975. /**
  11976. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  11977. */
  11978. followSymlinks?: boolean;
  11979. /**
  11980. * Ignore some files from watching (glob pattern or regexp).
  11981. */
  11982. ignored?: string | RegExp | string[];
  11983. /**
  11984. * Enable polling mode for watching.
  11985. */
  11986. poll?: number | boolean;
  11987. /**
  11988. * Stop watching when stdin stream has ended.
  11989. */
  11990. stdin?: boolean;
  11991. }
  11992. declare interface Watcher {
  11993. /**
  11994. * closes the watcher and all underlying file watchers
  11995. */
  11996. close: () => void;
  11997. /**
  11998. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  11999. */
  12000. pause: () => void;
  12001. /**
  12002. * get current aggregated changes that have not yet send to callback
  12003. */
  12004. getAggregatedChanges?: () => Set<string>;
  12005. /**
  12006. * get current aggregated removals that have not yet send to callback
  12007. */
  12008. getAggregatedRemovals?: () => Set<string>;
  12009. /**
  12010. * get info about files
  12011. */
  12012. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  12013. /**
  12014. * get info about directories
  12015. */
  12016. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  12017. /**
  12018. * get info about timestamps and changes
  12019. */
  12020. getInfo?: () => WatcherInfo;
  12021. }
  12022. declare interface WatcherInfo {
  12023. /**
  12024. * get current aggregated changes that have not yet send to callback
  12025. */
  12026. changes: Set<string>;
  12027. /**
  12028. * get current aggregated removals that have not yet send to callback
  12029. */
  12030. removals: Set<string>;
  12031. /**
  12032. * get info about files
  12033. */
  12034. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  12035. /**
  12036. * get info about directories
  12037. */
  12038. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  12039. }
  12040. declare abstract class Watching {
  12041. startTime: null | number;
  12042. invalid: boolean;
  12043. handler: CallbackFunction<Stats>;
  12044. callbacks: CallbackFunction<void>[];
  12045. closed: boolean;
  12046. suspended: boolean;
  12047. blocked: boolean;
  12048. watchOptions: {
  12049. /**
  12050. * Delay the rebuilt after the first change. Value is a time in ms.
  12051. */
  12052. aggregateTimeout?: number;
  12053. /**
  12054. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  12055. */
  12056. followSymlinks?: boolean;
  12057. /**
  12058. * Ignore some files from watching (glob pattern or regexp).
  12059. */
  12060. ignored?: string | RegExp | string[];
  12061. /**
  12062. * Enable polling mode for watching.
  12063. */
  12064. poll?: number | boolean;
  12065. /**
  12066. * Stop watching when stdin stream has ended.
  12067. */
  12068. stdin?: boolean;
  12069. };
  12070. compiler: Compiler;
  12071. running: boolean;
  12072. watcher?: null | Watcher;
  12073. pausedWatcher?: null | Watcher;
  12074. lastWatcherStartTime?: number;
  12075. watch(
  12076. files: Iterable<string>,
  12077. dirs: Iterable<string>,
  12078. missing: Iterable<string>
  12079. ): void;
  12080. invalidate(callback?: CallbackFunction<void>): void;
  12081. suspend(): void;
  12082. resume(): void;
  12083. close(callback: CallbackFunction<void>): void;
  12084. }
  12085. declare abstract class WeakTupleMap<T extends any[], V> {
  12086. set(...args: [T, ...V[]]): void;
  12087. has(...args: T): boolean;
  12088. get(...args: T): V;
  12089. provide(...args: [T, ...(() => V)[]]): V;
  12090. delete(...args: T): void;
  12091. clear(): void;
  12092. }
  12093. declare interface WebAssemblyRenderContext {
  12094. /**
  12095. * the chunk
  12096. */
  12097. chunk: Chunk;
  12098. /**
  12099. * the dependency templates
  12100. */
  12101. dependencyTemplates: DependencyTemplates;
  12102. /**
  12103. * the runtime template
  12104. */
  12105. runtimeTemplate: RuntimeTemplate;
  12106. /**
  12107. * the module graph
  12108. */
  12109. moduleGraph: ModuleGraph;
  12110. /**
  12111. * the chunk graph
  12112. */
  12113. chunkGraph: ChunkGraph;
  12114. /**
  12115. * results of code generation
  12116. */
  12117. codeGenerationResults: CodeGenerationResults;
  12118. }
  12119. declare class WebWorkerTemplatePlugin {
  12120. constructor();
  12121. /**
  12122. * Apply the plugin
  12123. */
  12124. apply(compiler: Compiler): void;
  12125. }
  12126. declare class WebpackError extends Error {
  12127. /**
  12128. * Creates an instance of WebpackError.
  12129. */
  12130. constructor(message?: string);
  12131. details?: string;
  12132. module?: null | Module;
  12133. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  12134. hideStack?: boolean;
  12135. chunk?: Chunk;
  12136. file?: string;
  12137. serialize(__0: ObjectSerializerContext): void;
  12138. deserialize(__0: ObjectDeserializerContext): void;
  12139. /**
  12140. * Create .stack property on a target object
  12141. */
  12142. static captureStackTrace(
  12143. targetObject: object,
  12144. constructorOpt?: Function
  12145. ): void;
  12146. /**
  12147. * Optional override for formatting stack traces
  12148. */
  12149. static prepareStackTrace?: (
  12150. err: Error,
  12151. stackTraces: NodeJS.CallSite[]
  12152. ) => any;
  12153. static stackTraceLimit: number;
  12154. }
  12155. declare abstract class WebpackLogger {
  12156. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  12157. error(...args: any[]): void;
  12158. warn(...args: any[]): void;
  12159. info(...args: any[]): void;
  12160. log(...args: any[]): void;
  12161. debug(...args: any[]): void;
  12162. assert(assertion: any, ...args: any[]): void;
  12163. trace(): void;
  12164. clear(): void;
  12165. status(...args: any[]): void;
  12166. group(...args: any[]): void;
  12167. groupCollapsed(...args: any[]): void;
  12168. groupEnd(...args: any[]): void;
  12169. profile(label?: any): void;
  12170. profileEnd(label?: any): void;
  12171. time(label?: any): void;
  12172. timeLog(label?: any): void;
  12173. timeEnd(label?: any): void;
  12174. timeAggregate(label?: any): void;
  12175. timeAggregateEnd(label?: any): void;
  12176. }
  12177. declare class WebpackOptionsApply extends OptionsApply {
  12178. constructor();
  12179. }
  12180. declare class WebpackOptionsDefaulter {
  12181. constructor();
  12182. process(options: Configuration): WebpackOptionsNormalized;
  12183. }
  12184. /**
  12185. * Normalized webpack options object.
  12186. */
  12187. declare interface WebpackOptionsNormalized {
  12188. /**
  12189. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  12190. */
  12191. amd?: false | { [index: string]: any };
  12192. /**
  12193. * Report the first error as a hard error instead of tolerating it.
  12194. */
  12195. bail?: boolean;
  12196. /**
  12197. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  12198. */
  12199. cache: CacheOptionsNormalized;
  12200. /**
  12201. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  12202. */
  12203. context?: string;
  12204. /**
  12205. * References to other configurations to depend on.
  12206. */
  12207. dependencies?: string[];
  12208. /**
  12209. * Options for the webpack-dev-server.
  12210. */
  12211. devServer?: DevServer;
  12212. /**
  12213. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  12214. */
  12215. devtool?: string | false;
  12216. /**
  12217. * The entry point(s) of the compilation.
  12218. */
  12219. entry: EntryNormalized;
  12220. /**
  12221. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  12222. */
  12223. experiments: ExperimentsNormalized;
  12224. /**
  12225. * Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
  12226. */
  12227. externals: Externals;
  12228. /**
  12229. * Enable presets of externals for specific targets.
  12230. */
  12231. externalsPresets: ExternalsPresets;
  12232. /**
  12233. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  12234. */
  12235. externalsType?:
  12236. | "import"
  12237. | "var"
  12238. | "module"
  12239. | "assign"
  12240. | "this"
  12241. | "window"
  12242. | "self"
  12243. | "global"
  12244. | "commonjs"
  12245. | "commonjs2"
  12246. | "commonjs-module"
  12247. | "commonjs-static"
  12248. | "amd"
  12249. | "amd-require"
  12250. | "umd"
  12251. | "umd2"
  12252. | "jsonp"
  12253. | "system"
  12254. | "promise"
  12255. | "script"
  12256. | "node-commonjs";
  12257. /**
  12258. * Ignore specific warnings.
  12259. */
  12260. ignoreWarnings?: ((
  12261. warning: WebpackError,
  12262. compilation: Compilation
  12263. ) => boolean)[];
  12264. /**
  12265. * Options for infrastructure level logging.
  12266. */
  12267. infrastructureLogging: InfrastructureLogging;
  12268. /**
  12269. * Custom values available in the loader context.
  12270. */
  12271. loader?: Loader;
  12272. /**
  12273. * Enable production optimizations or development hints.
  12274. */
  12275. mode?: "none" | "development" | "production";
  12276. /**
  12277. * Options affecting the normal modules (`NormalModuleFactory`).
  12278. */
  12279. module: ModuleOptionsNormalized;
  12280. /**
  12281. * Name of the configuration. Used when loading multiple configurations.
  12282. */
  12283. name?: string;
  12284. /**
  12285. * Include polyfills or mocks for various node stuff.
  12286. */
  12287. node: Node;
  12288. /**
  12289. * Enables/Disables integrated optimizations.
  12290. */
  12291. optimization: Optimization;
  12292. /**
  12293. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  12294. */
  12295. output: OutputNormalized;
  12296. /**
  12297. * The number of parallel processed modules in the compilation.
  12298. */
  12299. parallelism?: number;
  12300. /**
  12301. * Configuration for web performance recommendations.
  12302. */
  12303. performance?: false | PerformanceOptions;
  12304. /**
  12305. * Add additional plugins to the compiler.
  12306. */
  12307. plugins: (
  12308. | undefined
  12309. | null
  12310. | false
  12311. | ""
  12312. | 0
  12313. | ((this: Compiler, compiler: Compiler) => void)
  12314. | WebpackPluginInstance
  12315. )[];
  12316. /**
  12317. * Capture timing information for each module.
  12318. */
  12319. profile?: boolean;
  12320. /**
  12321. * Store compiler state to a json file.
  12322. */
  12323. recordsInputPath?: string | false;
  12324. /**
  12325. * Load compiler state from a json file.
  12326. */
  12327. recordsOutputPath?: string | false;
  12328. /**
  12329. * Options for the resolver.
  12330. */
  12331. resolve: ResolveOptionsWebpackOptions;
  12332. /**
  12333. * Options for the resolver when resolving loaders.
  12334. */
  12335. resolveLoader: ResolveOptionsWebpackOptions;
  12336. /**
  12337. * Options affecting how file system snapshots are created and validated.
  12338. */
  12339. snapshot: SnapshotOptionsWebpackOptions;
  12340. /**
  12341. * Stats options object or preset name.
  12342. */
  12343. stats: StatsValue;
  12344. /**
  12345. * Environment to build for. An array of environments to build for all of them when possible.
  12346. */
  12347. target?: string | false | string[];
  12348. /**
  12349. * Enter watch mode, which rebuilds on file change.
  12350. */
  12351. watch?: boolean;
  12352. /**
  12353. * Options for the watcher.
  12354. */
  12355. watchOptions: WatchOptions;
  12356. }
  12357. /**
  12358. * Plugin instance.
  12359. */
  12360. declare interface WebpackPluginInstance {
  12361. [index: string]: any;
  12362. /**
  12363. * The run point of the plugin, required method.
  12364. */
  12365. apply: (compiler: Compiler) => void;
  12366. }
  12367. declare interface WithId {
  12368. id: string | number;
  12369. }
  12370. declare interface WithOptions {
  12371. /**
  12372. * create a resolver with additional/different options
  12373. */
  12374. withOptions: (
  12375. arg0: Partial<ResolveOptionsWithDependencyType>
  12376. ) => ResolverWithOptions;
  12377. }
  12378. declare interface WriteOnlySet<T> {
  12379. add: (item: T) => void;
  12380. }
  12381. type __TypeWebpackOptions = (data: object) =>
  12382. | string
  12383. | {
  12384. /**
  12385. * Unique loader options identifier.
  12386. */
  12387. ident?: string;
  12388. /**
  12389. * Loader name.
  12390. */
  12391. loader?: string;
  12392. /**
  12393. * Loader options.
  12394. */
  12395. options?: string | { [index: string]: any };
  12396. }
  12397. | __TypeWebpackOptions
  12398. | __Type_2[];
  12399. type __Type_2 =
  12400. | undefined
  12401. | null
  12402. | string
  12403. | false
  12404. | 0
  12405. | {
  12406. /**
  12407. * Unique loader options identifier.
  12408. */
  12409. ident?: string;
  12410. /**
  12411. * Loader name.
  12412. */
  12413. loader?: string;
  12414. /**
  12415. * Loader options.
  12416. */
  12417. options?: string | { [index: string]: any };
  12418. }
  12419. | ((data: object) =>
  12420. | string
  12421. | {
  12422. /**
  12423. * Unique loader options identifier.
  12424. */
  12425. ident?: string;
  12426. /**
  12427. * Loader name.
  12428. */
  12429. loader?: string;
  12430. /**
  12431. * Loader options.
  12432. */
  12433. options?: string | { [index: string]: any };
  12434. }
  12435. | __TypeWebpackOptions
  12436. | __Type_2[]);
  12437. declare function exports(
  12438. options: Configuration,
  12439. callback?: CallbackWebpack<Stats>
  12440. ): Compiler;
  12441. declare function exports(
  12442. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  12443. callback?: CallbackWebpack<MultiStats>
  12444. ): MultiCompiler;
  12445. declare namespace exports {
  12446. export const webpack: {
  12447. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  12448. (
  12449. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  12450. callback?: CallbackWebpack<MultiStats>
  12451. ): MultiCompiler;
  12452. };
  12453. export const validate: (options?: any) => void;
  12454. export const validateSchema: (
  12455. schema: Parameters<typeof validateFunction>[0],
  12456. options: Parameters<typeof validateFunction>[1],
  12457. validationConfiguration?: ValidationErrorConfiguration
  12458. ) => void;
  12459. export const version: string;
  12460. export namespace cli {
  12461. export let getArguments: (schema?: any) => Record<string, Argument>;
  12462. export let processArguments: (
  12463. args: Record<string, Argument>,
  12464. config: any,
  12465. values: Record<
  12466. string,
  12467. | string
  12468. | number
  12469. | boolean
  12470. | RegExp
  12471. | (string | number | boolean | RegExp)[]
  12472. >
  12473. ) => null | Problem[];
  12474. }
  12475. export namespace ModuleFilenameHelpers {
  12476. export let ALL_LOADERS_RESOURCE: string;
  12477. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  12478. export let LOADERS_RESOURCE: string;
  12479. export let REGEXP_LOADERS_RESOURCE: RegExp;
  12480. export let RESOURCE: string;
  12481. export let REGEXP_RESOURCE: RegExp;
  12482. export let ABSOLUTE_RESOURCE_PATH: string;
  12483. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  12484. export let RESOURCE_PATH: string;
  12485. export let REGEXP_RESOURCE_PATH: RegExp;
  12486. export let ALL_LOADERS: string;
  12487. export let REGEXP_ALL_LOADERS: RegExp;
  12488. export let LOADERS: string;
  12489. export let REGEXP_LOADERS: RegExp;
  12490. export let QUERY: string;
  12491. export let REGEXP_QUERY: RegExp;
  12492. export let ID: string;
  12493. export let REGEXP_ID: RegExp;
  12494. export let HASH: string;
  12495. export let REGEXP_HASH: RegExp;
  12496. export let NAMESPACE: string;
  12497. export let REGEXP_NAMESPACE: RegExp;
  12498. export let createFilename: (
  12499. module: string | Module,
  12500. options: any,
  12501. __2: {
  12502. /**
  12503. * requestShortener
  12504. */
  12505. requestShortener: RequestShortener;
  12506. /**
  12507. * chunk graph
  12508. */
  12509. chunkGraph: ChunkGraph;
  12510. /**
  12511. * the hash function to use
  12512. */
  12513. hashFunction: string | typeof Hash;
  12514. }
  12515. ) => string;
  12516. export let replaceDuplicates: <T>(
  12517. array: T[],
  12518. fn: (
  12519. duplicateItem: T,
  12520. duplicateItemIndex: number,
  12521. numberOfTimesReplaced: number
  12522. ) => T,
  12523. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  12524. ) => T[];
  12525. export let matchPart: (str: string, test: Matcher) => boolean;
  12526. export let matchObject: (obj: MatchObject, str: string) => boolean;
  12527. }
  12528. export namespace RuntimeGlobals {
  12529. export let require: "__webpack_require__";
  12530. export let requireScope: "__webpack_require__.*";
  12531. export let exports: "__webpack_exports__";
  12532. export let thisAsExports: "top-level-this-exports";
  12533. export let returnExportsFromRuntime: "return-exports-from-runtime";
  12534. export let module: "module";
  12535. export let moduleId: "module.id";
  12536. export let moduleLoaded: "module.loaded";
  12537. export let publicPath: "__webpack_require__.p";
  12538. export let entryModuleId: "__webpack_require__.s";
  12539. export let moduleCache: "__webpack_require__.c";
  12540. export let moduleFactories: "__webpack_require__.m";
  12541. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  12542. export let ensureChunk: "__webpack_require__.e";
  12543. export let ensureChunkHandlers: "__webpack_require__.f";
  12544. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  12545. export let prefetchChunk: "__webpack_require__.E";
  12546. export let prefetchChunkHandlers: "__webpack_require__.F";
  12547. export let preloadChunk: "__webpack_require__.G";
  12548. export let preloadChunkHandlers: "__webpack_require__.H";
  12549. export let definePropertyGetters: "__webpack_require__.d";
  12550. export let makeNamespaceObject: "__webpack_require__.r";
  12551. export let createFakeNamespaceObject: "__webpack_require__.t";
  12552. export let compatGetDefaultExport: "__webpack_require__.n";
  12553. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  12554. export let nodeModuleDecorator: "__webpack_require__.nmd";
  12555. export let getFullHash: "__webpack_require__.h";
  12556. export let wasmInstances: "__webpack_require__.w";
  12557. export let instantiateWasm: "__webpack_require__.v";
  12558. export let uncaughtErrorHandler: "__webpack_require__.oe";
  12559. export let scriptNonce: "__webpack_require__.nc";
  12560. export let loadScript: "__webpack_require__.l";
  12561. export let createScript: "__webpack_require__.ts";
  12562. export let createScriptUrl: "__webpack_require__.tu";
  12563. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  12564. export let hasFetchPriority: "has fetch priority";
  12565. export let chunkName: "__webpack_require__.cn";
  12566. export let runtimeId: "__webpack_require__.j";
  12567. export let getChunkScriptFilename: "__webpack_require__.u";
  12568. export let getChunkCssFilename: "__webpack_require__.k";
  12569. export let hasCssModules: "has css modules";
  12570. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  12571. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  12572. export let startup: "__webpack_require__.x";
  12573. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  12574. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  12575. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  12576. export let chunkCallback: "webpackChunk";
  12577. export let startupEntrypoint: "__webpack_require__.X";
  12578. export let onChunksLoaded: "__webpack_require__.O";
  12579. export let externalInstallChunk: "__webpack_require__.C";
  12580. export let interceptModuleExecution: "__webpack_require__.i";
  12581. export let global: "__webpack_require__.g";
  12582. export let shareScopeMap: "__webpack_require__.S";
  12583. export let initializeSharing: "__webpack_require__.I";
  12584. export let currentRemoteGetScope: "__webpack_require__.R";
  12585. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  12586. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  12587. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  12588. export let hmrModuleData: "__webpack_require__.hmrD";
  12589. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  12590. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  12591. export let amdDefine: "__webpack_require__.amdD";
  12592. export let amdOptions: "__webpack_require__.amdO";
  12593. export let system: "__webpack_require__.System";
  12594. export let hasOwnProperty: "__webpack_require__.o";
  12595. export let systemContext: "__webpack_require__.y";
  12596. export let baseURI: "__webpack_require__.b";
  12597. export let relativeUrl: "__webpack_require__.U";
  12598. export let asyncModule: "__webpack_require__.a";
  12599. }
  12600. export const UsageState: Readonly<{
  12601. Unused: 0;
  12602. OnlyPropertiesUsed: 1;
  12603. NoInfo: 2;
  12604. Unknown: 3;
  12605. Used: 4;
  12606. }>;
  12607. export namespace cache {
  12608. export { MemoryCachePlugin };
  12609. }
  12610. export namespace config {
  12611. export const getNormalizedWebpackOptions: (
  12612. config: Configuration
  12613. ) => WebpackOptionsNormalized;
  12614. export const applyWebpackOptionsDefaults: (
  12615. options: WebpackOptionsNormalized
  12616. ) => void;
  12617. }
  12618. export namespace dependencies {
  12619. export {
  12620. ModuleDependency,
  12621. HarmonyImportDependency,
  12622. ConstDependency,
  12623. NullDependency
  12624. };
  12625. }
  12626. export namespace ids {
  12627. export {
  12628. ChunkModuleIdRangePlugin,
  12629. NaturalModuleIdsPlugin,
  12630. OccurrenceModuleIdsPlugin,
  12631. NamedModuleIdsPlugin,
  12632. DeterministicChunkIdsPlugin,
  12633. DeterministicModuleIdsPlugin,
  12634. NamedChunkIdsPlugin,
  12635. OccurrenceChunkIdsPlugin,
  12636. HashedModuleIdsPlugin
  12637. };
  12638. }
  12639. export namespace javascript {
  12640. export {
  12641. EnableChunkLoadingPlugin,
  12642. JavascriptModulesPlugin,
  12643. JavascriptParser
  12644. };
  12645. }
  12646. export namespace optimize {
  12647. export namespace InnerGraph {
  12648. export let bailout: (parserState: ParserState) => void;
  12649. export let enable: (parserState: ParserState) => void;
  12650. export let isEnabled: (parserState: ParserState) => boolean;
  12651. export let addUsage: (
  12652. state: ParserState,
  12653. symbol: null | TopLevelSymbol,
  12654. usage: string | true | TopLevelSymbol
  12655. ) => void;
  12656. export let addVariableUsage: (
  12657. parser: JavascriptParser,
  12658. name: string,
  12659. usage: string | true | TopLevelSymbol
  12660. ) => void;
  12661. export let inferDependencyUsage: (state: ParserState) => void;
  12662. export let onUsage: (
  12663. state: ParserState,
  12664. onUsageCallback: (arg0?: boolean | Set<string>) => void
  12665. ) => void;
  12666. export let setTopLevelSymbol: (
  12667. state: ParserState,
  12668. symbol?: TopLevelSymbol
  12669. ) => void;
  12670. export let getTopLevelSymbol: (
  12671. state: ParserState
  12672. ) => void | TopLevelSymbol;
  12673. export let tagTopLevelSymbol: (
  12674. parser: JavascriptParser,
  12675. name: string
  12676. ) => undefined | TopLevelSymbol;
  12677. export let isDependencyUsedByExports: (
  12678. dependency: Dependency,
  12679. usedByExports: boolean | Set<string>,
  12680. moduleGraph: ModuleGraph,
  12681. runtime: RuntimeSpec
  12682. ) => boolean;
  12683. export let getDependencyUsedByExportsCondition: (
  12684. dependency: Dependency,
  12685. usedByExports: undefined | boolean | Set<string>,
  12686. moduleGraph: ModuleGraph
  12687. ) =>
  12688. | null
  12689. | false
  12690. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  12691. export { TopLevelSymbol, topLevelSymbolTag };
  12692. }
  12693. export {
  12694. AggressiveMergingPlugin,
  12695. AggressiveSplittingPlugin,
  12696. LimitChunkCountPlugin,
  12697. MinChunkSizePlugin,
  12698. ModuleConcatenationPlugin,
  12699. RealContentHashPlugin,
  12700. RuntimeChunkPlugin,
  12701. SideEffectsFlagPlugin,
  12702. SplitChunksPlugin
  12703. };
  12704. }
  12705. export namespace runtime {
  12706. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  12707. }
  12708. export namespace prefetch {
  12709. export { ChunkPrefetchPreloadPlugin };
  12710. }
  12711. export namespace web {
  12712. export {
  12713. FetchCompileAsyncWasmPlugin,
  12714. FetchCompileWasmPlugin,
  12715. JsonpChunkLoadingRuntimeModule,
  12716. JsonpTemplatePlugin
  12717. };
  12718. }
  12719. export namespace webworker {
  12720. export { WebWorkerTemplatePlugin };
  12721. }
  12722. export namespace node {
  12723. export {
  12724. NodeEnvironmentPlugin,
  12725. NodeSourcePlugin,
  12726. NodeTargetPlugin,
  12727. NodeTemplatePlugin,
  12728. ReadFileCompileWasmPlugin
  12729. };
  12730. }
  12731. export namespace electron {
  12732. export { ElectronTargetPlugin };
  12733. }
  12734. export namespace wasm {
  12735. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  12736. }
  12737. export namespace library {
  12738. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  12739. }
  12740. export namespace container {
  12741. export const scope: <T>(
  12742. scope: string,
  12743. options: ContainerOptionsFormat<T>
  12744. ) => Record<string, string | string[] | T>;
  12745. export {
  12746. ContainerPlugin,
  12747. ContainerReferencePlugin,
  12748. ModuleFederationPlugin
  12749. };
  12750. }
  12751. export namespace sharing {
  12752. export const scope: <T>(
  12753. scope: string,
  12754. options: ContainerOptionsFormat<T>
  12755. ) => Record<string, string | string[] | T>;
  12756. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  12757. }
  12758. export namespace debug {
  12759. export { ProfilingPlugin };
  12760. }
  12761. export namespace util {
  12762. export const createHash: (algorithm?: string | typeof Hash) => Hash;
  12763. export namespace comparators {
  12764. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  12765. export let compareModulesByIdentifier: (
  12766. a: Module,
  12767. b: Module
  12768. ) => 0 | 1 | -1;
  12769. export let compareModulesById: ParameterizedComparator<
  12770. ChunkGraph,
  12771. Module
  12772. >;
  12773. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  12774. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  12775. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  12776. ModuleGraph,
  12777. Module
  12778. >;
  12779. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  12780. ModuleGraph,
  12781. Module
  12782. >;
  12783. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  12784. ChunkGraph,
  12785. Module
  12786. >;
  12787. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  12788. export let compareIds: (
  12789. a: string | number,
  12790. b: string | number
  12791. ) => 0 | 1 | -1;
  12792. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  12793. export let compareChunkGroupsByIndex: (
  12794. a: ChunkGroup,
  12795. b: ChunkGroup
  12796. ) => 0 | 1 | -1;
  12797. export let concatComparators: <T>(
  12798. c1: Comparator<T>,
  12799. c2: Comparator<T>,
  12800. ...cRest: Comparator<T>[]
  12801. ) => Comparator<T>;
  12802. export let compareSelect: <T, R>(
  12803. getter: Selector<T, R>,
  12804. comparator: Comparator<R>
  12805. ) => Comparator<T>;
  12806. export let compareIterables: <T>(
  12807. elementComparator: Comparator<T>
  12808. ) => Comparator<Iterable<T>>;
  12809. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  12810. export let compareChunksNatural: (
  12811. chunkGraph: ChunkGraph
  12812. ) => Comparator<Chunk>;
  12813. export let compareLocations: (
  12814. a: DependencyLocation,
  12815. b: DependencyLocation
  12816. ) => 0 | 1 | -1;
  12817. }
  12818. export namespace runtime {
  12819. export let getEntryRuntime: (
  12820. compilation: Compilation,
  12821. name: string,
  12822. options?: EntryOptions
  12823. ) => RuntimeSpec;
  12824. export let forEachRuntime: (
  12825. runtime: RuntimeSpec,
  12826. fn: (arg0?: string) => void,
  12827. deterministicOrder?: boolean
  12828. ) => void;
  12829. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  12830. export let keyToRuntime: (key: string) => RuntimeSpec;
  12831. export let runtimeToString: (runtime: RuntimeSpec) => string;
  12832. export let runtimeConditionToString: (
  12833. runtimeCondition: RuntimeCondition
  12834. ) => string;
  12835. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  12836. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  12837. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  12838. export let mergeRuntimeCondition: (
  12839. a: RuntimeCondition,
  12840. b: RuntimeCondition,
  12841. runtime: RuntimeSpec
  12842. ) => RuntimeCondition;
  12843. export let mergeRuntimeConditionNonFalse: (
  12844. a: undefined | string | true | SortableSet<string>,
  12845. b: undefined | string | true | SortableSet<string>,
  12846. runtime: RuntimeSpec
  12847. ) => undefined | string | true | SortableSet<string>;
  12848. export let mergeRuntimeOwned: (
  12849. a: RuntimeSpec,
  12850. b: RuntimeSpec
  12851. ) => RuntimeSpec;
  12852. export let intersectRuntime: (
  12853. a: RuntimeSpec,
  12854. b: RuntimeSpec
  12855. ) => RuntimeSpec;
  12856. export let subtractRuntime: (
  12857. a: RuntimeSpec,
  12858. b: RuntimeSpec
  12859. ) => RuntimeSpec;
  12860. export let subtractRuntimeCondition: (
  12861. a: RuntimeCondition,
  12862. b: RuntimeCondition,
  12863. runtime: RuntimeSpec
  12864. ) => RuntimeCondition;
  12865. export let filterRuntime: (
  12866. runtime: RuntimeSpec,
  12867. filter: (arg0: RuntimeSpec) => boolean
  12868. ) => undefined | string | boolean | SortableSet<string>;
  12869. export { RuntimeSpecMap, RuntimeSpecSet };
  12870. }
  12871. export namespace serialization {
  12872. export const register: (
  12873. Constructor: Constructor,
  12874. request: string,
  12875. name: null | string,
  12876. serializer: ObjectSerializer
  12877. ) => void;
  12878. export const registerLoader: (
  12879. regExp: RegExp,
  12880. loader: (arg0: string) => boolean
  12881. ) => void;
  12882. export const registerNotSerializable: (Constructor: Constructor) => void;
  12883. export const NOT_SERIALIZABLE: object;
  12884. export const buffersSerializer: Serializer;
  12885. export let createFileSerializer: (
  12886. fs: IntermediateFileSystem,
  12887. hashFunction: string | typeof Hash
  12888. ) => Serializer;
  12889. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  12890. }
  12891. export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
  12892. export { LazySet };
  12893. }
  12894. export namespace sources {
  12895. export {
  12896. Source,
  12897. RawSource,
  12898. OriginalSource,
  12899. ReplaceSource,
  12900. SourceMapSource,
  12901. ConcatSource,
  12902. PrefixSource,
  12903. CachedSource,
  12904. SizeOnlySource,
  12905. CompatSource
  12906. };
  12907. }
  12908. export namespace experiments {
  12909. export namespace schemes {
  12910. export { HttpUriPlugin };
  12911. }
  12912. export namespace ids {
  12913. export { SyncModuleIdsPlugin };
  12914. }
  12915. }
  12916. export type WebpackPluginFunction = (
  12917. this: Compiler,
  12918. compiler: Compiler
  12919. ) => void;
  12920. export {
  12921. AutomaticPrefetchPlugin,
  12922. AsyncDependenciesBlock,
  12923. BannerPlugin,
  12924. Cache,
  12925. Chunk,
  12926. ChunkGraph,
  12927. CleanPlugin,
  12928. Compilation,
  12929. Compiler,
  12930. ConcatenationScope,
  12931. ContextExclusionPlugin,
  12932. ContextReplacementPlugin,
  12933. DefinePlugin,
  12934. DelegatedPlugin,
  12935. Dependency,
  12936. DllPlugin,
  12937. DllReferencePlugin,
  12938. DynamicEntryPlugin,
  12939. EntryOptionPlugin,
  12940. EntryPlugin,
  12941. EnvironmentPlugin,
  12942. EvalDevToolModulePlugin,
  12943. EvalSourceMapDevToolPlugin,
  12944. ExternalModule,
  12945. ExternalsPlugin,
  12946. Generator,
  12947. HotUpdateChunk,
  12948. HotModuleReplacementPlugin,
  12949. IgnorePlugin,
  12950. JavascriptModulesPlugin,
  12951. LibManifestPlugin,
  12952. LibraryTemplatePlugin,
  12953. LoaderOptionsPlugin,
  12954. LoaderTargetPlugin,
  12955. Module,
  12956. ModuleGraph,
  12957. ModuleGraphConnection,
  12958. NoEmitOnErrorsPlugin,
  12959. NormalModule,
  12960. NormalModuleReplacementPlugin,
  12961. MultiCompiler,
  12962. Parser,
  12963. PrefetchPlugin,
  12964. ProgressPlugin,
  12965. ProvidePlugin,
  12966. RuntimeModule,
  12967. EntryPlugin as SingleEntryPlugin,
  12968. SourceMapDevToolPlugin,
  12969. Stats,
  12970. Template,
  12971. WatchIgnorePlugin,
  12972. WebpackError,
  12973. WebpackOptionsApply,
  12974. WebpackOptionsDefaulter,
  12975. ValidationError as WebpackOptionsValidationError,
  12976. ValidationError,
  12977. Entry,
  12978. EntryNormalized,
  12979. EntryObject,
  12980. ExternalItemFunctionData,
  12981. ExternalItemObjectKnown,
  12982. ExternalItemObjectUnknown,
  12983. ExternalItemValue,
  12984. Externals,
  12985. FileCacheOptions,
  12986. LibraryOptions,
  12987. MemoryCacheOptions,
  12988. ModuleOptions,
  12989. ResolveOptionsWebpackOptions as ResolveOptions,
  12990. RuleSetCondition,
  12991. RuleSetConditionAbsolute,
  12992. RuleSetRule,
  12993. RuleSetUse,
  12994. RuleSetUseItem,
  12995. StatsOptions,
  12996. Configuration,
  12997. WebpackOptionsNormalized,
  12998. WebpackPluginInstance,
  12999. ChunkGroup,
  13000. Asset,
  13001. AssetInfo,
  13002. EntryOptions,
  13003. PathData,
  13004. AssetEmittedInfo,
  13005. MultiStats,
  13006. ResolveData,
  13007. ParserState,
  13008. ResolvePluginInstance,
  13009. Resolver,
  13010. Watching,
  13011. Argument,
  13012. Problem,
  13013. StatsAsset,
  13014. StatsChunk,
  13015. StatsChunkGroup,
  13016. StatsChunkOrigin,
  13017. StatsCompilation,
  13018. StatsError,
  13019. StatsLogging,
  13020. StatsLoggingEntry,
  13021. StatsModule,
  13022. StatsModuleIssuer,
  13023. StatsModuleReason,
  13024. StatsModuleTraceDependency,
  13025. StatsModuleTraceItem,
  13026. StatsProfile,
  13027. LoaderModule,
  13028. RawLoaderDefinition,
  13029. LoaderDefinition,
  13030. LoaderDefinitionFunction,
  13031. PitchLoaderDefinitionFunction,
  13032. RawLoaderDefinitionFunction,
  13033. LoaderContext
  13034. };
  13035. }
  13036. declare const topLevelSymbolTag: unique symbol;
  13037. export = exports;