types.d.ts 384 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583
  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 {
  86. IncomingMessage,
  87. ServerOptions as ServerOptionsImport,
  88. ServerResponse
  89. } from "http";
  90. import { ListenOptions, Server } from "net";
  91. import { validate as validateFunction } from "schema-utils";
  92. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  93. import { ValidationErrorConfiguration } from "schema-utils/declarations/validate";
  94. import {
  95. AsArray,
  96. AsyncParallelHook,
  97. AsyncSeriesBailHook,
  98. AsyncSeriesHook,
  99. AsyncSeriesWaterfallHook,
  100. HookMap,
  101. MultiHook,
  102. SyncBailHook,
  103. SyncHook,
  104. SyncWaterfallHook
  105. } from "tapable";
  106. import { SecureContextOptions, TlsOptions } from "tls";
  107. import { URL } from "url";
  108. import { Context } from "vm";
  109. declare interface Abortable {
  110. /**
  111. * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
  112. */
  113. signal?: AbortSignal;
  114. }
  115. declare class AbstractLibraryPlugin<T> {
  116. constructor(__0: {
  117. /**
  118. * name of the plugin
  119. */
  120. pluginName: string;
  121. /**
  122. * used library type
  123. */
  124. type: string;
  125. });
  126. /**
  127. * Apply the plugin
  128. */
  129. apply(compiler: Compiler): void;
  130. parseOptions(library: LibraryOptions): false | T;
  131. finishEntryModule(
  132. module: Module,
  133. entryName: string,
  134. libraryContext: LibraryContext<T>
  135. ): void;
  136. embedInRuntimeBailout(
  137. module: Module,
  138. renderContext: RenderContext,
  139. libraryContext: LibraryContext<T>
  140. ): undefined | string;
  141. strictRuntimeBailout(
  142. renderContext: RenderContext,
  143. libraryContext: LibraryContext<T>
  144. ): undefined | string;
  145. runtimeRequirements(
  146. chunk: Chunk,
  147. set: Set<string>,
  148. libraryContext: LibraryContext<T>
  149. ): void;
  150. render(
  151. source: Source,
  152. renderContext: RenderContext,
  153. libraryContext: LibraryContext<T>
  154. ): Source;
  155. renderStartup(
  156. source: Source,
  157. module: Module,
  158. renderContext: StartupRenderContext,
  159. libraryContext: LibraryContext<T>
  160. ): Source;
  161. chunkHash(
  162. chunk: Chunk,
  163. hash: Hash,
  164. chunkHashContext: ChunkHashContext,
  165. libraryContext: LibraryContext<T>
  166. ): void;
  167. static COMMON_LIBRARY_NAME_MESSAGE: string;
  168. }
  169. declare interface AdditionalData {
  170. [index: string]: any;
  171. webpackAST: object;
  172. }
  173. declare class AggressiveMergingPlugin {
  174. constructor(options?: AggressiveMergingPluginOptions);
  175. options: AggressiveMergingPluginOptions;
  176. /**
  177. * Apply the plugin
  178. */
  179. apply(compiler: Compiler): void;
  180. }
  181. declare interface AggressiveMergingPluginOptions {
  182. /**
  183. * minimal size reduction to trigger merging
  184. */
  185. minSizeReduce?: number;
  186. }
  187. declare class AggressiveSplittingPlugin {
  188. constructor(options?: AggressiveSplittingPluginOptions);
  189. options: AggressiveSplittingPluginOptions;
  190. /**
  191. * Apply the plugin
  192. */
  193. apply(compiler: Compiler): void;
  194. static wasChunkRecorded(chunk: Chunk): boolean;
  195. }
  196. declare interface AggressiveSplittingPluginOptions {
  197. /**
  198. * Extra cost for each chunk (Default: 9.8kiB).
  199. */
  200. chunkOverhead?: number;
  201. /**
  202. * Extra cost multiplicator for entry chunks (Default: 10).
  203. */
  204. entryChunkMultiplicator?: number;
  205. /**
  206. * Byte, max size of per file (Default: 50kiB).
  207. */
  208. maxSize?: number;
  209. /**
  210. * Byte, split point. (Default: 30kiB).
  211. */
  212. minSize?: number;
  213. }
  214. type Alias = string | false | string[];
  215. declare interface AliasOption {
  216. alias: Alias;
  217. name: string;
  218. onlyModule?: boolean;
  219. }
  220. type AliasOptionNewRequest = string | false | string[];
  221. declare interface AliasOptions {
  222. [index: string]: AliasOptionNewRequest;
  223. }
  224. declare interface Argument {
  225. description: string;
  226. simpleType: "string" | "number" | "boolean";
  227. multiple: boolean;
  228. configs: ArgumentConfig[];
  229. }
  230. declare interface ArgumentConfig {
  231. description: string;
  232. negatedDescription?: string;
  233. path: string;
  234. multiple: boolean;
  235. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  236. values?: any[];
  237. }
  238. type ArrayBufferView =
  239. | Uint8Array
  240. | Uint8ClampedArray
  241. | Uint16Array
  242. | Uint32Array
  243. | Int8Array
  244. | Int16Array
  245. | Int32Array
  246. | BigUint64Array
  247. | BigInt64Array
  248. | Float32Array
  249. | Float64Array
  250. | DataView;
  251. declare interface Asset {
  252. /**
  253. * the filename of the asset
  254. */
  255. name: string;
  256. /**
  257. * source of the asset
  258. */
  259. source: Source;
  260. /**
  261. * info about the asset
  262. */
  263. info: AssetInfo;
  264. }
  265. declare interface AssetEmittedInfo {
  266. content: Buffer;
  267. source: Source;
  268. compilation: Compilation;
  269. outputPath: string;
  270. targetPath: string;
  271. }
  272. type AssetFilterItemTypes =
  273. | string
  274. | RegExp
  275. | ((name: string, asset: StatsAsset) => boolean);
  276. /**
  277. * Options object for data url generation.
  278. */
  279. declare interface AssetGeneratorDataUrlOptions {
  280. /**
  281. * Asset encoding (defaults to base64).
  282. */
  283. encoding?: false | "base64";
  284. /**
  285. * Asset mimetype (getting from file extension by default).
  286. */
  287. mimetype?: string;
  288. }
  289. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  290. AssetResourceGeneratorOptions;
  291. type AssetInfo = KnownAssetInfo & Record<string, any>;
  292. /**
  293. * Generator options for asset/inline modules.
  294. */
  295. declare interface AssetInlineGeneratorOptions {
  296. /**
  297. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  298. */
  299. binary?: boolean;
  300. /**
  301. * The options for data url generator.
  302. */
  303. dataUrl?:
  304. | AssetGeneratorDataUrlOptions
  305. | ((
  306. source: string | Buffer,
  307. context: { filename: string; module: Module }
  308. ) => string);
  309. }
  310. /**
  311. * Options object for DataUrl condition.
  312. */
  313. declare interface AssetParserDataUrlOptions {
  314. /**
  315. * Maximum size of asset that should be inline as modules. Default: 8kb.
  316. */
  317. maxSize?: number;
  318. }
  319. /**
  320. * Parser options for asset modules.
  321. */
  322. declare interface AssetParserOptions {
  323. /**
  324. * The condition for inlining the asset as DataUrl.
  325. */
  326. dataUrlCondition?:
  327. | AssetParserDataUrlOptions
  328. | ((
  329. source: string | Buffer,
  330. context: { filename: string; module: Module }
  331. ) => boolean);
  332. }
  333. /**
  334. * Generator options for asset/resource modules.
  335. */
  336. declare interface AssetResourceGeneratorOptions {
  337. /**
  338. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  339. */
  340. binary?: boolean;
  341. /**
  342. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  343. */
  344. emit?: boolean;
  345. /**
  346. * 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.
  347. */
  348. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  349. /**
  350. * 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.
  351. */
  352. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  353. /**
  354. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  355. */
  356. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  357. }
  358. declare class AsyncDependenciesBlock extends DependenciesBlock {
  359. constructor(
  360. groupOptions:
  361. | null
  362. | (RawChunkGroupOptions & { name?: string } & {
  363. entryOptions?: EntryOptions;
  364. }),
  365. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  366. request?: null | string
  367. );
  368. groupOptions: RawChunkGroupOptions & { name?: string } & {
  369. entryOptions?: EntryOptions;
  370. };
  371. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  372. request?: null | string;
  373. chunkName?: string;
  374. module: any;
  375. }
  376. declare abstract class AsyncQueue<T, K, R> {
  377. hooks: {
  378. beforeAdd: AsyncSeriesHook<[T]>;
  379. added: SyncHook<[T]>;
  380. beforeStart: AsyncSeriesHook<[T]>;
  381. started: SyncHook<[T]>;
  382. result: SyncHook<[T, Error, R]>;
  383. };
  384. add(item: T, callback: CallbackAsyncQueue<R>): void;
  385. invalidate(item: T): void;
  386. /**
  387. * Waits for an already started item
  388. */
  389. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  390. stop(): void;
  391. increaseParallelism(): void;
  392. decreaseParallelism(): void;
  393. isProcessing(item: T): boolean;
  394. isQueued(item: T): boolean;
  395. isDone(item: T): boolean;
  396. clear(): void;
  397. }
  398. declare class AsyncWebAssemblyModulesPlugin {
  399. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  400. options: AsyncWebAssemblyModulesPluginOptions;
  401. /**
  402. * Apply the plugin
  403. */
  404. apply(compiler: Compiler): void;
  405. renderModule(
  406. module: Module,
  407. renderContext: WebAssemblyRenderContext,
  408. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  409. ): Source;
  410. static getCompilationHooks(
  411. compilation: Compilation
  412. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  413. }
  414. declare interface AsyncWebAssemblyModulesPluginOptions {
  415. /**
  416. * mangle imports
  417. */
  418. mangleImports?: boolean;
  419. }
  420. declare class AutomaticPrefetchPlugin {
  421. constructor();
  422. /**
  423. * Apply the plugin
  424. */
  425. apply(compiler: Compiler): void;
  426. }
  427. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  428. declare interface BackendApi {
  429. dispose: (arg0?: Error) => void;
  430. module: (arg0: Module) => { client: string; data: string; active: boolean };
  431. }
  432. declare class BannerPlugin {
  433. constructor(options: BannerPluginArgument);
  434. options: BannerPluginOptions;
  435. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  436. /**
  437. * Apply the plugin
  438. */
  439. apply(compiler: Compiler): void;
  440. }
  441. type BannerPluginArgument =
  442. | string
  443. | BannerPluginOptions
  444. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  445. declare interface BannerPluginOptions {
  446. /**
  447. * Specifies the banner.
  448. */
  449. banner:
  450. | string
  451. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  452. /**
  453. * If true, the banner will only be added to the entry chunks.
  454. */
  455. entryOnly?: boolean;
  456. /**
  457. * Exclude all modules matching any of these conditions.
  458. */
  459. exclude?: string | RegExp | Rule[];
  460. /**
  461. * If true, banner will be placed at the end of the output.
  462. */
  463. footer?: boolean;
  464. /**
  465. * Include all modules matching any of these conditions.
  466. */
  467. include?: string | RegExp | Rule[];
  468. /**
  469. * If true, banner will not be wrapped in a comment.
  470. */
  471. raw?: boolean;
  472. /**
  473. * Specifies the banner.
  474. */
  475. stage?: number;
  476. /**
  477. * Include all modules that pass test assertion.
  478. */
  479. test?: string | RegExp | Rule[];
  480. }
  481. declare interface BaseResolveRequest {
  482. path: string | false;
  483. context?: object;
  484. descriptionFilePath?: string;
  485. descriptionFileRoot?: string;
  486. descriptionFileData?: JsonObjectTypes;
  487. relativePath?: string;
  488. ignoreSymlinks?: boolean;
  489. fullySpecified?: boolean;
  490. __innerRequest?: string;
  491. __innerRequest_request?: string;
  492. __innerRequest_relativePath?: string;
  493. }
  494. declare abstract class BasicEvaluatedExpression {
  495. type: number;
  496. range?: [number, number];
  497. falsy: boolean;
  498. truthy: boolean;
  499. nullish?: boolean;
  500. sideEffects: boolean;
  501. bool?: boolean;
  502. number?: number;
  503. bigint?: bigint;
  504. regExp?: RegExp;
  505. string?: string;
  506. quasis?: BasicEvaluatedExpression[];
  507. parts?: BasicEvaluatedExpression[];
  508. array?: any[];
  509. items?: BasicEvaluatedExpression[];
  510. options?: BasicEvaluatedExpression[];
  511. prefix?: null | BasicEvaluatedExpression;
  512. postfix?: null | BasicEvaluatedExpression;
  513. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  514. identifier?: string | VariableInfoInterface;
  515. rootInfo?: string | VariableInfoInterface;
  516. getMembers?: () => string[];
  517. getMembersOptionals?: () => boolean[];
  518. getMemberRanges?: () => [number, number][];
  519. expression?:
  520. | UnaryExpression
  521. | ArrayExpression
  522. | ArrowFunctionExpression
  523. | AssignmentExpression
  524. | AwaitExpression
  525. | BinaryExpression
  526. | SimpleCallExpression
  527. | NewExpression
  528. | ChainExpression
  529. | ClassExpression
  530. | ConditionalExpression
  531. | FunctionExpression
  532. | Identifier
  533. | ImportExpression
  534. | SimpleLiteral
  535. | RegExpLiteral
  536. | BigIntLiteral
  537. | LogicalExpression
  538. | MemberExpression
  539. | MetaProperty
  540. | ObjectExpression
  541. | SequenceExpression
  542. | TaggedTemplateExpression
  543. | TemplateLiteral
  544. | ThisExpression
  545. | UpdateExpression
  546. | YieldExpression
  547. | FunctionDeclaration
  548. | VariableDeclaration
  549. | ClassDeclaration
  550. | PrivateIdentifier
  551. | ExpressionStatement
  552. | BlockStatement
  553. | StaticBlock
  554. | EmptyStatement
  555. | DebuggerStatement
  556. | WithStatement
  557. | ReturnStatement
  558. | LabeledStatement
  559. | BreakStatement
  560. | ContinueStatement
  561. | IfStatement
  562. | SwitchStatement
  563. | ThrowStatement
  564. | TryStatement
  565. | WhileStatement
  566. | DoWhileStatement
  567. | ForStatement
  568. | ForInStatement
  569. | ForOfStatement
  570. | ImportDeclaration
  571. | ExportNamedDeclaration
  572. | ExportDefaultDeclaration
  573. | ExportAllDeclaration
  574. | MethodDefinition
  575. | PropertyDefinition
  576. | VariableDeclarator
  577. | Program
  578. | SwitchCase
  579. | CatchClause
  580. | ObjectPattern
  581. | ArrayPattern
  582. | RestElement
  583. | AssignmentPattern
  584. | SpreadElement
  585. | Property
  586. | AssignmentProperty
  587. | ClassBody
  588. | ImportSpecifier
  589. | ImportDefaultSpecifier
  590. | ImportNamespaceSpecifier
  591. | ExportSpecifier
  592. | Super
  593. | TemplateElement;
  594. isUnknown(): boolean;
  595. isNull(): boolean;
  596. isUndefined(): boolean;
  597. isString(): boolean;
  598. isNumber(): boolean;
  599. isBigInt(): boolean;
  600. isBoolean(): boolean;
  601. isRegExp(): boolean;
  602. isConditional(): boolean;
  603. isArray(): boolean;
  604. isConstArray(): boolean;
  605. isIdentifier(): boolean;
  606. isWrapped(): boolean;
  607. isTemplateString(): boolean;
  608. /**
  609. * Is expression a primitive or an object type value?
  610. */
  611. isPrimitiveType(): undefined | boolean;
  612. /**
  613. * Is expression a runtime or compile-time value?
  614. */
  615. isCompileTimeValue(): boolean;
  616. /**
  617. * Gets the compile-time value of the expression
  618. */
  619. asCompileTimeValue(): any;
  620. isTruthy(): boolean;
  621. isFalsy(): boolean;
  622. isNullish(): undefined | boolean;
  623. /**
  624. * Can this expression have side effects?
  625. */
  626. couldHaveSideEffects(): boolean;
  627. /**
  628. * Creates a boolean representation of this evaluated expression.
  629. */
  630. asBool(): undefined | boolean;
  631. /**
  632. * Creates a nullish coalescing representation of this evaluated expression.
  633. */
  634. asNullish(): undefined | boolean;
  635. /**
  636. * Creates a string representation of this evaluated expression.
  637. */
  638. asString(): undefined | string;
  639. setString(string: string): BasicEvaluatedExpression;
  640. setUndefined(): BasicEvaluatedExpression;
  641. setNull(): BasicEvaluatedExpression;
  642. /**
  643. * Set's the value of this expression to a number
  644. */
  645. setNumber(number: number): BasicEvaluatedExpression;
  646. /**
  647. * Set's the value of this expression to a BigInt
  648. */
  649. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  650. /**
  651. * Set's the value of this expression to a boolean
  652. */
  653. setBoolean(bool: boolean): BasicEvaluatedExpression;
  654. /**
  655. * Set's the value of this expression to a regular expression
  656. */
  657. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  658. /**
  659. * Set's the value of this expression to a particular identifier and its members.
  660. */
  661. setIdentifier(
  662. identifier: string | VariableInfoInterface,
  663. rootInfo: string | VariableInfoInterface,
  664. getMembers: () => string[],
  665. getMembersOptionals?: () => boolean[],
  666. getMemberRanges?: () => [number, number][]
  667. ): BasicEvaluatedExpression;
  668. /**
  669. * Wraps an array of expressions with a prefix and postfix expression.
  670. */
  671. setWrapped(
  672. prefix?: null | BasicEvaluatedExpression,
  673. postfix?: null | BasicEvaluatedExpression,
  674. innerExpressions?: BasicEvaluatedExpression[]
  675. ): BasicEvaluatedExpression;
  676. /**
  677. * Stores the options of a conditional expression.
  678. */
  679. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  680. /**
  681. * Adds options to a conditional expression.
  682. */
  683. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  684. /**
  685. * Set's the value of this expression to an array of expressions.
  686. */
  687. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  688. /**
  689. * Set's the value of this expression to an array of strings.
  690. */
  691. setArray(array: string[]): BasicEvaluatedExpression;
  692. /**
  693. * Set's the value of this expression to a processed/unprocessed template string. Used
  694. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  695. */
  696. setTemplateString(
  697. quasis: BasicEvaluatedExpression[],
  698. parts: BasicEvaluatedExpression[],
  699. kind: "raw" | "cooked"
  700. ): BasicEvaluatedExpression;
  701. templateStringKind?: "raw" | "cooked";
  702. setTruthy(): BasicEvaluatedExpression;
  703. setFalsy(): BasicEvaluatedExpression;
  704. /**
  705. * Set's the value of the expression to nullish.
  706. */
  707. setNullish(value: boolean): BasicEvaluatedExpression;
  708. /**
  709. * Set's the range for the expression.
  710. */
  711. setRange(range: [number, number]): BasicEvaluatedExpression;
  712. /**
  713. * Set whether or not the expression has side effects.
  714. */
  715. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  716. /**
  717. * Set the expression node for the expression.
  718. */
  719. setExpression(
  720. expression?:
  721. | UnaryExpression
  722. | ArrayExpression
  723. | ArrowFunctionExpression
  724. | AssignmentExpression
  725. | AwaitExpression
  726. | BinaryExpression
  727. | SimpleCallExpression
  728. | NewExpression
  729. | ChainExpression
  730. | ClassExpression
  731. | ConditionalExpression
  732. | FunctionExpression
  733. | Identifier
  734. | ImportExpression
  735. | SimpleLiteral
  736. | RegExpLiteral
  737. | BigIntLiteral
  738. | LogicalExpression
  739. | MemberExpression
  740. | MetaProperty
  741. | ObjectExpression
  742. | SequenceExpression
  743. | TaggedTemplateExpression
  744. | TemplateLiteral
  745. | ThisExpression
  746. | UpdateExpression
  747. | YieldExpression
  748. | FunctionDeclaration
  749. | VariableDeclaration
  750. | ClassDeclaration
  751. | PrivateIdentifier
  752. | ExpressionStatement
  753. | BlockStatement
  754. | StaticBlock
  755. | EmptyStatement
  756. | DebuggerStatement
  757. | WithStatement
  758. | ReturnStatement
  759. | LabeledStatement
  760. | BreakStatement
  761. | ContinueStatement
  762. | IfStatement
  763. | SwitchStatement
  764. | ThrowStatement
  765. | TryStatement
  766. | WhileStatement
  767. | DoWhileStatement
  768. | ForStatement
  769. | ForInStatement
  770. | ForOfStatement
  771. | ImportDeclaration
  772. | ExportNamedDeclaration
  773. | ExportDefaultDeclaration
  774. | ExportAllDeclaration
  775. | MethodDefinition
  776. | PropertyDefinition
  777. | VariableDeclarator
  778. | Program
  779. | SwitchCase
  780. | CatchClause
  781. | ObjectPattern
  782. | ArrayPattern
  783. | RestElement
  784. | AssignmentPattern
  785. | SpreadElement
  786. | Property
  787. | AssignmentProperty
  788. | ClassBody
  789. | ImportSpecifier
  790. | ImportDefaultSpecifier
  791. | ImportNamespaceSpecifier
  792. | ExportSpecifier
  793. | Super
  794. | TemplateElement
  795. ): BasicEvaluatedExpression;
  796. }
  797. type BufferEncoding =
  798. | "ascii"
  799. | "utf8"
  800. | "utf-8"
  801. | "utf16le"
  802. | "utf-16le"
  803. | "ucs2"
  804. | "ucs-2"
  805. | "latin1"
  806. | "binary"
  807. | "base64"
  808. | "base64url"
  809. | "hex";
  810. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  811. type BuildInfo = KnownBuildInfo & Record<string, any>;
  812. type BuildMeta = KnownBuildMeta & Record<string, any>;
  813. declare abstract class ByTypeGenerator extends Generator {
  814. map: Record<string, Generator>;
  815. }
  816. declare const CIRCULAR_CONNECTION: unique symbol;
  817. declare class Cache {
  818. constructor();
  819. hooks: {
  820. get: AsyncSeriesBailHook<
  821. [
  822. string,
  823. null | Etag,
  824. ((result: any, callback: (arg0?: Error) => void) => void)[]
  825. ],
  826. any
  827. >;
  828. store: AsyncParallelHook<[string, null | Etag, any]>;
  829. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  830. beginIdle: SyncHook<[]>;
  831. endIdle: AsyncParallelHook<[]>;
  832. shutdown: AsyncParallelHook<[]>;
  833. };
  834. get<T>(
  835. identifier: string,
  836. etag: null | Etag,
  837. callback: CallbackCacheCache<T>
  838. ): void;
  839. store<T>(
  840. identifier: string,
  841. etag: null | Etag,
  842. data: T,
  843. callback: CallbackCacheCache<void>
  844. ): void;
  845. /**
  846. * After this method has succeeded the cache can only be restored when build dependencies are
  847. */
  848. storeBuildDependencies(
  849. dependencies: Iterable<string>,
  850. callback: CallbackCacheCache<void>
  851. ): void;
  852. beginIdle(): void;
  853. endIdle(callback: CallbackCacheCache<void>): void;
  854. shutdown(callback: CallbackCacheCache<void>): void;
  855. static STAGE_MEMORY: number;
  856. static STAGE_DEFAULT: number;
  857. static STAGE_DISK: number;
  858. static STAGE_NETWORK: number;
  859. }
  860. declare abstract class CacheFacade {
  861. getChildCache(name: string): CacheFacade;
  862. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  863. getLazyHashedEtag(obj: HashableObject): Etag;
  864. mergeEtags(a: Etag, b: Etag): Etag;
  865. get<T>(
  866. identifier: string,
  867. etag: null | Etag,
  868. callback: CallbackCacheCacheFacade<T>
  869. ): void;
  870. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  871. store<T>(
  872. identifier: string,
  873. etag: null | Etag,
  874. data: T,
  875. callback: CallbackCacheCacheFacade<void>
  876. ): void;
  877. storePromise<T>(
  878. identifier: string,
  879. etag: null | Etag,
  880. data: T
  881. ): Promise<void>;
  882. provide<T>(
  883. identifier: string,
  884. etag: null | Etag,
  885. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  886. callback: CallbackNormalErrorCache<T>
  887. ): void;
  888. providePromise<T>(
  889. identifier: string,
  890. etag: null | Etag,
  891. computer: () => T | Promise<T>
  892. ): Promise<T>;
  893. }
  894. declare interface CacheGroupSource {
  895. key?: string;
  896. priority?: number;
  897. getName?: (
  898. module?: Module,
  899. chunks?: Chunk[],
  900. key?: string
  901. ) => undefined | string;
  902. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  903. enforce?: boolean;
  904. minSize: SplitChunksSizes;
  905. minSizeReduction: SplitChunksSizes;
  906. minRemainingSize: SplitChunksSizes;
  907. enforceSizeThreshold: SplitChunksSizes;
  908. maxAsyncSize: SplitChunksSizes;
  909. maxInitialSize: SplitChunksSizes;
  910. minChunks?: number;
  911. maxAsyncRequests?: number;
  912. maxInitialRequests?: number;
  913. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  914. idHint?: string;
  915. automaticNameDelimiter?: string;
  916. reuseExistingChunk?: boolean;
  917. usedExports?: boolean;
  918. }
  919. declare interface CacheGroupsContext {
  920. moduleGraph: ModuleGraph;
  921. chunkGraph: ChunkGraph;
  922. }
  923. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  924. declare class CachedSource extends Source {
  925. constructor(source: Source);
  926. constructor(source: Source | (() => Source), cachedData?: any);
  927. original(): Source;
  928. originalLazy(): Source | (() => Source);
  929. getCachedData(): any;
  930. }
  931. type CallExpression = SimpleCallExpression | NewExpression;
  932. declare interface CallExpressionInfo {
  933. type: "call";
  934. call: CallExpression;
  935. calleeName: string;
  936. rootInfo: string | VariableInfo;
  937. getCalleeMembers: () => string[];
  938. name: string;
  939. getMembers: () => string[];
  940. getMembersOptionals: () => boolean[];
  941. getMemberRanges: () => [number, number][];
  942. }
  943. declare interface CallbackAsyncQueue<T> {
  944. (err?: null | WebpackError, result?: T): any;
  945. }
  946. declare interface CallbackCacheCache<T> {
  947. (err: null | WebpackError, result?: T): void;
  948. }
  949. declare interface CallbackCacheCacheFacade<T> {
  950. (err?: null | Error, result?: null | T): void;
  951. }
  952. declare interface CallbackFunction_1<T> {
  953. (err: null | Error, result?: T): any;
  954. }
  955. declare interface CallbackFunction_2<T> {
  956. (err?: null | Error, result?: T): any;
  957. }
  958. declare interface CallbackNormalErrorCache<T> {
  959. (err?: null | Error, result?: T): void;
  960. }
  961. declare interface CallbackNormalModuleFactory<T> {
  962. (err?: null | Error, stats?: T): void;
  963. }
  964. declare interface CallbackWebpack<T> {
  965. (err: null | Error, stats?: T): void;
  966. }
  967. type Cell<T> = undefined | T;
  968. declare class Chunk {
  969. constructor(name?: string, backCompat?: boolean);
  970. id: null | string | number;
  971. ids: null | ChunkId[];
  972. debugId: number;
  973. name?: string;
  974. idNameHints: SortableSet<string>;
  975. preventIntegration: boolean;
  976. filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  977. cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  978. runtime: RuntimeSpec;
  979. files: Set<string>;
  980. auxiliaryFiles: Set<string>;
  981. rendered: boolean;
  982. hash?: string;
  983. contentHash: Record<string, string>;
  984. renderedHash?: string;
  985. chunkReason?: string;
  986. extraAsync: boolean;
  987. get entryModule(): Module;
  988. hasEntryModule(): boolean;
  989. addModule(module: Module): boolean;
  990. removeModule(module: Module): void;
  991. getNumberOfModules(): number;
  992. get modulesIterable(): Iterable<Module>;
  993. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  994. containsModule(module: Module): boolean;
  995. getModules(): Module[];
  996. remove(): void;
  997. moveModule(module: Module, otherChunk: Chunk): void;
  998. integrate(otherChunk: Chunk): boolean;
  999. canBeIntegrated(otherChunk: Chunk): boolean;
  1000. isEmpty(): boolean;
  1001. modulesSize(): number;
  1002. size(options?: ChunkSizeOptions): number;
  1003. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  1004. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  1005. hasModuleInGraph(
  1006. filterFn: (m: Module) => boolean,
  1007. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1008. ): boolean;
  1009. getChunkMaps(realHash: boolean): ChunkMaps;
  1010. hasRuntime(): boolean;
  1011. canBeInitial(): boolean;
  1012. isOnlyInitial(): boolean;
  1013. getEntryOptions(): undefined | EntryOptions;
  1014. addGroup(chunkGroup: ChunkGroup): void;
  1015. removeGroup(chunkGroup: ChunkGroup): void;
  1016. isInGroup(chunkGroup: ChunkGroup): boolean;
  1017. getNumberOfGroups(): number;
  1018. get groupsIterable(): SortableSet<ChunkGroup>;
  1019. disconnectFromGroups(): void;
  1020. split(newChunk: Chunk): void;
  1021. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1022. getAllAsyncChunks(): Set<Chunk>;
  1023. getAllInitialChunks(): Set<Chunk>;
  1024. getAllReferencedChunks(): Set<Chunk>;
  1025. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1026. hasAsyncChunks(): boolean;
  1027. getChildIdsByOrders(
  1028. chunkGraph: ChunkGraph,
  1029. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1030. ): Record<string, (string | number)[]>;
  1031. getChildrenOfTypeInOrder(
  1032. chunkGraph: ChunkGraph,
  1033. type: string
  1034. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  1035. getChildIdsByOrdersMap(
  1036. chunkGraph: ChunkGraph,
  1037. includeDirectChildren?: boolean,
  1038. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1039. ): Record<string | number, Record<string, (string | number)[]>>;
  1040. }
  1041. declare class ChunkGraph {
  1042. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  1043. moduleGraph: ModuleGraph;
  1044. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1045. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1046. disconnectChunk(chunk: Chunk): void;
  1047. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1048. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1049. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1050. attachDependentHashModules(
  1051. chunk: Chunk,
  1052. modules: Iterable<RuntimeModule>
  1053. ): void;
  1054. replaceModule(oldModule: Module, newModule: Module): void;
  1055. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1056. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1057. isEntryModule(module: Module): boolean;
  1058. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1059. getOrderedModuleChunksIterable(
  1060. module: Module,
  1061. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  1062. ): Iterable<Chunk>;
  1063. getModuleChunks(module: Module): Chunk[];
  1064. getNumberOfModuleChunks(module: Module): number;
  1065. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1066. getNumberOfChunkModules(chunk: Chunk): number;
  1067. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1068. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1069. getChunkModulesIterableBySourceType(
  1070. chunk: Chunk,
  1071. sourceType: string
  1072. ): undefined | Iterable<Module>;
  1073. setChunkModuleSourceTypes(
  1074. chunk: Chunk,
  1075. module: Module,
  1076. sourceTypes: Set<string>
  1077. ): void;
  1078. getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
  1079. getModuleSourceTypes(module: Module): Set<string>;
  1080. getOrderedChunkModulesIterable(
  1081. chunk: Chunk,
  1082. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1083. ): Iterable<Module>;
  1084. getOrderedChunkModulesIterableBySourceType(
  1085. chunk: Chunk,
  1086. sourceType: string,
  1087. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1088. ): undefined | Iterable<Module>;
  1089. getChunkModules(chunk: Chunk): Module[];
  1090. getOrderedChunkModules(
  1091. chunk: Chunk,
  1092. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1093. ): Module[];
  1094. getChunkModuleIdMap(
  1095. chunk: Chunk,
  1096. filterFn: (m: Module) => boolean,
  1097. includeAllChunks?: boolean
  1098. ): Record<string | number, (string | number)[]>;
  1099. getChunkModuleRenderedHashMap(
  1100. chunk: Chunk,
  1101. filterFn: (m: Module) => boolean,
  1102. hashLength?: number,
  1103. includeAllChunks?: boolean
  1104. ): Record<string | number, Record<string | number, string>>;
  1105. getChunkConditionMap(
  1106. chunk: Chunk,
  1107. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1108. ): Record<string | number, boolean>;
  1109. hasModuleInGraph(
  1110. chunk: Chunk,
  1111. filterFn: (m: Module) => boolean,
  1112. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1113. ): boolean;
  1114. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1115. getChunkModulesSize(chunk: Chunk): number;
  1116. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1117. getChunkRootModules(chunk: Chunk): Module[];
  1118. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1119. getIntegratedChunksSize(
  1120. chunkA: Chunk,
  1121. chunkB: Chunk,
  1122. options?: ChunkSizeOptions
  1123. ): number;
  1124. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1125. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1126. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1127. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1128. connectChunkAndEntryModule(
  1129. chunk: Chunk,
  1130. module: Module,
  1131. entrypoint?: Entrypoint
  1132. ): void;
  1133. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1134. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1135. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1136. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1137. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1138. disconnectEntryModule(module: Module): void;
  1139. disconnectEntries(chunk: Chunk): void;
  1140. getNumberOfEntryModules(chunk: Chunk): number;
  1141. getNumberOfRuntimeModules(chunk: Chunk): number;
  1142. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1143. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1144. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1145. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1146. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1147. getChunkFullHashModulesIterable(
  1148. chunk: Chunk
  1149. ): undefined | Iterable<RuntimeModule>;
  1150. getChunkFullHashModulesSet(
  1151. chunk: Chunk
  1152. ): undefined | ReadonlySet<RuntimeModule>;
  1153. getChunkDependentHashModulesIterable(
  1154. chunk: Chunk
  1155. ): undefined | Iterable<RuntimeModule>;
  1156. getChunkEntryModulesWithChunkGroupIterable(
  1157. chunk: Chunk
  1158. ): Iterable<[Module, undefined | Entrypoint]>;
  1159. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1160. connectBlockAndChunkGroup(
  1161. depBlock: AsyncDependenciesBlock,
  1162. chunkGroup: ChunkGroup
  1163. ): void;
  1164. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1165. getModuleId(module: Module): ModuleId;
  1166. setModuleId(module: Module, id: ModuleId): void;
  1167. getRuntimeId(runtime: string): string | number;
  1168. setRuntimeId(runtime: string, id: string | number): void;
  1169. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1170. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1171. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1172. setModuleHashes(
  1173. module: Module,
  1174. runtime: RuntimeSpec,
  1175. hash: string,
  1176. renderedHash: string
  1177. ): void;
  1178. addModuleRuntimeRequirements(
  1179. module: Module,
  1180. runtime: RuntimeSpec,
  1181. items: Set<string>,
  1182. transferOwnership?: boolean
  1183. ): void;
  1184. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1185. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1186. getModuleRuntimeRequirements(
  1187. module: Module,
  1188. runtime: RuntimeSpec
  1189. ): ReadonlySet<string>;
  1190. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1191. getModuleGraphHash(
  1192. module: Module,
  1193. runtime: RuntimeSpec,
  1194. withConnections?: boolean
  1195. ): string;
  1196. getModuleGraphHashBigInt(
  1197. module: Module,
  1198. runtime: RuntimeSpec,
  1199. withConnections?: boolean
  1200. ): bigint;
  1201. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1202. static getChunkGraphForModule(
  1203. module: Module,
  1204. deprecateMessage: string,
  1205. deprecationCode: string
  1206. ): ChunkGraph;
  1207. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1208. static clearChunkGraphForModule(module: Module): void;
  1209. static getChunkGraphForChunk(
  1210. chunk: Chunk,
  1211. deprecateMessage: string,
  1212. deprecationCode: string
  1213. ): ChunkGraph;
  1214. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1215. static clearChunkGraphForChunk(chunk: Chunk): void;
  1216. }
  1217. declare abstract class ChunkGroup {
  1218. groupDebugId: number;
  1219. options: ChunkGroupOptions;
  1220. chunks: Chunk[];
  1221. origins: OriginRecord[];
  1222. index?: number;
  1223. /**
  1224. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1225. */
  1226. addOptions(options: ChunkGroupOptions): void;
  1227. /**
  1228. * returns the name of current ChunkGroup
  1229. * sets a new name for current ChunkGroup
  1230. */
  1231. name?: string;
  1232. /**
  1233. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1234. */
  1235. get debugId(): string;
  1236. /**
  1237. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1238. */
  1239. get id(): string;
  1240. /**
  1241. * Performs an unshift of a specific chunk
  1242. */
  1243. unshiftChunk(chunk: Chunk): boolean;
  1244. /**
  1245. * inserts a chunk before another existing chunk in group
  1246. */
  1247. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1248. /**
  1249. * add a chunk into ChunkGroup. Is pushed on or prepended
  1250. */
  1251. pushChunk(chunk: Chunk): boolean;
  1252. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1253. removeChunk(chunk: Chunk): boolean;
  1254. isInitial(): boolean;
  1255. addChild(group: ChunkGroup): boolean;
  1256. getChildren(): ChunkGroup[];
  1257. getNumberOfChildren(): number;
  1258. get childrenIterable(): SortableSet<ChunkGroup>;
  1259. removeChild(group: ChunkGroup): boolean;
  1260. addParent(parentChunk: ChunkGroup): boolean;
  1261. getParents(): ChunkGroup[];
  1262. getNumberOfParents(): number;
  1263. hasParent(parent: ChunkGroup): boolean;
  1264. get parentsIterable(): SortableSet<ChunkGroup>;
  1265. removeParent(chunkGroup: ChunkGroup): boolean;
  1266. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1267. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1268. getBlocks(): AsyncDependenciesBlock[];
  1269. getNumberOfBlocks(): number;
  1270. hasBlock(block: AsyncDependenciesBlock): boolean;
  1271. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1272. addBlock(block: AsyncDependenciesBlock): boolean;
  1273. addOrigin(module: Module, loc: DependencyLocation, request: string): void;
  1274. getFiles(): string[];
  1275. remove(): void;
  1276. sortItems(): void;
  1277. /**
  1278. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1279. * Sorting values are based off of number of chunks in ChunkGroup.
  1280. */
  1281. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1282. getChildrenByOrders(
  1283. moduleGraph: ModuleGraph,
  1284. chunkGraph: ChunkGraph
  1285. ): Record<string, ChunkGroup[]>;
  1286. /**
  1287. * Sets the top-down index of a module in this ChunkGroup
  1288. */
  1289. setModulePreOrderIndex(module: Module, index: number): void;
  1290. /**
  1291. * Gets the top-down index of a module in this ChunkGroup
  1292. */
  1293. getModulePreOrderIndex(module: Module): undefined | number;
  1294. /**
  1295. * Sets the bottom-up index of a module in this ChunkGroup
  1296. */
  1297. setModulePostOrderIndex(module: Module, index: number): void;
  1298. /**
  1299. * Gets the bottom-up index of a module in this ChunkGroup
  1300. */
  1301. getModulePostOrderIndex(module: Module): undefined | number;
  1302. checkConstraints(): void;
  1303. getModuleIndex: (module: Module) => undefined | number;
  1304. getModuleIndex2: (module: Module) => undefined | number;
  1305. }
  1306. type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
  1307. declare interface ChunkHashContext {
  1308. /**
  1309. * results of code generation
  1310. */
  1311. codeGenerationResults: CodeGenerationResults;
  1312. /**
  1313. * the runtime template
  1314. */
  1315. runtimeTemplate: RuntimeTemplate;
  1316. /**
  1317. * the module graph
  1318. */
  1319. moduleGraph: ModuleGraph;
  1320. /**
  1321. * the chunk graph
  1322. */
  1323. chunkGraph: ChunkGraph;
  1324. }
  1325. type ChunkId = string | number;
  1326. declare interface ChunkMaps {
  1327. hash: Record<string | number, string>;
  1328. contentHash: Record<string | number, Record<string, string>>;
  1329. name: Record<string | number, string>;
  1330. }
  1331. declare class ChunkModuleIdRangePlugin {
  1332. constructor(options: ChunkModuleIdRangePluginOptions);
  1333. options: ChunkModuleIdRangePluginOptions;
  1334. /**
  1335. * Apply the plugin
  1336. */
  1337. apply(compiler: Compiler): void;
  1338. }
  1339. declare interface ChunkModuleIdRangePluginOptions {
  1340. /**
  1341. * the chunk name
  1342. */
  1343. name: string;
  1344. /**
  1345. * order
  1346. */
  1347. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1348. /**
  1349. * start id
  1350. */
  1351. start?: number;
  1352. /**
  1353. * end id
  1354. */
  1355. end?: number;
  1356. }
  1357. declare interface ChunkModuleMaps {
  1358. id: Record<string | number, (string | number)[]>;
  1359. hash: Record<string | number, string>;
  1360. }
  1361. declare interface ChunkPathData {
  1362. id: string | number;
  1363. name?: string;
  1364. hash: string;
  1365. hashWithLength?: (arg0: number) => string;
  1366. contentHash?: Record<string, string>;
  1367. contentHashWithLength?: Record<string, (length: number) => string>;
  1368. }
  1369. declare class ChunkPrefetchPreloadPlugin {
  1370. constructor();
  1371. apply(compiler: Compiler): void;
  1372. }
  1373. declare interface ChunkRenderContext {
  1374. /**
  1375. * the chunk
  1376. */
  1377. chunk: Chunk;
  1378. /**
  1379. * the dependency templates
  1380. */
  1381. dependencyTemplates: DependencyTemplates;
  1382. /**
  1383. * the runtime template
  1384. */
  1385. runtimeTemplate: RuntimeTemplate;
  1386. /**
  1387. * the module graph
  1388. */
  1389. moduleGraph: ModuleGraph;
  1390. /**
  1391. * the chunk graph
  1392. */
  1393. chunkGraph: ChunkGraph;
  1394. /**
  1395. * results of code generation
  1396. */
  1397. codeGenerationResults: CodeGenerationResults;
  1398. /**
  1399. * init fragments for the chunk
  1400. */
  1401. chunkInitFragments: InitFragment<ChunkRenderContext>[];
  1402. /**
  1403. * rendering in strict context
  1404. */
  1405. strictMode: boolean;
  1406. }
  1407. declare interface ChunkSizeOptions {
  1408. /**
  1409. * constant overhead for a chunk
  1410. */
  1411. chunkOverhead?: number;
  1412. /**
  1413. * multiplicator for initial chunks
  1414. */
  1415. entryChunkMultiplicator?: number;
  1416. }
  1417. declare abstract class ChunkTemplate {
  1418. hooks: Readonly<{
  1419. renderManifest: { tap: (options?: any, fn?: any) => void };
  1420. modules: { tap: (options?: any, fn?: any) => void };
  1421. render: { tap: (options?: any, fn?: any) => void };
  1422. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  1423. hash: { tap: (options?: any, fn?: any) => void };
  1424. hashForChunk: { tap: (options?: any, fn?: any) => void };
  1425. }>;
  1426. get outputOptions(): Output;
  1427. }
  1428. /**
  1429. * Advanced options for cleaning assets.
  1430. */
  1431. declare interface CleanOptions {
  1432. /**
  1433. * Log the assets that should be removed instead of deleting them.
  1434. */
  1435. dry?: boolean;
  1436. /**
  1437. * Keep these assets.
  1438. */
  1439. keep?: string | RegExp | ((filename: string) => boolean);
  1440. }
  1441. declare class CleanPlugin {
  1442. constructor(options?: CleanOptions);
  1443. options: {
  1444. /**
  1445. * Log the assets that should be removed instead of deleting them.
  1446. */
  1447. dry: boolean;
  1448. /**
  1449. * Keep these assets.
  1450. */
  1451. keep?: string | RegExp | ((filename: string) => boolean);
  1452. };
  1453. /**
  1454. * Apply the plugin
  1455. */
  1456. apply(compiler: Compiler): void;
  1457. static getCompilationHooks(
  1458. compilation: Compilation
  1459. ): CleanPluginCompilationHooks;
  1460. }
  1461. declare interface CleanPluginCompilationHooks {
  1462. /**
  1463. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1464. */
  1465. keep: SyncBailHook<[string], boolean>;
  1466. }
  1467. declare interface CodeGenerationContext {
  1468. /**
  1469. * the dependency templates
  1470. */
  1471. dependencyTemplates: DependencyTemplates;
  1472. /**
  1473. * the runtime template
  1474. */
  1475. runtimeTemplate: RuntimeTemplate;
  1476. /**
  1477. * the module graph
  1478. */
  1479. moduleGraph: ModuleGraph;
  1480. /**
  1481. * the chunk graph
  1482. */
  1483. chunkGraph: ChunkGraph;
  1484. /**
  1485. * the runtimes code should be generated for
  1486. */
  1487. runtime: RuntimeSpec;
  1488. /**
  1489. * when in concatenated module, information about other concatenated modules
  1490. */
  1491. concatenationScope?: ConcatenationScope;
  1492. /**
  1493. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1494. */
  1495. codeGenerationResults?: CodeGenerationResults;
  1496. /**
  1497. * the compilation
  1498. */
  1499. compilation?: Compilation;
  1500. /**
  1501. * source types
  1502. */
  1503. sourceTypes?: ReadonlySet<string>;
  1504. }
  1505. declare interface CodeGenerationResult {
  1506. /**
  1507. * the resulting sources for all source types
  1508. */
  1509. sources: Map<string, Source>;
  1510. /**
  1511. * the resulting data for all source types
  1512. */
  1513. data?: Map<string, any>;
  1514. /**
  1515. * the runtime requirements
  1516. */
  1517. runtimeRequirements: ReadonlySet<string>;
  1518. /**
  1519. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1520. */
  1521. hash?: string;
  1522. }
  1523. declare abstract class CodeGenerationResults {
  1524. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1525. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1526. has(module: Module, runtime: RuntimeSpec): boolean;
  1527. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1528. getRuntimeRequirements(
  1529. module: Module,
  1530. runtime: RuntimeSpec
  1531. ): ReadonlySet<string>;
  1532. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1533. getHash(module: Module, runtime: RuntimeSpec): any;
  1534. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1535. }
  1536. type CodeValue =
  1537. | undefined
  1538. | null
  1539. | string
  1540. | number
  1541. | bigint
  1542. | boolean
  1543. | Function
  1544. | RegExp
  1545. | RuntimeValue
  1546. | {
  1547. [index: string]: RecursiveArrayOrRecord<
  1548. | undefined
  1549. | null
  1550. | string
  1551. | number
  1552. | bigint
  1553. | boolean
  1554. | Function
  1555. | RegExp
  1556. | RuntimeValue
  1557. >;
  1558. }
  1559. | RecursiveArrayOrRecord<
  1560. | undefined
  1561. | null
  1562. | string
  1563. | number
  1564. | bigint
  1565. | boolean
  1566. | Function
  1567. | RegExp
  1568. | RuntimeValue
  1569. >[];
  1570. type CodeValuePrimitive =
  1571. | undefined
  1572. | null
  1573. | string
  1574. | number
  1575. | bigint
  1576. | boolean
  1577. | Function
  1578. | RegExp;
  1579. declare interface Comparator<T> {
  1580. (arg0: T, arg1: T): 0 | 1 | -1;
  1581. }
  1582. declare class CompatSource extends Source {
  1583. constructor(sourceLike: SourceLike);
  1584. static from(sourceLike: SourceLike): Source;
  1585. }
  1586. declare class Compilation {
  1587. /**
  1588. * Creates an instance of Compilation.
  1589. */
  1590. constructor(compiler: Compiler, params: CompilationParams);
  1591. hooks: Readonly<{
  1592. buildModule: SyncHook<[Module]>;
  1593. rebuildModule: SyncHook<[Module]>;
  1594. failedModule: SyncHook<[Module, WebpackError]>;
  1595. succeedModule: SyncHook<[Module]>;
  1596. stillValidModule: SyncHook<[Module]>;
  1597. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1598. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1599. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1600. dependencyReferencedExports: SyncWaterfallHook<
  1601. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1602. >;
  1603. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1604. prepareModuleExecution: AsyncParallelHook<
  1605. [ExecuteModuleArgument, ExecuteModuleContext]
  1606. >;
  1607. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1608. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1609. unseal: SyncHook<[]>;
  1610. seal: SyncHook<[]>;
  1611. beforeChunks: SyncHook<[]>;
  1612. /**
  1613. * The `afterChunks` hook is called directly after the chunks and module graph have
  1614. * been created and before the chunks and modules have been optimized. This hook is useful to
  1615. * inspect, analyze, and/or modify the chunk graph.
  1616. */
  1617. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1618. optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
  1619. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1620. optimize: SyncHook<[]>;
  1621. optimizeModules: SyncBailHook<[Iterable<Module>], any>;
  1622. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1623. optimizeChunks: SyncBailHook<
  1624. [Iterable<Chunk>, ChunkGroup[]],
  1625. boolean | void
  1626. >;
  1627. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1628. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1629. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1630. optimizeChunkModules: AsyncSeriesBailHook<
  1631. [Iterable<Chunk>, Iterable<Module>],
  1632. void
  1633. >;
  1634. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1635. shouldRecord: SyncBailHook<[], undefined | boolean>;
  1636. additionalChunkRuntimeRequirements: SyncHook<
  1637. [Chunk, Set<string>, RuntimeRequirementsContext]
  1638. >;
  1639. runtimeRequirementInChunk: HookMap<
  1640. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1641. >;
  1642. additionalModuleRuntimeRequirements: SyncHook<
  1643. [Module, Set<string>, RuntimeRequirementsContext]
  1644. >;
  1645. runtimeRequirementInModule: HookMap<
  1646. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
  1647. >;
  1648. additionalTreeRuntimeRequirements: SyncHook<
  1649. [Chunk, Set<string>, RuntimeRequirementsContext]
  1650. >;
  1651. runtimeRequirementInTree: HookMap<
  1652. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1653. >;
  1654. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1655. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1656. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1657. moduleIds: SyncHook<[Iterable<Module>]>;
  1658. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1659. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1660. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1661. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1662. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1663. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1664. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1665. recordModules: SyncHook<[Iterable<Module>, any]>;
  1666. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1667. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1668. beforeModuleHash: SyncHook<[]>;
  1669. afterModuleHash: SyncHook<[]>;
  1670. beforeCodeGeneration: SyncHook<[]>;
  1671. afterCodeGeneration: SyncHook<[]>;
  1672. beforeRuntimeRequirements: SyncHook<[]>;
  1673. afterRuntimeRequirements: SyncHook<[]>;
  1674. beforeHash: SyncHook<[]>;
  1675. contentHash: SyncHook<[Chunk]>;
  1676. afterHash: SyncHook<[]>;
  1677. recordHash: SyncHook<[any]>;
  1678. record: SyncHook<[Compilation, any]>;
  1679. beforeModuleAssets: SyncHook<[]>;
  1680. shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
  1681. beforeChunkAssets: SyncHook<[]>;
  1682. additionalChunkAssets: FakeHook<
  1683. Pick<
  1684. AsyncSeriesHook<[Set<Chunk>]>,
  1685. "name" | "tap" | "tapAsync" | "tapPromise"
  1686. >
  1687. >;
  1688. additionalAssets: FakeHook<
  1689. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1690. >;
  1691. optimizeChunkAssets: FakeHook<
  1692. Pick<
  1693. AsyncSeriesHook<[Set<Chunk>]>,
  1694. "name" | "tap" | "tapAsync" | "tapPromise"
  1695. >
  1696. >;
  1697. afterOptimizeChunkAssets: FakeHook<
  1698. Pick<
  1699. AsyncSeriesHook<[Set<Chunk>]>,
  1700. "name" | "tap" | "tapAsync" | "tapPromise"
  1701. >
  1702. >;
  1703. optimizeAssets: AsyncSeriesHook<
  1704. [CompilationAssets],
  1705. ProcessAssetsAdditionalOptions
  1706. >;
  1707. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1708. processAssets: AsyncSeriesHook<
  1709. [CompilationAssets],
  1710. ProcessAssetsAdditionalOptions
  1711. >;
  1712. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1713. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1714. needAdditionalSeal: SyncBailHook<[], undefined | boolean>;
  1715. afterSeal: AsyncSeriesHook<[]>;
  1716. renderManifest: SyncWaterfallHook<
  1717. [RenderManifestEntry[], RenderManifestOptions]
  1718. >;
  1719. fullHash: SyncHook<[Hash]>;
  1720. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1721. moduleAsset: SyncHook<[Module, string]>;
  1722. chunkAsset: SyncHook<[Chunk, string]>;
  1723. assetPath: SyncWaterfallHook<[string, object, undefined | AssetInfo]>;
  1724. needAdditionalPass: SyncBailHook<[], boolean>;
  1725. childCompiler: SyncHook<[Compiler, string, number]>;
  1726. log: SyncBailHook<[string, LogEntry], true>;
  1727. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1728. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1729. statsPreset: HookMap<
  1730. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1731. >;
  1732. statsNormalize: SyncHook<
  1733. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1734. >;
  1735. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1736. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1737. get normalModuleLoader(): SyncHook<[object, NormalModule]>;
  1738. }>;
  1739. name?: string;
  1740. startTime?: number;
  1741. endTime?: number;
  1742. compiler: Compiler;
  1743. resolverFactory: ResolverFactory;
  1744. inputFileSystem: InputFileSystem;
  1745. fileSystemInfo: FileSystemInfo;
  1746. valueCacheVersions: Map<string, string | Set<string>>;
  1747. requestShortener: RequestShortener;
  1748. compilerPath: string;
  1749. logger: WebpackLogger;
  1750. options: WebpackOptionsNormalized;
  1751. outputOptions: OutputNormalized;
  1752. bail: boolean;
  1753. profile: boolean;
  1754. params: CompilationParams;
  1755. mainTemplate: MainTemplate;
  1756. chunkTemplate: ChunkTemplate;
  1757. runtimeTemplate: RuntimeTemplate;
  1758. moduleTemplates: ModuleTemplates;
  1759. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1760. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1761. moduleGraph: ModuleGraph;
  1762. chunkGraph: ChunkGraph;
  1763. codeGenerationResults: CodeGenerationResults;
  1764. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1765. addModuleQueue: AsyncQueue<Module, string, Module>;
  1766. factorizeQueue: AsyncQueue<
  1767. FactorizeModuleOptions,
  1768. string,
  1769. Module | ModuleFactoryResult
  1770. >;
  1771. buildQueue: AsyncQueue<Module, Module, Module>;
  1772. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1773. /**
  1774. * Modules in value are building during the build of Module in key.
  1775. * Means value blocking key from finishing.
  1776. * Needed to detect build cycles.
  1777. */
  1778. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1779. entries: Map<string, EntryData>;
  1780. globalEntry: EntryData;
  1781. entrypoints: Map<string, Entrypoint>;
  1782. asyncEntrypoints: Entrypoint[];
  1783. chunks: Set<Chunk>;
  1784. chunkGroups: ChunkGroup[];
  1785. namedChunkGroups: Map<string, ChunkGroup>;
  1786. namedChunks: Map<string, Chunk>;
  1787. modules: Set<Module>;
  1788. records: any;
  1789. additionalChunkAssets: string[];
  1790. assets: CompilationAssets;
  1791. assetsInfo: Map<string, AssetInfo>;
  1792. errors: WebpackError[];
  1793. warnings: WebpackError[];
  1794. children: Compilation[];
  1795. logging: Map<string, LogEntry[]>;
  1796. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1797. dependencyTemplates: DependencyTemplates;
  1798. childrenCounters: object;
  1799. usedChunkIds: Set<string | number>;
  1800. usedModuleIds: Set<number>;
  1801. needAdditionalPass: boolean;
  1802. builtModules: WeakSet<Module>;
  1803. codeGeneratedModules: WeakSet<Module>;
  1804. buildTimeExecutedModules: WeakSet<Module>;
  1805. emittedAssets: Set<string>;
  1806. comparedForEmitAssets: Set<string>;
  1807. fileDependencies: LazySet<string>;
  1808. contextDependencies: LazySet<string>;
  1809. missingDependencies: LazySet<string>;
  1810. buildDependencies: LazySet<string>;
  1811. compilationDependencies: { add: (item: string) => LazySet<string> };
  1812. getStats(): Stats;
  1813. createStatsOptions(
  1814. optionsOrPreset?: string | boolean | StatsOptions,
  1815. context?: CreateStatsOptionsContext
  1816. ): NormalizedStatsOptions;
  1817. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  1818. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  1819. getCache(name: string): CacheFacade;
  1820. getLogger(name: string | (() => string)): WebpackLogger;
  1821. addModule(
  1822. module: Module,
  1823. callback: (err?: null | WebpackError, result?: Module) => void
  1824. ): void;
  1825. /**
  1826. * Fetches a module from a compilation by its identifier
  1827. */
  1828. getModule(module: Module): Module;
  1829. /**
  1830. * Attempts to search for a module by its identifier
  1831. */
  1832. findModule(identifier: string): undefined | Module;
  1833. /**
  1834. * Schedules a build of the module object
  1835. */
  1836. buildModule(
  1837. module: Module,
  1838. callback: (err?: null | WebpackError, result?: Module) => void
  1839. ): void;
  1840. processModuleDependencies(
  1841. module: Module,
  1842. callback: (err?: null | WebpackError, result?: Module) => void
  1843. ): void;
  1844. processModuleDependenciesNonRecursive(module: Module): void;
  1845. handleModuleCreation(
  1846. __0: HandleModuleCreationOptions,
  1847. callback: (err?: null | WebpackError, result?: Module) => void
  1848. ): void;
  1849. addModuleChain(
  1850. context: string,
  1851. dependency: Dependency,
  1852. callback: (err?: null | WebpackError, result?: Module) => void
  1853. ): void;
  1854. addModuleTree(
  1855. __0: {
  1856. /**
  1857. * context string path
  1858. */
  1859. context: string;
  1860. /**
  1861. * dependency used to create Module chain
  1862. */
  1863. dependency: Dependency;
  1864. /**
  1865. * additional context info for the root module
  1866. */
  1867. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1868. },
  1869. callback: (err?: null | WebpackError, result?: Module) => void
  1870. ): void;
  1871. addEntry(
  1872. context: string,
  1873. entry: Dependency,
  1874. optionsOrName: string | EntryOptions,
  1875. callback: (err?: null | WebpackError, result?: Module) => void
  1876. ): void;
  1877. addInclude(
  1878. context: string,
  1879. dependency: Dependency,
  1880. options: EntryOptions,
  1881. callback: (err?: null | WebpackError, result?: Module) => void
  1882. ): void;
  1883. rebuildModule(
  1884. module: Module,
  1885. callback: (err?: null | WebpackError, result?: Module) => void
  1886. ): void;
  1887. finish(callback: (err?: null | WebpackError) => void): void;
  1888. unseal(): void;
  1889. seal(callback: (err?: null | WebpackError) => void): void;
  1890. reportDependencyErrorsAndWarnings(
  1891. module: Module,
  1892. blocks: DependenciesBlock[]
  1893. ): boolean;
  1894. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  1895. processRuntimeRequirements(__0?: {
  1896. /**
  1897. * the chunk graph
  1898. */
  1899. chunkGraph?: ChunkGraph;
  1900. /**
  1901. * modules
  1902. */
  1903. modules?: Iterable<Module>;
  1904. /**
  1905. * chunks
  1906. */
  1907. chunks?: Iterable<Chunk>;
  1908. /**
  1909. * codeGenerationResults
  1910. */
  1911. codeGenerationResults?: CodeGenerationResults;
  1912. /**
  1913. * chunkGraphEntries
  1914. */
  1915. chunkGraphEntries?: Iterable<Chunk>;
  1916. }): void;
  1917. addRuntimeModule(
  1918. chunk: Chunk,
  1919. module: RuntimeModule,
  1920. chunkGraph?: ChunkGraph
  1921. ): void;
  1922. /**
  1923. * If `module` is passed, `loc` and `request` must also be passed.
  1924. */
  1925. addChunkInGroup(
  1926. groupOptions: string | ChunkGroupOptions,
  1927. module?: Module,
  1928. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  1929. request?: string
  1930. ): ChunkGroup;
  1931. addAsyncEntrypoint(
  1932. options: EntryOptions,
  1933. module: Module,
  1934. loc: DependencyLocation,
  1935. request: string
  1936. ): Entrypoint;
  1937. /**
  1938. * This method first looks to see if a name is provided for a new chunk,
  1939. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  1940. */
  1941. addChunk(name?: string): Chunk;
  1942. assignDepth(module: Module): void;
  1943. assignDepths(modules: Set<Module>): void;
  1944. getDependencyReferencedExports(
  1945. dependency: Dependency,
  1946. runtime: RuntimeSpec
  1947. ): (string[] | ReferencedExport)[];
  1948. removeReasonsOfDependencyBlock(
  1949. module: Module,
  1950. block: DependenciesBlockLike
  1951. ): void;
  1952. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  1953. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  1954. assignRuntimeIds(): void;
  1955. sortItemsWithChunkIds(): void;
  1956. summarizeDependencies(): void;
  1957. createModuleHashes(): void;
  1958. createHash(): {
  1959. module: Module;
  1960. hash: string;
  1961. runtime: RuntimeSpec;
  1962. runtimes: RuntimeSpec[];
  1963. }[];
  1964. fullHash?: string;
  1965. hash?: string;
  1966. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  1967. updateAsset(
  1968. file: string,
  1969. newSourceOrFunction: Source | ((arg0: Source) => Source),
  1970. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  1971. ): void;
  1972. renameAsset(file: string, newFile: string): void;
  1973. deleteAsset(file: string): void;
  1974. getAssets(): Readonly<Asset>[];
  1975. getAsset(name: string): undefined | Readonly<Asset>;
  1976. clearAssets(): void;
  1977. createModuleAssets(): void;
  1978. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  1979. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  1980. getPath(
  1981. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1982. data?: PathData
  1983. ): string;
  1984. getPathWithInfo(
  1985. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1986. data?: PathData
  1987. ): { path: string; info: AssetInfo };
  1988. getAssetPath(
  1989. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1990. data: PathData
  1991. ): string;
  1992. getAssetPathWithInfo(
  1993. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1994. data: PathData
  1995. ): { path: string; info: AssetInfo };
  1996. getWarnings(): WebpackError[];
  1997. getErrors(): WebpackError[];
  1998. /**
  1999. * This function allows you to run another instance of webpack inside of webpack however as
  2000. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  2001. * from parent (or top level compiler) and creates a child Compilation
  2002. */
  2003. createChildCompiler(
  2004. name: string,
  2005. outputOptions?: OutputNormalized,
  2006. plugins?: (
  2007. | ((this: Compiler, compiler: Compiler) => void)
  2008. | WebpackPluginInstance
  2009. )[]
  2010. ): Compiler;
  2011. executeModule(
  2012. module: Module,
  2013. options: ExecuteModuleOptions,
  2014. callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
  2015. ): void;
  2016. checkConstraints(): void;
  2017. factorizeModule: {
  2018. (
  2019. options: FactorizeModuleOptions & { factoryResult?: false },
  2020. callback: (err?: null | WebpackError, result?: Module) => void
  2021. ): void;
  2022. (
  2023. options: FactorizeModuleOptions & { factoryResult: true },
  2024. callback: (
  2025. err?: null | WebpackError,
  2026. result?: ModuleFactoryResult
  2027. ) => void
  2028. ): void;
  2029. };
  2030. /**
  2031. * Add additional assets to the compilation.
  2032. */
  2033. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2034. /**
  2035. * Basic preprocessing of assets.
  2036. */
  2037. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2038. /**
  2039. * Derive new assets from existing assets.
  2040. * Existing assets should not be treated as complete.
  2041. */
  2042. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2043. /**
  2044. * Add additional sections to existing assets, like a banner or initialization code.
  2045. */
  2046. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2047. /**
  2048. * Optimize existing assets in a general way.
  2049. */
  2050. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2051. /**
  2052. * Optimize the count of existing assets, e. g. by merging them.
  2053. * Only assets of the same type should be merged.
  2054. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2055. */
  2056. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2057. /**
  2058. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2059. */
  2060. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2061. /**
  2062. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2063. */
  2064. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2065. /**
  2066. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2067. */
  2068. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2069. /**
  2070. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2071. * Only assets of different types should be inlined.
  2072. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2073. */
  2074. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2075. /**
  2076. * Summarize the list of existing assets
  2077. * e. g. creating an assets manifest of Service Workers.
  2078. */
  2079. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2080. /**
  2081. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2082. */
  2083. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2084. /**
  2085. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2086. */
  2087. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2088. /**
  2089. * Analyse existing assets.
  2090. */
  2091. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2092. /**
  2093. * Creating assets for reporting purposes.
  2094. */
  2095. static PROCESS_ASSETS_STAGE_REPORT: number;
  2096. }
  2097. declare interface CompilationAssets {
  2098. [index: string]: Source;
  2099. }
  2100. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2101. renderModuleContent: SyncWaterfallHook<
  2102. [Source, Module, WebAssemblyRenderContext]
  2103. >;
  2104. }
  2105. declare interface CompilationHooksJavascriptModulesPlugin {
  2106. renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2107. renderModuleContainer: SyncWaterfallHook<
  2108. [Source, Module, ChunkRenderContext]
  2109. >;
  2110. renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2111. renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
  2112. renderMain: SyncWaterfallHook<[Source, RenderContext]>;
  2113. renderContent: SyncWaterfallHook<[Source, RenderContext]>;
  2114. render: SyncWaterfallHook<[Source, RenderContext]>;
  2115. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  2116. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  2117. inlineInRuntimeBailout: SyncBailHook<
  2118. [Module, RenderBootstrapContext],
  2119. string
  2120. >;
  2121. embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
  2122. strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
  2123. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2124. useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
  2125. }
  2126. declare interface CompilationHooksRealContentHashPlugin {
  2127. updateHash: SyncBailHook<[Buffer[], string], string>;
  2128. }
  2129. declare interface CompilationParams {
  2130. normalModuleFactory: NormalModuleFactory;
  2131. contextModuleFactory: ContextModuleFactory;
  2132. }
  2133. declare class Compiler {
  2134. constructor(context: string, options?: WebpackOptionsNormalized);
  2135. hooks: Readonly<{
  2136. initialize: SyncHook<[]>;
  2137. shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
  2138. done: AsyncSeriesHook<[Stats]>;
  2139. afterDone: SyncHook<[Stats]>;
  2140. additionalPass: AsyncSeriesHook<[]>;
  2141. beforeRun: AsyncSeriesHook<[Compiler]>;
  2142. run: AsyncSeriesHook<[Compiler]>;
  2143. emit: AsyncSeriesHook<[Compilation]>;
  2144. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2145. afterEmit: AsyncSeriesHook<[Compilation]>;
  2146. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2147. compilation: SyncHook<[Compilation, CompilationParams]>;
  2148. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2149. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2150. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2151. compile: SyncHook<[CompilationParams]>;
  2152. make: AsyncParallelHook<[Compilation]>;
  2153. finishMake: AsyncParallelHook<[Compilation]>;
  2154. afterCompile: AsyncSeriesHook<[Compilation]>;
  2155. readRecords: AsyncSeriesHook<[]>;
  2156. emitRecords: AsyncSeriesHook<[]>;
  2157. watchRun: AsyncSeriesHook<[Compiler]>;
  2158. failed: SyncHook<[Error]>;
  2159. invalid: SyncHook<[null | string, number]>;
  2160. watchClose: SyncHook<[]>;
  2161. shutdown: AsyncSeriesHook<[]>;
  2162. infrastructureLog: SyncBailHook<[string, string, any[]], true>;
  2163. environment: SyncHook<[]>;
  2164. afterEnvironment: SyncHook<[]>;
  2165. afterPlugins: SyncHook<[Compiler]>;
  2166. afterResolvers: SyncHook<[Compiler]>;
  2167. entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
  2168. }>;
  2169. webpack: typeof exports;
  2170. name?: string;
  2171. parentCompilation?: Compilation;
  2172. root: Compiler;
  2173. outputPath: string;
  2174. watching?: Watching;
  2175. outputFileSystem: null | OutputFileSystem;
  2176. intermediateFileSystem: null | IntermediateFileSystem;
  2177. inputFileSystem: null | InputFileSystem;
  2178. watchFileSystem: null | WatchFileSystem;
  2179. recordsInputPath: null | string;
  2180. recordsOutputPath: null | string;
  2181. records: Record<string, any>;
  2182. managedPaths: Set<string | RegExp>;
  2183. unmanagedPaths: Set<string | RegExp>;
  2184. immutablePaths: Set<string | RegExp>;
  2185. modifiedFiles?: ReadonlySet<string>;
  2186. removedFiles?: ReadonlySet<string>;
  2187. fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  2188. contextTimestamps?: ReadonlyMap<
  2189. string,
  2190. null | FileSystemInfoEntry | "ignore"
  2191. >;
  2192. fsStartTime?: number;
  2193. resolverFactory: ResolverFactory;
  2194. infrastructureLogger?: (arg0: string, arg1: LogTypeEnum, arg2: any[]) => void;
  2195. platform: Readonly<PlatformTargetProperties>;
  2196. options: WebpackOptionsNormalized;
  2197. context: string;
  2198. requestShortener: RequestShortener;
  2199. cache: Cache;
  2200. moduleMemCaches?: Map<
  2201. Module,
  2202. {
  2203. buildInfo: BuildInfo;
  2204. references?: WeakMap<Dependency, Module>;
  2205. memCache: WeakTupleMap<any, any>;
  2206. }
  2207. >;
  2208. compilerPath: string;
  2209. running: boolean;
  2210. idle: boolean;
  2211. watchMode: boolean;
  2212. getCache(name: string): CacheFacade;
  2213. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2214. watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
  2215. run(callback: RunCallback<Stats>): void;
  2216. runAsChild(
  2217. callback: (
  2218. err: null | Error,
  2219. entries?: Chunk[],
  2220. compilation?: Compilation
  2221. ) => any
  2222. ): void;
  2223. purgeInputFileSystem(): void;
  2224. emitAssets(
  2225. compilation: Compilation,
  2226. callback: CallbackFunction_2<void>
  2227. ): void;
  2228. emitRecords(callback: CallbackFunction_2<void>): void;
  2229. readRecords(callback: CallbackFunction_2<void>): void;
  2230. createChildCompiler(
  2231. compilation: Compilation,
  2232. compilerName: string,
  2233. compilerIndex: number,
  2234. outputOptions?: OutputNormalized,
  2235. plugins?: WebpackPluginInstance[]
  2236. ): Compiler;
  2237. isChild(): boolean;
  2238. createCompilation(params: CompilationParams): Compilation;
  2239. newCompilation(params: CompilationParams): Compilation;
  2240. createNormalModuleFactory(): NormalModuleFactory;
  2241. createContextModuleFactory(): ContextModuleFactory;
  2242. newCompilationParams(): {
  2243. normalModuleFactory: NormalModuleFactory;
  2244. contextModuleFactory: ContextModuleFactory;
  2245. };
  2246. compile(callback: RunCallback<Compilation>): void;
  2247. close(callback: RunCallback<void>): void;
  2248. }
  2249. declare class ConcatSource extends Source {
  2250. constructor(...args: (string | Source)[]);
  2251. getChildren(): Source[];
  2252. add(item: string | Source): void;
  2253. addAllSkipOptimizing(items: Source[]): void;
  2254. }
  2255. declare interface ConcatenatedModuleInfo {
  2256. index: number;
  2257. module: Module;
  2258. /**
  2259. * mapping from export name to symbol
  2260. */
  2261. exportMap: Map<string, string>;
  2262. /**
  2263. * mapping from export name to symbol
  2264. */
  2265. rawExportMap: Map<string, string>;
  2266. namespaceExportSymbol?: string;
  2267. }
  2268. declare interface ConcatenationBailoutReasonContext {
  2269. /**
  2270. * the module graph
  2271. */
  2272. moduleGraph: ModuleGraph;
  2273. /**
  2274. * the chunk graph
  2275. */
  2276. chunkGraph: ChunkGraph;
  2277. }
  2278. declare class ConcatenationScope {
  2279. constructor(
  2280. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2281. currentModule: ConcatenatedModuleInfo
  2282. );
  2283. isModuleInScope(module: Module): boolean;
  2284. registerExport(exportName: string, symbol: string): void;
  2285. registerRawExport(exportName: string, expression: string): void;
  2286. registerNamespaceExport(symbol: string): void;
  2287. createModuleReference(
  2288. module: Module,
  2289. __1: Partial<ModuleReferenceOptions>
  2290. ): string;
  2291. static isModuleReference(name: string): boolean;
  2292. static matchModuleReference(
  2293. name: string
  2294. ): null | (ModuleReferenceOptions & { index: number });
  2295. static DEFAULT_EXPORT: string;
  2296. static NAMESPACE_OBJECT_EXPORT: string;
  2297. }
  2298. /**
  2299. * Options object as provided by the user.
  2300. */
  2301. declare interface Configuration {
  2302. /**
  2303. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2304. */
  2305. amd?: false | { [index: string]: any };
  2306. /**
  2307. * Report the first error as a hard error instead of tolerating it.
  2308. */
  2309. bail?: boolean;
  2310. /**
  2311. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2312. */
  2313. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2314. /**
  2315. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2316. */
  2317. context?: string;
  2318. /**
  2319. * References to other configurations to depend on.
  2320. */
  2321. dependencies?: string[];
  2322. /**
  2323. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2324. */
  2325. devtool?: string | false;
  2326. /**
  2327. * The entry point(s) of the compilation.
  2328. */
  2329. entry?:
  2330. | string
  2331. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2332. | EntryObject
  2333. | string[];
  2334. /**
  2335. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2336. */
  2337. experiments?: Experiments;
  2338. /**
  2339. * Extend configuration from another configuration (only works when using webpack-cli).
  2340. */
  2341. extends?: string | string[];
  2342. /**
  2343. * 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`.
  2344. */
  2345. externals?:
  2346. | string
  2347. | RegExp
  2348. | ExternalItem[]
  2349. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2350. | ((
  2351. data: ExternalItemFunctionData,
  2352. callback: (
  2353. err?: null | Error,
  2354. result?: string | boolean | string[] | { [index: string]: any }
  2355. ) => void
  2356. ) => void)
  2357. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2358. /**
  2359. * Enable presets of externals for specific targets.
  2360. */
  2361. externalsPresets?: ExternalsPresets;
  2362. /**
  2363. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2364. */
  2365. externalsType?:
  2366. | "import"
  2367. | "var"
  2368. | "module"
  2369. | "assign"
  2370. | "this"
  2371. | "window"
  2372. | "self"
  2373. | "global"
  2374. | "commonjs"
  2375. | "commonjs2"
  2376. | "commonjs-module"
  2377. | "commonjs-static"
  2378. | "amd"
  2379. | "amd-require"
  2380. | "umd"
  2381. | "umd2"
  2382. | "jsonp"
  2383. | "system"
  2384. | "promise"
  2385. | "script"
  2386. | "node-commonjs";
  2387. /**
  2388. * Ignore specific warnings.
  2389. */
  2390. ignoreWarnings?: (
  2391. | RegExp
  2392. | {
  2393. /**
  2394. * A RegExp to select the origin file for the warning.
  2395. */
  2396. file?: RegExp;
  2397. /**
  2398. * A RegExp to select the warning message.
  2399. */
  2400. message?: RegExp;
  2401. /**
  2402. * A RegExp to select the origin module for the warning.
  2403. */
  2404. module?: RegExp;
  2405. }
  2406. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2407. )[];
  2408. /**
  2409. * Options for infrastructure level logging.
  2410. */
  2411. infrastructureLogging?: InfrastructureLogging;
  2412. /**
  2413. * Custom values available in the loader context.
  2414. */
  2415. loader?: Loader;
  2416. /**
  2417. * Enable production optimizations or development hints.
  2418. */
  2419. mode?: "none" | "development" | "production";
  2420. /**
  2421. * Options affecting the normal modules (`NormalModuleFactory`).
  2422. */
  2423. module?: ModuleOptions;
  2424. /**
  2425. * Name of the configuration. Used when loading multiple configurations.
  2426. */
  2427. name?: string;
  2428. /**
  2429. * Include polyfills or mocks for various node stuff.
  2430. */
  2431. node?: false | NodeOptions;
  2432. /**
  2433. * Enables/Disables integrated optimizations.
  2434. */
  2435. optimization?: Optimization;
  2436. /**
  2437. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2438. */
  2439. output?: Output;
  2440. /**
  2441. * The number of parallel processed modules in the compilation.
  2442. */
  2443. parallelism?: number;
  2444. /**
  2445. * Configuration for web performance recommendations.
  2446. */
  2447. performance?: false | PerformanceOptions;
  2448. /**
  2449. * Add additional plugins to the compiler.
  2450. */
  2451. plugins?: (
  2452. | undefined
  2453. | null
  2454. | false
  2455. | ""
  2456. | 0
  2457. | ((this: Compiler, compiler: Compiler) => void)
  2458. | WebpackPluginInstance
  2459. )[];
  2460. /**
  2461. * Capture timing information for each module.
  2462. */
  2463. profile?: boolean;
  2464. /**
  2465. * Store compiler state to a json file.
  2466. */
  2467. recordsInputPath?: string | false;
  2468. /**
  2469. * Load compiler state from a json file.
  2470. */
  2471. recordsOutputPath?: string | false;
  2472. /**
  2473. * 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.
  2474. */
  2475. recordsPath?: string | false;
  2476. /**
  2477. * Options for the resolver.
  2478. */
  2479. resolve?: ResolveOptions;
  2480. /**
  2481. * Options for the resolver when resolving loaders.
  2482. */
  2483. resolveLoader?: ResolveOptions;
  2484. /**
  2485. * Options affecting how file system snapshots are created and validated.
  2486. */
  2487. snapshot?: SnapshotOptionsWebpackOptions;
  2488. /**
  2489. * Stats options object or preset name.
  2490. */
  2491. stats?:
  2492. | boolean
  2493. | StatsOptions
  2494. | "none"
  2495. | "verbose"
  2496. | "summary"
  2497. | "errors-only"
  2498. | "errors-warnings"
  2499. | "minimal"
  2500. | "normal"
  2501. | "detailed";
  2502. /**
  2503. * Environment to build for. An array of environments to build for all of them when possible.
  2504. */
  2505. target?: string | false | string[];
  2506. /**
  2507. * Enter watch mode, which rebuilds on file change.
  2508. */
  2509. watch?: boolean;
  2510. /**
  2511. * Options for the watcher.
  2512. */
  2513. watchOptions?: WatchOptions;
  2514. }
  2515. type ConnectionState =
  2516. | boolean
  2517. | typeof TRANSITIVE_ONLY
  2518. | typeof CIRCULAR_CONNECTION;
  2519. declare class ConstDependency extends NullDependency {
  2520. constructor(
  2521. expression: string,
  2522. range: number | [number, number],
  2523. runtimeRequirements?: null | string[]
  2524. );
  2525. expression: string;
  2526. range: number | [number, number];
  2527. runtimeRequirements: null | Set<string>;
  2528. static Template: typeof ConstDependencyTemplate;
  2529. static NO_EXPORTS_REFERENCED: string[][];
  2530. static EXPORTS_OBJECT_REFERENCED: string[][];
  2531. static TRANSITIVE: typeof TRANSITIVE;
  2532. }
  2533. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2534. constructor();
  2535. }
  2536. declare interface Constructor {
  2537. new (...params: any[]): any;
  2538. }
  2539. declare class ConsumeSharedPlugin {
  2540. constructor(options: ConsumeSharedPluginOptions);
  2541. /**
  2542. * Apply the plugin
  2543. */
  2544. apply(compiler: Compiler): void;
  2545. }
  2546. /**
  2547. * Options for consuming shared modules.
  2548. */
  2549. declare interface ConsumeSharedPluginOptions {
  2550. /**
  2551. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2552. */
  2553. consumes: Consumes;
  2554. /**
  2555. * Share scope name used for all consumed modules (defaults to 'default').
  2556. */
  2557. shareScope?: string;
  2558. }
  2559. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2560. /**
  2561. * Advanced configuration for modules that should be consumed from share scope.
  2562. */
  2563. declare interface ConsumesConfig {
  2564. /**
  2565. * 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.
  2566. */
  2567. eager?: boolean;
  2568. /**
  2569. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2570. */
  2571. import?: string | false;
  2572. /**
  2573. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2574. */
  2575. packageName?: string;
  2576. /**
  2577. * Version requirement from module in share scope.
  2578. */
  2579. requiredVersion?: string | false;
  2580. /**
  2581. * Module is looked up under this key from the share scope.
  2582. */
  2583. shareKey?: string;
  2584. /**
  2585. * Share scope name.
  2586. */
  2587. shareScope?: string;
  2588. /**
  2589. * Allow only a single version of the shared module in share scope (disabled by default).
  2590. */
  2591. singleton?: boolean;
  2592. /**
  2593. * 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).
  2594. */
  2595. strictVersion?: boolean;
  2596. }
  2597. /**
  2598. * 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.
  2599. */
  2600. declare interface ConsumesObject {
  2601. [index: string]: string | ConsumesConfig;
  2602. }
  2603. type ContainerOptionsFormat<T> =
  2604. | Record<string, string | string[] | T>
  2605. | (string | Record<string, string | string[] | T>)[];
  2606. declare class ContainerPlugin {
  2607. constructor(options: ContainerPluginOptions);
  2608. /**
  2609. * Apply the plugin
  2610. */
  2611. apply(compiler: Compiler): void;
  2612. }
  2613. declare interface ContainerPluginOptions {
  2614. /**
  2615. * 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.
  2616. */
  2617. exposes: Exposes;
  2618. /**
  2619. * The filename for this container relative path inside the `output.path` directory.
  2620. */
  2621. filename?: string;
  2622. /**
  2623. * Options for library.
  2624. */
  2625. library?: LibraryOptions;
  2626. /**
  2627. * The name for this container.
  2628. */
  2629. name: string;
  2630. /**
  2631. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2632. */
  2633. runtime?: string | false;
  2634. /**
  2635. * The name of the share scope which is shared with the host (defaults to 'default').
  2636. */
  2637. shareScope?: string;
  2638. }
  2639. declare class ContainerReferencePlugin {
  2640. constructor(options: ContainerReferencePluginOptions);
  2641. /**
  2642. * Apply the plugin
  2643. */
  2644. apply(compiler: Compiler): void;
  2645. }
  2646. declare interface ContainerReferencePluginOptions {
  2647. /**
  2648. * The external type of the remote containers.
  2649. */
  2650. remoteType: ExternalsType;
  2651. /**
  2652. * 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.
  2653. */
  2654. remotes: Remotes;
  2655. /**
  2656. * The name of the share scope shared with all remotes (defaults to 'default').
  2657. */
  2658. shareScope?: string;
  2659. }
  2660. declare abstract class ContextElementDependency extends ModuleDependency {
  2661. referencedExports?: string[][];
  2662. }
  2663. declare class ContextExclusionPlugin {
  2664. constructor(negativeMatcher: RegExp);
  2665. negativeMatcher: RegExp;
  2666. /**
  2667. * Apply the plugin
  2668. */
  2669. apply(compiler: Compiler): void;
  2670. }
  2671. declare interface ContextFileSystemInfoEntry {
  2672. safeTime: number;
  2673. timestampHash?: string;
  2674. resolved?: ResolvedContextFileSystemInfoEntry;
  2675. symlinks?: Set<string>;
  2676. }
  2677. declare interface ContextHash {
  2678. hash: string;
  2679. resolved?: string;
  2680. symlinks?: Set<string>;
  2681. }
  2682. type ContextMode =
  2683. | "weak"
  2684. | "eager"
  2685. | "lazy"
  2686. | "lazy-once"
  2687. | "sync"
  2688. | "async-weak";
  2689. declare abstract class ContextModuleFactory extends ModuleFactory {
  2690. hooks: Readonly<{
  2691. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2692. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2693. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2694. alternatives: FakeHook<
  2695. Pick<
  2696. AsyncSeriesWaterfallHook<[any[]]>,
  2697. "name" | "tap" | "tapAsync" | "tapPromise"
  2698. >
  2699. >;
  2700. alternativeRequests: AsyncSeriesWaterfallHook<
  2701. [any[], ContextModuleOptions]
  2702. >;
  2703. }>;
  2704. resolverFactory: ResolverFactory;
  2705. resolveDependencies(
  2706. fs: InputFileSystem,
  2707. options: ContextModuleOptions,
  2708. callback: (
  2709. err?: null | Error,
  2710. dependencies?: ContextElementDependency[]
  2711. ) => any
  2712. ): void;
  2713. }
  2714. declare interface ContextModuleOptions {
  2715. mode: ContextMode;
  2716. recursive: boolean;
  2717. regExp: RegExp;
  2718. namespaceObject?: boolean | "strict";
  2719. addon?: string;
  2720. chunkName?: string;
  2721. include?: RegExp;
  2722. exclude?: RegExp;
  2723. groupOptions?: RawChunkGroupOptions;
  2724. typePrefix?: string;
  2725. category?: string;
  2726. /**
  2727. * exports referenced from modules (won't be mangled)
  2728. */
  2729. referencedExports?: null | string[][];
  2730. layer?: string;
  2731. attributes?: ImportAttributes;
  2732. resource: string | false | string[];
  2733. resourceQuery?: string;
  2734. resourceFragment?: string;
  2735. resolveOptions: any;
  2736. }
  2737. declare class ContextReplacementPlugin {
  2738. constructor(
  2739. resourceRegExp: RegExp,
  2740. newContentResource?: any,
  2741. newContentRecursive?: any,
  2742. newContentRegExp?: any
  2743. );
  2744. resourceRegExp: RegExp;
  2745. newContentCallback: any;
  2746. newContentResource: any;
  2747. newContentCreateContextMap: any;
  2748. newContentRecursive: any;
  2749. newContentRegExp: any;
  2750. /**
  2751. * Apply the plugin
  2752. */
  2753. apply(compiler: Compiler): void;
  2754. }
  2755. declare interface ContextTimestampAndHash {
  2756. safeTime: number;
  2757. timestampHash?: string;
  2758. hash: string;
  2759. resolved?: ResolvedContextTimestampAndHash;
  2760. symlinks?: Set<string>;
  2761. }
  2762. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2763. Record<string, any>;
  2764. type CreateWriteStreamFSImplementation = FSImplementation & {
  2765. write: (...args: any[]) => any;
  2766. close?: (...args: any[]) => any;
  2767. };
  2768. /**
  2769. * Generator options for css/auto modules.
  2770. */
  2771. declare interface CssAutoGeneratorOptions {
  2772. /**
  2773. * Configure the generated JS modules that use the ES modules syntax.
  2774. */
  2775. esModule?: boolean;
  2776. /**
  2777. * Specifies the convention of exported names.
  2778. */
  2779. exportsConvention?:
  2780. | "as-is"
  2781. | "camel-case"
  2782. | "camel-case-only"
  2783. | "dashes"
  2784. | "dashes-only"
  2785. | ((name: string) => string);
  2786. /**
  2787. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2788. */
  2789. exportsOnly?: boolean;
  2790. /**
  2791. * Configure the generated local ident name.
  2792. */
  2793. localIdentName?: string;
  2794. }
  2795. /**
  2796. * Parser options for css/auto modules.
  2797. */
  2798. declare interface CssAutoParserOptions {
  2799. /**
  2800. * Use ES modules named export for css exports.
  2801. */
  2802. namedExports?: boolean;
  2803. }
  2804. /**
  2805. * Generator options for css modules.
  2806. */
  2807. declare interface CssGeneratorOptions {
  2808. /**
  2809. * Configure the generated JS modules that use the ES modules syntax.
  2810. */
  2811. esModule?: boolean;
  2812. /**
  2813. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2814. */
  2815. exportsOnly?: boolean;
  2816. }
  2817. /**
  2818. * Generator options for css/global modules.
  2819. */
  2820. declare interface CssGlobalGeneratorOptions {
  2821. /**
  2822. * Configure the generated JS modules that use the ES modules syntax.
  2823. */
  2824. esModule?: boolean;
  2825. /**
  2826. * Specifies the convention of exported names.
  2827. */
  2828. exportsConvention?:
  2829. | "as-is"
  2830. | "camel-case"
  2831. | "camel-case-only"
  2832. | "dashes"
  2833. | "dashes-only"
  2834. | ((name: string) => string);
  2835. /**
  2836. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2837. */
  2838. exportsOnly?: boolean;
  2839. /**
  2840. * Configure the generated local ident name.
  2841. */
  2842. localIdentName?: string;
  2843. }
  2844. /**
  2845. * Parser options for css/global modules.
  2846. */
  2847. declare interface CssGlobalParserOptions {
  2848. /**
  2849. * Use ES modules named export for css exports.
  2850. */
  2851. namedExports?: boolean;
  2852. }
  2853. declare interface CssImportDependencyMeta {
  2854. layer?: string;
  2855. supports?: string;
  2856. media?: string;
  2857. }
  2858. /**
  2859. * Generator options for css/module modules.
  2860. */
  2861. declare interface CssModuleGeneratorOptions {
  2862. /**
  2863. * Configure the generated JS modules that use the ES modules syntax.
  2864. */
  2865. esModule?: boolean;
  2866. /**
  2867. * Specifies the convention of exported names.
  2868. */
  2869. exportsConvention?:
  2870. | "as-is"
  2871. | "camel-case"
  2872. | "camel-case-only"
  2873. | "dashes"
  2874. | "dashes-only"
  2875. | ((name: string) => string);
  2876. /**
  2877. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2878. */
  2879. exportsOnly?: boolean;
  2880. /**
  2881. * Configure the generated local ident name.
  2882. */
  2883. localIdentName?: string;
  2884. }
  2885. /**
  2886. * Parser options for css/module modules.
  2887. */
  2888. declare interface CssModuleParserOptions {
  2889. /**
  2890. * Use ES modules named export for css exports.
  2891. */
  2892. namedExports?: boolean;
  2893. }
  2894. /**
  2895. * Parser options for css modules.
  2896. */
  2897. declare interface CssParserOptions {
  2898. /**
  2899. * Use ES modules named export for css exports.
  2900. */
  2901. namedExports?: boolean;
  2902. }
  2903. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  2904. declare class DefinePlugin {
  2905. /**
  2906. * Create a new define plugin
  2907. */
  2908. constructor(definitions: Record<string, CodeValue>);
  2909. definitions: Record<string, CodeValue>;
  2910. /**
  2911. * Apply the plugin
  2912. */
  2913. apply(compiler: Compiler): void;
  2914. static runtimeValue(
  2915. fn: (arg0: {
  2916. module: NormalModule;
  2917. key: string;
  2918. readonly version?: string;
  2919. }) => CodeValuePrimitive,
  2920. options?: true | string[] | RuntimeValueOptions
  2921. ): RuntimeValue;
  2922. }
  2923. declare class DelegatedPlugin {
  2924. constructor(options?: any);
  2925. options: any;
  2926. /**
  2927. * Apply the plugin
  2928. */
  2929. apply(compiler: Compiler): void;
  2930. }
  2931. declare interface DepConstructor {
  2932. new (...args: any[]): Dependency;
  2933. }
  2934. declare abstract class DependenciesBlock {
  2935. dependencies: Dependency[];
  2936. blocks: AsyncDependenciesBlock[];
  2937. parent?: DependenciesBlock;
  2938. getRootBlock(): DependenciesBlock;
  2939. /**
  2940. * Adds a DependencyBlock to DependencyBlock relationship.
  2941. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  2942. */
  2943. addBlock(block: AsyncDependenciesBlock): void;
  2944. addDependency(dependency: Dependency): void;
  2945. removeDependency(dependency: Dependency): void;
  2946. /**
  2947. * Removes all dependencies and blocks
  2948. */
  2949. clearDependenciesAndBlocks(): void;
  2950. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2951. serialize(__0: ObjectSerializerContext): void;
  2952. deserialize(__0: ObjectDeserializerContext): void;
  2953. }
  2954. declare interface DependenciesBlockLike {
  2955. dependencies: Dependency[];
  2956. blocks: AsyncDependenciesBlock[];
  2957. }
  2958. declare class Dependency {
  2959. constructor();
  2960. weak: boolean;
  2961. optional: boolean;
  2962. get type(): string;
  2963. get category(): string;
  2964. loc: DependencyLocation;
  2965. setLoc(
  2966. startLine: number,
  2967. startColumn: number,
  2968. endLine: number,
  2969. endColumn: number
  2970. ): void;
  2971. getContext(): undefined | string;
  2972. getResourceIdentifier(): null | string;
  2973. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  2974. /**
  2975. * Returns the referenced module and export
  2976. */
  2977. getReference(moduleGraph: ModuleGraph): never;
  2978. /**
  2979. * Returns list of exports referenced by this dependency
  2980. */
  2981. getReferencedExports(
  2982. moduleGraph: ModuleGraph,
  2983. runtime: RuntimeSpec
  2984. ): (string[] | ReferencedExport)[];
  2985. getCondition(
  2986. moduleGraph: ModuleGraph
  2987. ):
  2988. | null
  2989. | false
  2990. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  2991. /**
  2992. * Returns the exported names
  2993. */
  2994. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  2995. /**
  2996. * Returns warnings
  2997. */
  2998. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  2999. /**
  3000. * Returns errors
  3001. */
  3002. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3003. /**
  3004. * Update the hash
  3005. */
  3006. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3007. /**
  3008. * implement this method to allow the occurrence order plugin to count correctly
  3009. */
  3010. getNumberOfIdOccurrences(): number;
  3011. getModuleEvaluationSideEffectsState(
  3012. moduleGraph: ModuleGraph
  3013. ): ConnectionState;
  3014. createIgnoredModule(context: string): null | Module;
  3015. serialize(__0: ObjectSerializerContext): void;
  3016. deserialize(__0: ObjectDeserializerContext): void;
  3017. module: any;
  3018. get disconnect(): any;
  3019. static NO_EXPORTS_REFERENCED: string[][];
  3020. static EXPORTS_OBJECT_REFERENCED: string[][];
  3021. static TRANSITIVE: typeof TRANSITIVE;
  3022. }
  3023. declare interface DependencyConstructor {
  3024. new (...args: any[]): Dependency;
  3025. }
  3026. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3027. declare class DependencyTemplate {
  3028. constructor();
  3029. apply(
  3030. dependency: Dependency,
  3031. source: ReplaceSource,
  3032. templateContext: DependencyTemplateContext
  3033. ): void;
  3034. }
  3035. declare interface DependencyTemplateContext {
  3036. /**
  3037. * the runtime template
  3038. */
  3039. runtimeTemplate: RuntimeTemplate;
  3040. /**
  3041. * the dependency templates
  3042. */
  3043. dependencyTemplates: DependencyTemplates;
  3044. /**
  3045. * the module graph
  3046. */
  3047. moduleGraph: ModuleGraph;
  3048. /**
  3049. * the chunk graph
  3050. */
  3051. chunkGraph: ChunkGraph;
  3052. /**
  3053. * the requirements for runtime
  3054. */
  3055. runtimeRequirements: Set<string>;
  3056. /**
  3057. * current module
  3058. */
  3059. module: Module;
  3060. /**
  3061. * current runtimes, for which code is generated
  3062. */
  3063. runtime: RuntimeSpec;
  3064. /**
  3065. * mutable array of init fragments for the current module
  3066. */
  3067. initFragments: InitFragment<GenerateContext>[];
  3068. /**
  3069. * when in a concatenated module, information about other concatenated modules
  3070. */
  3071. concatenationScope?: ConcatenationScope;
  3072. /**
  3073. * the code generation results
  3074. */
  3075. codeGenerationResults: CodeGenerationResults;
  3076. /**
  3077. * chunkInitFragments
  3078. */
  3079. chunkInitFragments: InitFragment<GenerateContext>[];
  3080. }
  3081. declare abstract class DependencyTemplates {
  3082. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3083. set(
  3084. dependency: DependencyConstructor,
  3085. dependencyTemplate: DependencyTemplate
  3086. ): void;
  3087. updateHash(part: string): void;
  3088. getHash(): string;
  3089. clone(): DependencyTemplates;
  3090. }
  3091. /**
  3092. * Helper function for joining two ranges into a single range. This is useful
  3093. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3094. * to create the range of the _parent node_.
  3095. */
  3096. declare interface DestructuringAssignmentProperty {
  3097. id: string;
  3098. range?: [number, number];
  3099. shorthand: string | boolean;
  3100. }
  3101. declare class DeterministicChunkIdsPlugin {
  3102. constructor(options?: DeterministicChunkIdsPluginOptions);
  3103. options: DeterministicChunkIdsPluginOptions;
  3104. /**
  3105. * Apply the plugin
  3106. */
  3107. apply(compiler: Compiler): void;
  3108. }
  3109. declare interface DeterministicChunkIdsPluginOptions {
  3110. /**
  3111. * context for ids
  3112. */
  3113. context?: string;
  3114. /**
  3115. * maximum length of ids
  3116. */
  3117. maxLength?: number;
  3118. }
  3119. declare class DeterministicModuleIdsPlugin {
  3120. constructor(options?: DeterministicModuleIdsPluginOptions);
  3121. options: DeterministicModuleIdsPluginOptions;
  3122. /**
  3123. * Apply the plugin
  3124. */
  3125. apply(compiler: Compiler): void;
  3126. }
  3127. declare interface DeterministicModuleIdsPluginOptions {
  3128. /**
  3129. * context relative to which module identifiers are computed
  3130. */
  3131. context?: string;
  3132. /**
  3133. * selector function for modules
  3134. */
  3135. test?: (arg0: Module) => boolean;
  3136. /**
  3137. * maximum id length in digits (used as starting point)
  3138. */
  3139. maxLength?: number;
  3140. /**
  3141. * hash salt for ids
  3142. */
  3143. salt?: number;
  3144. /**
  3145. * do not increase the maxLength to find an optimal id space size
  3146. */
  3147. fixedLength?: boolean;
  3148. /**
  3149. * throw an error when id conflicts occur (instead of rehashing)
  3150. */
  3151. failOnConflict?: boolean;
  3152. }
  3153. type DevtoolModuleFilenameTemplate = string | Function;
  3154. declare interface Dirent {
  3155. isFile: () => boolean;
  3156. isDirectory: () => boolean;
  3157. isBlockDevice: () => boolean;
  3158. isCharacterDevice: () => boolean;
  3159. isSymbolicLink: () => boolean;
  3160. isFIFO: () => boolean;
  3161. isSocket: () => boolean;
  3162. name: string;
  3163. path: string;
  3164. }
  3165. declare class DllPlugin {
  3166. constructor(options: DllPluginOptions);
  3167. options: {
  3168. entryOnly: boolean;
  3169. /**
  3170. * Context of requests in the manifest file (defaults to the webpack context).
  3171. */
  3172. context?: string;
  3173. /**
  3174. * If true, manifest json file (output) will be formatted.
  3175. */
  3176. format?: boolean;
  3177. /**
  3178. * Name of the exposed dll function (external name, use value of 'output.library').
  3179. */
  3180. name?: string;
  3181. /**
  3182. * Absolute path to the manifest json file (output).
  3183. */
  3184. path: string;
  3185. /**
  3186. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3187. */
  3188. type?: string;
  3189. };
  3190. /**
  3191. * Apply the plugin
  3192. */
  3193. apply(compiler: Compiler): void;
  3194. }
  3195. declare interface DllPluginOptions {
  3196. /**
  3197. * Context of requests in the manifest file (defaults to the webpack context).
  3198. */
  3199. context?: string;
  3200. /**
  3201. * If true, only entry points will be exposed (default: true).
  3202. */
  3203. entryOnly?: boolean;
  3204. /**
  3205. * If true, manifest json file (output) will be formatted.
  3206. */
  3207. format?: boolean;
  3208. /**
  3209. * Name of the exposed dll function (external name, use value of 'output.library').
  3210. */
  3211. name?: string;
  3212. /**
  3213. * Absolute path to the manifest json file (output).
  3214. */
  3215. path: string;
  3216. /**
  3217. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3218. */
  3219. type?: string;
  3220. }
  3221. declare class DllReferencePlugin {
  3222. constructor(options: DllReferencePluginOptions);
  3223. options: DllReferencePluginOptions;
  3224. /**
  3225. * Apply the plugin
  3226. */
  3227. apply(compiler: Compiler): void;
  3228. }
  3229. type DllReferencePluginOptions =
  3230. | {
  3231. /**
  3232. * Context of requests in the manifest (or content property) as absolute path.
  3233. */
  3234. context?: string;
  3235. /**
  3236. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3237. */
  3238. extensions?: string[];
  3239. /**
  3240. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  3241. */
  3242. manifest: string | DllReferencePluginOptionsManifest;
  3243. /**
  3244. * The name where the dll is exposed (external name, defaults to manifest.name).
  3245. */
  3246. name?: string;
  3247. /**
  3248. * Prefix which is used for accessing the content of the dll.
  3249. */
  3250. scope?: string;
  3251. /**
  3252. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  3253. */
  3254. sourceType?:
  3255. | "var"
  3256. | "assign"
  3257. | "this"
  3258. | "window"
  3259. | "global"
  3260. | "commonjs"
  3261. | "commonjs2"
  3262. | "commonjs-module"
  3263. | "amd"
  3264. | "amd-require"
  3265. | "umd"
  3266. | "umd2"
  3267. | "jsonp"
  3268. | "system";
  3269. /**
  3270. * The way how the export of the dll bundle is used.
  3271. */
  3272. type?: "object" | "require";
  3273. }
  3274. | {
  3275. /**
  3276. * The mappings from request to module info.
  3277. */
  3278. content: DllReferencePluginOptionsContent;
  3279. /**
  3280. * Context of requests in the manifest (or content property) as absolute path.
  3281. */
  3282. context?: string;
  3283. /**
  3284. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3285. */
  3286. extensions?: string[];
  3287. /**
  3288. * The name where the dll is exposed (external name).
  3289. */
  3290. name: string;
  3291. /**
  3292. * Prefix which is used for accessing the content of the dll.
  3293. */
  3294. scope?: string;
  3295. /**
  3296. * How the dll is exposed (libraryTarget).
  3297. */
  3298. sourceType?:
  3299. | "var"
  3300. | "assign"
  3301. | "this"
  3302. | "window"
  3303. | "global"
  3304. | "commonjs"
  3305. | "commonjs2"
  3306. | "commonjs-module"
  3307. | "amd"
  3308. | "amd-require"
  3309. | "umd"
  3310. | "umd2"
  3311. | "jsonp"
  3312. | "system";
  3313. /**
  3314. * The way how the export of the dll bundle is used.
  3315. */
  3316. type?: "object" | "require";
  3317. };
  3318. /**
  3319. * The mappings from request to module info.
  3320. */
  3321. declare interface DllReferencePluginOptionsContent {
  3322. [index: string]: {
  3323. /**
  3324. * Meta information about the module.
  3325. */
  3326. buildMeta?: { [index: string]: any };
  3327. /**
  3328. * Information about the provided exports of the module.
  3329. */
  3330. exports?: true | string[];
  3331. /**
  3332. * Module ID.
  3333. */
  3334. id: string | number;
  3335. };
  3336. }
  3337. /**
  3338. * An object containing content, name and type.
  3339. */
  3340. declare interface DllReferencePluginOptionsManifest {
  3341. /**
  3342. * The mappings from request to module info.
  3343. */
  3344. content: DllReferencePluginOptionsContent;
  3345. /**
  3346. * The name where the dll is exposed (external name).
  3347. */
  3348. name?: string;
  3349. /**
  3350. * The type how the dll is exposed (external type).
  3351. */
  3352. type?:
  3353. | "var"
  3354. | "assign"
  3355. | "this"
  3356. | "window"
  3357. | "global"
  3358. | "commonjs"
  3359. | "commonjs2"
  3360. | "commonjs-module"
  3361. | "amd"
  3362. | "amd-require"
  3363. | "umd"
  3364. | "umd2"
  3365. | "jsonp"
  3366. | "system";
  3367. }
  3368. declare class DynamicEntryPlugin {
  3369. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  3370. context: string;
  3371. entry: () => Promise<EntryStaticNormalized>;
  3372. /**
  3373. * Apply the plugin
  3374. */
  3375. apply(compiler: Compiler): void;
  3376. }
  3377. declare interface Effect {
  3378. type: string;
  3379. value: any;
  3380. }
  3381. declare class ElectronTargetPlugin {
  3382. constructor(context?: "main" | "preload" | "renderer");
  3383. /**
  3384. * Apply the plugin
  3385. */
  3386. apply(compiler: Compiler): void;
  3387. }
  3388. /**
  3389. * No generator options are supported for this module type.
  3390. */
  3391. declare interface EmptyGeneratorOptions {}
  3392. /**
  3393. * No parser options are supported for this module type.
  3394. */
  3395. declare interface EmptyParserOptions {}
  3396. declare class EnableChunkLoadingPlugin {
  3397. constructor(type: string);
  3398. type: string;
  3399. /**
  3400. * Apply the plugin
  3401. */
  3402. apply(compiler: Compiler): void;
  3403. static setEnabled(compiler: Compiler, type: string): void;
  3404. static checkEnabled(compiler: Compiler, type: string): void;
  3405. }
  3406. declare class EnableLibraryPlugin {
  3407. constructor(type: string);
  3408. type: string;
  3409. /**
  3410. * Apply the plugin
  3411. */
  3412. apply(compiler: Compiler): void;
  3413. static setEnabled(compiler: Compiler, type: string): void;
  3414. static checkEnabled(compiler: Compiler, type: string): void;
  3415. }
  3416. declare class EnableWasmLoadingPlugin {
  3417. constructor(type: string);
  3418. type: string;
  3419. /**
  3420. * Apply the plugin
  3421. */
  3422. apply(compiler: Compiler): void;
  3423. static setEnabled(compiler: Compiler, type: string): void;
  3424. static checkEnabled(compiler: Compiler, type: string): void;
  3425. }
  3426. type EncodingOption =
  3427. | undefined
  3428. | null
  3429. | "ascii"
  3430. | "utf8"
  3431. | "utf-8"
  3432. | "utf16le"
  3433. | "utf-16le"
  3434. | "ucs2"
  3435. | "ucs-2"
  3436. | "latin1"
  3437. | "binary"
  3438. | "base64"
  3439. | "base64url"
  3440. | "hex"
  3441. | ObjectEncodingOptions;
  3442. type Entry =
  3443. | string
  3444. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  3445. | EntryObject
  3446. | string[];
  3447. declare interface EntryData {
  3448. /**
  3449. * dependencies of the entrypoint that should be evaluated at startup
  3450. */
  3451. dependencies: Dependency[];
  3452. /**
  3453. * dependencies of the entrypoint that should be included but not evaluated
  3454. */
  3455. includeDependencies: Dependency[];
  3456. /**
  3457. * options of the entrypoint
  3458. */
  3459. options: EntryOptions;
  3460. }
  3461. declare abstract class EntryDependency extends ModuleDependency {}
  3462. /**
  3463. * An object with entry point description.
  3464. */
  3465. declare interface EntryDescription {
  3466. /**
  3467. * Enable/disable creating async chunks that are loaded on demand.
  3468. */
  3469. asyncChunks?: boolean;
  3470. /**
  3471. * Base uri for this entry.
  3472. */
  3473. baseUri?: string;
  3474. /**
  3475. * 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).
  3476. */
  3477. chunkLoading?: string | false;
  3478. /**
  3479. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3480. */
  3481. dependOn?: string | string[];
  3482. /**
  3483. * 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.
  3484. */
  3485. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3486. /**
  3487. * Module(s) that are loaded upon startup.
  3488. */
  3489. import: EntryItem;
  3490. /**
  3491. * Specifies the layer in which modules of this entrypoint are placed.
  3492. */
  3493. layer?: null | string;
  3494. /**
  3495. * Options for library.
  3496. */
  3497. library?: LibraryOptions;
  3498. /**
  3499. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3500. */
  3501. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3502. /**
  3503. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3504. */
  3505. runtime?: string | false;
  3506. /**
  3507. * 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).
  3508. */
  3509. wasmLoading?: string | false;
  3510. }
  3511. /**
  3512. * An object with entry point description.
  3513. */
  3514. declare interface EntryDescriptionNormalized {
  3515. /**
  3516. * Enable/disable creating async chunks that are loaded on demand.
  3517. */
  3518. asyncChunks?: boolean;
  3519. /**
  3520. * Base uri for this entry.
  3521. */
  3522. baseUri?: string;
  3523. /**
  3524. * 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).
  3525. */
  3526. chunkLoading?: string | false;
  3527. /**
  3528. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3529. */
  3530. dependOn?: string[];
  3531. /**
  3532. * 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.
  3533. */
  3534. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3535. /**
  3536. * Module(s) that are loaded upon startup. The last one is exported.
  3537. */
  3538. import?: string[];
  3539. /**
  3540. * Specifies the layer in which modules of this entrypoint are placed.
  3541. */
  3542. layer?: null | string;
  3543. /**
  3544. * Options for library.
  3545. */
  3546. library?: LibraryOptions;
  3547. /**
  3548. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3549. */
  3550. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3551. /**
  3552. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3553. */
  3554. runtime?: string | false;
  3555. /**
  3556. * 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).
  3557. */
  3558. wasmLoading?: string | false;
  3559. }
  3560. type EntryItem = string | string[];
  3561. type EntryNormalized =
  3562. | (() => Promise<EntryStaticNormalized>)
  3563. | EntryStaticNormalized;
  3564. /**
  3565. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3566. */
  3567. declare interface EntryObject {
  3568. [index: string]: string | string[] | EntryDescription;
  3569. }
  3570. declare class EntryOptionPlugin {
  3571. constructor();
  3572. apply(compiler: Compiler): void;
  3573. static applyEntryOption(
  3574. compiler: Compiler,
  3575. context: string,
  3576. entry: EntryNormalized
  3577. ): void;
  3578. static entryDescriptionToOptions(
  3579. compiler: Compiler,
  3580. name: string,
  3581. desc: EntryDescriptionNormalized
  3582. ): EntryOptions;
  3583. }
  3584. type EntryOptions = { name?: string } & Omit<
  3585. EntryDescriptionNormalized,
  3586. "import"
  3587. >;
  3588. declare class EntryPlugin {
  3589. /**
  3590. * An entry plugin which will handle
  3591. * creation of the EntryDependency
  3592. */
  3593. constructor(context: string, entry: string, options?: string | EntryOptions);
  3594. context: string;
  3595. entry: string;
  3596. options: string | EntryOptions;
  3597. /**
  3598. * Apply the plugin
  3599. */
  3600. apply(compiler: Compiler): void;
  3601. static createDependency(
  3602. entry: string,
  3603. options: string | EntryOptions
  3604. ): EntryDependency;
  3605. }
  3606. type EntryStatic = string | EntryObject | string[];
  3607. /**
  3608. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3609. */
  3610. declare interface EntryStaticNormalized {
  3611. [index: string]: EntryDescriptionNormalized;
  3612. }
  3613. declare abstract class Entrypoint extends ChunkGroup {
  3614. /**
  3615. * Sets the runtimeChunk for an entrypoint.
  3616. */
  3617. setRuntimeChunk(chunk: Chunk): void;
  3618. /**
  3619. * Fetches the chunk reference containing the webpack bootstrap code
  3620. */
  3621. getRuntimeChunk(): null | Chunk;
  3622. /**
  3623. * Sets the chunk with the entrypoint modules for an entrypoint.
  3624. */
  3625. setEntrypointChunk(chunk: Chunk): void;
  3626. /**
  3627. * Returns the chunk which contains the entrypoint modules
  3628. * (or at least the execution of them)
  3629. */
  3630. getEntrypointChunk(): Chunk;
  3631. }
  3632. /**
  3633. * The abilities of the environment where the webpack generated code should run.
  3634. */
  3635. declare interface Environment {
  3636. /**
  3637. * The environment supports arrow functions ('() => { ... }').
  3638. */
  3639. arrowFunction?: boolean;
  3640. /**
  3641. * The environment supports async function and await ('async function () { await ... }').
  3642. */
  3643. asyncFunction?: boolean;
  3644. /**
  3645. * The environment supports BigInt as literal (123n).
  3646. */
  3647. bigIntLiteral?: boolean;
  3648. /**
  3649. * The environment supports const and let for variable declarations.
  3650. */
  3651. const?: boolean;
  3652. /**
  3653. * The environment supports destructuring ('{ a, b } = obj').
  3654. */
  3655. destructuring?: boolean;
  3656. /**
  3657. * The environment supports 'document'.
  3658. */
  3659. document?: boolean;
  3660. /**
  3661. * The environment supports an async import() function to import EcmaScript modules.
  3662. */
  3663. dynamicImport?: boolean;
  3664. /**
  3665. * The environment supports an async import() is available when creating a worker.
  3666. */
  3667. dynamicImportInWorker?: boolean;
  3668. /**
  3669. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3670. */
  3671. forOf?: boolean;
  3672. /**
  3673. * The environment supports 'globalThis'.
  3674. */
  3675. globalThis?: boolean;
  3676. /**
  3677. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3678. */
  3679. module?: boolean;
  3680. /**
  3681. * The environment supports `node:` prefix for Node.js core modules.
  3682. */
  3683. nodePrefixForCoreModules?: boolean;
  3684. /**
  3685. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3686. */
  3687. optionalChaining?: boolean;
  3688. /**
  3689. * The environment supports template literals.
  3690. */
  3691. templateLiteral?: boolean;
  3692. }
  3693. declare class EnvironmentPlugin {
  3694. constructor(...keys: any[]);
  3695. keys: any[];
  3696. defaultValues: any;
  3697. /**
  3698. * Apply the plugin
  3699. */
  3700. apply(compiler: Compiler): void;
  3701. }
  3702. type ErrorWithDetail = Error & { details?: string };
  3703. declare interface Etag {
  3704. toString: () => string;
  3705. }
  3706. declare class EvalDevToolModulePlugin {
  3707. constructor(options?: EvalDevToolModulePluginOptions);
  3708. namespace: string;
  3709. sourceUrlComment: string;
  3710. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  3711. /**
  3712. * Apply the plugin
  3713. */
  3714. apply(compiler: Compiler): void;
  3715. }
  3716. declare interface EvalDevToolModulePluginOptions {
  3717. /**
  3718. * namespace
  3719. */
  3720. namespace?: string;
  3721. /**
  3722. * source url comment
  3723. */
  3724. sourceUrlComment?: string;
  3725. /**
  3726. * module filename template
  3727. */
  3728. moduleFilenameTemplate?: string | Function;
  3729. }
  3730. declare class EvalSourceMapDevToolPlugin {
  3731. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3732. sourceMapComment: string;
  3733. moduleFilenameTemplate: string | Function;
  3734. namespace: string;
  3735. options: SourceMapDevToolPluginOptions;
  3736. /**
  3737. * Apply the plugin
  3738. */
  3739. apply(compiler: Compiler): void;
  3740. }
  3741. declare interface ExecuteModuleArgument {
  3742. module: Module;
  3743. moduleObject?: { id: string; exports: any; loaded: boolean };
  3744. preparedInfo: any;
  3745. codeGenerationResult: CodeGenerationResult;
  3746. }
  3747. declare interface ExecuteModuleContext {
  3748. assets: Map<string, { source: Source; info: AssetInfo }>;
  3749. chunk: Chunk;
  3750. chunkGraph: ChunkGraph;
  3751. __webpack_require__?: (arg0: string) => any;
  3752. }
  3753. declare interface ExecuteModuleOptions {
  3754. entryOptions?: EntryOptions;
  3755. }
  3756. declare interface ExecuteModuleResult {
  3757. exports: any;
  3758. cacheable: boolean;
  3759. assets: Map<string, { source: Source; info: AssetInfo }>;
  3760. fileDependencies: LazySet<string>;
  3761. contextDependencies: LazySet<string>;
  3762. missingDependencies: LazySet<string>;
  3763. buildDependencies: LazySet<string>;
  3764. }
  3765. type Experiments = ExperimentsCommon & ExperimentsExtra;
  3766. /**
  3767. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3768. */
  3769. declare interface ExperimentsCommon {
  3770. /**
  3771. * Support WebAssembly as asynchronous EcmaScript Module.
  3772. */
  3773. asyncWebAssembly?: boolean;
  3774. /**
  3775. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  3776. */
  3777. backCompat?: boolean;
  3778. /**
  3779. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  3780. */
  3781. cacheUnaffected?: boolean;
  3782. /**
  3783. * Apply defaults of next major version.
  3784. */
  3785. futureDefaults?: boolean;
  3786. /**
  3787. * Enable module layers.
  3788. */
  3789. layers?: boolean;
  3790. /**
  3791. * Allow output javascript files as module source type.
  3792. */
  3793. outputModule?: boolean;
  3794. /**
  3795. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  3796. */
  3797. syncWebAssembly?: boolean;
  3798. /**
  3799. * Allow using top-level-await in EcmaScript Modules.
  3800. */
  3801. topLevelAwait?: boolean;
  3802. }
  3803. /**
  3804. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3805. */
  3806. declare interface ExperimentsExtra {
  3807. /**
  3808. * Build http(s): urls using a lockfile and resource content cache.
  3809. */
  3810. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  3811. /**
  3812. * Enable css support.
  3813. */
  3814. css?: boolean;
  3815. /**
  3816. * Compile entrypoints and import()s only when they are accessed.
  3817. */
  3818. lazyCompilation?: boolean | LazyCompilationOptions;
  3819. }
  3820. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  3821. /**
  3822. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3823. */
  3824. declare interface ExperimentsNormalizedExtra {
  3825. /**
  3826. * Build http(s): urls using a lockfile and resource content cache.
  3827. */
  3828. buildHttp?: HttpUriOptions;
  3829. /**
  3830. * Enable css support.
  3831. */
  3832. css?: boolean;
  3833. /**
  3834. * Compile entrypoints and import()s only when they are accessed.
  3835. */
  3836. lazyCompilation?: false | LazyCompilationOptions;
  3837. }
  3838. declare abstract class ExportInfo {
  3839. name: string;
  3840. /**
  3841. * true: it is provided
  3842. * false: it is not provided
  3843. * null: only the runtime knows if it is provided
  3844. * undefined: it was not determined if it is provided
  3845. */
  3846. provided?: null | boolean;
  3847. /**
  3848. * is the export a terminal binding that should be checked for export star conflicts
  3849. */
  3850. terminalBinding: boolean;
  3851. /**
  3852. * true: it can be mangled
  3853. * false: is can not be mangled
  3854. * undefined: it was not determined if it can be mangled
  3855. */
  3856. canMangleProvide?: boolean;
  3857. /**
  3858. * true: it can be mangled
  3859. * false: is can not be mangled
  3860. * undefined: it was not determined if it can be mangled
  3861. */
  3862. canMangleUse?: boolean;
  3863. exportsInfoOwned: boolean;
  3864. exportsInfo?: ExportsInfo;
  3865. get canMangle(): boolean;
  3866. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3867. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3868. setHasUseInfo(): void;
  3869. setUsedConditionally(
  3870. condition: (arg0: UsageStateType) => boolean,
  3871. newValue: UsageStateType,
  3872. runtime: RuntimeSpec
  3873. ): boolean;
  3874. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  3875. unsetTarget(key?: any): boolean;
  3876. setTarget(
  3877. key: any,
  3878. connection: ModuleGraphConnection,
  3879. exportName?: string[],
  3880. priority?: number
  3881. ): boolean;
  3882. getUsed(runtime: RuntimeSpec): UsageStateType;
  3883. /**
  3884. * get used name
  3885. */
  3886. getUsedName(
  3887. fallbackName: undefined | string,
  3888. runtime: RuntimeSpec
  3889. ): string | false;
  3890. hasUsedName(): boolean;
  3891. /**
  3892. * Sets the mangled name of this export
  3893. */
  3894. setUsedName(name: string): void;
  3895. getTerminalBinding(
  3896. moduleGraph: ModuleGraph,
  3897. resolveTargetFilter?: (arg0: {
  3898. module: Module;
  3899. export?: string[];
  3900. }) => boolean
  3901. ): undefined | ExportsInfo | ExportInfo;
  3902. isReexport(): undefined | boolean;
  3903. findTarget(
  3904. moduleGraph: ModuleGraph,
  3905. validTargetModuleFilter: (arg0: Module) => boolean
  3906. ): undefined | false | { module: Module; export?: string[] };
  3907. getTarget(
  3908. moduleGraph: ModuleGraph,
  3909. resolveTargetFilter?: (arg0: {
  3910. module: Module;
  3911. export?: string[];
  3912. }) => boolean
  3913. ): undefined | { module: Module; export?: string[] };
  3914. /**
  3915. * Move the target forward as long resolveTargetFilter is fulfilled
  3916. */
  3917. moveTarget(
  3918. moduleGraph: ModuleGraph,
  3919. resolveTargetFilter: (arg0: {
  3920. module: Module;
  3921. export?: string[];
  3922. }) => boolean,
  3923. updateOriginalConnection?: (arg0: {
  3924. module: Module;
  3925. export?: string[];
  3926. }) => ModuleGraphConnection
  3927. ): undefined | { module: Module; export?: string[] };
  3928. createNestedExportsInfo(): undefined | ExportsInfo;
  3929. getNestedExportsInfo(): undefined | ExportsInfo;
  3930. hasInfo(baseInfo?: any, runtime?: any): boolean;
  3931. updateHash(hash?: any, runtime?: any): void;
  3932. getUsedInfo(): string;
  3933. getProvidedInfo():
  3934. | "no provided info"
  3935. | "maybe provided (runtime-defined)"
  3936. | "provided"
  3937. | "not provided";
  3938. getRenameInfo(): string;
  3939. }
  3940. declare interface ExportSpec {
  3941. /**
  3942. * the name of the export
  3943. */
  3944. name: string;
  3945. /**
  3946. * can the export be renamed (defaults to true)
  3947. */
  3948. canMangle?: boolean;
  3949. /**
  3950. * is the export a terminal binding that should be checked for export star conflicts
  3951. */
  3952. terminalBinding?: boolean;
  3953. /**
  3954. * nested exports
  3955. */
  3956. exports?: (string | ExportSpec)[];
  3957. /**
  3958. * when reexported: from which module
  3959. */
  3960. from?: ModuleGraphConnection;
  3961. /**
  3962. * when reexported: from which export
  3963. */
  3964. export?: null | string[];
  3965. /**
  3966. * when reexported: with which priority
  3967. */
  3968. priority?: number;
  3969. /**
  3970. * export is not visible, because another export blends over it
  3971. */
  3972. hidden?: boolean;
  3973. }
  3974. type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
  3975. declare abstract class ExportsInfo {
  3976. get ownedExports(): Iterable<ExportInfo>;
  3977. get orderedOwnedExports(): Iterable<ExportInfo>;
  3978. get exports(): Iterable<ExportInfo>;
  3979. get orderedExports(): Iterable<ExportInfo>;
  3980. get otherExportsInfo(): ExportInfo;
  3981. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  3982. setHasProvideInfo(): void;
  3983. setHasUseInfo(): void;
  3984. getOwnExportInfo(name: string): ExportInfo;
  3985. getExportInfo(name: string): ExportInfo;
  3986. getReadOnlyExportInfo(name: string): ExportInfo;
  3987. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  3988. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  3989. setUnknownExportsProvided(
  3990. canMangle?: boolean,
  3991. excludeExports?: Set<string>,
  3992. targetKey?: any,
  3993. targetModule?: ModuleGraphConnection,
  3994. priority?: number
  3995. ): boolean;
  3996. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3997. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3998. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  3999. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  4000. isUsed(runtime: RuntimeSpec): boolean;
  4001. isModuleUsed(runtime: RuntimeSpec): boolean;
  4002. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  4003. getProvidedExports(): null | true | string[];
  4004. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  4005. isExportProvided(name: string | string[]): undefined | null | boolean;
  4006. getUsageKey(runtime: RuntimeSpec): string;
  4007. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  4008. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  4009. getUsedName(
  4010. name: undefined | string | string[],
  4011. runtime: RuntimeSpec
  4012. ): string | false | string[];
  4013. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4014. getRestoreProvidedData(): any;
  4015. restoreProvided(__0: {
  4016. otherProvided: any;
  4017. otherCanMangleProvide: any;
  4018. otherTerminalBinding: any;
  4019. exports: any;
  4020. }): void;
  4021. }
  4022. declare interface ExportsSpec {
  4023. /**
  4024. * exported names, true for unknown exports or null for no exports
  4025. */
  4026. exports: null | true | (string | ExportSpec)[];
  4027. /**
  4028. * when exports = true, list of unaffected exports
  4029. */
  4030. excludeExports?: Set<string>;
  4031. /**
  4032. * list of maybe prior exposed, but now hidden exports
  4033. */
  4034. hideExports?: Set<string>;
  4035. /**
  4036. * when reexported: from which module
  4037. */
  4038. from?: ModuleGraphConnection;
  4039. /**
  4040. * when reexported: with which priority
  4041. */
  4042. priority?: number;
  4043. /**
  4044. * can the export be renamed (defaults to true)
  4045. */
  4046. canMangle?: boolean;
  4047. /**
  4048. * are the exports terminal bindings that should be checked for export star conflicts
  4049. */
  4050. terminalBinding?: boolean;
  4051. /**
  4052. * module on which the result depends on
  4053. */
  4054. dependencies?: Module[];
  4055. }
  4056. type Exposes = (string | ExposesObject)[] | ExposesObject;
  4057. /**
  4058. * Advanced configuration for modules that should be exposed by this container.
  4059. */
  4060. declare interface ExposesConfig {
  4061. /**
  4062. * Request to a module that should be exposed by this container.
  4063. */
  4064. import: string | string[];
  4065. /**
  4066. * Custom chunk name for the exposed module.
  4067. */
  4068. name?: string;
  4069. }
  4070. /**
  4071. * Modules that should be exposed by this container. Property names are used as public paths.
  4072. */
  4073. declare interface ExposesObject {
  4074. [index: string]: string | ExposesConfig | string[];
  4075. }
  4076. type Expression =
  4077. | UnaryExpression
  4078. | ArrayExpression
  4079. | ArrowFunctionExpression
  4080. | AssignmentExpression
  4081. | AwaitExpression
  4082. | BinaryExpression
  4083. | SimpleCallExpression
  4084. | NewExpression
  4085. | ChainExpression
  4086. | ClassExpression
  4087. | ConditionalExpression
  4088. | FunctionExpression
  4089. | Identifier
  4090. | ImportExpression
  4091. | SimpleLiteral
  4092. | RegExpLiteral
  4093. | BigIntLiteral
  4094. | LogicalExpression
  4095. | MemberExpression
  4096. | MetaProperty
  4097. | ObjectExpression
  4098. | SequenceExpression
  4099. | TaggedTemplateExpression
  4100. | TemplateLiteral
  4101. | ThisExpression
  4102. | UpdateExpression
  4103. | YieldExpression;
  4104. declare interface ExpressionExpressionInfo {
  4105. type: "expression";
  4106. rootInfo: string | VariableInfo;
  4107. name: string;
  4108. getMembers: () => string[];
  4109. getMembersOptionals: () => boolean[];
  4110. getMemberRanges: () => [number, number][];
  4111. }
  4112. declare interface ExtensionAliasOption {
  4113. alias: string | string[];
  4114. extension: string;
  4115. }
  4116. declare interface ExtensionAliasOptions {
  4117. [index: string]: string | string[];
  4118. }
  4119. type ExternalItem =
  4120. | string
  4121. | RegExp
  4122. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4123. | ((
  4124. data: ExternalItemFunctionData,
  4125. callback: (
  4126. err?: null | Error,
  4127. result?: string | boolean | string[] | { [index: string]: any }
  4128. ) => void
  4129. ) => void)
  4130. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4131. /**
  4132. * Data object passed as argument when a function is set for 'externals'.
  4133. */
  4134. declare interface ExternalItemFunctionData {
  4135. /**
  4136. * The directory in which the request is placed.
  4137. */
  4138. context?: string;
  4139. /**
  4140. * Contextual information.
  4141. */
  4142. contextInfo?: ModuleFactoryCreateDataContextInfo;
  4143. /**
  4144. * The category of the referencing dependencies.
  4145. */
  4146. dependencyType?: string;
  4147. /**
  4148. * Get a resolve function with the current resolver options.
  4149. */
  4150. getResolve?: (
  4151. options?: ResolveOptions
  4152. ) =>
  4153. | ((
  4154. context: string,
  4155. request: string,
  4156. callback: (err?: Error, result?: string) => void
  4157. ) => void)
  4158. | ((context: string, request: string) => Promise<string>);
  4159. /**
  4160. * The request as written by the user in the require/import expression/statement.
  4161. */
  4162. request?: string;
  4163. }
  4164. /**
  4165. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4166. */
  4167. declare interface ExternalItemObjectKnown {
  4168. /**
  4169. * Specify externals depending on the layer.
  4170. */
  4171. byLayer?:
  4172. | { [index: string]: ExternalItem }
  4173. | ((layer: null | string) => ExternalItem);
  4174. }
  4175. /**
  4176. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4177. */
  4178. declare interface ExternalItemObjectUnknown {
  4179. [index: string]: ExternalItemValue;
  4180. }
  4181. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  4182. declare class ExternalModule extends Module {
  4183. constructor(
  4184. request: string | string[] | RequestRecord,
  4185. type: string,
  4186. userRequest: string,
  4187. dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta
  4188. );
  4189. request: string | string[] | Record<string, string | string[]>;
  4190. externalType: string;
  4191. userRequest: string;
  4192. dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta;
  4193. /**
  4194. * restore unsafe cache data
  4195. */
  4196. restoreFromUnsafeCache(
  4197. unsafeCacheData: object,
  4198. normalModuleFactory: NormalModuleFactory
  4199. ): void;
  4200. }
  4201. declare interface ExternalModuleInfo {
  4202. index: number;
  4203. module: Module;
  4204. }
  4205. type Externals =
  4206. | string
  4207. | RegExp
  4208. | ExternalItem[]
  4209. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4210. | ((
  4211. data: ExternalItemFunctionData,
  4212. callback: (
  4213. err?: null | Error,
  4214. result?: string | boolean | string[] | { [index: string]: any }
  4215. ) => void
  4216. ) => void)
  4217. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4218. declare class ExternalsPlugin {
  4219. constructor(type: undefined | string, externals: Externals);
  4220. type?: string;
  4221. externals: Externals;
  4222. /**
  4223. * Apply the plugin
  4224. */
  4225. apply(compiler: Compiler): void;
  4226. }
  4227. /**
  4228. * Enable presets of externals for specific targets.
  4229. */
  4230. declare interface ExternalsPresets {
  4231. /**
  4232. * 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.
  4233. */
  4234. electron?: boolean;
  4235. /**
  4236. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  4237. */
  4238. electronMain?: boolean;
  4239. /**
  4240. * 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.
  4241. */
  4242. electronPreload?: boolean;
  4243. /**
  4244. * 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.
  4245. */
  4246. electronRenderer?: boolean;
  4247. /**
  4248. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  4249. */
  4250. node?: boolean;
  4251. /**
  4252. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  4253. */
  4254. nwjs?: boolean;
  4255. /**
  4256. * 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).
  4257. */
  4258. web?: boolean;
  4259. /**
  4260. * 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).
  4261. */
  4262. webAsync?: boolean;
  4263. }
  4264. type ExternalsType =
  4265. | "import"
  4266. | "var"
  4267. | "module"
  4268. | "assign"
  4269. | "this"
  4270. | "window"
  4271. | "self"
  4272. | "global"
  4273. | "commonjs"
  4274. | "commonjs2"
  4275. | "commonjs-module"
  4276. | "commonjs-static"
  4277. | "amd"
  4278. | "amd-require"
  4279. | "umd"
  4280. | "umd2"
  4281. | "jsonp"
  4282. | "system"
  4283. | "promise"
  4284. | "script"
  4285. | "node-commonjs";
  4286. declare interface FSImplementation {
  4287. open?: (...args: any[]) => any;
  4288. close?: (...args: any[]) => any;
  4289. }
  4290. declare interface FactorizeModuleOptions {
  4291. currentProfile: ModuleProfile;
  4292. factory: ModuleFactory;
  4293. dependencies: Dependency[];
  4294. /**
  4295. * return full ModuleFactoryResult instead of only module
  4296. */
  4297. factoryResult?: boolean;
  4298. originModule: null | Module;
  4299. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4300. context?: string;
  4301. }
  4302. declare interface FactoryMeta {
  4303. sideEffectFree?: boolean;
  4304. }
  4305. type FakeHook<T> = T & FakeHookMarker;
  4306. declare interface FakeHookMarker {}
  4307. declare interface FallbackCacheGroup {
  4308. chunksFilter: (chunk: Chunk) => undefined | boolean;
  4309. minSize: SplitChunksSizes;
  4310. maxAsyncSize: SplitChunksSizes;
  4311. maxInitialSize: SplitChunksSizes;
  4312. automaticNameDelimiter: string;
  4313. }
  4314. declare class FetchCompileAsyncWasmPlugin {
  4315. constructor();
  4316. /**
  4317. * Apply the plugin
  4318. */
  4319. apply(compiler: Compiler): void;
  4320. }
  4321. declare class FetchCompileWasmPlugin {
  4322. constructor(options?: FetchCompileWasmPluginOptions);
  4323. options: FetchCompileWasmPluginOptions;
  4324. /**
  4325. * Apply the plugin
  4326. */
  4327. apply(compiler: Compiler): void;
  4328. }
  4329. declare interface FetchCompileWasmPluginOptions {
  4330. /**
  4331. * mangle imports
  4332. */
  4333. mangleImports?: boolean;
  4334. }
  4335. /**
  4336. * Options object for persistent file-based caching.
  4337. */
  4338. declare interface FileCacheOptions {
  4339. /**
  4340. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  4341. */
  4342. allowCollectingMemory?: boolean;
  4343. /**
  4344. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  4345. */
  4346. buildDependencies?: { [index: string]: string[] };
  4347. /**
  4348. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  4349. */
  4350. cacheDirectory?: string;
  4351. /**
  4352. * Locations for the cache (defaults to cacheDirectory / name).
  4353. */
  4354. cacheLocation?: string;
  4355. /**
  4356. * Compression type used for the cache files.
  4357. */
  4358. compression?: false | "gzip" | "brotli";
  4359. /**
  4360. * Algorithm used for generation the hash (see node.js crypto package).
  4361. */
  4362. hashAlgorithm?: string;
  4363. /**
  4364. * Time in ms after which idle period the cache storing should happen.
  4365. */
  4366. idleTimeout?: number;
  4367. /**
  4368. * 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).
  4369. */
  4370. idleTimeoutAfterLargeChanges?: number;
  4371. /**
  4372. * Time in ms after which idle period the initial cache storing should happen.
  4373. */
  4374. idleTimeoutForInitialStore?: number;
  4375. /**
  4376. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  4377. */
  4378. immutablePaths?: (string | RegExp)[];
  4379. /**
  4380. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  4381. */
  4382. managedPaths?: (string | RegExp)[];
  4383. /**
  4384. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  4385. */
  4386. maxAge?: number;
  4387. /**
  4388. * 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.
  4389. */
  4390. maxMemoryGenerations?: number;
  4391. /**
  4392. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  4393. */
  4394. memoryCacheUnaffected?: boolean;
  4395. /**
  4396. * Name for the cache. Different names will lead to different coexisting caches.
  4397. */
  4398. name?: string;
  4399. /**
  4400. * Track and log detailed timing information for individual cache items.
  4401. */
  4402. profile?: boolean;
  4403. /**
  4404. * Enable/disable readonly mode.
  4405. */
  4406. readonly?: boolean;
  4407. /**
  4408. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  4409. */
  4410. store?: "pack";
  4411. /**
  4412. * Filesystem caching.
  4413. */
  4414. type: "filesystem";
  4415. /**
  4416. * 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.
  4417. */
  4418. version?: string;
  4419. }
  4420. declare interface FileSystem {
  4421. readFile: ReadFileTypes;
  4422. readdir: ReaddirTypes;
  4423. readJson?: (
  4424. arg0: PathOrFileDescriptorTypes,
  4425. arg1: (
  4426. arg0: null | Error | NodeJS.ErrnoException,
  4427. arg1?: JsonObjectTypes
  4428. ) => void
  4429. ) => void;
  4430. readlink: ReadlinkTypes;
  4431. lstat?: LStatTypes;
  4432. stat: StatTypes;
  4433. realpath?: RealPathTypes;
  4434. }
  4435. declare abstract class FileSystemInfo {
  4436. fs: InputFileSystem;
  4437. logger?: WebpackLogger;
  4438. fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
  4439. fileHashQueue: AsyncQueue<string, string, null | string>;
  4440. contextTimestampQueue: AsyncQueue<
  4441. string,
  4442. string,
  4443. null | ContextFileSystemInfoEntry
  4444. >;
  4445. contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
  4446. contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
  4447. managedItemQueue: AsyncQueue<string, string, null | string>;
  4448. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  4449. unmanagedPathsWithSlash: string[];
  4450. unmanagedPathsRegExps: RegExp[];
  4451. managedPaths: (string | RegExp)[];
  4452. managedPathsWithSlash: string[];
  4453. managedPathsRegExps: RegExp[];
  4454. immutablePaths: (string | RegExp)[];
  4455. immutablePathsWithSlash: string[];
  4456. immutablePathsRegExps: RegExp[];
  4457. logStatistics(): void;
  4458. clear(): void;
  4459. addFileTimestamps(
  4460. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4461. immutable?: boolean
  4462. ): void;
  4463. addContextTimestamps(
  4464. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4465. immutable?: boolean
  4466. ): void;
  4467. getFileTimestamp(
  4468. path: string,
  4469. callback: (
  4470. arg0?: null | WebpackError,
  4471. arg1?: null | FileSystemInfoEntry | "ignore"
  4472. ) => void
  4473. ): void;
  4474. getContextTimestamp(
  4475. path: string,
  4476. callback: (
  4477. arg0?: null | WebpackError,
  4478. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  4479. ) => void
  4480. ): void;
  4481. getFileHash(
  4482. path: string,
  4483. callback: (arg0?: null | WebpackError, arg1?: null | string) => void
  4484. ): void;
  4485. getContextHash(
  4486. path: string,
  4487. callback: (arg0?: null | WebpackError, arg1?: string) => void
  4488. ): void;
  4489. getContextTsh(
  4490. path: string,
  4491. callback: (
  4492. arg0?: null | WebpackError,
  4493. arg1?: ResolvedContextTimestampAndHash
  4494. ) => void
  4495. ): void;
  4496. resolveBuildDependencies(
  4497. context: string,
  4498. deps: Iterable<string>,
  4499. callback: (
  4500. arg0?: null | Error,
  4501. arg1?: ResolveBuildDependenciesResult
  4502. ) => void
  4503. ): void;
  4504. checkResolveResultsValid(
  4505. resolveResults: Map<string, string | false>,
  4506. callback: (arg0?: null | Error, arg1?: boolean) => void
  4507. ): void;
  4508. createSnapshot(
  4509. startTime: undefined | null | number,
  4510. files: null | Iterable<string>,
  4511. directories: null | Iterable<string>,
  4512. missing: null | Iterable<string>,
  4513. options: undefined | null | SnapshotOptionsFileSystemInfo,
  4514. callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
  4515. ): void;
  4516. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4517. checkSnapshotValid(
  4518. snapshot: Snapshot,
  4519. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  4520. ): void;
  4521. getDeprecatedFileTimestamps(): Map<any, any>;
  4522. getDeprecatedContextTimestamps(): Map<any, any>;
  4523. }
  4524. declare interface FileSystemInfoEntry {
  4525. safeTime: number;
  4526. timestamp?: number;
  4527. }
  4528. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4529. declare interface GenerateContext {
  4530. /**
  4531. * mapping from dependencies to templates
  4532. */
  4533. dependencyTemplates: DependencyTemplates;
  4534. /**
  4535. * the runtime template
  4536. */
  4537. runtimeTemplate: RuntimeTemplate;
  4538. /**
  4539. * the module graph
  4540. */
  4541. moduleGraph: ModuleGraph;
  4542. /**
  4543. * the chunk graph
  4544. */
  4545. chunkGraph: ChunkGraph;
  4546. /**
  4547. * the requirements for runtime
  4548. */
  4549. runtimeRequirements: Set<string>;
  4550. /**
  4551. * the runtime
  4552. */
  4553. runtime: RuntimeSpec;
  4554. /**
  4555. * when in concatenated module, information about other concatenated modules
  4556. */
  4557. concatenationScope?: ConcatenationScope;
  4558. /**
  4559. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4560. */
  4561. codeGenerationResults?: CodeGenerationResults;
  4562. /**
  4563. * which kind of code should be generated
  4564. */
  4565. type: string;
  4566. /**
  4567. * get access to the code generation data
  4568. */
  4569. getData?: () => Map<string, any>;
  4570. }
  4571. declare class Generator {
  4572. constructor();
  4573. getTypes(module: NormalModule): Set<string>;
  4574. getSize(module: NormalModule, type?: string): number;
  4575. generate(module: NormalModule, __1: GenerateContext): Source;
  4576. getConcatenationBailoutReason(
  4577. module: NormalModule,
  4578. context: ConcatenationBailoutReasonContext
  4579. ): undefined | string;
  4580. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4581. static byType(map: Record<string, Generator>): ByTypeGenerator;
  4582. }
  4583. declare interface GeneratorOptions {
  4584. [index: string]: any;
  4585. }
  4586. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4587. GeneratorOptionsByModuleTypeUnknown;
  4588. /**
  4589. * Specify options for each generator.
  4590. */
  4591. declare interface GeneratorOptionsByModuleTypeKnown {
  4592. /**
  4593. * Generator options for asset modules.
  4594. */
  4595. asset?: AssetGeneratorOptions;
  4596. /**
  4597. * Generator options for asset/inline modules.
  4598. */
  4599. "asset/inline"?: AssetInlineGeneratorOptions;
  4600. /**
  4601. * Generator options for asset/resource modules.
  4602. */
  4603. "asset/resource"?: AssetResourceGeneratorOptions;
  4604. /**
  4605. * Generator options for css modules.
  4606. */
  4607. css?: CssGeneratorOptions;
  4608. /**
  4609. * Generator options for css/auto modules.
  4610. */
  4611. "css/auto"?: CssAutoGeneratorOptions;
  4612. /**
  4613. * Generator options for css/global modules.
  4614. */
  4615. "css/global"?: CssGlobalGeneratorOptions;
  4616. /**
  4617. * Generator options for css/module modules.
  4618. */
  4619. "css/module"?: CssModuleGeneratorOptions;
  4620. /**
  4621. * No generator options are supported for this module type.
  4622. */
  4623. javascript?: EmptyGeneratorOptions;
  4624. /**
  4625. * No generator options are supported for this module type.
  4626. */
  4627. "javascript/auto"?: EmptyGeneratorOptions;
  4628. /**
  4629. * No generator options are supported for this module type.
  4630. */
  4631. "javascript/dynamic"?: EmptyGeneratorOptions;
  4632. /**
  4633. * No generator options are supported for this module type.
  4634. */
  4635. "javascript/esm"?: EmptyGeneratorOptions;
  4636. }
  4637. /**
  4638. * Specify options for each generator.
  4639. */
  4640. declare interface GeneratorOptionsByModuleTypeUnknown {
  4641. [index: string]: { [index: string]: any };
  4642. }
  4643. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4644. constructor(
  4645. contentType: string,
  4646. name: string,
  4647. global: string,
  4648. getFilenameForChunk: (
  4649. arg0: Chunk
  4650. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
  4651. allChunks: boolean
  4652. );
  4653. contentType: string;
  4654. global: string;
  4655. getFilenameForChunk: (
  4656. arg0: Chunk
  4657. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
  4658. allChunks: boolean;
  4659. /**
  4660. * Runtime modules without any dependencies to other runtime modules
  4661. */
  4662. static STAGE_NORMAL: number;
  4663. /**
  4664. * Runtime modules with simple dependencies on other runtime modules
  4665. */
  4666. static STAGE_BASIC: number;
  4667. /**
  4668. * Runtime modules which attach to handlers of other runtime modules
  4669. */
  4670. static STAGE_ATTACH: number;
  4671. /**
  4672. * Runtime modules which trigger actions on bootstrap
  4673. */
  4674. static STAGE_TRIGGER: number;
  4675. }
  4676. declare interface GroupConfig {
  4677. getKeys: (arg0?: any) => string[];
  4678. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4679. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4680. }
  4681. declare interface GroupOptions {
  4682. groupChildren?: boolean;
  4683. force?: boolean;
  4684. targetGroupCount?: number;
  4685. }
  4686. declare interface HMRJavascriptParserHooks {
  4687. hotAcceptCallback: SyncBailHook<[any, string[]], void>;
  4688. hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
  4689. }
  4690. declare interface HandleModuleCreationOptions {
  4691. factory: ModuleFactory;
  4692. dependencies: Dependency[];
  4693. originModule: null | Module;
  4694. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4695. context?: string;
  4696. /**
  4697. * recurse into dependencies of the created module
  4698. */
  4699. recursive?: boolean;
  4700. /**
  4701. * connect the resolved module with the origin module
  4702. */
  4703. connectOrigin?: boolean;
  4704. /**
  4705. * check the cycle dependencies of the created module
  4706. */
  4707. checkCycle?: boolean;
  4708. }
  4709. declare class HarmonyImportDependency extends ModuleDependency {
  4710. constructor(
  4711. request: string,
  4712. sourceOrder: number,
  4713. attributes?: ImportAttributes
  4714. );
  4715. sourceOrder: number;
  4716. getImportVar(moduleGraph: ModuleGraph): string;
  4717. getImportStatement(
  4718. update: boolean,
  4719. __1: DependencyTemplateContext
  4720. ): [string, string];
  4721. getLinkingErrors(
  4722. moduleGraph: ModuleGraph,
  4723. ids: string[],
  4724. additionalMessage: string
  4725. ): undefined | WebpackError[];
  4726. static Template: typeof HarmonyImportDependencyTemplate;
  4727. static ExportPresenceModes: {
  4728. NONE: 0;
  4729. WARN: 1;
  4730. AUTO: 2;
  4731. ERROR: 3;
  4732. fromUserOption(str: string | false): 0 | 1 | 2 | 3;
  4733. };
  4734. static NO_EXPORTS_REFERENCED: string[][];
  4735. static EXPORTS_OBJECT_REFERENCED: string[][];
  4736. static TRANSITIVE: typeof TRANSITIVE;
  4737. }
  4738. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  4739. constructor();
  4740. static getImportEmittedRuntime(
  4741. module: Module,
  4742. referencedModule: Module
  4743. ): undefined | string | boolean | SortableSet<string>;
  4744. }
  4745. declare class Hash {
  4746. constructor();
  4747. /**
  4748. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  4749. */
  4750. update(data: string | Buffer, inputEncoding?: string): Hash;
  4751. /**
  4752. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  4753. */
  4754. digest(encoding?: string): string | Buffer;
  4755. }
  4756. declare interface HashableObject {
  4757. updateHash: (arg0: Hash) => void;
  4758. }
  4759. declare class HashedModuleIdsPlugin {
  4760. constructor(options?: HashedModuleIdsPluginOptions);
  4761. options: HashedModuleIdsPluginOptions;
  4762. /**
  4763. * Apply the plugin
  4764. */
  4765. apply(compiler: Compiler): void;
  4766. }
  4767. declare interface HashedModuleIdsPluginOptions {
  4768. /**
  4769. * The context directory for creating names.
  4770. */
  4771. context?: string;
  4772. /**
  4773. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  4774. */
  4775. hashDigest?: "latin1" | "base64" | "hex";
  4776. /**
  4777. * The prefix length of the hash digest to use, defaults to 4.
  4778. */
  4779. hashDigestLength?: number;
  4780. /**
  4781. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  4782. */
  4783. hashFunction?: string | typeof Hash;
  4784. }
  4785. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  4786. declare class HotModuleReplacementPlugin {
  4787. constructor(options?: object);
  4788. options: object;
  4789. /**
  4790. * Apply the plugin
  4791. */
  4792. apply(compiler: Compiler): void;
  4793. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  4794. }
  4795. /**
  4796. * These properties are added by the HotModuleReplacementPlugin
  4797. */
  4798. declare interface HotModuleReplacementPluginLoaderContext {
  4799. hot?: boolean;
  4800. }
  4801. declare class HotUpdateChunk extends Chunk {
  4802. constructor();
  4803. }
  4804. /**
  4805. * Options for building http resources.
  4806. */
  4807. declare interface HttpUriOptions {
  4808. /**
  4809. * List of allowed URIs (resp. the beginning of them).
  4810. */
  4811. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  4812. /**
  4813. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  4814. */
  4815. cacheLocation?: string | false;
  4816. /**
  4817. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  4818. */
  4819. frozen?: boolean;
  4820. /**
  4821. * Location of the lockfile.
  4822. */
  4823. lockfileLocation?: string;
  4824. /**
  4825. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  4826. */
  4827. proxy?: string;
  4828. /**
  4829. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  4830. */
  4831. upgrade?: boolean;
  4832. }
  4833. declare class HttpUriPlugin {
  4834. constructor(options: HttpUriOptions);
  4835. /**
  4836. * Apply the plugin
  4837. */
  4838. apply(compiler: Compiler): void;
  4839. }
  4840. type IBigIntStats = IStatsBase<bigint> & {
  4841. atimeNs: bigint;
  4842. mtimeNs: bigint;
  4843. ctimeNs: bigint;
  4844. birthtimeNs: bigint;
  4845. };
  4846. declare interface IStats {
  4847. isFile: () => boolean;
  4848. isDirectory: () => boolean;
  4849. isBlockDevice: () => boolean;
  4850. isCharacterDevice: () => boolean;
  4851. isSymbolicLink: () => boolean;
  4852. isFIFO: () => boolean;
  4853. isSocket: () => boolean;
  4854. dev: number;
  4855. ino: number;
  4856. mode: number;
  4857. nlink: number;
  4858. uid: number;
  4859. gid: number;
  4860. rdev: number;
  4861. size: number;
  4862. blksize: number;
  4863. blocks: number;
  4864. atimeMs: number;
  4865. mtimeMs: number;
  4866. ctimeMs: number;
  4867. birthtimeMs: number;
  4868. atime: Date;
  4869. mtime: Date;
  4870. ctime: Date;
  4871. birthtime: Date;
  4872. }
  4873. declare interface IStatsBase<T> {
  4874. isFile: () => boolean;
  4875. isDirectory: () => boolean;
  4876. isBlockDevice: () => boolean;
  4877. isCharacterDevice: () => boolean;
  4878. isSymbolicLink: () => boolean;
  4879. isFIFO: () => boolean;
  4880. isSocket: () => boolean;
  4881. dev: T;
  4882. ino: T;
  4883. mode: T;
  4884. nlink: T;
  4885. uid: T;
  4886. gid: T;
  4887. rdev: T;
  4888. size: T;
  4889. blksize: T;
  4890. blocks: T;
  4891. atimeMs: T;
  4892. mtimeMs: T;
  4893. ctimeMs: T;
  4894. birthtimeMs: T;
  4895. atime: Date;
  4896. mtime: Date;
  4897. ctime: Date;
  4898. birthtime: Date;
  4899. }
  4900. declare class IgnorePlugin {
  4901. constructor(options: IgnorePluginOptions);
  4902. options: IgnorePluginOptions;
  4903. /**
  4904. * Note that if "contextRegExp" is given, both the "resourceRegExp"
  4905. * and "contextRegExp" have to match.
  4906. */
  4907. checkIgnore(resolveData: ResolveData): undefined | false;
  4908. /**
  4909. * Apply the plugin
  4910. */
  4911. apply(compiler: Compiler): void;
  4912. }
  4913. type IgnorePluginOptions =
  4914. | {
  4915. /**
  4916. * A RegExp to test the context (directory) against.
  4917. */
  4918. contextRegExp?: RegExp;
  4919. /**
  4920. * A RegExp to test the request against.
  4921. */
  4922. resourceRegExp: RegExp;
  4923. }
  4924. | {
  4925. /**
  4926. * A filter function for resource and context.
  4927. */
  4928. checkResource: (resource: string, context: string) => boolean;
  4929. };
  4930. type ImportAttributes = Record<string, string> & {};
  4931. declare interface ImportDependencyMeta {
  4932. attributes?: ImportAttributes;
  4933. }
  4934. declare interface ImportModuleOptions {
  4935. /**
  4936. * the target layer
  4937. */
  4938. layer?: string;
  4939. /**
  4940. * the target public path
  4941. */
  4942. publicPath?: string;
  4943. /**
  4944. * target base uri
  4945. */
  4946. baseUri?: string;
  4947. }
  4948. type ImportSource =
  4949. | undefined
  4950. | null
  4951. | string
  4952. | SimpleLiteral
  4953. | RegExpLiteral
  4954. | BigIntLiteral;
  4955. /**
  4956. * Options for infrastructure level logging.
  4957. */
  4958. declare interface InfrastructureLogging {
  4959. /**
  4960. * 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.
  4961. */
  4962. appendOnly?: boolean;
  4963. /**
  4964. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  4965. */
  4966. colors?: boolean;
  4967. /**
  4968. * Custom console used for logging.
  4969. */
  4970. console?: Console;
  4971. /**
  4972. * Enable debug logging for specific loggers.
  4973. */
  4974. debug?:
  4975. | string
  4976. | boolean
  4977. | RegExp
  4978. | FilterItemTypes[]
  4979. | ((value: string) => boolean);
  4980. /**
  4981. * Log level.
  4982. */
  4983. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  4984. /**
  4985. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  4986. */
  4987. stream?: NodeJS.WritableStream;
  4988. }
  4989. declare class InitFragment<GenerateContext> {
  4990. constructor(
  4991. content: undefined | string | Source,
  4992. stage: number,
  4993. position: number,
  4994. key?: string,
  4995. endContent?: string | Source
  4996. );
  4997. content?: string | Source;
  4998. stage: number;
  4999. position: number;
  5000. key?: string;
  5001. endContent?: string | Source;
  5002. getContent(context: GenerateContext): undefined | string | Source;
  5003. getEndContent(context: GenerateContext): undefined | string | Source;
  5004. serialize(context: ObjectSerializerContext): void;
  5005. deserialize(context: ObjectDeserializerContext): void;
  5006. merge: any;
  5007. static addToSource<Context, T>(
  5008. source: Source,
  5009. initFragments: InitFragment<T>[],
  5010. context: Context
  5011. ): Source;
  5012. static STAGE_CONSTANTS: number;
  5013. static STAGE_ASYNC_BOUNDARY: number;
  5014. static STAGE_HARMONY_EXPORTS: number;
  5015. static STAGE_HARMONY_IMPORTS: number;
  5016. static STAGE_PROVIDES: number;
  5017. static STAGE_ASYNC_DEPENDENCIES: number;
  5018. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  5019. }
  5020. declare interface InputFileSystem {
  5021. readFile: ReadFileFs;
  5022. readFileSync?: ReadFileSync;
  5023. readlink: ReadlinkFs;
  5024. readlinkSync?: ReadlinkSync;
  5025. readdir: ReaddirFs;
  5026. readdirSync?: ReaddirSync;
  5027. stat: StatFs;
  5028. statSync?: StatSync;
  5029. lstat?: LStatFs;
  5030. lstatSync?: LStatSync;
  5031. realpath?: RealPathFs;
  5032. realpathSync?: RealPathSync;
  5033. readJson?: (
  5034. arg0: PathOrFileDescriptorFs,
  5035. arg1: (
  5036. arg0: null | Error | NodeJS.ErrnoException,
  5037. arg1?: JsonObjectFs
  5038. ) => void
  5039. ) => void;
  5040. readJsonSync?: (arg0: PathOrFileDescriptorFs) => JsonObjectFs;
  5041. purge?: (arg0?: string | string[] | Set<string>) => void;
  5042. join?: (arg0: string, arg1: string) => string;
  5043. relative?: (arg0: string, arg1: string) => string;
  5044. dirname?: (arg0: string) => string;
  5045. }
  5046. type IntermediateFileSystem = InputFileSystem &
  5047. OutputFileSystem &
  5048. IntermediateFileSystemExtras;
  5049. declare interface IntermediateFileSystemExtras {
  5050. mkdirSync: MkdirSync;
  5051. createWriteStream: (
  5052. arg0: PathLikeFs,
  5053. arg1?:
  5054. | "ascii"
  5055. | "utf8"
  5056. | "utf-8"
  5057. | "utf16le"
  5058. | "utf-16le"
  5059. | "ucs2"
  5060. | "ucs-2"
  5061. | "latin1"
  5062. | "binary"
  5063. | "base64"
  5064. | "base64url"
  5065. | "hex"
  5066. | WriteStreamOptions
  5067. ) => NodeJS.WritableStream;
  5068. open: Open;
  5069. read: Read<Buffer>;
  5070. close: (
  5071. arg0: number,
  5072. arg1: (arg0: null | NodeJS.ErrnoException) => void
  5073. ) => void;
  5074. rename: (
  5075. arg0: PathLikeFs,
  5076. arg1: PathLikeFs,
  5077. arg2: (arg0: null | NodeJS.ErrnoException) => void
  5078. ) => void;
  5079. }
  5080. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  5081. declare abstract class ItemCacheFacade {
  5082. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  5083. getPromise<T>(): Promise<T>;
  5084. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  5085. storePromise<T>(data: T): Promise<void>;
  5086. provide<T>(
  5087. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  5088. callback: CallbackNormalErrorCache<T>
  5089. ): void;
  5090. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  5091. }
  5092. declare class JavascriptModulesPlugin {
  5093. constructor(options?: object);
  5094. options: object;
  5095. /**
  5096. * Apply the plugin
  5097. */
  5098. apply(compiler: Compiler): void;
  5099. renderModule(
  5100. module: Module,
  5101. renderContext: ChunkRenderContext,
  5102. hooks: CompilationHooksJavascriptModulesPlugin,
  5103. factory: boolean
  5104. ): Source;
  5105. renderChunk(
  5106. renderContext: RenderContext,
  5107. hooks: CompilationHooksJavascriptModulesPlugin
  5108. ): Source;
  5109. renderMain(
  5110. renderContext: MainRenderContext,
  5111. hooks: CompilationHooksJavascriptModulesPlugin,
  5112. compilation: Compilation
  5113. ): Source;
  5114. updateHashWithBootstrap(
  5115. hash: Hash,
  5116. renderContext: RenderBootstrapContext,
  5117. hooks: CompilationHooksJavascriptModulesPlugin
  5118. ): void;
  5119. renderBootstrap(
  5120. renderContext: RenderBootstrapContext,
  5121. hooks: CompilationHooksJavascriptModulesPlugin
  5122. ): {
  5123. header: string[];
  5124. beforeStartup: string[];
  5125. startup: string[];
  5126. afterStartup: string[];
  5127. allowInlineStartup: boolean;
  5128. };
  5129. renderRequire(
  5130. renderContext: RenderBootstrapContext,
  5131. hooks: CompilationHooksJavascriptModulesPlugin
  5132. ): string;
  5133. renameInlineModule(
  5134. allModules: Module[],
  5135. renderContext: MainRenderContext,
  5136. inlinedModules: Set<Module>,
  5137. chunkRenderContext: ChunkRenderContext,
  5138. hooks: CompilationHooksJavascriptModulesPlugin
  5139. ): Map<Module, Source>;
  5140. findNewName(
  5141. oldName: string,
  5142. usedName: Set<string>,
  5143. extraInfo: string
  5144. ): string;
  5145. static getCompilationHooks(
  5146. compilation: Compilation
  5147. ): CompilationHooksJavascriptModulesPlugin;
  5148. static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
  5149. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  5150. }
  5151. declare class JavascriptParser extends Parser {
  5152. constructor(sourceType?: "module" | "auto" | "script");
  5153. hooks: Readonly<{
  5154. evaluateTypeof: HookMap<
  5155. SyncBailHook<
  5156. [UnaryExpression],
  5157. undefined | null | BasicEvaluatedExpression
  5158. >
  5159. >;
  5160. evaluate: HookMap<
  5161. SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
  5162. >;
  5163. evaluateIdentifier: HookMap<
  5164. SyncBailHook<
  5165. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  5166. undefined | null | BasicEvaluatedExpression
  5167. >
  5168. >;
  5169. evaluateDefinedIdentifier: HookMap<
  5170. SyncBailHook<
  5171. [Identifier | MemberExpression | ThisExpression],
  5172. undefined | null | BasicEvaluatedExpression
  5173. >
  5174. >;
  5175. evaluateNewExpression: HookMap<
  5176. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  5177. >;
  5178. evaluateCallExpression: HookMap<
  5179. SyncBailHook<
  5180. [CallExpression],
  5181. undefined | null | BasicEvaluatedExpression
  5182. >
  5183. >;
  5184. evaluateCallExpressionMember: HookMap<
  5185. SyncBailHook<
  5186. [CallExpression, BasicEvaluatedExpression],
  5187. undefined | null | BasicEvaluatedExpression
  5188. >
  5189. >;
  5190. isPure: HookMap<
  5191. SyncBailHook<
  5192. [
  5193. (
  5194. | UnaryExpression
  5195. | ArrayExpression
  5196. | ArrowFunctionExpression
  5197. | AssignmentExpression
  5198. | AwaitExpression
  5199. | BinaryExpression
  5200. | SimpleCallExpression
  5201. | NewExpression
  5202. | ChainExpression
  5203. | ClassExpression
  5204. | ConditionalExpression
  5205. | FunctionExpression
  5206. | Identifier
  5207. | ImportExpression
  5208. | SimpleLiteral
  5209. | RegExpLiteral
  5210. | BigIntLiteral
  5211. | LogicalExpression
  5212. | MemberExpression
  5213. | MetaProperty
  5214. | ObjectExpression
  5215. | SequenceExpression
  5216. | TaggedTemplateExpression
  5217. | TemplateLiteral
  5218. | ThisExpression
  5219. | UpdateExpression
  5220. | YieldExpression
  5221. | FunctionDeclaration
  5222. | VariableDeclaration
  5223. | ClassDeclaration
  5224. | PrivateIdentifier
  5225. ),
  5226. number
  5227. ],
  5228. boolean | void
  5229. >
  5230. >;
  5231. preStatement: SyncBailHook<
  5232. [
  5233. | FunctionDeclaration
  5234. | VariableDeclaration
  5235. | ClassDeclaration
  5236. | ExpressionStatement
  5237. | BlockStatement
  5238. | StaticBlock
  5239. | EmptyStatement
  5240. | DebuggerStatement
  5241. | WithStatement
  5242. | ReturnStatement
  5243. | LabeledStatement
  5244. | BreakStatement
  5245. | ContinueStatement
  5246. | IfStatement
  5247. | SwitchStatement
  5248. | ThrowStatement
  5249. | TryStatement
  5250. | WhileStatement
  5251. | DoWhileStatement
  5252. | ForStatement
  5253. | ForInStatement
  5254. | ForOfStatement
  5255. | ImportDeclaration
  5256. | ExportNamedDeclaration
  5257. | ExportDefaultDeclaration
  5258. | ExportAllDeclaration
  5259. ],
  5260. boolean | void
  5261. >;
  5262. blockPreStatement: SyncBailHook<
  5263. [
  5264. | FunctionDeclaration
  5265. | VariableDeclaration
  5266. | ClassDeclaration
  5267. | ExpressionStatement
  5268. | BlockStatement
  5269. | StaticBlock
  5270. | EmptyStatement
  5271. | DebuggerStatement
  5272. | WithStatement
  5273. | ReturnStatement
  5274. | LabeledStatement
  5275. | BreakStatement
  5276. | ContinueStatement
  5277. | IfStatement
  5278. | SwitchStatement
  5279. | ThrowStatement
  5280. | TryStatement
  5281. | WhileStatement
  5282. | DoWhileStatement
  5283. | ForStatement
  5284. | ForInStatement
  5285. | ForOfStatement
  5286. | ImportDeclaration
  5287. | ExportNamedDeclaration
  5288. | ExportDefaultDeclaration
  5289. | ExportAllDeclaration
  5290. ],
  5291. boolean | void
  5292. >;
  5293. statement: SyncBailHook<
  5294. [
  5295. | FunctionDeclaration
  5296. | VariableDeclaration
  5297. | ClassDeclaration
  5298. | ExpressionStatement
  5299. | BlockStatement
  5300. | StaticBlock
  5301. | EmptyStatement
  5302. | DebuggerStatement
  5303. | WithStatement
  5304. | ReturnStatement
  5305. | LabeledStatement
  5306. | BreakStatement
  5307. | ContinueStatement
  5308. | IfStatement
  5309. | SwitchStatement
  5310. | ThrowStatement
  5311. | TryStatement
  5312. | WhileStatement
  5313. | DoWhileStatement
  5314. | ForStatement
  5315. | ForInStatement
  5316. | ForOfStatement
  5317. | ImportDeclaration
  5318. | ExportNamedDeclaration
  5319. | ExportDefaultDeclaration
  5320. | ExportAllDeclaration
  5321. ],
  5322. boolean | void
  5323. >;
  5324. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  5325. classExtendsExpression: SyncBailHook<
  5326. [Expression, ClassExpression | ClassDeclaration],
  5327. boolean | void
  5328. >;
  5329. classBodyElement: SyncBailHook<
  5330. [
  5331. StaticBlock | MethodDefinition | PropertyDefinition,
  5332. ClassExpression | ClassDeclaration
  5333. ],
  5334. boolean | void
  5335. >;
  5336. classBodyValue: SyncBailHook<
  5337. [
  5338. Expression,
  5339. MethodDefinition | PropertyDefinition,
  5340. ClassExpression | ClassDeclaration
  5341. ],
  5342. boolean | void
  5343. >;
  5344. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  5345. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  5346. importSpecifier: SyncBailHook<
  5347. [ImportDeclaration, ImportSource, string, string],
  5348. boolean | void
  5349. >;
  5350. export: SyncBailHook<
  5351. [ExportNamedDeclaration | ExportDefaultDeclaration],
  5352. boolean | void
  5353. >;
  5354. exportImport: SyncBailHook<
  5355. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  5356. boolean | void
  5357. >;
  5358. exportDeclaration: SyncBailHook<
  5359. [
  5360. (
  5361. | ExportNamedDeclaration
  5362. | ExportDefaultDeclaration
  5363. | ExportAllDeclaration
  5364. ),
  5365. Declaration
  5366. ],
  5367. boolean | void
  5368. >;
  5369. exportExpression: SyncBailHook<
  5370. [ExportDefaultDeclaration, FunctionDeclaration | ClassDeclaration],
  5371. boolean | void
  5372. >;
  5373. exportSpecifier: SyncBailHook<
  5374. [
  5375. (
  5376. | ExportNamedDeclaration
  5377. | ExportDefaultDeclaration
  5378. | ExportAllDeclaration
  5379. ),
  5380. string,
  5381. string,
  5382. undefined | number
  5383. ],
  5384. boolean | void
  5385. >;
  5386. exportImportSpecifier: SyncBailHook<
  5387. [
  5388. ExportNamedDeclaration | ExportAllDeclaration,
  5389. ImportSource,
  5390. string,
  5391. string,
  5392. undefined | number
  5393. ],
  5394. boolean | void
  5395. >;
  5396. preDeclarator: SyncBailHook<
  5397. [VariableDeclarator, Statement],
  5398. boolean | void
  5399. >;
  5400. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  5401. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5402. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5403. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5404. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5405. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  5406. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5407. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5408. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  5409. assignMemberChain: HookMap<
  5410. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  5411. >;
  5412. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5413. importCall: SyncBailHook<[ImportExpression], boolean | void>;
  5414. topLevelAwait: SyncBailHook<
  5415. [
  5416. | UnaryExpression
  5417. | ArrayExpression
  5418. | ArrowFunctionExpression
  5419. | AssignmentExpression
  5420. | AwaitExpression
  5421. | BinaryExpression
  5422. | SimpleCallExpression
  5423. | NewExpression
  5424. | ChainExpression
  5425. | ClassExpression
  5426. | ConditionalExpression
  5427. | FunctionExpression
  5428. | Identifier
  5429. | ImportExpression
  5430. | SimpleLiteral
  5431. | RegExpLiteral
  5432. | BigIntLiteral
  5433. | LogicalExpression
  5434. | MemberExpression
  5435. | MetaProperty
  5436. | ObjectExpression
  5437. | SequenceExpression
  5438. | TaggedTemplateExpression
  5439. | TemplateLiteral
  5440. | ThisExpression
  5441. | UpdateExpression
  5442. | YieldExpression
  5443. | ForOfStatement
  5444. ],
  5445. boolean | void
  5446. >;
  5447. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  5448. callMemberChain: HookMap<
  5449. SyncBailHook<
  5450. [CallExpression, string[], boolean[], [number, number][]],
  5451. boolean | void
  5452. >
  5453. >;
  5454. memberChainOfCallMemberChain: HookMap<
  5455. SyncBailHook<
  5456. [Expression, string[], CallExpression, string[], [number, number][]],
  5457. boolean | void
  5458. >
  5459. >;
  5460. callMemberChainOfCallMemberChain: HookMap<
  5461. SyncBailHook<
  5462. [
  5463. CallExpression,
  5464. string[],
  5465. CallExpression,
  5466. string[],
  5467. [number, number][]
  5468. ],
  5469. boolean | void
  5470. >
  5471. >;
  5472. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  5473. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  5474. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  5475. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5476. expressionMemberChain: HookMap<
  5477. SyncBailHook<
  5478. [MemberExpression, string[], boolean[], [number, number][]],
  5479. boolean | void
  5480. >
  5481. >;
  5482. unhandledExpressionMemberChain: HookMap<
  5483. SyncBailHook<[MemberExpression, string[]], boolean | void>
  5484. >;
  5485. expressionConditionalOperator: SyncBailHook<
  5486. [ConditionalExpression],
  5487. boolean | void
  5488. >;
  5489. expressionLogicalOperator: SyncBailHook<
  5490. [LogicalExpression],
  5491. boolean | void
  5492. >;
  5493. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  5494. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  5495. }>;
  5496. sourceType: "module" | "auto" | "script";
  5497. scope: ScopeInfo;
  5498. state: ParserState;
  5499. comments?: Comment[];
  5500. semicolons?: Set<number>;
  5501. statementPath: StatementPathItem[];
  5502. prevStatement?:
  5503. | UnaryExpression
  5504. | ArrayExpression
  5505. | ArrowFunctionExpression
  5506. | AssignmentExpression
  5507. | AwaitExpression
  5508. | BinaryExpression
  5509. | SimpleCallExpression
  5510. | NewExpression
  5511. | ChainExpression
  5512. | ClassExpression
  5513. | ConditionalExpression
  5514. | FunctionExpression
  5515. | Identifier
  5516. | ImportExpression
  5517. | SimpleLiteral
  5518. | RegExpLiteral
  5519. | BigIntLiteral
  5520. | LogicalExpression
  5521. | MemberExpression
  5522. | MetaProperty
  5523. | ObjectExpression
  5524. | SequenceExpression
  5525. | TaggedTemplateExpression
  5526. | TemplateLiteral
  5527. | ThisExpression
  5528. | UpdateExpression
  5529. | YieldExpression
  5530. | FunctionDeclaration
  5531. | VariableDeclaration
  5532. | ClassDeclaration
  5533. | ExpressionStatement
  5534. | BlockStatement
  5535. | StaticBlock
  5536. | EmptyStatement
  5537. | DebuggerStatement
  5538. | WithStatement
  5539. | ReturnStatement
  5540. | LabeledStatement
  5541. | BreakStatement
  5542. | ContinueStatement
  5543. | IfStatement
  5544. | SwitchStatement
  5545. | ThrowStatement
  5546. | TryStatement
  5547. | WhileStatement
  5548. | DoWhileStatement
  5549. | ForStatement
  5550. | ForInStatement
  5551. | ForOfStatement
  5552. | ImportDeclaration
  5553. | ExportNamedDeclaration
  5554. | ExportDefaultDeclaration
  5555. | ExportAllDeclaration;
  5556. destructuringAssignmentProperties?: WeakMap<
  5557. Expression,
  5558. Set<DestructuringAssignmentProperty>
  5559. >;
  5560. currentTagData: any;
  5561. magicCommentContext: Context;
  5562. destructuringAssignmentPropertiesFor(
  5563. node: Expression
  5564. ): undefined | Set<DestructuringAssignmentProperty>;
  5565. getRenameIdentifier(
  5566. expr: Expression
  5567. ): undefined | string | VariableInfoInterface;
  5568. walkClass(classy: ClassExpression | ClassDeclaration): void;
  5569. /**
  5570. * Pre walking iterates the scope for variable declarations
  5571. */
  5572. preWalkStatements(
  5573. statements: (
  5574. | FunctionDeclaration
  5575. | VariableDeclaration
  5576. | ClassDeclaration
  5577. | ExpressionStatement
  5578. | BlockStatement
  5579. | StaticBlock
  5580. | EmptyStatement
  5581. | DebuggerStatement
  5582. | WithStatement
  5583. | ReturnStatement
  5584. | LabeledStatement
  5585. | BreakStatement
  5586. | ContinueStatement
  5587. | IfStatement
  5588. | SwitchStatement
  5589. | ThrowStatement
  5590. | TryStatement
  5591. | WhileStatement
  5592. | DoWhileStatement
  5593. | ForStatement
  5594. | ForInStatement
  5595. | ForOfStatement
  5596. | ImportDeclaration
  5597. | ExportNamedDeclaration
  5598. | ExportDefaultDeclaration
  5599. | ExportAllDeclaration
  5600. )[]
  5601. ): void;
  5602. /**
  5603. * Block pre walking iterates the scope for block variable declarations
  5604. */
  5605. blockPreWalkStatements(
  5606. statements: (
  5607. | FunctionDeclaration
  5608. | VariableDeclaration
  5609. | ClassDeclaration
  5610. | ExpressionStatement
  5611. | BlockStatement
  5612. | StaticBlock
  5613. | EmptyStatement
  5614. | DebuggerStatement
  5615. | WithStatement
  5616. | ReturnStatement
  5617. | LabeledStatement
  5618. | BreakStatement
  5619. | ContinueStatement
  5620. | IfStatement
  5621. | SwitchStatement
  5622. | ThrowStatement
  5623. | TryStatement
  5624. | WhileStatement
  5625. | DoWhileStatement
  5626. | ForStatement
  5627. | ForInStatement
  5628. | ForOfStatement
  5629. | ImportDeclaration
  5630. | ExportNamedDeclaration
  5631. | ExportDefaultDeclaration
  5632. | ExportAllDeclaration
  5633. )[]
  5634. ): void;
  5635. /**
  5636. * Walking iterates the statements and expressions and processes them
  5637. */
  5638. walkStatements(
  5639. statements: (
  5640. | FunctionDeclaration
  5641. | VariableDeclaration
  5642. | ClassDeclaration
  5643. | ExpressionStatement
  5644. | BlockStatement
  5645. | StaticBlock
  5646. | EmptyStatement
  5647. | DebuggerStatement
  5648. | WithStatement
  5649. | ReturnStatement
  5650. | LabeledStatement
  5651. | BreakStatement
  5652. | ContinueStatement
  5653. | IfStatement
  5654. | SwitchStatement
  5655. | ThrowStatement
  5656. | TryStatement
  5657. | WhileStatement
  5658. | DoWhileStatement
  5659. | ForStatement
  5660. | ForInStatement
  5661. | ForOfStatement
  5662. | ImportDeclaration
  5663. | ExportNamedDeclaration
  5664. | ExportDefaultDeclaration
  5665. | ExportAllDeclaration
  5666. )[]
  5667. ): void;
  5668. /**
  5669. * Walking iterates the statements and expressions and processes them
  5670. */
  5671. preWalkStatement(
  5672. statement:
  5673. | FunctionDeclaration
  5674. | VariableDeclaration
  5675. | ClassDeclaration
  5676. | ExpressionStatement
  5677. | BlockStatement
  5678. | StaticBlock
  5679. | EmptyStatement
  5680. | DebuggerStatement
  5681. | WithStatement
  5682. | ReturnStatement
  5683. | LabeledStatement
  5684. | BreakStatement
  5685. | ContinueStatement
  5686. | IfStatement
  5687. | SwitchStatement
  5688. | ThrowStatement
  5689. | TryStatement
  5690. | WhileStatement
  5691. | DoWhileStatement
  5692. | ForStatement
  5693. | ForInStatement
  5694. | ForOfStatement
  5695. | ImportDeclaration
  5696. | ExportNamedDeclaration
  5697. | ExportDefaultDeclaration
  5698. | ExportAllDeclaration
  5699. ): void;
  5700. blockPreWalkStatement(
  5701. statement:
  5702. | FunctionDeclaration
  5703. | VariableDeclaration
  5704. | ClassDeclaration
  5705. | ExpressionStatement
  5706. | BlockStatement
  5707. | StaticBlock
  5708. | EmptyStatement
  5709. | DebuggerStatement
  5710. | WithStatement
  5711. | ReturnStatement
  5712. | LabeledStatement
  5713. | BreakStatement
  5714. | ContinueStatement
  5715. | IfStatement
  5716. | SwitchStatement
  5717. | ThrowStatement
  5718. | TryStatement
  5719. | WhileStatement
  5720. | DoWhileStatement
  5721. | ForStatement
  5722. | ForInStatement
  5723. | ForOfStatement
  5724. | ImportDeclaration
  5725. | ExportNamedDeclaration
  5726. | ExportDefaultDeclaration
  5727. | ExportAllDeclaration
  5728. ): void;
  5729. walkStatement(
  5730. statement:
  5731. | FunctionDeclaration
  5732. | VariableDeclaration
  5733. | ClassDeclaration
  5734. | ExpressionStatement
  5735. | BlockStatement
  5736. | StaticBlock
  5737. | EmptyStatement
  5738. | DebuggerStatement
  5739. | WithStatement
  5740. | ReturnStatement
  5741. | LabeledStatement
  5742. | BreakStatement
  5743. | ContinueStatement
  5744. | IfStatement
  5745. | SwitchStatement
  5746. | ThrowStatement
  5747. | TryStatement
  5748. | WhileStatement
  5749. | DoWhileStatement
  5750. | ForStatement
  5751. | ForInStatement
  5752. | ForOfStatement
  5753. | ImportDeclaration
  5754. | ExportNamedDeclaration
  5755. | ExportDefaultDeclaration
  5756. | ExportAllDeclaration
  5757. ): void;
  5758. /**
  5759. * Walks a statements that is nested within a parent statement
  5760. * and can potentially be a non-block statement.
  5761. * This enforces the nested statement to never be in ASI position.
  5762. */
  5763. walkNestedStatement(statement: Statement): void;
  5764. preWalkBlockStatement(statement: BlockStatement): void;
  5765. walkBlockStatement(statement: BlockStatement): void;
  5766. walkExpressionStatement(statement: ExpressionStatement): void;
  5767. preWalkIfStatement(statement: IfStatement): void;
  5768. walkIfStatement(statement: IfStatement): void;
  5769. preWalkLabeledStatement(statement: LabeledStatement): void;
  5770. walkLabeledStatement(statement: LabeledStatement): void;
  5771. preWalkWithStatement(statement: WithStatement): void;
  5772. walkWithStatement(statement: WithStatement): void;
  5773. preWalkSwitchStatement(statement: SwitchStatement): void;
  5774. walkSwitchStatement(statement: SwitchStatement): void;
  5775. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  5776. walkReturnStatement(statement: ReturnStatement): void;
  5777. walkThrowStatement(statement: ThrowStatement): void;
  5778. preWalkTryStatement(statement: TryStatement): void;
  5779. walkTryStatement(statement: TryStatement): void;
  5780. preWalkWhileStatement(statement: WhileStatement): void;
  5781. walkWhileStatement(statement: WhileStatement): void;
  5782. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  5783. walkDoWhileStatement(statement: DoWhileStatement): void;
  5784. preWalkForStatement(statement: ForStatement): void;
  5785. walkForStatement(statement: ForStatement): void;
  5786. preWalkForInStatement(statement: ForInStatement): void;
  5787. walkForInStatement(statement: ForInStatement): void;
  5788. preWalkForOfStatement(statement: ForOfStatement): void;
  5789. walkForOfStatement(statement: ForOfStatement): void;
  5790. preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
  5791. walkFunctionDeclaration(statement: FunctionDeclaration): void;
  5792. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  5793. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  5794. blockPreWalkImportDeclaration(statement: ImportDeclaration): void;
  5795. enterDeclaration(declaration: Declaration, onIdent?: any): void;
  5796. blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  5797. walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  5798. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  5799. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  5800. blockPreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
  5801. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  5802. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  5803. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  5804. walkVariableDeclaration(statement: VariableDeclaration): void;
  5805. blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
  5806. walkClassDeclaration(statement: ClassDeclaration): void;
  5807. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  5808. walkSwitchCases(switchCases: SwitchCase[]): void;
  5809. preWalkCatchClause(catchClause: CatchClause): void;
  5810. walkCatchClause(catchClause: CatchClause): void;
  5811. walkPattern(pattern: Pattern): void;
  5812. walkAssignmentPattern(pattern: AssignmentPattern): void;
  5813. walkObjectPattern(pattern: ObjectPattern): void;
  5814. walkArrayPattern(pattern: ArrayPattern): void;
  5815. walkRestElement(pattern: RestElement): void;
  5816. walkExpressions(
  5817. expressions: (
  5818. | null
  5819. | UnaryExpression
  5820. | ArrayExpression
  5821. | ArrowFunctionExpression
  5822. | AssignmentExpression
  5823. | AwaitExpression
  5824. | BinaryExpression
  5825. | SimpleCallExpression
  5826. | NewExpression
  5827. | ChainExpression
  5828. | ClassExpression
  5829. | ConditionalExpression
  5830. | FunctionExpression
  5831. | Identifier
  5832. | ImportExpression
  5833. | SimpleLiteral
  5834. | RegExpLiteral
  5835. | BigIntLiteral
  5836. | LogicalExpression
  5837. | MemberExpression
  5838. | MetaProperty
  5839. | ObjectExpression
  5840. | SequenceExpression
  5841. | TaggedTemplateExpression
  5842. | TemplateLiteral
  5843. | ThisExpression
  5844. | UpdateExpression
  5845. | YieldExpression
  5846. | SpreadElement
  5847. )[]
  5848. ): void;
  5849. walkExpression(expression?: any): void;
  5850. walkAwaitExpression(expression: AwaitExpression): void;
  5851. walkArrayExpression(expression: ArrayExpression): void;
  5852. walkSpreadElement(expression: SpreadElement): void;
  5853. walkObjectExpression(expression: ObjectExpression): void;
  5854. walkProperty(prop: SpreadElement | Property): void;
  5855. walkFunctionExpression(expression: FunctionExpression): void;
  5856. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  5857. walkSequenceExpression(expression: SequenceExpression): void;
  5858. walkUpdateExpression(expression: UpdateExpression): void;
  5859. walkUnaryExpression(expression: UnaryExpression): void;
  5860. walkLeftRightExpression(
  5861. expression: BinaryExpression | LogicalExpression
  5862. ): void;
  5863. walkBinaryExpression(expression: BinaryExpression): void;
  5864. walkLogicalExpression(expression: LogicalExpression): void;
  5865. walkAssignmentExpression(expression: AssignmentExpression): void;
  5866. walkConditionalExpression(expression: ConditionalExpression): void;
  5867. walkNewExpression(expression: NewExpression): void;
  5868. walkYieldExpression(expression: YieldExpression): void;
  5869. walkTemplateLiteral(expression: TemplateLiteral): void;
  5870. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  5871. walkClassExpression(expression: ClassExpression): void;
  5872. walkChainExpression(expression: ChainExpression): void;
  5873. walkImportExpression(expression: ImportExpression): void;
  5874. walkCallExpression(expression: CallExpression): void;
  5875. walkMemberExpression(expression: MemberExpression): void;
  5876. walkMemberExpressionWithExpressionName(
  5877. expression: any,
  5878. name: string,
  5879. rootInfo: string | VariableInfo,
  5880. members: string[],
  5881. onUnhandled?: any
  5882. ): void;
  5883. walkThisExpression(expression: ThisExpression): void;
  5884. walkIdentifier(expression: Identifier): void;
  5885. walkMetaProperty(metaProperty: MetaProperty): void;
  5886. callHooksForExpression<T, R>(
  5887. hookMap: HookMap<SyncBailHook<T, R>>,
  5888. expr: any,
  5889. ...args: AsArray<T>
  5890. ): undefined | R;
  5891. callHooksForExpressionWithFallback<T, R>(
  5892. hookMap: HookMap<SyncBailHook<T, R>>,
  5893. expr: MemberExpression,
  5894. fallback:
  5895. | undefined
  5896. | ((
  5897. arg0: string,
  5898. arg1: string | ScopeInfo | VariableInfo,
  5899. arg2: () => string[]
  5900. ) => any),
  5901. defined: undefined | ((arg0: string) => any),
  5902. ...args: AsArray<T>
  5903. ): undefined | R;
  5904. callHooksForName<T, R>(
  5905. hookMap: HookMap<SyncBailHook<T, R>>,
  5906. name: string,
  5907. ...args: AsArray<T>
  5908. ): undefined | R;
  5909. callHooksForInfo<T, R>(
  5910. hookMap: HookMap<SyncBailHook<T, R>>,
  5911. info: ExportedVariableInfo,
  5912. ...args: AsArray<T>
  5913. ): undefined | R;
  5914. callHooksForInfoWithFallback<T, R>(
  5915. hookMap: HookMap<SyncBailHook<T, R>>,
  5916. info: ExportedVariableInfo,
  5917. fallback: undefined | ((arg0: string) => any),
  5918. defined: undefined | (() => any),
  5919. ...args: AsArray<T>
  5920. ): undefined | R;
  5921. callHooksForNameWithFallback<T, R>(
  5922. hookMap: HookMap<SyncBailHook<T, R>>,
  5923. name: string,
  5924. fallback: undefined | ((arg0: string) => any),
  5925. defined: undefined | (() => any),
  5926. ...args: AsArray<T>
  5927. ): undefined | R;
  5928. inScope(params: any, fn: () => void): void;
  5929. inClassScope(hasThis: boolean, params: any, fn: () => void): void;
  5930. inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
  5931. inBlockScope(fn: () => void): void;
  5932. detectMode(
  5933. statements: (
  5934. | FunctionDeclaration
  5935. | VariableDeclaration
  5936. | ClassDeclaration
  5937. | ExpressionStatement
  5938. | BlockStatement
  5939. | StaticBlock
  5940. | EmptyStatement
  5941. | DebuggerStatement
  5942. | WithStatement
  5943. | ReturnStatement
  5944. | LabeledStatement
  5945. | BreakStatement
  5946. | ContinueStatement
  5947. | IfStatement
  5948. | SwitchStatement
  5949. | ThrowStatement
  5950. | TryStatement
  5951. | WhileStatement
  5952. | DoWhileStatement
  5953. | ForStatement
  5954. | ForInStatement
  5955. | ForOfStatement
  5956. | ImportDeclaration
  5957. | ExportNamedDeclaration
  5958. | ExportDefaultDeclaration
  5959. | ExportAllDeclaration
  5960. | Directive
  5961. )[]
  5962. ): void;
  5963. enterPatterns(
  5964. patterns: (
  5965. | string
  5966. | Identifier
  5967. | MemberExpression
  5968. | ObjectPattern
  5969. | ArrayPattern
  5970. | RestElement
  5971. | AssignmentPattern
  5972. | Property
  5973. )[],
  5974. onIdent?: any
  5975. ): void;
  5976. enterPattern(
  5977. pattern:
  5978. | Identifier
  5979. | MemberExpression
  5980. | ObjectPattern
  5981. | ArrayPattern
  5982. | RestElement
  5983. | AssignmentPattern
  5984. | Property,
  5985. onIdent?: any
  5986. ): void;
  5987. enterIdentifier(pattern: Identifier, onIdent?: any): void;
  5988. enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
  5989. enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
  5990. enterRestElement(pattern: RestElement, onIdent?: any): void;
  5991. enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
  5992. evaluateExpression(expression?: any): BasicEvaluatedExpression;
  5993. parseString(expression: Expression): string;
  5994. parseCalculatedString(expression: Expression): any;
  5995. evaluate(source: string): BasicEvaluatedExpression;
  5996. isPure(
  5997. expr:
  5998. | undefined
  5999. | null
  6000. | UnaryExpression
  6001. | ArrayExpression
  6002. | ArrowFunctionExpression
  6003. | AssignmentExpression
  6004. | AwaitExpression
  6005. | BinaryExpression
  6006. | SimpleCallExpression
  6007. | NewExpression
  6008. | ChainExpression
  6009. | ClassExpression
  6010. | ConditionalExpression
  6011. | FunctionExpression
  6012. | Identifier
  6013. | ImportExpression
  6014. | SimpleLiteral
  6015. | RegExpLiteral
  6016. | BigIntLiteral
  6017. | LogicalExpression
  6018. | MemberExpression
  6019. | MetaProperty
  6020. | ObjectExpression
  6021. | SequenceExpression
  6022. | TaggedTemplateExpression
  6023. | TemplateLiteral
  6024. | ThisExpression
  6025. | UpdateExpression
  6026. | YieldExpression
  6027. | FunctionDeclaration
  6028. | VariableDeclaration
  6029. | ClassDeclaration
  6030. | PrivateIdentifier,
  6031. commentsStartPos: number
  6032. ): boolean;
  6033. getComments(range: [number, number]): Comment[];
  6034. isAsiPosition(pos: number): boolean;
  6035. unsetAsiPosition(pos: number): void;
  6036. isStatementLevelExpression(expr: Expression): boolean;
  6037. getTagData(name: string, tag?: any): any;
  6038. tagVariable(name: string, tag?: any, data?: any): void;
  6039. defineVariable(name: string): void;
  6040. undefineVariable(name: string): void;
  6041. isVariableDefined(name: string): boolean;
  6042. getVariableInfo(name: string): ExportedVariableInfo;
  6043. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  6044. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  6045. parseCommentOptions(range: [number, number]): any;
  6046. extractMemberExpressionChain(expression: MemberExpression): {
  6047. members: string[];
  6048. object:
  6049. | UnaryExpression
  6050. | ArrayExpression
  6051. | ArrowFunctionExpression
  6052. | AssignmentExpression
  6053. | AwaitExpression
  6054. | BinaryExpression
  6055. | SimpleCallExpression
  6056. | NewExpression
  6057. | ChainExpression
  6058. | ClassExpression
  6059. | ConditionalExpression
  6060. | FunctionExpression
  6061. | Identifier
  6062. | ImportExpression
  6063. | SimpleLiteral
  6064. | RegExpLiteral
  6065. | BigIntLiteral
  6066. | LogicalExpression
  6067. | MemberExpression
  6068. | MetaProperty
  6069. | ObjectExpression
  6070. | SequenceExpression
  6071. | TaggedTemplateExpression
  6072. | TemplateLiteral
  6073. | ThisExpression
  6074. | UpdateExpression
  6075. | YieldExpression
  6076. | Super;
  6077. membersOptionals: boolean[];
  6078. memberRanges: [number, number][];
  6079. };
  6080. getFreeInfoFromVariable(
  6081. varName: string
  6082. ): undefined | { name: string; info: string | VariableInfo };
  6083. getMemberExpressionInfo(
  6084. expression: MemberExpression,
  6085. allowedTypes: number
  6086. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  6087. getNameForExpression(
  6088. expression: MemberExpression
  6089. ):
  6090. | undefined
  6091. | {
  6092. name: string;
  6093. rootInfo: ExportedVariableInfo;
  6094. getMembers: () => string[];
  6095. };
  6096. static ALLOWED_MEMBER_TYPES_ALL: 3;
  6097. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  6098. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  6099. }
  6100. /**
  6101. * Parser options for javascript modules.
  6102. */
  6103. declare interface JavascriptParserOptions {
  6104. [index: string]: any;
  6105. /**
  6106. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  6107. */
  6108. amd?: false | { [index: string]: any };
  6109. /**
  6110. * Enable/disable special handling for browserify bundles.
  6111. */
  6112. browserify?: boolean;
  6113. /**
  6114. * Enable/disable parsing of CommonJs syntax.
  6115. */
  6116. commonjs?: boolean;
  6117. /**
  6118. * Enable/disable parsing of magic comments in CommonJs syntax.
  6119. */
  6120. commonjsMagicComments?: boolean;
  6121. /**
  6122. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  6123. */
  6124. createRequire?: string | boolean;
  6125. /**
  6126. * Specifies global fetchPriority for dynamic import.
  6127. */
  6128. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  6129. /**
  6130. * Specifies global mode for dynamic import.
  6131. */
  6132. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  6133. /**
  6134. * Specifies global prefetch for dynamic import.
  6135. */
  6136. dynamicImportPrefetch?: number | boolean;
  6137. /**
  6138. * Specifies global preload for dynamic import.
  6139. */
  6140. dynamicImportPreload?: number | boolean;
  6141. /**
  6142. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  6143. */
  6144. exportsPresence?: false | "auto" | "error" | "warn";
  6145. /**
  6146. * Enable warnings for full dynamic dependencies.
  6147. */
  6148. exprContextCritical?: boolean;
  6149. /**
  6150. * Enable recursive directory lookup for full dynamic dependencies.
  6151. */
  6152. exprContextRecursive?: boolean;
  6153. /**
  6154. * Sets the default regular expression for full dynamic dependencies.
  6155. */
  6156. exprContextRegExp?: boolean | RegExp;
  6157. /**
  6158. * Set the default request for full dynamic dependencies.
  6159. */
  6160. exprContextRequest?: string;
  6161. /**
  6162. * Enable/disable parsing of EcmaScript Modules syntax.
  6163. */
  6164. harmony?: boolean;
  6165. /**
  6166. * Enable/disable parsing of import() syntax.
  6167. */
  6168. import?: boolean;
  6169. /**
  6170. * Specifies the behavior of invalid export names in "import ... from ...".
  6171. */
  6172. importExportsPresence?: false | "auto" | "error" | "warn";
  6173. /**
  6174. * Enable/disable evaluating import.meta.
  6175. */
  6176. importMeta?: boolean;
  6177. /**
  6178. * Enable/disable evaluating import.meta.webpackContext.
  6179. */
  6180. importMetaContext?: boolean;
  6181. /**
  6182. * Include polyfills or mocks for various node stuff.
  6183. */
  6184. node?: false | NodeOptions;
  6185. /**
  6186. * Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
  6187. */
  6188. overrideStrict?: "strict" | "non-strict";
  6189. /**
  6190. * 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.
  6191. */
  6192. reexportExportsPresence?: false | "auto" | "error" | "warn";
  6193. /**
  6194. * Enable/disable parsing of require.context syntax.
  6195. */
  6196. requireContext?: boolean;
  6197. /**
  6198. * Enable/disable parsing of require.ensure syntax.
  6199. */
  6200. requireEnsure?: boolean;
  6201. /**
  6202. * Enable/disable parsing of require.include syntax.
  6203. */
  6204. requireInclude?: boolean;
  6205. /**
  6206. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  6207. */
  6208. requireJs?: boolean;
  6209. /**
  6210. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  6211. */
  6212. strictExportPresence?: boolean;
  6213. /**
  6214. * Handle the this context correctly according to the spec for namespace objects.
  6215. */
  6216. strictThisContextOnImports?: boolean;
  6217. /**
  6218. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  6219. */
  6220. system?: boolean;
  6221. /**
  6222. * Enable warnings when using the require function in a not statically analyse-able way.
  6223. */
  6224. unknownContextCritical?: boolean;
  6225. /**
  6226. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  6227. */
  6228. unknownContextRecursive?: boolean;
  6229. /**
  6230. * Sets the regular expression when using the require function in a not statically analyse-able way.
  6231. */
  6232. unknownContextRegExp?: boolean | RegExp;
  6233. /**
  6234. * Sets the request when using the require function in a not statically analyse-able way.
  6235. */
  6236. unknownContextRequest?: string;
  6237. /**
  6238. * Enable/disable parsing of new URL() syntax.
  6239. */
  6240. url?: boolean | "relative";
  6241. /**
  6242. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  6243. */
  6244. worker?: boolean | string[];
  6245. /**
  6246. * Enable warnings for partial dynamic dependencies.
  6247. */
  6248. wrappedContextCritical?: boolean;
  6249. /**
  6250. * Enable recursive directory lookup for partial dynamic dependencies.
  6251. */
  6252. wrappedContextRecursive?: boolean;
  6253. /**
  6254. * Set the inner regular expression for partial dynamic dependencies.
  6255. */
  6256. wrappedContextRegExp?: RegExp;
  6257. }
  6258. type JsonObjectFs = { [index: string]: JsonValueFs } & {
  6259. [index: string]:
  6260. | undefined
  6261. | null
  6262. | string
  6263. | number
  6264. | boolean
  6265. | JsonObjectFs
  6266. | JsonValueFs[];
  6267. };
  6268. type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
  6269. [index: string]:
  6270. | undefined
  6271. | null
  6272. | string
  6273. | number
  6274. | boolean
  6275. | JsonObjectTypes
  6276. | JsonValueTypes[];
  6277. };
  6278. type JsonValueFs =
  6279. | null
  6280. | string
  6281. | number
  6282. | boolean
  6283. | JsonObjectFs
  6284. | JsonValueFs[];
  6285. type JsonValueTypes =
  6286. | null
  6287. | string
  6288. | number
  6289. | boolean
  6290. | JsonObjectTypes
  6291. | JsonValueTypes[];
  6292. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  6293. constructor(runtimeRequirements: ReadonlySet<string>);
  6294. static getCompilationHooks(
  6295. compilation: Compilation
  6296. ): JsonpCompilationPluginHooks;
  6297. /**
  6298. * Runtime modules without any dependencies to other runtime modules
  6299. */
  6300. static STAGE_NORMAL: number;
  6301. /**
  6302. * Runtime modules with simple dependencies on other runtime modules
  6303. */
  6304. static STAGE_BASIC: number;
  6305. /**
  6306. * Runtime modules which attach to handlers of other runtime modules
  6307. */
  6308. static STAGE_ATTACH: number;
  6309. /**
  6310. * Runtime modules which trigger actions on bootstrap
  6311. */
  6312. static STAGE_TRIGGER: number;
  6313. }
  6314. declare interface JsonpCompilationPluginHooks {
  6315. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  6316. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  6317. }
  6318. declare class JsonpTemplatePlugin {
  6319. constructor();
  6320. /**
  6321. * Apply the plugin
  6322. */
  6323. apply(compiler: Compiler): void;
  6324. static getCompilationHooks(
  6325. compilation: Compilation
  6326. ): JsonpCompilationPluginHooks;
  6327. }
  6328. declare interface KnownAssetInfo {
  6329. /**
  6330. * true, if the asset can be long term cached forever (contains a hash)
  6331. */
  6332. immutable?: boolean;
  6333. /**
  6334. * whether the asset is minimized
  6335. */
  6336. minimized?: boolean;
  6337. /**
  6338. * the value(s) of the full hash used for this asset
  6339. */
  6340. fullhash?: string | string[];
  6341. /**
  6342. * the value(s) of the chunk hash used for this asset
  6343. */
  6344. chunkhash?: string | string[];
  6345. /**
  6346. * the value(s) of the module hash used for this asset
  6347. */
  6348. modulehash?: string | string[];
  6349. /**
  6350. * the value(s) of the content hash used for this asset
  6351. */
  6352. contenthash?: string | string[];
  6353. /**
  6354. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  6355. */
  6356. sourceFilename?: string;
  6357. /**
  6358. * size in bytes, only set after asset has been emitted
  6359. */
  6360. size?: number;
  6361. /**
  6362. * true, when asset is only used for development and doesn't count towards user-facing assets
  6363. */
  6364. development?: boolean;
  6365. /**
  6366. * true, when asset ships data for updating an existing application (HMR)
  6367. */
  6368. hotModuleReplacement?: boolean;
  6369. /**
  6370. * true, when asset is javascript and an ESM
  6371. */
  6372. javascriptModule?: boolean;
  6373. /**
  6374. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  6375. */
  6376. related?: Record<string, string | string[]>;
  6377. }
  6378. declare interface KnownBuildInfo {
  6379. cacheable?: boolean;
  6380. parsed?: boolean;
  6381. fileDependencies?: LazySet<string>;
  6382. contextDependencies?: LazySet<string>;
  6383. missingDependencies?: LazySet<string>;
  6384. buildDependencies?: LazySet<string>;
  6385. valueDependencies?: Map<string, string | Set<string>>;
  6386. hash?: any;
  6387. assets?: Record<string, Source>;
  6388. assetsInfo?: Map<string, undefined | AssetInfo>;
  6389. snapshot?: null | Snapshot;
  6390. }
  6391. declare interface KnownBuildMeta {
  6392. moduleArgument?: string;
  6393. exportsArgument?: string;
  6394. strict?: boolean;
  6395. moduleConcatenationBailout?: string;
  6396. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  6397. defaultObject?: false | "redirect" | "redirect-warn";
  6398. strictHarmonyModule?: boolean;
  6399. async?: boolean;
  6400. sideEffectFree?: boolean;
  6401. }
  6402. declare interface KnownCreateStatsOptionsContext {
  6403. forToString?: boolean;
  6404. }
  6405. declare interface KnownHooks {
  6406. resolveStep: SyncHook<
  6407. [
  6408. AsyncSeriesBailHook<
  6409. [ResolveRequest, ResolveContext],
  6410. null | ResolveRequest
  6411. >,
  6412. ResolveRequest
  6413. ]
  6414. >;
  6415. noResolve: SyncHook<[ResolveRequest, Error]>;
  6416. resolve: AsyncSeriesBailHook<
  6417. [ResolveRequest, ResolveContext],
  6418. null | ResolveRequest
  6419. >;
  6420. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  6421. }
  6422. declare interface KnownNormalizedStatsOptions {
  6423. context: string;
  6424. requestShortener: RequestShortener;
  6425. chunksSort: string;
  6426. modulesSort: string;
  6427. chunkModulesSort: string;
  6428. nestedModulesSort: string;
  6429. assetsSort: string;
  6430. ids: boolean;
  6431. cachedAssets: boolean;
  6432. groupAssetsByEmitStatus: boolean;
  6433. groupAssetsByPath: boolean;
  6434. groupAssetsByExtension: boolean;
  6435. assetsSpace: number;
  6436. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  6437. excludeModules: ((
  6438. name: string,
  6439. module: StatsModule,
  6440. type: "module" | "chunk" | "root-of-chunk" | "nested"
  6441. ) => boolean)[];
  6442. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  6443. cachedModules: boolean;
  6444. orphanModules: boolean;
  6445. dependentModules: boolean;
  6446. runtimeModules: boolean;
  6447. groupModulesByCacheStatus: boolean;
  6448. groupModulesByLayer: boolean;
  6449. groupModulesByAttributes: boolean;
  6450. groupModulesByPath: boolean;
  6451. groupModulesByExtension: boolean;
  6452. groupModulesByType: boolean;
  6453. entrypoints: boolean | "auto";
  6454. chunkGroups: boolean;
  6455. chunkGroupAuxiliary: boolean;
  6456. chunkGroupChildren: boolean;
  6457. chunkGroupMaxAssets: number;
  6458. modulesSpace: number;
  6459. chunkModulesSpace: number;
  6460. nestedModulesSpace: number;
  6461. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  6462. loggingDebug: ((value: string) => boolean)[];
  6463. loggingTrace: boolean;
  6464. }
  6465. declare interface KnownStatsAsset {
  6466. type: string;
  6467. name: string;
  6468. info: AssetInfo;
  6469. size: number;
  6470. emitted: boolean;
  6471. comparedForEmit: boolean;
  6472. cached: boolean;
  6473. related?: StatsAsset[];
  6474. chunkNames?: (string | number)[];
  6475. chunkIdHints?: (string | number)[];
  6476. chunks?: (string | number)[];
  6477. auxiliaryChunkNames?: (string | number)[];
  6478. auxiliaryChunks?: (string | number)[];
  6479. auxiliaryChunkIdHints?: (string | number)[];
  6480. filteredRelated?: number;
  6481. isOverSizeLimit?: boolean;
  6482. }
  6483. declare interface KnownStatsChunk {
  6484. rendered: boolean;
  6485. initial: boolean;
  6486. entry: boolean;
  6487. recorded: boolean;
  6488. reason?: string;
  6489. size: number;
  6490. sizes?: Record<string, number>;
  6491. names?: string[];
  6492. idHints?: string[];
  6493. runtime?: string[];
  6494. files?: string[];
  6495. auxiliaryFiles?: string[];
  6496. hash: string;
  6497. childrenByOrder?: Record<string, (string | number)[]>;
  6498. id?: string | number;
  6499. siblings?: (string | number)[];
  6500. parents?: (string | number)[];
  6501. children?: (string | number)[];
  6502. modules?: StatsModule[];
  6503. filteredModules?: number;
  6504. origins?: StatsChunkOrigin[];
  6505. }
  6506. declare interface KnownStatsChunkGroup {
  6507. name?: string;
  6508. chunks?: (string | number)[];
  6509. assets?: { name: string; size?: number }[];
  6510. filteredAssets?: number;
  6511. assetsSize?: number;
  6512. auxiliaryAssets?: { name: string; size?: number }[];
  6513. filteredAuxiliaryAssets?: number;
  6514. auxiliaryAssetsSize?: number;
  6515. children?: { [index: string]: StatsChunkGroup[] };
  6516. childAssets?: { [index: string]: string[] };
  6517. isOverSizeLimit?: boolean;
  6518. }
  6519. declare interface KnownStatsChunkOrigin {
  6520. module?: string;
  6521. moduleIdentifier?: string;
  6522. moduleName?: string;
  6523. loc?: string;
  6524. request?: string;
  6525. moduleId?: string | number;
  6526. }
  6527. declare interface KnownStatsCompilation {
  6528. env?: any;
  6529. name?: string;
  6530. hash?: string;
  6531. version?: string;
  6532. time?: number;
  6533. builtAt?: number;
  6534. needAdditionalPass?: boolean;
  6535. publicPath?: string;
  6536. outputPath?: string;
  6537. assetsByChunkName?: Record<string, string[]>;
  6538. assets?: StatsAsset[];
  6539. filteredAssets?: number;
  6540. chunks?: StatsChunk[];
  6541. modules?: StatsModule[];
  6542. filteredModules?: number;
  6543. entrypoints?: Record<string, StatsChunkGroup>;
  6544. namedChunkGroups?: Record<string, StatsChunkGroup>;
  6545. errors?: StatsError[];
  6546. errorsCount?: number;
  6547. warnings?: StatsError[];
  6548. warningsCount?: number;
  6549. children?: StatsCompilation[];
  6550. logging?: Record<string, StatsLogging>;
  6551. }
  6552. declare interface KnownStatsError {
  6553. message: string;
  6554. chunkName?: string;
  6555. chunkEntry?: boolean;
  6556. chunkInitial?: boolean;
  6557. file?: string;
  6558. moduleIdentifier?: string;
  6559. moduleName?: string;
  6560. loc?: string;
  6561. chunkId?: string | number;
  6562. moduleId?: string | number;
  6563. moduleTrace?: StatsModuleTraceItem[];
  6564. details?: any;
  6565. stack?: string;
  6566. }
  6567. declare interface KnownStatsFactoryContext {
  6568. type: string;
  6569. makePathsRelative?: (arg0: string) => string;
  6570. compilation?: Compilation;
  6571. rootModules?: Set<Module>;
  6572. compilationFileToChunks?: Map<string, Chunk[]>;
  6573. compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
  6574. runtime?: RuntimeSpec;
  6575. cachedGetErrors?: (arg0: Compilation) => WebpackError[];
  6576. cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
  6577. }
  6578. declare interface KnownStatsLogging {
  6579. entries: StatsLoggingEntry[];
  6580. filteredEntries: number;
  6581. debug: boolean;
  6582. }
  6583. declare interface KnownStatsLoggingEntry {
  6584. type: string;
  6585. message: string;
  6586. trace?: string[];
  6587. children?: StatsLoggingEntry[];
  6588. args?: any[];
  6589. time?: number;
  6590. }
  6591. declare interface KnownStatsModule {
  6592. type?: string;
  6593. moduleType?: string;
  6594. layer?: string;
  6595. identifier?: string;
  6596. name?: string;
  6597. nameForCondition?: string;
  6598. index?: number;
  6599. preOrderIndex?: number;
  6600. index2?: number;
  6601. postOrderIndex?: number;
  6602. size?: number;
  6603. sizes?: { [index: string]: number };
  6604. cacheable?: boolean;
  6605. built?: boolean;
  6606. codeGenerated?: boolean;
  6607. buildTimeExecuted?: boolean;
  6608. cached?: boolean;
  6609. optional?: boolean;
  6610. orphan?: boolean;
  6611. id?: string | number;
  6612. issuerId?: string | number;
  6613. chunks?: (string | number)[];
  6614. assets?: (string | number)[];
  6615. dependent?: boolean;
  6616. issuer?: string;
  6617. issuerName?: string;
  6618. issuerPath?: StatsModuleIssuer[];
  6619. failed?: boolean;
  6620. errors?: number;
  6621. warnings?: number;
  6622. profile?: StatsProfile;
  6623. reasons?: StatsModuleReason[];
  6624. usedExports?: boolean | string[];
  6625. providedExports?: string[];
  6626. optimizationBailout?: string[];
  6627. depth?: number;
  6628. modules?: StatsModule[];
  6629. filteredModules?: number;
  6630. source?: string | Buffer;
  6631. }
  6632. declare interface KnownStatsModuleIssuer {
  6633. identifier?: string;
  6634. name?: string;
  6635. id?: string | number;
  6636. profile?: StatsProfile;
  6637. }
  6638. declare interface KnownStatsModuleReason {
  6639. moduleIdentifier?: string;
  6640. module?: string;
  6641. moduleName?: string;
  6642. resolvedModuleIdentifier?: string;
  6643. resolvedModule?: string;
  6644. type?: string;
  6645. active: boolean;
  6646. explanation?: string;
  6647. userRequest?: string;
  6648. loc?: string;
  6649. moduleId?: string | number;
  6650. resolvedModuleId?: string | number;
  6651. }
  6652. declare interface KnownStatsModuleTraceDependency {
  6653. loc?: string;
  6654. }
  6655. declare interface KnownStatsModuleTraceItem {
  6656. originIdentifier?: string;
  6657. originName?: string;
  6658. moduleIdentifier?: string;
  6659. moduleName?: string;
  6660. dependencies?: StatsModuleTraceDependency[];
  6661. originId?: string | number;
  6662. moduleId?: string | number;
  6663. }
  6664. declare interface KnownStatsPrinterContext {
  6665. type?: string;
  6666. compilation?: StatsCompilation;
  6667. chunkGroup?: StatsChunkGroup;
  6668. asset?: StatsAsset;
  6669. module?: StatsModule;
  6670. chunk?: StatsChunk;
  6671. moduleReason?: StatsModuleReason;
  6672. bold?: (str: string) => string;
  6673. yellow?: (str: string) => string;
  6674. red?: (str: string) => string;
  6675. green?: (str: string) => string;
  6676. magenta?: (str: string) => string;
  6677. cyan?: (str: string) => string;
  6678. formatFilename?: (file: string, oversize?: boolean) => string;
  6679. formatModuleId?: (id: string) => string;
  6680. formatChunkId?: (
  6681. id: string,
  6682. direction?: "parent" | "child" | "sibling"
  6683. ) => string;
  6684. formatSize?: (size: number) => string;
  6685. formatDateTime?: (dateTime: number) => string;
  6686. formatFlag?: (flag: string) => string;
  6687. formatTime?: (time: number, boldQuantity?: boolean) => string;
  6688. chunkGroupKind?: string;
  6689. }
  6690. declare interface KnownStatsProfile {
  6691. total: number;
  6692. resolving: number;
  6693. restoring: number;
  6694. building: number;
  6695. integration: number;
  6696. storing: number;
  6697. additionalResolving: number;
  6698. additionalIntegration: number;
  6699. factory: number;
  6700. dependencies: number;
  6701. }
  6702. declare interface LStatFs {
  6703. (
  6704. path: PathLikeFs,
  6705. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6706. ): void;
  6707. (
  6708. path: PathLikeFs,
  6709. options: undefined | (StatOptions & { bigint?: false }),
  6710. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6711. ): void;
  6712. (
  6713. path: PathLikeFs,
  6714. options: StatOptions & { bigint: true },
  6715. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  6716. ): void;
  6717. (
  6718. path: PathLikeFs,
  6719. options: undefined | StatOptions,
  6720. callback: (
  6721. arg0: null | NodeJS.ErrnoException,
  6722. arg1?: IStats | IBigIntStats
  6723. ) => void
  6724. ): void;
  6725. }
  6726. declare interface LStatSync {
  6727. (path: PathLikeFs, options?: undefined): IStats;
  6728. (
  6729. path: PathLikeFs,
  6730. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  6731. ): undefined | IStats;
  6732. (
  6733. path: PathLikeFs,
  6734. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  6735. ): undefined | IBigIntStats;
  6736. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  6737. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  6738. (
  6739. path: PathLikeFs,
  6740. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  6741. ): IStats | IBigIntStats;
  6742. (
  6743. path: PathLikeFs,
  6744. options?: StatSyncOptions
  6745. ): undefined | IStats | IBigIntStats;
  6746. }
  6747. declare interface LStatTypes {
  6748. (
  6749. path: PathLikeTypes,
  6750. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6751. ): void;
  6752. (
  6753. path: PathLikeTypes,
  6754. options: undefined | (StatOptions & { bigint?: false }),
  6755. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6756. ): void;
  6757. (
  6758. path: PathLikeTypes,
  6759. options: StatOptions & { bigint: true },
  6760. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  6761. ): void;
  6762. (
  6763. path: PathLikeTypes,
  6764. options: undefined | StatOptions,
  6765. callback: (
  6766. arg0: null | NodeJS.ErrnoException,
  6767. arg1?: IStats | IBigIntStats
  6768. ) => void
  6769. ): void;
  6770. }
  6771. /**
  6772. * Options for the default backend.
  6773. */
  6774. declare interface LazyCompilationDefaultBackendOptions {
  6775. /**
  6776. * A custom client.
  6777. */
  6778. client?: string;
  6779. /**
  6780. * Specifies where to listen to from the server.
  6781. */
  6782. listen?: number | ListenOptions | ((server: Server) => void);
  6783. /**
  6784. * Specifies the protocol the client should use to connect to the server.
  6785. */
  6786. protocol?: "http" | "https";
  6787. /**
  6788. * Specifies how to create the server handling the EventSource requests.
  6789. */
  6790. server?:
  6791. | ServerOptionsImport<typeof IncomingMessage>
  6792. | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
  6793. | (() => Server);
  6794. }
  6795. /**
  6796. * Options for compiling entrypoints and import()s only when they are accessed.
  6797. */
  6798. declare interface LazyCompilationOptions {
  6799. /**
  6800. * Specifies the backend that should be used for handling client keep alive.
  6801. */
  6802. backend?:
  6803. | ((
  6804. compiler: Compiler,
  6805. callback: (err?: Error, api?: BackendApi) => void
  6806. ) => void)
  6807. | ((compiler: Compiler) => Promise<BackendApi>)
  6808. | LazyCompilationDefaultBackendOptions;
  6809. /**
  6810. * Enable/disable lazy compilation for entries.
  6811. */
  6812. entries?: boolean;
  6813. /**
  6814. * Enable/disable lazy compilation for import() modules.
  6815. */
  6816. imports?: boolean;
  6817. /**
  6818. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  6819. */
  6820. test?: string | RegExp | ((module: Module) => boolean);
  6821. }
  6822. declare class LazySet<T> {
  6823. constructor(iterable?: Iterable<T>);
  6824. get size(): number;
  6825. add(item: T): LazySet<T>;
  6826. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  6827. clear(): void;
  6828. delete(value: T): boolean;
  6829. entries(): IterableIterator<[T, T]>;
  6830. forEach(
  6831. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  6832. thisArg?: any
  6833. ): void;
  6834. has(item: T): boolean;
  6835. keys(): IterableIterator<T>;
  6836. values(): IterableIterator<T>;
  6837. serialize(__0: ObjectSerializerContext): void;
  6838. [Symbol.iterator](): IterableIterator<T>;
  6839. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  6840. }
  6841. declare interface LibIdentOptions {
  6842. /**
  6843. * absolute context path to which lib ident is relative to
  6844. */
  6845. context: string;
  6846. /**
  6847. * object for caching
  6848. */
  6849. associatedObjectForCache?: object;
  6850. }
  6851. declare class LibManifestPlugin {
  6852. constructor(options: LibManifestPluginOptions);
  6853. options: LibManifestPluginOptions;
  6854. /**
  6855. * Apply the plugin
  6856. */
  6857. apply(compiler: Compiler): void;
  6858. }
  6859. declare interface LibManifestPluginOptions {
  6860. /**
  6861. * Context of requests in the manifest file (defaults to the webpack context).
  6862. */
  6863. context?: string;
  6864. /**
  6865. * If true, only entry points will be exposed (default: true).
  6866. */
  6867. entryOnly?: boolean;
  6868. /**
  6869. * If true, manifest json file (output) will be formatted.
  6870. */
  6871. format?: boolean;
  6872. /**
  6873. * Name of the exposed dll function (external name, use value of 'output.library').
  6874. */
  6875. name?: string;
  6876. /**
  6877. * Absolute path to the manifest json file (output).
  6878. */
  6879. path: string;
  6880. /**
  6881. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  6882. */
  6883. type?: string;
  6884. }
  6885. declare interface LibraryContext<T> {
  6886. compilation: Compilation;
  6887. chunkGraph: ChunkGraph;
  6888. options: T;
  6889. }
  6890. /**
  6891. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  6892. */
  6893. declare interface LibraryCustomUmdCommentObject {
  6894. /**
  6895. * Set comment for `amd` section in UMD.
  6896. */
  6897. amd?: string;
  6898. /**
  6899. * Set comment for `commonjs` (exports) section in UMD.
  6900. */
  6901. commonjs?: string;
  6902. /**
  6903. * Set comment for `commonjs2` (module.exports) section in UMD.
  6904. */
  6905. commonjs2?: string;
  6906. /**
  6907. * Set comment for `root` (global variable) section in UMD.
  6908. */
  6909. root?: string;
  6910. }
  6911. /**
  6912. * Description object for all UMD variants of the library name.
  6913. */
  6914. declare interface LibraryCustomUmdObject {
  6915. /**
  6916. * Name of the exposed AMD library in the UMD.
  6917. */
  6918. amd?: string;
  6919. /**
  6920. * Name of the exposed commonjs export in the UMD.
  6921. */
  6922. commonjs?: string;
  6923. /**
  6924. * Name of the property exposed globally by a UMD library.
  6925. */
  6926. root?: string | string[];
  6927. }
  6928. type LibraryExport = string | string[];
  6929. type LibraryName = string | string[] | LibraryCustomUmdObject;
  6930. /**
  6931. * Options for library.
  6932. */
  6933. declare interface LibraryOptions {
  6934. /**
  6935. * Add a container for define/require functions in the AMD module.
  6936. */
  6937. amdContainer?: string;
  6938. /**
  6939. * Add a comment in the UMD wrapper.
  6940. */
  6941. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  6942. /**
  6943. * Specify which export should be exposed as library.
  6944. */
  6945. export?: string | string[];
  6946. /**
  6947. * The name of the library (some types allow unnamed libraries too).
  6948. */
  6949. name?: string | string[] | LibraryCustomUmdObject;
  6950. /**
  6951. * 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).
  6952. */
  6953. type: string;
  6954. /**
  6955. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  6956. */
  6957. umdNamedDefine?: boolean;
  6958. }
  6959. declare class LibraryTemplatePlugin {
  6960. constructor(
  6961. name: LibraryName,
  6962. target: string,
  6963. umdNamedDefine: boolean,
  6964. auxiliaryComment: AuxiliaryComment,
  6965. exportProperty: LibraryExport
  6966. );
  6967. library: {
  6968. type: string;
  6969. name: LibraryName;
  6970. umdNamedDefine: boolean;
  6971. auxiliaryComment: AuxiliaryComment;
  6972. export: LibraryExport;
  6973. };
  6974. /**
  6975. * Apply the plugin
  6976. */
  6977. apply(compiler: Compiler): void;
  6978. }
  6979. declare class LimitChunkCountPlugin {
  6980. constructor(options?: LimitChunkCountPluginOptions);
  6981. options?: LimitChunkCountPluginOptions;
  6982. apply(compiler: Compiler): void;
  6983. }
  6984. declare interface LimitChunkCountPluginOptions {
  6985. /**
  6986. * Constant overhead for a chunk.
  6987. */
  6988. chunkOverhead?: number;
  6989. /**
  6990. * Multiplicator for initial chunks.
  6991. */
  6992. entryChunkMultiplicator?: number;
  6993. /**
  6994. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  6995. */
  6996. maxChunks: number;
  6997. }
  6998. declare interface LoadScriptCompilationHooks {
  6999. createScript: SyncWaterfallHook<[string, Chunk]>;
  7000. }
  7001. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  7002. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  7003. static getCompilationHooks(
  7004. compilation: Compilation
  7005. ): LoadScriptCompilationHooks;
  7006. /**
  7007. * Runtime modules without any dependencies to other runtime modules
  7008. */
  7009. static STAGE_NORMAL: number;
  7010. /**
  7011. * Runtime modules with simple dependencies on other runtime modules
  7012. */
  7013. static STAGE_BASIC: number;
  7014. /**
  7015. * Runtime modules which attach to handlers of other runtime modules
  7016. */
  7017. static STAGE_ATTACH: number;
  7018. /**
  7019. * Runtime modules which trigger actions on bootstrap
  7020. */
  7021. static STAGE_TRIGGER: number;
  7022. }
  7023. /**
  7024. * Custom values available in the loader context.
  7025. */
  7026. declare interface Loader {
  7027. [index: string]: any;
  7028. }
  7029. type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
  7030. LoaderRunnerLoaderContext<OptionsType> &
  7031. LoaderPluginLoaderContext &
  7032. HotModuleReplacementPluginLoaderContext;
  7033. type LoaderDefinition<
  7034. OptionsType = {},
  7035. ContextAdditions = {}
  7036. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  7037. raw?: false;
  7038. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7039. };
  7040. declare interface LoaderDefinitionFunction<
  7041. OptionsType = {},
  7042. ContextAdditions = {}
  7043. > {
  7044. (
  7045. this: NormalModuleLoaderContext<OptionsType> &
  7046. LoaderRunnerLoaderContext<OptionsType> &
  7047. LoaderPluginLoaderContext &
  7048. HotModuleReplacementPluginLoaderContext &
  7049. ContextAdditions,
  7050. content: string,
  7051. sourceMap?: string | SourceMap,
  7052. additionalData?: AdditionalData
  7053. ): string | void | Buffer | Promise<string | Buffer>;
  7054. }
  7055. declare interface LoaderItem {
  7056. loader: string;
  7057. options: any;
  7058. ident: null | string;
  7059. type: null | string;
  7060. }
  7061. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  7062. default?:
  7063. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  7064. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7065. raw?: false;
  7066. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7067. }
  7068. declare class LoaderOptionsPlugin {
  7069. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  7070. options: LoaderOptionsPluginOptions & MatchObject;
  7071. /**
  7072. * Apply the plugin
  7073. */
  7074. apply(compiler: Compiler): void;
  7075. }
  7076. declare interface LoaderOptionsPluginOptions {
  7077. [index: string]: any;
  7078. /**
  7079. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  7080. */
  7081. debug?: boolean;
  7082. /**
  7083. * Where loaders can be switched to minimize mode.
  7084. */
  7085. minimize?: boolean;
  7086. /**
  7087. * A configuration object that can be used to configure older loaders.
  7088. */
  7089. options?: {
  7090. [index: string]: any;
  7091. /**
  7092. * The context that can be used to configure older loaders.
  7093. */
  7094. context?: string;
  7095. };
  7096. }
  7097. /**
  7098. * These properties are added by the LoaderPlugin
  7099. */
  7100. declare interface LoaderPluginLoaderContext {
  7101. /**
  7102. * Resolves the given request to a module, applies all configured loaders and calls
  7103. * back with the generated source, the sourceMap and the module instance (usually an
  7104. * instance of NormalModule). Use this function if you need to know the source code
  7105. * of another module to generate the result.
  7106. */
  7107. loadModule(
  7108. request: string,
  7109. callback: (
  7110. err: null | Error,
  7111. source: string,
  7112. sourceMap: any,
  7113. module: NormalModule
  7114. ) => void
  7115. ): void;
  7116. importModule(
  7117. request: string,
  7118. options: ImportModuleOptions,
  7119. callback: (err?: null | Error, exports?: any) => any
  7120. ): void;
  7121. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  7122. }
  7123. /**
  7124. * The properties are added by https://github.com/webpack/loader-runner
  7125. */
  7126. declare interface LoaderRunnerLoaderContext<OptionsType> {
  7127. /**
  7128. * Add a directory as dependency of the loader result.
  7129. */
  7130. addContextDependency(context: string): void;
  7131. /**
  7132. * Adds a file as dependency of the loader result in order to make them watchable.
  7133. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7134. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7135. */
  7136. addDependency(file: string): void;
  7137. addMissingDependency(context: string): void;
  7138. /**
  7139. * Make this loader async.
  7140. */
  7141. async(): (
  7142. err?: null | Error,
  7143. content?: string | Buffer,
  7144. sourceMap?: string | SourceMap,
  7145. additionalData?: AdditionalData
  7146. ) => void;
  7147. /**
  7148. * Make this loader result cacheable. By default it's cacheable.
  7149. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  7150. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  7151. * Most loaders are deterministic and cacheable.
  7152. */
  7153. cacheable(flag?: boolean): void;
  7154. callback: (
  7155. err?: null | Error,
  7156. content?: string | Buffer,
  7157. sourceMap?: string | SourceMap,
  7158. additionalData?: AdditionalData
  7159. ) => void;
  7160. /**
  7161. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  7162. */
  7163. clearDependencies(): void;
  7164. /**
  7165. * The directory of the module. Can be used as context for resolving other stuff.
  7166. * eg '/workspaces/ts-loader/examples/vanilla/src'
  7167. */
  7168. context: string;
  7169. readonly currentRequest: string;
  7170. readonly data: any;
  7171. /**
  7172. * alias of addDependency
  7173. * Adds a file as dependency of the loader result in order to make them watchable.
  7174. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7175. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7176. */
  7177. dependency(file: string): void;
  7178. getContextDependencies(): string[];
  7179. getDependencies(): string[];
  7180. getMissingDependencies(): string[];
  7181. /**
  7182. * The index in the loaders array of the current loader.
  7183. * In the example: in loader1: 0, in loader2: 1
  7184. */
  7185. loaderIndex: number;
  7186. readonly previousRequest: string;
  7187. readonly query: string | OptionsType;
  7188. readonly remainingRequest: string;
  7189. readonly request: string;
  7190. /**
  7191. * An array of all the loaders. It is writeable in the pitch phase.
  7192. * loaders = [{request: string, path: string, query: string, module: function}]
  7193. * In the example:
  7194. * [
  7195. * { request: "/abc/loader1.js?xyz",
  7196. * path: "/abc/loader1.js",
  7197. * query: "?xyz",
  7198. * module: [Function]
  7199. * },
  7200. * { request: "/abc/node_modules/loader2/index.js",
  7201. * path: "/abc/node_modules/loader2/index.js",
  7202. * query: "",
  7203. * module: [Function]
  7204. * }
  7205. * ]
  7206. */
  7207. loaders: {
  7208. request: string;
  7209. path: string;
  7210. query: string;
  7211. fragment: string;
  7212. options?: string | object;
  7213. ident: string;
  7214. normal?: Function;
  7215. pitch?: Function;
  7216. raw?: boolean;
  7217. data?: object;
  7218. pitchExecuted: boolean;
  7219. normalExecuted: boolean;
  7220. type?: "module" | "commonjs";
  7221. }[];
  7222. /**
  7223. * The resource path.
  7224. * In the example: "/abc/resource.js"
  7225. */
  7226. resourcePath: string;
  7227. /**
  7228. * The resource query string.
  7229. * Example: "?query"
  7230. */
  7231. resourceQuery: string;
  7232. /**
  7233. * The resource fragment.
  7234. * Example: "#frag"
  7235. */
  7236. resourceFragment: string;
  7237. /**
  7238. * The resource inclusive query and fragment.
  7239. * Example: "/abc/resource.js?query#frag"
  7240. */
  7241. resource: string;
  7242. /**
  7243. * Target of compilation.
  7244. * Example: "web"
  7245. */
  7246. target: string;
  7247. /**
  7248. * Tell what kind of ES-features may be used in the generated runtime-code.
  7249. * Example: { arrowFunction: true }
  7250. */
  7251. environment: Environment;
  7252. }
  7253. declare class LoaderTargetPlugin {
  7254. constructor(target: string);
  7255. target: string;
  7256. /**
  7257. * Apply the plugin
  7258. */
  7259. apply(compiler: Compiler): void;
  7260. }
  7261. declare interface LogEntry {
  7262. type: string;
  7263. args: any[];
  7264. time: number;
  7265. trace?: string[];
  7266. }
  7267. type LogTypeEnum =
  7268. | "error"
  7269. | "warn"
  7270. | "info"
  7271. | "log"
  7272. | "debug"
  7273. | "profile"
  7274. | "trace"
  7275. | "group"
  7276. | "groupCollapsed"
  7277. | "groupEnd"
  7278. | "profileEnd"
  7279. | "time"
  7280. | "clear"
  7281. | "status";
  7282. declare const MEASURE_END_OPERATION: unique symbol;
  7283. declare const MEASURE_START_OPERATION: unique symbol;
  7284. declare interface MainRenderContext {
  7285. /**
  7286. * the chunk
  7287. */
  7288. chunk: Chunk;
  7289. /**
  7290. * the dependency templates
  7291. */
  7292. dependencyTemplates: DependencyTemplates;
  7293. /**
  7294. * the runtime template
  7295. */
  7296. runtimeTemplate: RuntimeTemplate;
  7297. /**
  7298. * the module graph
  7299. */
  7300. moduleGraph: ModuleGraph;
  7301. /**
  7302. * the chunk graph
  7303. */
  7304. chunkGraph: ChunkGraph;
  7305. /**
  7306. * results of code generation
  7307. */
  7308. codeGenerationResults: CodeGenerationResults;
  7309. /**
  7310. * hash to be used for render call
  7311. */
  7312. hash: string;
  7313. /**
  7314. * rendering in strict context
  7315. */
  7316. strictMode: boolean;
  7317. }
  7318. declare abstract class MainTemplate {
  7319. hooks: Readonly<{
  7320. renderManifest: { tap: (options?: any, fn?: any) => void };
  7321. modules: { tap: () => never };
  7322. moduleObj: { tap: () => never };
  7323. require: { tap: (options?: any, fn?: any) => void };
  7324. beforeStartup: { tap: () => never };
  7325. startup: { tap: () => never };
  7326. afterStartup: { tap: () => never };
  7327. render: { tap: (options?: any, fn?: any) => void };
  7328. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  7329. assetPath: {
  7330. tap: (options?: any, fn?: any) => void;
  7331. call: (filename?: any, options?: any) => string;
  7332. };
  7333. hash: { tap: (options?: any, fn?: any) => void };
  7334. hashForChunk: { tap: (options?: any, fn?: any) => void };
  7335. globalHashPaths: { tap: () => void };
  7336. globalHash: { tap: () => void };
  7337. hotBootstrap: { tap: () => never };
  7338. bootstrap: SyncWaterfallHook<
  7339. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  7340. >;
  7341. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  7342. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  7343. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  7344. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  7345. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  7346. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  7347. }>;
  7348. renderCurrentHashCode: (hash: string, length?: number) => string;
  7349. getPublicPath: (options: object) => string;
  7350. getAssetPath: (path?: any, options?: any) => string;
  7351. getAssetPathWithInfo: (
  7352. path?: any,
  7353. options?: any
  7354. ) => { path: string; info: AssetInfo };
  7355. get requireFn(): "__webpack_require__";
  7356. get outputOptions(): Output;
  7357. }
  7358. declare interface MakeDirectoryOptions {
  7359. recursive?: boolean;
  7360. mode?: string | number;
  7361. }
  7362. declare interface MapOptions {
  7363. columns?: boolean;
  7364. module?: boolean;
  7365. }
  7366. declare interface MatchObject {
  7367. test?: string | RegExp | (string | RegExp)[];
  7368. include?: string | RegExp | (string | RegExp)[];
  7369. exclude?: string | RegExp | (string | RegExp)[];
  7370. }
  7371. type Matcher = string | RegExp | (string | RegExp)[];
  7372. /**
  7373. * Options object for in-memory caching.
  7374. */
  7375. declare interface MemoryCacheOptions {
  7376. /**
  7377. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  7378. */
  7379. cacheUnaffected?: boolean;
  7380. /**
  7381. * 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).
  7382. */
  7383. maxGenerations?: number;
  7384. /**
  7385. * In memory caching.
  7386. */
  7387. type: "memory";
  7388. }
  7389. declare class MemoryCachePlugin {
  7390. constructor();
  7391. /**
  7392. * Apply the plugin
  7393. */
  7394. apply(compiler: Compiler): void;
  7395. }
  7396. declare class MinChunkSizePlugin {
  7397. constructor(options: MinChunkSizePluginOptions);
  7398. options: MinChunkSizePluginOptions;
  7399. /**
  7400. * Apply the plugin
  7401. */
  7402. apply(compiler: Compiler): void;
  7403. }
  7404. declare interface MinChunkSizePluginOptions {
  7405. /**
  7406. * Constant overhead for a chunk.
  7407. */
  7408. chunkOverhead?: number;
  7409. /**
  7410. * Multiplicator for initial chunks.
  7411. */
  7412. entryChunkMultiplicator?: number;
  7413. /**
  7414. * Minimum number of characters.
  7415. */
  7416. minChunkSize: number;
  7417. }
  7418. declare interface Mkdir {
  7419. (
  7420. file: PathLikeFs,
  7421. options: MakeDirectoryOptions & { recursive: true },
  7422. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  7423. ): void;
  7424. (
  7425. file: PathLikeFs,
  7426. options:
  7427. | undefined
  7428. | null
  7429. | string
  7430. | number
  7431. | (MakeDirectoryOptions & { recursive?: false }),
  7432. callback: (arg0: null | NodeJS.ErrnoException) => void
  7433. ): void;
  7434. (
  7435. file: PathLikeFs,
  7436. options: undefined | null | string | number | MakeDirectoryOptions,
  7437. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  7438. ): void;
  7439. (
  7440. file: PathLikeFs,
  7441. callback: (arg0: null | NodeJS.ErrnoException) => void
  7442. ): void;
  7443. }
  7444. declare interface MkdirSync {
  7445. (
  7446. path: PathLikeFs,
  7447. options: MakeDirectoryOptions & { recursive: true }
  7448. ): undefined | string;
  7449. (
  7450. path: PathLikeFs,
  7451. options?:
  7452. | null
  7453. | string
  7454. | number
  7455. | (MakeDirectoryOptions & { recursive?: false })
  7456. ): void;
  7457. (
  7458. path: PathLikeFs,
  7459. options?: null | string | number | MakeDirectoryOptions
  7460. ): undefined | string;
  7461. }
  7462. declare class Module extends DependenciesBlock {
  7463. constructor(type: string, context?: null | string, layer?: null | string);
  7464. type: string;
  7465. context: null | string;
  7466. layer: null | string;
  7467. needId: boolean;
  7468. debugId: number;
  7469. resolveOptions?: ResolveOptions;
  7470. factoryMeta?: FactoryMeta;
  7471. useSourceMap: boolean;
  7472. useSimpleSourceMap: boolean;
  7473. buildMeta?: BuildMeta;
  7474. buildInfo?: BuildInfo;
  7475. presentationalDependencies?: Dependency[];
  7476. codeGenerationDependencies?: Dependency[];
  7477. id: ModuleId;
  7478. get hash(): string;
  7479. get renderedHash(): string;
  7480. profile?: ModuleProfile;
  7481. index: null | number;
  7482. index2: null | number;
  7483. depth: null | number;
  7484. issuer?: null | Module;
  7485. get usedExports(): null | boolean | SortableSet<string>;
  7486. get optimizationBailout(): (
  7487. | string
  7488. | ((requestShortener: RequestShortener) => string)
  7489. )[];
  7490. get optional(): boolean;
  7491. addChunk(chunk: Chunk): boolean;
  7492. removeChunk(chunk: Chunk): void;
  7493. isInChunk(chunk: Chunk): boolean;
  7494. isEntryModule(): boolean;
  7495. getChunks(): Chunk[];
  7496. getNumberOfChunks(): number;
  7497. get chunksIterable(): Iterable<Chunk>;
  7498. isProvided(exportName: string): null | boolean;
  7499. get exportsArgument(): string;
  7500. get moduleArgument(): string;
  7501. getExportsType(
  7502. moduleGraph: ModuleGraph,
  7503. strict?: boolean
  7504. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  7505. addPresentationalDependency(presentationalDependency: Dependency): void;
  7506. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  7507. addWarning(warning: WebpackError): void;
  7508. getWarnings(): undefined | Iterable<WebpackError>;
  7509. getNumberOfWarnings(): number;
  7510. addError(error: WebpackError): void;
  7511. getErrors(): undefined | Iterable<WebpackError>;
  7512. getNumberOfErrors(): number;
  7513. /**
  7514. * removes all warnings and errors
  7515. */
  7516. clearWarningsAndErrors(): void;
  7517. isOptional(moduleGraph: ModuleGraph): boolean;
  7518. isAccessibleInChunk(
  7519. chunkGraph: ChunkGraph,
  7520. chunk: Chunk,
  7521. ignoreChunk?: Chunk
  7522. ): boolean;
  7523. isAccessibleInChunkGroup(
  7524. chunkGraph: ChunkGraph,
  7525. chunkGroup: ChunkGroup,
  7526. ignoreChunk?: Chunk
  7527. ): boolean;
  7528. hasReasonForChunk(
  7529. chunk: Chunk,
  7530. moduleGraph: ModuleGraph,
  7531. chunkGraph: ChunkGraph
  7532. ): boolean;
  7533. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  7534. needBuild(
  7535. context: NeedBuildContext,
  7536. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  7537. ): void;
  7538. needRebuild(
  7539. fileTimestamps: Map<string, null | number>,
  7540. contextTimestamps: Map<string, null | number>
  7541. ): boolean;
  7542. invalidateBuild(): void;
  7543. identifier(): string;
  7544. readableIdentifier(requestShortener: RequestShortener): string;
  7545. build(
  7546. options: WebpackOptionsNormalized,
  7547. compilation: Compilation,
  7548. resolver: ResolverWithOptions,
  7549. fs: InputFileSystem,
  7550. callback: (arg0?: WebpackError) => void
  7551. ): void;
  7552. getSourceTypes(): Set<string>;
  7553. source(
  7554. dependencyTemplates: DependencyTemplates,
  7555. runtimeTemplate: RuntimeTemplate,
  7556. type?: string
  7557. ): Source;
  7558. size(type?: string): number;
  7559. libIdent(options: LibIdentOptions): null | string;
  7560. nameForCondition(): null | string;
  7561. getConcatenationBailoutReason(
  7562. context: ConcatenationBailoutReasonContext
  7563. ): undefined | string;
  7564. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  7565. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  7566. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  7567. hasChunkCondition(): boolean;
  7568. /**
  7569. * Assuming this module is in the cache. Update the (cached) module with
  7570. * the fresh module from the factory. Usually updates internal references
  7571. * and properties.
  7572. */
  7573. updateCacheModule(module: Module): void;
  7574. /**
  7575. * Module should be unsafe cached. Get data that's needed for that.
  7576. * This data will be passed to restoreFromUnsafeCache later.
  7577. */
  7578. getUnsafeCacheData(): UnsafeCacheData;
  7579. /**
  7580. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  7581. */
  7582. cleanupForCache(): void;
  7583. originalSource(): null | Source;
  7584. addCacheDependencies(
  7585. fileDependencies: LazySet<string>,
  7586. contextDependencies: LazySet<string>,
  7587. missingDependencies: LazySet<string>,
  7588. buildDependencies: LazySet<string>
  7589. ): void;
  7590. get hasEqualsChunks(): any;
  7591. get isUsed(): any;
  7592. get errors(): any;
  7593. get warnings(): any;
  7594. used: any;
  7595. }
  7596. declare class ModuleConcatenationPlugin {
  7597. constructor(options?: any);
  7598. options: any;
  7599. /**
  7600. * Apply the plugin
  7601. */
  7602. apply(compiler: Compiler): void;
  7603. }
  7604. declare class ModuleDependency extends Dependency {
  7605. constructor(request: string);
  7606. request: string;
  7607. userRequest: string;
  7608. range: any;
  7609. assertions?: ImportAttributes;
  7610. static Template: typeof DependencyTemplate;
  7611. static NO_EXPORTS_REFERENCED: string[][];
  7612. static EXPORTS_OBJECT_REFERENCED: string[][];
  7613. static TRANSITIVE: typeof TRANSITIVE;
  7614. }
  7615. declare abstract class ModuleFactory {
  7616. create(
  7617. data: ModuleFactoryCreateData,
  7618. callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
  7619. ): void;
  7620. }
  7621. declare interface ModuleFactoryCreateData {
  7622. contextInfo: ModuleFactoryCreateDataContextInfo;
  7623. resolveOptions?: ResolveOptions;
  7624. context: string;
  7625. dependencies: Dependency[];
  7626. }
  7627. declare interface ModuleFactoryCreateDataContextInfo {
  7628. issuer: string;
  7629. issuerLayer?: null | string;
  7630. compiler: string;
  7631. }
  7632. declare interface ModuleFactoryResult {
  7633. /**
  7634. * the created module or unset if no module was created
  7635. */
  7636. module?: Module;
  7637. fileDependencies?: Set<string>;
  7638. contextDependencies?: Set<string>;
  7639. missingDependencies?: Set<string>;
  7640. /**
  7641. * allow to use the unsafe cache
  7642. */
  7643. cacheable?: boolean;
  7644. }
  7645. declare class ModuleFederationPlugin {
  7646. constructor(options: ModuleFederationPluginOptions);
  7647. /**
  7648. * Apply the plugin
  7649. */
  7650. apply(compiler: Compiler): void;
  7651. }
  7652. declare interface ModuleFederationPluginOptions {
  7653. /**
  7654. * 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.
  7655. */
  7656. exposes?: (string | ExposesObject)[] | ExposesObject;
  7657. /**
  7658. * The filename of the container as relative path inside the `output.path` directory.
  7659. */
  7660. filename?: string;
  7661. /**
  7662. * Options for library.
  7663. */
  7664. library?: LibraryOptions;
  7665. /**
  7666. * The name of the container.
  7667. */
  7668. name?: string;
  7669. /**
  7670. * The external type of the remote containers.
  7671. */
  7672. remoteType?:
  7673. | "import"
  7674. | "var"
  7675. | "module"
  7676. | "assign"
  7677. | "this"
  7678. | "window"
  7679. | "self"
  7680. | "global"
  7681. | "commonjs"
  7682. | "commonjs2"
  7683. | "commonjs-module"
  7684. | "commonjs-static"
  7685. | "amd"
  7686. | "amd-require"
  7687. | "umd"
  7688. | "umd2"
  7689. | "jsonp"
  7690. | "system"
  7691. | "promise"
  7692. | "script"
  7693. | "node-commonjs";
  7694. /**
  7695. * 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.
  7696. */
  7697. remotes?: (string | RemotesObject)[] | RemotesObject;
  7698. /**
  7699. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  7700. */
  7701. runtime?: string | false;
  7702. /**
  7703. * Share scope name used for all shared modules (defaults to 'default').
  7704. */
  7705. shareScope?: string;
  7706. /**
  7707. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  7708. */
  7709. shared?: (string | SharedObject)[] | SharedObject;
  7710. }
  7711. type ModuleFilterItemTypes =
  7712. | string
  7713. | RegExp
  7714. | ((
  7715. name: string,
  7716. module: StatsModule,
  7717. type: "module" | "chunk" | "root-of-chunk" | "nested"
  7718. ) => boolean);
  7719. declare class ModuleGraph {
  7720. constructor();
  7721. setParents(
  7722. dependency: Dependency,
  7723. block: DependenciesBlock,
  7724. module: Module,
  7725. indexInBlock?: number
  7726. ): void;
  7727. getParentModule(dependency: Dependency): undefined | Module;
  7728. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  7729. getParentBlockIndex(dependency: Dependency): number;
  7730. setResolvedModule(
  7731. originModule: null | Module,
  7732. dependency: Dependency,
  7733. module: Module
  7734. ): void;
  7735. updateModule(dependency: Dependency, module: Module): void;
  7736. removeConnection(dependency: Dependency): void;
  7737. addExplanation(dependency: Dependency, explanation: string): void;
  7738. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  7739. removeModuleAttributes(module: Module): void;
  7740. removeAllModuleAttributes(): void;
  7741. moveModuleConnections(
  7742. oldModule: Module,
  7743. newModule: Module,
  7744. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7745. ): void;
  7746. copyOutgoingModuleConnections(
  7747. oldModule: Module,
  7748. newModule: Module,
  7749. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7750. ): void;
  7751. addExtraReason(module: Module, explanation: string): void;
  7752. getResolvedModule(dependency: Dependency): null | Module;
  7753. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  7754. getModule(dependency: Dependency): null | Module;
  7755. getOrigin(dependency: Dependency): null | Module;
  7756. getResolvedOrigin(dependency: Dependency): null | Module;
  7757. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7758. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7759. getIncomingConnectionsByOriginModule(
  7760. module: Module
  7761. ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
  7762. getOutgoingConnectionsByModule(
  7763. module: Module
  7764. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  7765. getProfile(module: Module): undefined | ModuleProfile;
  7766. setProfile(module: Module, profile?: ModuleProfile): void;
  7767. getIssuer(module: Module): undefined | null | Module;
  7768. setIssuer(module: Module, issuer: null | Module): void;
  7769. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  7770. getOptimizationBailout(
  7771. module: Module
  7772. ): (string | ((requestShortener: RequestShortener) => string))[];
  7773. getProvidedExports(module: Module): null | true | string[];
  7774. isExportProvided(
  7775. module: Module,
  7776. exportName: string | string[]
  7777. ): null | boolean;
  7778. getExportsInfo(module: Module): ExportsInfo;
  7779. getExportInfo(module: Module, exportName: string): ExportInfo;
  7780. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  7781. getUsedExports(
  7782. module: Module,
  7783. runtime: RuntimeSpec
  7784. ): null | boolean | SortableSet<string>;
  7785. getPreOrderIndex(module: Module): null | number;
  7786. getPostOrderIndex(module: Module): null | number;
  7787. setPreOrderIndex(module: Module, index: number): void;
  7788. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  7789. setPostOrderIndex(module: Module, index: number): void;
  7790. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  7791. getDepth(module: Module): null | number;
  7792. setDepth(module: Module, depth: number): void;
  7793. setDepthIfLower(module: Module, depth: number): boolean;
  7794. isAsync(module: Module): boolean;
  7795. setAsync(module: Module): void;
  7796. getMeta(thing?: any): object;
  7797. getMetaIfExisting(thing?: any): undefined | object;
  7798. freeze(cacheStage?: string): void;
  7799. unfreeze(): void;
  7800. cached<T extends any[], V>(
  7801. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  7802. ...args: T
  7803. ): V;
  7804. setModuleMemCaches(
  7805. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  7806. ): void;
  7807. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  7808. static getModuleGraphForModule(
  7809. module: Module,
  7810. deprecateMessage: string,
  7811. deprecationCode: string
  7812. ): ModuleGraph;
  7813. static setModuleGraphForModule(
  7814. module: Module,
  7815. moduleGraph: ModuleGraph
  7816. ): void;
  7817. static clearModuleGraphForModule(module: Module): void;
  7818. static ModuleGraphConnection: typeof ModuleGraphConnection;
  7819. }
  7820. declare class ModuleGraphConnection {
  7821. constructor(
  7822. originModule: null | Module,
  7823. dependency: null | Dependency,
  7824. module: Module,
  7825. explanation?: string,
  7826. weak?: boolean,
  7827. condition?:
  7828. | null
  7829. | false
  7830. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  7831. );
  7832. originModule: null | Module;
  7833. resolvedOriginModule: null | Module;
  7834. dependency: null | Dependency;
  7835. resolvedModule: Module;
  7836. module: Module;
  7837. weak: boolean;
  7838. conditional: boolean;
  7839. condition?: (
  7840. arg0: ModuleGraphConnection,
  7841. arg1: RuntimeSpec
  7842. ) => ConnectionState;
  7843. explanations?: Set<string>;
  7844. clone(): ModuleGraphConnection;
  7845. addCondition(
  7846. condition: (
  7847. arg0: ModuleGraphConnection,
  7848. arg1: RuntimeSpec
  7849. ) => ConnectionState
  7850. ): void;
  7851. addExplanation(explanation: string): void;
  7852. get explanation(): string;
  7853. active: void;
  7854. isActive(runtime: RuntimeSpec): boolean;
  7855. isTargetActive(runtime: RuntimeSpec): boolean;
  7856. getActiveState(runtime: RuntimeSpec): ConnectionState;
  7857. setActive(value: boolean): void;
  7858. static addConnectionStates: (
  7859. a: ConnectionState,
  7860. b: ConnectionState
  7861. ) => ConnectionState;
  7862. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  7863. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  7864. }
  7865. type ModuleId = string | number;
  7866. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  7867. /**
  7868. * Options affecting the normal modules (`NormalModuleFactory`).
  7869. */
  7870. declare interface ModuleOptions {
  7871. /**
  7872. * An array of rules applied by default for modules.
  7873. */
  7874. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7875. /**
  7876. * Enable warnings for full dynamic dependencies.
  7877. */
  7878. exprContextCritical?: boolean;
  7879. /**
  7880. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  7881. */
  7882. exprContextRecursive?: boolean;
  7883. /**
  7884. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  7885. */
  7886. exprContextRegExp?: boolean | RegExp;
  7887. /**
  7888. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  7889. */
  7890. exprContextRequest?: string;
  7891. /**
  7892. * Specify options for each generator.
  7893. */
  7894. generator?: GeneratorOptionsByModuleType;
  7895. /**
  7896. * Don't parse files matching. It's matched against the full resolved request.
  7897. */
  7898. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7899. /**
  7900. * Specify options for each parser.
  7901. */
  7902. parser?: ParserOptionsByModuleType;
  7903. /**
  7904. * An array of rules applied for modules.
  7905. */
  7906. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7907. /**
  7908. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  7909. */
  7910. strictExportPresence?: boolean;
  7911. /**
  7912. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  7913. */
  7914. strictThisContextOnImports?: boolean;
  7915. /**
  7916. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  7917. */
  7918. unknownContextCritical?: boolean;
  7919. /**
  7920. * 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'.
  7921. */
  7922. unknownContextRecursive?: boolean;
  7923. /**
  7924. * 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'.
  7925. */
  7926. unknownContextRegExp?: boolean | RegExp;
  7927. /**
  7928. * 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'.
  7929. */
  7930. unknownContextRequest?: string;
  7931. /**
  7932. * Cache the resolving of module requests.
  7933. */
  7934. unsafeCache?: boolean | Function;
  7935. /**
  7936. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  7937. */
  7938. wrappedContextCritical?: boolean;
  7939. /**
  7940. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  7941. */
  7942. wrappedContextRecursive?: boolean;
  7943. /**
  7944. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  7945. */
  7946. wrappedContextRegExp?: RegExp;
  7947. }
  7948. /**
  7949. * Options affecting the normal modules (`NormalModuleFactory`).
  7950. */
  7951. declare interface ModuleOptionsNormalized {
  7952. /**
  7953. * An array of rules applied by default for modules.
  7954. */
  7955. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7956. /**
  7957. * Specify options for each generator.
  7958. */
  7959. generator: GeneratorOptionsByModuleType;
  7960. /**
  7961. * Don't parse files matching. It's matched against the full resolved request.
  7962. */
  7963. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7964. /**
  7965. * Specify options for each parser.
  7966. */
  7967. parser: ParserOptionsByModuleType;
  7968. /**
  7969. * An array of rules applied for modules.
  7970. */
  7971. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7972. /**
  7973. * Cache the resolving of module requests.
  7974. */
  7975. unsafeCache?: boolean | Function;
  7976. }
  7977. declare interface ModulePathData {
  7978. id: string | number;
  7979. hash: string;
  7980. hashWithLength?: (arg0: number) => string;
  7981. }
  7982. declare abstract class ModuleProfile {
  7983. startTime: number;
  7984. factoryStartTime: number;
  7985. factoryEndTime: number;
  7986. factory: number;
  7987. factoryParallelismFactor: number;
  7988. restoringStartTime: number;
  7989. restoringEndTime: number;
  7990. restoring: number;
  7991. restoringParallelismFactor: number;
  7992. integrationStartTime: number;
  7993. integrationEndTime: number;
  7994. integration: number;
  7995. integrationParallelismFactor: number;
  7996. buildingStartTime: number;
  7997. buildingEndTime: number;
  7998. building: number;
  7999. buildingParallelismFactor: number;
  8000. storingStartTime: number;
  8001. storingEndTime: number;
  8002. storing: number;
  8003. storingParallelismFactor: number;
  8004. additionalFactoryTimes?: { start: number; end: number }[];
  8005. additionalFactories: number;
  8006. additionalFactoriesParallelismFactor: number;
  8007. additionalIntegration: number;
  8008. markFactoryStart(): void;
  8009. markFactoryEnd(): void;
  8010. markRestoringStart(): void;
  8011. markRestoringEnd(): void;
  8012. markIntegrationStart(): void;
  8013. markIntegrationEnd(): void;
  8014. markBuildingStart(): void;
  8015. markBuildingEnd(): void;
  8016. markStoringStart(): void;
  8017. markStoringEnd(): void;
  8018. /**
  8019. * Merge this profile into another one
  8020. */
  8021. mergeInto(realProfile: ModuleProfile): void;
  8022. }
  8023. declare interface ModuleReferenceOptions {
  8024. /**
  8025. * the properties/exports of the module
  8026. */
  8027. ids: string[];
  8028. /**
  8029. * true, when this referenced export is called
  8030. */
  8031. call: boolean;
  8032. /**
  8033. * true, when this referenced export is directly imported (not via property access)
  8034. */
  8035. directImport: boolean;
  8036. /**
  8037. * if the position is ASI safe or unknown
  8038. */
  8039. asiSafe?: boolean;
  8040. }
  8041. declare interface ModuleSettings {
  8042. /**
  8043. * Specifies the layer in which the module should be placed in.
  8044. */
  8045. layer?: string;
  8046. /**
  8047. * Module type to use for the module.
  8048. */
  8049. type?: string;
  8050. /**
  8051. * Options for the resolver.
  8052. */
  8053. resolve?: ResolveOptions;
  8054. /**
  8055. * Options for parsing.
  8056. */
  8057. parser?: { [index: string]: any };
  8058. /**
  8059. * The options for the module generator.
  8060. */
  8061. generator?: { [index: string]: any };
  8062. /**
  8063. * Flags a module as with or without side effects.
  8064. */
  8065. sideEffects?: boolean;
  8066. }
  8067. declare abstract class ModuleTemplate {
  8068. type: string;
  8069. hooks: Readonly<{
  8070. content: { tap: (options?: any, fn?: any) => void };
  8071. module: { tap: (options?: any, fn?: any) => void };
  8072. render: { tap: (options?: any, fn?: any) => void };
  8073. package: { tap: (options?: any, fn?: any) => void };
  8074. hash: { tap: (options?: any, fn?: any) => void };
  8075. }>;
  8076. get runtimeTemplate(): any;
  8077. }
  8078. declare interface ModuleTemplates {
  8079. javascript: ModuleTemplate;
  8080. }
  8081. declare class MultiCompiler {
  8082. constructor(
  8083. compilers: Compiler[] | Record<string, Compiler>,
  8084. options: MultiCompilerOptions
  8085. );
  8086. hooks: Readonly<{
  8087. done: SyncHook<[MultiStats]>;
  8088. invalid: MultiHook<SyncHook<[null | string, number]>>;
  8089. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8090. watchClose: SyncHook<[]>;
  8091. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8092. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  8093. }>;
  8094. compilers: Compiler[];
  8095. dependencies: WeakMap<Compiler, string[]>;
  8096. running: boolean;
  8097. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  8098. get outputPath(): string;
  8099. inputFileSystem: InputFileSystem;
  8100. outputFileSystem: OutputFileSystem;
  8101. watchFileSystem: WatchFileSystem;
  8102. intermediateFileSystem: IntermediateFileSystem;
  8103. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  8104. setDependencies(compiler: Compiler, dependencies: string[]): void;
  8105. validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
  8106. runWithDependencies(
  8107. compilers: Compiler[],
  8108. fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
  8109. callback: CallbackFunction_1<MultiStats>
  8110. ): void;
  8111. watch(
  8112. watchOptions: WatchOptions | WatchOptions[],
  8113. handler: CallbackFunction_1<MultiStats>
  8114. ): MultiWatching;
  8115. run(callback: CallbackFunction_1<MultiStats>): void;
  8116. purgeInputFileSystem(): void;
  8117. close(callback: CallbackFunction_1<void>): void;
  8118. }
  8119. declare interface MultiCompilerOptions {
  8120. /**
  8121. * how many Compilers are allows to run at the same time in parallel
  8122. */
  8123. parallelism?: number;
  8124. }
  8125. declare abstract class MultiStats {
  8126. stats: Stats[];
  8127. get hash(): string;
  8128. hasErrors(): boolean;
  8129. hasWarnings(): boolean;
  8130. toJson(options?: any): StatsCompilation;
  8131. toString(options?: any): string;
  8132. }
  8133. declare abstract class MultiWatching {
  8134. watchings: Watching[];
  8135. compiler: MultiCompiler;
  8136. invalidate(callback?: CallbackFunction_2<void>): void;
  8137. suspend(): void;
  8138. resume(): void;
  8139. close(callback: CallbackFunction_2<void>): void;
  8140. }
  8141. declare class NamedChunkIdsPlugin {
  8142. constructor(options?: NamedChunkIdsPluginOptions);
  8143. delimiter: string;
  8144. context?: string;
  8145. /**
  8146. * Apply the plugin
  8147. */
  8148. apply(compiler: Compiler): void;
  8149. }
  8150. declare interface NamedChunkIdsPluginOptions {
  8151. /**
  8152. * context
  8153. */
  8154. context?: string;
  8155. /**
  8156. * delimiter
  8157. */
  8158. delimiter?: string;
  8159. }
  8160. declare class NamedModuleIdsPlugin {
  8161. constructor(options?: NamedModuleIdsPluginOptions);
  8162. options: NamedModuleIdsPluginOptions;
  8163. /**
  8164. * Apply the plugin
  8165. */
  8166. apply(compiler: Compiler): void;
  8167. }
  8168. declare interface NamedModuleIdsPluginOptions {
  8169. /**
  8170. * context
  8171. */
  8172. context?: string;
  8173. }
  8174. declare class NaturalModuleIdsPlugin {
  8175. constructor();
  8176. /**
  8177. * Apply the plugin
  8178. */
  8179. apply(compiler: Compiler): void;
  8180. }
  8181. declare interface NeedBuildContext {
  8182. compilation: Compilation;
  8183. fileSystemInfo: FileSystemInfo;
  8184. valueCacheVersions: Map<string, string | Set<string>>;
  8185. }
  8186. declare class NoEmitOnErrorsPlugin {
  8187. constructor();
  8188. /**
  8189. * Apply the plugin
  8190. */
  8191. apply(compiler: Compiler): void;
  8192. }
  8193. type Node = false | NodeOptions;
  8194. declare class NodeEnvironmentPlugin {
  8195. constructor(options: {
  8196. /**
  8197. * infrastructure logging options
  8198. */
  8199. infrastructureLogging: InfrastructureLogging;
  8200. });
  8201. options: {
  8202. /**
  8203. * infrastructure logging options
  8204. */
  8205. infrastructureLogging: InfrastructureLogging;
  8206. };
  8207. /**
  8208. * Apply the plugin
  8209. */
  8210. apply(compiler: Compiler): void;
  8211. }
  8212. /**
  8213. * Options object for node compatibility features.
  8214. */
  8215. declare interface NodeOptions {
  8216. /**
  8217. * Include a polyfill for the '__dirname' variable.
  8218. */
  8219. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  8220. /**
  8221. * Include a polyfill for the '__filename' variable.
  8222. */
  8223. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  8224. /**
  8225. * Include a polyfill for the 'global' variable.
  8226. */
  8227. global?: boolean | "warn";
  8228. }
  8229. declare class NodeSourcePlugin {
  8230. constructor();
  8231. /**
  8232. * Apply the plugin
  8233. */
  8234. apply(compiler: Compiler): void;
  8235. }
  8236. declare class NodeTargetPlugin {
  8237. constructor();
  8238. /**
  8239. * Apply the plugin
  8240. */
  8241. apply(compiler: Compiler): void;
  8242. }
  8243. declare class NodeTemplatePlugin {
  8244. constructor(options?: NodeTemplatePluginOptions);
  8245. /**
  8246. * Apply the plugin
  8247. */
  8248. apply(compiler: Compiler): void;
  8249. }
  8250. declare interface NodeTemplatePluginOptions {
  8251. /**
  8252. * enable async chunk loading
  8253. */
  8254. asyncChunkLoading?: boolean;
  8255. }
  8256. declare class NormalModule extends Module {
  8257. constructor(__0: NormalModuleCreateData);
  8258. request: string;
  8259. userRequest: string;
  8260. rawRequest: string;
  8261. binary: boolean;
  8262. parser?: Parser;
  8263. parserOptions?: ParserOptions;
  8264. generator?: Generator;
  8265. generatorOptions?: GeneratorOptions;
  8266. resource: string;
  8267. resourceResolveData?: Record<string, any>;
  8268. matchResource?: string;
  8269. loaders: LoaderItem[];
  8270. error: null | WebpackError;
  8271. /**
  8272. * restore unsafe cache data
  8273. */
  8274. restoreFromUnsafeCache(
  8275. unsafeCacheData: NormalModuleUnsafeCacheData,
  8276. normalModuleFactory: NormalModuleFactory
  8277. ): void;
  8278. createSourceForAsset(
  8279. context: string,
  8280. name: string,
  8281. content: string | Buffer,
  8282. sourceMap?: string | SourceMap,
  8283. associatedObjectForCache?: object
  8284. ): Source;
  8285. getCurrentLoader(loaderContext?: any, index?: number): null | LoaderItem;
  8286. createSource(
  8287. context: string,
  8288. content: string | Buffer,
  8289. sourceMap?: string | SourceMapSource,
  8290. associatedObjectForCache?: object
  8291. ): Source;
  8292. markModuleAsErrored(error: WebpackError): void;
  8293. applyNoParseRule(rule: any, content: string): boolean;
  8294. shouldPreventParsing(noParseRule: any, request: string): boolean;
  8295. static getCompilationHooks(
  8296. compilation: Compilation
  8297. ): NormalModuleCompilationHooks;
  8298. static deserialize(context?: any): NormalModule;
  8299. }
  8300. declare interface NormalModuleCompilationHooks {
  8301. loader: SyncHook<[object, NormalModule]>;
  8302. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
  8303. beforeParse: SyncHook<[NormalModule]>;
  8304. beforeSnapshot: SyncHook<[NormalModule]>;
  8305. readResourceForScheme: HookMap<
  8306. AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
  8307. >;
  8308. readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
  8309. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  8310. }
  8311. declare interface NormalModuleCreateData {
  8312. /**
  8313. * an optional layer in which the module is
  8314. */
  8315. layer?: string;
  8316. /**
  8317. * module type. When deserializing, this is set to an empty string "".
  8318. */
  8319. type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
  8320. /**
  8321. * request string
  8322. */
  8323. request: string;
  8324. /**
  8325. * request intended by user (without loaders from config)
  8326. */
  8327. userRequest: string;
  8328. /**
  8329. * request without resolving
  8330. */
  8331. rawRequest: string;
  8332. /**
  8333. * list of loaders
  8334. */
  8335. loaders: LoaderItem[];
  8336. /**
  8337. * path + query of the real resource
  8338. */
  8339. resource: string;
  8340. /**
  8341. * resource resolve data
  8342. */
  8343. resourceResolveData?: Record<string, any>;
  8344. /**
  8345. * context directory for resolving
  8346. */
  8347. context: string;
  8348. /**
  8349. * path + query of the matched resource (virtual)
  8350. */
  8351. matchResource?: string;
  8352. /**
  8353. * the parser used
  8354. */
  8355. parser: Parser;
  8356. /**
  8357. * the options of the parser used
  8358. */
  8359. parserOptions?: ParserOptions;
  8360. /**
  8361. * the generator used
  8362. */
  8363. generator: Generator;
  8364. /**
  8365. * the options of the generator used
  8366. */
  8367. generatorOptions?: GeneratorOptions;
  8368. /**
  8369. * options used for resolving requests from this module
  8370. */
  8371. resolveOptions?: ResolveOptions;
  8372. }
  8373. declare abstract class NormalModuleFactory extends ModuleFactory {
  8374. hooks: Readonly<{
  8375. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  8376. resolveForScheme: HookMap<
  8377. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  8378. >;
  8379. resolveInScheme: HookMap<
  8380. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  8381. >;
  8382. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  8383. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  8384. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  8385. createModule: AsyncSeriesBailHook<
  8386. [
  8387. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  8388. ResolveData
  8389. ],
  8390. void | Module
  8391. >;
  8392. module: SyncWaterfallHook<
  8393. [
  8394. Module,
  8395. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  8396. ResolveData
  8397. ],
  8398. Module
  8399. >;
  8400. createParser: HookMap<SyncBailHook<[ParserOptions], Parser>>;
  8401. parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
  8402. createGenerator: HookMap<SyncBailHook<[GeneratorOptions], Generator>>;
  8403. generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
  8404. createModuleClass: HookMap<SyncBailHook<[any, ResolveData], Module>>;
  8405. }>;
  8406. resolverFactory: ResolverFactory;
  8407. ruleSet: RuleSet;
  8408. context: string;
  8409. fs: InputFileSystem;
  8410. parserCache: Map<string, WeakMap<object, Parser>>;
  8411. generatorCache: Map<string, WeakMap<object, Generator>>;
  8412. cleanupForCache(): void;
  8413. resolveResource(
  8414. contextInfo: ModuleFactoryCreateDataContextInfo,
  8415. context: string,
  8416. unresolvedResource: string,
  8417. resolver: ResolverWithOptions,
  8418. resolveContext: ResolveContext,
  8419. callback: (
  8420. err: null | Error,
  8421. res?: string | false,
  8422. req?: ResolveRequest
  8423. ) => void
  8424. ): void;
  8425. resolveRequestArray(
  8426. contextInfo: ModuleFactoryCreateDataContextInfo,
  8427. context: string,
  8428. array: LoaderItem[],
  8429. resolver: ResolverWithOptions,
  8430. resolveContext: ResolveContext,
  8431. callback: CallbackNormalModuleFactory<LoaderItem[]>
  8432. ): void;
  8433. getParser(type: string, parserOptions?: ParserOptions): Parser;
  8434. createParser(type: string, parserOptions?: ParserOptions): Parser;
  8435. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  8436. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  8437. getResolver(
  8438. type: string,
  8439. resolveOptions?: ResolveOptionsWithDependencyType
  8440. ): ResolverWithOptions;
  8441. }
  8442. /**
  8443. * These properties are added by the NormalModule
  8444. */
  8445. declare interface NormalModuleLoaderContext<OptionsType> {
  8446. version: number;
  8447. getOptions(): OptionsType;
  8448. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  8449. emitWarning(warning: Error): void;
  8450. emitError(error: Error): void;
  8451. getLogger(name?: string): WebpackLogger;
  8452. resolve(
  8453. context: string,
  8454. request: string,
  8455. callback: (
  8456. err: null | ErrorWithDetail,
  8457. res?: string | false,
  8458. req?: ResolveRequest
  8459. ) => void
  8460. ): any;
  8461. getResolve(options?: ResolveOptionsWithDependencyType): {
  8462. (
  8463. context: string,
  8464. request: string,
  8465. callback: (
  8466. err: null | ErrorWithDetail,
  8467. res?: string | false,
  8468. req?: ResolveRequest
  8469. ) => void
  8470. ): void;
  8471. (context: string, request: string): Promise<string>;
  8472. };
  8473. emitFile(
  8474. name: string,
  8475. content: string | Buffer,
  8476. sourceMap?: string,
  8477. assetInfo?: AssetInfo
  8478. ): void;
  8479. addBuildDependency(dep: string): void;
  8480. utils: {
  8481. absolutify: (context: string, request: string) => string;
  8482. contextify: (context: string, request: string) => string;
  8483. createHash: (algorithm?: string | typeof Hash) => Hash;
  8484. };
  8485. rootContext: string;
  8486. fs: InputFileSystem;
  8487. sourceMap?: boolean;
  8488. mode: "none" | "development" | "production";
  8489. webpack?: boolean;
  8490. _module?: NormalModule;
  8491. _compilation?: Compilation;
  8492. _compiler?: Compiler;
  8493. }
  8494. declare class NormalModuleReplacementPlugin {
  8495. /**
  8496. * Create an instance of the plugin
  8497. */
  8498. constructor(
  8499. resourceRegExp: RegExp,
  8500. newResource: string | ((arg0: ResolveData) => void)
  8501. );
  8502. resourceRegExp: RegExp;
  8503. newResource: string | ((arg0: ResolveData) => void);
  8504. /**
  8505. * Apply the plugin
  8506. */
  8507. apply(compiler: Compiler): void;
  8508. }
  8509. type NormalModuleUnsafeCacheData = UnsafeCacheData & {
  8510. parser?: Parser;
  8511. parserOptions?: ParserOptions;
  8512. generator?: Generator;
  8513. generatorOptions?: GeneratorOptions;
  8514. };
  8515. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  8516. Omit<
  8517. StatsOptions,
  8518. | "context"
  8519. | "chunkGroups"
  8520. | "requestShortener"
  8521. | "chunksSort"
  8522. | "modulesSort"
  8523. | "chunkModulesSort"
  8524. | "nestedModulesSort"
  8525. | "assetsSort"
  8526. | "ids"
  8527. | "cachedAssets"
  8528. | "groupAssetsByEmitStatus"
  8529. | "groupAssetsByPath"
  8530. | "groupAssetsByExtension"
  8531. | "assetsSpace"
  8532. | "excludeAssets"
  8533. | "excludeModules"
  8534. | "warningsFilter"
  8535. | "cachedModules"
  8536. | "orphanModules"
  8537. | "dependentModules"
  8538. | "runtimeModules"
  8539. | "groupModulesByCacheStatus"
  8540. | "groupModulesByLayer"
  8541. | "groupModulesByAttributes"
  8542. | "groupModulesByPath"
  8543. | "groupModulesByExtension"
  8544. | "groupModulesByType"
  8545. | "entrypoints"
  8546. | "chunkGroupAuxiliary"
  8547. | "chunkGroupChildren"
  8548. | "chunkGroupMaxAssets"
  8549. | "modulesSpace"
  8550. | "chunkModulesSpace"
  8551. | "nestedModulesSpace"
  8552. | "logging"
  8553. | "loggingDebug"
  8554. | "loggingTrace"
  8555. | "_env"
  8556. > &
  8557. Record<string, any>;
  8558. declare class NullDependency extends Dependency {
  8559. constructor();
  8560. static Template: typeof NullDependencyTemplate;
  8561. static NO_EXPORTS_REFERENCED: string[][];
  8562. static EXPORTS_OBJECT_REFERENCED: string[][];
  8563. static TRANSITIVE: typeof TRANSITIVE;
  8564. }
  8565. declare class NullDependencyTemplate extends DependencyTemplate {
  8566. constructor();
  8567. }
  8568. declare interface ObjectDeserializerContext {
  8569. read: () => any;
  8570. setCircularReference: (arg0?: any) => void;
  8571. }
  8572. declare interface ObjectEncodingOptions {
  8573. encoding?:
  8574. | null
  8575. | "ascii"
  8576. | "utf8"
  8577. | "utf-8"
  8578. | "utf16le"
  8579. | "utf-16le"
  8580. | "ucs2"
  8581. | "ucs-2"
  8582. | "latin1"
  8583. | "binary"
  8584. | "base64"
  8585. | "base64url"
  8586. | "hex";
  8587. }
  8588. declare interface ObjectSerializer {
  8589. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  8590. deserialize: (arg0: ObjectDeserializerContext) => any;
  8591. }
  8592. declare interface ObjectSerializerContext {
  8593. write: (arg0?: any) => void;
  8594. writeLazy?: (arg0?: any) => void;
  8595. writeSeparate?: (arg0: any, arg1?: object) => () => any;
  8596. setCircularReference: (arg0?: any) => void;
  8597. }
  8598. declare class OccurrenceChunkIdsPlugin {
  8599. constructor(options?: OccurrenceChunkIdsPluginOptions);
  8600. options: OccurrenceChunkIdsPluginOptions;
  8601. /**
  8602. * Apply the plugin
  8603. */
  8604. apply(compiler: Compiler): void;
  8605. }
  8606. declare interface OccurrenceChunkIdsPluginOptions {
  8607. /**
  8608. * Prioritise initial size over total size.
  8609. */
  8610. prioritiseInitial?: boolean;
  8611. }
  8612. declare class OccurrenceModuleIdsPlugin {
  8613. constructor(options?: OccurrenceModuleIdsPluginOptions);
  8614. options: OccurrenceModuleIdsPluginOptions;
  8615. /**
  8616. * Apply the plugin
  8617. */
  8618. apply(compiler: Compiler): void;
  8619. }
  8620. declare interface OccurrenceModuleIdsPluginOptions {
  8621. /**
  8622. * Prioritise initial size over total size.
  8623. */
  8624. prioritiseInitial?: boolean;
  8625. }
  8626. declare interface Open {
  8627. (
  8628. file: PathLikeFs,
  8629. flags: undefined | string | number,
  8630. mode: undefined | null | string | number,
  8631. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8632. ): void;
  8633. (
  8634. file: PathLikeFs,
  8635. flags: undefined | string | number,
  8636. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8637. ): void;
  8638. (
  8639. file: PathLikeFs,
  8640. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8641. ): void;
  8642. }
  8643. /**
  8644. * Enables/Disables integrated optimizations.
  8645. */
  8646. declare interface Optimization {
  8647. /**
  8648. * Check for incompatible wasm types when importing/exporting from/to ESM.
  8649. */
  8650. checkWasmTypes?: boolean;
  8651. /**
  8652. * 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).
  8653. */
  8654. chunkIds?:
  8655. | false
  8656. | "natural"
  8657. | "named"
  8658. | "deterministic"
  8659. | "size"
  8660. | "total-size";
  8661. /**
  8662. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  8663. */
  8664. concatenateModules?: boolean;
  8665. /**
  8666. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  8667. */
  8668. emitOnErrors?: boolean;
  8669. /**
  8670. * Also flag chunks as loaded which contain a subset of the modules.
  8671. */
  8672. flagIncludedChunks?: boolean;
  8673. /**
  8674. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  8675. */
  8676. innerGraph?: boolean;
  8677. /**
  8678. * 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).
  8679. */
  8680. mangleExports?: boolean | "deterministic" | "size";
  8681. /**
  8682. * Reduce size of WASM by changing imports to shorter strings.
  8683. */
  8684. mangleWasmImports?: boolean;
  8685. /**
  8686. * Merge chunks which contain the same modules.
  8687. */
  8688. mergeDuplicateChunks?: boolean;
  8689. /**
  8690. * Enable minimizing the output. Uses optimization.minimizer.
  8691. */
  8692. minimize?: boolean;
  8693. /**
  8694. * Minimizer(s) to use for minimizing the output.
  8695. */
  8696. minimizer?: (
  8697. | undefined
  8698. | null
  8699. | false
  8700. | ""
  8701. | 0
  8702. | ((this: Compiler, compiler: Compiler) => void)
  8703. | WebpackPluginInstance
  8704. | "..."
  8705. )[];
  8706. /**
  8707. * 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).
  8708. */
  8709. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  8710. /**
  8711. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  8712. */
  8713. noEmitOnErrors?: boolean;
  8714. /**
  8715. * Set process.env.NODE_ENV to a specific value.
  8716. */
  8717. nodeEnv?: string | false;
  8718. /**
  8719. * Generate records with relative paths to be able to move the context folder.
  8720. */
  8721. portableRecords?: boolean;
  8722. /**
  8723. * Figure out which exports are provided by modules to generate more efficient code.
  8724. */
  8725. providedExports?: boolean;
  8726. /**
  8727. * Use real [contenthash] based on final content of the assets.
  8728. */
  8729. realContentHash?: boolean;
  8730. /**
  8731. * Removes modules from chunks when these modules are already included in all parents.
  8732. */
  8733. removeAvailableModules?: boolean;
  8734. /**
  8735. * Remove chunks which are empty.
  8736. */
  8737. removeEmptyChunks?: boolean;
  8738. /**
  8739. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  8740. */
  8741. runtimeChunk?:
  8742. | boolean
  8743. | "single"
  8744. | "multiple"
  8745. | {
  8746. /**
  8747. * The name or name factory for the runtime chunks.
  8748. */
  8749. name?: string | Function;
  8750. };
  8751. /**
  8752. * 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).
  8753. */
  8754. sideEffects?: boolean | "flag";
  8755. /**
  8756. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  8757. */
  8758. splitChunks?: false | OptimizationSplitChunksOptions;
  8759. /**
  8760. * 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).
  8761. */
  8762. usedExports?: boolean | "global";
  8763. }
  8764. /**
  8765. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  8766. */
  8767. declare interface OptimizationSplitChunksCacheGroup {
  8768. /**
  8769. * Sets the name delimiter for created chunks.
  8770. */
  8771. automaticNameDelimiter?: string;
  8772. /**
  8773. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  8774. */
  8775. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8776. /**
  8777. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  8778. */
  8779. enforce?: boolean;
  8780. /**
  8781. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8782. */
  8783. enforceSizeThreshold?: number | { [index: string]: number };
  8784. /**
  8785. * Sets the template for the filename for created chunks.
  8786. */
  8787. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8788. /**
  8789. * Sets the hint for chunk id.
  8790. */
  8791. idHint?: string;
  8792. /**
  8793. * Assign modules to a cache group by module layer.
  8794. */
  8795. layer?: string | Function | RegExp;
  8796. /**
  8797. * Maximum number of requests which are accepted for on-demand loading.
  8798. */
  8799. maxAsyncRequests?: number;
  8800. /**
  8801. * Maximal size hint for the on-demand chunks.
  8802. */
  8803. maxAsyncSize?: number | { [index: string]: number };
  8804. /**
  8805. * Maximum number of initial chunks which are accepted for an entry point.
  8806. */
  8807. maxInitialRequests?: number;
  8808. /**
  8809. * Maximal size hint for the initial chunks.
  8810. */
  8811. maxInitialSize?: number | { [index: string]: number };
  8812. /**
  8813. * Maximal size hint for the created chunks.
  8814. */
  8815. maxSize?: number | { [index: string]: number };
  8816. /**
  8817. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8818. */
  8819. minChunks?: number;
  8820. /**
  8821. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8822. */
  8823. minRemainingSize?: number | { [index: string]: number };
  8824. /**
  8825. * Minimal size for the created chunk.
  8826. */
  8827. minSize?: number | { [index: string]: number };
  8828. /**
  8829. * Minimum size reduction due to the created chunk.
  8830. */
  8831. minSizeReduction?: number | { [index: string]: number };
  8832. /**
  8833. * Give chunks for this cache group a name (chunks with equal name are merged).
  8834. */
  8835. name?: string | false | Function;
  8836. /**
  8837. * Priority of this cache group.
  8838. */
  8839. priority?: number;
  8840. /**
  8841. * Try to reuse existing chunk (with name) when it has matching modules.
  8842. */
  8843. reuseExistingChunk?: boolean;
  8844. /**
  8845. * Assign modules to a cache group by module name.
  8846. */
  8847. test?: string | Function | RegExp;
  8848. /**
  8849. * Assign modules to a cache group by module type.
  8850. */
  8851. type?: string | Function | RegExp;
  8852. /**
  8853. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8854. */
  8855. usedExports?: boolean;
  8856. }
  8857. /**
  8858. * Options object for splitting chunks into smaller chunks.
  8859. */
  8860. declare interface OptimizationSplitChunksOptions {
  8861. /**
  8862. * Sets the name delimiter for created chunks.
  8863. */
  8864. automaticNameDelimiter?: string;
  8865. /**
  8866. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  8867. */
  8868. cacheGroups?: {
  8869. [index: string]:
  8870. | string
  8871. | false
  8872. | Function
  8873. | RegExp
  8874. | OptimizationSplitChunksCacheGroup;
  8875. };
  8876. /**
  8877. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8878. */
  8879. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8880. /**
  8881. * Sets the size types which are used when a number is used for sizes.
  8882. */
  8883. defaultSizeTypes?: string[];
  8884. /**
  8885. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8886. */
  8887. enforceSizeThreshold?: number | { [index: string]: number };
  8888. /**
  8889. * Options for modules not selected by any other cache group.
  8890. */
  8891. fallbackCacheGroup?: {
  8892. /**
  8893. * Sets the name delimiter for created chunks.
  8894. */
  8895. automaticNameDelimiter?: string;
  8896. /**
  8897. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8898. */
  8899. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8900. /**
  8901. * Maximal size hint for the on-demand chunks.
  8902. */
  8903. maxAsyncSize?: number | { [index: string]: number };
  8904. /**
  8905. * Maximal size hint for the initial chunks.
  8906. */
  8907. maxInitialSize?: number | { [index: string]: number };
  8908. /**
  8909. * Maximal size hint for the created chunks.
  8910. */
  8911. maxSize?: number | { [index: string]: number };
  8912. /**
  8913. * Minimal size for the created chunk.
  8914. */
  8915. minSize?: number | { [index: string]: number };
  8916. /**
  8917. * Minimum size reduction due to the created chunk.
  8918. */
  8919. minSizeReduction?: number | { [index: string]: number };
  8920. };
  8921. /**
  8922. * Sets the template for the filename for created chunks.
  8923. */
  8924. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8925. /**
  8926. * Prevents exposing path info when creating names for parts splitted by maxSize.
  8927. */
  8928. hidePathInfo?: boolean;
  8929. /**
  8930. * Maximum number of requests which are accepted for on-demand loading.
  8931. */
  8932. maxAsyncRequests?: number;
  8933. /**
  8934. * Maximal size hint for the on-demand chunks.
  8935. */
  8936. maxAsyncSize?: number | { [index: string]: number };
  8937. /**
  8938. * Maximum number of initial chunks which are accepted for an entry point.
  8939. */
  8940. maxInitialRequests?: number;
  8941. /**
  8942. * Maximal size hint for the initial chunks.
  8943. */
  8944. maxInitialSize?: number | { [index: string]: number };
  8945. /**
  8946. * Maximal size hint for the created chunks.
  8947. */
  8948. maxSize?: number | { [index: string]: number };
  8949. /**
  8950. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8951. */
  8952. minChunks?: number;
  8953. /**
  8954. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8955. */
  8956. minRemainingSize?: number | { [index: string]: number };
  8957. /**
  8958. * Minimal size for the created chunks.
  8959. */
  8960. minSize?: number | { [index: string]: number };
  8961. /**
  8962. * Minimum size reduction due to the created chunk.
  8963. */
  8964. minSizeReduction?: number | { [index: string]: number };
  8965. /**
  8966. * Give chunks created a name (chunks with equal name are merged).
  8967. */
  8968. name?: string | false | Function;
  8969. /**
  8970. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8971. */
  8972. usedExports?: boolean;
  8973. }
  8974. declare abstract class OptionsApply {
  8975. process(options?: any, compiler?: any): void;
  8976. }
  8977. declare interface OriginRecord {
  8978. module: Module;
  8979. loc: DependencyLocation;
  8980. request: string;
  8981. }
  8982. declare class OriginalSource extends Source {
  8983. constructor(source: string | Buffer, name: string);
  8984. getName(): string;
  8985. }
  8986. /**
  8987. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  8988. */
  8989. declare interface Output {
  8990. /**
  8991. * Add a container for define/require functions in the AMD module.
  8992. */
  8993. amdContainer?: string;
  8994. /**
  8995. * The filename of asset modules as relative path inside the 'output.path' directory.
  8996. */
  8997. assetModuleFilename?:
  8998. | string
  8999. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9000. /**
  9001. * Enable/disable creating async chunks that are loaded on demand.
  9002. */
  9003. asyncChunks?: boolean;
  9004. /**
  9005. * Add a comment in the UMD wrapper.
  9006. */
  9007. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  9008. /**
  9009. * Add charset attribute for script tag.
  9010. */
  9011. charset?: boolean;
  9012. /**
  9013. * 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.
  9014. */
  9015. chunkFilename?:
  9016. | string
  9017. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9018. /**
  9019. * 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).
  9020. */
  9021. chunkFormat?: string | false;
  9022. /**
  9023. * Number of milliseconds before chunk request expires.
  9024. */
  9025. chunkLoadTimeout?: number;
  9026. /**
  9027. * 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).
  9028. */
  9029. chunkLoading?: string | false;
  9030. /**
  9031. * The global variable used by webpack for loading of chunks.
  9032. */
  9033. chunkLoadingGlobal?: string;
  9034. /**
  9035. * Clean the output directory before emit.
  9036. */
  9037. clean?: boolean | CleanOptions;
  9038. /**
  9039. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  9040. */
  9041. compareBeforeEmit?: boolean;
  9042. /**
  9043. * This option enables cross-origin loading of chunks.
  9044. */
  9045. crossOriginLoading?: false | "anonymous" | "use-credentials";
  9046. /**
  9047. * 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.
  9048. */
  9049. cssChunkFilename?:
  9050. | string
  9051. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9052. /**
  9053. * 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.
  9054. */
  9055. cssFilename?:
  9056. | string
  9057. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9058. /**
  9059. * Compress the data in the head tag of CSS files.
  9060. */
  9061. cssHeadDataCompression?: boolean;
  9062. /**
  9063. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  9064. */
  9065. devtoolFallbackModuleFilenameTemplate?: string | Function;
  9066. /**
  9067. * Filename template string of function for the sources array in a generated SourceMap.
  9068. */
  9069. devtoolModuleFilenameTemplate?: string | Function;
  9070. /**
  9071. * 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.
  9072. */
  9073. devtoolNamespace?: string;
  9074. /**
  9075. * List of chunk loading types enabled for use by entry points.
  9076. */
  9077. enabledChunkLoadingTypes?: string[];
  9078. /**
  9079. * List of library types enabled for use by entry points.
  9080. */
  9081. enabledLibraryTypes?: string[];
  9082. /**
  9083. * List of wasm loading types enabled for use by entry points.
  9084. */
  9085. enabledWasmLoadingTypes?: string[];
  9086. /**
  9087. * The abilities of the environment where the webpack generated code should run.
  9088. */
  9089. environment?: Environment;
  9090. /**
  9091. * 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.
  9092. */
  9093. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9094. /**
  9095. * An expression which is used to address the global object/scope in runtime code.
  9096. */
  9097. globalObject?: string;
  9098. /**
  9099. * Digest type used for the hash.
  9100. */
  9101. hashDigest?: string;
  9102. /**
  9103. * Number of chars which are used for the hash.
  9104. */
  9105. hashDigestLength?: number;
  9106. /**
  9107. * Algorithm used for generation the hash (see node.js crypto package).
  9108. */
  9109. hashFunction?: string | typeof Hash;
  9110. /**
  9111. * Any string which is added to the hash to salt it.
  9112. */
  9113. hashSalt?: string;
  9114. /**
  9115. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  9116. */
  9117. hotUpdateChunkFilename?: string;
  9118. /**
  9119. * The global variable used by webpack for loading of hot update chunks.
  9120. */
  9121. hotUpdateGlobal?: string;
  9122. /**
  9123. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  9124. */
  9125. hotUpdateMainFilename?: string;
  9126. /**
  9127. * Ignore warnings in the browser.
  9128. */
  9129. ignoreBrowserWarnings?: boolean;
  9130. /**
  9131. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  9132. */
  9133. iife?: boolean;
  9134. /**
  9135. * The name of the native import() function (can be exchanged for a polyfill).
  9136. */
  9137. importFunctionName?: string;
  9138. /**
  9139. * The name of the native import.meta object (can be exchanged for a polyfill).
  9140. */
  9141. importMetaName?: string;
  9142. /**
  9143. * Make the output files a library, exporting the exports of the entry point.
  9144. */
  9145. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  9146. /**
  9147. * Specify which export should be exposed as library.
  9148. */
  9149. libraryExport?: string | string[];
  9150. /**
  9151. * 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).
  9152. */
  9153. libraryTarget?: string;
  9154. /**
  9155. * Output javascript files as module source type.
  9156. */
  9157. module?: boolean;
  9158. /**
  9159. * The output directory as **absolute path** (required).
  9160. */
  9161. path?: string;
  9162. /**
  9163. * Include comments with information about the modules.
  9164. */
  9165. pathinfo?: boolean | "verbose";
  9166. /**
  9167. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  9168. */
  9169. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9170. /**
  9171. * This option enables loading async chunks via a custom script type, such as script type="module".
  9172. */
  9173. scriptType?: false | "module" | "text/javascript";
  9174. /**
  9175. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  9176. */
  9177. sourceMapFilename?: string;
  9178. /**
  9179. * Prefixes every line of the source in the bundle with this string.
  9180. */
  9181. sourcePrefix?: string;
  9182. /**
  9183. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  9184. */
  9185. strictModuleErrorHandling?: boolean;
  9186. /**
  9187. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  9188. */
  9189. strictModuleExceptionHandling?: boolean;
  9190. /**
  9191. * 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.
  9192. */
  9193. trustedTypes?: string | true | TrustedTypes;
  9194. /**
  9195. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  9196. */
  9197. umdNamedDefine?: boolean;
  9198. /**
  9199. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  9200. */
  9201. uniqueName?: string;
  9202. /**
  9203. * 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).
  9204. */
  9205. wasmLoading?: string | false;
  9206. /**
  9207. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  9208. */
  9209. webassemblyModuleFilename?: string;
  9210. /**
  9211. * 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).
  9212. */
  9213. workerChunkLoading?: string | false;
  9214. /**
  9215. * 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.
  9216. */
  9217. workerPublicPath?: string;
  9218. /**
  9219. * 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).
  9220. */
  9221. workerWasmLoading?: string | false;
  9222. }
  9223. declare interface OutputFileSystem {
  9224. writeFile: WriteFile;
  9225. mkdir: Mkdir;
  9226. readdir?: ReaddirFs;
  9227. rmdir?: Rmdir;
  9228. unlink?: (
  9229. arg0: PathLikeFs,
  9230. arg1: (arg0: null | NodeJS.ErrnoException) => void
  9231. ) => void;
  9232. stat: StatFs;
  9233. lstat?: LStatFs;
  9234. readFile: ReadFileFs;
  9235. join?: (arg0: string, arg1: string) => string;
  9236. relative?: (arg0: string, arg1: string) => string;
  9237. dirname?: (arg0: string) => string;
  9238. }
  9239. /**
  9240. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  9241. */
  9242. declare interface OutputNormalized {
  9243. /**
  9244. * The filename of asset modules as relative path inside the 'output.path' directory.
  9245. */
  9246. assetModuleFilename?:
  9247. | string
  9248. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9249. /**
  9250. * Enable/disable creating async chunks that are loaded on demand.
  9251. */
  9252. asyncChunks?: boolean;
  9253. /**
  9254. * Add charset attribute for script tag.
  9255. */
  9256. charset?: boolean;
  9257. /**
  9258. * 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.
  9259. */
  9260. chunkFilename?:
  9261. | string
  9262. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9263. /**
  9264. * 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).
  9265. */
  9266. chunkFormat?: string | false;
  9267. /**
  9268. * Number of milliseconds before chunk request expires.
  9269. */
  9270. chunkLoadTimeout?: number;
  9271. /**
  9272. * 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).
  9273. */
  9274. chunkLoading?: string | false;
  9275. /**
  9276. * The global variable used by webpack for loading of chunks.
  9277. */
  9278. chunkLoadingGlobal?: string;
  9279. /**
  9280. * Clean the output directory before emit.
  9281. */
  9282. clean?: boolean | CleanOptions;
  9283. /**
  9284. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  9285. */
  9286. compareBeforeEmit?: boolean;
  9287. /**
  9288. * This option enables cross-origin loading of chunks.
  9289. */
  9290. crossOriginLoading?: false | "anonymous" | "use-credentials";
  9291. /**
  9292. * 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.
  9293. */
  9294. cssChunkFilename?:
  9295. | string
  9296. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9297. /**
  9298. * 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.
  9299. */
  9300. cssFilename?:
  9301. | string
  9302. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9303. /**
  9304. * Compress the data in the head tag of CSS files.
  9305. */
  9306. cssHeadDataCompression?: boolean;
  9307. /**
  9308. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  9309. */
  9310. devtoolFallbackModuleFilenameTemplate?: string | Function;
  9311. /**
  9312. * Filename template string of function for the sources array in a generated SourceMap.
  9313. */
  9314. devtoolModuleFilenameTemplate?: string | Function;
  9315. /**
  9316. * 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.
  9317. */
  9318. devtoolNamespace?: string;
  9319. /**
  9320. * List of chunk loading types enabled for use by entry points.
  9321. */
  9322. enabledChunkLoadingTypes?: string[];
  9323. /**
  9324. * List of library types enabled for use by entry points.
  9325. */
  9326. enabledLibraryTypes?: string[];
  9327. /**
  9328. * List of wasm loading types enabled for use by entry points.
  9329. */
  9330. enabledWasmLoadingTypes?: string[];
  9331. /**
  9332. * The abilities of the environment where the webpack generated code should run.
  9333. */
  9334. environment?: Environment;
  9335. /**
  9336. * 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.
  9337. */
  9338. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9339. /**
  9340. * An expression which is used to address the global object/scope in runtime code.
  9341. */
  9342. globalObject?: string;
  9343. /**
  9344. * Digest type used for the hash.
  9345. */
  9346. hashDigest?: string;
  9347. /**
  9348. * Number of chars which are used for the hash.
  9349. */
  9350. hashDigestLength?: number;
  9351. /**
  9352. * Algorithm used for generation the hash (see node.js crypto package).
  9353. */
  9354. hashFunction?: string | typeof Hash;
  9355. /**
  9356. * Any string which is added to the hash to salt it.
  9357. */
  9358. hashSalt?: string;
  9359. /**
  9360. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  9361. */
  9362. hotUpdateChunkFilename?: string;
  9363. /**
  9364. * The global variable used by webpack for loading of hot update chunks.
  9365. */
  9366. hotUpdateGlobal?: string;
  9367. /**
  9368. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  9369. */
  9370. hotUpdateMainFilename?: string;
  9371. /**
  9372. * Ignore warnings in the browser.
  9373. */
  9374. ignoreBrowserWarnings?: boolean;
  9375. /**
  9376. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  9377. */
  9378. iife?: boolean;
  9379. /**
  9380. * The name of the native import() function (can be exchanged for a polyfill).
  9381. */
  9382. importFunctionName?: string;
  9383. /**
  9384. * The name of the native import.meta object (can be exchanged for a polyfill).
  9385. */
  9386. importMetaName?: string;
  9387. /**
  9388. * Options for library.
  9389. */
  9390. library?: LibraryOptions;
  9391. /**
  9392. * Output javascript files as module source type.
  9393. */
  9394. module?: boolean;
  9395. /**
  9396. * The output directory as **absolute path** (required).
  9397. */
  9398. path?: string;
  9399. /**
  9400. * Include comments with information about the modules.
  9401. */
  9402. pathinfo?: boolean | "verbose";
  9403. /**
  9404. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  9405. */
  9406. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9407. /**
  9408. * This option enables loading async chunks via a custom script type, such as script type="module".
  9409. */
  9410. scriptType?: false | "module" | "text/javascript";
  9411. /**
  9412. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  9413. */
  9414. sourceMapFilename?: string;
  9415. /**
  9416. * Prefixes every line of the source in the bundle with this string.
  9417. */
  9418. sourcePrefix?: string;
  9419. /**
  9420. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  9421. */
  9422. strictModuleErrorHandling?: boolean;
  9423. /**
  9424. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  9425. */
  9426. strictModuleExceptionHandling?: boolean;
  9427. /**
  9428. * Use a Trusted Types policy to create urls for chunks.
  9429. */
  9430. trustedTypes?: TrustedTypes;
  9431. /**
  9432. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  9433. */
  9434. uniqueName?: string;
  9435. /**
  9436. * 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).
  9437. */
  9438. wasmLoading?: string | false;
  9439. /**
  9440. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  9441. */
  9442. webassemblyModuleFilename?: string;
  9443. /**
  9444. * 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).
  9445. */
  9446. workerChunkLoading?: string | false;
  9447. /**
  9448. * 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.
  9449. */
  9450. workerPublicPath?: string;
  9451. /**
  9452. * 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).
  9453. */
  9454. workerWasmLoading?: string | false;
  9455. }
  9456. declare interface ParameterizedComparator<TArg, T> {
  9457. (arg0: TArg): Comparator<T>;
  9458. }
  9459. declare interface ParsedIdentifier {
  9460. request: string;
  9461. query: string;
  9462. fragment: string;
  9463. directory: boolean;
  9464. module: boolean;
  9465. file: boolean;
  9466. internal: boolean;
  9467. }
  9468. declare class Parser {
  9469. constructor();
  9470. parse(
  9471. source: string | Buffer | PreparsedAst,
  9472. state: ParserState
  9473. ): ParserState;
  9474. }
  9475. declare interface ParserOptions {
  9476. [index: string]: any;
  9477. }
  9478. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  9479. ParserOptionsByModuleTypeUnknown;
  9480. /**
  9481. * Specify options for each parser.
  9482. */
  9483. declare interface ParserOptionsByModuleTypeKnown {
  9484. /**
  9485. * Parser options for asset modules.
  9486. */
  9487. asset?: AssetParserOptions;
  9488. /**
  9489. * No parser options are supported for this module type.
  9490. */
  9491. "asset/inline"?: EmptyParserOptions;
  9492. /**
  9493. * No parser options are supported for this module type.
  9494. */
  9495. "asset/resource"?: EmptyParserOptions;
  9496. /**
  9497. * No parser options are supported for this module type.
  9498. */
  9499. "asset/source"?: EmptyParserOptions;
  9500. /**
  9501. * Parser options for css modules.
  9502. */
  9503. css?: CssParserOptions;
  9504. /**
  9505. * Parser options for css/auto modules.
  9506. */
  9507. "css/auto"?: CssAutoParserOptions;
  9508. /**
  9509. * Parser options for css/global modules.
  9510. */
  9511. "css/global"?: CssGlobalParserOptions;
  9512. /**
  9513. * Parser options for css/module modules.
  9514. */
  9515. "css/module"?: CssModuleParserOptions;
  9516. /**
  9517. * Parser options for javascript modules.
  9518. */
  9519. javascript?: JavascriptParserOptions;
  9520. /**
  9521. * Parser options for javascript modules.
  9522. */
  9523. "javascript/auto"?: JavascriptParserOptions;
  9524. /**
  9525. * Parser options for javascript modules.
  9526. */
  9527. "javascript/dynamic"?: JavascriptParserOptions;
  9528. /**
  9529. * Parser options for javascript modules.
  9530. */
  9531. "javascript/esm"?: JavascriptParserOptions;
  9532. }
  9533. /**
  9534. * Specify options for each parser.
  9535. */
  9536. declare interface ParserOptionsByModuleTypeUnknown {
  9537. [index: string]: { [index: string]: any };
  9538. }
  9539. type ParserState = Record<string, any> & ParserStateBase;
  9540. declare interface ParserStateBase {
  9541. source: string | Buffer;
  9542. current: NormalModule;
  9543. module: NormalModule;
  9544. compilation: Compilation;
  9545. options: { [index: string]: any };
  9546. }
  9547. declare interface PathData {
  9548. chunkGraph?: ChunkGraph;
  9549. hash?: string;
  9550. hashWithLength?: (arg0: number) => string;
  9551. chunk?: Chunk | ChunkPathData;
  9552. module?: Module | ModulePathData;
  9553. runtime?: RuntimeSpec;
  9554. filename?: string;
  9555. basename?: string;
  9556. query?: string;
  9557. contentHashType?: string;
  9558. contentHash?: string;
  9559. contentHashWithLength?: (arg0: number) => string;
  9560. noChunkHash?: boolean;
  9561. url?: string;
  9562. }
  9563. type PathLikeFs = string | Buffer | URL;
  9564. type PathLikeTypes = string | Buffer | URL_url;
  9565. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  9566. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  9567. type Pattern =
  9568. | Identifier
  9569. | MemberExpression
  9570. | ObjectPattern
  9571. | ArrayPattern
  9572. | RestElement
  9573. | AssignmentPattern;
  9574. /**
  9575. * Configuration object for web performance recommendations.
  9576. */
  9577. declare interface PerformanceOptions {
  9578. /**
  9579. * Filter function to select assets that are checked.
  9580. */
  9581. assetFilter?: Function;
  9582. /**
  9583. * Sets the format of the hints: warnings, errors or nothing at all.
  9584. */
  9585. hints?: false | "error" | "warning";
  9586. /**
  9587. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  9588. */
  9589. maxAssetSize?: number;
  9590. /**
  9591. * Total size of an entry point (in bytes).
  9592. */
  9593. maxEntrypointSize?: number;
  9594. }
  9595. declare interface PitchLoaderDefinitionFunction<
  9596. OptionsType = {},
  9597. ContextAdditions = {}
  9598. > {
  9599. (
  9600. this: NormalModuleLoaderContext<OptionsType> &
  9601. LoaderRunnerLoaderContext<OptionsType> &
  9602. LoaderPluginLoaderContext &
  9603. HotModuleReplacementPluginLoaderContext &
  9604. ContextAdditions,
  9605. remainingRequest: string,
  9606. previousRequest: string,
  9607. data: object
  9608. ): string | void | Buffer | Promise<string | Buffer>;
  9609. }
  9610. declare class PlatformPlugin {
  9611. constructor(platform: Partial<PlatformTargetProperties>);
  9612. platform: Partial<PlatformTargetProperties>;
  9613. /**
  9614. * Apply the plugin
  9615. */
  9616. apply(compiler: Compiler): void;
  9617. }
  9618. declare interface PlatformTargetProperties {
  9619. /**
  9620. * web platform, importing of http(s) and std: is available
  9621. */
  9622. web: null | boolean;
  9623. /**
  9624. * browser platform, running in a normal web browser
  9625. */
  9626. browser: null | boolean;
  9627. /**
  9628. * (Web)Worker platform, running in a web/shared/service worker
  9629. */
  9630. webworker: null | boolean;
  9631. /**
  9632. * node platform, require of node built-in modules is available
  9633. */
  9634. node: null | boolean;
  9635. /**
  9636. * nwjs platform, require of legacy nw.gui is available
  9637. */
  9638. nwjs: null | boolean;
  9639. /**
  9640. * electron platform, require of some electron built-in modules is available
  9641. */
  9642. electron: null | boolean;
  9643. }
  9644. type Plugin =
  9645. | undefined
  9646. | null
  9647. | false
  9648. | ""
  9649. | 0
  9650. | { apply: (arg0: Resolver) => void }
  9651. | ((this: Resolver, arg1: Resolver) => void);
  9652. declare interface PnpApi {
  9653. resolveToUnqualified: (
  9654. arg0: string,
  9655. arg1: string,
  9656. arg2: object
  9657. ) => null | string;
  9658. }
  9659. declare class PrefetchPlugin {
  9660. constructor(context: string, request?: string);
  9661. context: null | string;
  9662. request: string;
  9663. /**
  9664. * Apply the plugin
  9665. */
  9666. apply(compiler: Compiler): void;
  9667. }
  9668. declare class PrefixSource extends Source {
  9669. constructor(prefix: string, source: string | Source);
  9670. original(): Source;
  9671. getPrefix(): string;
  9672. }
  9673. declare interface PreparsedAst {
  9674. [index: string]: any;
  9675. }
  9676. declare interface PrintedElement {
  9677. element: string;
  9678. content: string;
  9679. }
  9680. declare interface Problem {
  9681. type: ProblemType;
  9682. path: string;
  9683. argument: string;
  9684. value?: any;
  9685. index?: number;
  9686. expected?: string;
  9687. }
  9688. type ProblemType =
  9689. | "unknown-argument"
  9690. | "unexpected-non-array-in-path"
  9691. | "unexpected-non-object-in-path"
  9692. | "multiple-values-unexpected"
  9693. | "invalid-value";
  9694. declare interface ProcessAssetsAdditionalOptions {
  9695. additionalAssets?: true | Function;
  9696. }
  9697. declare class Profiler {
  9698. constructor(inspector?: any);
  9699. session: any;
  9700. inspector: any;
  9701. hasSession(): boolean;
  9702. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  9703. sendCommand(method: string, params?: object): Promise<any>;
  9704. destroy(): Promise<void>;
  9705. stopProfiling(): Promise<{ profile: any }>;
  9706. }
  9707. declare class ProfilingPlugin {
  9708. constructor(options?: ProfilingPluginOptions);
  9709. outputPath: string;
  9710. /**
  9711. * Apply the plugin
  9712. */
  9713. apply(compiler: Compiler): void;
  9714. static Profiler: typeof Profiler;
  9715. }
  9716. declare interface ProfilingPluginOptions {
  9717. /**
  9718. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  9719. */
  9720. outputPath?: string;
  9721. }
  9722. declare class ProgressPlugin {
  9723. constructor(options?: ProgressPluginArgument);
  9724. profile?: null | boolean;
  9725. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9726. modulesCount?: number;
  9727. dependenciesCount?: number;
  9728. showEntries?: boolean;
  9729. showModules?: boolean;
  9730. showDependencies?: boolean;
  9731. showActiveModules?: boolean;
  9732. percentBy?: null | "entries" | "modules" | "dependencies";
  9733. apply(compiler: Compiler | MultiCompiler): void;
  9734. static getReporter(
  9735. compiler: Compiler
  9736. ): undefined | ((p: number, ...args: string[]) => void);
  9737. static defaultOptions: {
  9738. profile: boolean;
  9739. modulesCount: number;
  9740. dependenciesCount: number;
  9741. modules: boolean;
  9742. dependencies: boolean;
  9743. activeModules: boolean;
  9744. entries: boolean;
  9745. };
  9746. static createDefaultHandler: (
  9747. profile: undefined | null | boolean,
  9748. logger: WebpackLogger
  9749. ) => (percentage: number, msg: string, ...args: string[]) => void;
  9750. }
  9751. type ProgressPluginArgument =
  9752. | ProgressPluginOptions
  9753. | ((percentage: number, msg: string, ...args: string[]) => void);
  9754. /**
  9755. * Options object for the ProgressPlugin.
  9756. */
  9757. declare interface ProgressPluginOptions {
  9758. /**
  9759. * Show active modules count and one active module in progress message.
  9760. */
  9761. activeModules?: boolean;
  9762. /**
  9763. * Show dependencies count in progress message.
  9764. */
  9765. dependencies?: boolean;
  9766. /**
  9767. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  9768. */
  9769. dependenciesCount?: number;
  9770. /**
  9771. * Show entries count in progress message.
  9772. */
  9773. entries?: boolean;
  9774. /**
  9775. * Function that executes for every progress step.
  9776. */
  9777. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9778. /**
  9779. * Show modules count in progress message.
  9780. */
  9781. modules?: boolean;
  9782. /**
  9783. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  9784. */
  9785. modulesCount?: number;
  9786. /**
  9787. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  9788. */
  9789. percentBy?: null | "entries" | "modules" | "dependencies";
  9790. /**
  9791. * Collect profile data for progress steps. Default: false.
  9792. */
  9793. profile?: null | boolean;
  9794. }
  9795. declare class ProvidePlugin {
  9796. constructor(definitions: Record<string, string | string[]>);
  9797. definitions: Record<string, string | string[]>;
  9798. /**
  9799. * Apply the plugin
  9800. */
  9801. apply(compiler: Compiler): void;
  9802. }
  9803. declare class ProvideSharedPlugin {
  9804. constructor(options: ProvideSharedPluginOptions);
  9805. /**
  9806. * Apply the plugin
  9807. */
  9808. apply(compiler: Compiler): void;
  9809. }
  9810. declare interface ProvideSharedPluginOptions {
  9811. /**
  9812. * 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.
  9813. */
  9814. provides: Provides;
  9815. /**
  9816. * Share scope name used for all provided modules (defaults to 'default').
  9817. */
  9818. shareScope?: string;
  9819. }
  9820. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  9821. /**
  9822. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  9823. */
  9824. declare interface ProvidesConfig {
  9825. /**
  9826. * 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.
  9827. */
  9828. eager?: boolean;
  9829. /**
  9830. * Key in the share scope under which the shared modules should be stored.
  9831. */
  9832. shareKey?: string;
  9833. /**
  9834. * Share scope name.
  9835. */
  9836. shareScope?: string;
  9837. /**
  9838. * Version of the provided module. Will replace lower matching versions, but not higher.
  9839. */
  9840. version?: string | false;
  9841. }
  9842. /**
  9843. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  9844. */
  9845. declare interface ProvidesObject {
  9846. [index: string]: string | ProvidesConfig;
  9847. }
  9848. declare interface RawChunkGroupOptions {
  9849. preloadOrder?: number;
  9850. prefetchOrder?: number;
  9851. fetchPriority?: "auto" | "low" | "high";
  9852. }
  9853. type RawLoaderDefinition<
  9854. OptionsType = {},
  9855. ContextAdditions = {}
  9856. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  9857. raw: true;
  9858. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9859. };
  9860. declare interface RawLoaderDefinitionFunction<
  9861. OptionsType = {},
  9862. ContextAdditions = {}
  9863. > {
  9864. (
  9865. this: NormalModuleLoaderContext<OptionsType> &
  9866. LoaderRunnerLoaderContext<OptionsType> &
  9867. LoaderPluginLoaderContext &
  9868. HotModuleReplacementPluginLoaderContext &
  9869. ContextAdditions,
  9870. content: Buffer,
  9871. sourceMap?: string | SourceMap,
  9872. additionalData?: AdditionalData
  9873. ): string | void | Buffer | Promise<string | Buffer>;
  9874. }
  9875. declare class RawSource extends Source {
  9876. constructor(source: string | Buffer, convertToString?: boolean);
  9877. isBuffer(): boolean;
  9878. }
  9879. declare interface RawSourceMap {
  9880. version: number;
  9881. sources: string[];
  9882. names: string[];
  9883. sourceRoot?: string;
  9884. sourcesContent?: string[];
  9885. mappings: string;
  9886. file: string;
  9887. }
  9888. declare interface Read<TBuffer extends ArrayBufferView = Buffer> {
  9889. (
  9890. fd: number,
  9891. buffer: TBuffer,
  9892. offset: number,
  9893. length: number,
  9894. position: null | number | bigint,
  9895. callback: (
  9896. err: null | NodeJS.ErrnoException,
  9897. bytesRead: number,
  9898. buffer: TBuffer
  9899. ) => void
  9900. ): void;
  9901. (
  9902. fd: number,
  9903. options: ReadAsyncOptions<TBuffer>,
  9904. callback: (
  9905. err: null | NodeJS.ErrnoException,
  9906. bytesRead: number,
  9907. buffer: TBuffer
  9908. ) => void
  9909. ): void;
  9910. (
  9911. fd: number,
  9912. callback: (
  9913. err: null | NodeJS.ErrnoException,
  9914. bytesRead: number,
  9915. buffer: ArrayBufferView
  9916. ) => void
  9917. ): void;
  9918. }
  9919. declare interface ReadAsyncOptions<TBuffer extends ArrayBufferView> {
  9920. offset?: number;
  9921. length?: number;
  9922. position?: null | number | bigint;
  9923. buffer?: TBuffer;
  9924. }
  9925. declare class ReadFileCompileWasmPlugin {
  9926. constructor(options?: ReadFileCompileWasmPluginOptions);
  9927. options: ReadFileCompileWasmPluginOptions;
  9928. /**
  9929. * Apply the plugin
  9930. */
  9931. apply(compiler: Compiler): void;
  9932. }
  9933. declare interface ReadFileCompileWasmPluginOptions {
  9934. /**
  9935. * mangle imports
  9936. */
  9937. mangleImports?: boolean;
  9938. }
  9939. declare interface ReadFileFs {
  9940. (
  9941. path: PathOrFileDescriptorFs,
  9942. options:
  9943. | undefined
  9944. | null
  9945. | ({ encoding?: null; flag?: string } & Abortable),
  9946. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  9947. ): void;
  9948. (
  9949. path: PathOrFileDescriptorFs,
  9950. options:
  9951. | "ascii"
  9952. | "utf8"
  9953. | "utf-8"
  9954. | "utf16le"
  9955. | "utf-16le"
  9956. | "ucs2"
  9957. | "ucs-2"
  9958. | "latin1"
  9959. | "binary"
  9960. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  9961. | "base64"
  9962. | "base64url"
  9963. | "hex",
  9964. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  9965. ): void;
  9966. (
  9967. path: PathOrFileDescriptorFs,
  9968. options:
  9969. | undefined
  9970. | null
  9971. | "ascii"
  9972. | "utf8"
  9973. | "utf-8"
  9974. | "utf16le"
  9975. | "utf-16le"
  9976. | "ucs2"
  9977. | "ucs-2"
  9978. | "latin1"
  9979. | "binary"
  9980. | "base64"
  9981. | "base64url"
  9982. | "hex"
  9983. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  9984. callback: (
  9985. arg0: null | NodeJS.ErrnoException,
  9986. arg1?: string | Buffer
  9987. ) => void
  9988. ): void;
  9989. (
  9990. path: PathOrFileDescriptorFs,
  9991. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  9992. ): void;
  9993. }
  9994. declare interface ReadFileSync {
  9995. (
  9996. path: PathOrFileDescriptorFs,
  9997. options?: null | { encoding?: null; flag?: string }
  9998. ): Buffer;
  9999. (
  10000. path: PathOrFileDescriptorFs,
  10001. options:
  10002. | "ascii"
  10003. | "utf8"
  10004. | "utf-8"
  10005. | "utf16le"
  10006. | "utf-16le"
  10007. | "ucs2"
  10008. | "ucs-2"
  10009. | "latin1"
  10010. | "binary"
  10011. | "base64"
  10012. | "base64url"
  10013. | "hex"
  10014. | { encoding: BufferEncoding; flag?: string }
  10015. ): string;
  10016. (
  10017. path: PathOrFileDescriptorFs,
  10018. options?:
  10019. | null
  10020. | "ascii"
  10021. | "utf8"
  10022. | "utf-8"
  10023. | "utf16le"
  10024. | "utf-16le"
  10025. | "ucs2"
  10026. | "ucs-2"
  10027. | "latin1"
  10028. | "binary"
  10029. | "base64"
  10030. | "base64url"
  10031. | "hex"
  10032. | (ObjectEncodingOptions & { flag?: string })
  10033. ): string | Buffer;
  10034. }
  10035. declare interface ReadFileTypes {
  10036. (
  10037. path: PathOrFileDescriptorTypes,
  10038. options:
  10039. | undefined
  10040. | null
  10041. | ({ encoding?: null; flag?: string } & Abortable),
  10042. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10043. ): void;
  10044. (
  10045. path: PathOrFileDescriptorTypes,
  10046. options:
  10047. | "ascii"
  10048. | "utf8"
  10049. | "utf-8"
  10050. | "utf16le"
  10051. | "utf-16le"
  10052. | "ucs2"
  10053. | "ucs-2"
  10054. | "latin1"
  10055. | "binary"
  10056. | "base64"
  10057. | "base64url"
  10058. | "hex"
  10059. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  10060. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10061. ): void;
  10062. (
  10063. path: PathOrFileDescriptorTypes,
  10064. options:
  10065. | undefined
  10066. | null
  10067. | "ascii"
  10068. | "utf8"
  10069. | "utf-8"
  10070. | "utf16le"
  10071. | "utf-16le"
  10072. | "ucs2"
  10073. | "ucs-2"
  10074. | "latin1"
  10075. | "binary"
  10076. | "base64"
  10077. | "base64url"
  10078. | "hex"
  10079. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  10080. callback: (
  10081. arg0: null | NodeJS.ErrnoException,
  10082. arg1?: string | Buffer
  10083. ) => void
  10084. ): void;
  10085. (
  10086. path: PathOrFileDescriptorTypes,
  10087. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10088. ): void;
  10089. }
  10090. declare interface ReaddirFs {
  10091. (
  10092. path: PathLikeFs,
  10093. options:
  10094. | undefined
  10095. | null
  10096. | "ascii"
  10097. | "utf8"
  10098. | "utf-8"
  10099. | "utf16le"
  10100. | "utf-16le"
  10101. | "ucs2"
  10102. | "ucs-2"
  10103. | "latin1"
  10104. | "binary"
  10105. | "base64"
  10106. | "base64url"
  10107. | "hex"
  10108. | {
  10109. encoding:
  10110. | null
  10111. | "ascii"
  10112. | "utf8"
  10113. | "utf-8"
  10114. | "utf16le"
  10115. | "utf-16le"
  10116. | "ucs2"
  10117. | "ucs-2"
  10118. | "latin1"
  10119. | "binary"
  10120. | "base64"
  10121. | "base64url"
  10122. | "hex";
  10123. withFileTypes?: false;
  10124. recursive?: boolean;
  10125. },
  10126. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10127. ): void;
  10128. (
  10129. path: PathLikeFs,
  10130. options:
  10131. | "buffer"
  10132. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  10133. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  10134. ): void;
  10135. (
  10136. path: PathLikeFs,
  10137. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10138. ): void;
  10139. (
  10140. path: PathLikeFs,
  10141. options:
  10142. | undefined
  10143. | null
  10144. | "ascii"
  10145. | "utf8"
  10146. | "utf-8"
  10147. | "utf16le"
  10148. | "utf-16le"
  10149. | "ucs2"
  10150. | "ucs-2"
  10151. | "latin1"
  10152. | "binary"
  10153. | "base64"
  10154. | "base64url"
  10155. | "hex"
  10156. | (ObjectEncodingOptions & {
  10157. withFileTypes?: false;
  10158. recursive?: boolean;
  10159. }),
  10160. callback: (
  10161. arg0: null | NodeJS.ErrnoException,
  10162. arg1?: string[] | Buffer[]
  10163. ) => void
  10164. ): void;
  10165. (
  10166. path: PathLikeFs,
  10167. options: ObjectEncodingOptions & {
  10168. withFileTypes: true;
  10169. recursive?: boolean;
  10170. },
  10171. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  10172. ): void;
  10173. }
  10174. declare interface ReaddirSync {
  10175. (
  10176. path: PathLikeFs,
  10177. options?:
  10178. | null
  10179. | "ascii"
  10180. | "utf8"
  10181. | "utf-8"
  10182. | "utf16le"
  10183. | "utf-16le"
  10184. | "ucs2"
  10185. | "ucs-2"
  10186. | "latin1"
  10187. | "binary"
  10188. | "base64"
  10189. | "base64url"
  10190. | "hex"
  10191. | {
  10192. encoding:
  10193. | null
  10194. | "ascii"
  10195. | "utf8"
  10196. | "utf-8"
  10197. | "utf16le"
  10198. | "utf-16le"
  10199. | "ucs2"
  10200. | "ucs-2"
  10201. | "latin1"
  10202. | "binary"
  10203. | "base64"
  10204. | "base64url"
  10205. | "hex";
  10206. withFileTypes?: false;
  10207. recursive?: boolean;
  10208. }
  10209. ): string[];
  10210. (
  10211. path: PathLikeFs,
  10212. options:
  10213. | "buffer"
  10214. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  10215. ): Buffer[];
  10216. (
  10217. path: PathLikeFs,
  10218. options?:
  10219. | null
  10220. | "ascii"
  10221. | "utf8"
  10222. | "utf-8"
  10223. | "utf16le"
  10224. | "utf-16le"
  10225. | "ucs2"
  10226. | "ucs-2"
  10227. | "latin1"
  10228. | "binary"
  10229. | "base64"
  10230. | "base64url"
  10231. | "hex"
  10232. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  10233. ): string[] | Buffer[];
  10234. (
  10235. path: PathLikeFs,
  10236. options: ObjectEncodingOptions & {
  10237. withFileTypes: true;
  10238. recursive?: boolean;
  10239. }
  10240. ): Dirent[];
  10241. }
  10242. declare interface ReaddirTypes {
  10243. (
  10244. path: PathLikeTypes,
  10245. options:
  10246. | undefined
  10247. | null
  10248. | "ascii"
  10249. | "utf8"
  10250. | "utf-8"
  10251. | "utf16le"
  10252. | "utf-16le"
  10253. | "ucs2"
  10254. | "ucs-2"
  10255. | "latin1"
  10256. | "binary"
  10257. | "base64"
  10258. | "base64url"
  10259. | "hex"
  10260. | {
  10261. encoding:
  10262. | null
  10263. | "ascii"
  10264. | "utf8"
  10265. | "utf-8"
  10266. | "utf16le"
  10267. | "utf-16le"
  10268. | "ucs2"
  10269. | "ucs-2"
  10270. | "latin1"
  10271. | "binary"
  10272. | "base64"
  10273. | "base64url"
  10274. | "hex";
  10275. withFileTypes?: false;
  10276. recursive?: boolean;
  10277. },
  10278. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10279. ): void;
  10280. (
  10281. path: PathLikeTypes,
  10282. options:
  10283. | "buffer"
  10284. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  10285. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  10286. ): void;
  10287. (
  10288. path: PathLikeTypes,
  10289. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10290. ): void;
  10291. (
  10292. path: PathLikeTypes,
  10293. options:
  10294. | undefined
  10295. | null
  10296. | "ascii"
  10297. | "utf8"
  10298. | "utf-8"
  10299. | "utf16le"
  10300. | "utf-16le"
  10301. | "ucs2"
  10302. | "ucs-2"
  10303. | "latin1"
  10304. | "binary"
  10305. | "base64"
  10306. | "base64url"
  10307. | "hex"
  10308. | (ObjectEncodingOptions & {
  10309. withFileTypes?: false;
  10310. recursive?: boolean;
  10311. }),
  10312. callback: (
  10313. arg0: null | NodeJS.ErrnoException,
  10314. arg1?: string[] | Buffer[]
  10315. ) => void
  10316. ): void;
  10317. (
  10318. path: PathLikeTypes,
  10319. options: ObjectEncodingOptions & {
  10320. withFileTypes: true;
  10321. recursive?: boolean;
  10322. },
  10323. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  10324. ): void;
  10325. }
  10326. declare interface ReadlinkFs {
  10327. (
  10328. path: PathLikeFs,
  10329. options: EncodingOption,
  10330. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10331. ): void;
  10332. (
  10333. path: PathLikeFs,
  10334. options: BufferEncodingOption,
  10335. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10336. ): void;
  10337. (
  10338. path: PathLikeFs,
  10339. options: EncodingOption,
  10340. callback: (
  10341. arg0: null | NodeJS.ErrnoException,
  10342. arg1?: string | Buffer
  10343. ) => void
  10344. ): void;
  10345. (
  10346. path: PathLikeFs,
  10347. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10348. ): void;
  10349. }
  10350. declare interface ReadlinkSync {
  10351. (path: PathLikeFs, options?: EncodingOption): string;
  10352. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  10353. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  10354. }
  10355. declare interface ReadlinkTypes {
  10356. (
  10357. path: PathLikeTypes,
  10358. options: EncodingOption,
  10359. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10360. ): void;
  10361. (
  10362. path: PathLikeTypes,
  10363. options: BufferEncodingOption,
  10364. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10365. ): void;
  10366. (
  10367. path: PathLikeTypes,
  10368. options: EncodingOption,
  10369. callback: (
  10370. arg0: null | NodeJS.ErrnoException,
  10371. arg1?: string | Buffer
  10372. ) => void
  10373. ): void;
  10374. (
  10375. path: PathLikeTypes,
  10376. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10377. ): void;
  10378. }
  10379. declare class RealContentHashPlugin {
  10380. constructor(__0: {
  10381. /**
  10382. * the hash function to use
  10383. */
  10384. hashFunction: string | typeof Hash;
  10385. /**
  10386. * the hash digest to use
  10387. */
  10388. hashDigest: string;
  10389. });
  10390. /**
  10391. * Apply the plugin
  10392. */
  10393. apply(compiler: Compiler): void;
  10394. static getCompilationHooks(
  10395. compilation: Compilation
  10396. ): CompilationHooksRealContentHashPlugin;
  10397. }
  10398. declare interface RealDependencyLocation {
  10399. start: SourcePosition;
  10400. end?: SourcePosition;
  10401. index?: number;
  10402. }
  10403. declare interface RealPathFs {
  10404. (
  10405. path: PathLikeFs,
  10406. options: EncodingOption,
  10407. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10408. ): void;
  10409. (
  10410. path: PathLikeFs,
  10411. options: BufferEncodingOption,
  10412. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10413. ): void;
  10414. (
  10415. path: PathLikeFs,
  10416. options: EncodingOption,
  10417. callback: (
  10418. arg0: null | NodeJS.ErrnoException,
  10419. arg1?: string | Buffer
  10420. ) => void
  10421. ): void;
  10422. (
  10423. path: PathLikeFs,
  10424. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10425. ): void;
  10426. }
  10427. declare interface RealPathSync {
  10428. (path: PathLikeFs, options?: EncodingOption): string;
  10429. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  10430. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  10431. }
  10432. declare interface RealPathTypes {
  10433. (
  10434. path: PathLikeTypes,
  10435. options: EncodingOption,
  10436. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10437. ): void;
  10438. (
  10439. path: PathLikeTypes,
  10440. options: BufferEncodingOption,
  10441. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10442. ): void;
  10443. (
  10444. path: PathLikeTypes,
  10445. options: EncodingOption,
  10446. callback: (
  10447. arg0: null | NodeJS.ErrnoException,
  10448. arg1?: string | Buffer
  10449. ) => void
  10450. ): void;
  10451. (
  10452. path: PathLikeTypes,
  10453. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10454. ): void;
  10455. }
  10456. type RecursiveArrayOrRecord<T> =
  10457. | { [index: string]: RecursiveArrayOrRecord<T> }
  10458. | RecursiveArrayOrRecord<T>[]
  10459. | T;
  10460. declare interface ReferencedExport {
  10461. /**
  10462. * name of the referenced export
  10463. */
  10464. name: string[];
  10465. /**
  10466. * when false, referenced export can not be mangled, defaults to true
  10467. */
  10468. canMangle?: boolean;
  10469. }
  10470. type Remotes = (string | RemotesObject)[] | RemotesObject;
  10471. /**
  10472. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  10473. */
  10474. declare interface RemotesConfig {
  10475. /**
  10476. * Container locations from which modules should be resolved and loaded at runtime.
  10477. */
  10478. external: string | string[];
  10479. /**
  10480. * The name of the share scope shared with this remote.
  10481. */
  10482. shareScope?: string;
  10483. }
  10484. /**
  10485. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  10486. */
  10487. declare interface RemotesObject {
  10488. [index: string]: string | RemotesConfig | string[];
  10489. }
  10490. declare interface RenderBootstrapContext {
  10491. /**
  10492. * the chunk
  10493. */
  10494. chunk: Chunk;
  10495. /**
  10496. * results of code generation
  10497. */
  10498. codeGenerationResults: CodeGenerationResults;
  10499. /**
  10500. * the runtime template
  10501. */
  10502. runtimeTemplate: RuntimeTemplate;
  10503. /**
  10504. * the module graph
  10505. */
  10506. moduleGraph: ModuleGraph;
  10507. /**
  10508. * the chunk graph
  10509. */
  10510. chunkGraph: ChunkGraph;
  10511. /**
  10512. * hash to be used for render call
  10513. */
  10514. hash: string;
  10515. }
  10516. declare interface RenderContext {
  10517. /**
  10518. * the chunk
  10519. */
  10520. chunk: Chunk;
  10521. /**
  10522. * the dependency templates
  10523. */
  10524. dependencyTemplates: DependencyTemplates;
  10525. /**
  10526. * the runtime template
  10527. */
  10528. runtimeTemplate: RuntimeTemplate;
  10529. /**
  10530. * the module graph
  10531. */
  10532. moduleGraph: ModuleGraph;
  10533. /**
  10534. * the chunk graph
  10535. */
  10536. chunkGraph: ChunkGraph;
  10537. /**
  10538. * results of code generation
  10539. */
  10540. codeGenerationResults: CodeGenerationResults;
  10541. /**
  10542. * rendering in strict context
  10543. */
  10544. strictMode: boolean;
  10545. }
  10546. type RenderManifestEntry =
  10547. | RenderManifestEntryTemplated
  10548. | RenderManifestEntryStatic;
  10549. declare interface RenderManifestEntryStatic {
  10550. render: () => Source;
  10551. filename: string;
  10552. info: AssetInfo;
  10553. identifier: string;
  10554. hash?: string;
  10555. auxiliary?: boolean;
  10556. }
  10557. declare interface RenderManifestEntryTemplated {
  10558. render: () => Source;
  10559. filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  10560. pathOptions?: PathData;
  10561. info?: AssetInfo;
  10562. identifier: string;
  10563. hash?: string;
  10564. auxiliary?: boolean;
  10565. }
  10566. declare interface RenderManifestOptions {
  10567. /**
  10568. * the chunk used to render
  10569. */
  10570. chunk: Chunk;
  10571. hash: string;
  10572. fullHash: string;
  10573. outputOptions: Output;
  10574. codeGenerationResults: CodeGenerationResults;
  10575. moduleTemplates: { javascript: ModuleTemplate };
  10576. dependencyTemplates: DependencyTemplates;
  10577. runtimeTemplate: RuntimeTemplate;
  10578. moduleGraph: ModuleGraph;
  10579. chunkGraph: ChunkGraph;
  10580. }
  10581. declare class ReplaceSource extends Source {
  10582. constructor(source: Source, name?: string);
  10583. replace(start: number, end: number, newValue: string, name?: string): void;
  10584. insert(pos: number, newValue: string, name?: string): void;
  10585. getName(): string;
  10586. original(): string;
  10587. getReplacements(): {
  10588. start: number;
  10589. end: number;
  10590. content: string;
  10591. insertIndex: number;
  10592. name: string;
  10593. }[];
  10594. }
  10595. declare interface RequestRecord {
  10596. [index: string]: string | string[];
  10597. }
  10598. declare abstract class RequestShortener {
  10599. contextify: (arg0: string) => string;
  10600. shorten(request?: null | string): undefined | null | string;
  10601. }
  10602. declare interface ResolveBuildDependenciesResult {
  10603. /**
  10604. * list of files
  10605. */
  10606. files: Set<string>;
  10607. /**
  10608. * list of directories
  10609. */
  10610. directories: Set<string>;
  10611. /**
  10612. * list of missing entries
  10613. */
  10614. missing: Set<string>;
  10615. /**
  10616. * stored resolve results
  10617. */
  10618. resolveResults: Map<string, string | false>;
  10619. /**
  10620. * dependencies of the resolving
  10621. */
  10622. resolveDependencies: {
  10623. /**
  10624. * list of files
  10625. */
  10626. files: Set<string>;
  10627. /**
  10628. * list of directories
  10629. */
  10630. directories: Set<string>;
  10631. /**
  10632. * list of missing entries
  10633. */
  10634. missing: Set<string>;
  10635. };
  10636. }
  10637. declare interface ResolveContext {
  10638. contextDependencies?: WriteOnlySet<string>;
  10639. /**
  10640. * files that was found on file system
  10641. */
  10642. fileDependencies?: WriteOnlySet<string>;
  10643. /**
  10644. * dependencies that was not found on file system
  10645. */
  10646. missingDependencies?: WriteOnlySet<string>;
  10647. /**
  10648. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  10649. */
  10650. stack?: Set<string>;
  10651. /**
  10652. * log function
  10653. */
  10654. log?: (arg0: string) => void;
  10655. /**
  10656. * yield result, if provided plugins can return several results
  10657. */
  10658. yield?: (arg0: ResolveRequest) => void;
  10659. }
  10660. declare interface ResolveData {
  10661. contextInfo: ModuleFactoryCreateDataContextInfo;
  10662. resolveOptions?: ResolveOptions;
  10663. context: string;
  10664. request: string;
  10665. assertions?: Record<string, any>;
  10666. dependencies: ModuleDependency[];
  10667. dependencyType: string;
  10668. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  10669. fileDependencies: LazySet<string>;
  10670. missingDependencies: LazySet<string>;
  10671. contextDependencies: LazySet<string>;
  10672. /**
  10673. * allow to use the unsafe cache
  10674. */
  10675. cacheable: boolean;
  10676. }
  10677. /**
  10678. * Options object for resolving requests.
  10679. */
  10680. declare interface ResolveOptions {
  10681. /**
  10682. * Redirect module requests.
  10683. */
  10684. alias?:
  10685. | {
  10686. /**
  10687. * New request.
  10688. */
  10689. alias: string | false | string[];
  10690. /**
  10691. * Request to be redirected.
  10692. */
  10693. name: string;
  10694. /**
  10695. * Redirect only exact matching request.
  10696. */
  10697. onlyModule?: boolean;
  10698. }[]
  10699. | { [index: string]: string | false | string[] };
  10700. /**
  10701. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  10702. */
  10703. aliasFields?: (string | string[])[];
  10704. /**
  10705. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  10706. */
  10707. byDependency?: { [index: string]: ResolveOptions };
  10708. /**
  10709. * Enable caching of successfully resolved requests (cache entries are revalidated).
  10710. */
  10711. cache?: boolean;
  10712. /**
  10713. * Predicate function to decide which requests should be cached.
  10714. */
  10715. cachePredicate?: (request: ResolveRequest) => boolean;
  10716. /**
  10717. * Include the context information in the cache identifier when caching.
  10718. */
  10719. cacheWithContext?: boolean;
  10720. /**
  10721. * Condition names for exports field entry point.
  10722. */
  10723. conditionNames?: string[];
  10724. /**
  10725. * Filenames used to find a description file (like a package.json).
  10726. */
  10727. descriptionFiles?: string[];
  10728. /**
  10729. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  10730. */
  10731. enforceExtension?: boolean;
  10732. /**
  10733. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  10734. */
  10735. exportsFields?: string[];
  10736. /**
  10737. * An object which maps extension to extension aliases.
  10738. */
  10739. extensionAlias?: { [index: string]: string | string[] };
  10740. /**
  10741. * Extensions added to the request when trying to find the file.
  10742. */
  10743. extensions?: string[];
  10744. /**
  10745. * Redirect module requests when normal resolving fails.
  10746. */
  10747. fallback?:
  10748. | {
  10749. /**
  10750. * New request.
  10751. */
  10752. alias: string | false | string[];
  10753. /**
  10754. * Request to be redirected.
  10755. */
  10756. name: string;
  10757. /**
  10758. * Redirect only exact matching request.
  10759. */
  10760. onlyModule?: boolean;
  10761. }[]
  10762. | { [index: string]: string | false | string[] };
  10763. /**
  10764. * Filesystem for the resolver.
  10765. */
  10766. fileSystem?: InputFileSystem;
  10767. /**
  10768. * 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).
  10769. */
  10770. fullySpecified?: boolean;
  10771. /**
  10772. * 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).
  10773. */
  10774. importsFields?: string[];
  10775. /**
  10776. * Field names from the description file (package.json) which are used to find the default entry point.
  10777. */
  10778. mainFields?: (string | string[])[];
  10779. /**
  10780. * Filenames used to find the default entry point if there is no description file or main field.
  10781. */
  10782. mainFiles?: string[];
  10783. /**
  10784. * Folder names or directory paths where to find modules.
  10785. */
  10786. modules?: string[];
  10787. /**
  10788. * Plugins for the resolver.
  10789. */
  10790. plugins?: (
  10791. | undefined
  10792. | null
  10793. | false
  10794. | ""
  10795. | 0
  10796. | {
  10797. [index: string]: any;
  10798. /**
  10799. * The run point of the plugin, required method.
  10800. */
  10801. apply: (arg0: Resolver) => void;
  10802. }
  10803. | ((this: Resolver, arg1: Resolver) => void)
  10804. | "..."
  10805. )[];
  10806. /**
  10807. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  10808. */
  10809. preferAbsolute?: boolean;
  10810. /**
  10811. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  10812. */
  10813. preferRelative?: boolean;
  10814. /**
  10815. * Custom resolver.
  10816. */
  10817. resolver?: Resolver;
  10818. /**
  10819. * 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.
  10820. */
  10821. restrictions?: (string | RegExp)[];
  10822. /**
  10823. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  10824. */
  10825. roots?: string[];
  10826. /**
  10827. * Enable resolving symlinks to the original location.
  10828. */
  10829. symlinks?: boolean;
  10830. /**
  10831. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  10832. */
  10833. unsafeCache?: boolean | { [index: string]: any };
  10834. /**
  10835. * Use synchronous filesystem calls for the resolver.
  10836. */
  10837. useSyncFileSystemCalls?: boolean;
  10838. }
  10839. declare interface ResolveOptionsResolverFactoryObject1 {
  10840. alias: AliasOption[];
  10841. fallback: AliasOption[];
  10842. aliasFields: Set<string | string[]>;
  10843. extensionAlias: ExtensionAliasOption[];
  10844. cachePredicate: (arg0: ResolveRequest) => boolean;
  10845. cacheWithContext: boolean;
  10846. /**
  10847. * A list of exports field condition names.
  10848. */
  10849. conditionNames: Set<string>;
  10850. descriptionFiles: string[];
  10851. enforceExtension: boolean;
  10852. exportsFields: Set<string | string[]>;
  10853. importsFields: Set<string | string[]>;
  10854. extensions: Set<string>;
  10855. fileSystem: FileSystem;
  10856. unsafeCache: false | object;
  10857. symlinks: boolean;
  10858. resolver?: Resolver;
  10859. modules: (string | string[])[];
  10860. mainFields: { name: string[]; forceRelative: boolean }[];
  10861. mainFiles: Set<string>;
  10862. plugins: Plugin[];
  10863. pnpApi: null | PnpApi;
  10864. roots: Set<string>;
  10865. fullySpecified: boolean;
  10866. resolveToContext: boolean;
  10867. restrictions: Set<string | RegExp>;
  10868. preferRelative: boolean;
  10869. preferAbsolute: boolean;
  10870. }
  10871. declare interface ResolveOptionsResolverFactoryObject2 {
  10872. /**
  10873. * A list of module alias configurations or an object which maps key to value
  10874. */
  10875. alias?: AliasOption[] | AliasOptions;
  10876. /**
  10877. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  10878. */
  10879. fallback?: AliasOption[] | AliasOptions;
  10880. /**
  10881. * An object which maps extension to extension aliases
  10882. */
  10883. extensionAlias?: ExtensionAliasOptions;
  10884. /**
  10885. * A list of alias fields in description files
  10886. */
  10887. aliasFields?: (string | string[])[];
  10888. /**
  10889. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  10890. */
  10891. cachePredicate?: (arg0: ResolveRequest) => boolean;
  10892. /**
  10893. * Whether or not the unsafeCache should include request context as part of the cache key.
  10894. */
  10895. cacheWithContext?: boolean;
  10896. /**
  10897. * A list of description files to read from
  10898. */
  10899. descriptionFiles?: string[];
  10900. /**
  10901. * A list of exports field condition names.
  10902. */
  10903. conditionNames?: string[];
  10904. /**
  10905. * Enforce that a extension from extensions must be used
  10906. */
  10907. enforceExtension?: boolean;
  10908. /**
  10909. * A list of exports fields in description files
  10910. */
  10911. exportsFields?: (string | string[])[];
  10912. /**
  10913. * A list of imports fields in description files
  10914. */
  10915. importsFields?: (string | string[])[];
  10916. /**
  10917. * A list of extensions which should be tried for files
  10918. */
  10919. extensions?: string[];
  10920. /**
  10921. * The file system which should be used
  10922. */
  10923. fileSystem: FileSystem;
  10924. /**
  10925. * Use this cache object to unsafely cache the successful requests
  10926. */
  10927. unsafeCache?: boolean | object;
  10928. /**
  10929. * Resolve symlinks to their symlinked location
  10930. */
  10931. symlinks?: boolean;
  10932. /**
  10933. * A prepared Resolver to which the plugins are attached
  10934. */
  10935. resolver?: Resolver;
  10936. /**
  10937. * A list of directories to resolve modules from, can be absolute path or folder name
  10938. */
  10939. modules?: string | string[];
  10940. /**
  10941. * A list of main fields in description files
  10942. */
  10943. mainFields?: (
  10944. | string
  10945. | string[]
  10946. | { name: string | string[]; forceRelative: boolean }
  10947. )[];
  10948. /**
  10949. * A list of main files in directories
  10950. */
  10951. mainFiles?: string[];
  10952. /**
  10953. * A list of additional resolve plugins which should be applied
  10954. */
  10955. plugins?: Plugin[];
  10956. /**
  10957. * A PnP API that should be used - null is "never", undefined is "auto"
  10958. */
  10959. pnpApi?: null | PnpApi;
  10960. /**
  10961. * A list of root paths
  10962. */
  10963. roots?: string[];
  10964. /**
  10965. * The request is already fully specified and no extensions or directories are resolved for it
  10966. */
  10967. fullySpecified?: boolean;
  10968. /**
  10969. * Resolve to a context instead of a file
  10970. */
  10971. resolveToContext?: boolean;
  10972. /**
  10973. * A list of resolve restrictions
  10974. */
  10975. restrictions?: (string | RegExp)[];
  10976. /**
  10977. * Use only the sync constraints of the file system calls
  10978. */
  10979. useSyncFileSystemCalls?: boolean;
  10980. /**
  10981. * Prefer to resolve module requests as relative requests before falling back to modules
  10982. */
  10983. preferRelative?: boolean;
  10984. /**
  10985. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  10986. */
  10987. preferAbsolute?: boolean;
  10988. }
  10989. type ResolveOptionsWithDependencyType = ResolveOptions & {
  10990. dependencyType?: string;
  10991. resolveToContext?: boolean;
  10992. };
  10993. type ResolvePluginInstance =
  10994. | {
  10995. [index: string]: any;
  10996. /**
  10997. * The run point of the plugin, required method.
  10998. */
  10999. apply: (arg0: Resolver) => void;
  11000. }
  11001. | ((this: Resolver, arg1: Resolver) => void);
  11002. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  11003. declare interface ResolvedContextFileSystemInfoEntry {
  11004. safeTime: number;
  11005. timestampHash?: string;
  11006. }
  11007. declare interface ResolvedContextTimestampAndHash {
  11008. safeTime: number;
  11009. timestampHash?: string;
  11010. hash: string;
  11011. }
  11012. declare interface ResolvedOptions {
  11013. /**
  11014. * - platform target properties
  11015. */
  11016. platform: false | PlatformTargetProperties;
  11017. }
  11018. declare abstract class Resolver {
  11019. fileSystem: FileSystem;
  11020. options: ResolveOptionsResolverFactoryObject1;
  11021. hooks: KnownHooks;
  11022. ensureHook(
  11023. name:
  11024. | string
  11025. | AsyncSeriesBailHook<
  11026. [ResolveRequest, ResolveContext],
  11027. null | ResolveRequest
  11028. >
  11029. ): AsyncSeriesBailHook<
  11030. [ResolveRequest, ResolveContext],
  11031. null | ResolveRequest
  11032. >;
  11033. getHook(
  11034. name:
  11035. | string
  11036. | AsyncSeriesBailHook<
  11037. [ResolveRequest, ResolveContext],
  11038. null | ResolveRequest
  11039. >
  11040. ): AsyncSeriesBailHook<
  11041. [ResolveRequest, ResolveContext],
  11042. null | ResolveRequest
  11043. >;
  11044. resolveSync(context: object, path: string, request: string): string | false;
  11045. resolve(
  11046. context: object,
  11047. path: string,
  11048. request: string,
  11049. resolveContext: ResolveContext,
  11050. callback: (
  11051. err: null | ErrorWithDetail,
  11052. res?: string | false,
  11053. req?: ResolveRequest
  11054. ) => void
  11055. ): void;
  11056. doResolve(
  11057. hook: AsyncSeriesBailHook<
  11058. [ResolveRequest, ResolveContext],
  11059. null | ResolveRequest
  11060. >,
  11061. request: ResolveRequest,
  11062. message: null | string,
  11063. resolveContext: ResolveContext,
  11064. callback: (err?: null | Error, result?: ResolveRequest) => void
  11065. ): void;
  11066. parse(identifier: string): ParsedIdentifier;
  11067. isModule(path: string): boolean;
  11068. isPrivate(path: string): boolean;
  11069. isDirectory(path: string): boolean;
  11070. join(path: string, request: string): string;
  11071. normalize(path: string): string;
  11072. }
  11073. declare interface ResolverCache {
  11074. direct: WeakMap<object, ResolverWithOptions>;
  11075. stringified: Map<string, ResolverWithOptions>;
  11076. }
  11077. declare abstract class ResolverFactory {
  11078. hooks: Readonly<{
  11079. resolveOptions: HookMap<
  11080. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  11081. >;
  11082. resolver: HookMap<
  11083. SyncHook<
  11084. [
  11085. Resolver,
  11086. ResolveOptionsResolverFactoryObject2,
  11087. ResolveOptionsWithDependencyType
  11088. ]
  11089. >
  11090. >;
  11091. }>;
  11092. cache: Map<string, ResolverCache>;
  11093. get(
  11094. type: string,
  11095. resolveOptions?: ResolveOptionsWithDependencyType
  11096. ): ResolverWithOptions;
  11097. }
  11098. type ResolverWithOptions = Resolver & WithOptions;
  11099. declare interface ResourceDataWithData {
  11100. resource: string;
  11101. path?: string;
  11102. query?: string;
  11103. fragment?: string;
  11104. context?: string;
  11105. data: Record<string, any>;
  11106. }
  11107. declare interface RmDirOptions {
  11108. maxRetries?: number;
  11109. recursive?: boolean;
  11110. retryDelay?: number;
  11111. }
  11112. declare interface Rmdir {
  11113. (
  11114. file: PathLikeFs,
  11115. callback: (arg0: null | NodeJS.ErrnoException) => void
  11116. ): void;
  11117. (
  11118. file: PathLikeFs,
  11119. options: RmDirOptions,
  11120. callback: (arg0: null | NodeJS.ErrnoException) => void
  11121. ): void;
  11122. }
  11123. type Rule = string | RegExp;
  11124. declare interface RuleSet {
  11125. /**
  11126. * map of references in the rule set (may grow over time)
  11127. */
  11128. references: Map<string, any>;
  11129. /**
  11130. * execute the rule set
  11131. */
  11132. exec: (arg0: object) => Effect[];
  11133. }
  11134. type RuleSetCondition =
  11135. | string
  11136. | RegExp
  11137. | ((value: string) => boolean)
  11138. | RuleSetLogicalConditions
  11139. | RuleSetCondition[];
  11140. type RuleSetConditionAbsolute =
  11141. | string
  11142. | RegExp
  11143. | ((value: string) => boolean)
  11144. | RuleSetLogicalConditionsAbsolute
  11145. | RuleSetConditionAbsolute[];
  11146. type RuleSetConditionOrConditions =
  11147. | string
  11148. | RegExp
  11149. | ((value: string) => boolean)
  11150. | RuleSetLogicalConditions
  11151. | RuleSetCondition[];
  11152. /**
  11153. * Logic operators used in a condition matcher.
  11154. */
  11155. declare interface RuleSetLogicalConditions {
  11156. /**
  11157. * Logical AND.
  11158. */
  11159. and?: RuleSetCondition[];
  11160. /**
  11161. * Logical NOT.
  11162. */
  11163. not?:
  11164. | string
  11165. | RegExp
  11166. | ((value: string) => boolean)
  11167. | RuleSetLogicalConditions
  11168. | RuleSetCondition[];
  11169. /**
  11170. * Logical OR.
  11171. */
  11172. or?: RuleSetCondition[];
  11173. }
  11174. /**
  11175. * Logic operators used in a condition matcher.
  11176. */
  11177. declare interface RuleSetLogicalConditionsAbsolute {
  11178. /**
  11179. * Logical AND.
  11180. */
  11181. and?: RuleSetConditionAbsolute[];
  11182. /**
  11183. * Logical NOT.
  11184. */
  11185. not?:
  11186. | string
  11187. | RegExp
  11188. | ((value: string) => boolean)
  11189. | RuleSetLogicalConditionsAbsolute
  11190. | RuleSetConditionAbsolute[];
  11191. /**
  11192. * Logical OR.
  11193. */
  11194. or?: RuleSetConditionAbsolute[];
  11195. }
  11196. /**
  11197. * A rule description with conditions and effects for modules.
  11198. */
  11199. declare interface RuleSetRule {
  11200. /**
  11201. * Match on import assertions of the dependency.
  11202. */
  11203. assert?: { [index: string]: RuleSetConditionOrConditions };
  11204. /**
  11205. * Match the child compiler name.
  11206. */
  11207. compiler?:
  11208. | string
  11209. | RegExp
  11210. | ((value: string) => boolean)
  11211. | RuleSetLogicalConditions
  11212. | RuleSetCondition[];
  11213. /**
  11214. * Match dependency type.
  11215. */
  11216. dependency?:
  11217. | string
  11218. | RegExp
  11219. | ((value: string) => boolean)
  11220. | RuleSetLogicalConditions
  11221. | RuleSetCondition[];
  11222. /**
  11223. * Match values of properties in the description file (usually package.json).
  11224. */
  11225. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  11226. /**
  11227. * Enforce this rule as pre or post step.
  11228. */
  11229. enforce?: "pre" | "post";
  11230. /**
  11231. * Shortcut for resource.exclude.
  11232. */
  11233. exclude?:
  11234. | string
  11235. | RegExp
  11236. | ((value: string) => boolean)
  11237. | RuleSetLogicalConditionsAbsolute
  11238. | RuleSetConditionAbsolute[];
  11239. /**
  11240. * The options for the module generator.
  11241. */
  11242. generator?: { [index: string]: any };
  11243. /**
  11244. * Shortcut for resource.include.
  11245. */
  11246. include?:
  11247. | string
  11248. | RegExp
  11249. | ((value: string) => boolean)
  11250. | RuleSetLogicalConditionsAbsolute
  11251. | RuleSetConditionAbsolute[];
  11252. /**
  11253. * Match the issuer of the module (The module pointing to this module).
  11254. */
  11255. issuer?:
  11256. | string
  11257. | RegExp
  11258. | ((value: string) => boolean)
  11259. | RuleSetLogicalConditionsAbsolute
  11260. | RuleSetConditionAbsolute[];
  11261. /**
  11262. * Match layer of the issuer of this module (The module pointing to this module).
  11263. */
  11264. issuerLayer?:
  11265. | string
  11266. | RegExp
  11267. | ((value: string) => boolean)
  11268. | RuleSetLogicalConditions
  11269. | RuleSetCondition[];
  11270. /**
  11271. * Specifies the layer in which the module should be placed in.
  11272. */
  11273. layer?: string;
  11274. /**
  11275. * Shortcut for use.loader.
  11276. */
  11277. loader?: string;
  11278. /**
  11279. * Match module mimetype when load from Data URI.
  11280. */
  11281. mimetype?:
  11282. | string
  11283. | RegExp
  11284. | ((value: string) => boolean)
  11285. | RuleSetLogicalConditions
  11286. | RuleSetCondition[];
  11287. /**
  11288. * Only execute the first matching rule in this array.
  11289. */
  11290. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  11291. /**
  11292. * Shortcut for use.options.
  11293. */
  11294. options?: string | { [index: string]: any };
  11295. /**
  11296. * Options for parsing.
  11297. */
  11298. parser?: { [index: string]: any };
  11299. /**
  11300. * Match the real resource path of the module.
  11301. */
  11302. realResource?:
  11303. | string
  11304. | RegExp
  11305. | ((value: string) => boolean)
  11306. | RuleSetLogicalConditionsAbsolute
  11307. | RuleSetConditionAbsolute[];
  11308. /**
  11309. * Options for the resolver.
  11310. */
  11311. resolve?: ResolveOptions;
  11312. /**
  11313. * Match the resource path of the module.
  11314. */
  11315. resource?:
  11316. | string
  11317. | RegExp
  11318. | ((value: string) => boolean)
  11319. | RuleSetLogicalConditionsAbsolute
  11320. | RuleSetConditionAbsolute[];
  11321. /**
  11322. * Match the resource fragment of the module.
  11323. */
  11324. resourceFragment?:
  11325. | string
  11326. | RegExp
  11327. | ((value: string) => boolean)
  11328. | RuleSetLogicalConditions
  11329. | RuleSetCondition[];
  11330. /**
  11331. * Match the resource query of the module.
  11332. */
  11333. resourceQuery?:
  11334. | string
  11335. | RegExp
  11336. | ((value: string) => boolean)
  11337. | RuleSetLogicalConditions
  11338. | RuleSetCondition[];
  11339. /**
  11340. * Match and execute these rules when this rule is matched.
  11341. */
  11342. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  11343. /**
  11344. * Match module scheme.
  11345. */
  11346. scheme?:
  11347. | string
  11348. | RegExp
  11349. | ((value: string) => boolean)
  11350. | RuleSetLogicalConditions
  11351. | RuleSetCondition[];
  11352. /**
  11353. * Flags a module as with or without side effects.
  11354. */
  11355. sideEffects?: boolean;
  11356. /**
  11357. * Shortcut for resource.test.
  11358. */
  11359. test?:
  11360. | string
  11361. | RegExp
  11362. | ((value: string) => boolean)
  11363. | RuleSetLogicalConditionsAbsolute
  11364. | RuleSetConditionAbsolute[];
  11365. /**
  11366. * Module type to use for the module.
  11367. */
  11368. type?: string;
  11369. /**
  11370. * Modifiers applied to the module when rule is matched.
  11371. */
  11372. use?:
  11373. | string
  11374. | (
  11375. | undefined
  11376. | null
  11377. | string
  11378. | false
  11379. | 0
  11380. | {
  11381. /**
  11382. * Unique loader options identifier.
  11383. */
  11384. ident?: string;
  11385. /**
  11386. * Loader name.
  11387. */
  11388. loader?: string;
  11389. /**
  11390. * Loader options.
  11391. */
  11392. options?: string | { [index: string]: any };
  11393. }
  11394. | ((data: object) =>
  11395. | string
  11396. | {
  11397. /**
  11398. * Unique loader options identifier.
  11399. */
  11400. ident?: string;
  11401. /**
  11402. * Loader name.
  11403. */
  11404. loader?: string;
  11405. /**
  11406. * Loader options.
  11407. */
  11408. options?: string | { [index: string]: any };
  11409. }
  11410. | __TypeWebpackOptions
  11411. | __Type_2[])
  11412. )[]
  11413. | ((data: {
  11414. resource: string;
  11415. realResource: string;
  11416. resourceQuery: string;
  11417. issuer: string;
  11418. compiler: string;
  11419. }) => __Type_2[])
  11420. | {
  11421. /**
  11422. * Unique loader options identifier.
  11423. */
  11424. ident?: string;
  11425. /**
  11426. * Loader name.
  11427. */
  11428. loader?: string;
  11429. /**
  11430. * Loader options.
  11431. */
  11432. options?: string | { [index: string]: any };
  11433. }
  11434. | __TypeWebpackOptions;
  11435. /**
  11436. * Match on import attributes of the dependency.
  11437. */
  11438. with?: { [index: string]: RuleSetConditionOrConditions };
  11439. }
  11440. type RuleSetUse =
  11441. | string
  11442. | (
  11443. | undefined
  11444. | null
  11445. | string
  11446. | false
  11447. | 0
  11448. | {
  11449. /**
  11450. * Unique loader options identifier.
  11451. */
  11452. ident?: string;
  11453. /**
  11454. * Loader name.
  11455. */
  11456. loader?: string;
  11457. /**
  11458. * Loader options.
  11459. */
  11460. options?: string | { [index: string]: any };
  11461. }
  11462. | ((data: object) =>
  11463. | string
  11464. | {
  11465. /**
  11466. * Unique loader options identifier.
  11467. */
  11468. ident?: string;
  11469. /**
  11470. * Loader name.
  11471. */
  11472. loader?: string;
  11473. /**
  11474. * Loader options.
  11475. */
  11476. options?: string | { [index: string]: any };
  11477. }
  11478. | __TypeWebpackOptions
  11479. | __Type_2[])
  11480. )[]
  11481. | ((data: {
  11482. resource: string;
  11483. realResource: string;
  11484. resourceQuery: string;
  11485. issuer: string;
  11486. compiler: string;
  11487. }) => __Type_2[])
  11488. | {
  11489. /**
  11490. * Unique loader options identifier.
  11491. */
  11492. ident?: string;
  11493. /**
  11494. * Loader name.
  11495. */
  11496. loader?: string;
  11497. /**
  11498. * Loader options.
  11499. */
  11500. options?: string | { [index: string]: any };
  11501. }
  11502. | __TypeWebpackOptions;
  11503. type RuleSetUseItem =
  11504. | string
  11505. | {
  11506. /**
  11507. * Unique loader options identifier.
  11508. */
  11509. ident?: string;
  11510. /**
  11511. * Loader name.
  11512. */
  11513. loader?: string;
  11514. /**
  11515. * Loader options.
  11516. */
  11517. options?: string | { [index: string]: any };
  11518. }
  11519. | __TypeWebpackOptions;
  11520. declare interface RunCallback<T> {
  11521. (err: null | Error, result?: T): any;
  11522. }
  11523. declare class RuntimeChunkPlugin {
  11524. constructor(options: { name?: (entrypoint: { name: string }) => string });
  11525. options: {
  11526. name:
  11527. | ((entrypoint: { name: string }) => string)
  11528. | ((entrypoint: Entrypoint) => string);
  11529. };
  11530. /**
  11531. * Apply the plugin
  11532. */
  11533. apply(compiler: Compiler): void;
  11534. }
  11535. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  11536. declare class RuntimeModule extends Module {
  11537. constructor(name: string, stage?: number);
  11538. name: string;
  11539. stage: number;
  11540. compilation?: Compilation;
  11541. chunk?: Chunk;
  11542. chunkGraph?: ChunkGraph;
  11543. fullHash: boolean;
  11544. dependentHash: boolean;
  11545. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  11546. generate(): null | string;
  11547. getGeneratedCode(): null | string;
  11548. shouldIsolate(): boolean;
  11549. /**
  11550. * Runtime modules without any dependencies to other runtime modules
  11551. */
  11552. static STAGE_NORMAL: number;
  11553. /**
  11554. * Runtime modules with simple dependencies on other runtime modules
  11555. */
  11556. static STAGE_BASIC: number;
  11557. /**
  11558. * Runtime modules which attach to handlers of other runtime modules
  11559. */
  11560. static STAGE_ATTACH: number;
  11561. /**
  11562. * Runtime modules which trigger actions on bootstrap
  11563. */
  11564. static STAGE_TRIGGER: number;
  11565. }
  11566. declare interface RuntimeRequirementsContext {
  11567. /**
  11568. * the chunk graph
  11569. */
  11570. chunkGraph: ChunkGraph;
  11571. /**
  11572. * the code generation results
  11573. */
  11574. codeGenerationResults: CodeGenerationResults;
  11575. }
  11576. type RuntimeSpec = undefined | string | SortableSet<string>;
  11577. declare class RuntimeSpecMap<T> {
  11578. constructor(clone?: RuntimeSpecMap<T>);
  11579. get(runtime: RuntimeSpec): undefined | T;
  11580. has(runtime: RuntimeSpec): boolean;
  11581. set(runtime: RuntimeSpec, value: T): void;
  11582. provide(runtime: RuntimeSpec, computer: () => any): any;
  11583. delete(runtime: RuntimeSpec): void;
  11584. update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
  11585. keys(): RuntimeSpec[];
  11586. values(): IterableIterator<T>;
  11587. get size(): number;
  11588. }
  11589. declare class RuntimeSpecSet {
  11590. constructor(iterable?: Iterable<RuntimeSpec>);
  11591. add(runtime: RuntimeSpec): void;
  11592. has(runtime: RuntimeSpec): boolean;
  11593. get size(): number;
  11594. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  11595. }
  11596. declare abstract class RuntimeTemplate {
  11597. compilation: Compilation;
  11598. outputOptions: OutputNormalized;
  11599. requestShortener: RequestShortener;
  11600. globalObject: string;
  11601. contentHashReplacement: string;
  11602. isIIFE(): undefined | boolean;
  11603. isModule(): undefined | boolean;
  11604. supportsConst(): undefined | boolean;
  11605. supportsArrowFunction(): undefined | boolean;
  11606. supportsAsyncFunction(): undefined | boolean;
  11607. supportsOptionalChaining(): undefined | boolean;
  11608. supportsForOf(): undefined | boolean;
  11609. supportsDestructuring(): undefined | boolean;
  11610. supportsBigIntLiteral(): undefined | boolean;
  11611. supportsDynamicImport(): undefined | boolean;
  11612. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  11613. supportTemplateLiteral(): undefined | boolean;
  11614. supportNodePrefixForCoreModules(): undefined | boolean;
  11615. returningFunction(returnValue: string, args?: string): string;
  11616. basicFunction(args: string, body: string | string[]): string;
  11617. concatenation(...args: (string | { expr: string })[]): string;
  11618. expressionFunction(expression: string, args?: string): string;
  11619. emptyFunction(): string;
  11620. destructureArray(items: string[], value: string): string;
  11621. destructureObject(items: string[], value: string): string;
  11622. iife(args: string, body: string): string;
  11623. forEach(variable: string, array: string, body: string | string[]): string;
  11624. /**
  11625. * Add a comment
  11626. */
  11627. comment(__0: {
  11628. /**
  11629. * request string used originally
  11630. */
  11631. request?: string;
  11632. /**
  11633. * name of the chunk referenced
  11634. */
  11635. chunkName?: string;
  11636. /**
  11637. * reason information of the chunk
  11638. */
  11639. chunkReason?: string;
  11640. /**
  11641. * additional message
  11642. */
  11643. message?: string;
  11644. /**
  11645. * name of the export
  11646. */
  11647. exportName?: string;
  11648. }): string;
  11649. throwMissingModuleErrorBlock(__0: {
  11650. /**
  11651. * request string used originally
  11652. */
  11653. request?: string;
  11654. }): string;
  11655. throwMissingModuleErrorFunction(__0: {
  11656. /**
  11657. * request string used originally
  11658. */
  11659. request?: string;
  11660. }): string;
  11661. missingModule(__0: {
  11662. /**
  11663. * request string used originally
  11664. */
  11665. request?: string;
  11666. }): string;
  11667. missingModuleStatement(__0: {
  11668. /**
  11669. * request string used originally
  11670. */
  11671. request?: string;
  11672. }): string;
  11673. missingModulePromise(__0: {
  11674. /**
  11675. * request string used originally
  11676. */
  11677. request?: string;
  11678. }): string;
  11679. weakError(__0: {
  11680. /**
  11681. * the chunk graph
  11682. */
  11683. chunkGraph: ChunkGraph;
  11684. /**
  11685. * the module
  11686. */
  11687. module: Module;
  11688. /**
  11689. * the request that should be printed as comment
  11690. */
  11691. request?: string;
  11692. /**
  11693. * expression to use as id expression
  11694. */
  11695. idExpr?: string;
  11696. /**
  11697. * which kind of code should be returned
  11698. */
  11699. type: "promise" | "expression" | "statements";
  11700. }): string;
  11701. moduleId(__0: {
  11702. /**
  11703. * the module
  11704. */
  11705. module: Module;
  11706. /**
  11707. * the chunk graph
  11708. */
  11709. chunkGraph: ChunkGraph;
  11710. /**
  11711. * the request that should be printed as comment
  11712. */
  11713. request?: string;
  11714. /**
  11715. * if the dependency is weak (will create a nice error message)
  11716. */
  11717. weak?: boolean;
  11718. }): string;
  11719. moduleRaw(__0: {
  11720. /**
  11721. * the module
  11722. */
  11723. module: null | Module;
  11724. /**
  11725. * the chunk graph
  11726. */
  11727. chunkGraph: ChunkGraph;
  11728. /**
  11729. * the request that should be printed as comment
  11730. */
  11731. request?: string;
  11732. /**
  11733. * if the dependency is weak (will create a nice error message)
  11734. */
  11735. weak?: boolean;
  11736. /**
  11737. * if set, will be filled with runtime requirements
  11738. */
  11739. runtimeRequirements: Set<string>;
  11740. }): string;
  11741. moduleExports(__0: {
  11742. /**
  11743. * the module
  11744. */
  11745. module: null | Module;
  11746. /**
  11747. * the chunk graph
  11748. */
  11749. chunkGraph: ChunkGraph;
  11750. /**
  11751. * the request that should be printed as comment
  11752. */
  11753. request: string;
  11754. /**
  11755. * if the dependency is weak (will create a nice error message)
  11756. */
  11757. weak?: boolean;
  11758. /**
  11759. * if set, will be filled with runtime requirements
  11760. */
  11761. runtimeRequirements: Set<string>;
  11762. }): string;
  11763. moduleNamespace(__0: {
  11764. /**
  11765. * the module
  11766. */
  11767. module: Module;
  11768. /**
  11769. * the chunk graph
  11770. */
  11771. chunkGraph: ChunkGraph;
  11772. /**
  11773. * the request that should be printed as comment
  11774. */
  11775. request: string;
  11776. /**
  11777. * if the current module is in strict esm mode
  11778. */
  11779. strict?: boolean;
  11780. /**
  11781. * if the dependency is weak (will create a nice error message)
  11782. */
  11783. weak?: boolean;
  11784. /**
  11785. * if set, will be filled with runtime requirements
  11786. */
  11787. runtimeRequirements: Set<string>;
  11788. }): string;
  11789. moduleNamespacePromise(__0: {
  11790. /**
  11791. * the chunk graph
  11792. */
  11793. chunkGraph: ChunkGraph;
  11794. /**
  11795. * the current dependencies block
  11796. */
  11797. block?: AsyncDependenciesBlock;
  11798. /**
  11799. * the module
  11800. */
  11801. module: Module;
  11802. /**
  11803. * the request that should be printed as comment
  11804. */
  11805. request: string;
  11806. /**
  11807. * a message for the comment
  11808. */
  11809. message: string;
  11810. /**
  11811. * if the current module is in strict esm mode
  11812. */
  11813. strict?: boolean;
  11814. /**
  11815. * if the dependency is weak (will create a nice error message)
  11816. */
  11817. weak?: boolean;
  11818. /**
  11819. * if set, will be filled with runtime requirements
  11820. */
  11821. runtimeRequirements: Set<string>;
  11822. }): string;
  11823. runtimeConditionExpression(__0: {
  11824. /**
  11825. * the chunk graph
  11826. */
  11827. chunkGraph: ChunkGraph;
  11828. /**
  11829. * runtime for which this code will be generated
  11830. */
  11831. runtime?: RuntimeSpec;
  11832. /**
  11833. * only execute the statement in some runtimes
  11834. */
  11835. runtimeCondition?: string | boolean | SortableSet<string>;
  11836. /**
  11837. * if set, will be filled with runtime requirements
  11838. */
  11839. runtimeRequirements: Set<string>;
  11840. }): string;
  11841. importStatement(__0: {
  11842. /**
  11843. * whether a new variable should be created or the existing one updated
  11844. */
  11845. update?: boolean;
  11846. /**
  11847. * the module
  11848. */
  11849. module: Module;
  11850. /**
  11851. * the chunk graph
  11852. */
  11853. chunkGraph: ChunkGraph;
  11854. /**
  11855. * the request that should be printed as comment
  11856. */
  11857. request: string;
  11858. /**
  11859. * name of the import variable
  11860. */
  11861. importVar: string;
  11862. /**
  11863. * module in which the statement is emitted
  11864. */
  11865. originModule: Module;
  11866. /**
  11867. * true, if this is a weak dependency
  11868. */
  11869. weak?: boolean;
  11870. /**
  11871. * if set, will be filled with runtime requirements
  11872. */
  11873. runtimeRequirements: Set<string>;
  11874. }): [string, string];
  11875. exportFromImport(__0: {
  11876. /**
  11877. * the module graph
  11878. */
  11879. moduleGraph: ModuleGraph;
  11880. /**
  11881. * the module
  11882. */
  11883. module: Module;
  11884. /**
  11885. * the request
  11886. */
  11887. request: string;
  11888. /**
  11889. * the export name
  11890. */
  11891. exportName: string | string[];
  11892. /**
  11893. * the origin module
  11894. */
  11895. originModule: Module;
  11896. /**
  11897. * true, if location is safe for ASI, a bracket can be emitted
  11898. */
  11899. asiSafe?: boolean;
  11900. /**
  11901. * true, if expression will be called
  11902. */
  11903. isCall: boolean;
  11904. /**
  11905. * when false, call context will not be preserved
  11906. */
  11907. callContext: null | boolean;
  11908. /**
  11909. * when true and accessing the default exports, interop code will be generated
  11910. */
  11911. defaultInterop: boolean;
  11912. /**
  11913. * the identifier name of the import variable
  11914. */
  11915. importVar: string;
  11916. /**
  11917. * init fragments will be added here
  11918. */
  11919. initFragments: InitFragment<any>[];
  11920. /**
  11921. * runtime for which this code will be generated
  11922. */
  11923. runtime: RuntimeSpec;
  11924. /**
  11925. * if set, will be filled with runtime requirements
  11926. */
  11927. runtimeRequirements: Set<string>;
  11928. }): string;
  11929. blockPromise(__0: {
  11930. /**
  11931. * the async block
  11932. */
  11933. block?: AsyncDependenciesBlock;
  11934. /**
  11935. * the message
  11936. */
  11937. message: string;
  11938. /**
  11939. * the chunk graph
  11940. */
  11941. chunkGraph: ChunkGraph;
  11942. /**
  11943. * if set, will be filled with runtime requirements
  11944. */
  11945. runtimeRequirements: Set<string>;
  11946. }): string;
  11947. asyncModuleFactory(__0: {
  11948. /**
  11949. * the async block
  11950. */
  11951. block: AsyncDependenciesBlock;
  11952. /**
  11953. * the chunk graph
  11954. */
  11955. chunkGraph: ChunkGraph;
  11956. /**
  11957. * if set, will be filled with runtime requirements
  11958. */
  11959. runtimeRequirements: Set<string>;
  11960. /**
  11961. * request string used originally
  11962. */
  11963. request?: string;
  11964. }): string;
  11965. syncModuleFactory(__0: {
  11966. /**
  11967. * the dependency
  11968. */
  11969. dependency: Dependency;
  11970. /**
  11971. * the chunk graph
  11972. */
  11973. chunkGraph: ChunkGraph;
  11974. /**
  11975. * if set, will be filled with runtime requirements
  11976. */
  11977. runtimeRequirements: Set<string>;
  11978. /**
  11979. * request string used originally
  11980. */
  11981. request?: string;
  11982. }): string;
  11983. defineEsModuleFlagStatement(__0: {
  11984. /**
  11985. * the name of the exports object
  11986. */
  11987. exportsArgument: string;
  11988. /**
  11989. * if set, will be filled with runtime requirements
  11990. */
  11991. runtimeRequirements: Set<string>;
  11992. }): string;
  11993. assetUrl(__0: {
  11994. /**
  11995. * the module
  11996. */
  11997. module: Module;
  11998. /**
  11999. * runtime
  12000. */
  12001. runtime?: RuntimeSpec;
  12002. /**
  12003. * the code generation results
  12004. */
  12005. codeGenerationResults: CodeGenerationResults;
  12006. }): string;
  12007. }
  12008. declare abstract class RuntimeValue {
  12009. fn: (arg0: {
  12010. module: NormalModule;
  12011. key: string;
  12012. readonly version?: string;
  12013. }) => CodeValuePrimitive;
  12014. options: true | RuntimeValueOptions;
  12015. get fileDependencies(): true | string[];
  12016. exec(
  12017. parser: JavascriptParser,
  12018. valueCacheVersions: Map<string, string | Set<string>>,
  12019. key: string
  12020. ): CodeValuePrimitive;
  12021. getCacheVersion(): undefined | string;
  12022. }
  12023. declare interface RuntimeValueOptions {
  12024. fileDependencies?: string[];
  12025. contextDependencies?: string[];
  12026. missingDependencies?: string[];
  12027. buildDependencies?: string[];
  12028. version?: string | (() => string);
  12029. }
  12030. /**
  12031. * Helper function for joining two ranges into a single range. This is useful
  12032. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  12033. * to create the range of the _parent node_.
  12034. */
  12035. declare interface ScopeInfo {
  12036. definitions: StackedMap<string, ScopeInfo | VariableInfo>;
  12037. topLevelScope: boolean | "arrow";
  12038. inShorthand: string | boolean;
  12039. inTaggedTemplateTag: boolean;
  12040. inTry: boolean;
  12041. isStrict: boolean;
  12042. isAsmJs: boolean;
  12043. }
  12044. declare interface Selector<A, B> {
  12045. (input: A): undefined | null | B;
  12046. }
  12047. declare abstract class Serializer {
  12048. serializeMiddlewares: SerializerMiddleware<any, any>[];
  12049. deserializeMiddlewares: SerializerMiddleware<any, any>[];
  12050. context: any;
  12051. serialize(obj?: any, context?: any): Promise<any>;
  12052. deserialize(value?: any, context?: any): Promise<any>;
  12053. }
  12054. declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
  12055. serialize(
  12056. data: DeserializedType,
  12057. context: object
  12058. ): SerializedType | Promise<SerializedType>;
  12059. deserialize(
  12060. data: SerializedType,
  12061. context: object
  12062. ): DeserializedType | Promise<DeserializedType>;
  12063. }
  12064. type ServerOptionsHttps<
  12065. Request extends typeof IncomingMessage = typeof IncomingMessage,
  12066. Response extends typeof ServerResponse = typeof ServerResponse
  12067. > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
  12068. declare class SharePlugin {
  12069. constructor(options: SharePluginOptions);
  12070. /**
  12071. * Apply the plugin
  12072. */
  12073. apply(compiler: Compiler): void;
  12074. }
  12075. /**
  12076. * Options for shared modules.
  12077. */
  12078. declare interface SharePluginOptions {
  12079. /**
  12080. * Share scope name used for all shared modules (defaults to 'default').
  12081. */
  12082. shareScope?: string;
  12083. /**
  12084. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  12085. */
  12086. shared: Shared;
  12087. }
  12088. type Shared = (string | SharedObject)[] | SharedObject;
  12089. /**
  12090. * Advanced configuration for modules that should be shared in the share scope.
  12091. */
  12092. declare interface SharedConfig {
  12093. /**
  12094. * 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.
  12095. */
  12096. eager?: boolean;
  12097. /**
  12098. * 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.
  12099. */
  12100. import?: string | false;
  12101. /**
  12102. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  12103. */
  12104. packageName?: string;
  12105. /**
  12106. * Version requirement from module in share scope.
  12107. */
  12108. requiredVersion?: string | false;
  12109. /**
  12110. * Module is looked up under this key from the share scope.
  12111. */
  12112. shareKey?: string;
  12113. /**
  12114. * Share scope name.
  12115. */
  12116. shareScope?: string;
  12117. /**
  12118. * Allow only a single version of the shared module in share scope (disabled by default).
  12119. */
  12120. singleton?: boolean;
  12121. /**
  12122. * 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).
  12123. */
  12124. strictVersion?: boolean;
  12125. /**
  12126. * Version of the provided module. Will replace lower matching versions, but not higher.
  12127. */
  12128. version?: string | false;
  12129. }
  12130. /**
  12131. * 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.
  12132. */
  12133. declare interface SharedObject {
  12134. [index: string]: string | SharedConfig;
  12135. }
  12136. declare class SideEffectsFlagPlugin {
  12137. constructor(analyseSource?: boolean);
  12138. /**
  12139. * Apply the plugin
  12140. */
  12141. apply(compiler: Compiler): void;
  12142. static moduleHasSideEffects(
  12143. moduleName: string,
  12144. flagValue: undefined | string | boolean | string[],
  12145. cache: Map<string, RegExp>
  12146. ): undefined | boolean;
  12147. }
  12148. declare class SizeOnlySource extends Source {
  12149. constructor(size: number);
  12150. }
  12151. declare abstract class Snapshot {
  12152. startTime?: number;
  12153. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  12154. fileHashes?: Map<string, null | string>;
  12155. fileTshs?: Map<string, null | string | TimestampAndHash>;
  12156. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  12157. contextHashes?: Map<string, null | string>;
  12158. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  12159. missingExistence?: Map<string, boolean>;
  12160. managedItemInfo?: Map<string, string>;
  12161. managedFiles?: Set<string>;
  12162. managedContexts?: Set<string>;
  12163. managedMissing?: Set<string>;
  12164. children?: Set<Snapshot>;
  12165. hasStartTime(): boolean;
  12166. setStartTime(value: number): void;
  12167. setMergedStartTime(value?: any, snapshot?: any): void;
  12168. hasFileTimestamps(): boolean;
  12169. setFileTimestamps(value?: any): void;
  12170. hasFileHashes(): boolean;
  12171. setFileHashes(value?: any): void;
  12172. hasFileTshs(): boolean;
  12173. setFileTshs(value?: any): void;
  12174. hasContextTimestamps(): boolean;
  12175. setContextTimestamps(value?: any): void;
  12176. hasContextHashes(): boolean;
  12177. setContextHashes(value?: any): void;
  12178. hasContextTshs(): boolean;
  12179. setContextTshs(value?: any): void;
  12180. hasMissingExistence(): boolean;
  12181. setMissingExistence(value?: any): void;
  12182. hasManagedItemInfo(): boolean;
  12183. setManagedItemInfo(value?: any): void;
  12184. hasManagedFiles(): boolean;
  12185. setManagedFiles(value?: any): void;
  12186. hasManagedContexts(): boolean;
  12187. setManagedContexts(value?: any): void;
  12188. hasManagedMissing(): boolean;
  12189. setManagedMissing(value?: any): void;
  12190. hasChildren(): boolean;
  12191. setChildren(value?: any): void;
  12192. addChild(child?: any): void;
  12193. serialize(__0: ObjectSerializerContext): void;
  12194. deserialize(__0: ObjectDeserializerContext): void;
  12195. getFileIterable(): Iterable<string>;
  12196. getContextIterable(): Iterable<string>;
  12197. getMissingIterable(): Iterable<string>;
  12198. }
  12199. declare interface SnapshotOptionsFileSystemInfo {
  12200. /**
  12201. * should use hash to snapshot
  12202. */
  12203. hash?: boolean;
  12204. /**
  12205. * should use timestamp to snapshot
  12206. */
  12207. timestamp?: boolean;
  12208. }
  12209. /**
  12210. * Options affecting how file system snapshots are created and validated.
  12211. */
  12212. declare interface SnapshotOptionsWebpackOptions {
  12213. /**
  12214. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  12215. */
  12216. buildDependencies?: {
  12217. /**
  12218. * Use hashes of the content of the files/directories to determine invalidation.
  12219. */
  12220. hash?: boolean;
  12221. /**
  12222. * Use timestamps of the files/directories to determine invalidation.
  12223. */
  12224. timestamp?: boolean;
  12225. };
  12226. /**
  12227. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  12228. */
  12229. immutablePaths?: (string | RegExp)[];
  12230. /**
  12231. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  12232. */
  12233. managedPaths?: (string | RegExp)[];
  12234. /**
  12235. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  12236. */
  12237. module?: {
  12238. /**
  12239. * Use hashes of the content of the files/directories to determine invalidation.
  12240. */
  12241. hash?: boolean;
  12242. /**
  12243. * Use timestamps of the files/directories to determine invalidation.
  12244. */
  12245. timestamp?: boolean;
  12246. };
  12247. /**
  12248. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  12249. */
  12250. resolve?: {
  12251. /**
  12252. * Use hashes of the content of the files/directories to determine invalidation.
  12253. */
  12254. hash?: boolean;
  12255. /**
  12256. * Use timestamps of the files/directories to determine invalidation.
  12257. */
  12258. timestamp?: boolean;
  12259. };
  12260. /**
  12261. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  12262. */
  12263. resolveBuildDependencies?: {
  12264. /**
  12265. * Use hashes of the content of the files/directories to determine invalidation.
  12266. */
  12267. hash?: boolean;
  12268. /**
  12269. * Use timestamps of the files/directories to determine invalidation.
  12270. */
  12271. timestamp?: boolean;
  12272. };
  12273. /**
  12274. * List of paths that are not managed by a package manager and the contents are subject to change.
  12275. */
  12276. unmanagedPaths?: (string | RegExp)[];
  12277. }
  12278. declare abstract class SortableSet<T> extends Set<T> {
  12279. /**
  12280. * Sort with a comparer function
  12281. */
  12282. sortWith(sortFn: (arg0: T, arg1: T) => number): void;
  12283. sort(): SortableSet<T>;
  12284. /**
  12285. * Get data from cache
  12286. */
  12287. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  12288. /**
  12289. * Get data from cache (ignoring sorting)
  12290. */
  12291. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  12292. toJSON(): T[];
  12293. /**
  12294. * Iterates over values in the set.
  12295. */
  12296. [Symbol.iterator](): IterableIterator<T>;
  12297. }
  12298. declare class Source {
  12299. constructor();
  12300. size(): number;
  12301. map(options?: MapOptions): null | RawSourceMap;
  12302. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  12303. updateHash(hash: Hash): void;
  12304. source(): string | Buffer;
  12305. buffer(): Buffer;
  12306. }
  12307. declare interface SourceLike {
  12308. source(): string | Buffer;
  12309. }
  12310. declare interface SourceMap {
  12311. version: number;
  12312. sources: string[];
  12313. mappings: string;
  12314. file?: string;
  12315. sourceRoot?: string;
  12316. sourcesContent?: string[];
  12317. names?: string[];
  12318. }
  12319. declare class SourceMapDevToolPlugin {
  12320. constructor(options?: SourceMapDevToolPluginOptions);
  12321. sourceMapFilename: string | false;
  12322. sourceMappingURLComment:
  12323. | string
  12324. | false
  12325. | ((arg0: PathData, arg1?: AssetInfo) => string);
  12326. moduleFilenameTemplate: string | Function;
  12327. fallbackModuleFilenameTemplate: string | Function;
  12328. namespace: string;
  12329. options: SourceMapDevToolPluginOptions;
  12330. /**
  12331. * Apply the plugin
  12332. */
  12333. apply(compiler: Compiler): void;
  12334. }
  12335. declare interface SourceMapDevToolPluginOptions {
  12336. /**
  12337. * 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.
  12338. */
  12339. append?:
  12340. | null
  12341. | string
  12342. | false
  12343. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12344. /**
  12345. * Indicates whether column mappings should be used (defaults to true).
  12346. */
  12347. columns?: boolean;
  12348. /**
  12349. * Exclude modules that match the given value from source map generation.
  12350. */
  12351. exclude?: string | RegExp | Rule[];
  12352. /**
  12353. * 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.
  12354. */
  12355. fallbackModuleFilenameTemplate?: string | Function;
  12356. /**
  12357. * Path prefix to which the [file] placeholder is relative to.
  12358. */
  12359. fileContext?: string;
  12360. /**
  12361. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  12362. */
  12363. filename?: null | string | false;
  12364. /**
  12365. * Include source maps for module paths that match the given value.
  12366. */
  12367. include?: string | RegExp | Rule[];
  12368. /**
  12369. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  12370. */
  12371. module?: boolean;
  12372. /**
  12373. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  12374. */
  12375. moduleFilenameTemplate?: string | Function;
  12376. /**
  12377. * Namespace prefix to allow multiple webpack roots in the devtools.
  12378. */
  12379. namespace?: string;
  12380. /**
  12381. * Omit the 'sourceContents' array from the SourceMap.
  12382. */
  12383. noSources?: boolean;
  12384. /**
  12385. * Provide a custom public path for the SourceMapping comment.
  12386. */
  12387. publicPath?: string;
  12388. /**
  12389. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  12390. */
  12391. sourceRoot?: string;
  12392. /**
  12393. * Include source maps for modules based on their extension (defaults to .js and .css).
  12394. */
  12395. test?: string | RegExp | Rule[];
  12396. }
  12397. declare class SourceMapSource extends Source {
  12398. constructor(
  12399. source: string | Buffer,
  12400. name: string,
  12401. sourceMap: string | Object | Buffer,
  12402. originalSource?: string | Buffer,
  12403. innerSourceMap?: string | Object | Buffer,
  12404. removeOriginalSource?: boolean
  12405. );
  12406. getArgsAsBuffers(): [
  12407. Buffer,
  12408. string,
  12409. Buffer,
  12410. undefined | Buffer,
  12411. undefined | Buffer,
  12412. boolean
  12413. ];
  12414. }
  12415. declare interface SourcePosition {
  12416. line: number;
  12417. column?: number;
  12418. }
  12419. declare interface SplitChunksOptions {
  12420. chunksFilter: (chunk: Chunk) => undefined | boolean;
  12421. defaultSizeTypes: string[];
  12422. minSize: SplitChunksSizes;
  12423. minSizeReduction: SplitChunksSizes;
  12424. minRemainingSize: SplitChunksSizes;
  12425. enforceSizeThreshold: SplitChunksSizes;
  12426. maxInitialSize: SplitChunksSizes;
  12427. maxAsyncSize: SplitChunksSizes;
  12428. minChunks: number;
  12429. maxAsyncRequests: number;
  12430. maxInitialRequests: number;
  12431. hidePathInfo: boolean;
  12432. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  12433. automaticNameDelimiter: string;
  12434. getCacheGroups: (
  12435. module: Module,
  12436. context: CacheGroupsContext
  12437. ) => CacheGroupSource[];
  12438. getName: (
  12439. module?: Module,
  12440. chunks?: Chunk[],
  12441. key?: string
  12442. ) => undefined | string;
  12443. usedExports: boolean;
  12444. fallbackCacheGroup: FallbackCacheGroup;
  12445. }
  12446. declare class SplitChunksPlugin {
  12447. constructor(options?: OptimizationSplitChunksOptions);
  12448. options: SplitChunksOptions;
  12449. /**
  12450. * Apply the plugin
  12451. */
  12452. apply(compiler: Compiler): void;
  12453. }
  12454. declare interface SplitChunksSizes {
  12455. [index: string]: number;
  12456. }
  12457. declare abstract class StackedMap<K, V> {
  12458. map: Map<K, InternalCell<V>>;
  12459. stack: Map<K, InternalCell<V>>[];
  12460. set(item: K, value: V): void;
  12461. delete(item: K): void;
  12462. has(item: K): boolean;
  12463. get(item: K): Cell<V>;
  12464. asArray(): K[];
  12465. asSet(): Set<K>;
  12466. asPairArray(): [K, Cell<V>][];
  12467. asMap(): Map<K, Cell<V>>;
  12468. get size(): number;
  12469. createChild(): StackedMap<K, V>;
  12470. }
  12471. type StartupRenderContext = RenderContext & { inlined: boolean };
  12472. declare interface StatFs {
  12473. (
  12474. path: PathLikeFs,
  12475. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12476. ): void;
  12477. (
  12478. path: PathLikeFs,
  12479. options: undefined | (StatOptions & { bigint?: false }),
  12480. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12481. ): void;
  12482. (
  12483. path: PathLikeFs,
  12484. options: StatOptions & { bigint: true },
  12485. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  12486. ): void;
  12487. (
  12488. path: PathLikeFs,
  12489. options: undefined | StatOptions,
  12490. callback: (
  12491. arg0: null | NodeJS.ErrnoException,
  12492. arg1?: IStats | IBigIntStats
  12493. ) => void
  12494. ): void;
  12495. }
  12496. declare interface StatOptions {
  12497. bigint?: boolean;
  12498. }
  12499. declare interface StatSync {
  12500. (path: PathLikeFs, options?: undefined): IStats;
  12501. (
  12502. path: PathLikeFs,
  12503. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  12504. ): undefined | IStats;
  12505. (
  12506. path: PathLikeFs,
  12507. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  12508. ): undefined | IBigIntStats;
  12509. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  12510. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  12511. (
  12512. path: PathLikeFs,
  12513. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  12514. ): IStats | IBigIntStats;
  12515. (
  12516. path: PathLikeFs,
  12517. options?: StatSyncOptions
  12518. ): undefined | IStats | IBigIntStats;
  12519. }
  12520. declare interface StatSyncOptions {
  12521. bigint?: boolean;
  12522. throwIfNoEntry?: boolean;
  12523. }
  12524. declare interface StatTypes {
  12525. (
  12526. path: PathLikeTypes,
  12527. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12528. ): void;
  12529. (
  12530. path: PathLikeTypes,
  12531. options: undefined | (StatOptions & { bigint?: false }),
  12532. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12533. ): void;
  12534. (
  12535. path: PathLikeTypes,
  12536. options: StatOptions & { bigint: true },
  12537. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  12538. ): void;
  12539. (
  12540. path: PathLikeTypes,
  12541. options: undefined | StatOptions,
  12542. callback: (
  12543. arg0: null | NodeJS.ErrnoException,
  12544. arg1?: IStats | IBigIntStats
  12545. ) => void
  12546. ): void;
  12547. }
  12548. type Statement =
  12549. | FunctionDeclaration
  12550. | VariableDeclaration
  12551. | ClassDeclaration
  12552. | ExpressionStatement
  12553. | BlockStatement
  12554. | StaticBlock
  12555. | EmptyStatement
  12556. | DebuggerStatement
  12557. | WithStatement
  12558. | ReturnStatement
  12559. | LabeledStatement
  12560. | BreakStatement
  12561. | ContinueStatement
  12562. | IfStatement
  12563. | SwitchStatement
  12564. | ThrowStatement
  12565. | TryStatement
  12566. | WhileStatement
  12567. | DoWhileStatement
  12568. | ForStatement
  12569. | ForInStatement
  12570. | ForOfStatement;
  12571. type StatementPathItem =
  12572. | UnaryExpression
  12573. | ArrayExpression
  12574. | ArrowFunctionExpression
  12575. | AssignmentExpression
  12576. | AwaitExpression
  12577. | BinaryExpression
  12578. | SimpleCallExpression
  12579. | NewExpression
  12580. | ChainExpression
  12581. | ClassExpression
  12582. | ConditionalExpression
  12583. | FunctionExpression
  12584. | Identifier
  12585. | ImportExpression
  12586. | SimpleLiteral
  12587. | RegExpLiteral
  12588. | BigIntLiteral
  12589. | LogicalExpression
  12590. | MemberExpression
  12591. | MetaProperty
  12592. | ObjectExpression
  12593. | SequenceExpression
  12594. | TaggedTemplateExpression
  12595. | TemplateLiteral
  12596. | ThisExpression
  12597. | UpdateExpression
  12598. | YieldExpression
  12599. | FunctionDeclaration
  12600. | VariableDeclaration
  12601. | ClassDeclaration
  12602. | ExpressionStatement
  12603. | BlockStatement
  12604. | StaticBlock
  12605. | EmptyStatement
  12606. | DebuggerStatement
  12607. | WithStatement
  12608. | ReturnStatement
  12609. | LabeledStatement
  12610. | BreakStatement
  12611. | ContinueStatement
  12612. | IfStatement
  12613. | SwitchStatement
  12614. | ThrowStatement
  12615. | TryStatement
  12616. | WhileStatement
  12617. | DoWhileStatement
  12618. | ForStatement
  12619. | ForInStatement
  12620. | ForOfStatement
  12621. | ImportDeclaration
  12622. | ExportNamedDeclaration
  12623. | ExportDefaultDeclaration
  12624. | ExportAllDeclaration;
  12625. declare class Stats {
  12626. constructor(compilation: Compilation);
  12627. compilation: Compilation;
  12628. get hash(): string;
  12629. get startTime(): number;
  12630. get endTime(): number;
  12631. hasWarnings(): boolean;
  12632. hasErrors(): boolean;
  12633. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  12634. toString(options?: string | boolean | StatsOptions): string;
  12635. }
  12636. type StatsAsset = KnownStatsAsset & Record<string, any>;
  12637. type StatsChunk = KnownStatsChunk & Record<string, any>;
  12638. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  12639. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  12640. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  12641. type StatsError = KnownStatsError & Record<string, any>;
  12642. declare abstract class StatsFactory {
  12643. hooks: Readonly<{
  12644. extract: HookMap<SyncBailHook<[object, any, StatsFactoryContext], any>>;
  12645. filter: HookMap<
  12646. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12647. >;
  12648. sort: HookMap<
  12649. SyncBailHook<
  12650. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  12651. any
  12652. >
  12653. >;
  12654. filterSorted: HookMap<
  12655. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12656. >;
  12657. groupResults: HookMap<
  12658. SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
  12659. >;
  12660. sortResults: HookMap<
  12661. SyncBailHook<
  12662. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  12663. any
  12664. >
  12665. >;
  12666. filterResults: HookMap<
  12667. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12668. >;
  12669. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  12670. result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  12671. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  12672. getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  12673. }>;
  12674. create(
  12675. type: string,
  12676. data: any,
  12677. baseContext: Omit<StatsFactoryContext, "type">
  12678. ): any;
  12679. }
  12680. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  12681. type StatsLogging = KnownStatsLogging & Record<string, any>;
  12682. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  12683. type StatsModule = KnownStatsModule & Record<string, any>;
  12684. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  12685. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  12686. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  12687. Record<string, any>;
  12688. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  12689. /**
  12690. * Stats options object.
  12691. */
  12692. declare interface StatsOptions {
  12693. /**
  12694. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  12695. */
  12696. all?: boolean;
  12697. /**
  12698. * Add assets information.
  12699. */
  12700. assets?: boolean;
  12701. /**
  12702. * Sort the assets by that field.
  12703. */
  12704. assetsSort?: string;
  12705. /**
  12706. * Space to display assets (groups will be collapsed to fit this space).
  12707. */
  12708. assetsSpace?: number;
  12709. /**
  12710. * Add built at time information.
  12711. */
  12712. builtAt?: boolean;
  12713. /**
  12714. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  12715. */
  12716. cached?: boolean;
  12717. /**
  12718. * Show cached assets (setting this to `false` only shows emitted files).
  12719. */
  12720. cachedAssets?: boolean;
  12721. /**
  12722. * Add information about cached (not built) modules.
  12723. */
  12724. cachedModules?: boolean;
  12725. /**
  12726. * Add children information.
  12727. */
  12728. children?: boolean;
  12729. /**
  12730. * Display auxiliary assets in chunk groups.
  12731. */
  12732. chunkGroupAuxiliary?: boolean;
  12733. /**
  12734. * Display children of chunk groups.
  12735. */
  12736. chunkGroupChildren?: boolean;
  12737. /**
  12738. * Limit of assets displayed in chunk groups.
  12739. */
  12740. chunkGroupMaxAssets?: number;
  12741. /**
  12742. * Display all chunk groups with the corresponding bundles.
  12743. */
  12744. chunkGroups?: boolean;
  12745. /**
  12746. * Add built modules information to chunk information.
  12747. */
  12748. chunkModules?: boolean;
  12749. /**
  12750. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  12751. */
  12752. chunkModulesSpace?: number;
  12753. /**
  12754. * Add the origins of chunks and chunk merging info.
  12755. */
  12756. chunkOrigins?: boolean;
  12757. /**
  12758. * Add information about parent, children and sibling chunks to chunk information.
  12759. */
  12760. chunkRelations?: boolean;
  12761. /**
  12762. * Add chunk information.
  12763. */
  12764. chunks?: boolean;
  12765. /**
  12766. * Sort the chunks by that field.
  12767. */
  12768. chunksSort?: string;
  12769. /**
  12770. * Enables/Disables colorful output.
  12771. */
  12772. colors?:
  12773. | boolean
  12774. | {
  12775. /**
  12776. * Custom color for bold text.
  12777. */
  12778. bold?: string;
  12779. /**
  12780. * Custom color for cyan text.
  12781. */
  12782. cyan?: string;
  12783. /**
  12784. * Custom color for green text.
  12785. */
  12786. green?: string;
  12787. /**
  12788. * Custom color for magenta text.
  12789. */
  12790. magenta?: string;
  12791. /**
  12792. * Custom color for red text.
  12793. */
  12794. red?: string;
  12795. /**
  12796. * Custom color for yellow text.
  12797. */
  12798. yellow?: string;
  12799. };
  12800. /**
  12801. * Context directory for request shortening.
  12802. */
  12803. context?: string;
  12804. /**
  12805. * Show chunk modules that are dependencies of other modules of the chunk.
  12806. */
  12807. dependentModules?: boolean;
  12808. /**
  12809. * Add module depth in module graph.
  12810. */
  12811. depth?: boolean;
  12812. /**
  12813. * Display the entry points with the corresponding bundles.
  12814. */
  12815. entrypoints?: boolean | "auto";
  12816. /**
  12817. * Add --env information.
  12818. */
  12819. env?: boolean;
  12820. /**
  12821. * Add details to errors (like resolving log).
  12822. */
  12823. errorDetails?: boolean | "auto";
  12824. /**
  12825. * Add internal stack trace to errors.
  12826. */
  12827. errorStack?: boolean;
  12828. /**
  12829. * Add errors.
  12830. */
  12831. errors?: boolean;
  12832. /**
  12833. * Add errors count.
  12834. */
  12835. errorsCount?: boolean;
  12836. /**
  12837. * Space to display errors (value is in number of lines).
  12838. */
  12839. errorsSpace?: number;
  12840. /**
  12841. * Please use excludeModules instead.
  12842. */
  12843. exclude?:
  12844. | string
  12845. | boolean
  12846. | RegExp
  12847. | ModuleFilterItemTypes[]
  12848. | ((
  12849. name: string,
  12850. module: StatsModule,
  12851. type: "module" | "chunk" | "root-of-chunk" | "nested"
  12852. ) => boolean);
  12853. /**
  12854. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  12855. */
  12856. excludeAssets?:
  12857. | string
  12858. | RegExp
  12859. | AssetFilterItemTypes[]
  12860. | ((name: string, asset: StatsAsset) => boolean);
  12861. /**
  12862. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  12863. */
  12864. excludeModules?:
  12865. | string
  12866. | boolean
  12867. | RegExp
  12868. | ModuleFilterItemTypes[]
  12869. | ((
  12870. name: string,
  12871. module: StatsModule,
  12872. type: "module" | "chunk" | "root-of-chunk" | "nested"
  12873. ) => boolean);
  12874. /**
  12875. * Group assets by how their are related to chunks.
  12876. */
  12877. groupAssetsByChunk?: boolean;
  12878. /**
  12879. * Group assets by their status (emitted, compared for emit or cached).
  12880. */
  12881. groupAssetsByEmitStatus?: boolean;
  12882. /**
  12883. * Group assets by their extension.
  12884. */
  12885. groupAssetsByExtension?: boolean;
  12886. /**
  12887. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  12888. */
  12889. groupAssetsByInfo?: boolean;
  12890. /**
  12891. * Group assets by their path.
  12892. */
  12893. groupAssetsByPath?: boolean;
  12894. /**
  12895. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  12896. */
  12897. groupModulesByAttributes?: boolean;
  12898. /**
  12899. * Group modules by their status (cached or built and cacheable).
  12900. */
  12901. groupModulesByCacheStatus?: boolean;
  12902. /**
  12903. * Group modules by their extension.
  12904. */
  12905. groupModulesByExtension?: boolean;
  12906. /**
  12907. * Group modules by their layer.
  12908. */
  12909. groupModulesByLayer?: boolean;
  12910. /**
  12911. * Group modules by their path.
  12912. */
  12913. groupModulesByPath?: boolean;
  12914. /**
  12915. * Group modules by their type.
  12916. */
  12917. groupModulesByType?: boolean;
  12918. /**
  12919. * Group reasons by their origin module.
  12920. */
  12921. groupReasonsByOrigin?: boolean;
  12922. /**
  12923. * Add the hash of the compilation.
  12924. */
  12925. hash?: boolean;
  12926. /**
  12927. * Add ids.
  12928. */
  12929. ids?: boolean;
  12930. /**
  12931. * Add logging output.
  12932. */
  12933. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  12934. /**
  12935. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  12936. */
  12937. loggingDebug?:
  12938. | string
  12939. | boolean
  12940. | RegExp
  12941. | FilterItemTypes[]
  12942. | ((value: string) => boolean);
  12943. /**
  12944. * Add stack traces to logging output.
  12945. */
  12946. loggingTrace?: boolean;
  12947. /**
  12948. * Add information about assets inside modules.
  12949. */
  12950. moduleAssets?: boolean;
  12951. /**
  12952. * Add dependencies and origin of warnings/errors.
  12953. */
  12954. moduleTrace?: boolean;
  12955. /**
  12956. * Add built modules information.
  12957. */
  12958. modules?: boolean;
  12959. /**
  12960. * Sort the modules by that field.
  12961. */
  12962. modulesSort?: string;
  12963. /**
  12964. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  12965. */
  12966. modulesSpace?: number;
  12967. /**
  12968. * Add information about modules nested in other modules (like with module concatenation).
  12969. */
  12970. nestedModules?: boolean;
  12971. /**
  12972. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  12973. */
  12974. nestedModulesSpace?: number;
  12975. /**
  12976. * Show reasons why optimization bailed out for modules.
  12977. */
  12978. optimizationBailout?: boolean;
  12979. /**
  12980. * Add information about orphan modules.
  12981. */
  12982. orphanModules?: boolean;
  12983. /**
  12984. * Add output path information.
  12985. */
  12986. outputPath?: boolean;
  12987. /**
  12988. * Add performance hint flags.
  12989. */
  12990. performance?: boolean;
  12991. /**
  12992. * Preset for the default values.
  12993. */
  12994. preset?: string | boolean;
  12995. /**
  12996. * Show exports provided by modules.
  12997. */
  12998. providedExports?: boolean;
  12999. /**
  13000. * Add public path information.
  13001. */
  13002. publicPath?: boolean;
  13003. /**
  13004. * Add information about the reasons why modules are included.
  13005. */
  13006. reasons?: boolean;
  13007. /**
  13008. * Space to display reasons (groups will be collapsed to fit this space).
  13009. */
  13010. reasonsSpace?: number;
  13011. /**
  13012. * Add information about assets that are related to other assets (like SourceMaps for assets).
  13013. */
  13014. relatedAssets?: boolean;
  13015. /**
  13016. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  13017. */
  13018. runtime?: boolean;
  13019. /**
  13020. * Add information about runtime modules.
  13021. */
  13022. runtimeModules?: boolean;
  13023. /**
  13024. * Add the source code of modules.
  13025. */
  13026. source?: boolean;
  13027. /**
  13028. * Add timing information.
  13029. */
  13030. timings?: boolean;
  13031. /**
  13032. * Show exports used by modules.
  13033. */
  13034. usedExports?: boolean;
  13035. /**
  13036. * Add webpack version information.
  13037. */
  13038. version?: boolean;
  13039. /**
  13040. * Add warnings.
  13041. */
  13042. warnings?: boolean;
  13043. /**
  13044. * Add warnings count.
  13045. */
  13046. warningsCount?: boolean;
  13047. /**
  13048. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  13049. */
  13050. warningsFilter?:
  13051. | string
  13052. | RegExp
  13053. | WarningFilterItemTypes[]
  13054. | ((warning: StatsError, value: string) => boolean);
  13055. /**
  13056. * Space to display warnings (value is in number of lines).
  13057. */
  13058. warningsSpace?: number;
  13059. }
  13060. declare abstract class StatsPrinter {
  13061. hooks: Readonly<{
  13062. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
  13063. printElements: HookMap<
  13064. SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
  13065. >;
  13066. sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
  13067. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
  13068. printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
  13069. print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
  13070. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  13071. }>;
  13072. print(type: string, object: object, baseContext?: object): string;
  13073. }
  13074. type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
  13075. type StatsProfile = KnownStatsProfile & Record<string, any>;
  13076. type StatsValue =
  13077. | boolean
  13078. | StatsOptions
  13079. | "none"
  13080. | "verbose"
  13081. | "summary"
  13082. | "errors-only"
  13083. | "errors-warnings"
  13084. | "minimal"
  13085. | "normal"
  13086. | "detailed";
  13087. declare class SyncModuleIdsPlugin {
  13088. constructor(__0: {
  13089. /**
  13090. * path to file
  13091. */
  13092. path: string;
  13093. /**
  13094. * context for module names
  13095. */
  13096. context?: string;
  13097. /**
  13098. * selector for modules
  13099. */
  13100. test: (arg0: Module) => boolean;
  13101. /**
  13102. * operation mode (defaults to merge)
  13103. */
  13104. mode?: "read" | "merge" | "create" | "update";
  13105. });
  13106. /**
  13107. * Apply the plugin
  13108. */
  13109. apply(compiler: Compiler): void;
  13110. }
  13111. declare interface SyntheticDependencyLocation {
  13112. name: string;
  13113. index?: number;
  13114. }
  13115. declare const TOMBSTONE: unique symbol;
  13116. declare const TRANSITIVE: unique symbol;
  13117. declare const TRANSITIVE_ONLY: unique symbol;
  13118. /**
  13119. * Helper function for joining two ranges into a single range. This is useful
  13120. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  13121. * to create the range of the _parent node_.
  13122. */
  13123. declare interface TagInfo {
  13124. tag: any;
  13125. data: any;
  13126. next?: TagInfo;
  13127. }
  13128. declare class Template {
  13129. constructor();
  13130. static getFunctionContent(fn: Function): string;
  13131. static toIdentifier(str: string): string;
  13132. static toComment(str: string): string;
  13133. static toNormalComment(str: string): string;
  13134. static toPath(str: string): string;
  13135. static numberToIdentifier(n: number): string;
  13136. static numberToIdentifierContinuation(n: number): string;
  13137. static indent(s: string | string[]): string;
  13138. static prefix(s: string | string[], prefix: string): string;
  13139. static asString(str: string | string[]): string;
  13140. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  13141. static renderChunkModules(
  13142. renderContext: ChunkRenderContext,
  13143. modules: Module[],
  13144. renderModule: (arg0: Module) => Source,
  13145. prefix?: string
  13146. ): null | Source;
  13147. static renderRuntimeModules(
  13148. runtimeModules: RuntimeModule[],
  13149. renderContext: RenderContext & {
  13150. codeGenerationResults?: CodeGenerationResults;
  13151. }
  13152. ): Source;
  13153. static renderChunkRuntimeModules(
  13154. runtimeModules: RuntimeModule[],
  13155. renderContext: RenderContext
  13156. ): Source;
  13157. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  13158. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  13159. }
  13160. declare interface TimestampAndHash {
  13161. safeTime: number;
  13162. timestamp?: number;
  13163. hash: string;
  13164. }
  13165. declare class TopLevelSymbol {
  13166. constructor(name: string);
  13167. name: string;
  13168. }
  13169. /**
  13170. * Use a Trusted Types policy to create urls for chunks.
  13171. */
  13172. declare interface TrustedTypes {
  13173. /**
  13174. * 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'.
  13175. */
  13176. onPolicyCreationFailure?: "continue" | "stop";
  13177. /**
  13178. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  13179. */
  13180. policyName?: string;
  13181. }
  13182. declare const UNDEFINED_MARKER: unique symbol;
  13183. /**
  13184. * `URL` class is a global reference for `require('url').URL`
  13185. * https://nodejs.org/api/url.html#the-whatwg-url-api
  13186. */
  13187. declare interface URL_url extends URL {}
  13188. declare interface UnsafeCacheData {
  13189. factoryMeta?: FactoryMeta;
  13190. resolveOptions?: ResolveOptions;
  13191. }
  13192. declare interface UpdateHashContextDependency {
  13193. chunkGraph: ChunkGraph;
  13194. runtime: RuntimeSpec;
  13195. runtimeTemplate?: RuntimeTemplate;
  13196. }
  13197. declare interface UpdateHashContextGenerator {
  13198. /**
  13199. * the module
  13200. */
  13201. module: NormalModule;
  13202. chunkGraph: ChunkGraph;
  13203. runtime: RuntimeSpec;
  13204. runtimeTemplate?: RuntimeTemplate;
  13205. }
  13206. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  13207. declare abstract class VariableInfo {
  13208. declaredScope: ScopeInfo;
  13209. freeName?: string | true;
  13210. tagInfo?: TagInfo;
  13211. }
  13212. declare interface VariableInfoInterface {
  13213. declaredScope: ScopeInfo;
  13214. freeName: string | true;
  13215. tagInfo?: TagInfo;
  13216. }
  13217. type WarningFilterItemTypes =
  13218. | string
  13219. | RegExp
  13220. | ((warning: StatsError, value: string) => boolean);
  13221. declare interface WatchFileSystem {
  13222. watch: (
  13223. files: Iterable<string>,
  13224. directories: Iterable<string>,
  13225. missing: Iterable<string>,
  13226. startTime: number,
  13227. options: WatchOptions,
  13228. callback: (
  13229. arg0: null | Error,
  13230. arg1: Map<string, FileSystemInfoEntry | "ignore">,
  13231. arg2: Map<string, FileSystemInfoEntry | "ignore">,
  13232. arg3: Set<string>,
  13233. arg4: Set<string>
  13234. ) => void,
  13235. callbackUndelayed: (arg0: string, arg1: number) => void
  13236. ) => Watcher;
  13237. }
  13238. declare class WatchIgnorePlugin {
  13239. constructor(options: WatchIgnorePluginOptions);
  13240. paths: (string | RegExp)[];
  13241. /**
  13242. * Apply the plugin
  13243. */
  13244. apply(compiler: Compiler): void;
  13245. }
  13246. declare interface WatchIgnorePluginOptions {
  13247. /**
  13248. * A list of RegExps or absolute paths to directories or files that should be ignored.
  13249. */
  13250. paths: (string | RegExp)[];
  13251. }
  13252. /**
  13253. * Options for the watcher.
  13254. */
  13255. declare interface WatchOptions {
  13256. /**
  13257. * Delay the rebuilt after the first change. Value is a time in ms.
  13258. */
  13259. aggregateTimeout?: number;
  13260. /**
  13261. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  13262. */
  13263. followSymlinks?: boolean;
  13264. /**
  13265. * Ignore some files from watching (glob pattern or regexp).
  13266. */
  13267. ignored?: string | RegExp | string[];
  13268. /**
  13269. * Enable polling mode for watching.
  13270. */
  13271. poll?: number | boolean;
  13272. /**
  13273. * Stop watching when stdin stream has ended.
  13274. */
  13275. stdin?: boolean;
  13276. }
  13277. declare interface Watcher {
  13278. /**
  13279. * closes the watcher and all underlying file watchers
  13280. */
  13281. close: () => void;
  13282. /**
  13283. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  13284. */
  13285. pause: () => void;
  13286. /**
  13287. * get current aggregated changes that have not yet send to callback
  13288. */
  13289. getAggregatedChanges?: () => Set<string>;
  13290. /**
  13291. * get current aggregated removals that have not yet send to callback
  13292. */
  13293. getAggregatedRemovals?: () => Set<string>;
  13294. /**
  13295. * get info about files
  13296. */
  13297. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  13298. /**
  13299. * get info about directories
  13300. */
  13301. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  13302. /**
  13303. * get info about timestamps and changes
  13304. */
  13305. getInfo?: () => WatcherInfo;
  13306. }
  13307. declare interface WatcherInfo {
  13308. /**
  13309. * get current aggregated changes that have not yet send to callback
  13310. */
  13311. changes: Set<string>;
  13312. /**
  13313. * get current aggregated removals that have not yet send to callback
  13314. */
  13315. removals: Set<string>;
  13316. /**
  13317. * get info about files
  13318. */
  13319. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  13320. /**
  13321. * get info about directories
  13322. */
  13323. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  13324. }
  13325. declare abstract class Watching {
  13326. startTime: null | number;
  13327. invalid: boolean;
  13328. handler: CallbackFunction_1<Stats>;
  13329. callbacks: CallbackFunction_1<void>[];
  13330. closed: boolean;
  13331. suspended: boolean;
  13332. blocked: boolean;
  13333. watchOptions: {
  13334. /**
  13335. * Delay the rebuilt after the first change. Value is a time in ms.
  13336. */
  13337. aggregateTimeout?: number;
  13338. /**
  13339. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  13340. */
  13341. followSymlinks?: boolean;
  13342. /**
  13343. * Ignore some files from watching (glob pattern or regexp).
  13344. */
  13345. ignored?: string | RegExp | string[];
  13346. /**
  13347. * Enable polling mode for watching.
  13348. */
  13349. poll?: number | boolean;
  13350. /**
  13351. * Stop watching when stdin stream has ended.
  13352. */
  13353. stdin?: boolean;
  13354. };
  13355. compiler: Compiler;
  13356. running: boolean;
  13357. watcher?: null | Watcher;
  13358. pausedWatcher?: null | Watcher;
  13359. lastWatcherStartTime?: number;
  13360. watch(
  13361. files: Iterable<string>,
  13362. dirs: Iterable<string>,
  13363. missing: Iterable<string>
  13364. ): void;
  13365. invalidate(callback?: CallbackFunction_1<void>): void;
  13366. suspend(): void;
  13367. resume(): void;
  13368. close(callback: CallbackFunction_1<void>): void;
  13369. }
  13370. declare abstract class WeakTupleMap<T extends any[], V> {
  13371. set(...args: [T, ...V[]]): void;
  13372. has(...args: T): boolean;
  13373. get(...args: T): undefined | V;
  13374. provide(...args: [T, ...(() => V)[]]): V;
  13375. delete(...args: T): void;
  13376. clear(): void;
  13377. }
  13378. declare interface WebAssemblyRenderContext {
  13379. /**
  13380. * the chunk
  13381. */
  13382. chunk: Chunk;
  13383. /**
  13384. * the dependency templates
  13385. */
  13386. dependencyTemplates: DependencyTemplates;
  13387. /**
  13388. * the runtime template
  13389. */
  13390. runtimeTemplate: RuntimeTemplate;
  13391. /**
  13392. * the module graph
  13393. */
  13394. moduleGraph: ModuleGraph;
  13395. /**
  13396. * the chunk graph
  13397. */
  13398. chunkGraph: ChunkGraph;
  13399. /**
  13400. * results of code generation
  13401. */
  13402. codeGenerationResults: CodeGenerationResults;
  13403. }
  13404. declare class WebWorkerTemplatePlugin {
  13405. constructor();
  13406. /**
  13407. * Apply the plugin
  13408. */
  13409. apply(compiler: Compiler): void;
  13410. }
  13411. declare class WebpackError extends Error {
  13412. /**
  13413. * Creates an instance of WebpackError.
  13414. */
  13415. constructor(message?: string);
  13416. details?: string;
  13417. module?: null | Module;
  13418. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  13419. hideStack?: boolean;
  13420. chunk?: Chunk;
  13421. file?: string;
  13422. serialize(__0: ObjectSerializerContext): void;
  13423. deserialize(__0: ObjectDeserializerContext): void;
  13424. /**
  13425. * Create .stack property on a target object
  13426. */
  13427. static captureStackTrace(
  13428. targetObject: object,
  13429. constructorOpt?: Function
  13430. ): void;
  13431. /**
  13432. * Optional override for formatting stack traces
  13433. */
  13434. static prepareStackTrace?: (
  13435. err: Error,
  13436. stackTraces: NodeJS.CallSite[]
  13437. ) => any;
  13438. static stackTraceLimit: number;
  13439. }
  13440. declare abstract class WebpackLogger {
  13441. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  13442. error(...args: any[]): void;
  13443. warn(...args: any[]): void;
  13444. info(...args: any[]): void;
  13445. log(...args: any[]): void;
  13446. debug(...args: any[]): void;
  13447. assert(assertion: any, ...args: any[]): void;
  13448. trace(): void;
  13449. clear(): void;
  13450. status(...args: any[]): void;
  13451. group(...args: any[]): void;
  13452. groupCollapsed(...args: any[]): void;
  13453. groupEnd(...args: any[]): void;
  13454. profile(label?: string): void;
  13455. profileEnd(label?: string): void;
  13456. time(label: string): void;
  13457. timeLog(label?: string): void;
  13458. timeEnd(label?: string): void;
  13459. timeAggregate(label?: string): void;
  13460. timeAggregateEnd(label?: string): void;
  13461. }
  13462. declare class WebpackOptionsApply extends OptionsApply {
  13463. constructor();
  13464. }
  13465. declare class WebpackOptionsDefaulter {
  13466. constructor();
  13467. process(options: Configuration): WebpackOptionsNormalized;
  13468. }
  13469. /**
  13470. * Normalized webpack options object.
  13471. */
  13472. declare interface WebpackOptionsNormalized {
  13473. /**
  13474. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  13475. */
  13476. amd?: false | { [index: string]: any };
  13477. /**
  13478. * Report the first error as a hard error instead of tolerating it.
  13479. */
  13480. bail?: boolean;
  13481. /**
  13482. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  13483. */
  13484. cache: CacheOptionsNormalized;
  13485. /**
  13486. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  13487. */
  13488. context?: string;
  13489. /**
  13490. * References to other configurations to depend on.
  13491. */
  13492. dependencies?: string[];
  13493. /**
  13494. * Options for the webpack-dev-server.
  13495. */
  13496. devServer?: false | { [index: string]: any };
  13497. /**
  13498. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  13499. */
  13500. devtool?: string | false;
  13501. /**
  13502. * The entry point(s) of the compilation.
  13503. */
  13504. entry: EntryNormalized;
  13505. /**
  13506. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  13507. */
  13508. experiments: ExperimentsNormalized;
  13509. /**
  13510. * 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`.
  13511. */
  13512. externals: Externals;
  13513. /**
  13514. * Enable presets of externals for specific targets.
  13515. */
  13516. externalsPresets: ExternalsPresets;
  13517. /**
  13518. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  13519. */
  13520. externalsType?:
  13521. | "import"
  13522. | "var"
  13523. | "module"
  13524. | "assign"
  13525. | "this"
  13526. | "window"
  13527. | "self"
  13528. | "global"
  13529. | "commonjs"
  13530. | "commonjs2"
  13531. | "commonjs-module"
  13532. | "commonjs-static"
  13533. | "amd"
  13534. | "amd-require"
  13535. | "umd"
  13536. | "umd2"
  13537. | "jsonp"
  13538. | "system"
  13539. | "promise"
  13540. | "script"
  13541. | "node-commonjs";
  13542. /**
  13543. * Ignore specific warnings.
  13544. */
  13545. ignoreWarnings?: ((
  13546. warning: WebpackError,
  13547. compilation: Compilation
  13548. ) => boolean)[];
  13549. /**
  13550. * Options for infrastructure level logging.
  13551. */
  13552. infrastructureLogging: InfrastructureLogging;
  13553. /**
  13554. * Custom values available in the loader context.
  13555. */
  13556. loader?: Loader;
  13557. /**
  13558. * Enable production optimizations or development hints.
  13559. */
  13560. mode?: "none" | "development" | "production";
  13561. /**
  13562. * Options affecting the normal modules (`NormalModuleFactory`).
  13563. */
  13564. module: ModuleOptionsNormalized;
  13565. /**
  13566. * Name of the configuration. Used when loading multiple configurations.
  13567. */
  13568. name?: string;
  13569. /**
  13570. * Include polyfills or mocks for various node stuff.
  13571. */
  13572. node: Node;
  13573. /**
  13574. * Enables/Disables integrated optimizations.
  13575. */
  13576. optimization: Optimization;
  13577. /**
  13578. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  13579. */
  13580. output: OutputNormalized;
  13581. /**
  13582. * The number of parallel processed modules in the compilation.
  13583. */
  13584. parallelism?: number;
  13585. /**
  13586. * Configuration for web performance recommendations.
  13587. */
  13588. performance?: false | PerformanceOptions;
  13589. /**
  13590. * Add additional plugins to the compiler.
  13591. */
  13592. plugins: (
  13593. | undefined
  13594. | null
  13595. | false
  13596. | ""
  13597. | 0
  13598. | ((this: Compiler, compiler: Compiler) => void)
  13599. | WebpackPluginInstance
  13600. )[];
  13601. /**
  13602. * Capture timing information for each module.
  13603. */
  13604. profile?: boolean;
  13605. /**
  13606. * Store compiler state to a json file.
  13607. */
  13608. recordsInputPath?: string | false;
  13609. /**
  13610. * Load compiler state from a json file.
  13611. */
  13612. recordsOutputPath?: string | false;
  13613. /**
  13614. * Options for the resolver.
  13615. */
  13616. resolve: ResolveOptions;
  13617. /**
  13618. * Options for the resolver when resolving loaders.
  13619. */
  13620. resolveLoader: ResolveOptions;
  13621. /**
  13622. * Options affecting how file system snapshots are created and validated.
  13623. */
  13624. snapshot: SnapshotOptionsWebpackOptions;
  13625. /**
  13626. * Stats options object or preset name.
  13627. */
  13628. stats: StatsValue;
  13629. /**
  13630. * Environment to build for. An array of environments to build for all of them when possible.
  13631. */
  13632. target?: string | false | string[];
  13633. /**
  13634. * Enter watch mode, which rebuilds on file change.
  13635. */
  13636. watch?: boolean;
  13637. /**
  13638. * Options for the watcher.
  13639. */
  13640. watchOptions: WatchOptions;
  13641. }
  13642. /**
  13643. * Plugin instance.
  13644. */
  13645. declare interface WebpackPluginInstance {
  13646. [index: string]: any;
  13647. /**
  13648. * The run point of the plugin, required method.
  13649. */
  13650. apply: (compiler: Compiler) => void;
  13651. }
  13652. declare interface WithId {
  13653. id: string | number;
  13654. }
  13655. declare interface WithOptions {
  13656. /**
  13657. * create a resolver with additional/different options
  13658. */
  13659. withOptions: (
  13660. arg0: Partial<ResolveOptionsWithDependencyType>
  13661. ) => ResolverWithOptions;
  13662. }
  13663. declare interface WriteFile {
  13664. (
  13665. file: PathOrFileDescriptorFs,
  13666. data:
  13667. | string
  13668. | Uint8Array
  13669. | Uint8ClampedArray
  13670. | Uint16Array
  13671. | Uint32Array
  13672. | Int8Array
  13673. | Int16Array
  13674. | Int32Array
  13675. | BigUint64Array
  13676. | BigInt64Array
  13677. | Float32Array
  13678. | Float64Array
  13679. | DataView,
  13680. options: WriteFileOptions,
  13681. callback: (arg0: null | NodeJS.ErrnoException) => void
  13682. ): void;
  13683. (
  13684. file: PathOrFileDescriptorFs,
  13685. data:
  13686. | string
  13687. | Uint8Array
  13688. | Uint8ClampedArray
  13689. | Uint16Array
  13690. | Uint32Array
  13691. | Int8Array
  13692. | Int16Array
  13693. | Int32Array
  13694. | BigUint64Array
  13695. | BigInt64Array
  13696. | Float32Array
  13697. | Float64Array
  13698. | DataView,
  13699. callback: (arg0: null | NodeJS.ErrnoException) => void
  13700. ): void;
  13701. }
  13702. type WriteFileOptions =
  13703. | null
  13704. | "ascii"
  13705. | "utf8"
  13706. | "utf-8"
  13707. | "utf16le"
  13708. | "utf-16le"
  13709. | "ucs2"
  13710. | "ucs-2"
  13711. | "latin1"
  13712. | "binary"
  13713. | "base64"
  13714. | "base64url"
  13715. | "hex"
  13716. | (ObjectEncodingOptions &
  13717. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  13718. declare interface WriteOnlySet<T> {
  13719. add: (item: T) => void;
  13720. }
  13721. declare interface WriteStreamOptions {
  13722. flags?: string;
  13723. encoding?:
  13724. | "ascii"
  13725. | "utf8"
  13726. | "utf-8"
  13727. | "utf16le"
  13728. | "utf-16le"
  13729. | "ucs2"
  13730. | "ucs-2"
  13731. | "latin1"
  13732. | "binary"
  13733. | "base64"
  13734. | "base64url"
  13735. | "hex";
  13736. fd?: any;
  13737. mode?: number;
  13738. autoClose?: boolean;
  13739. emitClose?: boolean;
  13740. start?: number;
  13741. signal?: null | AbortSignal;
  13742. fs?: null | CreateWriteStreamFSImplementation;
  13743. }
  13744. type __TypeWebpackOptions = (data: object) =>
  13745. | string
  13746. | {
  13747. /**
  13748. * Unique loader options identifier.
  13749. */
  13750. ident?: string;
  13751. /**
  13752. * Loader name.
  13753. */
  13754. loader?: string;
  13755. /**
  13756. * Loader options.
  13757. */
  13758. options?: string | { [index: string]: any };
  13759. }
  13760. | __TypeWebpackOptions
  13761. | __Type_2[];
  13762. type __Type_2 =
  13763. | undefined
  13764. | null
  13765. | string
  13766. | false
  13767. | 0
  13768. | {
  13769. /**
  13770. * Unique loader options identifier.
  13771. */
  13772. ident?: string;
  13773. /**
  13774. * Loader name.
  13775. */
  13776. loader?: string;
  13777. /**
  13778. * Loader options.
  13779. */
  13780. options?: string | { [index: string]: any };
  13781. }
  13782. | ((data: object) =>
  13783. | string
  13784. | {
  13785. /**
  13786. * Unique loader options identifier.
  13787. */
  13788. ident?: string;
  13789. /**
  13790. * Loader name.
  13791. */
  13792. loader?: string;
  13793. /**
  13794. * Loader options.
  13795. */
  13796. options?: string | { [index: string]: any };
  13797. }
  13798. | __TypeWebpackOptions
  13799. | __Type_2[]);
  13800. declare function exports(
  13801. options: Configuration,
  13802. callback?: CallbackWebpack<Stats>
  13803. ): Compiler;
  13804. declare function exports(
  13805. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  13806. callback?: CallbackWebpack<MultiStats>
  13807. ): MultiCompiler;
  13808. declare namespace exports {
  13809. export const webpack: {
  13810. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  13811. (
  13812. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  13813. callback?: CallbackWebpack<MultiStats>
  13814. ): MultiCompiler;
  13815. };
  13816. export const validate: (options?: any) => void;
  13817. export const validateSchema: (
  13818. schema: Parameters<typeof validateFunction>[0],
  13819. options: Parameters<typeof validateFunction>[1],
  13820. validationConfiguration?: ValidationErrorConfiguration
  13821. ) => void;
  13822. export const version: string;
  13823. export namespace cli {
  13824. export let getArguments: (schema?: any) => Record<string, Argument>;
  13825. export let processArguments: (
  13826. args: Record<string, Argument>,
  13827. config: any,
  13828. values: Record<
  13829. string,
  13830. | string
  13831. | number
  13832. | boolean
  13833. | RegExp
  13834. | (string | number | boolean | RegExp)[]
  13835. >
  13836. ) => null | Problem[];
  13837. }
  13838. export namespace ModuleFilenameHelpers {
  13839. export let ALL_LOADERS_RESOURCE: string;
  13840. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  13841. export let LOADERS_RESOURCE: string;
  13842. export let REGEXP_LOADERS_RESOURCE: RegExp;
  13843. export let RESOURCE: string;
  13844. export let REGEXP_RESOURCE: RegExp;
  13845. export let ABSOLUTE_RESOURCE_PATH: string;
  13846. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  13847. export let RESOURCE_PATH: string;
  13848. export let REGEXP_RESOURCE_PATH: RegExp;
  13849. export let ALL_LOADERS: string;
  13850. export let REGEXP_ALL_LOADERS: RegExp;
  13851. export let LOADERS: string;
  13852. export let REGEXP_LOADERS: RegExp;
  13853. export let QUERY: string;
  13854. export let REGEXP_QUERY: RegExp;
  13855. export let ID: string;
  13856. export let REGEXP_ID: RegExp;
  13857. export let HASH: string;
  13858. export let REGEXP_HASH: RegExp;
  13859. export let NAMESPACE: string;
  13860. export let REGEXP_NAMESPACE: RegExp;
  13861. export let createFilename: (
  13862. module: string | Module,
  13863. options: any,
  13864. __2: {
  13865. /**
  13866. * requestShortener
  13867. */
  13868. requestShortener: RequestShortener;
  13869. /**
  13870. * chunk graph
  13871. */
  13872. chunkGraph: ChunkGraph;
  13873. /**
  13874. * the hash function to use
  13875. */
  13876. hashFunction?: string | typeof Hash;
  13877. }
  13878. ) => string;
  13879. export let replaceDuplicates: <T>(
  13880. array: T[],
  13881. fn: (
  13882. duplicateItem: T,
  13883. duplicateItemIndex: number,
  13884. numberOfTimesReplaced: number
  13885. ) => T,
  13886. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  13887. ) => T[];
  13888. export let matchPart: (str: string, test: Matcher) => boolean;
  13889. export let matchObject: (obj: MatchObject, str: string) => boolean;
  13890. }
  13891. export namespace OptimizationStages {
  13892. export let STAGE_BASIC: -10;
  13893. export let STAGE_DEFAULT: 0;
  13894. export let STAGE_ADVANCED: 10;
  13895. }
  13896. export namespace RuntimeGlobals {
  13897. export let require: "__webpack_require__";
  13898. export let requireScope: "__webpack_require__.*";
  13899. export let exports: "__webpack_exports__";
  13900. export let thisAsExports: "top-level-this-exports";
  13901. export let returnExportsFromRuntime: "return-exports-from-runtime";
  13902. export let module: "module";
  13903. export let moduleId: "module.id";
  13904. export let moduleLoaded: "module.loaded";
  13905. export let publicPath: "__webpack_require__.p";
  13906. export let entryModuleId: "__webpack_require__.s";
  13907. export let moduleCache: "__webpack_require__.c";
  13908. export let moduleFactories: "__webpack_require__.m";
  13909. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  13910. export let ensureChunk: "__webpack_require__.e";
  13911. export let ensureChunkHandlers: "__webpack_require__.f";
  13912. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  13913. export let prefetchChunk: "__webpack_require__.E";
  13914. export let prefetchChunkHandlers: "__webpack_require__.F";
  13915. export let preloadChunk: "__webpack_require__.G";
  13916. export let preloadChunkHandlers: "__webpack_require__.H";
  13917. export let definePropertyGetters: "__webpack_require__.d";
  13918. export let makeNamespaceObject: "__webpack_require__.r";
  13919. export let createFakeNamespaceObject: "__webpack_require__.t";
  13920. export let compatGetDefaultExport: "__webpack_require__.n";
  13921. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  13922. export let nodeModuleDecorator: "__webpack_require__.nmd";
  13923. export let getFullHash: "__webpack_require__.h";
  13924. export let wasmInstances: "__webpack_require__.w";
  13925. export let instantiateWasm: "__webpack_require__.v";
  13926. export let uncaughtErrorHandler: "__webpack_require__.oe";
  13927. export let scriptNonce: "__webpack_require__.nc";
  13928. export let loadScript: "__webpack_require__.l";
  13929. export let createScript: "__webpack_require__.ts";
  13930. export let createScriptUrl: "__webpack_require__.tu";
  13931. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  13932. export let hasFetchPriority: "has fetch priority";
  13933. export let chunkName: "__webpack_require__.cn";
  13934. export let runtimeId: "__webpack_require__.j";
  13935. export let getChunkScriptFilename: "__webpack_require__.u";
  13936. export let getChunkCssFilename: "__webpack_require__.k";
  13937. export let hasCssModules: "has css modules";
  13938. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  13939. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  13940. export let startup: "__webpack_require__.x";
  13941. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  13942. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  13943. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  13944. export let chunkCallback: "webpackChunk";
  13945. export let startupEntrypoint: "__webpack_require__.X";
  13946. export let onChunksLoaded: "__webpack_require__.O";
  13947. export let externalInstallChunk: "__webpack_require__.C";
  13948. export let interceptModuleExecution: "__webpack_require__.i";
  13949. export let global: "__webpack_require__.g";
  13950. export let shareScopeMap: "__webpack_require__.S";
  13951. export let initializeSharing: "__webpack_require__.I";
  13952. export let currentRemoteGetScope: "__webpack_require__.R";
  13953. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  13954. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  13955. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  13956. export let hmrModuleData: "__webpack_require__.hmrD";
  13957. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  13958. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  13959. export let amdDefine: "__webpack_require__.amdD";
  13960. export let amdOptions: "__webpack_require__.amdO";
  13961. export let system: "__webpack_require__.System";
  13962. export let hasOwnProperty: "__webpack_require__.o";
  13963. export let systemContext: "__webpack_require__.y";
  13964. export let baseURI: "__webpack_require__.b";
  13965. export let relativeUrl: "__webpack_require__.U";
  13966. export let asyncModule: "__webpack_require__.a";
  13967. }
  13968. export const UsageState: Readonly<{
  13969. Unused: 0;
  13970. OnlyPropertiesUsed: 1;
  13971. NoInfo: 2;
  13972. Unknown: 3;
  13973. Used: 4;
  13974. }>;
  13975. export namespace cache {
  13976. export { MemoryCachePlugin };
  13977. }
  13978. export namespace config {
  13979. export const getNormalizedWebpackOptions: (
  13980. config: Configuration
  13981. ) => WebpackOptionsNormalized;
  13982. export const applyWebpackOptionsDefaults: (
  13983. options: WebpackOptionsNormalized,
  13984. compilerIndex?: number
  13985. ) => ResolvedOptions;
  13986. }
  13987. export namespace dependencies {
  13988. export {
  13989. ModuleDependency,
  13990. HarmonyImportDependency,
  13991. ConstDependency,
  13992. NullDependency
  13993. };
  13994. }
  13995. export namespace ids {
  13996. export {
  13997. ChunkModuleIdRangePlugin,
  13998. NaturalModuleIdsPlugin,
  13999. OccurrenceModuleIdsPlugin,
  14000. NamedModuleIdsPlugin,
  14001. DeterministicChunkIdsPlugin,
  14002. DeterministicModuleIdsPlugin,
  14003. NamedChunkIdsPlugin,
  14004. OccurrenceChunkIdsPlugin,
  14005. HashedModuleIdsPlugin
  14006. };
  14007. }
  14008. export namespace javascript {
  14009. export {
  14010. EnableChunkLoadingPlugin,
  14011. JavascriptModulesPlugin,
  14012. JavascriptParser
  14013. };
  14014. }
  14015. export namespace optimize {
  14016. export namespace InnerGraph {
  14017. export let bailout: (parserState: ParserState) => void;
  14018. export let enable: (parserState: ParserState) => void;
  14019. export let isEnabled: (parserState: ParserState) => boolean;
  14020. export let addUsage: (
  14021. state: ParserState,
  14022. symbol: null | TopLevelSymbol,
  14023. usage: string | true | TopLevelSymbol
  14024. ) => void;
  14025. export let addVariableUsage: (
  14026. parser: JavascriptParser,
  14027. name: string,
  14028. usage: string | true | TopLevelSymbol
  14029. ) => void;
  14030. export let inferDependencyUsage: (state: ParserState) => void;
  14031. export let onUsage: (
  14032. state: ParserState,
  14033. onUsageCallback: (arg0?: boolean | Set<string>) => void
  14034. ) => void;
  14035. export let setTopLevelSymbol: (
  14036. state: ParserState,
  14037. symbol?: TopLevelSymbol
  14038. ) => void;
  14039. export let getTopLevelSymbol: (
  14040. state: ParserState
  14041. ) => void | TopLevelSymbol;
  14042. export let tagTopLevelSymbol: (
  14043. parser: JavascriptParser,
  14044. name: string
  14045. ) => undefined | TopLevelSymbol;
  14046. export let isDependencyUsedByExports: (
  14047. dependency: Dependency,
  14048. usedByExports: boolean | Set<string>,
  14049. moduleGraph: ModuleGraph,
  14050. runtime: RuntimeSpec
  14051. ) => boolean;
  14052. export let getDependencyUsedByExportsCondition: (
  14053. dependency: Dependency,
  14054. usedByExports: undefined | boolean | Set<string>,
  14055. moduleGraph: ModuleGraph
  14056. ) =>
  14057. | null
  14058. | false
  14059. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  14060. export { TopLevelSymbol, topLevelSymbolTag };
  14061. }
  14062. export {
  14063. AggressiveMergingPlugin,
  14064. AggressiveSplittingPlugin,
  14065. LimitChunkCountPlugin,
  14066. MinChunkSizePlugin,
  14067. ModuleConcatenationPlugin,
  14068. RealContentHashPlugin,
  14069. RuntimeChunkPlugin,
  14070. SideEffectsFlagPlugin,
  14071. SplitChunksPlugin
  14072. };
  14073. }
  14074. export namespace runtime {
  14075. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  14076. }
  14077. export namespace prefetch {
  14078. export { ChunkPrefetchPreloadPlugin };
  14079. }
  14080. export namespace web {
  14081. export {
  14082. FetchCompileAsyncWasmPlugin,
  14083. FetchCompileWasmPlugin,
  14084. JsonpChunkLoadingRuntimeModule,
  14085. JsonpTemplatePlugin
  14086. };
  14087. }
  14088. export namespace webworker {
  14089. export { WebWorkerTemplatePlugin };
  14090. }
  14091. export namespace node {
  14092. export {
  14093. NodeEnvironmentPlugin,
  14094. NodeSourcePlugin,
  14095. NodeTargetPlugin,
  14096. NodeTemplatePlugin,
  14097. ReadFileCompileWasmPlugin
  14098. };
  14099. }
  14100. export namespace electron {
  14101. export { ElectronTargetPlugin };
  14102. }
  14103. export namespace wasm {
  14104. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  14105. }
  14106. export namespace library {
  14107. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  14108. }
  14109. export namespace container {
  14110. export const scope: <T>(
  14111. scope: string,
  14112. options: ContainerOptionsFormat<T>
  14113. ) => Record<string, string | string[] | T>;
  14114. export {
  14115. ContainerPlugin,
  14116. ContainerReferencePlugin,
  14117. ModuleFederationPlugin
  14118. };
  14119. }
  14120. export namespace sharing {
  14121. export const scope: <T>(
  14122. scope: string,
  14123. options: ContainerOptionsFormat<T>
  14124. ) => Record<string, string | string[] | T>;
  14125. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  14126. }
  14127. export namespace debug {
  14128. export { ProfilingPlugin };
  14129. }
  14130. export namespace util {
  14131. export const createHash: (algorithm: string | typeof Hash) => Hash;
  14132. export namespace comparators {
  14133. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  14134. export let compareModulesByIdentifier: (
  14135. a: Module,
  14136. b: Module
  14137. ) => 0 | 1 | -1;
  14138. export let compareModulesById: ParameterizedComparator<
  14139. ChunkGraph,
  14140. Module
  14141. >;
  14142. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  14143. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  14144. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  14145. ModuleGraph,
  14146. Module
  14147. >;
  14148. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  14149. ModuleGraph,
  14150. Module
  14151. >;
  14152. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  14153. ChunkGraph,
  14154. Module
  14155. >;
  14156. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  14157. export let compareIds: (
  14158. a: string | number,
  14159. b: string | number
  14160. ) => 0 | 1 | -1;
  14161. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  14162. export let compareChunkGroupsByIndex: (
  14163. a: ChunkGroup,
  14164. b: ChunkGroup
  14165. ) => 0 | 1 | -1;
  14166. export let concatComparators: <T>(
  14167. c1: Comparator<T>,
  14168. c2: Comparator<T>,
  14169. ...cRest: Comparator<T>[]
  14170. ) => Comparator<T>;
  14171. export let compareSelect: <T, R>(
  14172. getter: Selector<T, R>,
  14173. comparator: Comparator<R>
  14174. ) => Comparator<T>;
  14175. export let compareIterables: <T>(
  14176. elementComparator: Comparator<T>
  14177. ) => Comparator<Iterable<T>>;
  14178. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  14179. export let compareChunksNatural: (
  14180. chunkGraph: ChunkGraph
  14181. ) => Comparator<Chunk>;
  14182. export let compareLocations: (
  14183. a: DependencyLocation,
  14184. b: DependencyLocation
  14185. ) => 0 | 1 | -1;
  14186. }
  14187. export namespace runtime {
  14188. export let getEntryRuntime: (
  14189. compilation: Compilation,
  14190. name: string,
  14191. options?: EntryOptions
  14192. ) => RuntimeSpec;
  14193. export let forEachRuntime: (
  14194. runtime: RuntimeSpec,
  14195. fn: (arg0?: string) => void,
  14196. deterministicOrder?: boolean
  14197. ) => void;
  14198. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  14199. export let keyToRuntime: (key: string) => RuntimeSpec;
  14200. export let runtimeToString: (runtime: RuntimeSpec) => string;
  14201. export let runtimeConditionToString: (
  14202. runtimeCondition: RuntimeCondition
  14203. ) => string;
  14204. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  14205. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  14206. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  14207. export let mergeRuntimeCondition: (
  14208. a: RuntimeCondition,
  14209. b: RuntimeCondition,
  14210. runtime: RuntimeSpec
  14211. ) => RuntimeCondition;
  14212. export let mergeRuntimeConditionNonFalse: (
  14213. a: undefined | string | true | SortableSet<string>,
  14214. b: undefined | string | true | SortableSet<string>,
  14215. runtime: RuntimeSpec
  14216. ) => undefined | string | true | SortableSet<string>;
  14217. export let mergeRuntimeOwned: (
  14218. a: RuntimeSpec,
  14219. b: RuntimeSpec
  14220. ) => RuntimeSpec;
  14221. export let intersectRuntime: (
  14222. a: RuntimeSpec,
  14223. b: RuntimeSpec
  14224. ) => RuntimeSpec;
  14225. export let subtractRuntime: (
  14226. a: RuntimeSpec,
  14227. b: RuntimeSpec
  14228. ) => RuntimeSpec;
  14229. export let subtractRuntimeCondition: (
  14230. a: RuntimeCondition,
  14231. b: RuntimeCondition,
  14232. runtime: RuntimeSpec
  14233. ) => RuntimeCondition;
  14234. export let filterRuntime: (
  14235. runtime: RuntimeSpec,
  14236. filter: (arg0: RuntimeSpec) => boolean
  14237. ) => undefined | string | boolean | SortableSet<string>;
  14238. export { RuntimeSpecMap, RuntimeSpecSet };
  14239. }
  14240. export namespace serialization {
  14241. export const register: (
  14242. Constructor: Constructor,
  14243. request: string,
  14244. name: null | string,
  14245. serializer: ObjectSerializer
  14246. ) => void;
  14247. export const registerLoader: (
  14248. regExp: RegExp,
  14249. loader: (arg0: string) => boolean
  14250. ) => void;
  14251. export const registerNotSerializable: (Constructor: Constructor) => void;
  14252. export const NOT_SERIALIZABLE: object;
  14253. export const buffersSerializer: Serializer;
  14254. export let createFileSerializer: (
  14255. fs: IntermediateFileSystem,
  14256. hashFunction: string | typeof Hash
  14257. ) => Serializer;
  14258. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  14259. }
  14260. export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
  14261. export function compileBooleanMatcher(
  14262. map: Record<string | number, boolean>
  14263. ): boolean | ((arg0: string) => string);
  14264. export namespace compileBooleanMatcher {
  14265. export let fromLists: (
  14266. positiveItems: string[],
  14267. negativeItems: string[]
  14268. ) => (arg0: string) => string;
  14269. export let itemsToRegexp: (itemsArr: string[]) => string;
  14270. }
  14271. export { LazySet };
  14272. }
  14273. export namespace sources {
  14274. export {
  14275. Source,
  14276. RawSource,
  14277. OriginalSource,
  14278. ReplaceSource,
  14279. SourceMapSource,
  14280. ConcatSource,
  14281. PrefixSource,
  14282. CachedSource,
  14283. SizeOnlySource,
  14284. CompatSource
  14285. };
  14286. }
  14287. export namespace experiments {
  14288. export namespace schemes {
  14289. export { HttpUriPlugin };
  14290. }
  14291. export namespace ids {
  14292. export { SyncModuleIdsPlugin };
  14293. }
  14294. }
  14295. export type WebpackPluginFunction = (
  14296. this: Compiler,
  14297. compiler: Compiler
  14298. ) => void;
  14299. export {
  14300. AutomaticPrefetchPlugin,
  14301. AsyncDependenciesBlock,
  14302. BannerPlugin,
  14303. Cache,
  14304. Chunk,
  14305. ChunkGraph,
  14306. CleanPlugin,
  14307. Compilation,
  14308. Compiler,
  14309. ConcatenationScope,
  14310. ContextExclusionPlugin,
  14311. ContextReplacementPlugin,
  14312. DefinePlugin,
  14313. DelegatedPlugin,
  14314. Dependency,
  14315. DllPlugin,
  14316. DllReferencePlugin,
  14317. DynamicEntryPlugin,
  14318. EntryOptionPlugin,
  14319. EntryPlugin,
  14320. EnvironmentPlugin,
  14321. EvalDevToolModulePlugin,
  14322. EvalSourceMapDevToolPlugin,
  14323. ExternalModule,
  14324. ExternalsPlugin,
  14325. Generator,
  14326. HotUpdateChunk,
  14327. HotModuleReplacementPlugin,
  14328. InitFragment,
  14329. IgnorePlugin,
  14330. JavascriptModulesPlugin,
  14331. LibManifestPlugin,
  14332. LibraryTemplatePlugin,
  14333. LoaderOptionsPlugin,
  14334. LoaderTargetPlugin,
  14335. Module,
  14336. ModuleGraph,
  14337. ModuleGraphConnection,
  14338. NoEmitOnErrorsPlugin,
  14339. NormalModule,
  14340. NormalModuleReplacementPlugin,
  14341. MultiCompiler,
  14342. Parser,
  14343. PlatformPlugin,
  14344. PrefetchPlugin,
  14345. ProgressPlugin,
  14346. ProvidePlugin,
  14347. RuntimeModule,
  14348. EntryPlugin as SingleEntryPlugin,
  14349. SourceMapDevToolPlugin,
  14350. Stats,
  14351. Template,
  14352. WatchIgnorePlugin,
  14353. WebpackError,
  14354. WebpackOptionsApply,
  14355. WebpackOptionsDefaulter,
  14356. ValidationError as WebpackOptionsValidationError,
  14357. ValidationError,
  14358. Entry,
  14359. EntryNormalized,
  14360. EntryObject,
  14361. ExternalItemFunctionData,
  14362. ExternalItemObjectKnown,
  14363. ExternalItemObjectUnknown,
  14364. ExternalItemValue,
  14365. Externals,
  14366. FileCacheOptions,
  14367. LibraryOptions,
  14368. MemoryCacheOptions,
  14369. ModuleOptions,
  14370. ResolveOptions,
  14371. RuleSetCondition,
  14372. RuleSetConditionAbsolute,
  14373. RuleSetRule,
  14374. RuleSetUse,
  14375. RuleSetUseItem,
  14376. StatsOptions,
  14377. Configuration,
  14378. WebpackOptionsNormalized,
  14379. WebpackPluginInstance,
  14380. ChunkGroup,
  14381. Asset,
  14382. AssetInfo,
  14383. EntryOptions,
  14384. PathData,
  14385. AssetEmittedInfo,
  14386. MultiCompilerOptions,
  14387. MultiStats,
  14388. ResolveData,
  14389. ParserState,
  14390. ResolvePluginInstance,
  14391. Resolver,
  14392. Watching,
  14393. Argument,
  14394. Problem,
  14395. StatsAsset,
  14396. StatsChunk,
  14397. StatsChunkGroup,
  14398. StatsChunkOrigin,
  14399. StatsCompilation,
  14400. StatsError,
  14401. StatsLogging,
  14402. StatsLoggingEntry,
  14403. StatsModule,
  14404. StatsModuleIssuer,
  14405. StatsModuleReason,
  14406. StatsModuleTraceDependency,
  14407. StatsModuleTraceItem,
  14408. StatsProfile,
  14409. InputFileSystem,
  14410. OutputFileSystem,
  14411. LoaderModule,
  14412. RawLoaderDefinition,
  14413. LoaderDefinition,
  14414. LoaderDefinitionFunction,
  14415. PitchLoaderDefinitionFunction,
  14416. RawLoaderDefinitionFunction,
  14417. LoaderContext
  14418. };
  14419. }
  14420. declare const topLevelSymbolTag: unique symbol;
  14421. export = exports;