types.d.ts 384 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568
  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. * The options for data url generator.
  298. */
  299. dataUrl?:
  300. | AssetGeneratorDataUrlOptions
  301. | ((
  302. source: string | Buffer,
  303. context: { filename: string; module: Module }
  304. ) => string);
  305. }
  306. /**
  307. * Options object for DataUrl condition.
  308. */
  309. declare interface AssetParserDataUrlOptions {
  310. /**
  311. * Maximum size of asset that should be inline as modules. Default: 8kb.
  312. */
  313. maxSize?: number;
  314. }
  315. /**
  316. * Parser options for asset modules.
  317. */
  318. declare interface AssetParserOptions {
  319. /**
  320. * The condition for inlining the asset as DataUrl.
  321. */
  322. dataUrlCondition?:
  323. | AssetParserDataUrlOptions
  324. | ((
  325. source: string | Buffer,
  326. context: { filename: string; module: Module }
  327. ) => boolean);
  328. }
  329. /**
  330. * Generator options for asset/resource modules.
  331. */
  332. declare interface AssetResourceGeneratorOptions {
  333. /**
  334. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  335. */
  336. emit?: boolean;
  337. /**
  338. * 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.
  339. */
  340. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  341. /**
  342. * 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.
  343. */
  344. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  345. /**
  346. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  347. */
  348. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  349. }
  350. declare class AsyncDependenciesBlock extends DependenciesBlock {
  351. constructor(
  352. groupOptions:
  353. | null
  354. | (RawChunkGroupOptions & { name?: string } & {
  355. entryOptions?: EntryOptions;
  356. }),
  357. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  358. request?: null | string
  359. );
  360. groupOptions: RawChunkGroupOptions & { name?: string } & {
  361. entryOptions?: EntryOptions;
  362. };
  363. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  364. request?: null | string;
  365. chunkName?: string;
  366. module: any;
  367. }
  368. declare abstract class AsyncQueue<T, K, R> {
  369. hooks: {
  370. beforeAdd: AsyncSeriesHook<[T]>;
  371. added: SyncHook<[T]>;
  372. beforeStart: AsyncSeriesHook<[T]>;
  373. started: SyncHook<[T]>;
  374. result: SyncHook<[T, Error, R]>;
  375. };
  376. add(item: T, callback: CallbackAsyncQueue<R>): void;
  377. invalidate(item: T): void;
  378. /**
  379. * Waits for an already started item
  380. */
  381. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  382. stop(): void;
  383. increaseParallelism(): void;
  384. decreaseParallelism(): void;
  385. isProcessing(item: T): boolean;
  386. isQueued(item: T): boolean;
  387. isDone(item: T): boolean;
  388. clear(): void;
  389. }
  390. declare class AsyncWebAssemblyModulesPlugin {
  391. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  392. options: AsyncWebAssemblyModulesPluginOptions;
  393. /**
  394. * Apply the plugin
  395. */
  396. apply(compiler: Compiler): void;
  397. renderModule(
  398. module: Module,
  399. renderContext: WebAssemblyRenderContext,
  400. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  401. ): Source;
  402. static getCompilationHooks(
  403. compilation: Compilation
  404. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  405. }
  406. declare interface AsyncWebAssemblyModulesPluginOptions {
  407. /**
  408. * mangle imports
  409. */
  410. mangleImports?: boolean;
  411. }
  412. declare class AutomaticPrefetchPlugin {
  413. constructor();
  414. /**
  415. * Apply the plugin
  416. */
  417. apply(compiler: Compiler): void;
  418. }
  419. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  420. declare interface BackendApi {
  421. dispose: (arg0?: Error) => void;
  422. module: (arg0: Module) => { client: string; data: string; active: boolean };
  423. }
  424. declare class BannerPlugin {
  425. constructor(options: BannerPluginArgument);
  426. options: BannerPluginOptions;
  427. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  428. /**
  429. * Apply the plugin
  430. */
  431. apply(compiler: Compiler): void;
  432. }
  433. type BannerPluginArgument =
  434. | string
  435. | BannerPluginOptions
  436. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  437. declare interface BannerPluginOptions {
  438. /**
  439. * Specifies the banner.
  440. */
  441. banner:
  442. | string
  443. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  444. /**
  445. * If true, the banner will only be added to the entry chunks.
  446. */
  447. entryOnly?: boolean;
  448. /**
  449. * Exclude all modules matching any of these conditions.
  450. */
  451. exclude?: string | RegExp | Rule[];
  452. /**
  453. * If true, banner will be placed at the end of the output.
  454. */
  455. footer?: boolean;
  456. /**
  457. * Include all modules matching any of these conditions.
  458. */
  459. include?: string | RegExp | Rule[];
  460. /**
  461. * If true, banner will not be wrapped in a comment.
  462. */
  463. raw?: boolean;
  464. /**
  465. * Specifies the banner.
  466. */
  467. stage?: number;
  468. /**
  469. * Include all modules that pass test assertion.
  470. */
  471. test?: string | RegExp | Rule[];
  472. }
  473. declare interface BaseResolveRequest {
  474. path: string | false;
  475. context?: object;
  476. descriptionFilePath?: string;
  477. descriptionFileRoot?: string;
  478. descriptionFileData?: JsonObjectTypes;
  479. relativePath?: string;
  480. ignoreSymlinks?: boolean;
  481. fullySpecified?: boolean;
  482. __innerRequest?: string;
  483. __innerRequest_request?: string;
  484. __innerRequest_relativePath?: string;
  485. }
  486. declare abstract class BasicEvaluatedExpression {
  487. type: number;
  488. range?: [number, number];
  489. falsy: boolean;
  490. truthy: boolean;
  491. nullish?: boolean;
  492. sideEffects: boolean;
  493. bool?: boolean;
  494. number?: number;
  495. bigint?: bigint;
  496. regExp?: RegExp;
  497. string?: string;
  498. quasis?: BasicEvaluatedExpression[];
  499. parts?: BasicEvaluatedExpression[];
  500. array?: any[];
  501. items?: BasicEvaluatedExpression[];
  502. options?: BasicEvaluatedExpression[];
  503. prefix?: null | BasicEvaluatedExpression;
  504. postfix?: null | BasicEvaluatedExpression;
  505. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  506. identifier?: string | VariableInfoInterface;
  507. rootInfo?: string | VariableInfoInterface;
  508. getMembers?: () => string[];
  509. getMembersOptionals?: () => boolean[];
  510. getMemberRanges?: () => [number, number][];
  511. expression?:
  512. | UnaryExpression
  513. | ArrayExpression
  514. | ArrowFunctionExpression
  515. | AssignmentExpression
  516. | AwaitExpression
  517. | BinaryExpression
  518. | SimpleCallExpression
  519. | NewExpression
  520. | ChainExpression
  521. | ClassExpression
  522. | ConditionalExpression
  523. | FunctionExpression
  524. | Identifier
  525. | ImportExpression
  526. | SimpleLiteral
  527. | RegExpLiteral
  528. | BigIntLiteral
  529. | LogicalExpression
  530. | MemberExpression
  531. | MetaProperty
  532. | ObjectExpression
  533. | SequenceExpression
  534. | TaggedTemplateExpression
  535. | TemplateLiteral
  536. | ThisExpression
  537. | UpdateExpression
  538. | YieldExpression
  539. | FunctionDeclaration
  540. | VariableDeclaration
  541. | ClassDeclaration
  542. | PrivateIdentifier
  543. | ExpressionStatement
  544. | BlockStatement
  545. | StaticBlock
  546. | EmptyStatement
  547. | DebuggerStatement
  548. | WithStatement
  549. | ReturnStatement
  550. | LabeledStatement
  551. | BreakStatement
  552. | ContinueStatement
  553. | IfStatement
  554. | SwitchStatement
  555. | ThrowStatement
  556. | TryStatement
  557. | WhileStatement
  558. | DoWhileStatement
  559. | ForStatement
  560. | ForInStatement
  561. | ForOfStatement
  562. | ImportDeclaration
  563. | ExportNamedDeclaration
  564. | ExportDefaultDeclaration
  565. | ExportAllDeclaration
  566. | MethodDefinition
  567. | PropertyDefinition
  568. | VariableDeclarator
  569. | Program
  570. | SwitchCase
  571. | CatchClause
  572. | ObjectPattern
  573. | ArrayPattern
  574. | RestElement
  575. | AssignmentPattern
  576. | SpreadElement
  577. | Property
  578. | AssignmentProperty
  579. | ClassBody
  580. | ImportSpecifier
  581. | ImportDefaultSpecifier
  582. | ImportNamespaceSpecifier
  583. | ExportSpecifier
  584. | Super
  585. | TemplateElement;
  586. isUnknown(): boolean;
  587. isNull(): boolean;
  588. isUndefined(): boolean;
  589. isString(): boolean;
  590. isNumber(): boolean;
  591. isBigInt(): boolean;
  592. isBoolean(): boolean;
  593. isRegExp(): boolean;
  594. isConditional(): boolean;
  595. isArray(): boolean;
  596. isConstArray(): boolean;
  597. isIdentifier(): boolean;
  598. isWrapped(): boolean;
  599. isTemplateString(): boolean;
  600. /**
  601. * Is expression a primitive or an object type value?
  602. */
  603. isPrimitiveType(): undefined | boolean;
  604. /**
  605. * Is expression a runtime or compile-time value?
  606. */
  607. isCompileTimeValue(): boolean;
  608. /**
  609. * Gets the compile-time value of the expression
  610. */
  611. asCompileTimeValue(): any;
  612. isTruthy(): boolean;
  613. isFalsy(): boolean;
  614. isNullish(): undefined | boolean;
  615. /**
  616. * Can this expression have side effects?
  617. */
  618. couldHaveSideEffects(): boolean;
  619. /**
  620. * Creates a boolean representation of this evaluated expression.
  621. */
  622. asBool(): undefined | boolean;
  623. /**
  624. * Creates a nullish coalescing representation of this evaluated expression.
  625. */
  626. asNullish(): undefined | boolean;
  627. /**
  628. * Creates a string representation of this evaluated expression.
  629. */
  630. asString(): undefined | string;
  631. setString(string: string): BasicEvaluatedExpression;
  632. setUndefined(): BasicEvaluatedExpression;
  633. setNull(): BasicEvaluatedExpression;
  634. /**
  635. * Set's the value of this expression to a number
  636. */
  637. setNumber(number: number): BasicEvaluatedExpression;
  638. /**
  639. * Set's the value of this expression to a BigInt
  640. */
  641. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  642. /**
  643. * Set's the value of this expression to a boolean
  644. */
  645. setBoolean(bool: boolean): BasicEvaluatedExpression;
  646. /**
  647. * Set's the value of this expression to a regular expression
  648. */
  649. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  650. /**
  651. * Set's the value of this expression to a particular identifier and its members.
  652. */
  653. setIdentifier(
  654. identifier: string | VariableInfoInterface,
  655. rootInfo: string | VariableInfoInterface,
  656. getMembers: () => string[],
  657. getMembersOptionals?: () => boolean[],
  658. getMemberRanges?: () => [number, number][]
  659. ): BasicEvaluatedExpression;
  660. /**
  661. * Wraps an array of expressions with a prefix and postfix expression.
  662. */
  663. setWrapped(
  664. prefix?: null | BasicEvaluatedExpression,
  665. postfix?: null | BasicEvaluatedExpression,
  666. innerExpressions?: BasicEvaluatedExpression[]
  667. ): BasicEvaluatedExpression;
  668. /**
  669. * Stores the options of a conditional expression.
  670. */
  671. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  672. /**
  673. * Adds options to a conditional expression.
  674. */
  675. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  676. /**
  677. * Set's the value of this expression to an array of expressions.
  678. */
  679. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  680. /**
  681. * Set's the value of this expression to an array of strings.
  682. */
  683. setArray(array: string[]): BasicEvaluatedExpression;
  684. /**
  685. * Set's the value of this expression to a processed/unprocessed template string. Used
  686. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  687. */
  688. setTemplateString(
  689. quasis: BasicEvaluatedExpression[],
  690. parts: BasicEvaluatedExpression[],
  691. kind: "raw" | "cooked"
  692. ): BasicEvaluatedExpression;
  693. templateStringKind?: "raw" | "cooked";
  694. setTruthy(): BasicEvaluatedExpression;
  695. setFalsy(): BasicEvaluatedExpression;
  696. /**
  697. * Set's the value of the expression to nullish.
  698. */
  699. setNullish(value: boolean): BasicEvaluatedExpression;
  700. /**
  701. * Set's the range for the expression.
  702. */
  703. setRange(range: [number, number]): BasicEvaluatedExpression;
  704. /**
  705. * Set whether or not the expression has side effects.
  706. */
  707. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  708. /**
  709. * Set the expression node for the expression.
  710. */
  711. setExpression(
  712. expression?:
  713. | UnaryExpression
  714. | ArrayExpression
  715. | ArrowFunctionExpression
  716. | AssignmentExpression
  717. | AwaitExpression
  718. | BinaryExpression
  719. | SimpleCallExpression
  720. | NewExpression
  721. | ChainExpression
  722. | ClassExpression
  723. | ConditionalExpression
  724. | FunctionExpression
  725. | Identifier
  726. | ImportExpression
  727. | SimpleLiteral
  728. | RegExpLiteral
  729. | BigIntLiteral
  730. | LogicalExpression
  731. | MemberExpression
  732. | MetaProperty
  733. | ObjectExpression
  734. | SequenceExpression
  735. | TaggedTemplateExpression
  736. | TemplateLiteral
  737. | ThisExpression
  738. | UpdateExpression
  739. | YieldExpression
  740. | FunctionDeclaration
  741. | VariableDeclaration
  742. | ClassDeclaration
  743. | PrivateIdentifier
  744. | ExpressionStatement
  745. | BlockStatement
  746. | StaticBlock
  747. | EmptyStatement
  748. | DebuggerStatement
  749. | WithStatement
  750. | ReturnStatement
  751. | LabeledStatement
  752. | BreakStatement
  753. | ContinueStatement
  754. | IfStatement
  755. | SwitchStatement
  756. | ThrowStatement
  757. | TryStatement
  758. | WhileStatement
  759. | DoWhileStatement
  760. | ForStatement
  761. | ForInStatement
  762. | ForOfStatement
  763. | ImportDeclaration
  764. | ExportNamedDeclaration
  765. | ExportDefaultDeclaration
  766. | ExportAllDeclaration
  767. | MethodDefinition
  768. | PropertyDefinition
  769. | VariableDeclarator
  770. | Program
  771. | SwitchCase
  772. | CatchClause
  773. | ObjectPattern
  774. | ArrayPattern
  775. | RestElement
  776. | AssignmentPattern
  777. | SpreadElement
  778. | Property
  779. | AssignmentProperty
  780. | ClassBody
  781. | ImportSpecifier
  782. | ImportDefaultSpecifier
  783. | ImportNamespaceSpecifier
  784. | ExportSpecifier
  785. | Super
  786. | TemplateElement
  787. ): BasicEvaluatedExpression;
  788. }
  789. type BufferEncoding =
  790. | "ascii"
  791. | "utf8"
  792. | "utf-8"
  793. | "utf16le"
  794. | "utf-16le"
  795. | "ucs2"
  796. | "ucs-2"
  797. | "latin1"
  798. | "binary"
  799. | "base64"
  800. | "base64url"
  801. | "hex";
  802. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  803. type BuildInfo = KnownBuildInfo & Record<string, any>;
  804. type BuildMeta = KnownBuildMeta & Record<string, any>;
  805. declare abstract class ByTypeGenerator extends Generator {
  806. map: Record<string, Generator>;
  807. }
  808. declare const CIRCULAR_CONNECTION: unique symbol;
  809. declare class Cache {
  810. constructor();
  811. hooks: {
  812. get: AsyncSeriesBailHook<
  813. [
  814. string,
  815. null | Etag,
  816. ((result: any, callback: (arg0?: Error) => void) => void)[]
  817. ],
  818. any
  819. >;
  820. store: AsyncParallelHook<[string, null | Etag, any]>;
  821. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  822. beginIdle: SyncHook<[]>;
  823. endIdle: AsyncParallelHook<[]>;
  824. shutdown: AsyncParallelHook<[]>;
  825. };
  826. get<T>(
  827. identifier: string,
  828. etag: null | Etag,
  829. callback: CallbackCacheCache<T>
  830. ): void;
  831. store<T>(
  832. identifier: string,
  833. etag: null | Etag,
  834. data: T,
  835. callback: CallbackCacheCache<void>
  836. ): void;
  837. /**
  838. * After this method has succeeded the cache can only be restored when build dependencies are
  839. */
  840. storeBuildDependencies(
  841. dependencies: Iterable<string>,
  842. callback: CallbackCacheCache<void>
  843. ): void;
  844. beginIdle(): void;
  845. endIdle(callback: CallbackCacheCache<void>): void;
  846. shutdown(callback: CallbackCacheCache<void>): void;
  847. static STAGE_MEMORY: number;
  848. static STAGE_DEFAULT: number;
  849. static STAGE_DISK: number;
  850. static STAGE_NETWORK: number;
  851. }
  852. declare abstract class CacheFacade {
  853. getChildCache(name: string): CacheFacade;
  854. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  855. getLazyHashedEtag(obj: HashableObject): Etag;
  856. mergeEtags(a: Etag, b: Etag): Etag;
  857. get<T>(
  858. identifier: string,
  859. etag: null | Etag,
  860. callback: CallbackCacheCacheFacade<T>
  861. ): void;
  862. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  863. store<T>(
  864. identifier: string,
  865. etag: null | Etag,
  866. data: T,
  867. callback: CallbackCacheCacheFacade<void>
  868. ): void;
  869. storePromise<T>(
  870. identifier: string,
  871. etag: null | Etag,
  872. data: T
  873. ): Promise<void>;
  874. provide<T>(
  875. identifier: string,
  876. etag: null | Etag,
  877. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  878. callback: CallbackNormalErrorCache<T>
  879. ): void;
  880. providePromise<T>(
  881. identifier: string,
  882. etag: null | Etag,
  883. computer: () => T | Promise<T>
  884. ): Promise<T>;
  885. }
  886. declare interface CacheGroupSource {
  887. key?: string;
  888. priority?: number;
  889. getName?: (
  890. module?: Module,
  891. chunks?: Chunk[],
  892. key?: string
  893. ) => undefined | string;
  894. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  895. enforce?: boolean;
  896. minSize: SplitChunksSizes;
  897. minSizeReduction: SplitChunksSizes;
  898. minRemainingSize: SplitChunksSizes;
  899. enforceSizeThreshold: SplitChunksSizes;
  900. maxAsyncSize: SplitChunksSizes;
  901. maxInitialSize: SplitChunksSizes;
  902. minChunks?: number;
  903. maxAsyncRequests?: number;
  904. maxInitialRequests?: number;
  905. filename?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  906. idHint?: string;
  907. automaticNameDelimiter?: string;
  908. reuseExistingChunk?: boolean;
  909. usedExports?: boolean;
  910. }
  911. declare interface CacheGroupsContext {
  912. moduleGraph: ModuleGraph;
  913. chunkGraph: ChunkGraph;
  914. }
  915. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  916. declare class CachedSource extends Source {
  917. constructor(source: Source);
  918. constructor(source: Source | (() => Source), cachedData?: any);
  919. original(): Source;
  920. originalLazy(): Source | (() => Source);
  921. getCachedData(): any;
  922. }
  923. type CallExpression = SimpleCallExpression | NewExpression;
  924. declare interface CallExpressionInfo {
  925. type: "call";
  926. call: CallExpression;
  927. calleeName: string;
  928. rootInfo: string | VariableInfo;
  929. getCalleeMembers: () => string[];
  930. name: string;
  931. getMembers: () => string[];
  932. getMembersOptionals: () => boolean[];
  933. getMemberRanges: () => [number, number][];
  934. }
  935. declare interface CallbackAsyncQueue<T> {
  936. (err?: null | WebpackError, result?: T): any;
  937. }
  938. declare interface CallbackCacheCache<T> {
  939. (err: null | WebpackError, result?: T): void;
  940. }
  941. declare interface CallbackCacheCacheFacade<T> {
  942. (err?: null | Error, result?: null | T): void;
  943. }
  944. declare interface CallbackFunction_1<T> {
  945. (err: null | Error, result?: T): any;
  946. }
  947. declare interface CallbackFunction_2<T> {
  948. (err?: null | Error, result?: T): any;
  949. }
  950. declare interface CallbackNormalErrorCache<T> {
  951. (err?: null | Error, result?: T): void;
  952. }
  953. declare interface CallbackNormalModuleFactory<T> {
  954. (err?: null | Error, stats?: T): void;
  955. }
  956. declare interface CallbackWebpack<T> {
  957. (err: null | Error, stats?: T): void;
  958. }
  959. type Cell<T> = undefined | T;
  960. declare class Chunk {
  961. constructor(name?: string, backCompat?: boolean);
  962. id: null | string | number;
  963. ids: null | ChunkId[];
  964. debugId: number;
  965. name?: string;
  966. idNameHints: SortableSet<string>;
  967. preventIntegration: boolean;
  968. filenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  969. cssFilenameTemplate?: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  970. runtime: RuntimeSpec;
  971. files: Set<string>;
  972. auxiliaryFiles: Set<string>;
  973. rendered: boolean;
  974. hash?: string;
  975. contentHash: Record<string, string>;
  976. renderedHash?: string;
  977. chunkReason?: string;
  978. extraAsync: boolean;
  979. get entryModule(): Module;
  980. hasEntryModule(): boolean;
  981. addModule(module: Module): boolean;
  982. removeModule(module: Module): void;
  983. getNumberOfModules(): number;
  984. get modulesIterable(): Iterable<Module>;
  985. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  986. containsModule(module: Module): boolean;
  987. getModules(): Module[];
  988. remove(): void;
  989. moveModule(module: Module, otherChunk: Chunk): void;
  990. integrate(otherChunk: Chunk): boolean;
  991. canBeIntegrated(otherChunk: Chunk): boolean;
  992. isEmpty(): boolean;
  993. modulesSize(): number;
  994. size(options?: ChunkSizeOptions): number;
  995. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  996. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  997. hasModuleInGraph(
  998. filterFn: (m: Module) => boolean,
  999. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1000. ): boolean;
  1001. getChunkMaps(realHash: boolean): ChunkMaps;
  1002. hasRuntime(): boolean;
  1003. canBeInitial(): boolean;
  1004. isOnlyInitial(): boolean;
  1005. getEntryOptions(): undefined | EntryOptions;
  1006. addGroup(chunkGroup: ChunkGroup): void;
  1007. removeGroup(chunkGroup: ChunkGroup): void;
  1008. isInGroup(chunkGroup: ChunkGroup): boolean;
  1009. getNumberOfGroups(): number;
  1010. get groupsIterable(): SortableSet<ChunkGroup>;
  1011. disconnectFromGroups(): void;
  1012. split(newChunk: Chunk): void;
  1013. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1014. getAllAsyncChunks(): Set<Chunk>;
  1015. getAllInitialChunks(): Set<Chunk>;
  1016. getAllReferencedChunks(): Set<Chunk>;
  1017. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1018. hasAsyncChunks(): boolean;
  1019. getChildIdsByOrders(
  1020. chunkGraph: ChunkGraph,
  1021. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1022. ): Record<string, (string | number)[]>;
  1023. getChildrenOfTypeInOrder(
  1024. chunkGraph: ChunkGraph,
  1025. type: string
  1026. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  1027. getChildIdsByOrdersMap(
  1028. chunkGraph: ChunkGraph,
  1029. includeDirectChildren?: boolean,
  1030. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1031. ): Record<string | number, Record<string, (string | number)[]>>;
  1032. }
  1033. declare class ChunkGraph {
  1034. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  1035. moduleGraph: ModuleGraph;
  1036. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1037. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1038. disconnectChunk(chunk: Chunk): void;
  1039. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1040. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1041. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1042. attachDependentHashModules(
  1043. chunk: Chunk,
  1044. modules: Iterable<RuntimeModule>
  1045. ): void;
  1046. replaceModule(oldModule: Module, newModule: Module): void;
  1047. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1048. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1049. isEntryModule(module: Module): boolean;
  1050. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1051. getOrderedModuleChunksIterable(
  1052. module: Module,
  1053. sortFn: (arg0: Chunk, arg1: Chunk) => 0 | 1 | -1
  1054. ): Iterable<Chunk>;
  1055. getModuleChunks(module: Module): Chunk[];
  1056. getNumberOfModuleChunks(module: Module): number;
  1057. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1058. getNumberOfChunkModules(chunk: Chunk): number;
  1059. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1060. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1061. getChunkModulesIterableBySourceType(
  1062. chunk: Chunk,
  1063. sourceType: string
  1064. ): undefined | Iterable<Module>;
  1065. setChunkModuleSourceTypes(
  1066. chunk: Chunk,
  1067. module: Module,
  1068. sourceTypes: Set<string>
  1069. ): void;
  1070. getChunkModuleSourceTypes(chunk: Chunk, module: Module): Set<string>;
  1071. getModuleSourceTypes(module: Module): Set<string>;
  1072. getOrderedChunkModulesIterable(
  1073. chunk: Chunk,
  1074. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1075. ): Iterable<Module>;
  1076. getOrderedChunkModulesIterableBySourceType(
  1077. chunk: Chunk,
  1078. sourceType: string,
  1079. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1080. ): undefined | Iterable<Module>;
  1081. getChunkModules(chunk: Chunk): Module[];
  1082. getOrderedChunkModules(
  1083. chunk: Chunk,
  1084. comparator: (arg0: Module, arg1: Module) => 0 | 1 | -1
  1085. ): Module[];
  1086. getChunkModuleIdMap(
  1087. chunk: Chunk,
  1088. filterFn: (m: Module) => boolean,
  1089. includeAllChunks?: boolean
  1090. ): Record<string | number, (string | number)[]>;
  1091. getChunkModuleRenderedHashMap(
  1092. chunk: Chunk,
  1093. filterFn: (m: Module) => boolean,
  1094. hashLength?: number,
  1095. includeAllChunks?: boolean
  1096. ): Record<string | number, Record<string | number, string>>;
  1097. getChunkConditionMap(
  1098. chunk: Chunk,
  1099. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1100. ): Record<string | number, boolean>;
  1101. hasModuleInGraph(
  1102. chunk: Chunk,
  1103. filterFn: (m: Module) => boolean,
  1104. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1105. ): boolean;
  1106. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1107. getChunkModulesSize(chunk: Chunk): number;
  1108. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1109. getChunkRootModules(chunk: Chunk): Module[];
  1110. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1111. getIntegratedChunksSize(
  1112. chunkA: Chunk,
  1113. chunkB: Chunk,
  1114. options?: ChunkSizeOptions
  1115. ): number;
  1116. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1117. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1118. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1119. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1120. connectChunkAndEntryModule(
  1121. chunk: Chunk,
  1122. module: Module,
  1123. entrypoint?: Entrypoint
  1124. ): void;
  1125. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1126. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1127. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1128. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1129. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1130. disconnectEntryModule(module: Module): void;
  1131. disconnectEntries(chunk: Chunk): void;
  1132. getNumberOfEntryModules(chunk: Chunk): number;
  1133. getNumberOfRuntimeModules(chunk: Chunk): number;
  1134. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1135. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1136. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1137. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1138. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1139. getChunkFullHashModulesIterable(
  1140. chunk: Chunk
  1141. ): undefined | Iterable<RuntimeModule>;
  1142. getChunkFullHashModulesSet(
  1143. chunk: Chunk
  1144. ): undefined | ReadonlySet<RuntimeModule>;
  1145. getChunkDependentHashModulesIterable(
  1146. chunk: Chunk
  1147. ): undefined | Iterable<RuntimeModule>;
  1148. getChunkEntryModulesWithChunkGroupIterable(
  1149. chunk: Chunk
  1150. ): Iterable<[Module, undefined | Entrypoint]>;
  1151. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1152. connectBlockAndChunkGroup(
  1153. depBlock: AsyncDependenciesBlock,
  1154. chunkGroup: ChunkGroup
  1155. ): void;
  1156. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1157. getModuleId(module: Module): ModuleId;
  1158. setModuleId(module: Module, id: ModuleId): void;
  1159. getRuntimeId(runtime: string): string | number;
  1160. setRuntimeId(runtime: string, id: string | number): void;
  1161. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1162. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1163. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1164. setModuleHashes(
  1165. module: Module,
  1166. runtime: RuntimeSpec,
  1167. hash: string,
  1168. renderedHash: string
  1169. ): void;
  1170. addModuleRuntimeRequirements(
  1171. module: Module,
  1172. runtime: RuntimeSpec,
  1173. items: Set<string>,
  1174. transferOwnership?: boolean
  1175. ): void;
  1176. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1177. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1178. getModuleRuntimeRequirements(
  1179. module: Module,
  1180. runtime: RuntimeSpec
  1181. ): ReadonlySet<string>;
  1182. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1183. getModuleGraphHash(
  1184. module: Module,
  1185. runtime: RuntimeSpec,
  1186. withConnections?: boolean
  1187. ): string;
  1188. getModuleGraphHashBigInt(
  1189. module: Module,
  1190. runtime: RuntimeSpec,
  1191. withConnections?: boolean
  1192. ): bigint;
  1193. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1194. static getChunkGraphForModule(
  1195. module: Module,
  1196. deprecateMessage: string,
  1197. deprecationCode: string
  1198. ): ChunkGraph;
  1199. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1200. static clearChunkGraphForModule(module: Module): void;
  1201. static getChunkGraphForChunk(
  1202. chunk: Chunk,
  1203. deprecateMessage: string,
  1204. deprecationCode: string
  1205. ): ChunkGraph;
  1206. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1207. static clearChunkGraphForChunk(chunk: Chunk): void;
  1208. }
  1209. declare abstract class ChunkGroup {
  1210. groupDebugId: number;
  1211. options: ChunkGroupOptions;
  1212. chunks: Chunk[];
  1213. origins: OriginRecord[];
  1214. index?: number;
  1215. /**
  1216. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1217. */
  1218. addOptions(options: ChunkGroupOptions): void;
  1219. /**
  1220. * returns the name of current ChunkGroup
  1221. * sets a new name for current ChunkGroup
  1222. */
  1223. name?: string;
  1224. /**
  1225. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1226. */
  1227. get debugId(): string;
  1228. /**
  1229. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1230. */
  1231. get id(): string;
  1232. /**
  1233. * Performs an unshift of a specific chunk
  1234. */
  1235. unshiftChunk(chunk: Chunk): boolean;
  1236. /**
  1237. * inserts a chunk before another existing chunk in group
  1238. */
  1239. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1240. /**
  1241. * add a chunk into ChunkGroup. Is pushed on or prepended
  1242. */
  1243. pushChunk(chunk: Chunk): boolean;
  1244. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1245. removeChunk(chunk: Chunk): boolean;
  1246. isInitial(): boolean;
  1247. addChild(group: ChunkGroup): boolean;
  1248. getChildren(): ChunkGroup[];
  1249. getNumberOfChildren(): number;
  1250. get childrenIterable(): SortableSet<ChunkGroup>;
  1251. removeChild(group: ChunkGroup): boolean;
  1252. addParent(parentChunk: ChunkGroup): boolean;
  1253. getParents(): ChunkGroup[];
  1254. getNumberOfParents(): number;
  1255. hasParent(parent: ChunkGroup): boolean;
  1256. get parentsIterable(): SortableSet<ChunkGroup>;
  1257. removeParent(chunkGroup: ChunkGroup): boolean;
  1258. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1259. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1260. getBlocks(): AsyncDependenciesBlock[];
  1261. getNumberOfBlocks(): number;
  1262. hasBlock(block: AsyncDependenciesBlock): boolean;
  1263. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1264. addBlock(block: AsyncDependenciesBlock): boolean;
  1265. addOrigin(module: Module, loc: DependencyLocation, request: string): void;
  1266. getFiles(): string[];
  1267. remove(): void;
  1268. sortItems(): void;
  1269. /**
  1270. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1271. * Sorting values are based off of number of chunks in ChunkGroup.
  1272. */
  1273. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1274. getChildrenByOrders(
  1275. moduleGraph: ModuleGraph,
  1276. chunkGraph: ChunkGraph
  1277. ): Record<string, ChunkGroup[]>;
  1278. /**
  1279. * Sets the top-down index of a module in this ChunkGroup
  1280. */
  1281. setModulePreOrderIndex(module: Module, index: number): void;
  1282. /**
  1283. * Gets the top-down index of a module in this ChunkGroup
  1284. */
  1285. getModulePreOrderIndex(module: Module): undefined | number;
  1286. /**
  1287. * Sets the bottom-up index of a module in this ChunkGroup
  1288. */
  1289. setModulePostOrderIndex(module: Module, index: number): void;
  1290. /**
  1291. * Gets the bottom-up index of a module in this ChunkGroup
  1292. */
  1293. getModulePostOrderIndex(module: Module): undefined | number;
  1294. checkConstraints(): void;
  1295. getModuleIndex: (module: Module) => undefined | number;
  1296. getModuleIndex2: (module: Module) => undefined | number;
  1297. }
  1298. type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
  1299. declare interface ChunkHashContext {
  1300. /**
  1301. * results of code generation
  1302. */
  1303. codeGenerationResults: CodeGenerationResults;
  1304. /**
  1305. * the runtime template
  1306. */
  1307. runtimeTemplate: RuntimeTemplate;
  1308. /**
  1309. * the module graph
  1310. */
  1311. moduleGraph: ModuleGraph;
  1312. /**
  1313. * the chunk graph
  1314. */
  1315. chunkGraph: ChunkGraph;
  1316. }
  1317. type ChunkId = string | number;
  1318. declare interface ChunkMaps {
  1319. hash: Record<string | number, string>;
  1320. contentHash: Record<string | number, Record<string, string>>;
  1321. name: Record<string | number, string>;
  1322. }
  1323. declare class ChunkModuleIdRangePlugin {
  1324. constructor(options: ChunkModuleIdRangePluginOptions);
  1325. options: ChunkModuleIdRangePluginOptions;
  1326. /**
  1327. * Apply the plugin
  1328. */
  1329. apply(compiler: Compiler): void;
  1330. }
  1331. declare interface ChunkModuleIdRangePluginOptions {
  1332. /**
  1333. * the chunk name
  1334. */
  1335. name: string;
  1336. /**
  1337. * order
  1338. */
  1339. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1340. /**
  1341. * start id
  1342. */
  1343. start?: number;
  1344. /**
  1345. * end id
  1346. */
  1347. end?: number;
  1348. }
  1349. declare interface ChunkModuleMaps {
  1350. id: Record<string | number, (string | number)[]>;
  1351. hash: Record<string | number, string>;
  1352. }
  1353. declare interface ChunkPathData {
  1354. id: string | number;
  1355. name?: string;
  1356. hash: string;
  1357. hashWithLength?: (arg0: number) => string;
  1358. contentHash?: Record<string, string>;
  1359. contentHashWithLength?: Record<string, (length: number) => string>;
  1360. }
  1361. declare class ChunkPrefetchPreloadPlugin {
  1362. constructor();
  1363. apply(compiler: Compiler): void;
  1364. }
  1365. declare interface ChunkRenderContext {
  1366. /**
  1367. * the chunk
  1368. */
  1369. chunk: Chunk;
  1370. /**
  1371. * the dependency templates
  1372. */
  1373. dependencyTemplates: DependencyTemplates;
  1374. /**
  1375. * the runtime template
  1376. */
  1377. runtimeTemplate: RuntimeTemplate;
  1378. /**
  1379. * the module graph
  1380. */
  1381. moduleGraph: ModuleGraph;
  1382. /**
  1383. * the chunk graph
  1384. */
  1385. chunkGraph: ChunkGraph;
  1386. /**
  1387. * results of code generation
  1388. */
  1389. codeGenerationResults: CodeGenerationResults;
  1390. /**
  1391. * init fragments for the chunk
  1392. */
  1393. chunkInitFragments: InitFragment<ChunkRenderContext>[];
  1394. /**
  1395. * rendering in strict context
  1396. */
  1397. strictMode: boolean;
  1398. }
  1399. declare interface ChunkSizeOptions {
  1400. /**
  1401. * constant overhead for a chunk
  1402. */
  1403. chunkOverhead?: number;
  1404. /**
  1405. * multiplicator for initial chunks
  1406. */
  1407. entryChunkMultiplicator?: number;
  1408. }
  1409. declare abstract class ChunkTemplate {
  1410. hooks: Readonly<{
  1411. renderManifest: { tap: (options?: any, fn?: any) => void };
  1412. modules: { tap: (options?: any, fn?: any) => void };
  1413. render: { tap: (options?: any, fn?: any) => void };
  1414. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  1415. hash: { tap: (options?: any, fn?: any) => void };
  1416. hashForChunk: { tap: (options?: any, fn?: any) => void };
  1417. }>;
  1418. get outputOptions(): Output;
  1419. }
  1420. /**
  1421. * Advanced options for cleaning assets.
  1422. */
  1423. declare interface CleanOptions {
  1424. /**
  1425. * Log the assets that should be removed instead of deleting them.
  1426. */
  1427. dry?: boolean;
  1428. /**
  1429. * Keep these assets.
  1430. */
  1431. keep?: string | RegExp | ((filename: string) => boolean);
  1432. }
  1433. declare class CleanPlugin {
  1434. constructor(options?: CleanOptions);
  1435. options: {
  1436. /**
  1437. * Log the assets that should be removed instead of deleting them.
  1438. */
  1439. dry: boolean;
  1440. /**
  1441. * Keep these assets.
  1442. */
  1443. keep?: string | RegExp | ((filename: string) => boolean);
  1444. };
  1445. /**
  1446. * Apply the plugin
  1447. */
  1448. apply(compiler: Compiler): void;
  1449. static getCompilationHooks(
  1450. compilation: Compilation
  1451. ): CleanPluginCompilationHooks;
  1452. }
  1453. declare interface CleanPluginCompilationHooks {
  1454. /**
  1455. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1456. */
  1457. keep: SyncBailHook<[string], boolean>;
  1458. }
  1459. declare interface CodeGenerationContext {
  1460. /**
  1461. * the dependency templates
  1462. */
  1463. dependencyTemplates: DependencyTemplates;
  1464. /**
  1465. * the runtime template
  1466. */
  1467. runtimeTemplate: RuntimeTemplate;
  1468. /**
  1469. * the module graph
  1470. */
  1471. moduleGraph: ModuleGraph;
  1472. /**
  1473. * the chunk graph
  1474. */
  1475. chunkGraph: ChunkGraph;
  1476. /**
  1477. * the runtimes code should be generated for
  1478. */
  1479. runtime: RuntimeSpec;
  1480. /**
  1481. * when in concatenated module, information about other concatenated modules
  1482. */
  1483. concatenationScope?: ConcatenationScope;
  1484. /**
  1485. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1486. */
  1487. codeGenerationResults?: CodeGenerationResults;
  1488. /**
  1489. * the compilation
  1490. */
  1491. compilation?: Compilation;
  1492. /**
  1493. * source types
  1494. */
  1495. sourceTypes?: ReadonlySet<string>;
  1496. }
  1497. declare interface CodeGenerationResult {
  1498. /**
  1499. * the resulting sources for all source types
  1500. */
  1501. sources: Map<string, Source>;
  1502. /**
  1503. * the resulting data for all source types
  1504. */
  1505. data?: Map<string, any>;
  1506. /**
  1507. * the runtime requirements
  1508. */
  1509. runtimeRequirements: ReadonlySet<string>;
  1510. /**
  1511. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1512. */
  1513. hash?: string;
  1514. }
  1515. declare abstract class CodeGenerationResults {
  1516. map: Map<Module, RuntimeSpecMap<CodeGenerationResult>>;
  1517. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1518. has(module: Module, runtime: RuntimeSpec): boolean;
  1519. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1520. getRuntimeRequirements(
  1521. module: Module,
  1522. runtime: RuntimeSpec
  1523. ): ReadonlySet<string>;
  1524. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1525. getHash(module: Module, runtime: RuntimeSpec): any;
  1526. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1527. }
  1528. type CodeValue =
  1529. | undefined
  1530. | null
  1531. | string
  1532. | number
  1533. | bigint
  1534. | boolean
  1535. | Function
  1536. | RegExp
  1537. | RuntimeValue
  1538. | {
  1539. [index: string]: RecursiveArrayOrRecord<
  1540. | undefined
  1541. | null
  1542. | string
  1543. | number
  1544. | bigint
  1545. | boolean
  1546. | Function
  1547. | RegExp
  1548. | RuntimeValue
  1549. >;
  1550. }
  1551. | RecursiveArrayOrRecord<
  1552. | undefined
  1553. | null
  1554. | string
  1555. | number
  1556. | bigint
  1557. | boolean
  1558. | Function
  1559. | RegExp
  1560. | RuntimeValue
  1561. >[];
  1562. type CodeValuePrimitive =
  1563. | undefined
  1564. | null
  1565. | string
  1566. | number
  1567. | bigint
  1568. | boolean
  1569. | Function
  1570. | RegExp;
  1571. declare interface Comparator<T> {
  1572. (arg0: T, arg1: T): 0 | 1 | -1;
  1573. }
  1574. declare class CompatSource extends Source {
  1575. constructor(sourceLike: SourceLike);
  1576. static from(sourceLike: SourceLike): Source;
  1577. }
  1578. declare class Compilation {
  1579. /**
  1580. * Creates an instance of Compilation.
  1581. */
  1582. constructor(compiler: Compiler, params: CompilationParams);
  1583. hooks: Readonly<{
  1584. buildModule: SyncHook<[Module]>;
  1585. rebuildModule: SyncHook<[Module]>;
  1586. failedModule: SyncHook<[Module, WebpackError]>;
  1587. succeedModule: SyncHook<[Module]>;
  1588. stillValidModule: SyncHook<[Module]>;
  1589. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1590. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1591. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1592. dependencyReferencedExports: SyncWaterfallHook<
  1593. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1594. >;
  1595. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1596. prepareModuleExecution: AsyncParallelHook<
  1597. [ExecuteModuleArgument, ExecuteModuleContext]
  1598. >;
  1599. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1600. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1601. unseal: SyncHook<[]>;
  1602. seal: SyncHook<[]>;
  1603. beforeChunks: SyncHook<[]>;
  1604. /**
  1605. * The `afterChunks` hook is called directly after the chunks and module graph have
  1606. * been created and before the chunks and modules have been optimized. This hook is useful to
  1607. * inspect, analyze, and/or modify the chunk graph.
  1608. */
  1609. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1610. optimizeDependencies: SyncBailHook<[Iterable<Module>], any>;
  1611. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1612. optimize: SyncHook<[]>;
  1613. optimizeModules: SyncBailHook<[Iterable<Module>], any>;
  1614. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1615. optimizeChunks: SyncBailHook<
  1616. [Iterable<Chunk>, ChunkGroup[]],
  1617. boolean | void
  1618. >;
  1619. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1620. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1621. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1622. optimizeChunkModules: AsyncSeriesBailHook<
  1623. [Iterable<Chunk>, Iterable<Module>],
  1624. void
  1625. >;
  1626. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1627. shouldRecord: SyncBailHook<[], undefined | boolean>;
  1628. additionalChunkRuntimeRequirements: SyncHook<
  1629. [Chunk, Set<string>, RuntimeRequirementsContext]
  1630. >;
  1631. runtimeRequirementInChunk: HookMap<
  1632. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1633. >;
  1634. additionalModuleRuntimeRequirements: SyncHook<
  1635. [Module, Set<string>, RuntimeRequirementsContext]
  1636. >;
  1637. runtimeRequirementInModule: HookMap<
  1638. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], any>
  1639. >;
  1640. additionalTreeRuntimeRequirements: SyncHook<
  1641. [Chunk, Set<string>, RuntimeRequirementsContext]
  1642. >;
  1643. runtimeRequirementInTree: HookMap<
  1644. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], any>
  1645. >;
  1646. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1647. reviveModules: SyncHook<[Iterable<Module>, any]>;
  1648. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1649. moduleIds: SyncHook<[Iterable<Module>]>;
  1650. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1651. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1652. reviveChunks: SyncHook<[Iterable<Chunk>, any]>;
  1653. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1654. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1655. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1656. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1657. recordModules: SyncHook<[Iterable<Module>, any]>;
  1658. recordChunks: SyncHook<[Iterable<Chunk>, any]>;
  1659. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1660. beforeModuleHash: SyncHook<[]>;
  1661. afterModuleHash: SyncHook<[]>;
  1662. beforeCodeGeneration: SyncHook<[]>;
  1663. afterCodeGeneration: SyncHook<[]>;
  1664. beforeRuntimeRequirements: SyncHook<[]>;
  1665. afterRuntimeRequirements: SyncHook<[]>;
  1666. beforeHash: SyncHook<[]>;
  1667. contentHash: SyncHook<[Chunk]>;
  1668. afterHash: SyncHook<[]>;
  1669. recordHash: SyncHook<[any]>;
  1670. record: SyncHook<[Compilation, any]>;
  1671. beforeModuleAssets: SyncHook<[]>;
  1672. shouldGenerateChunkAssets: SyncBailHook<[], boolean>;
  1673. beforeChunkAssets: SyncHook<[]>;
  1674. additionalChunkAssets: FakeHook<
  1675. Pick<
  1676. AsyncSeriesHook<[Set<Chunk>]>,
  1677. "name" | "tap" | "tapAsync" | "tapPromise"
  1678. >
  1679. >;
  1680. additionalAssets: FakeHook<
  1681. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1682. >;
  1683. optimizeChunkAssets: FakeHook<
  1684. Pick<
  1685. AsyncSeriesHook<[Set<Chunk>]>,
  1686. "name" | "tap" | "tapAsync" | "tapPromise"
  1687. >
  1688. >;
  1689. afterOptimizeChunkAssets: FakeHook<
  1690. Pick<
  1691. AsyncSeriesHook<[Set<Chunk>]>,
  1692. "name" | "tap" | "tapAsync" | "tapPromise"
  1693. >
  1694. >;
  1695. optimizeAssets: AsyncSeriesHook<
  1696. [CompilationAssets],
  1697. ProcessAssetsAdditionalOptions
  1698. >;
  1699. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1700. processAssets: AsyncSeriesHook<
  1701. [CompilationAssets],
  1702. ProcessAssetsAdditionalOptions
  1703. >;
  1704. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1705. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1706. needAdditionalSeal: SyncBailHook<[], undefined | boolean>;
  1707. afterSeal: AsyncSeriesHook<[]>;
  1708. renderManifest: SyncWaterfallHook<
  1709. [RenderManifestEntry[], RenderManifestOptions]
  1710. >;
  1711. fullHash: SyncHook<[Hash]>;
  1712. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1713. moduleAsset: SyncHook<[Module, string]>;
  1714. chunkAsset: SyncHook<[Chunk, string]>;
  1715. assetPath: SyncWaterfallHook<[string, object, undefined | AssetInfo]>;
  1716. needAdditionalPass: SyncBailHook<[], boolean>;
  1717. childCompiler: SyncHook<[Compiler, string, number]>;
  1718. log: SyncBailHook<[string, LogEntry], true>;
  1719. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1720. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1721. statsPreset: HookMap<
  1722. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1723. >;
  1724. statsNormalize: SyncHook<
  1725. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1726. >;
  1727. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1728. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1729. get normalModuleLoader(): SyncHook<[object, NormalModule]>;
  1730. }>;
  1731. name?: string;
  1732. startTime?: number;
  1733. endTime?: number;
  1734. compiler: Compiler;
  1735. resolverFactory: ResolverFactory;
  1736. inputFileSystem: InputFileSystem;
  1737. fileSystemInfo: FileSystemInfo;
  1738. valueCacheVersions: Map<string, string | Set<string>>;
  1739. requestShortener: RequestShortener;
  1740. compilerPath: string;
  1741. logger: WebpackLogger;
  1742. options: WebpackOptionsNormalized;
  1743. outputOptions: OutputNormalized;
  1744. bail: boolean;
  1745. profile: boolean;
  1746. params: CompilationParams;
  1747. mainTemplate: MainTemplate;
  1748. chunkTemplate: ChunkTemplate;
  1749. runtimeTemplate: RuntimeTemplate;
  1750. moduleTemplates: ModuleTemplates;
  1751. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1752. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1753. moduleGraph: ModuleGraph;
  1754. chunkGraph: ChunkGraph;
  1755. codeGenerationResults: CodeGenerationResults;
  1756. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1757. addModuleQueue: AsyncQueue<Module, string, Module>;
  1758. factorizeQueue: AsyncQueue<
  1759. FactorizeModuleOptions,
  1760. string,
  1761. Module | ModuleFactoryResult
  1762. >;
  1763. buildQueue: AsyncQueue<Module, Module, Module>;
  1764. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1765. /**
  1766. * Modules in value are building during the build of Module in key.
  1767. * Means value blocking key from finishing.
  1768. * Needed to detect build cycles.
  1769. */
  1770. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1771. entries: Map<string, EntryData>;
  1772. globalEntry: EntryData;
  1773. entrypoints: Map<string, Entrypoint>;
  1774. asyncEntrypoints: Entrypoint[];
  1775. chunks: Set<Chunk>;
  1776. chunkGroups: ChunkGroup[];
  1777. namedChunkGroups: Map<string, ChunkGroup>;
  1778. namedChunks: Map<string, Chunk>;
  1779. modules: Set<Module>;
  1780. records: any;
  1781. additionalChunkAssets: string[];
  1782. assets: CompilationAssets;
  1783. assetsInfo: Map<string, AssetInfo>;
  1784. errors: WebpackError[];
  1785. warnings: WebpackError[];
  1786. children: Compilation[];
  1787. logging: Map<string, LogEntry[]>;
  1788. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1789. dependencyTemplates: DependencyTemplates;
  1790. childrenCounters: object;
  1791. usedChunkIds: Set<string | number>;
  1792. usedModuleIds: Set<number>;
  1793. needAdditionalPass: boolean;
  1794. builtModules: WeakSet<Module>;
  1795. codeGeneratedModules: WeakSet<Module>;
  1796. buildTimeExecutedModules: WeakSet<Module>;
  1797. emittedAssets: Set<string>;
  1798. comparedForEmitAssets: Set<string>;
  1799. fileDependencies: LazySet<string>;
  1800. contextDependencies: LazySet<string>;
  1801. missingDependencies: LazySet<string>;
  1802. buildDependencies: LazySet<string>;
  1803. compilationDependencies: { add: (item: string) => LazySet<string> };
  1804. getStats(): Stats;
  1805. createStatsOptions(
  1806. optionsOrPreset?: string | boolean | StatsOptions,
  1807. context?: CreateStatsOptionsContext
  1808. ): NormalizedStatsOptions;
  1809. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  1810. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  1811. getCache(name: string): CacheFacade;
  1812. getLogger(name: string | (() => string)): WebpackLogger;
  1813. addModule(
  1814. module: Module,
  1815. callback: (err?: null | WebpackError, result?: Module) => void
  1816. ): void;
  1817. /**
  1818. * Fetches a module from a compilation by its identifier
  1819. */
  1820. getModule(module: Module): Module;
  1821. /**
  1822. * Attempts to search for a module by its identifier
  1823. */
  1824. findModule(identifier: string): undefined | Module;
  1825. /**
  1826. * Schedules a build of the module object
  1827. */
  1828. buildModule(
  1829. module: Module,
  1830. callback: (err?: null | WebpackError, result?: Module) => void
  1831. ): void;
  1832. processModuleDependencies(
  1833. module: Module,
  1834. callback: (err?: null | WebpackError, result?: Module) => void
  1835. ): void;
  1836. processModuleDependenciesNonRecursive(module: Module): void;
  1837. handleModuleCreation(
  1838. __0: HandleModuleCreationOptions,
  1839. callback: (err?: null | WebpackError, result?: Module) => void
  1840. ): void;
  1841. addModuleChain(
  1842. context: string,
  1843. dependency: Dependency,
  1844. callback: (err?: null | WebpackError, result?: Module) => void
  1845. ): void;
  1846. addModuleTree(
  1847. __0: {
  1848. /**
  1849. * context string path
  1850. */
  1851. context: string;
  1852. /**
  1853. * dependency used to create Module chain
  1854. */
  1855. dependency: Dependency;
  1856. /**
  1857. * additional context info for the root module
  1858. */
  1859. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1860. },
  1861. callback: (err?: null | WebpackError, result?: Module) => void
  1862. ): void;
  1863. addEntry(
  1864. context: string,
  1865. entry: Dependency,
  1866. optionsOrName: string | EntryOptions,
  1867. callback: (err?: null | WebpackError, result?: Module) => void
  1868. ): void;
  1869. addInclude(
  1870. context: string,
  1871. dependency: Dependency,
  1872. options: EntryOptions,
  1873. callback: (err?: null | WebpackError, result?: Module) => void
  1874. ): void;
  1875. rebuildModule(
  1876. module: Module,
  1877. callback: (err?: null | WebpackError, result?: Module) => void
  1878. ): void;
  1879. finish(callback: (err?: null | WebpackError) => void): void;
  1880. unseal(): void;
  1881. seal(callback: (err?: null | WebpackError) => void): void;
  1882. reportDependencyErrorsAndWarnings(
  1883. module: Module,
  1884. blocks: DependenciesBlock[]
  1885. ): boolean;
  1886. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  1887. processRuntimeRequirements(__0?: {
  1888. /**
  1889. * the chunk graph
  1890. */
  1891. chunkGraph?: ChunkGraph;
  1892. /**
  1893. * modules
  1894. */
  1895. modules?: Iterable<Module>;
  1896. /**
  1897. * chunks
  1898. */
  1899. chunks?: Iterable<Chunk>;
  1900. /**
  1901. * codeGenerationResults
  1902. */
  1903. codeGenerationResults?: CodeGenerationResults;
  1904. /**
  1905. * chunkGraphEntries
  1906. */
  1907. chunkGraphEntries?: Iterable<Chunk>;
  1908. }): void;
  1909. addRuntimeModule(
  1910. chunk: Chunk,
  1911. module: RuntimeModule,
  1912. chunkGraph?: ChunkGraph
  1913. ): void;
  1914. /**
  1915. * If `module` is passed, `loc` and `request` must also be passed.
  1916. */
  1917. addChunkInGroup(
  1918. groupOptions: string | ChunkGroupOptions,
  1919. module?: Module,
  1920. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  1921. request?: string
  1922. ): ChunkGroup;
  1923. addAsyncEntrypoint(
  1924. options: EntryOptions,
  1925. module: Module,
  1926. loc: DependencyLocation,
  1927. request: string
  1928. ): Entrypoint;
  1929. /**
  1930. * This method first looks to see if a name is provided for a new chunk,
  1931. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  1932. */
  1933. addChunk(name?: string): Chunk;
  1934. assignDepth(module: Module): void;
  1935. assignDepths(modules: Set<Module>): void;
  1936. getDependencyReferencedExports(
  1937. dependency: Dependency,
  1938. runtime: RuntimeSpec
  1939. ): (string[] | ReferencedExport)[];
  1940. removeReasonsOfDependencyBlock(
  1941. module: Module,
  1942. block: DependenciesBlockLike
  1943. ): void;
  1944. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  1945. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  1946. assignRuntimeIds(): void;
  1947. sortItemsWithChunkIds(): void;
  1948. summarizeDependencies(): void;
  1949. createModuleHashes(): void;
  1950. createHash(): {
  1951. module: Module;
  1952. hash: string;
  1953. runtime: RuntimeSpec;
  1954. runtimes: RuntimeSpec[];
  1955. }[];
  1956. fullHash?: string;
  1957. hash?: string;
  1958. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  1959. updateAsset(
  1960. file: string,
  1961. newSourceOrFunction: Source | ((arg0: Source) => Source),
  1962. assetInfoUpdateOrFunction?: AssetInfo | ((arg0?: AssetInfo) => AssetInfo)
  1963. ): void;
  1964. renameAsset(file: string, newFile: string): void;
  1965. deleteAsset(file: string): void;
  1966. getAssets(): Readonly<Asset>[];
  1967. getAsset(name: string): undefined | Readonly<Asset>;
  1968. clearAssets(): void;
  1969. createModuleAssets(): void;
  1970. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  1971. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  1972. getPath(
  1973. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1974. data?: PathData
  1975. ): string;
  1976. getPathWithInfo(
  1977. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1978. data?: PathData
  1979. ): { path: string; info: AssetInfo };
  1980. getAssetPath(
  1981. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1982. data: PathData
  1983. ): string;
  1984. getAssetPathWithInfo(
  1985. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
  1986. data: PathData
  1987. ): { path: string; info: AssetInfo };
  1988. getWarnings(): WebpackError[];
  1989. getErrors(): WebpackError[];
  1990. /**
  1991. * This function allows you to run another instance of webpack inside of webpack however as
  1992. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  1993. * from parent (or top level compiler) and creates a child Compilation
  1994. */
  1995. createChildCompiler(
  1996. name: string,
  1997. outputOptions?: OutputNormalized,
  1998. plugins?: (
  1999. | ((this: Compiler, compiler: Compiler) => void)
  2000. | WebpackPluginInstance
  2001. )[]
  2002. ): Compiler;
  2003. executeModule(
  2004. module: Module,
  2005. options: ExecuteModuleOptions,
  2006. callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
  2007. ): void;
  2008. checkConstraints(): void;
  2009. factorizeModule: {
  2010. (
  2011. options: FactorizeModuleOptions & { factoryResult?: false },
  2012. callback: (err?: null | WebpackError, result?: Module) => void
  2013. ): void;
  2014. (
  2015. options: FactorizeModuleOptions & { factoryResult: true },
  2016. callback: (
  2017. err?: null | WebpackError,
  2018. result?: ModuleFactoryResult
  2019. ) => void
  2020. ): void;
  2021. };
  2022. /**
  2023. * Add additional assets to the compilation.
  2024. */
  2025. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2026. /**
  2027. * Basic preprocessing of assets.
  2028. */
  2029. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2030. /**
  2031. * Derive new assets from existing assets.
  2032. * Existing assets should not be treated as complete.
  2033. */
  2034. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2035. /**
  2036. * Add additional sections to existing assets, like a banner or initialization code.
  2037. */
  2038. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2039. /**
  2040. * Optimize existing assets in a general way.
  2041. */
  2042. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2043. /**
  2044. * Optimize the count of existing assets, e. g. by merging them.
  2045. * Only assets of the same type should be merged.
  2046. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2047. */
  2048. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2049. /**
  2050. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2051. */
  2052. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2053. /**
  2054. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2055. */
  2056. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2057. /**
  2058. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2059. */
  2060. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2061. /**
  2062. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2063. * Only assets of different types should be inlined.
  2064. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2065. */
  2066. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2067. /**
  2068. * Summarize the list of existing assets
  2069. * e. g. creating an assets manifest of Service Workers.
  2070. */
  2071. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2072. /**
  2073. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2074. */
  2075. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2076. /**
  2077. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2078. */
  2079. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2080. /**
  2081. * Analyse existing assets.
  2082. */
  2083. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2084. /**
  2085. * Creating assets for reporting purposes.
  2086. */
  2087. static PROCESS_ASSETS_STAGE_REPORT: number;
  2088. }
  2089. declare interface CompilationAssets {
  2090. [index: string]: Source;
  2091. }
  2092. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2093. renderModuleContent: SyncWaterfallHook<
  2094. [Source, Module, WebAssemblyRenderContext]
  2095. >;
  2096. }
  2097. declare interface CompilationHooksJavascriptModulesPlugin {
  2098. renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2099. renderModuleContainer: SyncWaterfallHook<
  2100. [Source, Module, ChunkRenderContext]
  2101. >;
  2102. renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
  2103. renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
  2104. renderMain: SyncWaterfallHook<[Source, RenderContext]>;
  2105. renderContent: SyncWaterfallHook<[Source, RenderContext]>;
  2106. render: SyncWaterfallHook<[Source, RenderContext]>;
  2107. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  2108. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  2109. inlineInRuntimeBailout: SyncBailHook<
  2110. [Module, RenderBootstrapContext],
  2111. string
  2112. >;
  2113. embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string | void>;
  2114. strictRuntimeBailout: SyncBailHook<[RenderContext], string | void>;
  2115. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2116. useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
  2117. }
  2118. declare interface CompilationHooksRealContentHashPlugin {
  2119. updateHash: SyncBailHook<[Buffer[], string], string>;
  2120. }
  2121. declare interface CompilationParams {
  2122. normalModuleFactory: NormalModuleFactory;
  2123. contextModuleFactory: ContextModuleFactory;
  2124. }
  2125. declare class Compiler {
  2126. constructor(context: string, options?: WebpackOptionsNormalized);
  2127. hooks: Readonly<{
  2128. initialize: SyncHook<[]>;
  2129. shouldEmit: SyncBailHook<[Compilation], undefined | boolean>;
  2130. done: AsyncSeriesHook<[Stats]>;
  2131. afterDone: SyncHook<[Stats]>;
  2132. additionalPass: AsyncSeriesHook<[]>;
  2133. beforeRun: AsyncSeriesHook<[Compiler]>;
  2134. run: AsyncSeriesHook<[Compiler]>;
  2135. emit: AsyncSeriesHook<[Compilation]>;
  2136. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2137. afterEmit: AsyncSeriesHook<[Compilation]>;
  2138. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2139. compilation: SyncHook<[Compilation, CompilationParams]>;
  2140. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2141. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2142. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2143. compile: SyncHook<[CompilationParams]>;
  2144. make: AsyncParallelHook<[Compilation]>;
  2145. finishMake: AsyncParallelHook<[Compilation]>;
  2146. afterCompile: AsyncSeriesHook<[Compilation]>;
  2147. readRecords: AsyncSeriesHook<[]>;
  2148. emitRecords: AsyncSeriesHook<[]>;
  2149. watchRun: AsyncSeriesHook<[Compiler]>;
  2150. failed: SyncHook<[Error]>;
  2151. invalid: SyncHook<[null | string, number]>;
  2152. watchClose: SyncHook<[]>;
  2153. shutdown: AsyncSeriesHook<[]>;
  2154. infrastructureLog: SyncBailHook<[string, string, any[]], true>;
  2155. environment: SyncHook<[]>;
  2156. afterEnvironment: SyncHook<[]>;
  2157. afterPlugins: SyncHook<[Compiler]>;
  2158. afterResolvers: SyncHook<[Compiler]>;
  2159. entryOption: SyncBailHook<[string, EntryNormalized], boolean>;
  2160. }>;
  2161. webpack: typeof exports;
  2162. name?: string;
  2163. parentCompilation?: Compilation;
  2164. root: Compiler;
  2165. outputPath: string;
  2166. watching?: Watching;
  2167. outputFileSystem: null | OutputFileSystem;
  2168. intermediateFileSystem: null | IntermediateFileSystem;
  2169. inputFileSystem: null | InputFileSystem;
  2170. watchFileSystem: null | WatchFileSystem;
  2171. recordsInputPath: null | string;
  2172. recordsOutputPath: null | string;
  2173. records: Record<string, any>;
  2174. managedPaths: Set<string | RegExp>;
  2175. unmanagedPaths: Set<string | RegExp>;
  2176. immutablePaths: Set<string | RegExp>;
  2177. modifiedFiles?: ReadonlySet<string>;
  2178. removedFiles?: ReadonlySet<string>;
  2179. fileTimestamps?: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">;
  2180. contextTimestamps?: ReadonlyMap<
  2181. string,
  2182. null | FileSystemInfoEntry | "ignore"
  2183. >;
  2184. fsStartTime?: number;
  2185. resolverFactory: ResolverFactory;
  2186. infrastructureLogger?: (arg0: string, arg1: LogTypeEnum, arg2: any[]) => void;
  2187. platform: Readonly<PlatformTargetProperties>;
  2188. options: WebpackOptionsNormalized;
  2189. context: string;
  2190. requestShortener: RequestShortener;
  2191. cache: Cache;
  2192. moduleMemCaches?: Map<
  2193. Module,
  2194. {
  2195. buildInfo: BuildInfo;
  2196. references?: WeakMap<Dependency, Module>;
  2197. memCache: WeakTupleMap<any, any>;
  2198. }
  2199. >;
  2200. compilerPath: string;
  2201. running: boolean;
  2202. idle: boolean;
  2203. watchMode: boolean;
  2204. getCache(name: string): CacheFacade;
  2205. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2206. watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
  2207. run(callback: RunCallback<Stats>): void;
  2208. runAsChild(
  2209. callback: (
  2210. err: null | Error,
  2211. entries?: Chunk[],
  2212. compilation?: Compilation
  2213. ) => any
  2214. ): void;
  2215. purgeInputFileSystem(): void;
  2216. emitAssets(
  2217. compilation: Compilation,
  2218. callback: CallbackFunction_2<void>
  2219. ): void;
  2220. emitRecords(callback: CallbackFunction_2<void>): void;
  2221. readRecords(callback: CallbackFunction_2<void>): void;
  2222. createChildCompiler(
  2223. compilation: Compilation,
  2224. compilerName: string,
  2225. compilerIndex: number,
  2226. outputOptions?: OutputNormalized,
  2227. plugins?: WebpackPluginInstance[]
  2228. ): Compiler;
  2229. isChild(): boolean;
  2230. createCompilation(params: CompilationParams): Compilation;
  2231. newCompilation(params: CompilationParams): Compilation;
  2232. createNormalModuleFactory(): NormalModuleFactory;
  2233. createContextModuleFactory(): ContextModuleFactory;
  2234. newCompilationParams(): {
  2235. normalModuleFactory: NormalModuleFactory;
  2236. contextModuleFactory: ContextModuleFactory;
  2237. };
  2238. compile(callback: RunCallback<Compilation>): void;
  2239. close(callback: RunCallback<void>): void;
  2240. }
  2241. declare class ConcatSource extends Source {
  2242. constructor(...args: (string | Source)[]);
  2243. getChildren(): Source[];
  2244. add(item: string | Source): void;
  2245. addAllSkipOptimizing(items: Source[]): void;
  2246. }
  2247. declare interface ConcatenatedModuleInfo {
  2248. index: number;
  2249. module: Module;
  2250. /**
  2251. * mapping from export name to symbol
  2252. */
  2253. exportMap: Map<string, string>;
  2254. /**
  2255. * mapping from export name to symbol
  2256. */
  2257. rawExportMap: Map<string, string>;
  2258. namespaceExportSymbol?: string;
  2259. }
  2260. declare interface ConcatenationBailoutReasonContext {
  2261. /**
  2262. * the module graph
  2263. */
  2264. moduleGraph: ModuleGraph;
  2265. /**
  2266. * the chunk graph
  2267. */
  2268. chunkGraph: ChunkGraph;
  2269. }
  2270. declare class ConcatenationScope {
  2271. constructor(
  2272. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2273. currentModule: ConcatenatedModuleInfo
  2274. );
  2275. isModuleInScope(module: Module): boolean;
  2276. registerExport(exportName: string, symbol: string): void;
  2277. registerRawExport(exportName: string, expression: string): void;
  2278. registerNamespaceExport(symbol: string): void;
  2279. createModuleReference(
  2280. module: Module,
  2281. __1: Partial<ModuleReferenceOptions>
  2282. ): string;
  2283. static isModuleReference(name: string): boolean;
  2284. static matchModuleReference(
  2285. name: string
  2286. ): null | (ModuleReferenceOptions & { index: number });
  2287. static DEFAULT_EXPORT: string;
  2288. static NAMESPACE_OBJECT_EXPORT: string;
  2289. }
  2290. /**
  2291. * Options object as provided by the user.
  2292. */
  2293. declare interface Configuration {
  2294. /**
  2295. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2296. */
  2297. amd?: false | { [index: string]: any };
  2298. /**
  2299. * Report the first error as a hard error instead of tolerating it.
  2300. */
  2301. bail?: boolean;
  2302. /**
  2303. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2304. */
  2305. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2306. /**
  2307. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2308. */
  2309. context?: string;
  2310. /**
  2311. * References to other configurations to depend on.
  2312. */
  2313. dependencies?: string[];
  2314. /**
  2315. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2316. */
  2317. devtool?: string | false;
  2318. /**
  2319. * The entry point(s) of the compilation.
  2320. */
  2321. entry?:
  2322. | string
  2323. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2324. | EntryObject
  2325. | string[];
  2326. /**
  2327. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2328. */
  2329. experiments?: Experiments;
  2330. /**
  2331. * Extend configuration from another configuration (only works when using webpack-cli).
  2332. */
  2333. extends?: string | string[];
  2334. /**
  2335. * 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`.
  2336. */
  2337. externals?:
  2338. | string
  2339. | RegExp
  2340. | ExternalItem[]
  2341. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2342. | ((
  2343. data: ExternalItemFunctionData,
  2344. callback: (
  2345. err?: null | Error,
  2346. result?: string | boolean | string[] | { [index: string]: any }
  2347. ) => void
  2348. ) => void)
  2349. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2350. /**
  2351. * Enable presets of externals for specific targets.
  2352. */
  2353. externalsPresets?: ExternalsPresets;
  2354. /**
  2355. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2356. */
  2357. externalsType?:
  2358. | "import"
  2359. | "var"
  2360. | "module"
  2361. | "assign"
  2362. | "this"
  2363. | "window"
  2364. | "self"
  2365. | "global"
  2366. | "commonjs"
  2367. | "commonjs2"
  2368. | "commonjs-module"
  2369. | "commonjs-static"
  2370. | "amd"
  2371. | "amd-require"
  2372. | "umd"
  2373. | "umd2"
  2374. | "jsonp"
  2375. | "system"
  2376. | "promise"
  2377. | "script"
  2378. | "node-commonjs";
  2379. /**
  2380. * Ignore specific warnings.
  2381. */
  2382. ignoreWarnings?: (
  2383. | RegExp
  2384. | {
  2385. /**
  2386. * A RegExp to select the origin file for the warning.
  2387. */
  2388. file?: RegExp;
  2389. /**
  2390. * A RegExp to select the warning message.
  2391. */
  2392. message?: RegExp;
  2393. /**
  2394. * A RegExp to select the origin module for the warning.
  2395. */
  2396. module?: RegExp;
  2397. }
  2398. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2399. )[];
  2400. /**
  2401. * Options for infrastructure level logging.
  2402. */
  2403. infrastructureLogging?: InfrastructureLogging;
  2404. /**
  2405. * Custom values available in the loader context.
  2406. */
  2407. loader?: Loader;
  2408. /**
  2409. * Enable production optimizations or development hints.
  2410. */
  2411. mode?: "none" | "development" | "production";
  2412. /**
  2413. * Options affecting the normal modules (`NormalModuleFactory`).
  2414. */
  2415. module?: ModuleOptions;
  2416. /**
  2417. * Name of the configuration. Used when loading multiple configurations.
  2418. */
  2419. name?: string;
  2420. /**
  2421. * Include polyfills or mocks for various node stuff.
  2422. */
  2423. node?: false | NodeOptions;
  2424. /**
  2425. * Enables/Disables integrated optimizations.
  2426. */
  2427. optimization?: Optimization;
  2428. /**
  2429. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2430. */
  2431. output?: Output;
  2432. /**
  2433. * The number of parallel processed modules in the compilation.
  2434. */
  2435. parallelism?: number;
  2436. /**
  2437. * Configuration for web performance recommendations.
  2438. */
  2439. performance?: false | PerformanceOptions;
  2440. /**
  2441. * Add additional plugins to the compiler.
  2442. */
  2443. plugins?: (
  2444. | undefined
  2445. | null
  2446. | false
  2447. | ""
  2448. | 0
  2449. | ((this: Compiler, compiler: Compiler) => void)
  2450. | WebpackPluginInstance
  2451. )[];
  2452. /**
  2453. * Capture timing information for each module.
  2454. */
  2455. profile?: boolean;
  2456. /**
  2457. * Store compiler state to a json file.
  2458. */
  2459. recordsInputPath?: string | false;
  2460. /**
  2461. * Load compiler state from a json file.
  2462. */
  2463. recordsOutputPath?: string | false;
  2464. /**
  2465. * 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.
  2466. */
  2467. recordsPath?: string | false;
  2468. /**
  2469. * Options for the resolver.
  2470. */
  2471. resolve?: ResolveOptions;
  2472. /**
  2473. * Options for the resolver when resolving loaders.
  2474. */
  2475. resolveLoader?: ResolveOptions;
  2476. /**
  2477. * Options affecting how file system snapshots are created and validated.
  2478. */
  2479. snapshot?: SnapshotOptionsWebpackOptions;
  2480. /**
  2481. * Stats options object or preset name.
  2482. */
  2483. stats?:
  2484. | boolean
  2485. | StatsOptions
  2486. | "none"
  2487. | "verbose"
  2488. | "summary"
  2489. | "errors-only"
  2490. | "errors-warnings"
  2491. | "minimal"
  2492. | "normal"
  2493. | "detailed";
  2494. /**
  2495. * Environment to build for. An array of environments to build for all of them when possible.
  2496. */
  2497. target?: string | false | string[];
  2498. /**
  2499. * Enter watch mode, which rebuilds on file change.
  2500. */
  2501. watch?: boolean;
  2502. /**
  2503. * Options for the watcher.
  2504. */
  2505. watchOptions?: WatchOptions;
  2506. }
  2507. type ConnectionState =
  2508. | boolean
  2509. | typeof TRANSITIVE_ONLY
  2510. | typeof CIRCULAR_CONNECTION;
  2511. declare class ConstDependency extends NullDependency {
  2512. constructor(
  2513. expression: string,
  2514. range: number | [number, number],
  2515. runtimeRequirements?: null | string[]
  2516. );
  2517. expression: string;
  2518. range: number | [number, number];
  2519. runtimeRequirements: null | Set<string>;
  2520. static Template: typeof ConstDependencyTemplate;
  2521. static NO_EXPORTS_REFERENCED: string[][];
  2522. static EXPORTS_OBJECT_REFERENCED: string[][];
  2523. static TRANSITIVE: typeof TRANSITIVE;
  2524. }
  2525. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2526. constructor();
  2527. }
  2528. declare interface Constructor {
  2529. new (...params: any[]): any;
  2530. }
  2531. declare class ConsumeSharedPlugin {
  2532. constructor(options: ConsumeSharedPluginOptions);
  2533. /**
  2534. * Apply the plugin
  2535. */
  2536. apply(compiler: Compiler): void;
  2537. }
  2538. /**
  2539. * Options for consuming shared modules.
  2540. */
  2541. declare interface ConsumeSharedPluginOptions {
  2542. /**
  2543. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2544. */
  2545. consumes: Consumes;
  2546. /**
  2547. * Share scope name used for all consumed modules (defaults to 'default').
  2548. */
  2549. shareScope?: string;
  2550. }
  2551. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2552. /**
  2553. * Advanced configuration for modules that should be consumed from share scope.
  2554. */
  2555. declare interface ConsumesConfig {
  2556. /**
  2557. * 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.
  2558. */
  2559. eager?: boolean;
  2560. /**
  2561. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2562. */
  2563. import?: string | false;
  2564. /**
  2565. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2566. */
  2567. packageName?: string;
  2568. /**
  2569. * Version requirement from module in share scope.
  2570. */
  2571. requiredVersion?: string | false;
  2572. /**
  2573. * Module is looked up under this key from the share scope.
  2574. */
  2575. shareKey?: string;
  2576. /**
  2577. * Share scope name.
  2578. */
  2579. shareScope?: string;
  2580. /**
  2581. * Allow only a single version of the shared module in share scope (disabled by default).
  2582. */
  2583. singleton?: boolean;
  2584. /**
  2585. * 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).
  2586. */
  2587. strictVersion?: boolean;
  2588. }
  2589. /**
  2590. * 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.
  2591. */
  2592. declare interface ConsumesObject {
  2593. [index: string]: string | ConsumesConfig;
  2594. }
  2595. type ContainerOptionsFormat<T> =
  2596. | Record<string, string | string[] | T>
  2597. | (string | Record<string, string | string[] | T>)[];
  2598. declare class ContainerPlugin {
  2599. constructor(options: ContainerPluginOptions);
  2600. /**
  2601. * Apply the plugin
  2602. */
  2603. apply(compiler: Compiler): void;
  2604. }
  2605. declare interface ContainerPluginOptions {
  2606. /**
  2607. * 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.
  2608. */
  2609. exposes: Exposes;
  2610. /**
  2611. * The filename for this container relative path inside the `output.path` directory.
  2612. */
  2613. filename?: string;
  2614. /**
  2615. * Options for library.
  2616. */
  2617. library?: LibraryOptions;
  2618. /**
  2619. * The name for this container.
  2620. */
  2621. name: string;
  2622. /**
  2623. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2624. */
  2625. runtime?: string | false;
  2626. /**
  2627. * The name of the share scope which is shared with the host (defaults to 'default').
  2628. */
  2629. shareScope?: string;
  2630. }
  2631. declare class ContainerReferencePlugin {
  2632. constructor(options: ContainerReferencePluginOptions);
  2633. /**
  2634. * Apply the plugin
  2635. */
  2636. apply(compiler: Compiler): void;
  2637. }
  2638. declare interface ContainerReferencePluginOptions {
  2639. /**
  2640. * The external type of the remote containers.
  2641. */
  2642. remoteType: ExternalsType;
  2643. /**
  2644. * 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.
  2645. */
  2646. remotes: Remotes;
  2647. /**
  2648. * The name of the share scope shared with all remotes (defaults to 'default').
  2649. */
  2650. shareScope?: string;
  2651. }
  2652. declare abstract class ContextElementDependency extends ModuleDependency {
  2653. referencedExports?: string[][];
  2654. }
  2655. declare class ContextExclusionPlugin {
  2656. constructor(negativeMatcher: RegExp);
  2657. negativeMatcher: RegExp;
  2658. /**
  2659. * Apply the plugin
  2660. */
  2661. apply(compiler: Compiler): void;
  2662. }
  2663. declare interface ContextFileSystemInfoEntry {
  2664. safeTime: number;
  2665. timestampHash?: string;
  2666. resolved?: ResolvedContextFileSystemInfoEntry;
  2667. symlinks?: Set<string>;
  2668. }
  2669. declare interface ContextHash {
  2670. hash: string;
  2671. resolved?: string;
  2672. symlinks?: Set<string>;
  2673. }
  2674. type ContextMode =
  2675. | "weak"
  2676. | "eager"
  2677. | "lazy"
  2678. | "lazy-once"
  2679. | "sync"
  2680. | "async-weak";
  2681. declare abstract class ContextModuleFactory extends ModuleFactory {
  2682. hooks: Readonly<{
  2683. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2684. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2685. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2686. alternatives: FakeHook<
  2687. Pick<
  2688. AsyncSeriesWaterfallHook<[any[]]>,
  2689. "name" | "tap" | "tapAsync" | "tapPromise"
  2690. >
  2691. >;
  2692. alternativeRequests: AsyncSeriesWaterfallHook<
  2693. [any[], ContextModuleOptions]
  2694. >;
  2695. }>;
  2696. resolverFactory: ResolverFactory;
  2697. resolveDependencies(
  2698. fs: InputFileSystem,
  2699. options: ContextModuleOptions,
  2700. callback: (
  2701. err?: null | Error,
  2702. dependencies?: ContextElementDependency[]
  2703. ) => any
  2704. ): void;
  2705. }
  2706. declare interface ContextModuleOptions {
  2707. mode: ContextMode;
  2708. recursive: boolean;
  2709. regExp: RegExp;
  2710. namespaceObject?: boolean | "strict";
  2711. addon?: string;
  2712. chunkName?: string;
  2713. include?: RegExp;
  2714. exclude?: RegExp;
  2715. groupOptions?: RawChunkGroupOptions;
  2716. typePrefix?: string;
  2717. category?: string;
  2718. /**
  2719. * exports referenced from modules (won't be mangled)
  2720. */
  2721. referencedExports?: null | string[][];
  2722. layer?: string;
  2723. attributes?: ImportAttributes;
  2724. resource: string | false | string[];
  2725. resourceQuery?: string;
  2726. resourceFragment?: string;
  2727. resolveOptions: any;
  2728. }
  2729. declare class ContextReplacementPlugin {
  2730. constructor(
  2731. resourceRegExp: RegExp,
  2732. newContentResource?: any,
  2733. newContentRecursive?: any,
  2734. newContentRegExp?: any
  2735. );
  2736. resourceRegExp: RegExp;
  2737. newContentCallback: any;
  2738. newContentResource: any;
  2739. newContentCreateContextMap: any;
  2740. newContentRecursive: any;
  2741. newContentRegExp: any;
  2742. /**
  2743. * Apply the plugin
  2744. */
  2745. apply(compiler: Compiler): void;
  2746. }
  2747. declare interface ContextTimestampAndHash {
  2748. safeTime: number;
  2749. timestampHash?: string;
  2750. hash: string;
  2751. resolved?: ResolvedContextTimestampAndHash;
  2752. symlinks?: Set<string>;
  2753. }
  2754. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2755. Record<string, any>;
  2756. type CreateWriteStreamFSImplementation = FSImplementation & {
  2757. write: (...args: any[]) => any;
  2758. close?: (...args: any[]) => any;
  2759. };
  2760. /**
  2761. * Generator options for css/auto modules.
  2762. */
  2763. declare interface CssAutoGeneratorOptions {
  2764. /**
  2765. * Configure the generated JS modules that use the ES modules syntax.
  2766. */
  2767. esModule?: boolean;
  2768. /**
  2769. * Specifies the convention of exported names.
  2770. */
  2771. exportsConvention?:
  2772. | "as-is"
  2773. | "camel-case"
  2774. | "camel-case-only"
  2775. | "dashes"
  2776. | "dashes-only"
  2777. | ((name: string) => string);
  2778. /**
  2779. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2780. */
  2781. exportsOnly?: boolean;
  2782. /**
  2783. * Configure the generated local ident name.
  2784. */
  2785. localIdentName?: string;
  2786. }
  2787. /**
  2788. * Parser options for css/auto modules.
  2789. */
  2790. declare interface CssAutoParserOptions {
  2791. /**
  2792. * Use ES modules named export for css exports.
  2793. */
  2794. namedExports?: boolean;
  2795. }
  2796. /**
  2797. * Generator options for css modules.
  2798. */
  2799. declare interface CssGeneratorOptions {
  2800. /**
  2801. * Configure the generated JS modules that use the ES modules syntax.
  2802. */
  2803. esModule?: boolean;
  2804. /**
  2805. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2806. */
  2807. exportsOnly?: boolean;
  2808. }
  2809. /**
  2810. * Generator options for css/global modules.
  2811. */
  2812. declare interface CssGlobalGeneratorOptions {
  2813. /**
  2814. * Configure the generated JS modules that use the ES modules syntax.
  2815. */
  2816. esModule?: boolean;
  2817. /**
  2818. * Specifies the convention of exported names.
  2819. */
  2820. exportsConvention?:
  2821. | "as-is"
  2822. | "camel-case"
  2823. | "camel-case-only"
  2824. | "dashes"
  2825. | "dashes-only"
  2826. | ((name: string) => string);
  2827. /**
  2828. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2829. */
  2830. exportsOnly?: boolean;
  2831. /**
  2832. * Configure the generated local ident name.
  2833. */
  2834. localIdentName?: string;
  2835. }
  2836. /**
  2837. * Parser options for css/global modules.
  2838. */
  2839. declare interface CssGlobalParserOptions {
  2840. /**
  2841. * Use ES modules named export for css exports.
  2842. */
  2843. namedExports?: boolean;
  2844. }
  2845. declare interface CssImportDependencyMeta {
  2846. layer?: string;
  2847. supports?: string;
  2848. media?: string;
  2849. }
  2850. /**
  2851. * Generator options for css/module modules.
  2852. */
  2853. declare interface CssModuleGeneratorOptions {
  2854. /**
  2855. * Configure the generated JS modules that use the ES modules syntax.
  2856. */
  2857. esModule?: boolean;
  2858. /**
  2859. * Specifies the convention of exported names.
  2860. */
  2861. exportsConvention?:
  2862. | "as-is"
  2863. | "camel-case"
  2864. | "camel-case-only"
  2865. | "dashes"
  2866. | "dashes-only"
  2867. | ((name: string) => string);
  2868. /**
  2869. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2870. */
  2871. exportsOnly?: boolean;
  2872. /**
  2873. * Configure the generated local ident name.
  2874. */
  2875. localIdentName?: string;
  2876. }
  2877. /**
  2878. * Parser options for css/module modules.
  2879. */
  2880. declare interface CssModuleParserOptions {
  2881. /**
  2882. * Use ES modules named export for css exports.
  2883. */
  2884. namedExports?: boolean;
  2885. }
  2886. /**
  2887. * Parser options for css modules.
  2888. */
  2889. declare interface CssParserOptions {
  2890. /**
  2891. * Use ES modules named export for css exports.
  2892. */
  2893. namedExports?: boolean;
  2894. }
  2895. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  2896. declare class DefinePlugin {
  2897. /**
  2898. * Create a new define plugin
  2899. */
  2900. constructor(definitions: Record<string, CodeValue>);
  2901. definitions: Record<string, CodeValue>;
  2902. /**
  2903. * Apply the plugin
  2904. */
  2905. apply(compiler: Compiler): void;
  2906. static runtimeValue(
  2907. fn: (arg0: {
  2908. module: NormalModule;
  2909. key: string;
  2910. readonly version?: string;
  2911. }) => CodeValuePrimitive,
  2912. options?: true | string[] | RuntimeValueOptions
  2913. ): RuntimeValue;
  2914. }
  2915. declare class DelegatedPlugin {
  2916. constructor(options?: any);
  2917. options: any;
  2918. /**
  2919. * Apply the plugin
  2920. */
  2921. apply(compiler: Compiler): void;
  2922. }
  2923. declare interface DepConstructor {
  2924. new (...args: any[]): Dependency;
  2925. }
  2926. declare abstract class DependenciesBlock {
  2927. dependencies: Dependency[];
  2928. blocks: AsyncDependenciesBlock[];
  2929. parent?: DependenciesBlock;
  2930. getRootBlock(): DependenciesBlock;
  2931. /**
  2932. * Adds a DependencyBlock to DependencyBlock relationship.
  2933. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  2934. */
  2935. addBlock(block: AsyncDependenciesBlock): void;
  2936. addDependency(dependency: Dependency): void;
  2937. removeDependency(dependency: Dependency): void;
  2938. /**
  2939. * Removes all dependencies and blocks
  2940. */
  2941. clearDependenciesAndBlocks(): void;
  2942. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2943. serialize(__0: ObjectSerializerContext): void;
  2944. deserialize(__0: ObjectDeserializerContext): void;
  2945. }
  2946. declare interface DependenciesBlockLike {
  2947. dependencies: Dependency[];
  2948. blocks: AsyncDependenciesBlock[];
  2949. }
  2950. declare class Dependency {
  2951. constructor();
  2952. weak: boolean;
  2953. optional: boolean;
  2954. get type(): string;
  2955. get category(): string;
  2956. loc: DependencyLocation;
  2957. setLoc(
  2958. startLine: number,
  2959. startColumn: number,
  2960. endLine: number,
  2961. endColumn: number
  2962. ): void;
  2963. getContext(): undefined | string;
  2964. getResourceIdentifier(): null | string;
  2965. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  2966. /**
  2967. * Returns the referenced module and export
  2968. */
  2969. getReference(moduleGraph: ModuleGraph): never;
  2970. /**
  2971. * Returns list of exports referenced by this dependency
  2972. */
  2973. getReferencedExports(
  2974. moduleGraph: ModuleGraph,
  2975. runtime: RuntimeSpec
  2976. ): (string[] | ReferencedExport)[];
  2977. getCondition(
  2978. moduleGraph: ModuleGraph
  2979. ):
  2980. | null
  2981. | false
  2982. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  2983. /**
  2984. * Returns the exported names
  2985. */
  2986. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  2987. /**
  2988. * Returns warnings
  2989. */
  2990. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  2991. /**
  2992. * Returns errors
  2993. */
  2994. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  2995. /**
  2996. * Update the hash
  2997. */
  2998. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  2999. /**
  3000. * implement this method to allow the occurrence order plugin to count correctly
  3001. */
  3002. getNumberOfIdOccurrences(): number;
  3003. getModuleEvaluationSideEffectsState(
  3004. moduleGraph: ModuleGraph
  3005. ): ConnectionState;
  3006. createIgnoredModule(context: string): null | Module;
  3007. serialize(__0: ObjectSerializerContext): void;
  3008. deserialize(__0: ObjectDeserializerContext): void;
  3009. module: any;
  3010. get disconnect(): any;
  3011. static NO_EXPORTS_REFERENCED: string[][];
  3012. static EXPORTS_OBJECT_REFERENCED: string[][];
  3013. static TRANSITIVE: typeof TRANSITIVE;
  3014. }
  3015. declare interface DependencyConstructor {
  3016. new (...args: any[]): Dependency;
  3017. }
  3018. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3019. declare class DependencyTemplate {
  3020. constructor();
  3021. apply(
  3022. dependency: Dependency,
  3023. source: ReplaceSource,
  3024. templateContext: DependencyTemplateContext
  3025. ): void;
  3026. }
  3027. declare interface DependencyTemplateContext {
  3028. /**
  3029. * the runtime template
  3030. */
  3031. runtimeTemplate: RuntimeTemplate;
  3032. /**
  3033. * the dependency templates
  3034. */
  3035. dependencyTemplates: DependencyTemplates;
  3036. /**
  3037. * the module graph
  3038. */
  3039. moduleGraph: ModuleGraph;
  3040. /**
  3041. * the chunk graph
  3042. */
  3043. chunkGraph: ChunkGraph;
  3044. /**
  3045. * the requirements for runtime
  3046. */
  3047. runtimeRequirements: Set<string>;
  3048. /**
  3049. * current module
  3050. */
  3051. module: Module;
  3052. /**
  3053. * current runtimes, for which code is generated
  3054. */
  3055. runtime: RuntimeSpec;
  3056. /**
  3057. * mutable array of init fragments for the current module
  3058. */
  3059. initFragments: InitFragment<GenerateContext>[];
  3060. /**
  3061. * when in a concatenated module, information about other concatenated modules
  3062. */
  3063. concatenationScope?: ConcatenationScope;
  3064. /**
  3065. * the code generation results
  3066. */
  3067. codeGenerationResults: CodeGenerationResults;
  3068. /**
  3069. * chunkInitFragments
  3070. */
  3071. chunkInitFragments: InitFragment<GenerateContext>[];
  3072. }
  3073. declare abstract class DependencyTemplates {
  3074. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3075. set(
  3076. dependency: DependencyConstructor,
  3077. dependencyTemplate: DependencyTemplate
  3078. ): void;
  3079. updateHash(part: string): void;
  3080. getHash(): string;
  3081. clone(): DependencyTemplates;
  3082. }
  3083. /**
  3084. * Helper function for joining two ranges into a single range. This is useful
  3085. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3086. * to create the range of the _parent node_.
  3087. */
  3088. declare interface DestructuringAssignmentProperty {
  3089. id: string;
  3090. range?: [number, number];
  3091. shorthand: string | boolean;
  3092. }
  3093. declare class DeterministicChunkIdsPlugin {
  3094. constructor(options?: DeterministicChunkIdsPluginOptions);
  3095. options: DeterministicChunkIdsPluginOptions;
  3096. /**
  3097. * Apply the plugin
  3098. */
  3099. apply(compiler: Compiler): void;
  3100. }
  3101. declare interface DeterministicChunkIdsPluginOptions {
  3102. /**
  3103. * context for ids
  3104. */
  3105. context?: string;
  3106. /**
  3107. * maximum length of ids
  3108. */
  3109. maxLength?: number;
  3110. }
  3111. declare class DeterministicModuleIdsPlugin {
  3112. constructor(options?: DeterministicModuleIdsPluginOptions);
  3113. options: DeterministicModuleIdsPluginOptions;
  3114. /**
  3115. * Apply the plugin
  3116. */
  3117. apply(compiler: Compiler): void;
  3118. }
  3119. declare interface DeterministicModuleIdsPluginOptions {
  3120. /**
  3121. * context relative to which module identifiers are computed
  3122. */
  3123. context?: string;
  3124. /**
  3125. * selector function for modules
  3126. */
  3127. test?: (arg0: Module) => boolean;
  3128. /**
  3129. * maximum id length in digits (used as starting point)
  3130. */
  3131. maxLength?: number;
  3132. /**
  3133. * hash salt for ids
  3134. */
  3135. salt?: number;
  3136. /**
  3137. * do not increase the maxLength to find an optimal id space size
  3138. */
  3139. fixedLength?: boolean;
  3140. /**
  3141. * throw an error when id conflicts occur (instead of rehashing)
  3142. */
  3143. failOnConflict?: boolean;
  3144. }
  3145. type DevtoolModuleFilenameTemplate = string | Function;
  3146. declare interface Dirent {
  3147. isFile: () => boolean;
  3148. isDirectory: () => boolean;
  3149. isBlockDevice: () => boolean;
  3150. isCharacterDevice: () => boolean;
  3151. isSymbolicLink: () => boolean;
  3152. isFIFO: () => boolean;
  3153. isSocket: () => boolean;
  3154. name: string;
  3155. path: string;
  3156. }
  3157. declare class DllPlugin {
  3158. constructor(options: DllPluginOptions);
  3159. options: {
  3160. entryOnly: boolean;
  3161. /**
  3162. * Context of requests in the manifest file (defaults to the webpack context).
  3163. */
  3164. context?: string;
  3165. /**
  3166. * If true, manifest json file (output) will be formatted.
  3167. */
  3168. format?: boolean;
  3169. /**
  3170. * Name of the exposed dll function (external name, use value of 'output.library').
  3171. */
  3172. name?: string;
  3173. /**
  3174. * Absolute path to the manifest json file (output).
  3175. */
  3176. path: string;
  3177. /**
  3178. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3179. */
  3180. type?: string;
  3181. };
  3182. /**
  3183. * Apply the plugin
  3184. */
  3185. apply(compiler: Compiler): void;
  3186. }
  3187. declare interface DllPluginOptions {
  3188. /**
  3189. * Context of requests in the manifest file (defaults to the webpack context).
  3190. */
  3191. context?: string;
  3192. /**
  3193. * If true, only entry points will be exposed (default: true).
  3194. */
  3195. entryOnly?: boolean;
  3196. /**
  3197. * If true, manifest json file (output) will be formatted.
  3198. */
  3199. format?: boolean;
  3200. /**
  3201. * Name of the exposed dll function (external name, use value of 'output.library').
  3202. */
  3203. name?: string;
  3204. /**
  3205. * Absolute path to the manifest json file (output).
  3206. */
  3207. path: string;
  3208. /**
  3209. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3210. */
  3211. type?: string;
  3212. }
  3213. declare class DllReferencePlugin {
  3214. constructor(options: DllReferencePluginOptions);
  3215. options: DllReferencePluginOptions;
  3216. /**
  3217. * Apply the plugin
  3218. */
  3219. apply(compiler: Compiler): void;
  3220. }
  3221. type DllReferencePluginOptions =
  3222. | {
  3223. /**
  3224. * Context of requests in the manifest (or content property) as absolute path.
  3225. */
  3226. context?: string;
  3227. /**
  3228. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3229. */
  3230. extensions?: string[];
  3231. /**
  3232. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  3233. */
  3234. manifest: string | DllReferencePluginOptionsManifest;
  3235. /**
  3236. * The name where the dll is exposed (external name, defaults to manifest.name).
  3237. */
  3238. name?: string;
  3239. /**
  3240. * Prefix which is used for accessing the content of the dll.
  3241. */
  3242. scope?: string;
  3243. /**
  3244. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  3245. */
  3246. sourceType?:
  3247. | "var"
  3248. | "assign"
  3249. | "this"
  3250. | "window"
  3251. | "global"
  3252. | "commonjs"
  3253. | "commonjs2"
  3254. | "commonjs-module"
  3255. | "amd"
  3256. | "amd-require"
  3257. | "umd"
  3258. | "umd2"
  3259. | "jsonp"
  3260. | "system";
  3261. /**
  3262. * The way how the export of the dll bundle is used.
  3263. */
  3264. type?: "object" | "require";
  3265. }
  3266. | {
  3267. /**
  3268. * The mappings from request to module info.
  3269. */
  3270. content: DllReferencePluginOptionsContent;
  3271. /**
  3272. * Context of requests in the manifest (or content property) as absolute path.
  3273. */
  3274. context?: string;
  3275. /**
  3276. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3277. */
  3278. extensions?: string[];
  3279. /**
  3280. * The name where the dll is exposed (external name).
  3281. */
  3282. name: string;
  3283. /**
  3284. * Prefix which is used for accessing the content of the dll.
  3285. */
  3286. scope?: string;
  3287. /**
  3288. * How the dll is exposed (libraryTarget).
  3289. */
  3290. sourceType?:
  3291. | "var"
  3292. | "assign"
  3293. | "this"
  3294. | "window"
  3295. | "global"
  3296. | "commonjs"
  3297. | "commonjs2"
  3298. | "commonjs-module"
  3299. | "amd"
  3300. | "amd-require"
  3301. | "umd"
  3302. | "umd2"
  3303. | "jsonp"
  3304. | "system";
  3305. /**
  3306. * The way how the export of the dll bundle is used.
  3307. */
  3308. type?: "object" | "require";
  3309. };
  3310. /**
  3311. * The mappings from request to module info.
  3312. */
  3313. declare interface DllReferencePluginOptionsContent {
  3314. [index: string]: {
  3315. /**
  3316. * Meta information about the module.
  3317. */
  3318. buildMeta?: { [index: string]: any };
  3319. /**
  3320. * Information about the provided exports of the module.
  3321. */
  3322. exports?: true | string[];
  3323. /**
  3324. * Module ID.
  3325. */
  3326. id: string | number;
  3327. };
  3328. }
  3329. /**
  3330. * An object containing content, name and type.
  3331. */
  3332. declare interface DllReferencePluginOptionsManifest {
  3333. /**
  3334. * The mappings from request to module info.
  3335. */
  3336. content: DllReferencePluginOptionsContent;
  3337. /**
  3338. * The name where the dll is exposed (external name).
  3339. */
  3340. name?: string;
  3341. /**
  3342. * The type how the dll is exposed (external type).
  3343. */
  3344. type?:
  3345. | "var"
  3346. | "assign"
  3347. | "this"
  3348. | "window"
  3349. | "global"
  3350. | "commonjs"
  3351. | "commonjs2"
  3352. | "commonjs-module"
  3353. | "amd"
  3354. | "amd-require"
  3355. | "umd"
  3356. | "umd2"
  3357. | "jsonp"
  3358. | "system";
  3359. }
  3360. declare class DynamicEntryPlugin {
  3361. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  3362. context: string;
  3363. entry: () => Promise<EntryStaticNormalized>;
  3364. /**
  3365. * Apply the plugin
  3366. */
  3367. apply(compiler: Compiler): void;
  3368. }
  3369. declare interface Effect {
  3370. type: string;
  3371. value: any;
  3372. }
  3373. declare class ElectronTargetPlugin {
  3374. constructor(context?: "main" | "preload" | "renderer");
  3375. /**
  3376. * Apply the plugin
  3377. */
  3378. apply(compiler: Compiler): void;
  3379. }
  3380. /**
  3381. * No generator options are supported for this module type.
  3382. */
  3383. declare interface EmptyGeneratorOptions {}
  3384. /**
  3385. * No parser options are supported for this module type.
  3386. */
  3387. declare interface EmptyParserOptions {}
  3388. declare class EnableChunkLoadingPlugin {
  3389. constructor(type: string);
  3390. type: string;
  3391. /**
  3392. * Apply the plugin
  3393. */
  3394. apply(compiler: Compiler): void;
  3395. static setEnabled(compiler: Compiler, type: string): void;
  3396. static checkEnabled(compiler: Compiler, type: string): void;
  3397. }
  3398. declare class EnableLibraryPlugin {
  3399. constructor(type: string);
  3400. type: string;
  3401. /**
  3402. * Apply the plugin
  3403. */
  3404. apply(compiler: Compiler): void;
  3405. static setEnabled(compiler: Compiler, type: string): void;
  3406. static checkEnabled(compiler: Compiler, type: string): void;
  3407. }
  3408. declare class EnableWasmLoadingPlugin {
  3409. constructor(type: string);
  3410. type: string;
  3411. /**
  3412. * Apply the plugin
  3413. */
  3414. apply(compiler: Compiler): void;
  3415. static setEnabled(compiler: Compiler, type: string): void;
  3416. static checkEnabled(compiler: Compiler, type: string): void;
  3417. }
  3418. type EncodingOption =
  3419. | undefined
  3420. | null
  3421. | "ascii"
  3422. | "utf8"
  3423. | "utf-8"
  3424. | "utf16le"
  3425. | "utf-16le"
  3426. | "ucs2"
  3427. | "ucs-2"
  3428. | "latin1"
  3429. | "binary"
  3430. | "base64"
  3431. | "base64url"
  3432. | "hex"
  3433. | ObjectEncodingOptions;
  3434. type Entry =
  3435. | string
  3436. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  3437. | EntryObject
  3438. | string[];
  3439. declare interface EntryData {
  3440. /**
  3441. * dependencies of the entrypoint that should be evaluated at startup
  3442. */
  3443. dependencies: Dependency[];
  3444. /**
  3445. * dependencies of the entrypoint that should be included but not evaluated
  3446. */
  3447. includeDependencies: Dependency[];
  3448. /**
  3449. * options of the entrypoint
  3450. */
  3451. options: EntryOptions;
  3452. }
  3453. declare abstract class EntryDependency extends ModuleDependency {}
  3454. /**
  3455. * An object with entry point description.
  3456. */
  3457. declare interface EntryDescription {
  3458. /**
  3459. * Enable/disable creating async chunks that are loaded on demand.
  3460. */
  3461. asyncChunks?: boolean;
  3462. /**
  3463. * Base uri for this entry.
  3464. */
  3465. baseUri?: string;
  3466. /**
  3467. * 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).
  3468. */
  3469. chunkLoading?: string | false;
  3470. /**
  3471. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3472. */
  3473. dependOn?: string | string[];
  3474. /**
  3475. * 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.
  3476. */
  3477. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3478. /**
  3479. * Module(s) that are loaded upon startup.
  3480. */
  3481. import: EntryItem;
  3482. /**
  3483. * Specifies the layer in which modules of this entrypoint are placed.
  3484. */
  3485. layer?: null | string;
  3486. /**
  3487. * Options for library.
  3488. */
  3489. library?: LibraryOptions;
  3490. /**
  3491. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3492. */
  3493. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3494. /**
  3495. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3496. */
  3497. runtime?: string | false;
  3498. /**
  3499. * 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).
  3500. */
  3501. wasmLoading?: string | false;
  3502. }
  3503. /**
  3504. * An object with entry point description.
  3505. */
  3506. declare interface EntryDescriptionNormalized {
  3507. /**
  3508. * Enable/disable creating async chunks that are loaded on demand.
  3509. */
  3510. asyncChunks?: boolean;
  3511. /**
  3512. * Base uri for this entry.
  3513. */
  3514. baseUri?: string;
  3515. /**
  3516. * 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).
  3517. */
  3518. chunkLoading?: string | false;
  3519. /**
  3520. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3521. */
  3522. dependOn?: string[];
  3523. /**
  3524. * 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.
  3525. */
  3526. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3527. /**
  3528. * Module(s) that are loaded upon startup. The last one is exported.
  3529. */
  3530. import?: string[];
  3531. /**
  3532. * Specifies the layer in which modules of this entrypoint are placed.
  3533. */
  3534. layer?: null | string;
  3535. /**
  3536. * Options for library.
  3537. */
  3538. library?: LibraryOptions;
  3539. /**
  3540. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3541. */
  3542. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3543. /**
  3544. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3545. */
  3546. runtime?: string | false;
  3547. /**
  3548. * 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).
  3549. */
  3550. wasmLoading?: string | false;
  3551. }
  3552. type EntryItem = string | string[];
  3553. type EntryNormalized =
  3554. | (() => Promise<EntryStaticNormalized>)
  3555. | EntryStaticNormalized;
  3556. /**
  3557. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3558. */
  3559. declare interface EntryObject {
  3560. [index: string]: string | string[] | EntryDescription;
  3561. }
  3562. declare class EntryOptionPlugin {
  3563. constructor();
  3564. apply(compiler: Compiler): void;
  3565. static applyEntryOption(
  3566. compiler: Compiler,
  3567. context: string,
  3568. entry: EntryNormalized
  3569. ): void;
  3570. static entryDescriptionToOptions(
  3571. compiler: Compiler,
  3572. name: string,
  3573. desc: EntryDescriptionNormalized
  3574. ): EntryOptions;
  3575. }
  3576. type EntryOptions = { name?: string } & Omit<
  3577. EntryDescriptionNormalized,
  3578. "import"
  3579. >;
  3580. declare class EntryPlugin {
  3581. /**
  3582. * An entry plugin which will handle
  3583. * creation of the EntryDependency
  3584. */
  3585. constructor(context: string, entry: string, options?: string | EntryOptions);
  3586. context: string;
  3587. entry: string;
  3588. options: string | EntryOptions;
  3589. /**
  3590. * Apply the plugin
  3591. */
  3592. apply(compiler: Compiler): void;
  3593. static createDependency(
  3594. entry: string,
  3595. options: string | EntryOptions
  3596. ): EntryDependency;
  3597. }
  3598. type EntryStatic = string | EntryObject | string[];
  3599. /**
  3600. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3601. */
  3602. declare interface EntryStaticNormalized {
  3603. [index: string]: EntryDescriptionNormalized;
  3604. }
  3605. declare abstract class Entrypoint extends ChunkGroup {
  3606. /**
  3607. * Sets the runtimeChunk for an entrypoint.
  3608. */
  3609. setRuntimeChunk(chunk: Chunk): void;
  3610. /**
  3611. * Fetches the chunk reference containing the webpack bootstrap code
  3612. */
  3613. getRuntimeChunk(): null | Chunk;
  3614. /**
  3615. * Sets the chunk with the entrypoint modules for an entrypoint.
  3616. */
  3617. setEntrypointChunk(chunk: Chunk): void;
  3618. /**
  3619. * Returns the chunk which contains the entrypoint modules
  3620. * (or at least the execution of them)
  3621. */
  3622. getEntrypointChunk(): Chunk;
  3623. }
  3624. /**
  3625. * The abilities of the environment where the webpack generated code should run.
  3626. */
  3627. declare interface Environment {
  3628. /**
  3629. * The environment supports arrow functions ('() => { ... }').
  3630. */
  3631. arrowFunction?: boolean;
  3632. /**
  3633. * The environment supports async function and await ('async function () { await ... }').
  3634. */
  3635. asyncFunction?: boolean;
  3636. /**
  3637. * The environment supports BigInt as literal (123n).
  3638. */
  3639. bigIntLiteral?: boolean;
  3640. /**
  3641. * The environment supports const and let for variable declarations.
  3642. */
  3643. const?: boolean;
  3644. /**
  3645. * The environment supports destructuring ('{ a, b } = obj').
  3646. */
  3647. destructuring?: boolean;
  3648. /**
  3649. * The environment supports 'document'.
  3650. */
  3651. document?: boolean;
  3652. /**
  3653. * The environment supports an async import() function to import EcmaScript modules.
  3654. */
  3655. dynamicImport?: boolean;
  3656. /**
  3657. * The environment supports an async import() is available when creating a worker.
  3658. */
  3659. dynamicImportInWorker?: boolean;
  3660. /**
  3661. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3662. */
  3663. forOf?: boolean;
  3664. /**
  3665. * The environment supports 'globalThis'.
  3666. */
  3667. globalThis?: boolean;
  3668. /**
  3669. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3670. */
  3671. module?: boolean;
  3672. /**
  3673. * The environment supports `node:` prefix for Node.js core modules.
  3674. */
  3675. nodePrefixForCoreModules?: boolean;
  3676. /**
  3677. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3678. */
  3679. optionalChaining?: boolean;
  3680. /**
  3681. * The environment supports template literals.
  3682. */
  3683. templateLiteral?: boolean;
  3684. }
  3685. declare class EnvironmentPlugin {
  3686. constructor(...keys: any[]);
  3687. keys: any[];
  3688. defaultValues: any;
  3689. /**
  3690. * Apply the plugin
  3691. */
  3692. apply(compiler: Compiler): void;
  3693. }
  3694. type ErrorWithDetail = Error & { details?: string };
  3695. declare interface Etag {
  3696. toString: () => string;
  3697. }
  3698. declare class EvalDevToolModulePlugin {
  3699. constructor(options?: EvalDevToolModulePluginOptions);
  3700. namespace: string;
  3701. sourceUrlComment: string;
  3702. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  3703. /**
  3704. * Apply the plugin
  3705. */
  3706. apply(compiler: Compiler): void;
  3707. }
  3708. declare interface EvalDevToolModulePluginOptions {
  3709. /**
  3710. * namespace
  3711. */
  3712. namespace?: string;
  3713. /**
  3714. * source url comment
  3715. */
  3716. sourceUrlComment?: string;
  3717. /**
  3718. * module filename template
  3719. */
  3720. moduleFilenameTemplate?: string | Function;
  3721. }
  3722. declare class EvalSourceMapDevToolPlugin {
  3723. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  3724. sourceMapComment: string;
  3725. moduleFilenameTemplate: string | Function;
  3726. namespace: string;
  3727. options: SourceMapDevToolPluginOptions;
  3728. /**
  3729. * Apply the plugin
  3730. */
  3731. apply(compiler: Compiler): void;
  3732. }
  3733. declare interface ExecuteModuleArgument {
  3734. module: Module;
  3735. moduleObject?: { id: string; exports: any; loaded: boolean };
  3736. preparedInfo: any;
  3737. codeGenerationResult: CodeGenerationResult;
  3738. }
  3739. declare interface ExecuteModuleContext {
  3740. assets: Map<string, { source: Source; info: AssetInfo }>;
  3741. chunk: Chunk;
  3742. chunkGraph: ChunkGraph;
  3743. __webpack_require__?: (arg0: string) => any;
  3744. }
  3745. declare interface ExecuteModuleOptions {
  3746. entryOptions?: EntryOptions;
  3747. }
  3748. declare interface ExecuteModuleResult {
  3749. exports: any;
  3750. cacheable: boolean;
  3751. assets: Map<string, { source: Source; info: AssetInfo }>;
  3752. fileDependencies: LazySet<string>;
  3753. contextDependencies: LazySet<string>;
  3754. missingDependencies: LazySet<string>;
  3755. buildDependencies: LazySet<string>;
  3756. }
  3757. type Experiments = ExperimentsCommon & ExperimentsExtra;
  3758. /**
  3759. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3760. */
  3761. declare interface ExperimentsCommon {
  3762. /**
  3763. * Support WebAssembly as asynchronous EcmaScript Module.
  3764. */
  3765. asyncWebAssembly?: boolean;
  3766. /**
  3767. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  3768. */
  3769. backCompat?: boolean;
  3770. /**
  3771. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  3772. */
  3773. cacheUnaffected?: boolean;
  3774. /**
  3775. * Apply defaults of next major version.
  3776. */
  3777. futureDefaults?: boolean;
  3778. /**
  3779. * Enable module layers.
  3780. */
  3781. layers?: boolean;
  3782. /**
  3783. * Allow output javascript files as module source type.
  3784. */
  3785. outputModule?: boolean;
  3786. /**
  3787. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  3788. */
  3789. syncWebAssembly?: boolean;
  3790. /**
  3791. * Allow using top-level-await in EcmaScript Modules.
  3792. */
  3793. topLevelAwait?: boolean;
  3794. }
  3795. /**
  3796. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3797. */
  3798. declare interface ExperimentsExtra {
  3799. /**
  3800. * Build http(s): urls using a lockfile and resource content cache.
  3801. */
  3802. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  3803. /**
  3804. * Enable css support.
  3805. */
  3806. css?: boolean;
  3807. /**
  3808. * Compile entrypoints and import()s only when they are accessed.
  3809. */
  3810. lazyCompilation?: boolean | LazyCompilationOptions;
  3811. }
  3812. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  3813. /**
  3814. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  3815. */
  3816. declare interface ExperimentsNormalizedExtra {
  3817. /**
  3818. * Build http(s): urls using a lockfile and resource content cache.
  3819. */
  3820. buildHttp?: HttpUriOptions;
  3821. /**
  3822. * Enable css support.
  3823. */
  3824. css?: boolean;
  3825. /**
  3826. * Compile entrypoints and import()s only when they are accessed.
  3827. */
  3828. lazyCompilation?: false | LazyCompilationOptions;
  3829. }
  3830. declare abstract class ExportInfo {
  3831. name: string;
  3832. /**
  3833. * true: it is provided
  3834. * false: it is not provided
  3835. * null: only the runtime knows if it is provided
  3836. * undefined: it was not determined if it is provided
  3837. */
  3838. provided?: null | boolean;
  3839. /**
  3840. * is the export a terminal binding that should be checked for export star conflicts
  3841. */
  3842. terminalBinding: boolean;
  3843. /**
  3844. * true: it can be mangled
  3845. * false: is can not be mangled
  3846. * undefined: it was not determined if it can be mangled
  3847. */
  3848. canMangleProvide?: boolean;
  3849. /**
  3850. * true: it can be mangled
  3851. * false: is can not be mangled
  3852. * undefined: it was not determined if it can be mangled
  3853. */
  3854. canMangleUse?: boolean;
  3855. exportsInfoOwned: boolean;
  3856. exportsInfo?: ExportsInfo;
  3857. get canMangle(): boolean;
  3858. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3859. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3860. setHasUseInfo(): void;
  3861. setUsedConditionally(
  3862. condition: (arg0: UsageStateType) => boolean,
  3863. newValue: UsageStateType,
  3864. runtime: RuntimeSpec
  3865. ): boolean;
  3866. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  3867. unsetTarget(key?: any): boolean;
  3868. setTarget(
  3869. key: any,
  3870. connection: ModuleGraphConnection,
  3871. exportName?: string[],
  3872. priority?: number
  3873. ): boolean;
  3874. getUsed(runtime: RuntimeSpec): UsageStateType;
  3875. /**
  3876. * get used name
  3877. */
  3878. getUsedName(
  3879. fallbackName: undefined | string,
  3880. runtime: RuntimeSpec
  3881. ): string | false;
  3882. hasUsedName(): boolean;
  3883. /**
  3884. * Sets the mangled name of this export
  3885. */
  3886. setUsedName(name: string): void;
  3887. getTerminalBinding(
  3888. moduleGraph: ModuleGraph,
  3889. resolveTargetFilter?: (arg0: {
  3890. module: Module;
  3891. export?: string[];
  3892. }) => boolean
  3893. ): undefined | ExportsInfo | ExportInfo;
  3894. isReexport(): undefined | boolean;
  3895. findTarget(
  3896. moduleGraph: ModuleGraph,
  3897. validTargetModuleFilter: (arg0: Module) => boolean
  3898. ): undefined | false | { module: Module; export?: string[] };
  3899. getTarget(
  3900. moduleGraph: ModuleGraph,
  3901. resolveTargetFilter?: (arg0: {
  3902. module: Module;
  3903. export?: string[];
  3904. }) => boolean
  3905. ): undefined | { module: Module; export?: string[] };
  3906. /**
  3907. * Move the target forward as long resolveTargetFilter is fulfilled
  3908. */
  3909. moveTarget(
  3910. moduleGraph: ModuleGraph,
  3911. resolveTargetFilter: (arg0: {
  3912. module: Module;
  3913. export?: string[];
  3914. }) => boolean,
  3915. updateOriginalConnection?: (arg0: {
  3916. module: Module;
  3917. export?: string[];
  3918. }) => ModuleGraphConnection
  3919. ): undefined | { module: Module; export?: string[] };
  3920. createNestedExportsInfo(): undefined | ExportsInfo;
  3921. getNestedExportsInfo(): undefined | ExportsInfo;
  3922. hasInfo(baseInfo?: any, runtime?: any): boolean;
  3923. updateHash(hash?: any, runtime?: any): void;
  3924. getUsedInfo(): string;
  3925. getProvidedInfo():
  3926. | "no provided info"
  3927. | "maybe provided (runtime-defined)"
  3928. | "provided"
  3929. | "not provided";
  3930. getRenameInfo(): string;
  3931. }
  3932. declare interface ExportSpec {
  3933. /**
  3934. * the name of the export
  3935. */
  3936. name: string;
  3937. /**
  3938. * can the export be renamed (defaults to true)
  3939. */
  3940. canMangle?: boolean;
  3941. /**
  3942. * is the export a terminal binding that should be checked for export star conflicts
  3943. */
  3944. terminalBinding?: boolean;
  3945. /**
  3946. * nested exports
  3947. */
  3948. exports?: (string | ExportSpec)[];
  3949. /**
  3950. * when reexported: from which module
  3951. */
  3952. from?: ModuleGraphConnection;
  3953. /**
  3954. * when reexported: from which export
  3955. */
  3956. export?: null | string[];
  3957. /**
  3958. * when reexported: with which priority
  3959. */
  3960. priority?: number;
  3961. /**
  3962. * export is not visible, because another export blends over it
  3963. */
  3964. hidden?: boolean;
  3965. }
  3966. type ExportedVariableInfo = string | ScopeInfo | VariableInfo;
  3967. declare abstract class ExportsInfo {
  3968. get ownedExports(): Iterable<ExportInfo>;
  3969. get orderedOwnedExports(): Iterable<ExportInfo>;
  3970. get exports(): Iterable<ExportInfo>;
  3971. get orderedExports(): Iterable<ExportInfo>;
  3972. get otherExportsInfo(): ExportInfo;
  3973. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  3974. setHasProvideInfo(): void;
  3975. setHasUseInfo(): void;
  3976. getOwnExportInfo(name: string): ExportInfo;
  3977. getExportInfo(name: string): ExportInfo;
  3978. getReadOnlyExportInfo(name: string): ExportInfo;
  3979. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  3980. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  3981. setUnknownExportsProvided(
  3982. canMangle?: boolean,
  3983. excludeExports?: Set<string>,
  3984. targetKey?: any,
  3985. targetModule?: ModuleGraphConnection,
  3986. priority?: number
  3987. ): boolean;
  3988. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  3989. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  3990. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  3991. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  3992. isUsed(runtime: RuntimeSpec): boolean;
  3993. isModuleUsed(runtime: RuntimeSpec): boolean;
  3994. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  3995. getProvidedExports(): null | true | string[];
  3996. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  3997. isExportProvided(name: string | string[]): undefined | null | boolean;
  3998. getUsageKey(runtime: RuntimeSpec): string;
  3999. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  4000. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  4001. getUsedName(
  4002. name: undefined | string | string[],
  4003. runtime: RuntimeSpec
  4004. ): string | false | string[];
  4005. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4006. getRestoreProvidedData(): any;
  4007. restoreProvided(__0: {
  4008. otherProvided: any;
  4009. otherCanMangleProvide: any;
  4010. otherTerminalBinding: any;
  4011. exports: any;
  4012. }): void;
  4013. }
  4014. declare interface ExportsSpec {
  4015. /**
  4016. * exported names, true for unknown exports or null for no exports
  4017. */
  4018. exports: null | true | (string | ExportSpec)[];
  4019. /**
  4020. * when exports = true, list of unaffected exports
  4021. */
  4022. excludeExports?: Set<string>;
  4023. /**
  4024. * list of maybe prior exposed, but now hidden exports
  4025. */
  4026. hideExports?: Set<string>;
  4027. /**
  4028. * when reexported: from which module
  4029. */
  4030. from?: ModuleGraphConnection;
  4031. /**
  4032. * when reexported: with which priority
  4033. */
  4034. priority?: number;
  4035. /**
  4036. * can the export be renamed (defaults to true)
  4037. */
  4038. canMangle?: boolean;
  4039. /**
  4040. * are the exports terminal bindings that should be checked for export star conflicts
  4041. */
  4042. terminalBinding?: boolean;
  4043. /**
  4044. * module on which the result depends on
  4045. */
  4046. dependencies?: Module[];
  4047. }
  4048. type Exposes = (string | ExposesObject)[] | ExposesObject;
  4049. /**
  4050. * Advanced configuration for modules that should be exposed by this container.
  4051. */
  4052. declare interface ExposesConfig {
  4053. /**
  4054. * Request to a module that should be exposed by this container.
  4055. */
  4056. import: string | string[];
  4057. /**
  4058. * Custom chunk name for the exposed module.
  4059. */
  4060. name?: string;
  4061. }
  4062. /**
  4063. * Modules that should be exposed by this container. Property names are used as public paths.
  4064. */
  4065. declare interface ExposesObject {
  4066. [index: string]: string | ExposesConfig | string[];
  4067. }
  4068. type Expression =
  4069. | UnaryExpression
  4070. | ArrayExpression
  4071. | ArrowFunctionExpression
  4072. | AssignmentExpression
  4073. | AwaitExpression
  4074. | BinaryExpression
  4075. | SimpleCallExpression
  4076. | NewExpression
  4077. | ChainExpression
  4078. | ClassExpression
  4079. | ConditionalExpression
  4080. | FunctionExpression
  4081. | Identifier
  4082. | ImportExpression
  4083. | SimpleLiteral
  4084. | RegExpLiteral
  4085. | BigIntLiteral
  4086. | LogicalExpression
  4087. | MemberExpression
  4088. | MetaProperty
  4089. | ObjectExpression
  4090. | SequenceExpression
  4091. | TaggedTemplateExpression
  4092. | TemplateLiteral
  4093. | ThisExpression
  4094. | UpdateExpression
  4095. | YieldExpression;
  4096. declare interface ExpressionExpressionInfo {
  4097. type: "expression";
  4098. rootInfo: string | VariableInfo;
  4099. name: string;
  4100. getMembers: () => string[];
  4101. getMembersOptionals: () => boolean[];
  4102. getMemberRanges: () => [number, number][];
  4103. }
  4104. declare interface ExtensionAliasOption {
  4105. alias: string | string[];
  4106. extension: string;
  4107. }
  4108. declare interface ExtensionAliasOptions {
  4109. [index: string]: string | string[];
  4110. }
  4111. type ExternalItem =
  4112. | string
  4113. | RegExp
  4114. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4115. | ((
  4116. data: ExternalItemFunctionData,
  4117. callback: (
  4118. err?: null | Error,
  4119. result?: string | boolean | string[] | { [index: string]: any }
  4120. ) => void
  4121. ) => void)
  4122. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4123. /**
  4124. * Data object passed as argument when a function is set for 'externals'.
  4125. */
  4126. declare interface ExternalItemFunctionData {
  4127. /**
  4128. * The directory in which the request is placed.
  4129. */
  4130. context?: string;
  4131. /**
  4132. * Contextual information.
  4133. */
  4134. contextInfo?: ModuleFactoryCreateDataContextInfo;
  4135. /**
  4136. * The category of the referencing dependencies.
  4137. */
  4138. dependencyType?: string;
  4139. /**
  4140. * Get a resolve function with the current resolver options.
  4141. */
  4142. getResolve?: (
  4143. options?: ResolveOptions
  4144. ) =>
  4145. | ((
  4146. context: string,
  4147. request: string,
  4148. callback: (err?: Error, result?: string) => void
  4149. ) => void)
  4150. | ((context: string, request: string) => Promise<string>);
  4151. /**
  4152. * The request as written by the user in the require/import expression/statement.
  4153. */
  4154. request?: string;
  4155. }
  4156. /**
  4157. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4158. */
  4159. declare interface ExternalItemObjectKnown {
  4160. /**
  4161. * Specify externals depending on the layer.
  4162. */
  4163. byLayer?:
  4164. | { [index: string]: ExternalItem }
  4165. | ((layer: null | string) => ExternalItem);
  4166. }
  4167. /**
  4168. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4169. */
  4170. declare interface ExternalItemObjectUnknown {
  4171. [index: string]: ExternalItemValue;
  4172. }
  4173. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  4174. declare class ExternalModule extends Module {
  4175. constructor(
  4176. request: string | string[] | RequestRecord,
  4177. type: string,
  4178. userRequest: string,
  4179. dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta
  4180. );
  4181. request: string | string[] | Record<string, string | string[]>;
  4182. externalType: string;
  4183. userRequest: string;
  4184. dependencyMeta?: ImportDependencyMeta | CssImportDependencyMeta;
  4185. /**
  4186. * restore unsafe cache data
  4187. */
  4188. restoreFromUnsafeCache(
  4189. unsafeCacheData: object,
  4190. normalModuleFactory: NormalModuleFactory
  4191. ): void;
  4192. }
  4193. declare interface ExternalModuleInfo {
  4194. index: number;
  4195. module: Module;
  4196. }
  4197. type Externals =
  4198. | string
  4199. | RegExp
  4200. | ExternalItem[]
  4201. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4202. | ((
  4203. data: ExternalItemFunctionData,
  4204. callback: (
  4205. err?: null | Error,
  4206. result?: string | boolean | string[] | { [index: string]: any }
  4207. ) => void
  4208. ) => void)
  4209. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4210. declare class ExternalsPlugin {
  4211. constructor(type: undefined | string, externals: Externals);
  4212. type?: string;
  4213. externals: Externals;
  4214. /**
  4215. * Apply the plugin
  4216. */
  4217. apply(compiler: Compiler): void;
  4218. }
  4219. /**
  4220. * Enable presets of externals for specific targets.
  4221. */
  4222. declare interface ExternalsPresets {
  4223. /**
  4224. * 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.
  4225. */
  4226. electron?: boolean;
  4227. /**
  4228. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  4229. */
  4230. electronMain?: boolean;
  4231. /**
  4232. * 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.
  4233. */
  4234. electronPreload?: boolean;
  4235. /**
  4236. * 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.
  4237. */
  4238. electronRenderer?: boolean;
  4239. /**
  4240. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  4241. */
  4242. node?: boolean;
  4243. /**
  4244. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  4245. */
  4246. nwjs?: boolean;
  4247. /**
  4248. * 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).
  4249. */
  4250. web?: boolean;
  4251. /**
  4252. * 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).
  4253. */
  4254. webAsync?: boolean;
  4255. }
  4256. type ExternalsType =
  4257. | "import"
  4258. | "var"
  4259. | "module"
  4260. | "assign"
  4261. | "this"
  4262. | "window"
  4263. | "self"
  4264. | "global"
  4265. | "commonjs"
  4266. | "commonjs2"
  4267. | "commonjs-module"
  4268. | "commonjs-static"
  4269. | "amd"
  4270. | "amd-require"
  4271. | "umd"
  4272. | "umd2"
  4273. | "jsonp"
  4274. | "system"
  4275. | "promise"
  4276. | "script"
  4277. | "node-commonjs";
  4278. declare interface FSImplementation {
  4279. open?: (...args: any[]) => any;
  4280. close?: (...args: any[]) => any;
  4281. }
  4282. declare interface FactorizeModuleOptions {
  4283. currentProfile: ModuleProfile;
  4284. factory: ModuleFactory;
  4285. dependencies: Dependency[];
  4286. /**
  4287. * return full ModuleFactoryResult instead of only module
  4288. */
  4289. factoryResult?: boolean;
  4290. originModule: null | Module;
  4291. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4292. context?: string;
  4293. }
  4294. declare interface FactoryMeta {
  4295. sideEffectFree?: boolean;
  4296. }
  4297. type FakeHook<T> = T & FakeHookMarker;
  4298. declare interface FakeHookMarker {}
  4299. declare interface FallbackCacheGroup {
  4300. chunksFilter: (chunk: Chunk) => undefined | boolean;
  4301. minSize: SplitChunksSizes;
  4302. maxAsyncSize: SplitChunksSizes;
  4303. maxInitialSize: SplitChunksSizes;
  4304. automaticNameDelimiter: string;
  4305. }
  4306. declare class FetchCompileAsyncWasmPlugin {
  4307. constructor();
  4308. /**
  4309. * Apply the plugin
  4310. */
  4311. apply(compiler: Compiler): void;
  4312. }
  4313. declare class FetchCompileWasmPlugin {
  4314. constructor(options?: FetchCompileWasmPluginOptions);
  4315. options: FetchCompileWasmPluginOptions;
  4316. /**
  4317. * Apply the plugin
  4318. */
  4319. apply(compiler: Compiler): void;
  4320. }
  4321. declare interface FetchCompileWasmPluginOptions {
  4322. /**
  4323. * mangle imports
  4324. */
  4325. mangleImports?: boolean;
  4326. }
  4327. /**
  4328. * Options object for persistent file-based caching.
  4329. */
  4330. declare interface FileCacheOptions {
  4331. /**
  4332. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  4333. */
  4334. allowCollectingMemory?: boolean;
  4335. /**
  4336. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  4337. */
  4338. buildDependencies?: { [index: string]: string[] };
  4339. /**
  4340. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  4341. */
  4342. cacheDirectory?: string;
  4343. /**
  4344. * Locations for the cache (defaults to cacheDirectory / name).
  4345. */
  4346. cacheLocation?: string;
  4347. /**
  4348. * Compression type used for the cache files.
  4349. */
  4350. compression?: false | "gzip" | "brotli";
  4351. /**
  4352. * Algorithm used for generation the hash (see node.js crypto package).
  4353. */
  4354. hashAlgorithm?: string;
  4355. /**
  4356. * Time in ms after which idle period the cache storing should happen.
  4357. */
  4358. idleTimeout?: number;
  4359. /**
  4360. * 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).
  4361. */
  4362. idleTimeoutAfterLargeChanges?: number;
  4363. /**
  4364. * Time in ms after which idle period the initial cache storing should happen.
  4365. */
  4366. idleTimeoutForInitialStore?: number;
  4367. /**
  4368. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  4369. */
  4370. immutablePaths?: (string | RegExp)[];
  4371. /**
  4372. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  4373. */
  4374. managedPaths?: (string | RegExp)[];
  4375. /**
  4376. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  4377. */
  4378. maxAge?: number;
  4379. /**
  4380. * 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.
  4381. */
  4382. maxMemoryGenerations?: number;
  4383. /**
  4384. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  4385. */
  4386. memoryCacheUnaffected?: boolean;
  4387. /**
  4388. * Name for the cache. Different names will lead to different coexisting caches.
  4389. */
  4390. name?: string;
  4391. /**
  4392. * Track and log detailed timing information for individual cache items.
  4393. */
  4394. profile?: boolean;
  4395. /**
  4396. * Enable/disable readonly mode.
  4397. */
  4398. readonly?: boolean;
  4399. /**
  4400. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  4401. */
  4402. store?: "pack";
  4403. /**
  4404. * Filesystem caching.
  4405. */
  4406. type: "filesystem";
  4407. /**
  4408. * 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.
  4409. */
  4410. version?: string;
  4411. }
  4412. declare interface FileSystem {
  4413. readFile: ReadFileTypes;
  4414. readdir: ReaddirTypes;
  4415. readJson?: (
  4416. arg0: PathOrFileDescriptorTypes,
  4417. arg1: (
  4418. arg0: null | Error | NodeJS.ErrnoException,
  4419. arg1?: JsonObjectTypes
  4420. ) => void
  4421. ) => void;
  4422. readlink: ReadlinkTypes;
  4423. lstat?: LStatTypes;
  4424. stat: StatTypes;
  4425. realpath?: RealPathTypes;
  4426. }
  4427. declare abstract class FileSystemInfo {
  4428. fs: InputFileSystem;
  4429. logger?: WebpackLogger;
  4430. fileTimestampQueue: AsyncQueue<string, string, null | FileSystemInfoEntry>;
  4431. fileHashQueue: AsyncQueue<string, string, null | string>;
  4432. contextTimestampQueue: AsyncQueue<
  4433. string,
  4434. string,
  4435. null | ContextFileSystemInfoEntry
  4436. >;
  4437. contextHashQueue: AsyncQueue<string, string, null | ContextHash>;
  4438. contextTshQueue: AsyncQueue<string, string, null | ContextTimestampAndHash>;
  4439. managedItemQueue: AsyncQueue<string, string, null | string>;
  4440. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  4441. unmanagedPathsWithSlash: string[];
  4442. unmanagedPathsRegExps: RegExp[];
  4443. managedPaths: (string | RegExp)[];
  4444. managedPathsWithSlash: string[];
  4445. managedPathsRegExps: RegExp[];
  4446. immutablePaths: (string | RegExp)[];
  4447. immutablePathsWithSlash: string[];
  4448. immutablePathsRegExps: RegExp[];
  4449. logStatistics(): void;
  4450. clear(): void;
  4451. addFileTimestamps(
  4452. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4453. immutable?: boolean
  4454. ): void;
  4455. addContextTimestamps(
  4456. map: ReadonlyMap<string, null | FileSystemInfoEntry | "ignore">,
  4457. immutable?: boolean
  4458. ): void;
  4459. getFileTimestamp(
  4460. path: string,
  4461. callback: (
  4462. arg0?: null | WebpackError,
  4463. arg1?: null | FileSystemInfoEntry | "ignore"
  4464. ) => void
  4465. ): void;
  4466. getContextTimestamp(
  4467. path: string,
  4468. callback: (
  4469. arg0?: null | WebpackError,
  4470. arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
  4471. ) => void
  4472. ): void;
  4473. getFileHash(
  4474. path: string,
  4475. callback: (arg0?: null | WebpackError, arg1?: null | string) => void
  4476. ): void;
  4477. getContextHash(
  4478. path: string,
  4479. callback: (arg0?: null | WebpackError, arg1?: string) => void
  4480. ): void;
  4481. getContextTsh(
  4482. path: string,
  4483. callback: (
  4484. arg0?: null | WebpackError,
  4485. arg1?: ResolvedContextTimestampAndHash
  4486. ) => void
  4487. ): void;
  4488. resolveBuildDependencies(
  4489. context: string,
  4490. deps: Iterable<string>,
  4491. callback: (
  4492. arg0?: null | Error,
  4493. arg1?: ResolveBuildDependenciesResult
  4494. ) => void
  4495. ): void;
  4496. checkResolveResultsValid(
  4497. resolveResults: Map<string, string | false>,
  4498. callback: (arg0?: null | Error, arg1?: boolean) => void
  4499. ): void;
  4500. createSnapshot(
  4501. startTime: undefined | null | number,
  4502. files: null | Iterable<string>,
  4503. directories: null | Iterable<string>,
  4504. missing: null | Iterable<string>,
  4505. options: undefined | null | SnapshotOptionsFileSystemInfo,
  4506. callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
  4507. ): void;
  4508. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4509. checkSnapshotValid(
  4510. snapshot: Snapshot,
  4511. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  4512. ): void;
  4513. getDeprecatedFileTimestamps(): Map<any, any>;
  4514. getDeprecatedContextTimestamps(): Map<any, any>;
  4515. }
  4516. declare interface FileSystemInfoEntry {
  4517. safeTime: number;
  4518. timestamp?: number;
  4519. }
  4520. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4521. declare interface GenerateContext {
  4522. /**
  4523. * mapping from dependencies to templates
  4524. */
  4525. dependencyTemplates: DependencyTemplates;
  4526. /**
  4527. * the runtime template
  4528. */
  4529. runtimeTemplate: RuntimeTemplate;
  4530. /**
  4531. * the module graph
  4532. */
  4533. moduleGraph: ModuleGraph;
  4534. /**
  4535. * the chunk graph
  4536. */
  4537. chunkGraph: ChunkGraph;
  4538. /**
  4539. * the requirements for runtime
  4540. */
  4541. runtimeRequirements: Set<string>;
  4542. /**
  4543. * the runtime
  4544. */
  4545. runtime: RuntimeSpec;
  4546. /**
  4547. * when in concatenated module, information about other concatenated modules
  4548. */
  4549. concatenationScope?: ConcatenationScope;
  4550. /**
  4551. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4552. */
  4553. codeGenerationResults?: CodeGenerationResults;
  4554. /**
  4555. * which kind of code should be generated
  4556. */
  4557. type: string;
  4558. /**
  4559. * get access to the code generation data
  4560. */
  4561. getData?: () => Map<string, any>;
  4562. }
  4563. declare class Generator {
  4564. constructor();
  4565. getTypes(module: NormalModule): Set<string>;
  4566. getSize(module: NormalModule, type?: string): number;
  4567. generate(module: NormalModule, __1: GenerateContext): Source;
  4568. getConcatenationBailoutReason(
  4569. module: NormalModule,
  4570. context: ConcatenationBailoutReasonContext
  4571. ): undefined | string;
  4572. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4573. static byType(map: Record<string, Generator>): ByTypeGenerator;
  4574. }
  4575. declare interface GeneratorOptions {
  4576. [index: string]: any;
  4577. }
  4578. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4579. GeneratorOptionsByModuleTypeUnknown;
  4580. /**
  4581. * Specify options for each generator.
  4582. */
  4583. declare interface GeneratorOptionsByModuleTypeKnown {
  4584. /**
  4585. * Generator options for asset modules.
  4586. */
  4587. asset?: AssetGeneratorOptions;
  4588. /**
  4589. * Generator options for asset/inline modules.
  4590. */
  4591. "asset/inline"?: AssetInlineGeneratorOptions;
  4592. /**
  4593. * Generator options for asset/resource modules.
  4594. */
  4595. "asset/resource"?: AssetResourceGeneratorOptions;
  4596. /**
  4597. * Generator options for css modules.
  4598. */
  4599. css?: CssGeneratorOptions;
  4600. /**
  4601. * Generator options for css/auto modules.
  4602. */
  4603. "css/auto"?: CssAutoGeneratorOptions;
  4604. /**
  4605. * Generator options for css/global modules.
  4606. */
  4607. "css/global"?: CssGlobalGeneratorOptions;
  4608. /**
  4609. * Generator options for css/module modules.
  4610. */
  4611. "css/module"?: CssModuleGeneratorOptions;
  4612. /**
  4613. * No generator options are supported for this module type.
  4614. */
  4615. javascript?: EmptyGeneratorOptions;
  4616. /**
  4617. * No generator options are supported for this module type.
  4618. */
  4619. "javascript/auto"?: EmptyGeneratorOptions;
  4620. /**
  4621. * No generator options are supported for this module type.
  4622. */
  4623. "javascript/dynamic"?: EmptyGeneratorOptions;
  4624. /**
  4625. * No generator options are supported for this module type.
  4626. */
  4627. "javascript/esm"?: EmptyGeneratorOptions;
  4628. }
  4629. /**
  4630. * Specify options for each generator.
  4631. */
  4632. declare interface GeneratorOptionsByModuleTypeUnknown {
  4633. [index: string]: { [index: string]: any };
  4634. }
  4635. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4636. constructor(
  4637. contentType: string,
  4638. name: string,
  4639. global: string,
  4640. getFilenameForChunk: (
  4641. arg0: Chunk
  4642. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string),
  4643. allChunks: boolean
  4644. );
  4645. contentType: string;
  4646. global: string;
  4647. getFilenameForChunk: (
  4648. arg0: Chunk
  4649. ) => string | ((arg0: PathData, arg1?: AssetInfo) => string);
  4650. allChunks: boolean;
  4651. /**
  4652. * Runtime modules without any dependencies to other runtime modules
  4653. */
  4654. static STAGE_NORMAL: number;
  4655. /**
  4656. * Runtime modules with simple dependencies on other runtime modules
  4657. */
  4658. static STAGE_BASIC: number;
  4659. /**
  4660. * Runtime modules which attach to handlers of other runtime modules
  4661. */
  4662. static STAGE_ATTACH: number;
  4663. /**
  4664. * Runtime modules which trigger actions on bootstrap
  4665. */
  4666. static STAGE_TRIGGER: number;
  4667. }
  4668. declare interface GroupConfig {
  4669. getKeys: (arg0?: any) => string[];
  4670. createGroup: (arg0: string, arg1: any[], arg2: any[]) => object;
  4671. getOptions?: (arg0: string, arg1: any[]) => GroupOptions;
  4672. }
  4673. declare interface GroupOptions {
  4674. groupChildren?: boolean;
  4675. force?: boolean;
  4676. targetGroupCount?: number;
  4677. }
  4678. declare interface HMRJavascriptParserHooks {
  4679. hotAcceptCallback: SyncBailHook<[any, string[]], void>;
  4680. hotAcceptWithoutCallback: SyncBailHook<[any, string[]], void>;
  4681. }
  4682. declare interface HandleModuleCreationOptions {
  4683. factory: ModuleFactory;
  4684. dependencies: Dependency[];
  4685. originModule: null | Module;
  4686. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4687. context?: string;
  4688. /**
  4689. * recurse into dependencies of the created module
  4690. */
  4691. recursive?: boolean;
  4692. /**
  4693. * connect the resolved module with the origin module
  4694. */
  4695. connectOrigin?: boolean;
  4696. /**
  4697. * check the cycle dependencies of the created module
  4698. */
  4699. checkCycle?: boolean;
  4700. }
  4701. declare class HarmonyImportDependency extends ModuleDependency {
  4702. constructor(
  4703. request: string,
  4704. sourceOrder: number,
  4705. attributes?: ImportAttributes
  4706. );
  4707. sourceOrder: number;
  4708. getImportVar(moduleGraph: ModuleGraph): string;
  4709. getImportStatement(
  4710. update: boolean,
  4711. __1: DependencyTemplateContext
  4712. ): [string, string];
  4713. getLinkingErrors(
  4714. moduleGraph: ModuleGraph,
  4715. ids: string[],
  4716. additionalMessage: string
  4717. ): undefined | WebpackError[];
  4718. static Template: typeof HarmonyImportDependencyTemplate;
  4719. static ExportPresenceModes: {
  4720. NONE: 0;
  4721. WARN: 1;
  4722. AUTO: 2;
  4723. ERROR: 3;
  4724. fromUserOption(str: string | false): 0 | 1 | 2 | 3;
  4725. };
  4726. static NO_EXPORTS_REFERENCED: string[][];
  4727. static EXPORTS_OBJECT_REFERENCED: string[][];
  4728. static TRANSITIVE: typeof TRANSITIVE;
  4729. }
  4730. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  4731. constructor();
  4732. static getImportEmittedRuntime(
  4733. module: Module,
  4734. referencedModule: Module
  4735. ): undefined | string | boolean | SortableSet<string>;
  4736. }
  4737. declare class Hash {
  4738. constructor();
  4739. /**
  4740. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  4741. */
  4742. update(data: string | Buffer, inputEncoding?: string): Hash;
  4743. /**
  4744. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  4745. */
  4746. digest(encoding?: string): string | Buffer;
  4747. }
  4748. declare interface HashableObject {
  4749. updateHash: (arg0: Hash) => void;
  4750. }
  4751. declare class HashedModuleIdsPlugin {
  4752. constructor(options?: HashedModuleIdsPluginOptions);
  4753. options: HashedModuleIdsPluginOptions;
  4754. /**
  4755. * Apply the plugin
  4756. */
  4757. apply(compiler: Compiler): void;
  4758. }
  4759. declare interface HashedModuleIdsPluginOptions {
  4760. /**
  4761. * The context directory for creating names.
  4762. */
  4763. context?: string;
  4764. /**
  4765. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  4766. */
  4767. hashDigest?: "latin1" | "base64" | "hex";
  4768. /**
  4769. * The prefix length of the hash digest to use, defaults to 4.
  4770. */
  4771. hashDigestLength?: number;
  4772. /**
  4773. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  4774. */
  4775. hashFunction?: string | typeof Hash;
  4776. }
  4777. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  4778. declare class HotModuleReplacementPlugin {
  4779. constructor(options?: object);
  4780. options: object;
  4781. /**
  4782. * Apply the plugin
  4783. */
  4784. apply(compiler: Compiler): void;
  4785. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  4786. }
  4787. /**
  4788. * These properties are added by the HotModuleReplacementPlugin
  4789. */
  4790. declare interface HotModuleReplacementPluginLoaderContext {
  4791. hot?: boolean;
  4792. }
  4793. declare class HotUpdateChunk extends Chunk {
  4794. constructor();
  4795. }
  4796. /**
  4797. * Options for building http resources.
  4798. */
  4799. declare interface HttpUriOptions {
  4800. /**
  4801. * List of allowed URIs (resp. the beginning of them).
  4802. */
  4803. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  4804. /**
  4805. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  4806. */
  4807. cacheLocation?: string | false;
  4808. /**
  4809. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  4810. */
  4811. frozen?: boolean;
  4812. /**
  4813. * Location of the lockfile.
  4814. */
  4815. lockfileLocation?: string;
  4816. /**
  4817. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  4818. */
  4819. proxy?: string;
  4820. /**
  4821. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  4822. */
  4823. upgrade?: boolean;
  4824. }
  4825. declare class HttpUriPlugin {
  4826. constructor(options: HttpUriOptions);
  4827. /**
  4828. * Apply the plugin
  4829. */
  4830. apply(compiler: Compiler): void;
  4831. }
  4832. type IBigIntStats = IStatsBase<bigint> & {
  4833. atimeNs: bigint;
  4834. mtimeNs: bigint;
  4835. ctimeNs: bigint;
  4836. birthtimeNs: bigint;
  4837. };
  4838. declare interface IStats {
  4839. isFile: () => boolean;
  4840. isDirectory: () => boolean;
  4841. isBlockDevice: () => boolean;
  4842. isCharacterDevice: () => boolean;
  4843. isSymbolicLink: () => boolean;
  4844. isFIFO: () => boolean;
  4845. isSocket: () => boolean;
  4846. dev: number;
  4847. ino: number;
  4848. mode: number;
  4849. nlink: number;
  4850. uid: number;
  4851. gid: number;
  4852. rdev: number;
  4853. size: number;
  4854. blksize: number;
  4855. blocks: number;
  4856. atimeMs: number;
  4857. mtimeMs: number;
  4858. ctimeMs: number;
  4859. birthtimeMs: number;
  4860. atime: Date;
  4861. mtime: Date;
  4862. ctime: Date;
  4863. birthtime: Date;
  4864. }
  4865. declare interface IStatsBase<T> {
  4866. isFile: () => boolean;
  4867. isDirectory: () => boolean;
  4868. isBlockDevice: () => boolean;
  4869. isCharacterDevice: () => boolean;
  4870. isSymbolicLink: () => boolean;
  4871. isFIFO: () => boolean;
  4872. isSocket: () => boolean;
  4873. dev: T;
  4874. ino: T;
  4875. mode: T;
  4876. nlink: T;
  4877. uid: T;
  4878. gid: T;
  4879. rdev: T;
  4880. size: T;
  4881. blksize: T;
  4882. blocks: T;
  4883. atimeMs: T;
  4884. mtimeMs: T;
  4885. ctimeMs: T;
  4886. birthtimeMs: T;
  4887. atime: Date;
  4888. mtime: Date;
  4889. ctime: Date;
  4890. birthtime: Date;
  4891. }
  4892. declare class IgnorePlugin {
  4893. constructor(options: IgnorePluginOptions);
  4894. options: IgnorePluginOptions;
  4895. /**
  4896. * Note that if "contextRegExp" is given, both the "resourceRegExp"
  4897. * and "contextRegExp" have to match.
  4898. */
  4899. checkIgnore(resolveData: ResolveData): undefined | false;
  4900. /**
  4901. * Apply the plugin
  4902. */
  4903. apply(compiler: Compiler): void;
  4904. }
  4905. type IgnorePluginOptions =
  4906. | {
  4907. /**
  4908. * A RegExp to test the context (directory) against.
  4909. */
  4910. contextRegExp?: RegExp;
  4911. /**
  4912. * A RegExp to test the request against.
  4913. */
  4914. resourceRegExp: RegExp;
  4915. }
  4916. | {
  4917. /**
  4918. * A filter function for resource and context.
  4919. */
  4920. checkResource: (resource: string, context: string) => boolean;
  4921. };
  4922. type ImportAttributes = Record<string, string> & {};
  4923. declare interface ImportDependencyMeta {
  4924. attributes?: ImportAttributes;
  4925. }
  4926. declare interface ImportModuleOptions {
  4927. /**
  4928. * the target layer
  4929. */
  4930. layer?: string;
  4931. /**
  4932. * the target public path
  4933. */
  4934. publicPath?: string;
  4935. /**
  4936. * target base uri
  4937. */
  4938. baseUri?: string;
  4939. }
  4940. type ImportSource =
  4941. | undefined
  4942. | null
  4943. | string
  4944. | SimpleLiteral
  4945. | RegExpLiteral
  4946. | BigIntLiteral;
  4947. /**
  4948. * Options for infrastructure level logging.
  4949. */
  4950. declare interface InfrastructureLogging {
  4951. /**
  4952. * 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.
  4953. */
  4954. appendOnly?: boolean;
  4955. /**
  4956. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  4957. */
  4958. colors?: boolean;
  4959. /**
  4960. * Custom console used for logging.
  4961. */
  4962. console?: Console;
  4963. /**
  4964. * Enable debug logging for specific loggers.
  4965. */
  4966. debug?:
  4967. | string
  4968. | boolean
  4969. | RegExp
  4970. | FilterItemTypes[]
  4971. | ((value: string) => boolean);
  4972. /**
  4973. * Log level.
  4974. */
  4975. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  4976. /**
  4977. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  4978. */
  4979. stream?: NodeJS.WritableStream;
  4980. }
  4981. declare class InitFragment<GenerateContext> {
  4982. constructor(
  4983. content: undefined | string | Source,
  4984. stage: number,
  4985. position: number,
  4986. key?: string,
  4987. endContent?: string | Source
  4988. );
  4989. content?: string | Source;
  4990. stage: number;
  4991. position: number;
  4992. key?: string;
  4993. endContent?: string | Source;
  4994. getContent(context: GenerateContext): undefined | string | Source;
  4995. getEndContent(context: GenerateContext): undefined | string | Source;
  4996. serialize(context: ObjectSerializerContext): void;
  4997. deserialize(context: ObjectDeserializerContext): void;
  4998. merge: any;
  4999. static addToSource<Context, T>(
  5000. source: Source,
  5001. initFragments: InitFragment<T>[],
  5002. context: Context
  5003. ): Source;
  5004. static STAGE_CONSTANTS: number;
  5005. static STAGE_ASYNC_BOUNDARY: number;
  5006. static STAGE_HARMONY_EXPORTS: number;
  5007. static STAGE_HARMONY_IMPORTS: number;
  5008. static STAGE_PROVIDES: number;
  5009. static STAGE_ASYNC_DEPENDENCIES: number;
  5010. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  5011. }
  5012. declare interface InputFileSystem {
  5013. readFile: ReadFileFs;
  5014. readFileSync?: ReadFileSync;
  5015. readlink: ReadlinkFs;
  5016. readlinkSync?: ReadlinkSync;
  5017. readdir: ReaddirFs;
  5018. readdirSync?: ReaddirSync;
  5019. stat: StatFs;
  5020. statSync?: StatSync;
  5021. lstat?: LStatFs;
  5022. lstatSync?: LStatSync;
  5023. realpath?: RealPathFs;
  5024. realpathSync?: RealPathSync;
  5025. readJson?: (
  5026. arg0: PathOrFileDescriptorFs,
  5027. arg1: (
  5028. arg0: null | Error | NodeJS.ErrnoException,
  5029. arg1?: JsonObjectFs
  5030. ) => void
  5031. ) => void;
  5032. readJsonSync?: (arg0: PathOrFileDescriptorFs) => JsonObjectFs;
  5033. purge?: (arg0?: string | string[] | Set<string>) => void;
  5034. join?: (arg0: string, arg1: string) => string;
  5035. relative?: (arg0: string, arg1: string) => string;
  5036. dirname?: (arg0: string) => string;
  5037. }
  5038. type IntermediateFileSystem = InputFileSystem &
  5039. OutputFileSystem &
  5040. IntermediateFileSystemExtras;
  5041. declare interface IntermediateFileSystemExtras {
  5042. mkdirSync: MkdirSync;
  5043. createWriteStream: (
  5044. arg0: PathLikeFs,
  5045. arg1?:
  5046. | "ascii"
  5047. | "utf8"
  5048. | "utf-8"
  5049. | "utf16le"
  5050. | "utf-16le"
  5051. | "ucs2"
  5052. | "ucs-2"
  5053. | "latin1"
  5054. | "binary"
  5055. | "base64"
  5056. | "base64url"
  5057. | "hex"
  5058. | WriteStreamOptions
  5059. ) => NodeJS.WritableStream;
  5060. open: Open;
  5061. read: Read<Buffer>;
  5062. close: (
  5063. arg0: number,
  5064. arg1: (arg0: null | NodeJS.ErrnoException) => void
  5065. ) => void;
  5066. rename: (
  5067. arg0: PathLikeFs,
  5068. arg1: PathLikeFs,
  5069. arg2: (arg0: null | NodeJS.ErrnoException) => void
  5070. ) => void;
  5071. }
  5072. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  5073. declare abstract class ItemCacheFacade {
  5074. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  5075. getPromise<T>(): Promise<T>;
  5076. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  5077. storePromise<T>(data: T): Promise<void>;
  5078. provide<T>(
  5079. computer: (arg0: CallbackNormalErrorCache<T>) => void,
  5080. callback: CallbackNormalErrorCache<T>
  5081. ): void;
  5082. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  5083. }
  5084. declare class JavascriptModulesPlugin {
  5085. constructor(options?: object);
  5086. options: object;
  5087. /**
  5088. * Apply the plugin
  5089. */
  5090. apply(compiler: Compiler): void;
  5091. renderModule(
  5092. module: Module,
  5093. renderContext: ChunkRenderContext,
  5094. hooks: CompilationHooksJavascriptModulesPlugin,
  5095. factory: boolean
  5096. ): Source;
  5097. renderChunk(
  5098. renderContext: RenderContext,
  5099. hooks: CompilationHooksJavascriptModulesPlugin
  5100. ): Source;
  5101. renderMain(
  5102. renderContext: MainRenderContext,
  5103. hooks: CompilationHooksJavascriptModulesPlugin,
  5104. compilation: Compilation
  5105. ): Source;
  5106. updateHashWithBootstrap(
  5107. hash: Hash,
  5108. renderContext: RenderBootstrapContext,
  5109. hooks: CompilationHooksJavascriptModulesPlugin
  5110. ): void;
  5111. renderBootstrap(
  5112. renderContext: RenderBootstrapContext,
  5113. hooks: CompilationHooksJavascriptModulesPlugin
  5114. ): {
  5115. header: string[];
  5116. beforeStartup: string[];
  5117. startup: string[];
  5118. afterStartup: string[];
  5119. allowInlineStartup: boolean;
  5120. };
  5121. renderRequire(
  5122. renderContext: RenderBootstrapContext,
  5123. hooks: CompilationHooksJavascriptModulesPlugin
  5124. ): string;
  5125. renameInlineModule(
  5126. allModules: Module[],
  5127. renderContext: MainRenderContext,
  5128. inlinedModules: Set<Module>,
  5129. chunkRenderContext: ChunkRenderContext,
  5130. hooks: CompilationHooksJavascriptModulesPlugin
  5131. ): Map<Module, Source>;
  5132. findNewName(
  5133. oldName: string,
  5134. usedName: Set<string>,
  5135. extraInfo: string
  5136. ): string;
  5137. static getCompilationHooks(
  5138. compilation: Compilation
  5139. ): CompilationHooksJavascriptModulesPlugin;
  5140. static getChunkFilenameTemplate(chunk?: any, outputOptions?: any): any;
  5141. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  5142. }
  5143. declare class JavascriptParser extends Parser {
  5144. constructor(sourceType?: "module" | "auto" | "script");
  5145. hooks: Readonly<{
  5146. evaluateTypeof: HookMap<
  5147. SyncBailHook<
  5148. [UnaryExpression],
  5149. undefined | null | BasicEvaluatedExpression
  5150. >
  5151. >;
  5152. evaluate: HookMap<
  5153. SyncBailHook<[Expression], undefined | null | BasicEvaluatedExpression>
  5154. >;
  5155. evaluateIdentifier: HookMap<
  5156. SyncBailHook<
  5157. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  5158. undefined | null | BasicEvaluatedExpression
  5159. >
  5160. >;
  5161. evaluateDefinedIdentifier: HookMap<
  5162. SyncBailHook<
  5163. [Identifier | MemberExpression | ThisExpression],
  5164. undefined | null | BasicEvaluatedExpression
  5165. >
  5166. >;
  5167. evaluateNewExpression: HookMap<
  5168. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  5169. >;
  5170. evaluateCallExpression: HookMap<
  5171. SyncBailHook<
  5172. [CallExpression],
  5173. undefined | null | BasicEvaluatedExpression
  5174. >
  5175. >;
  5176. evaluateCallExpressionMember: HookMap<
  5177. SyncBailHook<
  5178. [CallExpression, BasicEvaluatedExpression],
  5179. undefined | null | BasicEvaluatedExpression
  5180. >
  5181. >;
  5182. isPure: HookMap<
  5183. SyncBailHook<
  5184. [
  5185. (
  5186. | UnaryExpression
  5187. | ArrayExpression
  5188. | ArrowFunctionExpression
  5189. | AssignmentExpression
  5190. | AwaitExpression
  5191. | BinaryExpression
  5192. | SimpleCallExpression
  5193. | NewExpression
  5194. | ChainExpression
  5195. | ClassExpression
  5196. | ConditionalExpression
  5197. | FunctionExpression
  5198. | Identifier
  5199. | ImportExpression
  5200. | SimpleLiteral
  5201. | RegExpLiteral
  5202. | BigIntLiteral
  5203. | LogicalExpression
  5204. | MemberExpression
  5205. | MetaProperty
  5206. | ObjectExpression
  5207. | SequenceExpression
  5208. | TaggedTemplateExpression
  5209. | TemplateLiteral
  5210. | ThisExpression
  5211. | UpdateExpression
  5212. | YieldExpression
  5213. | FunctionDeclaration
  5214. | VariableDeclaration
  5215. | ClassDeclaration
  5216. | PrivateIdentifier
  5217. ),
  5218. number
  5219. ],
  5220. boolean | void
  5221. >
  5222. >;
  5223. preStatement: SyncBailHook<
  5224. [
  5225. | FunctionDeclaration
  5226. | VariableDeclaration
  5227. | ClassDeclaration
  5228. | ExpressionStatement
  5229. | BlockStatement
  5230. | StaticBlock
  5231. | EmptyStatement
  5232. | DebuggerStatement
  5233. | WithStatement
  5234. | ReturnStatement
  5235. | LabeledStatement
  5236. | BreakStatement
  5237. | ContinueStatement
  5238. | IfStatement
  5239. | SwitchStatement
  5240. | ThrowStatement
  5241. | TryStatement
  5242. | WhileStatement
  5243. | DoWhileStatement
  5244. | ForStatement
  5245. | ForInStatement
  5246. | ForOfStatement
  5247. | ImportDeclaration
  5248. | ExportNamedDeclaration
  5249. | ExportDefaultDeclaration
  5250. | ExportAllDeclaration
  5251. ],
  5252. boolean | void
  5253. >;
  5254. blockPreStatement: SyncBailHook<
  5255. [
  5256. | FunctionDeclaration
  5257. | VariableDeclaration
  5258. | ClassDeclaration
  5259. | ExpressionStatement
  5260. | BlockStatement
  5261. | StaticBlock
  5262. | EmptyStatement
  5263. | DebuggerStatement
  5264. | WithStatement
  5265. | ReturnStatement
  5266. | LabeledStatement
  5267. | BreakStatement
  5268. | ContinueStatement
  5269. | IfStatement
  5270. | SwitchStatement
  5271. | ThrowStatement
  5272. | TryStatement
  5273. | WhileStatement
  5274. | DoWhileStatement
  5275. | ForStatement
  5276. | ForInStatement
  5277. | ForOfStatement
  5278. | ImportDeclaration
  5279. | ExportNamedDeclaration
  5280. | ExportDefaultDeclaration
  5281. | ExportAllDeclaration
  5282. ],
  5283. boolean | void
  5284. >;
  5285. statement: SyncBailHook<
  5286. [
  5287. | FunctionDeclaration
  5288. | VariableDeclaration
  5289. | ClassDeclaration
  5290. | ExpressionStatement
  5291. | BlockStatement
  5292. | StaticBlock
  5293. | EmptyStatement
  5294. | DebuggerStatement
  5295. | WithStatement
  5296. | ReturnStatement
  5297. | LabeledStatement
  5298. | BreakStatement
  5299. | ContinueStatement
  5300. | IfStatement
  5301. | SwitchStatement
  5302. | ThrowStatement
  5303. | TryStatement
  5304. | WhileStatement
  5305. | DoWhileStatement
  5306. | ForStatement
  5307. | ForInStatement
  5308. | ForOfStatement
  5309. | ImportDeclaration
  5310. | ExportNamedDeclaration
  5311. | ExportDefaultDeclaration
  5312. | ExportAllDeclaration
  5313. ],
  5314. boolean | void
  5315. >;
  5316. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  5317. classExtendsExpression: SyncBailHook<
  5318. [Expression, ClassExpression | ClassDeclaration],
  5319. boolean | void
  5320. >;
  5321. classBodyElement: SyncBailHook<
  5322. [
  5323. StaticBlock | MethodDefinition | PropertyDefinition,
  5324. ClassExpression | ClassDeclaration
  5325. ],
  5326. boolean | void
  5327. >;
  5328. classBodyValue: SyncBailHook<
  5329. [
  5330. Expression,
  5331. MethodDefinition | PropertyDefinition,
  5332. ClassExpression | ClassDeclaration
  5333. ],
  5334. boolean | void
  5335. >;
  5336. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  5337. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  5338. importSpecifier: SyncBailHook<
  5339. [ImportDeclaration, ImportSource, string, string],
  5340. boolean | void
  5341. >;
  5342. export: SyncBailHook<
  5343. [ExportNamedDeclaration | ExportDefaultDeclaration],
  5344. boolean | void
  5345. >;
  5346. exportImport: SyncBailHook<
  5347. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  5348. boolean | void
  5349. >;
  5350. exportDeclaration: SyncBailHook<
  5351. [
  5352. (
  5353. | ExportNamedDeclaration
  5354. | ExportDefaultDeclaration
  5355. | ExportAllDeclaration
  5356. ),
  5357. Declaration
  5358. ],
  5359. boolean | void
  5360. >;
  5361. exportExpression: SyncBailHook<
  5362. [ExportDefaultDeclaration, FunctionDeclaration | ClassDeclaration],
  5363. boolean | void
  5364. >;
  5365. exportSpecifier: SyncBailHook<
  5366. [
  5367. (
  5368. | ExportNamedDeclaration
  5369. | ExportDefaultDeclaration
  5370. | ExportAllDeclaration
  5371. ),
  5372. string,
  5373. string,
  5374. undefined | number
  5375. ],
  5376. boolean | void
  5377. >;
  5378. exportImportSpecifier: SyncBailHook<
  5379. [
  5380. ExportNamedDeclaration | ExportAllDeclaration,
  5381. ImportSource,
  5382. string,
  5383. string,
  5384. undefined | number
  5385. ],
  5386. boolean | void
  5387. >;
  5388. preDeclarator: SyncBailHook<
  5389. [VariableDeclarator, Statement],
  5390. boolean | void
  5391. >;
  5392. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  5393. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5394. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5395. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5396. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5397. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  5398. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5399. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5400. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  5401. assignMemberChain: HookMap<
  5402. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  5403. >;
  5404. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5405. importCall: SyncBailHook<[ImportExpression], boolean | void>;
  5406. topLevelAwait: SyncBailHook<
  5407. [
  5408. | UnaryExpression
  5409. | ArrayExpression
  5410. | ArrowFunctionExpression
  5411. | AssignmentExpression
  5412. | AwaitExpression
  5413. | BinaryExpression
  5414. | SimpleCallExpression
  5415. | NewExpression
  5416. | ChainExpression
  5417. | ClassExpression
  5418. | ConditionalExpression
  5419. | FunctionExpression
  5420. | Identifier
  5421. | ImportExpression
  5422. | SimpleLiteral
  5423. | RegExpLiteral
  5424. | BigIntLiteral
  5425. | LogicalExpression
  5426. | MemberExpression
  5427. | MetaProperty
  5428. | ObjectExpression
  5429. | SequenceExpression
  5430. | TaggedTemplateExpression
  5431. | TemplateLiteral
  5432. | ThisExpression
  5433. | UpdateExpression
  5434. | YieldExpression
  5435. | ForOfStatement
  5436. ],
  5437. boolean | void
  5438. >;
  5439. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  5440. callMemberChain: HookMap<
  5441. SyncBailHook<
  5442. [CallExpression, string[], boolean[], [number, number][]],
  5443. boolean | void
  5444. >
  5445. >;
  5446. memberChainOfCallMemberChain: HookMap<
  5447. SyncBailHook<
  5448. [Expression, string[], CallExpression, string[], [number, number][]],
  5449. boolean | void
  5450. >
  5451. >;
  5452. callMemberChainOfCallMemberChain: HookMap<
  5453. SyncBailHook<
  5454. [
  5455. CallExpression,
  5456. string[],
  5457. CallExpression,
  5458. string[],
  5459. [number, number][]
  5460. ],
  5461. boolean | void
  5462. >
  5463. >;
  5464. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  5465. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  5466. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  5467. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5468. expressionMemberChain: HookMap<
  5469. SyncBailHook<
  5470. [MemberExpression, string[], boolean[], [number, number][]],
  5471. boolean | void
  5472. >
  5473. >;
  5474. unhandledExpressionMemberChain: HookMap<
  5475. SyncBailHook<[MemberExpression, string[]], boolean | void>
  5476. >;
  5477. expressionConditionalOperator: SyncBailHook<
  5478. [ConditionalExpression],
  5479. boolean | void
  5480. >;
  5481. expressionLogicalOperator: SyncBailHook<
  5482. [LogicalExpression],
  5483. boolean | void
  5484. >;
  5485. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  5486. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  5487. }>;
  5488. sourceType: "module" | "auto" | "script";
  5489. scope: ScopeInfo;
  5490. state: ParserState;
  5491. comments?: Comment[];
  5492. semicolons?: Set<number>;
  5493. statementPath: StatementPathItem[];
  5494. prevStatement?:
  5495. | UnaryExpression
  5496. | ArrayExpression
  5497. | ArrowFunctionExpression
  5498. | AssignmentExpression
  5499. | AwaitExpression
  5500. | BinaryExpression
  5501. | SimpleCallExpression
  5502. | NewExpression
  5503. | ChainExpression
  5504. | ClassExpression
  5505. | ConditionalExpression
  5506. | FunctionExpression
  5507. | Identifier
  5508. | ImportExpression
  5509. | SimpleLiteral
  5510. | RegExpLiteral
  5511. | BigIntLiteral
  5512. | LogicalExpression
  5513. | MemberExpression
  5514. | MetaProperty
  5515. | ObjectExpression
  5516. | SequenceExpression
  5517. | TaggedTemplateExpression
  5518. | TemplateLiteral
  5519. | ThisExpression
  5520. | UpdateExpression
  5521. | YieldExpression
  5522. | FunctionDeclaration
  5523. | VariableDeclaration
  5524. | ClassDeclaration
  5525. | ExpressionStatement
  5526. | BlockStatement
  5527. | StaticBlock
  5528. | EmptyStatement
  5529. | DebuggerStatement
  5530. | WithStatement
  5531. | ReturnStatement
  5532. | LabeledStatement
  5533. | BreakStatement
  5534. | ContinueStatement
  5535. | IfStatement
  5536. | SwitchStatement
  5537. | ThrowStatement
  5538. | TryStatement
  5539. | WhileStatement
  5540. | DoWhileStatement
  5541. | ForStatement
  5542. | ForInStatement
  5543. | ForOfStatement
  5544. | ImportDeclaration
  5545. | ExportNamedDeclaration
  5546. | ExportDefaultDeclaration
  5547. | ExportAllDeclaration;
  5548. destructuringAssignmentProperties?: WeakMap<
  5549. Expression,
  5550. Set<DestructuringAssignmentProperty>
  5551. >;
  5552. currentTagData: any;
  5553. magicCommentContext: Context;
  5554. destructuringAssignmentPropertiesFor(
  5555. node: Expression
  5556. ): undefined | Set<DestructuringAssignmentProperty>;
  5557. getRenameIdentifier(
  5558. expr: Expression
  5559. ): undefined | string | VariableInfoInterface;
  5560. walkClass(classy: ClassExpression | ClassDeclaration): void;
  5561. /**
  5562. * Pre walking iterates the scope for variable declarations
  5563. */
  5564. preWalkStatements(
  5565. statements: (
  5566. | FunctionDeclaration
  5567. | VariableDeclaration
  5568. | ClassDeclaration
  5569. | ExpressionStatement
  5570. | BlockStatement
  5571. | StaticBlock
  5572. | EmptyStatement
  5573. | DebuggerStatement
  5574. | WithStatement
  5575. | ReturnStatement
  5576. | LabeledStatement
  5577. | BreakStatement
  5578. | ContinueStatement
  5579. | IfStatement
  5580. | SwitchStatement
  5581. | ThrowStatement
  5582. | TryStatement
  5583. | WhileStatement
  5584. | DoWhileStatement
  5585. | ForStatement
  5586. | ForInStatement
  5587. | ForOfStatement
  5588. | ImportDeclaration
  5589. | ExportNamedDeclaration
  5590. | ExportDefaultDeclaration
  5591. | ExportAllDeclaration
  5592. )[]
  5593. ): void;
  5594. /**
  5595. * Block pre walking iterates the scope for block variable declarations
  5596. */
  5597. blockPreWalkStatements(
  5598. statements: (
  5599. | FunctionDeclaration
  5600. | VariableDeclaration
  5601. | ClassDeclaration
  5602. | ExpressionStatement
  5603. | BlockStatement
  5604. | StaticBlock
  5605. | EmptyStatement
  5606. | DebuggerStatement
  5607. | WithStatement
  5608. | ReturnStatement
  5609. | LabeledStatement
  5610. | BreakStatement
  5611. | ContinueStatement
  5612. | IfStatement
  5613. | SwitchStatement
  5614. | ThrowStatement
  5615. | TryStatement
  5616. | WhileStatement
  5617. | DoWhileStatement
  5618. | ForStatement
  5619. | ForInStatement
  5620. | ForOfStatement
  5621. | ImportDeclaration
  5622. | ExportNamedDeclaration
  5623. | ExportDefaultDeclaration
  5624. | ExportAllDeclaration
  5625. )[]
  5626. ): void;
  5627. /**
  5628. * Walking iterates the statements and expressions and processes them
  5629. */
  5630. walkStatements(
  5631. statements: (
  5632. | FunctionDeclaration
  5633. | VariableDeclaration
  5634. | ClassDeclaration
  5635. | ExpressionStatement
  5636. | BlockStatement
  5637. | StaticBlock
  5638. | EmptyStatement
  5639. | DebuggerStatement
  5640. | WithStatement
  5641. | ReturnStatement
  5642. | LabeledStatement
  5643. | BreakStatement
  5644. | ContinueStatement
  5645. | IfStatement
  5646. | SwitchStatement
  5647. | ThrowStatement
  5648. | TryStatement
  5649. | WhileStatement
  5650. | DoWhileStatement
  5651. | ForStatement
  5652. | ForInStatement
  5653. | ForOfStatement
  5654. | ImportDeclaration
  5655. | ExportNamedDeclaration
  5656. | ExportDefaultDeclaration
  5657. | ExportAllDeclaration
  5658. )[]
  5659. ): void;
  5660. /**
  5661. * Walking iterates the statements and expressions and processes them
  5662. */
  5663. preWalkStatement(
  5664. statement:
  5665. | FunctionDeclaration
  5666. | VariableDeclaration
  5667. | ClassDeclaration
  5668. | ExpressionStatement
  5669. | BlockStatement
  5670. | StaticBlock
  5671. | EmptyStatement
  5672. | DebuggerStatement
  5673. | WithStatement
  5674. | ReturnStatement
  5675. | LabeledStatement
  5676. | BreakStatement
  5677. | ContinueStatement
  5678. | IfStatement
  5679. | SwitchStatement
  5680. | ThrowStatement
  5681. | TryStatement
  5682. | WhileStatement
  5683. | DoWhileStatement
  5684. | ForStatement
  5685. | ForInStatement
  5686. | ForOfStatement
  5687. | ImportDeclaration
  5688. | ExportNamedDeclaration
  5689. | ExportDefaultDeclaration
  5690. | ExportAllDeclaration
  5691. ): void;
  5692. blockPreWalkStatement(
  5693. statement:
  5694. | FunctionDeclaration
  5695. | VariableDeclaration
  5696. | ClassDeclaration
  5697. | ExpressionStatement
  5698. | BlockStatement
  5699. | StaticBlock
  5700. | EmptyStatement
  5701. | DebuggerStatement
  5702. | WithStatement
  5703. | ReturnStatement
  5704. | LabeledStatement
  5705. | BreakStatement
  5706. | ContinueStatement
  5707. | IfStatement
  5708. | SwitchStatement
  5709. | ThrowStatement
  5710. | TryStatement
  5711. | WhileStatement
  5712. | DoWhileStatement
  5713. | ForStatement
  5714. | ForInStatement
  5715. | ForOfStatement
  5716. | ImportDeclaration
  5717. | ExportNamedDeclaration
  5718. | ExportDefaultDeclaration
  5719. | ExportAllDeclaration
  5720. ): void;
  5721. walkStatement(
  5722. statement:
  5723. | FunctionDeclaration
  5724. | VariableDeclaration
  5725. | ClassDeclaration
  5726. | ExpressionStatement
  5727. | BlockStatement
  5728. | StaticBlock
  5729. | EmptyStatement
  5730. | DebuggerStatement
  5731. | WithStatement
  5732. | ReturnStatement
  5733. | LabeledStatement
  5734. | BreakStatement
  5735. | ContinueStatement
  5736. | IfStatement
  5737. | SwitchStatement
  5738. | ThrowStatement
  5739. | TryStatement
  5740. | WhileStatement
  5741. | DoWhileStatement
  5742. | ForStatement
  5743. | ForInStatement
  5744. | ForOfStatement
  5745. | ImportDeclaration
  5746. | ExportNamedDeclaration
  5747. | ExportDefaultDeclaration
  5748. | ExportAllDeclaration
  5749. ): void;
  5750. /**
  5751. * Walks a statements that is nested within a parent statement
  5752. * and can potentially be a non-block statement.
  5753. * This enforces the nested statement to never be in ASI position.
  5754. */
  5755. walkNestedStatement(statement: Statement): void;
  5756. preWalkBlockStatement(statement: BlockStatement): void;
  5757. walkBlockStatement(statement: BlockStatement): void;
  5758. walkExpressionStatement(statement: ExpressionStatement): void;
  5759. preWalkIfStatement(statement: IfStatement): void;
  5760. walkIfStatement(statement: IfStatement): void;
  5761. preWalkLabeledStatement(statement: LabeledStatement): void;
  5762. walkLabeledStatement(statement: LabeledStatement): void;
  5763. preWalkWithStatement(statement: WithStatement): void;
  5764. walkWithStatement(statement: WithStatement): void;
  5765. preWalkSwitchStatement(statement: SwitchStatement): void;
  5766. walkSwitchStatement(statement: SwitchStatement): void;
  5767. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  5768. walkReturnStatement(statement: ReturnStatement): void;
  5769. walkThrowStatement(statement: ThrowStatement): void;
  5770. preWalkTryStatement(statement: TryStatement): void;
  5771. walkTryStatement(statement: TryStatement): void;
  5772. preWalkWhileStatement(statement: WhileStatement): void;
  5773. walkWhileStatement(statement: WhileStatement): void;
  5774. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  5775. walkDoWhileStatement(statement: DoWhileStatement): void;
  5776. preWalkForStatement(statement: ForStatement): void;
  5777. walkForStatement(statement: ForStatement): void;
  5778. preWalkForInStatement(statement: ForInStatement): void;
  5779. walkForInStatement(statement: ForInStatement): void;
  5780. preWalkForOfStatement(statement: ForOfStatement): void;
  5781. walkForOfStatement(statement: ForOfStatement): void;
  5782. preWalkFunctionDeclaration(statement: FunctionDeclaration): void;
  5783. walkFunctionDeclaration(statement: FunctionDeclaration): void;
  5784. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  5785. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  5786. blockPreWalkImportDeclaration(statement: ImportDeclaration): void;
  5787. enterDeclaration(declaration: Declaration, onIdent?: any): void;
  5788. blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  5789. walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  5790. blockPreWalkExportDefaultDeclaration(statement?: any): void;
  5791. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  5792. blockPreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
  5793. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  5794. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  5795. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  5796. walkVariableDeclaration(statement: VariableDeclaration): void;
  5797. blockPreWalkClassDeclaration(statement: ClassDeclaration): void;
  5798. walkClassDeclaration(statement: ClassDeclaration): void;
  5799. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  5800. walkSwitchCases(switchCases: SwitchCase[]): void;
  5801. preWalkCatchClause(catchClause: CatchClause): void;
  5802. walkCatchClause(catchClause: CatchClause): void;
  5803. walkPattern(pattern: Pattern): void;
  5804. walkAssignmentPattern(pattern: AssignmentPattern): void;
  5805. walkObjectPattern(pattern: ObjectPattern): void;
  5806. walkArrayPattern(pattern: ArrayPattern): void;
  5807. walkRestElement(pattern: RestElement): void;
  5808. walkExpressions(
  5809. expressions: (
  5810. | null
  5811. | UnaryExpression
  5812. | ArrayExpression
  5813. | ArrowFunctionExpression
  5814. | AssignmentExpression
  5815. | AwaitExpression
  5816. | BinaryExpression
  5817. | SimpleCallExpression
  5818. | NewExpression
  5819. | ChainExpression
  5820. | ClassExpression
  5821. | ConditionalExpression
  5822. | FunctionExpression
  5823. | Identifier
  5824. | ImportExpression
  5825. | SimpleLiteral
  5826. | RegExpLiteral
  5827. | BigIntLiteral
  5828. | LogicalExpression
  5829. | MemberExpression
  5830. | MetaProperty
  5831. | ObjectExpression
  5832. | SequenceExpression
  5833. | TaggedTemplateExpression
  5834. | TemplateLiteral
  5835. | ThisExpression
  5836. | UpdateExpression
  5837. | YieldExpression
  5838. | SpreadElement
  5839. )[]
  5840. ): void;
  5841. walkExpression(expression?: any): void;
  5842. walkAwaitExpression(expression: AwaitExpression): void;
  5843. walkArrayExpression(expression: ArrayExpression): void;
  5844. walkSpreadElement(expression: SpreadElement): void;
  5845. walkObjectExpression(expression: ObjectExpression): void;
  5846. walkProperty(prop: SpreadElement | Property): void;
  5847. walkFunctionExpression(expression: FunctionExpression): void;
  5848. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  5849. walkSequenceExpression(expression: SequenceExpression): void;
  5850. walkUpdateExpression(expression: UpdateExpression): void;
  5851. walkUnaryExpression(expression: UnaryExpression): void;
  5852. walkLeftRightExpression(
  5853. expression: BinaryExpression | LogicalExpression
  5854. ): void;
  5855. walkBinaryExpression(expression: BinaryExpression): void;
  5856. walkLogicalExpression(expression: LogicalExpression): void;
  5857. walkAssignmentExpression(expression: AssignmentExpression): void;
  5858. walkConditionalExpression(expression: ConditionalExpression): void;
  5859. walkNewExpression(expression: NewExpression): void;
  5860. walkYieldExpression(expression: YieldExpression): void;
  5861. walkTemplateLiteral(expression: TemplateLiteral): void;
  5862. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  5863. walkClassExpression(expression: ClassExpression): void;
  5864. walkChainExpression(expression: ChainExpression): void;
  5865. walkImportExpression(expression: ImportExpression): void;
  5866. walkCallExpression(expression: CallExpression): void;
  5867. walkMemberExpression(expression: MemberExpression): void;
  5868. walkMemberExpressionWithExpressionName(
  5869. expression: any,
  5870. name: string,
  5871. rootInfo: string | VariableInfo,
  5872. members: string[],
  5873. onUnhandled?: any
  5874. ): void;
  5875. walkThisExpression(expression: ThisExpression): void;
  5876. walkIdentifier(expression: Identifier): void;
  5877. walkMetaProperty(metaProperty: MetaProperty): void;
  5878. callHooksForExpression<T, R>(
  5879. hookMap: HookMap<SyncBailHook<T, R>>,
  5880. expr: any,
  5881. ...args: AsArray<T>
  5882. ): undefined | R;
  5883. callHooksForExpressionWithFallback<T, R>(
  5884. hookMap: HookMap<SyncBailHook<T, R>>,
  5885. expr: MemberExpression,
  5886. fallback:
  5887. | undefined
  5888. | ((
  5889. arg0: string,
  5890. arg1: string | ScopeInfo | VariableInfo,
  5891. arg2: () => string[]
  5892. ) => any),
  5893. defined: undefined | ((arg0: string) => any),
  5894. ...args: AsArray<T>
  5895. ): undefined | R;
  5896. callHooksForName<T, R>(
  5897. hookMap: HookMap<SyncBailHook<T, R>>,
  5898. name: string,
  5899. ...args: AsArray<T>
  5900. ): undefined | R;
  5901. callHooksForInfo<T, R>(
  5902. hookMap: HookMap<SyncBailHook<T, R>>,
  5903. info: ExportedVariableInfo,
  5904. ...args: AsArray<T>
  5905. ): undefined | R;
  5906. callHooksForInfoWithFallback<T, R>(
  5907. hookMap: HookMap<SyncBailHook<T, R>>,
  5908. info: ExportedVariableInfo,
  5909. fallback: undefined | ((arg0: string) => any),
  5910. defined: undefined | (() => any),
  5911. ...args: AsArray<T>
  5912. ): undefined | R;
  5913. callHooksForNameWithFallback<T, R>(
  5914. hookMap: HookMap<SyncBailHook<T, R>>,
  5915. name: string,
  5916. fallback: undefined | ((arg0: string) => any),
  5917. defined: undefined | (() => any),
  5918. ...args: AsArray<T>
  5919. ): undefined | R;
  5920. inScope(params: any, fn: () => void): void;
  5921. inClassScope(hasThis: boolean, params: any, fn: () => void): void;
  5922. inFunctionScope(hasThis: boolean, params: any, fn: () => void): void;
  5923. inBlockScope(fn: () => void): void;
  5924. detectMode(
  5925. statements: (
  5926. | FunctionDeclaration
  5927. | VariableDeclaration
  5928. | ClassDeclaration
  5929. | ExpressionStatement
  5930. | BlockStatement
  5931. | StaticBlock
  5932. | EmptyStatement
  5933. | DebuggerStatement
  5934. | WithStatement
  5935. | ReturnStatement
  5936. | LabeledStatement
  5937. | BreakStatement
  5938. | ContinueStatement
  5939. | IfStatement
  5940. | SwitchStatement
  5941. | ThrowStatement
  5942. | TryStatement
  5943. | WhileStatement
  5944. | DoWhileStatement
  5945. | ForStatement
  5946. | ForInStatement
  5947. | ForOfStatement
  5948. | ImportDeclaration
  5949. | ExportNamedDeclaration
  5950. | ExportDefaultDeclaration
  5951. | ExportAllDeclaration
  5952. | Directive
  5953. )[]
  5954. ): void;
  5955. enterPatterns(
  5956. patterns: (
  5957. | string
  5958. | Identifier
  5959. | MemberExpression
  5960. | ObjectPattern
  5961. | ArrayPattern
  5962. | RestElement
  5963. | AssignmentPattern
  5964. | Property
  5965. )[],
  5966. onIdent?: any
  5967. ): void;
  5968. enterPattern(
  5969. pattern:
  5970. | Identifier
  5971. | MemberExpression
  5972. | ObjectPattern
  5973. | ArrayPattern
  5974. | RestElement
  5975. | AssignmentPattern
  5976. | Property,
  5977. onIdent?: any
  5978. ): void;
  5979. enterIdentifier(pattern: Identifier, onIdent?: any): void;
  5980. enterObjectPattern(pattern: ObjectPattern, onIdent?: any): void;
  5981. enterArrayPattern(pattern: ArrayPattern, onIdent?: any): void;
  5982. enterRestElement(pattern: RestElement, onIdent?: any): void;
  5983. enterAssignmentPattern(pattern: AssignmentPattern, onIdent?: any): void;
  5984. evaluateExpression(expression?: any): BasicEvaluatedExpression;
  5985. parseString(expression: Expression): string;
  5986. parseCalculatedString(expression: Expression): any;
  5987. evaluate(source: string): BasicEvaluatedExpression;
  5988. isPure(
  5989. expr:
  5990. | undefined
  5991. | null
  5992. | UnaryExpression
  5993. | ArrayExpression
  5994. | ArrowFunctionExpression
  5995. | AssignmentExpression
  5996. | AwaitExpression
  5997. | BinaryExpression
  5998. | SimpleCallExpression
  5999. | NewExpression
  6000. | ChainExpression
  6001. | ClassExpression
  6002. | ConditionalExpression
  6003. | FunctionExpression
  6004. | Identifier
  6005. | ImportExpression
  6006. | SimpleLiteral
  6007. | RegExpLiteral
  6008. | BigIntLiteral
  6009. | LogicalExpression
  6010. | MemberExpression
  6011. | MetaProperty
  6012. | ObjectExpression
  6013. | SequenceExpression
  6014. | TaggedTemplateExpression
  6015. | TemplateLiteral
  6016. | ThisExpression
  6017. | UpdateExpression
  6018. | YieldExpression
  6019. | FunctionDeclaration
  6020. | VariableDeclaration
  6021. | ClassDeclaration
  6022. | PrivateIdentifier,
  6023. commentsStartPos: number
  6024. ): boolean;
  6025. getComments(range: [number, number]): Comment[];
  6026. isAsiPosition(pos: number): boolean;
  6027. unsetAsiPosition(pos: number): void;
  6028. isStatementLevelExpression(expr: Expression): boolean;
  6029. getTagData(name: string, tag?: any): any;
  6030. tagVariable(name: string, tag?: any, data?: any): void;
  6031. defineVariable(name: string): void;
  6032. undefineVariable(name: string): void;
  6033. isVariableDefined(name: string): boolean;
  6034. getVariableInfo(name: string): ExportedVariableInfo;
  6035. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  6036. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  6037. parseCommentOptions(range: [number, number]): any;
  6038. extractMemberExpressionChain(expression: MemberExpression): {
  6039. members: string[];
  6040. object:
  6041. | UnaryExpression
  6042. | ArrayExpression
  6043. | ArrowFunctionExpression
  6044. | AssignmentExpression
  6045. | AwaitExpression
  6046. | BinaryExpression
  6047. | SimpleCallExpression
  6048. | NewExpression
  6049. | ChainExpression
  6050. | ClassExpression
  6051. | ConditionalExpression
  6052. | FunctionExpression
  6053. | Identifier
  6054. | ImportExpression
  6055. | SimpleLiteral
  6056. | RegExpLiteral
  6057. | BigIntLiteral
  6058. | LogicalExpression
  6059. | MemberExpression
  6060. | MetaProperty
  6061. | ObjectExpression
  6062. | SequenceExpression
  6063. | TaggedTemplateExpression
  6064. | TemplateLiteral
  6065. | ThisExpression
  6066. | UpdateExpression
  6067. | YieldExpression
  6068. | Super;
  6069. membersOptionals: boolean[];
  6070. memberRanges: [number, number][];
  6071. };
  6072. getFreeInfoFromVariable(
  6073. varName: string
  6074. ): undefined | { name: string; info: string | VariableInfo };
  6075. getMemberExpressionInfo(
  6076. expression: MemberExpression,
  6077. allowedTypes: number
  6078. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  6079. getNameForExpression(
  6080. expression: MemberExpression
  6081. ):
  6082. | undefined
  6083. | {
  6084. name: string;
  6085. rootInfo: ExportedVariableInfo;
  6086. getMembers: () => string[];
  6087. };
  6088. static ALLOWED_MEMBER_TYPES_ALL: 3;
  6089. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  6090. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  6091. }
  6092. /**
  6093. * Parser options for javascript modules.
  6094. */
  6095. declare interface JavascriptParserOptions {
  6096. [index: string]: any;
  6097. /**
  6098. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  6099. */
  6100. amd?: false | { [index: string]: any };
  6101. /**
  6102. * Enable/disable special handling for browserify bundles.
  6103. */
  6104. browserify?: boolean;
  6105. /**
  6106. * Enable/disable parsing of CommonJs syntax.
  6107. */
  6108. commonjs?: boolean;
  6109. /**
  6110. * Enable/disable parsing of magic comments in CommonJs syntax.
  6111. */
  6112. commonjsMagicComments?: boolean;
  6113. /**
  6114. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  6115. */
  6116. createRequire?: string | boolean;
  6117. /**
  6118. * Specifies global fetchPriority for dynamic import.
  6119. */
  6120. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  6121. /**
  6122. * Specifies global mode for dynamic import.
  6123. */
  6124. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  6125. /**
  6126. * Specifies global prefetch for dynamic import.
  6127. */
  6128. dynamicImportPrefetch?: number | boolean;
  6129. /**
  6130. * Specifies global preload for dynamic import.
  6131. */
  6132. dynamicImportPreload?: number | boolean;
  6133. /**
  6134. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  6135. */
  6136. exportsPresence?: false | "auto" | "error" | "warn";
  6137. /**
  6138. * Enable warnings for full dynamic dependencies.
  6139. */
  6140. exprContextCritical?: boolean;
  6141. /**
  6142. * Enable recursive directory lookup for full dynamic dependencies.
  6143. */
  6144. exprContextRecursive?: boolean;
  6145. /**
  6146. * Sets the default regular expression for full dynamic dependencies.
  6147. */
  6148. exprContextRegExp?: boolean | RegExp;
  6149. /**
  6150. * Set the default request for full dynamic dependencies.
  6151. */
  6152. exprContextRequest?: string;
  6153. /**
  6154. * Enable/disable parsing of EcmaScript Modules syntax.
  6155. */
  6156. harmony?: boolean;
  6157. /**
  6158. * Enable/disable parsing of import() syntax.
  6159. */
  6160. import?: boolean;
  6161. /**
  6162. * Specifies the behavior of invalid export names in "import ... from ...".
  6163. */
  6164. importExportsPresence?: false | "auto" | "error" | "warn";
  6165. /**
  6166. * Enable/disable evaluating import.meta.
  6167. */
  6168. importMeta?: boolean;
  6169. /**
  6170. * Enable/disable evaluating import.meta.webpackContext.
  6171. */
  6172. importMetaContext?: boolean;
  6173. /**
  6174. * Include polyfills or mocks for various node stuff.
  6175. */
  6176. node?: false | NodeOptions;
  6177. /**
  6178. * 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.
  6179. */
  6180. reexportExportsPresence?: false | "auto" | "error" | "warn";
  6181. /**
  6182. * Enable/disable parsing of require.context syntax.
  6183. */
  6184. requireContext?: boolean;
  6185. /**
  6186. * Enable/disable parsing of require.ensure syntax.
  6187. */
  6188. requireEnsure?: boolean;
  6189. /**
  6190. * Enable/disable parsing of require.include syntax.
  6191. */
  6192. requireInclude?: boolean;
  6193. /**
  6194. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  6195. */
  6196. requireJs?: boolean;
  6197. /**
  6198. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  6199. */
  6200. strictExportPresence?: boolean;
  6201. /**
  6202. * Handle the this context correctly according to the spec for namespace objects.
  6203. */
  6204. strictThisContextOnImports?: boolean;
  6205. /**
  6206. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  6207. */
  6208. system?: boolean;
  6209. /**
  6210. * Enable warnings when using the require function in a not statically analyse-able way.
  6211. */
  6212. unknownContextCritical?: boolean;
  6213. /**
  6214. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  6215. */
  6216. unknownContextRecursive?: boolean;
  6217. /**
  6218. * Sets the regular expression when using the require function in a not statically analyse-able way.
  6219. */
  6220. unknownContextRegExp?: boolean | RegExp;
  6221. /**
  6222. * Sets the request when using the require function in a not statically analyse-able way.
  6223. */
  6224. unknownContextRequest?: string;
  6225. /**
  6226. * Enable/disable parsing of new URL() syntax.
  6227. */
  6228. url?: boolean | "relative";
  6229. /**
  6230. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  6231. */
  6232. worker?: boolean | string[];
  6233. /**
  6234. * Enable warnings for partial dynamic dependencies.
  6235. */
  6236. wrappedContextCritical?: boolean;
  6237. /**
  6238. * Enable recursive directory lookup for partial dynamic dependencies.
  6239. */
  6240. wrappedContextRecursive?: boolean;
  6241. /**
  6242. * Set the inner regular expression for partial dynamic dependencies.
  6243. */
  6244. wrappedContextRegExp?: RegExp;
  6245. }
  6246. type JsonObjectFs = { [index: string]: JsonValueFs } & {
  6247. [index: string]:
  6248. | undefined
  6249. | null
  6250. | string
  6251. | number
  6252. | boolean
  6253. | JsonObjectFs
  6254. | JsonValueFs[];
  6255. };
  6256. type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
  6257. [index: string]:
  6258. | undefined
  6259. | null
  6260. | string
  6261. | number
  6262. | boolean
  6263. | JsonObjectTypes
  6264. | JsonValueTypes[];
  6265. };
  6266. type JsonValueFs =
  6267. | null
  6268. | string
  6269. | number
  6270. | boolean
  6271. | JsonObjectFs
  6272. | JsonValueFs[];
  6273. type JsonValueTypes =
  6274. | null
  6275. | string
  6276. | number
  6277. | boolean
  6278. | JsonObjectTypes
  6279. | JsonValueTypes[];
  6280. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  6281. constructor(runtimeRequirements: ReadonlySet<string>);
  6282. static getCompilationHooks(
  6283. compilation: Compilation
  6284. ): JsonpCompilationPluginHooks;
  6285. /**
  6286. * Runtime modules without any dependencies to other runtime modules
  6287. */
  6288. static STAGE_NORMAL: number;
  6289. /**
  6290. * Runtime modules with simple dependencies on other runtime modules
  6291. */
  6292. static STAGE_BASIC: number;
  6293. /**
  6294. * Runtime modules which attach to handlers of other runtime modules
  6295. */
  6296. static STAGE_ATTACH: number;
  6297. /**
  6298. * Runtime modules which trigger actions on bootstrap
  6299. */
  6300. static STAGE_TRIGGER: number;
  6301. }
  6302. declare interface JsonpCompilationPluginHooks {
  6303. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  6304. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  6305. }
  6306. declare class JsonpTemplatePlugin {
  6307. constructor();
  6308. /**
  6309. * Apply the plugin
  6310. */
  6311. apply(compiler: Compiler): void;
  6312. static getCompilationHooks(
  6313. compilation: Compilation
  6314. ): JsonpCompilationPluginHooks;
  6315. }
  6316. declare interface KnownAssetInfo {
  6317. /**
  6318. * true, if the asset can be long term cached forever (contains a hash)
  6319. */
  6320. immutable?: boolean;
  6321. /**
  6322. * whether the asset is minimized
  6323. */
  6324. minimized?: boolean;
  6325. /**
  6326. * the value(s) of the full hash used for this asset
  6327. */
  6328. fullhash?: string | string[];
  6329. /**
  6330. * the value(s) of the chunk hash used for this asset
  6331. */
  6332. chunkhash?: string | string[];
  6333. /**
  6334. * the value(s) of the module hash used for this asset
  6335. */
  6336. modulehash?: string | string[];
  6337. /**
  6338. * the value(s) of the content hash used for this asset
  6339. */
  6340. contenthash?: string | string[];
  6341. /**
  6342. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  6343. */
  6344. sourceFilename?: string;
  6345. /**
  6346. * size in bytes, only set after asset has been emitted
  6347. */
  6348. size?: number;
  6349. /**
  6350. * true, when asset is only used for development and doesn't count towards user-facing assets
  6351. */
  6352. development?: boolean;
  6353. /**
  6354. * true, when asset ships data for updating an existing application (HMR)
  6355. */
  6356. hotModuleReplacement?: boolean;
  6357. /**
  6358. * true, when asset is javascript and an ESM
  6359. */
  6360. javascriptModule?: boolean;
  6361. /**
  6362. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  6363. */
  6364. related?: Record<string, string | string[]>;
  6365. }
  6366. declare interface KnownBuildInfo {
  6367. cacheable?: boolean;
  6368. parsed?: boolean;
  6369. fileDependencies?: LazySet<string>;
  6370. contextDependencies?: LazySet<string>;
  6371. missingDependencies?: LazySet<string>;
  6372. buildDependencies?: LazySet<string>;
  6373. valueDependencies?: Map<string, string | Set<string>>;
  6374. hash?: any;
  6375. assets?: Record<string, Source>;
  6376. assetsInfo?: Map<string, undefined | AssetInfo>;
  6377. snapshot?: null | Snapshot;
  6378. }
  6379. declare interface KnownBuildMeta {
  6380. moduleArgument?: string;
  6381. exportsArgument?: string;
  6382. strict?: boolean;
  6383. moduleConcatenationBailout?: string;
  6384. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  6385. defaultObject?: false | "redirect" | "redirect-warn";
  6386. strictHarmonyModule?: boolean;
  6387. async?: boolean;
  6388. sideEffectFree?: boolean;
  6389. }
  6390. declare interface KnownCreateStatsOptionsContext {
  6391. forToString?: boolean;
  6392. }
  6393. declare interface KnownHooks {
  6394. resolveStep: SyncHook<
  6395. [
  6396. AsyncSeriesBailHook<
  6397. [ResolveRequest, ResolveContext],
  6398. null | ResolveRequest
  6399. >,
  6400. ResolveRequest
  6401. ]
  6402. >;
  6403. noResolve: SyncHook<[ResolveRequest, Error]>;
  6404. resolve: AsyncSeriesBailHook<
  6405. [ResolveRequest, ResolveContext],
  6406. null | ResolveRequest
  6407. >;
  6408. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  6409. }
  6410. declare interface KnownNormalizedStatsOptions {
  6411. context: string;
  6412. requestShortener: RequestShortener;
  6413. chunksSort: string;
  6414. modulesSort: string;
  6415. chunkModulesSort: string;
  6416. nestedModulesSort: string;
  6417. assetsSort: string;
  6418. ids: boolean;
  6419. cachedAssets: boolean;
  6420. groupAssetsByEmitStatus: boolean;
  6421. groupAssetsByPath: boolean;
  6422. groupAssetsByExtension: boolean;
  6423. assetsSpace: number;
  6424. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  6425. excludeModules: ((
  6426. name: string,
  6427. module: StatsModule,
  6428. type: "module" | "chunk" | "root-of-chunk" | "nested"
  6429. ) => boolean)[];
  6430. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  6431. cachedModules: boolean;
  6432. orphanModules: boolean;
  6433. dependentModules: boolean;
  6434. runtimeModules: boolean;
  6435. groupModulesByCacheStatus: boolean;
  6436. groupModulesByLayer: boolean;
  6437. groupModulesByAttributes: boolean;
  6438. groupModulesByPath: boolean;
  6439. groupModulesByExtension: boolean;
  6440. groupModulesByType: boolean;
  6441. entrypoints: boolean | "auto";
  6442. chunkGroups: boolean;
  6443. chunkGroupAuxiliary: boolean;
  6444. chunkGroupChildren: boolean;
  6445. chunkGroupMaxAssets: number;
  6446. modulesSpace: number;
  6447. chunkModulesSpace: number;
  6448. nestedModulesSpace: number;
  6449. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  6450. loggingDebug: ((value: string) => boolean)[];
  6451. loggingTrace: boolean;
  6452. }
  6453. declare interface KnownStatsAsset {
  6454. type: string;
  6455. name: string;
  6456. info: AssetInfo;
  6457. size: number;
  6458. emitted: boolean;
  6459. comparedForEmit: boolean;
  6460. cached: boolean;
  6461. related?: StatsAsset[];
  6462. chunkNames?: (string | number)[];
  6463. chunkIdHints?: (string | number)[];
  6464. chunks?: (string | number)[];
  6465. auxiliaryChunkNames?: (string | number)[];
  6466. auxiliaryChunks?: (string | number)[];
  6467. auxiliaryChunkIdHints?: (string | number)[];
  6468. filteredRelated?: number;
  6469. isOverSizeLimit?: boolean;
  6470. }
  6471. declare interface KnownStatsChunk {
  6472. rendered: boolean;
  6473. initial: boolean;
  6474. entry: boolean;
  6475. recorded: boolean;
  6476. reason?: string;
  6477. size: number;
  6478. sizes?: Record<string, number>;
  6479. names?: string[];
  6480. idHints?: string[];
  6481. runtime?: string[];
  6482. files?: string[];
  6483. auxiliaryFiles?: string[];
  6484. hash: string;
  6485. childrenByOrder?: Record<string, (string | number)[]>;
  6486. id?: string | number;
  6487. siblings?: (string | number)[];
  6488. parents?: (string | number)[];
  6489. children?: (string | number)[];
  6490. modules?: StatsModule[];
  6491. filteredModules?: number;
  6492. origins?: StatsChunkOrigin[];
  6493. }
  6494. declare interface KnownStatsChunkGroup {
  6495. name?: string;
  6496. chunks?: (string | number)[];
  6497. assets?: { name: string; size?: number }[];
  6498. filteredAssets?: number;
  6499. assetsSize?: number;
  6500. auxiliaryAssets?: { name: string; size?: number }[];
  6501. filteredAuxiliaryAssets?: number;
  6502. auxiliaryAssetsSize?: number;
  6503. children?: { [index: string]: StatsChunkGroup[] };
  6504. childAssets?: { [index: string]: string[] };
  6505. isOverSizeLimit?: boolean;
  6506. }
  6507. declare interface KnownStatsChunkOrigin {
  6508. module?: string;
  6509. moduleIdentifier?: string;
  6510. moduleName?: string;
  6511. loc?: string;
  6512. request?: string;
  6513. moduleId?: string | number;
  6514. }
  6515. declare interface KnownStatsCompilation {
  6516. env?: any;
  6517. name?: string;
  6518. hash?: string;
  6519. version?: string;
  6520. time?: number;
  6521. builtAt?: number;
  6522. needAdditionalPass?: boolean;
  6523. publicPath?: string;
  6524. outputPath?: string;
  6525. assetsByChunkName?: Record<string, string[]>;
  6526. assets?: StatsAsset[];
  6527. filteredAssets?: number;
  6528. chunks?: StatsChunk[];
  6529. modules?: StatsModule[];
  6530. filteredModules?: number;
  6531. entrypoints?: Record<string, StatsChunkGroup>;
  6532. namedChunkGroups?: Record<string, StatsChunkGroup>;
  6533. errors?: StatsError[];
  6534. errorsCount?: number;
  6535. warnings?: StatsError[];
  6536. warningsCount?: number;
  6537. children?: StatsCompilation[];
  6538. logging?: Record<string, StatsLogging>;
  6539. }
  6540. declare interface KnownStatsError {
  6541. message: string;
  6542. chunkName?: string;
  6543. chunkEntry?: boolean;
  6544. chunkInitial?: boolean;
  6545. file?: string;
  6546. moduleIdentifier?: string;
  6547. moduleName?: string;
  6548. loc?: string;
  6549. chunkId?: string | number;
  6550. moduleId?: string | number;
  6551. moduleTrace?: StatsModuleTraceItem[];
  6552. details?: any;
  6553. stack?: string;
  6554. }
  6555. declare interface KnownStatsFactoryContext {
  6556. type: string;
  6557. makePathsRelative?: (arg0: string) => string;
  6558. compilation?: Compilation;
  6559. rootModules?: Set<Module>;
  6560. compilationFileToChunks?: Map<string, Chunk[]>;
  6561. compilationAuxiliaryFileToChunks?: Map<string, Chunk[]>;
  6562. runtime?: RuntimeSpec;
  6563. cachedGetErrors?: (arg0: Compilation) => WebpackError[];
  6564. cachedGetWarnings?: (arg0: Compilation) => WebpackError[];
  6565. }
  6566. declare interface KnownStatsLogging {
  6567. entries: StatsLoggingEntry[];
  6568. filteredEntries: number;
  6569. debug: boolean;
  6570. }
  6571. declare interface KnownStatsLoggingEntry {
  6572. type: string;
  6573. message: string;
  6574. trace?: string[];
  6575. children?: StatsLoggingEntry[];
  6576. args?: any[];
  6577. time?: number;
  6578. }
  6579. declare interface KnownStatsModule {
  6580. type?: string;
  6581. moduleType?: string;
  6582. layer?: string;
  6583. identifier?: string;
  6584. name?: string;
  6585. nameForCondition?: string;
  6586. index?: number;
  6587. preOrderIndex?: number;
  6588. index2?: number;
  6589. postOrderIndex?: number;
  6590. size?: number;
  6591. sizes?: { [index: string]: number };
  6592. cacheable?: boolean;
  6593. built?: boolean;
  6594. codeGenerated?: boolean;
  6595. buildTimeExecuted?: boolean;
  6596. cached?: boolean;
  6597. optional?: boolean;
  6598. orphan?: boolean;
  6599. id?: string | number;
  6600. issuerId?: string | number;
  6601. chunks?: (string | number)[];
  6602. assets?: (string | number)[];
  6603. dependent?: boolean;
  6604. issuer?: string;
  6605. issuerName?: string;
  6606. issuerPath?: StatsModuleIssuer[];
  6607. failed?: boolean;
  6608. errors?: number;
  6609. warnings?: number;
  6610. profile?: StatsProfile;
  6611. reasons?: StatsModuleReason[];
  6612. usedExports?: boolean | string[];
  6613. providedExports?: string[];
  6614. optimizationBailout?: string[];
  6615. depth?: number;
  6616. modules?: StatsModule[];
  6617. filteredModules?: number;
  6618. source?: string | Buffer;
  6619. }
  6620. declare interface KnownStatsModuleIssuer {
  6621. identifier?: string;
  6622. name?: string;
  6623. id?: string | number;
  6624. profile?: StatsProfile;
  6625. }
  6626. declare interface KnownStatsModuleReason {
  6627. moduleIdentifier?: string;
  6628. module?: string;
  6629. moduleName?: string;
  6630. resolvedModuleIdentifier?: string;
  6631. resolvedModule?: string;
  6632. type?: string;
  6633. active: boolean;
  6634. explanation?: string;
  6635. userRequest?: string;
  6636. loc?: string;
  6637. moduleId?: string | number;
  6638. resolvedModuleId?: string | number;
  6639. }
  6640. declare interface KnownStatsModuleTraceDependency {
  6641. loc?: string;
  6642. }
  6643. declare interface KnownStatsModuleTraceItem {
  6644. originIdentifier?: string;
  6645. originName?: string;
  6646. moduleIdentifier?: string;
  6647. moduleName?: string;
  6648. dependencies?: StatsModuleTraceDependency[];
  6649. originId?: string | number;
  6650. moduleId?: string | number;
  6651. }
  6652. declare interface KnownStatsPrinterContext {
  6653. type?: string;
  6654. compilation?: StatsCompilation;
  6655. chunkGroup?: StatsChunkGroup;
  6656. asset?: StatsAsset;
  6657. module?: StatsModule;
  6658. chunk?: StatsChunk;
  6659. moduleReason?: StatsModuleReason;
  6660. bold?: (str: string) => string;
  6661. yellow?: (str: string) => string;
  6662. red?: (str: string) => string;
  6663. green?: (str: string) => string;
  6664. magenta?: (str: string) => string;
  6665. cyan?: (str: string) => string;
  6666. formatFilename?: (file: string, oversize?: boolean) => string;
  6667. formatModuleId?: (id: string) => string;
  6668. formatChunkId?: (
  6669. id: string,
  6670. direction?: "parent" | "child" | "sibling"
  6671. ) => string;
  6672. formatSize?: (size: number) => string;
  6673. formatDateTime?: (dateTime: number) => string;
  6674. formatFlag?: (flag: string) => string;
  6675. formatTime?: (time: number, boldQuantity?: boolean) => string;
  6676. chunkGroupKind?: string;
  6677. }
  6678. declare interface KnownStatsProfile {
  6679. total: number;
  6680. resolving: number;
  6681. restoring: number;
  6682. building: number;
  6683. integration: number;
  6684. storing: number;
  6685. additionalResolving: number;
  6686. additionalIntegration: number;
  6687. factory: number;
  6688. dependencies: number;
  6689. }
  6690. declare interface LStatFs {
  6691. (
  6692. path: PathLikeFs,
  6693. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6694. ): void;
  6695. (
  6696. path: PathLikeFs,
  6697. options: undefined | (StatOptions & { bigint?: false }),
  6698. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6699. ): void;
  6700. (
  6701. path: PathLikeFs,
  6702. options: StatOptions & { bigint: true },
  6703. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  6704. ): void;
  6705. (
  6706. path: PathLikeFs,
  6707. options: undefined | StatOptions,
  6708. callback: (
  6709. arg0: null | NodeJS.ErrnoException,
  6710. arg1?: IStats | IBigIntStats
  6711. ) => void
  6712. ): void;
  6713. }
  6714. declare interface LStatSync {
  6715. (path: PathLikeFs, options?: undefined): IStats;
  6716. (
  6717. path: PathLikeFs,
  6718. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  6719. ): undefined | IStats;
  6720. (
  6721. path: PathLikeFs,
  6722. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  6723. ): undefined | IBigIntStats;
  6724. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  6725. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  6726. (
  6727. path: PathLikeFs,
  6728. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  6729. ): IStats | IBigIntStats;
  6730. (
  6731. path: PathLikeFs,
  6732. options?: StatSyncOptions
  6733. ): undefined | IStats | IBigIntStats;
  6734. }
  6735. declare interface LStatTypes {
  6736. (
  6737. path: PathLikeTypes,
  6738. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6739. ): void;
  6740. (
  6741. path: PathLikeTypes,
  6742. options: undefined | (StatOptions & { bigint?: false }),
  6743. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  6744. ): void;
  6745. (
  6746. path: PathLikeTypes,
  6747. options: StatOptions & { bigint: true },
  6748. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  6749. ): void;
  6750. (
  6751. path: PathLikeTypes,
  6752. options: undefined | StatOptions,
  6753. callback: (
  6754. arg0: null | NodeJS.ErrnoException,
  6755. arg1?: IStats | IBigIntStats
  6756. ) => void
  6757. ): void;
  6758. }
  6759. /**
  6760. * Options for the default backend.
  6761. */
  6762. declare interface LazyCompilationDefaultBackendOptions {
  6763. /**
  6764. * A custom client.
  6765. */
  6766. client?: string;
  6767. /**
  6768. * Specifies where to listen to from the server.
  6769. */
  6770. listen?: number | ListenOptions | ((server: Server) => void);
  6771. /**
  6772. * Specifies the protocol the client should use to connect to the server.
  6773. */
  6774. protocol?: "http" | "https";
  6775. /**
  6776. * Specifies how to create the server handling the EventSource requests.
  6777. */
  6778. server?:
  6779. | ServerOptionsImport<typeof IncomingMessage>
  6780. | ServerOptionsHttps<typeof IncomingMessage, typeof ServerResponse>
  6781. | (() => Server);
  6782. }
  6783. /**
  6784. * Options for compiling entrypoints and import()s only when they are accessed.
  6785. */
  6786. declare interface LazyCompilationOptions {
  6787. /**
  6788. * Specifies the backend that should be used for handling client keep alive.
  6789. */
  6790. backend?:
  6791. | ((
  6792. compiler: Compiler,
  6793. callback: (err?: Error, api?: BackendApi) => void
  6794. ) => void)
  6795. | ((compiler: Compiler) => Promise<BackendApi>)
  6796. | LazyCompilationDefaultBackendOptions;
  6797. /**
  6798. * Enable/disable lazy compilation for entries.
  6799. */
  6800. entries?: boolean;
  6801. /**
  6802. * Enable/disable lazy compilation for import() modules.
  6803. */
  6804. imports?: boolean;
  6805. /**
  6806. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  6807. */
  6808. test?: string | RegExp | ((module: Module) => boolean);
  6809. }
  6810. declare class LazySet<T> {
  6811. constructor(iterable?: Iterable<T>);
  6812. get size(): number;
  6813. add(item: T): LazySet<T>;
  6814. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  6815. clear(): void;
  6816. delete(value: T): boolean;
  6817. entries(): IterableIterator<[T, T]>;
  6818. forEach(
  6819. callbackFn: (arg0: T, arg1: T, arg2: Set<T>) => void,
  6820. thisArg?: any
  6821. ): void;
  6822. has(item: T): boolean;
  6823. keys(): IterableIterator<T>;
  6824. values(): IterableIterator<T>;
  6825. serialize(__0: ObjectSerializerContext): void;
  6826. [Symbol.iterator](): IterableIterator<T>;
  6827. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  6828. }
  6829. declare interface LibIdentOptions {
  6830. /**
  6831. * absolute context path to which lib ident is relative to
  6832. */
  6833. context: string;
  6834. /**
  6835. * object for caching
  6836. */
  6837. associatedObjectForCache?: object;
  6838. }
  6839. declare class LibManifestPlugin {
  6840. constructor(options: LibManifestPluginOptions);
  6841. options: LibManifestPluginOptions;
  6842. /**
  6843. * Apply the plugin
  6844. */
  6845. apply(compiler: Compiler): void;
  6846. }
  6847. declare interface LibManifestPluginOptions {
  6848. /**
  6849. * Context of requests in the manifest file (defaults to the webpack context).
  6850. */
  6851. context?: string;
  6852. /**
  6853. * If true, only entry points will be exposed (default: true).
  6854. */
  6855. entryOnly?: boolean;
  6856. /**
  6857. * If true, manifest json file (output) will be formatted.
  6858. */
  6859. format?: boolean;
  6860. /**
  6861. * Name of the exposed dll function (external name, use value of 'output.library').
  6862. */
  6863. name?: string;
  6864. /**
  6865. * Absolute path to the manifest json file (output).
  6866. */
  6867. path: string;
  6868. /**
  6869. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  6870. */
  6871. type?: string;
  6872. }
  6873. declare interface LibraryContext<T> {
  6874. compilation: Compilation;
  6875. chunkGraph: ChunkGraph;
  6876. options: T;
  6877. }
  6878. /**
  6879. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  6880. */
  6881. declare interface LibraryCustomUmdCommentObject {
  6882. /**
  6883. * Set comment for `amd` section in UMD.
  6884. */
  6885. amd?: string;
  6886. /**
  6887. * Set comment for `commonjs` (exports) section in UMD.
  6888. */
  6889. commonjs?: string;
  6890. /**
  6891. * Set comment for `commonjs2` (module.exports) section in UMD.
  6892. */
  6893. commonjs2?: string;
  6894. /**
  6895. * Set comment for `root` (global variable) section in UMD.
  6896. */
  6897. root?: string;
  6898. }
  6899. /**
  6900. * Description object for all UMD variants of the library name.
  6901. */
  6902. declare interface LibraryCustomUmdObject {
  6903. /**
  6904. * Name of the exposed AMD library in the UMD.
  6905. */
  6906. amd?: string;
  6907. /**
  6908. * Name of the exposed commonjs export in the UMD.
  6909. */
  6910. commonjs?: string;
  6911. /**
  6912. * Name of the property exposed globally by a UMD library.
  6913. */
  6914. root?: string | string[];
  6915. }
  6916. type LibraryExport = string | string[];
  6917. type LibraryName = string | string[] | LibraryCustomUmdObject;
  6918. /**
  6919. * Options for library.
  6920. */
  6921. declare interface LibraryOptions {
  6922. /**
  6923. * Add a container for define/require functions in the AMD module.
  6924. */
  6925. amdContainer?: string;
  6926. /**
  6927. * Add a comment in the UMD wrapper.
  6928. */
  6929. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  6930. /**
  6931. * Specify which export should be exposed as library.
  6932. */
  6933. export?: string | string[];
  6934. /**
  6935. * The name of the library (some types allow unnamed libraries too).
  6936. */
  6937. name?: string | string[] | LibraryCustomUmdObject;
  6938. /**
  6939. * 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).
  6940. */
  6941. type: string;
  6942. /**
  6943. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  6944. */
  6945. umdNamedDefine?: boolean;
  6946. }
  6947. declare class LibraryTemplatePlugin {
  6948. constructor(
  6949. name: LibraryName,
  6950. target: string,
  6951. umdNamedDefine: boolean,
  6952. auxiliaryComment: AuxiliaryComment,
  6953. exportProperty: LibraryExport
  6954. );
  6955. library: {
  6956. type: string;
  6957. name: LibraryName;
  6958. umdNamedDefine: boolean;
  6959. auxiliaryComment: AuxiliaryComment;
  6960. export: LibraryExport;
  6961. };
  6962. /**
  6963. * Apply the plugin
  6964. */
  6965. apply(compiler: Compiler): void;
  6966. }
  6967. declare class LimitChunkCountPlugin {
  6968. constructor(options?: LimitChunkCountPluginOptions);
  6969. options?: LimitChunkCountPluginOptions;
  6970. apply(compiler: Compiler): void;
  6971. }
  6972. declare interface LimitChunkCountPluginOptions {
  6973. /**
  6974. * Constant overhead for a chunk.
  6975. */
  6976. chunkOverhead?: number;
  6977. /**
  6978. * Multiplicator for initial chunks.
  6979. */
  6980. entryChunkMultiplicator?: number;
  6981. /**
  6982. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  6983. */
  6984. maxChunks: number;
  6985. }
  6986. declare interface LoadScriptCompilationHooks {
  6987. createScript: SyncWaterfallHook<[string, Chunk]>;
  6988. }
  6989. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  6990. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  6991. static getCompilationHooks(
  6992. compilation: Compilation
  6993. ): LoadScriptCompilationHooks;
  6994. /**
  6995. * Runtime modules without any dependencies to other runtime modules
  6996. */
  6997. static STAGE_NORMAL: number;
  6998. /**
  6999. * Runtime modules with simple dependencies on other runtime modules
  7000. */
  7001. static STAGE_BASIC: number;
  7002. /**
  7003. * Runtime modules which attach to handlers of other runtime modules
  7004. */
  7005. static STAGE_ATTACH: number;
  7006. /**
  7007. * Runtime modules which trigger actions on bootstrap
  7008. */
  7009. static STAGE_TRIGGER: number;
  7010. }
  7011. /**
  7012. * Custom values available in the loader context.
  7013. */
  7014. declare interface Loader {
  7015. [index: string]: any;
  7016. }
  7017. type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
  7018. LoaderRunnerLoaderContext<OptionsType> &
  7019. LoaderPluginLoaderContext &
  7020. HotModuleReplacementPluginLoaderContext;
  7021. type LoaderDefinition<
  7022. OptionsType = {},
  7023. ContextAdditions = {}
  7024. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  7025. raw?: false;
  7026. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7027. };
  7028. declare interface LoaderDefinitionFunction<
  7029. OptionsType = {},
  7030. ContextAdditions = {}
  7031. > {
  7032. (
  7033. this: NormalModuleLoaderContext<OptionsType> &
  7034. LoaderRunnerLoaderContext<OptionsType> &
  7035. LoaderPluginLoaderContext &
  7036. HotModuleReplacementPluginLoaderContext &
  7037. ContextAdditions,
  7038. content: string,
  7039. sourceMap?: string | SourceMap,
  7040. additionalData?: AdditionalData
  7041. ): string | void | Buffer | Promise<string | Buffer>;
  7042. }
  7043. declare interface LoaderItem {
  7044. loader: string;
  7045. options: any;
  7046. ident: null | string;
  7047. type: null | string;
  7048. }
  7049. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  7050. default?:
  7051. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  7052. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7053. raw?: false;
  7054. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7055. }
  7056. declare class LoaderOptionsPlugin {
  7057. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  7058. options: LoaderOptionsPluginOptions & MatchObject;
  7059. /**
  7060. * Apply the plugin
  7061. */
  7062. apply(compiler: Compiler): void;
  7063. }
  7064. declare interface LoaderOptionsPluginOptions {
  7065. [index: string]: any;
  7066. /**
  7067. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  7068. */
  7069. debug?: boolean;
  7070. /**
  7071. * Where loaders can be switched to minimize mode.
  7072. */
  7073. minimize?: boolean;
  7074. /**
  7075. * A configuration object that can be used to configure older loaders.
  7076. */
  7077. options?: {
  7078. [index: string]: any;
  7079. /**
  7080. * The context that can be used to configure older loaders.
  7081. */
  7082. context?: string;
  7083. };
  7084. }
  7085. /**
  7086. * These properties are added by the LoaderPlugin
  7087. */
  7088. declare interface LoaderPluginLoaderContext {
  7089. /**
  7090. * Resolves the given request to a module, applies all configured loaders and calls
  7091. * back with the generated source, the sourceMap and the module instance (usually an
  7092. * instance of NormalModule). Use this function if you need to know the source code
  7093. * of another module to generate the result.
  7094. */
  7095. loadModule(
  7096. request: string,
  7097. callback: (
  7098. err: null | Error,
  7099. source: string,
  7100. sourceMap: any,
  7101. module: NormalModule
  7102. ) => void
  7103. ): void;
  7104. importModule(
  7105. request: string,
  7106. options: ImportModuleOptions,
  7107. callback: (err?: null | Error, exports?: any) => any
  7108. ): void;
  7109. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  7110. }
  7111. /**
  7112. * The properties are added by https://github.com/webpack/loader-runner
  7113. */
  7114. declare interface LoaderRunnerLoaderContext<OptionsType> {
  7115. /**
  7116. * Add a directory as dependency of the loader result.
  7117. */
  7118. addContextDependency(context: string): void;
  7119. /**
  7120. * Adds a file as dependency of the loader result in order to make them watchable.
  7121. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7122. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7123. */
  7124. addDependency(file: string): void;
  7125. addMissingDependency(context: string): void;
  7126. /**
  7127. * Make this loader async.
  7128. */
  7129. async(): (
  7130. err?: null | Error,
  7131. content?: string | Buffer,
  7132. sourceMap?: string | SourceMap,
  7133. additionalData?: AdditionalData
  7134. ) => void;
  7135. /**
  7136. * Make this loader result cacheable. By default it's cacheable.
  7137. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  7138. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  7139. * Most loaders are deterministic and cacheable.
  7140. */
  7141. cacheable(flag?: boolean): void;
  7142. callback: (
  7143. err?: null | Error,
  7144. content?: string | Buffer,
  7145. sourceMap?: string | SourceMap,
  7146. additionalData?: AdditionalData
  7147. ) => void;
  7148. /**
  7149. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  7150. */
  7151. clearDependencies(): void;
  7152. /**
  7153. * The directory of the module. Can be used as context for resolving other stuff.
  7154. * eg '/workspaces/ts-loader/examples/vanilla/src'
  7155. */
  7156. context: string;
  7157. readonly currentRequest: string;
  7158. readonly data: any;
  7159. /**
  7160. * alias of addDependency
  7161. * Adds a file as dependency of the loader result in order to make them watchable.
  7162. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7163. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7164. */
  7165. dependency(file: string): void;
  7166. getContextDependencies(): string[];
  7167. getDependencies(): string[];
  7168. getMissingDependencies(): string[];
  7169. /**
  7170. * The index in the loaders array of the current loader.
  7171. * In the example: in loader1: 0, in loader2: 1
  7172. */
  7173. loaderIndex: number;
  7174. readonly previousRequest: string;
  7175. readonly query: string | OptionsType;
  7176. readonly remainingRequest: string;
  7177. readonly request: string;
  7178. /**
  7179. * An array of all the loaders. It is writeable in the pitch phase.
  7180. * loaders = [{request: string, path: string, query: string, module: function}]
  7181. * In the example:
  7182. * [
  7183. * { request: "/abc/loader1.js?xyz",
  7184. * path: "/abc/loader1.js",
  7185. * query: "?xyz",
  7186. * module: [Function]
  7187. * },
  7188. * { request: "/abc/node_modules/loader2/index.js",
  7189. * path: "/abc/node_modules/loader2/index.js",
  7190. * query: "",
  7191. * module: [Function]
  7192. * }
  7193. * ]
  7194. */
  7195. loaders: {
  7196. request: string;
  7197. path: string;
  7198. query: string;
  7199. fragment: string;
  7200. options?: string | object;
  7201. ident: string;
  7202. normal?: Function;
  7203. pitch?: Function;
  7204. raw?: boolean;
  7205. data?: object;
  7206. pitchExecuted: boolean;
  7207. normalExecuted: boolean;
  7208. type?: "module" | "commonjs";
  7209. }[];
  7210. /**
  7211. * The resource path.
  7212. * In the example: "/abc/resource.js"
  7213. */
  7214. resourcePath: string;
  7215. /**
  7216. * The resource query string.
  7217. * Example: "?query"
  7218. */
  7219. resourceQuery: string;
  7220. /**
  7221. * The resource fragment.
  7222. * Example: "#frag"
  7223. */
  7224. resourceFragment: string;
  7225. /**
  7226. * The resource inclusive query and fragment.
  7227. * Example: "/abc/resource.js?query#frag"
  7228. */
  7229. resource: string;
  7230. /**
  7231. * Target of compilation.
  7232. * Example: "web"
  7233. */
  7234. target: string;
  7235. /**
  7236. * Tell what kind of ES-features may be used in the generated runtime-code.
  7237. * Example: { arrowFunction: true }
  7238. */
  7239. environment: Environment;
  7240. }
  7241. declare class LoaderTargetPlugin {
  7242. constructor(target: string);
  7243. target: string;
  7244. /**
  7245. * Apply the plugin
  7246. */
  7247. apply(compiler: Compiler): void;
  7248. }
  7249. declare interface LogEntry {
  7250. type: string;
  7251. args: any[];
  7252. time: number;
  7253. trace?: string[];
  7254. }
  7255. type LogTypeEnum =
  7256. | "error"
  7257. | "warn"
  7258. | "info"
  7259. | "log"
  7260. | "debug"
  7261. | "profile"
  7262. | "trace"
  7263. | "group"
  7264. | "groupCollapsed"
  7265. | "groupEnd"
  7266. | "profileEnd"
  7267. | "time"
  7268. | "clear"
  7269. | "status";
  7270. declare const MEASURE_END_OPERATION: unique symbol;
  7271. declare const MEASURE_START_OPERATION: unique symbol;
  7272. declare interface MainRenderContext {
  7273. /**
  7274. * the chunk
  7275. */
  7276. chunk: Chunk;
  7277. /**
  7278. * the dependency templates
  7279. */
  7280. dependencyTemplates: DependencyTemplates;
  7281. /**
  7282. * the runtime template
  7283. */
  7284. runtimeTemplate: RuntimeTemplate;
  7285. /**
  7286. * the module graph
  7287. */
  7288. moduleGraph: ModuleGraph;
  7289. /**
  7290. * the chunk graph
  7291. */
  7292. chunkGraph: ChunkGraph;
  7293. /**
  7294. * results of code generation
  7295. */
  7296. codeGenerationResults: CodeGenerationResults;
  7297. /**
  7298. * hash to be used for render call
  7299. */
  7300. hash: string;
  7301. /**
  7302. * rendering in strict context
  7303. */
  7304. strictMode: boolean;
  7305. }
  7306. declare abstract class MainTemplate {
  7307. hooks: Readonly<{
  7308. renderManifest: { tap: (options?: any, fn?: any) => void };
  7309. modules: { tap: () => never };
  7310. moduleObj: { tap: () => never };
  7311. require: { tap: (options?: any, fn?: any) => void };
  7312. beforeStartup: { tap: () => never };
  7313. startup: { tap: () => never };
  7314. afterStartup: { tap: () => never };
  7315. render: { tap: (options?: any, fn?: any) => void };
  7316. renderWithEntry: { tap: (options?: any, fn?: any) => void };
  7317. assetPath: {
  7318. tap: (options?: any, fn?: any) => void;
  7319. call: (filename?: any, options?: any) => string;
  7320. };
  7321. hash: { tap: (options?: any, fn?: any) => void };
  7322. hashForChunk: { tap: (options?: any, fn?: any) => void };
  7323. globalHashPaths: { tap: () => void };
  7324. globalHash: { tap: () => void };
  7325. hotBootstrap: { tap: () => never };
  7326. bootstrap: SyncWaterfallHook<
  7327. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  7328. >;
  7329. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  7330. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  7331. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  7332. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  7333. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  7334. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  7335. }>;
  7336. renderCurrentHashCode: (hash: string, length?: number) => string;
  7337. getPublicPath: (options: object) => string;
  7338. getAssetPath: (path?: any, options?: any) => string;
  7339. getAssetPathWithInfo: (
  7340. path?: any,
  7341. options?: any
  7342. ) => { path: string; info: AssetInfo };
  7343. get requireFn(): "__webpack_require__";
  7344. get outputOptions(): Output;
  7345. }
  7346. declare interface MakeDirectoryOptions {
  7347. recursive?: boolean;
  7348. mode?: string | number;
  7349. }
  7350. declare interface MapOptions {
  7351. columns?: boolean;
  7352. module?: boolean;
  7353. }
  7354. declare interface MatchObject {
  7355. test?: string | RegExp | (string | RegExp)[];
  7356. include?: string | RegExp | (string | RegExp)[];
  7357. exclude?: string | RegExp | (string | RegExp)[];
  7358. }
  7359. type Matcher = string | RegExp | (string | RegExp)[];
  7360. /**
  7361. * Options object for in-memory caching.
  7362. */
  7363. declare interface MemoryCacheOptions {
  7364. /**
  7365. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  7366. */
  7367. cacheUnaffected?: boolean;
  7368. /**
  7369. * 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).
  7370. */
  7371. maxGenerations?: number;
  7372. /**
  7373. * In memory caching.
  7374. */
  7375. type: "memory";
  7376. }
  7377. declare class MemoryCachePlugin {
  7378. constructor();
  7379. /**
  7380. * Apply the plugin
  7381. */
  7382. apply(compiler: Compiler): void;
  7383. }
  7384. declare class MinChunkSizePlugin {
  7385. constructor(options: MinChunkSizePluginOptions);
  7386. options: MinChunkSizePluginOptions;
  7387. /**
  7388. * Apply the plugin
  7389. */
  7390. apply(compiler: Compiler): void;
  7391. }
  7392. declare interface MinChunkSizePluginOptions {
  7393. /**
  7394. * Constant overhead for a chunk.
  7395. */
  7396. chunkOverhead?: number;
  7397. /**
  7398. * Multiplicator for initial chunks.
  7399. */
  7400. entryChunkMultiplicator?: number;
  7401. /**
  7402. * Minimum number of characters.
  7403. */
  7404. minChunkSize: number;
  7405. }
  7406. declare interface Mkdir {
  7407. (
  7408. file: PathLikeFs,
  7409. options: MakeDirectoryOptions & { recursive: true },
  7410. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  7411. ): void;
  7412. (
  7413. file: PathLikeFs,
  7414. options:
  7415. | undefined
  7416. | null
  7417. | string
  7418. | number
  7419. | (MakeDirectoryOptions & { recursive?: false }),
  7420. callback: (arg0: null | NodeJS.ErrnoException) => void
  7421. ): void;
  7422. (
  7423. file: PathLikeFs,
  7424. options: undefined | null | string | number | MakeDirectoryOptions,
  7425. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  7426. ): void;
  7427. (
  7428. file: PathLikeFs,
  7429. callback: (arg0: null | NodeJS.ErrnoException) => void
  7430. ): void;
  7431. }
  7432. declare interface MkdirSync {
  7433. (
  7434. path: PathLikeFs,
  7435. options: MakeDirectoryOptions & { recursive: true }
  7436. ): undefined | string;
  7437. (
  7438. path: PathLikeFs,
  7439. options?:
  7440. | null
  7441. | string
  7442. | number
  7443. | (MakeDirectoryOptions & { recursive?: false })
  7444. ): void;
  7445. (
  7446. path: PathLikeFs,
  7447. options?: null | string | number | MakeDirectoryOptions
  7448. ): undefined | string;
  7449. }
  7450. declare class Module extends DependenciesBlock {
  7451. constructor(type: string, context?: null | string, layer?: null | string);
  7452. type: string;
  7453. context: null | string;
  7454. layer: null | string;
  7455. needId: boolean;
  7456. debugId: number;
  7457. resolveOptions?: ResolveOptions;
  7458. factoryMeta?: FactoryMeta;
  7459. useSourceMap: boolean;
  7460. useSimpleSourceMap: boolean;
  7461. buildMeta?: BuildMeta;
  7462. buildInfo?: BuildInfo;
  7463. presentationalDependencies?: Dependency[];
  7464. codeGenerationDependencies?: Dependency[];
  7465. id: ModuleId;
  7466. get hash(): string;
  7467. get renderedHash(): string;
  7468. profile?: ModuleProfile;
  7469. index: null | number;
  7470. index2: null | number;
  7471. depth: null | number;
  7472. issuer?: null | Module;
  7473. get usedExports(): null | boolean | SortableSet<string>;
  7474. get optimizationBailout(): (
  7475. | string
  7476. | ((requestShortener: RequestShortener) => string)
  7477. )[];
  7478. get optional(): boolean;
  7479. addChunk(chunk: Chunk): boolean;
  7480. removeChunk(chunk: Chunk): void;
  7481. isInChunk(chunk: Chunk): boolean;
  7482. isEntryModule(): boolean;
  7483. getChunks(): Chunk[];
  7484. getNumberOfChunks(): number;
  7485. get chunksIterable(): Iterable<Chunk>;
  7486. isProvided(exportName: string): null | boolean;
  7487. get exportsArgument(): string;
  7488. get moduleArgument(): string;
  7489. getExportsType(
  7490. moduleGraph: ModuleGraph,
  7491. strict?: boolean
  7492. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  7493. addPresentationalDependency(presentationalDependency: Dependency): void;
  7494. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  7495. addWarning(warning: WebpackError): void;
  7496. getWarnings(): undefined | Iterable<WebpackError>;
  7497. getNumberOfWarnings(): number;
  7498. addError(error: WebpackError): void;
  7499. getErrors(): undefined | Iterable<WebpackError>;
  7500. getNumberOfErrors(): number;
  7501. /**
  7502. * removes all warnings and errors
  7503. */
  7504. clearWarningsAndErrors(): void;
  7505. isOptional(moduleGraph: ModuleGraph): boolean;
  7506. isAccessibleInChunk(
  7507. chunkGraph: ChunkGraph,
  7508. chunk: Chunk,
  7509. ignoreChunk?: Chunk
  7510. ): boolean;
  7511. isAccessibleInChunkGroup(
  7512. chunkGraph: ChunkGraph,
  7513. chunkGroup: ChunkGroup,
  7514. ignoreChunk?: Chunk
  7515. ): boolean;
  7516. hasReasonForChunk(
  7517. chunk: Chunk,
  7518. moduleGraph: ModuleGraph,
  7519. chunkGraph: ChunkGraph
  7520. ): boolean;
  7521. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  7522. needBuild(
  7523. context: NeedBuildContext,
  7524. callback: (arg0?: null | WebpackError, arg1?: boolean) => void
  7525. ): void;
  7526. needRebuild(
  7527. fileTimestamps: Map<string, null | number>,
  7528. contextTimestamps: Map<string, null | number>
  7529. ): boolean;
  7530. invalidateBuild(): void;
  7531. identifier(): string;
  7532. readableIdentifier(requestShortener: RequestShortener): string;
  7533. build(
  7534. options: WebpackOptionsNormalized,
  7535. compilation: Compilation,
  7536. resolver: ResolverWithOptions,
  7537. fs: InputFileSystem,
  7538. callback: (arg0?: WebpackError) => void
  7539. ): void;
  7540. getSourceTypes(): Set<string>;
  7541. source(
  7542. dependencyTemplates: DependencyTemplates,
  7543. runtimeTemplate: RuntimeTemplate,
  7544. type?: string
  7545. ): Source;
  7546. size(type?: string): number;
  7547. libIdent(options: LibIdentOptions): null | string;
  7548. nameForCondition(): null | string;
  7549. getConcatenationBailoutReason(
  7550. context: ConcatenationBailoutReasonContext
  7551. ): undefined | string;
  7552. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  7553. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  7554. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  7555. hasChunkCondition(): boolean;
  7556. /**
  7557. * Assuming this module is in the cache. Update the (cached) module with
  7558. * the fresh module from the factory. Usually updates internal references
  7559. * and properties.
  7560. */
  7561. updateCacheModule(module: Module): void;
  7562. /**
  7563. * Module should be unsafe cached. Get data that's needed for that.
  7564. * This data will be passed to restoreFromUnsafeCache later.
  7565. */
  7566. getUnsafeCacheData(): UnsafeCacheData;
  7567. /**
  7568. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  7569. */
  7570. cleanupForCache(): void;
  7571. originalSource(): null | Source;
  7572. addCacheDependencies(
  7573. fileDependencies: LazySet<string>,
  7574. contextDependencies: LazySet<string>,
  7575. missingDependencies: LazySet<string>,
  7576. buildDependencies: LazySet<string>
  7577. ): void;
  7578. get hasEqualsChunks(): any;
  7579. get isUsed(): any;
  7580. get errors(): any;
  7581. get warnings(): any;
  7582. used: any;
  7583. }
  7584. declare class ModuleConcatenationPlugin {
  7585. constructor(options?: any);
  7586. options: any;
  7587. /**
  7588. * Apply the plugin
  7589. */
  7590. apply(compiler: Compiler): void;
  7591. }
  7592. declare class ModuleDependency extends Dependency {
  7593. constructor(request: string);
  7594. request: string;
  7595. userRequest: string;
  7596. range: any;
  7597. assertions?: ImportAttributes;
  7598. static Template: typeof DependencyTemplate;
  7599. static NO_EXPORTS_REFERENCED: string[][];
  7600. static EXPORTS_OBJECT_REFERENCED: string[][];
  7601. static TRANSITIVE: typeof TRANSITIVE;
  7602. }
  7603. declare abstract class ModuleFactory {
  7604. create(
  7605. data: ModuleFactoryCreateData,
  7606. callback: (arg0?: null | Error, arg1?: ModuleFactoryResult) => void
  7607. ): void;
  7608. }
  7609. declare interface ModuleFactoryCreateData {
  7610. contextInfo: ModuleFactoryCreateDataContextInfo;
  7611. resolveOptions?: ResolveOptions;
  7612. context: string;
  7613. dependencies: Dependency[];
  7614. }
  7615. declare interface ModuleFactoryCreateDataContextInfo {
  7616. issuer: string;
  7617. issuerLayer?: null | string;
  7618. compiler: string;
  7619. }
  7620. declare interface ModuleFactoryResult {
  7621. /**
  7622. * the created module or unset if no module was created
  7623. */
  7624. module?: Module;
  7625. fileDependencies?: Set<string>;
  7626. contextDependencies?: Set<string>;
  7627. missingDependencies?: Set<string>;
  7628. /**
  7629. * allow to use the unsafe cache
  7630. */
  7631. cacheable?: boolean;
  7632. }
  7633. declare class ModuleFederationPlugin {
  7634. constructor(options: ModuleFederationPluginOptions);
  7635. /**
  7636. * Apply the plugin
  7637. */
  7638. apply(compiler: Compiler): void;
  7639. }
  7640. declare interface ModuleFederationPluginOptions {
  7641. /**
  7642. * 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.
  7643. */
  7644. exposes?: (string | ExposesObject)[] | ExposesObject;
  7645. /**
  7646. * The filename of the container as relative path inside the `output.path` directory.
  7647. */
  7648. filename?: string;
  7649. /**
  7650. * Options for library.
  7651. */
  7652. library?: LibraryOptions;
  7653. /**
  7654. * The name of the container.
  7655. */
  7656. name?: string;
  7657. /**
  7658. * The external type of the remote containers.
  7659. */
  7660. remoteType?:
  7661. | "import"
  7662. | "var"
  7663. | "module"
  7664. | "assign"
  7665. | "this"
  7666. | "window"
  7667. | "self"
  7668. | "global"
  7669. | "commonjs"
  7670. | "commonjs2"
  7671. | "commonjs-module"
  7672. | "commonjs-static"
  7673. | "amd"
  7674. | "amd-require"
  7675. | "umd"
  7676. | "umd2"
  7677. | "jsonp"
  7678. | "system"
  7679. | "promise"
  7680. | "script"
  7681. | "node-commonjs";
  7682. /**
  7683. * 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.
  7684. */
  7685. remotes?: (string | RemotesObject)[] | RemotesObject;
  7686. /**
  7687. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  7688. */
  7689. runtime?: string | false;
  7690. /**
  7691. * Share scope name used for all shared modules (defaults to 'default').
  7692. */
  7693. shareScope?: string;
  7694. /**
  7695. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  7696. */
  7697. shared?: (string | SharedObject)[] | SharedObject;
  7698. }
  7699. type ModuleFilterItemTypes =
  7700. | string
  7701. | RegExp
  7702. | ((
  7703. name: string,
  7704. module: StatsModule,
  7705. type: "module" | "chunk" | "root-of-chunk" | "nested"
  7706. ) => boolean);
  7707. declare class ModuleGraph {
  7708. constructor();
  7709. setParents(
  7710. dependency: Dependency,
  7711. block: DependenciesBlock,
  7712. module: Module,
  7713. indexInBlock?: number
  7714. ): void;
  7715. getParentModule(dependency: Dependency): undefined | Module;
  7716. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  7717. getParentBlockIndex(dependency: Dependency): number;
  7718. setResolvedModule(
  7719. originModule: null | Module,
  7720. dependency: Dependency,
  7721. module: Module
  7722. ): void;
  7723. updateModule(dependency: Dependency, module: Module): void;
  7724. removeConnection(dependency: Dependency): void;
  7725. addExplanation(dependency: Dependency, explanation: string): void;
  7726. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  7727. removeModuleAttributes(module: Module): void;
  7728. removeAllModuleAttributes(): void;
  7729. moveModuleConnections(
  7730. oldModule: Module,
  7731. newModule: Module,
  7732. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7733. ): void;
  7734. copyOutgoingModuleConnections(
  7735. oldModule: Module,
  7736. newModule: Module,
  7737. filterConnection: (arg0: ModuleGraphConnection) => boolean
  7738. ): void;
  7739. addExtraReason(module: Module, explanation: string): void;
  7740. getResolvedModule(dependency: Dependency): null | Module;
  7741. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  7742. getModule(dependency: Dependency): null | Module;
  7743. getOrigin(dependency: Dependency): null | Module;
  7744. getResolvedOrigin(dependency: Dependency): null | Module;
  7745. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7746. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  7747. getIncomingConnectionsByOriginModule(
  7748. module: Module
  7749. ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
  7750. getOutgoingConnectionsByModule(
  7751. module: Module
  7752. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  7753. getProfile(module: Module): undefined | ModuleProfile;
  7754. setProfile(module: Module, profile?: ModuleProfile): void;
  7755. getIssuer(module: Module): undefined | null | Module;
  7756. setIssuer(module: Module, issuer: null | Module): void;
  7757. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  7758. getOptimizationBailout(
  7759. module: Module
  7760. ): (string | ((requestShortener: RequestShortener) => string))[];
  7761. getProvidedExports(module: Module): null | true | string[];
  7762. isExportProvided(
  7763. module: Module,
  7764. exportName: string | string[]
  7765. ): null | boolean;
  7766. getExportsInfo(module: Module): ExportsInfo;
  7767. getExportInfo(module: Module, exportName: string): ExportInfo;
  7768. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  7769. getUsedExports(
  7770. module: Module,
  7771. runtime: RuntimeSpec
  7772. ): null | boolean | SortableSet<string>;
  7773. getPreOrderIndex(module: Module): null | number;
  7774. getPostOrderIndex(module: Module): null | number;
  7775. setPreOrderIndex(module: Module, index: number): void;
  7776. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  7777. setPostOrderIndex(module: Module, index: number): void;
  7778. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  7779. getDepth(module: Module): null | number;
  7780. setDepth(module: Module, depth: number): void;
  7781. setDepthIfLower(module: Module, depth: number): boolean;
  7782. isAsync(module: Module): boolean;
  7783. setAsync(module: Module): void;
  7784. getMeta(thing?: any): object;
  7785. getMetaIfExisting(thing?: any): undefined | object;
  7786. freeze(cacheStage?: string): void;
  7787. unfreeze(): void;
  7788. cached<T extends any[], V>(
  7789. fn: (moduleGraph: ModuleGraph, ...args: T) => V,
  7790. ...args: T
  7791. ): V;
  7792. setModuleMemCaches(
  7793. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  7794. ): void;
  7795. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  7796. static getModuleGraphForModule(
  7797. module: Module,
  7798. deprecateMessage: string,
  7799. deprecationCode: string
  7800. ): ModuleGraph;
  7801. static setModuleGraphForModule(
  7802. module: Module,
  7803. moduleGraph: ModuleGraph
  7804. ): void;
  7805. static clearModuleGraphForModule(module: Module): void;
  7806. static ModuleGraphConnection: typeof ModuleGraphConnection;
  7807. }
  7808. declare class ModuleGraphConnection {
  7809. constructor(
  7810. originModule: null | Module,
  7811. dependency: null | Dependency,
  7812. module: Module,
  7813. explanation?: string,
  7814. weak?: boolean,
  7815. condition?:
  7816. | null
  7817. | false
  7818. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState)
  7819. );
  7820. originModule: null | Module;
  7821. resolvedOriginModule: null | Module;
  7822. dependency: null | Dependency;
  7823. resolvedModule: Module;
  7824. module: Module;
  7825. weak: boolean;
  7826. conditional: boolean;
  7827. condition?: (
  7828. arg0: ModuleGraphConnection,
  7829. arg1: RuntimeSpec
  7830. ) => ConnectionState;
  7831. explanations?: Set<string>;
  7832. clone(): ModuleGraphConnection;
  7833. addCondition(
  7834. condition: (
  7835. arg0: ModuleGraphConnection,
  7836. arg1: RuntimeSpec
  7837. ) => ConnectionState
  7838. ): void;
  7839. addExplanation(explanation: string): void;
  7840. get explanation(): string;
  7841. active: void;
  7842. isActive(runtime: RuntimeSpec): boolean;
  7843. isTargetActive(runtime: RuntimeSpec): boolean;
  7844. getActiveState(runtime: RuntimeSpec): ConnectionState;
  7845. setActive(value: boolean): void;
  7846. static addConnectionStates: (
  7847. a: ConnectionState,
  7848. b: ConnectionState
  7849. ) => ConnectionState;
  7850. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  7851. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  7852. }
  7853. type ModuleId = string | number;
  7854. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  7855. /**
  7856. * Options affecting the normal modules (`NormalModuleFactory`).
  7857. */
  7858. declare interface ModuleOptions {
  7859. /**
  7860. * An array of rules applied by default for modules.
  7861. */
  7862. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7863. /**
  7864. * Enable warnings for full dynamic dependencies.
  7865. */
  7866. exprContextCritical?: boolean;
  7867. /**
  7868. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  7869. */
  7870. exprContextRecursive?: boolean;
  7871. /**
  7872. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  7873. */
  7874. exprContextRegExp?: boolean | RegExp;
  7875. /**
  7876. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  7877. */
  7878. exprContextRequest?: string;
  7879. /**
  7880. * Specify options for each generator.
  7881. */
  7882. generator?: GeneratorOptionsByModuleType;
  7883. /**
  7884. * Don't parse files matching. It's matched against the full resolved request.
  7885. */
  7886. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7887. /**
  7888. * Specify options for each parser.
  7889. */
  7890. parser?: ParserOptionsByModuleType;
  7891. /**
  7892. * An array of rules applied for modules.
  7893. */
  7894. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7895. /**
  7896. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  7897. */
  7898. strictExportPresence?: boolean;
  7899. /**
  7900. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  7901. */
  7902. strictThisContextOnImports?: boolean;
  7903. /**
  7904. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  7905. */
  7906. unknownContextCritical?: boolean;
  7907. /**
  7908. * 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'.
  7909. */
  7910. unknownContextRecursive?: boolean;
  7911. /**
  7912. * 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'.
  7913. */
  7914. unknownContextRegExp?: boolean | RegExp;
  7915. /**
  7916. * 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'.
  7917. */
  7918. unknownContextRequest?: string;
  7919. /**
  7920. * Cache the resolving of module requests.
  7921. */
  7922. unsafeCache?: boolean | Function;
  7923. /**
  7924. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  7925. */
  7926. wrappedContextCritical?: boolean;
  7927. /**
  7928. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  7929. */
  7930. wrappedContextRecursive?: boolean;
  7931. /**
  7932. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  7933. */
  7934. wrappedContextRegExp?: RegExp;
  7935. }
  7936. /**
  7937. * Options affecting the normal modules (`NormalModuleFactory`).
  7938. */
  7939. declare interface ModuleOptionsNormalized {
  7940. /**
  7941. * An array of rules applied by default for modules.
  7942. */
  7943. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7944. /**
  7945. * Specify options for each generator.
  7946. */
  7947. generator: GeneratorOptionsByModuleType;
  7948. /**
  7949. * Don't parse files matching. It's matched against the full resolved request.
  7950. */
  7951. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  7952. /**
  7953. * Specify options for each parser.
  7954. */
  7955. parser: ParserOptionsByModuleType;
  7956. /**
  7957. * An array of rules applied for modules.
  7958. */
  7959. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  7960. /**
  7961. * Cache the resolving of module requests.
  7962. */
  7963. unsafeCache?: boolean | Function;
  7964. }
  7965. declare interface ModulePathData {
  7966. id: string | number;
  7967. hash: string;
  7968. hashWithLength?: (arg0: number) => string;
  7969. }
  7970. declare abstract class ModuleProfile {
  7971. startTime: number;
  7972. factoryStartTime: number;
  7973. factoryEndTime: number;
  7974. factory: number;
  7975. factoryParallelismFactor: number;
  7976. restoringStartTime: number;
  7977. restoringEndTime: number;
  7978. restoring: number;
  7979. restoringParallelismFactor: number;
  7980. integrationStartTime: number;
  7981. integrationEndTime: number;
  7982. integration: number;
  7983. integrationParallelismFactor: number;
  7984. buildingStartTime: number;
  7985. buildingEndTime: number;
  7986. building: number;
  7987. buildingParallelismFactor: number;
  7988. storingStartTime: number;
  7989. storingEndTime: number;
  7990. storing: number;
  7991. storingParallelismFactor: number;
  7992. additionalFactoryTimes?: { start: number; end: number }[];
  7993. additionalFactories: number;
  7994. additionalFactoriesParallelismFactor: number;
  7995. additionalIntegration: number;
  7996. markFactoryStart(): void;
  7997. markFactoryEnd(): void;
  7998. markRestoringStart(): void;
  7999. markRestoringEnd(): void;
  8000. markIntegrationStart(): void;
  8001. markIntegrationEnd(): void;
  8002. markBuildingStart(): void;
  8003. markBuildingEnd(): void;
  8004. markStoringStart(): void;
  8005. markStoringEnd(): void;
  8006. /**
  8007. * Merge this profile into another one
  8008. */
  8009. mergeInto(realProfile: ModuleProfile): void;
  8010. }
  8011. declare interface ModuleReferenceOptions {
  8012. /**
  8013. * the properties/exports of the module
  8014. */
  8015. ids: string[];
  8016. /**
  8017. * true, when this referenced export is called
  8018. */
  8019. call: boolean;
  8020. /**
  8021. * true, when this referenced export is directly imported (not via property access)
  8022. */
  8023. directImport: boolean;
  8024. /**
  8025. * if the position is ASI safe or unknown
  8026. */
  8027. asiSafe?: boolean;
  8028. }
  8029. declare interface ModuleSettings {
  8030. /**
  8031. * Specifies the layer in which the module should be placed in.
  8032. */
  8033. layer?: string;
  8034. /**
  8035. * Module type to use for the module.
  8036. */
  8037. type?: string;
  8038. /**
  8039. * Options for the resolver.
  8040. */
  8041. resolve?: ResolveOptions;
  8042. /**
  8043. * Options for parsing.
  8044. */
  8045. parser?: { [index: string]: any };
  8046. /**
  8047. * The options for the module generator.
  8048. */
  8049. generator?: { [index: string]: any };
  8050. /**
  8051. * Flags a module as with or without side effects.
  8052. */
  8053. sideEffects?: boolean;
  8054. }
  8055. declare abstract class ModuleTemplate {
  8056. type: string;
  8057. hooks: Readonly<{
  8058. content: { tap: (options?: any, fn?: any) => void };
  8059. module: { tap: (options?: any, fn?: any) => void };
  8060. render: { tap: (options?: any, fn?: any) => void };
  8061. package: { tap: (options?: any, fn?: any) => void };
  8062. hash: { tap: (options?: any, fn?: any) => void };
  8063. }>;
  8064. get runtimeTemplate(): any;
  8065. }
  8066. declare interface ModuleTemplates {
  8067. javascript: ModuleTemplate;
  8068. }
  8069. declare class MultiCompiler {
  8070. constructor(
  8071. compilers: Compiler[] | Record<string, Compiler>,
  8072. options: MultiCompilerOptions
  8073. );
  8074. hooks: Readonly<{
  8075. done: SyncHook<[MultiStats]>;
  8076. invalid: MultiHook<SyncHook<[null | string, number]>>;
  8077. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8078. watchClose: SyncHook<[]>;
  8079. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  8080. infrastructureLog: MultiHook<SyncBailHook<[string, string, any[]], true>>;
  8081. }>;
  8082. compilers: Compiler[];
  8083. dependencies: WeakMap<Compiler, string[]>;
  8084. running: boolean;
  8085. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  8086. get outputPath(): string;
  8087. inputFileSystem: InputFileSystem;
  8088. outputFileSystem: OutputFileSystem;
  8089. watchFileSystem: WatchFileSystem;
  8090. intermediateFileSystem: IntermediateFileSystem;
  8091. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  8092. setDependencies(compiler: Compiler, dependencies: string[]): void;
  8093. validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
  8094. runWithDependencies(
  8095. compilers: Compiler[],
  8096. fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
  8097. callback: CallbackFunction_1<MultiStats>
  8098. ): void;
  8099. watch(
  8100. watchOptions: WatchOptions | WatchOptions[],
  8101. handler: CallbackFunction_1<MultiStats>
  8102. ): MultiWatching;
  8103. run(callback: CallbackFunction_1<MultiStats>): void;
  8104. purgeInputFileSystem(): void;
  8105. close(callback: CallbackFunction_1<void>): void;
  8106. }
  8107. declare interface MultiCompilerOptions {
  8108. /**
  8109. * how many Compilers are allows to run at the same time in parallel
  8110. */
  8111. parallelism?: number;
  8112. }
  8113. declare abstract class MultiStats {
  8114. stats: Stats[];
  8115. get hash(): string;
  8116. hasErrors(): boolean;
  8117. hasWarnings(): boolean;
  8118. toJson(options?: any): StatsCompilation;
  8119. toString(options?: any): string;
  8120. }
  8121. declare abstract class MultiWatching {
  8122. watchings: Watching[];
  8123. compiler: MultiCompiler;
  8124. invalidate(callback?: CallbackFunction_2<void>): void;
  8125. suspend(): void;
  8126. resume(): void;
  8127. close(callback: CallbackFunction_2<void>): void;
  8128. }
  8129. declare class NamedChunkIdsPlugin {
  8130. constructor(options?: NamedChunkIdsPluginOptions);
  8131. delimiter: string;
  8132. context?: string;
  8133. /**
  8134. * Apply the plugin
  8135. */
  8136. apply(compiler: Compiler): void;
  8137. }
  8138. declare interface NamedChunkIdsPluginOptions {
  8139. /**
  8140. * context
  8141. */
  8142. context?: string;
  8143. /**
  8144. * delimiter
  8145. */
  8146. delimiter?: string;
  8147. }
  8148. declare class NamedModuleIdsPlugin {
  8149. constructor(options?: NamedModuleIdsPluginOptions);
  8150. options: NamedModuleIdsPluginOptions;
  8151. /**
  8152. * Apply the plugin
  8153. */
  8154. apply(compiler: Compiler): void;
  8155. }
  8156. declare interface NamedModuleIdsPluginOptions {
  8157. /**
  8158. * context
  8159. */
  8160. context?: string;
  8161. }
  8162. declare class NaturalModuleIdsPlugin {
  8163. constructor();
  8164. /**
  8165. * Apply the plugin
  8166. */
  8167. apply(compiler: Compiler): void;
  8168. }
  8169. declare interface NeedBuildContext {
  8170. compilation: Compilation;
  8171. fileSystemInfo: FileSystemInfo;
  8172. valueCacheVersions: Map<string, string | Set<string>>;
  8173. }
  8174. declare class NoEmitOnErrorsPlugin {
  8175. constructor();
  8176. /**
  8177. * Apply the plugin
  8178. */
  8179. apply(compiler: Compiler): void;
  8180. }
  8181. type Node = false | NodeOptions;
  8182. declare class NodeEnvironmentPlugin {
  8183. constructor(options: {
  8184. /**
  8185. * infrastructure logging options
  8186. */
  8187. infrastructureLogging: InfrastructureLogging;
  8188. });
  8189. options: {
  8190. /**
  8191. * infrastructure logging options
  8192. */
  8193. infrastructureLogging: InfrastructureLogging;
  8194. };
  8195. /**
  8196. * Apply the plugin
  8197. */
  8198. apply(compiler: Compiler): void;
  8199. }
  8200. /**
  8201. * Options object for node compatibility features.
  8202. */
  8203. declare interface NodeOptions {
  8204. /**
  8205. * Include a polyfill for the '__dirname' variable.
  8206. */
  8207. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  8208. /**
  8209. * Include a polyfill for the '__filename' variable.
  8210. */
  8211. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  8212. /**
  8213. * Include a polyfill for the 'global' variable.
  8214. */
  8215. global?: boolean | "warn";
  8216. }
  8217. declare class NodeSourcePlugin {
  8218. constructor();
  8219. /**
  8220. * Apply the plugin
  8221. */
  8222. apply(compiler: Compiler): void;
  8223. }
  8224. declare class NodeTargetPlugin {
  8225. constructor();
  8226. /**
  8227. * Apply the plugin
  8228. */
  8229. apply(compiler: Compiler): void;
  8230. }
  8231. declare class NodeTemplatePlugin {
  8232. constructor(options?: NodeTemplatePluginOptions);
  8233. /**
  8234. * Apply the plugin
  8235. */
  8236. apply(compiler: Compiler): void;
  8237. }
  8238. declare interface NodeTemplatePluginOptions {
  8239. /**
  8240. * enable async chunk loading
  8241. */
  8242. asyncChunkLoading?: boolean;
  8243. }
  8244. declare class NormalModule extends Module {
  8245. constructor(__0: NormalModuleCreateData);
  8246. request: string;
  8247. userRequest: string;
  8248. rawRequest: string;
  8249. binary: boolean;
  8250. parser?: Parser;
  8251. parserOptions?: ParserOptions;
  8252. generator?: Generator;
  8253. generatorOptions?: GeneratorOptions;
  8254. resource: string;
  8255. resourceResolveData?: Record<string, any>;
  8256. matchResource?: string;
  8257. loaders: LoaderItem[];
  8258. error: null | WebpackError;
  8259. /**
  8260. * restore unsafe cache data
  8261. */
  8262. restoreFromUnsafeCache(
  8263. unsafeCacheData: NormalModuleUnsafeCacheData,
  8264. normalModuleFactory: NormalModuleFactory
  8265. ): void;
  8266. createSourceForAsset(
  8267. context: string,
  8268. name: string,
  8269. content: string | Buffer,
  8270. sourceMap?: string | SourceMap,
  8271. associatedObjectForCache?: object
  8272. ): Source;
  8273. getCurrentLoader(loaderContext?: any, index?: number): null | LoaderItem;
  8274. createSource(
  8275. context: string,
  8276. content: string | Buffer,
  8277. sourceMap?: string | SourceMapSource,
  8278. associatedObjectForCache?: object
  8279. ): Source;
  8280. markModuleAsErrored(error: WebpackError): void;
  8281. applyNoParseRule(rule: any, content: string): boolean;
  8282. shouldPreventParsing(noParseRule: any, request: string): boolean;
  8283. static getCompilationHooks(
  8284. compilation: Compilation
  8285. ): NormalModuleCompilationHooks;
  8286. static deserialize(context?: any): NormalModule;
  8287. }
  8288. declare interface NormalModuleCompilationHooks {
  8289. loader: SyncHook<[object, NormalModule]>;
  8290. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, object]>;
  8291. beforeParse: SyncHook<[NormalModule]>;
  8292. beforeSnapshot: SyncHook<[NormalModule]>;
  8293. readResourceForScheme: HookMap<
  8294. AsyncSeriesBailHook<[string, NormalModule], string | Buffer>
  8295. >;
  8296. readResource: HookMap<AsyncSeriesBailHook<[object], string | Buffer>>;
  8297. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  8298. }
  8299. declare interface NormalModuleCreateData {
  8300. /**
  8301. * an optional layer in which the module is
  8302. */
  8303. layer?: string;
  8304. /**
  8305. * module type. When deserializing, this is set to an empty string "".
  8306. */
  8307. type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
  8308. /**
  8309. * request string
  8310. */
  8311. request: string;
  8312. /**
  8313. * request intended by user (without loaders from config)
  8314. */
  8315. userRequest: string;
  8316. /**
  8317. * request without resolving
  8318. */
  8319. rawRequest: string;
  8320. /**
  8321. * list of loaders
  8322. */
  8323. loaders: LoaderItem[];
  8324. /**
  8325. * path + query of the real resource
  8326. */
  8327. resource: string;
  8328. /**
  8329. * resource resolve data
  8330. */
  8331. resourceResolveData?: Record<string, any>;
  8332. /**
  8333. * context directory for resolving
  8334. */
  8335. context: string;
  8336. /**
  8337. * path + query of the matched resource (virtual)
  8338. */
  8339. matchResource?: string;
  8340. /**
  8341. * the parser used
  8342. */
  8343. parser: Parser;
  8344. /**
  8345. * the options of the parser used
  8346. */
  8347. parserOptions?: ParserOptions;
  8348. /**
  8349. * the generator used
  8350. */
  8351. generator: Generator;
  8352. /**
  8353. * the options of the generator used
  8354. */
  8355. generatorOptions?: GeneratorOptions;
  8356. /**
  8357. * options used for resolving requests from this module
  8358. */
  8359. resolveOptions?: ResolveOptions;
  8360. }
  8361. declare abstract class NormalModuleFactory extends ModuleFactory {
  8362. hooks: Readonly<{
  8363. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  8364. resolveForScheme: HookMap<
  8365. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  8366. >;
  8367. resolveInScheme: HookMap<
  8368. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  8369. >;
  8370. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  8371. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  8372. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  8373. createModule: AsyncSeriesBailHook<
  8374. [
  8375. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  8376. ResolveData
  8377. ],
  8378. void | Module
  8379. >;
  8380. module: SyncWaterfallHook<
  8381. [
  8382. Module,
  8383. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  8384. ResolveData
  8385. ],
  8386. Module
  8387. >;
  8388. createParser: HookMap<SyncBailHook<[ParserOptions], Parser>>;
  8389. parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
  8390. createGenerator: HookMap<SyncBailHook<[GeneratorOptions], Generator>>;
  8391. generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
  8392. createModuleClass: HookMap<SyncBailHook<[any, ResolveData], Module>>;
  8393. }>;
  8394. resolverFactory: ResolverFactory;
  8395. ruleSet: RuleSet;
  8396. context: string;
  8397. fs: InputFileSystem;
  8398. parserCache: Map<string, WeakMap<object, Parser>>;
  8399. generatorCache: Map<string, WeakMap<object, Generator>>;
  8400. cleanupForCache(): void;
  8401. resolveResource(
  8402. contextInfo: ModuleFactoryCreateDataContextInfo,
  8403. context: string,
  8404. unresolvedResource: string,
  8405. resolver: ResolverWithOptions,
  8406. resolveContext: ResolveContext,
  8407. callback: (
  8408. err: null | Error,
  8409. res?: string | false,
  8410. req?: ResolveRequest
  8411. ) => void
  8412. ): void;
  8413. resolveRequestArray(
  8414. contextInfo: ModuleFactoryCreateDataContextInfo,
  8415. context: string,
  8416. array: LoaderItem[],
  8417. resolver: ResolverWithOptions,
  8418. resolveContext: ResolveContext,
  8419. callback: CallbackNormalModuleFactory<LoaderItem[]>
  8420. ): void;
  8421. getParser(type: string, parserOptions?: ParserOptions): Parser;
  8422. createParser(type: string, parserOptions?: ParserOptions): Parser;
  8423. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  8424. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  8425. getResolver(
  8426. type: string,
  8427. resolveOptions?: ResolveOptionsWithDependencyType
  8428. ): ResolverWithOptions;
  8429. }
  8430. /**
  8431. * These properties are added by the NormalModule
  8432. */
  8433. declare interface NormalModuleLoaderContext<OptionsType> {
  8434. version: number;
  8435. getOptions(): OptionsType;
  8436. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  8437. emitWarning(warning: Error): void;
  8438. emitError(error: Error): void;
  8439. getLogger(name?: string): WebpackLogger;
  8440. resolve(
  8441. context: string,
  8442. request: string,
  8443. callback: (
  8444. err: null | ErrorWithDetail,
  8445. res?: string | false,
  8446. req?: ResolveRequest
  8447. ) => void
  8448. ): any;
  8449. getResolve(options?: ResolveOptionsWithDependencyType): {
  8450. (
  8451. context: string,
  8452. request: string,
  8453. callback: (
  8454. err: null | ErrorWithDetail,
  8455. res?: string | false,
  8456. req?: ResolveRequest
  8457. ) => void
  8458. ): void;
  8459. (context: string, request: string): Promise<string>;
  8460. };
  8461. emitFile(
  8462. name: string,
  8463. content: string | Buffer,
  8464. sourceMap?: string,
  8465. assetInfo?: AssetInfo
  8466. ): void;
  8467. addBuildDependency(dep: string): void;
  8468. utils: {
  8469. absolutify: (context: string, request: string) => string;
  8470. contextify: (context: string, request: string) => string;
  8471. createHash: (algorithm?: string | typeof Hash) => Hash;
  8472. };
  8473. rootContext: string;
  8474. fs: InputFileSystem;
  8475. sourceMap?: boolean;
  8476. mode: "none" | "development" | "production";
  8477. webpack?: boolean;
  8478. _module?: NormalModule;
  8479. _compilation?: Compilation;
  8480. _compiler?: Compiler;
  8481. }
  8482. declare class NormalModuleReplacementPlugin {
  8483. /**
  8484. * Create an instance of the plugin
  8485. */
  8486. constructor(
  8487. resourceRegExp: RegExp,
  8488. newResource: string | ((arg0: ResolveData) => void)
  8489. );
  8490. resourceRegExp: RegExp;
  8491. newResource: string | ((arg0: ResolveData) => void);
  8492. /**
  8493. * Apply the plugin
  8494. */
  8495. apply(compiler: Compiler): void;
  8496. }
  8497. type NormalModuleUnsafeCacheData = UnsafeCacheData & {
  8498. parser?: Parser;
  8499. parserOptions?: ParserOptions;
  8500. generator?: Generator;
  8501. generatorOptions?: GeneratorOptions;
  8502. };
  8503. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  8504. Omit<
  8505. StatsOptions,
  8506. | "context"
  8507. | "chunkGroups"
  8508. | "requestShortener"
  8509. | "chunksSort"
  8510. | "modulesSort"
  8511. | "chunkModulesSort"
  8512. | "nestedModulesSort"
  8513. | "assetsSort"
  8514. | "ids"
  8515. | "cachedAssets"
  8516. | "groupAssetsByEmitStatus"
  8517. | "groupAssetsByPath"
  8518. | "groupAssetsByExtension"
  8519. | "assetsSpace"
  8520. | "excludeAssets"
  8521. | "excludeModules"
  8522. | "warningsFilter"
  8523. | "cachedModules"
  8524. | "orphanModules"
  8525. | "dependentModules"
  8526. | "runtimeModules"
  8527. | "groupModulesByCacheStatus"
  8528. | "groupModulesByLayer"
  8529. | "groupModulesByAttributes"
  8530. | "groupModulesByPath"
  8531. | "groupModulesByExtension"
  8532. | "groupModulesByType"
  8533. | "entrypoints"
  8534. | "chunkGroupAuxiliary"
  8535. | "chunkGroupChildren"
  8536. | "chunkGroupMaxAssets"
  8537. | "modulesSpace"
  8538. | "chunkModulesSpace"
  8539. | "nestedModulesSpace"
  8540. | "logging"
  8541. | "loggingDebug"
  8542. | "loggingTrace"
  8543. | "_env"
  8544. > &
  8545. Record<string, any>;
  8546. declare class NullDependency extends Dependency {
  8547. constructor();
  8548. static Template: typeof NullDependencyTemplate;
  8549. static NO_EXPORTS_REFERENCED: string[][];
  8550. static EXPORTS_OBJECT_REFERENCED: string[][];
  8551. static TRANSITIVE: typeof TRANSITIVE;
  8552. }
  8553. declare class NullDependencyTemplate extends DependencyTemplate {
  8554. constructor();
  8555. }
  8556. declare interface ObjectDeserializerContext {
  8557. read: () => any;
  8558. setCircularReference: (arg0?: any) => void;
  8559. }
  8560. declare interface ObjectEncodingOptions {
  8561. encoding?:
  8562. | null
  8563. | "ascii"
  8564. | "utf8"
  8565. | "utf-8"
  8566. | "utf16le"
  8567. | "utf-16le"
  8568. | "ucs2"
  8569. | "ucs-2"
  8570. | "latin1"
  8571. | "binary"
  8572. | "base64"
  8573. | "base64url"
  8574. | "hex";
  8575. }
  8576. declare interface ObjectSerializer {
  8577. serialize: (arg0: any, arg1: ObjectSerializerContext) => void;
  8578. deserialize: (arg0: ObjectDeserializerContext) => any;
  8579. }
  8580. declare interface ObjectSerializerContext {
  8581. write: (arg0?: any) => void;
  8582. writeLazy?: (arg0?: any) => void;
  8583. writeSeparate?: (arg0: any, arg1?: object) => () => any;
  8584. setCircularReference: (arg0?: any) => void;
  8585. }
  8586. declare class OccurrenceChunkIdsPlugin {
  8587. constructor(options?: OccurrenceChunkIdsPluginOptions);
  8588. options: OccurrenceChunkIdsPluginOptions;
  8589. /**
  8590. * Apply the plugin
  8591. */
  8592. apply(compiler: Compiler): void;
  8593. }
  8594. declare interface OccurrenceChunkIdsPluginOptions {
  8595. /**
  8596. * Prioritise initial size over total size.
  8597. */
  8598. prioritiseInitial?: boolean;
  8599. }
  8600. declare class OccurrenceModuleIdsPlugin {
  8601. constructor(options?: OccurrenceModuleIdsPluginOptions);
  8602. options: OccurrenceModuleIdsPluginOptions;
  8603. /**
  8604. * Apply the plugin
  8605. */
  8606. apply(compiler: Compiler): void;
  8607. }
  8608. declare interface OccurrenceModuleIdsPluginOptions {
  8609. /**
  8610. * Prioritise initial size over total size.
  8611. */
  8612. prioritiseInitial?: boolean;
  8613. }
  8614. declare interface Open {
  8615. (
  8616. file: PathLikeFs,
  8617. flags: undefined | string | number,
  8618. mode: undefined | null | string | number,
  8619. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8620. ): void;
  8621. (
  8622. file: PathLikeFs,
  8623. flags: undefined | string | number,
  8624. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8625. ): void;
  8626. (
  8627. file: PathLikeFs,
  8628. callback: (arg0: null | NodeJS.ErrnoException, arg1?: number) => void
  8629. ): void;
  8630. }
  8631. /**
  8632. * Enables/Disables integrated optimizations.
  8633. */
  8634. declare interface Optimization {
  8635. /**
  8636. * Check for incompatible wasm types when importing/exporting from/to ESM.
  8637. */
  8638. checkWasmTypes?: boolean;
  8639. /**
  8640. * 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).
  8641. */
  8642. chunkIds?:
  8643. | false
  8644. | "natural"
  8645. | "named"
  8646. | "deterministic"
  8647. | "size"
  8648. | "total-size";
  8649. /**
  8650. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  8651. */
  8652. concatenateModules?: boolean;
  8653. /**
  8654. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  8655. */
  8656. emitOnErrors?: boolean;
  8657. /**
  8658. * Also flag chunks as loaded which contain a subset of the modules.
  8659. */
  8660. flagIncludedChunks?: boolean;
  8661. /**
  8662. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  8663. */
  8664. innerGraph?: boolean;
  8665. /**
  8666. * 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).
  8667. */
  8668. mangleExports?: boolean | "deterministic" | "size";
  8669. /**
  8670. * Reduce size of WASM by changing imports to shorter strings.
  8671. */
  8672. mangleWasmImports?: boolean;
  8673. /**
  8674. * Merge chunks which contain the same modules.
  8675. */
  8676. mergeDuplicateChunks?: boolean;
  8677. /**
  8678. * Enable minimizing the output. Uses optimization.minimizer.
  8679. */
  8680. minimize?: boolean;
  8681. /**
  8682. * Minimizer(s) to use for minimizing the output.
  8683. */
  8684. minimizer?: (
  8685. | undefined
  8686. | null
  8687. | false
  8688. | ""
  8689. | 0
  8690. | ((this: Compiler, compiler: Compiler) => void)
  8691. | WebpackPluginInstance
  8692. | "..."
  8693. )[];
  8694. /**
  8695. * 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).
  8696. */
  8697. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  8698. /**
  8699. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  8700. */
  8701. noEmitOnErrors?: boolean;
  8702. /**
  8703. * Set process.env.NODE_ENV to a specific value.
  8704. */
  8705. nodeEnv?: string | false;
  8706. /**
  8707. * Generate records with relative paths to be able to move the context folder.
  8708. */
  8709. portableRecords?: boolean;
  8710. /**
  8711. * Figure out which exports are provided by modules to generate more efficient code.
  8712. */
  8713. providedExports?: boolean;
  8714. /**
  8715. * Use real [contenthash] based on final content of the assets.
  8716. */
  8717. realContentHash?: boolean;
  8718. /**
  8719. * Removes modules from chunks when these modules are already included in all parents.
  8720. */
  8721. removeAvailableModules?: boolean;
  8722. /**
  8723. * Remove chunks which are empty.
  8724. */
  8725. removeEmptyChunks?: boolean;
  8726. /**
  8727. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  8728. */
  8729. runtimeChunk?:
  8730. | boolean
  8731. | "single"
  8732. | "multiple"
  8733. | {
  8734. /**
  8735. * The name or name factory for the runtime chunks.
  8736. */
  8737. name?: string | Function;
  8738. };
  8739. /**
  8740. * 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).
  8741. */
  8742. sideEffects?: boolean | "flag";
  8743. /**
  8744. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  8745. */
  8746. splitChunks?: false | OptimizationSplitChunksOptions;
  8747. /**
  8748. * 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).
  8749. */
  8750. usedExports?: boolean | "global";
  8751. }
  8752. /**
  8753. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  8754. */
  8755. declare interface OptimizationSplitChunksCacheGroup {
  8756. /**
  8757. * Sets the name delimiter for created chunks.
  8758. */
  8759. automaticNameDelimiter?: string;
  8760. /**
  8761. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  8762. */
  8763. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8764. /**
  8765. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  8766. */
  8767. enforce?: boolean;
  8768. /**
  8769. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8770. */
  8771. enforceSizeThreshold?: number | { [index: string]: number };
  8772. /**
  8773. * Sets the template for the filename for created chunks.
  8774. */
  8775. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8776. /**
  8777. * Sets the hint for chunk id.
  8778. */
  8779. idHint?: string;
  8780. /**
  8781. * Assign modules to a cache group by module layer.
  8782. */
  8783. layer?: string | Function | RegExp;
  8784. /**
  8785. * Maximum number of requests which are accepted for on-demand loading.
  8786. */
  8787. maxAsyncRequests?: number;
  8788. /**
  8789. * Maximal size hint for the on-demand chunks.
  8790. */
  8791. maxAsyncSize?: number | { [index: string]: number };
  8792. /**
  8793. * Maximum number of initial chunks which are accepted for an entry point.
  8794. */
  8795. maxInitialRequests?: number;
  8796. /**
  8797. * Maximal size hint for the initial chunks.
  8798. */
  8799. maxInitialSize?: number | { [index: string]: number };
  8800. /**
  8801. * Maximal size hint for the created chunks.
  8802. */
  8803. maxSize?: number | { [index: string]: number };
  8804. /**
  8805. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8806. */
  8807. minChunks?: number;
  8808. /**
  8809. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8810. */
  8811. minRemainingSize?: number | { [index: string]: number };
  8812. /**
  8813. * Minimal size for the created chunk.
  8814. */
  8815. minSize?: number | { [index: string]: number };
  8816. /**
  8817. * Minimum size reduction due to the created chunk.
  8818. */
  8819. minSizeReduction?: number | { [index: string]: number };
  8820. /**
  8821. * Give chunks for this cache group a name (chunks with equal name are merged).
  8822. */
  8823. name?: string | false | Function;
  8824. /**
  8825. * Priority of this cache group.
  8826. */
  8827. priority?: number;
  8828. /**
  8829. * Try to reuse existing chunk (with name) when it has matching modules.
  8830. */
  8831. reuseExistingChunk?: boolean;
  8832. /**
  8833. * Assign modules to a cache group by module name.
  8834. */
  8835. test?: string | Function | RegExp;
  8836. /**
  8837. * Assign modules to a cache group by module type.
  8838. */
  8839. type?: string | Function | RegExp;
  8840. /**
  8841. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8842. */
  8843. usedExports?: boolean;
  8844. }
  8845. /**
  8846. * Options object for splitting chunks into smaller chunks.
  8847. */
  8848. declare interface OptimizationSplitChunksOptions {
  8849. /**
  8850. * Sets the name delimiter for created chunks.
  8851. */
  8852. automaticNameDelimiter?: string;
  8853. /**
  8854. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  8855. */
  8856. cacheGroups?: {
  8857. [index: string]:
  8858. | string
  8859. | false
  8860. | Function
  8861. | RegExp
  8862. | OptimizationSplitChunksCacheGroup;
  8863. };
  8864. /**
  8865. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8866. */
  8867. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8868. /**
  8869. * Sets the size types which are used when a number is used for sizes.
  8870. */
  8871. defaultSizeTypes?: string[];
  8872. /**
  8873. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  8874. */
  8875. enforceSizeThreshold?: number | { [index: string]: number };
  8876. /**
  8877. * Options for modules not selected by any other cache group.
  8878. */
  8879. fallbackCacheGroup?: {
  8880. /**
  8881. * Sets the name delimiter for created chunks.
  8882. */
  8883. automaticNameDelimiter?: string;
  8884. /**
  8885. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  8886. */
  8887. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  8888. /**
  8889. * Maximal size hint for the on-demand chunks.
  8890. */
  8891. maxAsyncSize?: number | { [index: string]: number };
  8892. /**
  8893. * Maximal size hint for the initial chunks.
  8894. */
  8895. maxInitialSize?: number | { [index: string]: number };
  8896. /**
  8897. * Maximal size hint for the created chunks.
  8898. */
  8899. maxSize?: number | { [index: string]: number };
  8900. /**
  8901. * Minimal size for the created chunk.
  8902. */
  8903. minSize?: number | { [index: string]: number };
  8904. /**
  8905. * Minimum size reduction due to the created chunk.
  8906. */
  8907. minSizeReduction?: number | { [index: string]: number };
  8908. };
  8909. /**
  8910. * Sets the template for the filename for created chunks.
  8911. */
  8912. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8913. /**
  8914. * Prevents exposing path info when creating names for parts splitted by maxSize.
  8915. */
  8916. hidePathInfo?: boolean;
  8917. /**
  8918. * Maximum number of requests which are accepted for on-demand loading.
  8919. */
  8920. maxAsyncRequests?: number;
  8921. /**
  8922. * Maximal size hint for the on-demand chunks.
  8923. */
  8924. maxAsyncSize?: number | { [index: string]: number };
  8925. /**
  8926. * Maximum number of initial chunks which are accepted for an entry point.
  8927. */
  8928. maxInitialRequests?: number;
  8929. /**
  8930. * Maximal size hint for the initial chunks.
  8931. */
  8932. maxInitialSize?: number | { [index: string]: number };
  8933. /**
  8934. * Maximal size hint for the created chunks.
  8935. */
  8936. maxSize?: number | { [index: string]: number };
  8937. /**
  8938. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  8939. */
  8940. minChunks?: number;
  8941. /**
  8942. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  8943. */
  8944. minRemainingSize?: number | { [index: string]: number };
  8945. /**
  8946. * Minimal size for the created chunks.
  8947. */
  8948. minSize?: number | { [index: string]: number };
  8949. /**
  8950. * Minimum size reduction due to the created chunk.
  8951. */
  8952. minSizeReduction?: number | { [index: string]: number };
  8953. /**
  8954. * Give chunks created a name (chunks with equal name are merged).
  8955. */
  8956. name?: string | false | Function;
  8957. /**
  8958. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  8959. */
  8960. usedExports?: boolean;
  8961. }
  8962. declare abstract class OptionsApply {
  8963. process(options?: any, compiler?: any): void;
  8964. }
  8965. declare interface OriginRecord {
  8966. module: Module;
  8967. loc: DependencyLocation;
  8968. request: string;
  8969. }
  8970. declare class OriginalSource extends Source {
  8971. constructor(source: string | Buffer, name: string);
  8972. getName(): string;
  8973. }
  8974. /**
  8975. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  8976. */
  8977. declare interface Output {
  8978. /**
  8979. * Add a container for define/require functions in the AMD module.
  8980. */
  8981. amdContainer?: string;
  8982. /**
  8983. * The filename of asset modules as relative path inside the 'output.path' directory.
  8984. */
  8985. assetModuleFilename?:
  8986. | string
  8987. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  8988. /**
  8989. * Enable/disable creating async chunks that are loaded on demand.
  8990. */
  8991. asyncChunks?: boolean;
  8992. /**
  8993. * Add a comment in the UMD wrapper.
  8994. */
  8995. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  8996. /**
  8997. * Add charset attribute for script tag.
  8998. */
  8999. charset?: boolean;
  9000. /**
  9001. * 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.
  9002. */
  9003. chunkFilename?:
  9004. | string
  9005. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9006. /**
  9007. * 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).
  9008. */
  9009. chunkFormat?: string | false;
  9010. /**
  9011. * Number of milliseconds before chunk request expires.
  9012. */
  9013. chunkLoadTimeout?: number;
  9014. /**
  9015. * 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).
  9016. */
  9017. chunkLoading?: string | false;
  9018. /**
  9019. * The global variable used by webpack for loading of chunks.
  9020. */
  9021. chunkLoadingGlobal?: string;
  9022. /**
  9023. * Clean the output directory before emit.
  9024. */
  9025. clean?: boolean | CleanOptions;
  9026. /**
  9027. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  9028. */
  9029. compareBeforeEmit?: boolean;
  9030. /**
  9031. * This option enables cross-origin loading of chunks.
  9032. */
  9033. crossOriginLoading?: false | "anonymous" | "use-credentials";
  9034. /**
  9035. * 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.
  9036. */
  9037. cssChunkFilename?:
  9038. | string
  9039. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9040. /**
  9041. * 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.
  9042. */
  9043. cssFilename?:
  9044. | string
  9045. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9046. /**
  9047. * Compress the data in the head tag of CSS files.
  9048. */
  9049. cssHeadDataCompression?: boolean;
  9050. /**
  9051. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  9052. */
  9053. devtoolFallbackModuleFilenameTemplate?: string | Function;
  9054. /**
  9055. * Filename template string of function for the sources array in a generated SourceMap.
  9056. */
  9057. devtoolModuleFilenameTemplate?: string | Function;
  9058. /**
  9059. * 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.
  9060. */
  9061. devtoolNamespace?: string;
  9062. /**
  9063. * List of chunk loading types enabled for use by entry points.
  9064. */
  9065. enabledChunkLoadingTypes?: string[];
  9066. /**
  9067. * List of library types enabled for use by entry points.
  9068. */
  9069. enabledLibraryTypes?: string[];
  9070. /**
  9071. * List of wasm loading types enabled for use by entry points.
  9072. */
  9073. enabledWasmLoadingTypes?: string[];
  9074. /**
  9075. * The abilities of the environment where the webpack generated code should run.
  9076. */
  9077. environment?: Environment;
  9078. /**
  9079. * 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.
  9080. */
  9081. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9082. /**
  9083. * An expression which is used to address the global object/scope in runtime code.
  9084. */
  9085. globalObject?: string;
  9086. /**
  9087. * Digest type used for the hash.
  9088. */
  9089. hashDigest?: string;
  9090. /**
  9091. * Number of chars which are used for the hash.
  9092. */
  9093. hashDigestLength?: number;
  9094. /**
  9095. * Algorithm used for generation the hash (see node.js crypto package).
  9096. */
  9097. hashFunction?: string | typeof Hash;
  9098. /**
  9099. * Any string which is added to the hash to salt it.
  9100. */
  9101. hashSalt?: string;
  9102. /**
  9103. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  9104. */
  9105. hotUpdateChunkFilename?: string;
  9106. /**
  9107. * The global variable used by webpack for loading of hot update chunks.
  9108. */
  9109. hotUpdateGlobal?: string;
  9110. /**
  9111. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  9112. */
  9113. hotUpdateMainFilename?: string;
  9114. /**
  9115. * Ignore warnings in the browser.
  9116. */
  9117. ignoreBrowserWarnings?: boolean;
  9118. /**
  9119. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  9120. */
  9121. iife?: boolean;
  9122. /**
  9123. * The name of the native import() function (can be exchanged for a polyfill).
  9124. */
  9125. importFunctionName?: string;
  9126. /**
  9127. * The name of the native import.meta object (can be exchanged for a polyfill).
  9128. */
  9129. importMetaName?: string;
  9130. /**
  9131. * Make the output files a library, exporting the exports of the entry point.
  9132. */
  9133. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  9134. /**
  9135. * Specify which export should be exposed as library.
  9136. */
  9137. libraryExport?: string | string[];
  9138. /**
  9139. * 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).
  9140. */
  9141. libraryTarget?: string;
  9142. /**
  9143. * Output javascript files as module source type.
  9144. */
  9145. module?: boolean;
  9146. /**
  9147. * The output directory as **absolute path** (required).
  9148. */
  9149. path?: string;
  9150. /**
  9151. * Include comments with information about the modules.
  9152. */
  9153. pathinfo?: boolean | "verbose";
  9154. /**
  9155. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  9156. */
  9157. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9158. /**
  9159. * This option enables loading async chunks via a custom script type, such as script type="module".
  9160. */
  9161. scriptType?: false | "module" | "text/javascript";
  9162. /**
  9163. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  9164. */
  9165. sourceMapFilename?: string;
  9166. /**
  9167. * Prefixes every line of the source in the bundle with this string.
  9168. */
  9169. sourcePrefix?: string;
  9170. /**
  9171. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  9172. */
  9173. strictModuleErrorHandling?: boolean;
  9174. /**
  9175. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  9176. */
  9177. strictModuleExceptionHandling?: boolean;
  9178. /**
  9179. * 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.
  9180. */
  9181. trustedTypes?: string | true | TrustedTypes;
  9182. /**
  9183. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  9184. */
  9185. umdNamedDefine?: boolean;
  9186. /**
  9187. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  9188. */
  9189. uniqueName?: string;
  9190. /**
  9191. * 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).
  9192. */
  9193. wasmLoading?: string | false;
  9194. /**
  9195. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  9196. */
  9197. webassemblyModuleFilename?: string;
  9198. /**
  9199. * 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).
  9200. */
  9201. workerChunkLoading?: string | false;
  9202. /**
  9203. * 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.
  9204. */
  9205. workerPublicPath?: string;
  9206. /**
  9207. * 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).
  9208. */
  9209. workerWasmLoading?: string | false;
  9210. }
  9211. declare interface OutputFileSystem {
  9212. writeFile: WriteFile;
  9213. mkdir: Mkdir;
  9214. readdir?: ReaddirFs;
  9215. rmdir?: Rmdir;
  9216. unlink?: (
  9217. arg0: PathLikeFs,
  9218. arg1: (arg0: null | NodeJS.ErrnoException) => void
  9219. ) => void;
  9220. stat: StatFs;
  9221. lstat?: LStatFs;
  9222. readFile: ReadFileFs;
  9223. join?: (arg0: string, arg1: string) => string;
  9224. relative?: (arg0: string, arg1: string) => string;
  9225. dirname?: (arg0: string) => string;
  9226. }
  9227. /**
  9228. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  9229. */
  9230. declare interface OutputNormalized {
  9231. /**
  9232. * The filename of asset modules as relative path inside the 'output.path' directory.
  9233. */
  9234. assetModuleFilename?:
  9235. | string
  9236. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9237. /**
  9238. * Enable/disable creating async chunks that are loaded on demand.
  9239. */
  9240. asyncChunks?: boolean;
  9241. /**
  9242. * Add charset attribute for script tag.
  9243. */
  9244. charset?: boolean;
  9245. /**
  9246. * 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.
  9247. */
  9248. chunkFilename?:
  9249. | string
  9250. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9251. /**
  9252. * 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).
  9253. */
  9254. chunkFormat?: string | false;
  9255. /**
  9256. * Number of milliseconds before chunk request expires.
  9257. */
  9258. chunkLoadTimeout?: number;
  9259. /**
  9260. * 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).
  9261. */
  9262. chunkLoading?: string | false;
  9263. /**
  9264. * The global variable used by webpack for loading of chunks.
  9265. */
  9266. chunkLoadingGlobal?: string;
  9267. /**
  9268. * Clean the output directory before emit.
  9269. */
  9270. clean?: boolean | CleanOptions;
  9271. /**
  9272. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  9273. */
  9274. compareBeforeEmit?: boolean;
  9275. /**
  9276. * This option enables cross-origin loading of chunks.
  9277. */
  9278. crossOriginLoading?: false | "anonymous" | "use-credentials";
  9279. /**
  9280. * 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.
  9281. */
  9282. cssChunkFilename?:
  9283. | string
  9284. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9285. /**
  9286. * 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.
  9287. */
  9288. cssFilename?:
  9289. | string
  9290. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9291. /**
  9292. * Compress the data in the head tag of CSS files.
  9293. */
  9294. cssHeadDataCompression?: boolean;
  9295. /**
  9296. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  9297. */
  9298. devtoolFallbackModuleFilenameTemplate?: string | Function;
  9299. /**
  9300. * Filename template string of function for the sources array in a generated SourceMap.
  9301. */
  9302. devtoolModuleFilenameTemplate?: string | Function;
  9303. /**
  9304. * 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.
  9305. */
  9306. devtoolNamespace?: string;
  9307. /**
  9308. * List of chunk loading types enabled for use by entry points.
  9309. */
  9310. enabledChunkLoadingTypes?: string[];
  9311. /**
  9312. * List of library types enabled for use by entry points.
  9313. */
  9314. enabledLibraryTypes?: string[];
  9315. /**
  9316. * List of wasm loading types enabled for use by entry points.
  9317. */
  9318. enabledWasmLoadingTypes?: string[];
  9319. /**
  9320. * The abilities of the environment where the webpack generated code should run.
  9321. */
  9322. environment?: Environment;
  9323. /**
  9324. * 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.
  9325. */
  9326. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9327. /**
  9328. * An expression which is used to address the global object/scope in runtime code.
  9329. */
  9330. globalObject?: string;
  9331. /**
  9332. * Digest type used for the hash.
  9333. */
  9334. hashDigest?: string;
  9335. /**
  9336. * Number of chars which are used for the hash.
  9337. */
  9338. hashDigestLength?: number;
  9339. /**
  9340. * Algorithm used for generation the hash (see node.js crypto package).
  9341. */
  9342. hashFunction?: string | typeof Hash;
  9343. /**
  9344. * Any string which is added to the hash to salt it.
  9345. */
  9346. hashSalt?: string;
  9347. /**
  9348. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  9349. */
  9350. hotUpdateChunkFilename?: string;
  9351. /**
  9352. * The global variable used by webpack for loading of hot update chunks.
  9353. */
  9354. hotUpdateGlobal?: string;
  9355. /**
  9356. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  9357. */
  9358. hotUpdateMainFilename?: string;
  9359. /**
  9360. * Ignore warnings in the browser.
  9361. */
  9362. ignoreBrowserWarnings?: boolean;
  9363. /**
  9364. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  9365. */
  9366. iife?: boolean;
  9367. /**
  9368. * The name of the native import() function (can be exchanged for a polyfill).
  9369. */
  9370. importFunctionName?: string;
  9371. /**
  9372. * The name of the native import.meta object (can be exchanged for a polyfill).
  9373. */
  9374. importMetaName?: string;
  9375. /**
  9376. * Options for library.
  9377. */
  9378. library?: LibraryOptions;
  9379. /**
  9380. * Output javascript files as module source type.
  9381. */
  9382. module?: boolean;
  9383. /**
  9384. * The output directory as **absolute path** (required).
  9385. */
  9386. path?: string;
  9387. /**
  9388. * Include comments with information about the modules.
  9389. */
  9390. pathinfo?: boolean | "verbose";
  9391. /**
  9392. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  9393. */
  9394. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9395. /**
  9396. * This option enables loading async chunks via a custom script type, such as script type="module".
  9397. */
  9398. scriptType?: false | "module" | "text/javascript";
  9399. /**
  9400. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  9401. */
  9402. sourceMapFilename?: string;
  9403. /**
  9404. * Prefixes every line of the source in the bundle with this string.
  9405. */
  9406. sourcePrefix?: string;
  9407. /**
  9408. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  9409. */
  9410. strictModuleErrorHandling?: boolean;
  9411. /**
  9412. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  9413. */
  9414. strictModuleExceptionHandling?: boolean;
  9415. /**
  9416. * Use a Trusted Types policy to create urls for chunks.
  9417. */
  9418. trustedTypes?: TrustedTypes;
  9419. /**
  9420. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  9421. */
  9422. uniqueName?: string;
  9423. /**
  9424. * 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).
  9425. */
  9426. wasmLoading?: string | false;
  9427. /**
  9428. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  9429. */
  9430. webassemblyModuleFilename?: string;
  9431. /**
  9432. * 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).
  9433. */
  9434. workerChunkLoading?: string | false;
  9435. /**
  9436. * 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.
  9437. */
  9438. workerPublicPath?: string;
  9439. /**
  9440. * 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).
  9441. */
  9442. workerWasmLoading?: string | false;
  9443. }
  9444. declare interface ParameterizedComparator<TArg, T> {
  9445. (arg0: TArg): Comparator<T>;
  9446. }
  9447. declare interface ParsedIdentifier {
  9448. request: string;
  9449. query: string;
  9450. fragment: string;
  9451. directory: boolean;
  9452. module: boolean;
  9453. file: boolean;
  9454. internal: boolean;
  9455. }
  9456. declare class Parser {
  9457. constructor();
  9458. parse(
  9459. source: string | Buffer | PreparsedAst,
  9460. state: ParserState
  9461. ): ParserState;
  9462. }
  9463. declare interface ParserOptions {
  9464. [index: string]: any;
  9465. }
  9466. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  9467. ParserOptionsByModuleTypeUnknown;
  9468. /**
  9469. * Specify options for each parser.
  9470. */
  9471. declare interface ParserOptionsByModuleTypeKnown {
  9472. /**
  9473. * Parser options for asset modules.
  9474. */
  9475. asset?: AssetParserOptions;
  9476. /**
  9477. * No parser options are supported for this module type.
  9478. */
  9479. "asset/inline"?: EmptyParserOptions;
  9480. /**
  9481. * No parser options are supported for this module type.
  9482. */
  9483. "asset/resource"?: EmptyParserOptions;
  9484. /**
  9485. * No parser options are supported for this module type.
  9486. */
  9487. "asset/source"?: EmptyParserOptions;
  9488. /**
  9489. * Parser options for css modules.
  9490. */
  9491. css?: CssParserOptions;
  9492. /**
  9493. * Parser options for css/auto modules.
  9494. */
  9495. "css/auto"?: CssAutoParserOptions;
  9496. /**
  9497. * Parser options for css/global modules.
  9498. */
  9499. "css/global"?: CssGlobalParserOptions;
  9500. /**
  9501. * Parser options for css/module modules.
  9502. */
  9503. "css/module"?: CssModuleParserOptions;
  9504. /**
  9505. * Parser options for javascript modules.
  9506. */
  9507. javascript?: JavascriptParserOptions;
  9508. /**
  9509. * Parser options for javascript modules.
  9510. */
  9511. "javascript/auto"?: JavascriptParserOptions;
  9512. /**
  9513. * Parser options for javascript modules.
  9514. */
  9515. "javascript/dynamic"?: JavascriptParserOptions;
  9516. /**
  9517. * Parser options for javascript modules.
  9518. */
  9519. "javascript/esm"?: JavascriptParserOptions;
  9520. }
  9521. /**
  9522. * Specify options for each parser.
  9523. */
  9524. declare interface ParserOptionsByModuleTypeUnknown {
  9525. [index: string]: { [index: string]: any };
  9526. }
  9527. type ParserState = Record<string, any> & ParserStateBase;
  9528. declare interface ParserStateBase {
  9529. source: string | Buffer;
  9530. current: NormalModule;
  9531. module: NormalModule;
  9532. compilation: Compilation;
  9533. options: { [index: string]: any };
  9534. }
  9535. declare interface PathData {
  9536. chunkGraph?: ChunkGraph;
  9537. hash?: string;
  9538. hashWithLength?: (arg0: number) => string;
  9539. chunk?: Chunk | ChunkPathData;
  9540. module?: Module | ModulePathData;
  9541. runtime?: RuntimeSpec;
  9542. filename?: string;
  9543. basename?: string;
  9544. query?: string;
  9545. contentHashType?: string;
  9546. contentHash?: string;
  9547. contentHashWithLength?: (arg0: number) => string;
  9548. noChunkHash?: boolean;
  9549. url?: string;
  9550. }
  9551. type PathLikeFs = string | Buffer | URL;
  9552. type PathLikeTypes = string | Buffer | URL_url;
  9553. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  9554. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  9555. type Pattern =
  9556. | Identifier
  9557. | MemberExpression
  9558. | ObjectPattern
  9559. | ArrayPattern
  9560. | RestElement
  9561. | AssignmentPattern;
  9562. /**
  9563. * Configuration object for web performance recommendations.
  9564. */
  9565. declare interface PerformanceOptions {
  9566. /**
  9567. * Filter function to select assets that are checked.
  9568. */
  9569. assetFilter?: Function;
  9570. /**
  9571. * Sets the format of the hints: warnings, errors or nothing at all.
  9572. */
  9573. hints?: false | "error" | "warning";
  9574. /**
  9575. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  9576. */
  9577. maxAssetSize?: number;
  9578. /**
  9579. * Total size of an entry point (in bytes).
  9580. */
  9581. maxEntrypointSize?: number;
  9582. }
  9583. declare interface PitchLoaderDefinitionFunction<
  9584. OptionsType = {},
  9585. ContextAdditions = {}
  9586. > {
  9587. (
  9588. this: NormalModuleLoaderContext<OptionsType> &
  9589. LoaderRunnerLoaderContext<OptionsType> &
  9590. LoaderPluginLoaderContext &
  9591. HotModuleReplacementPluginLoaderContext &
  9592. ContextAdditions,
  9593. remainingRequest: string,
  9594. previousRequest: string,
  9595. data: object
  9596. ): string | void | Buffer | Promise<string | Buffer>;
  9597. }
  9598. declare class PlatformPlugin {
  9599. constructor(platform: Partial<PlatformTargetProperties>);
  9600. platform: Partial<PlatformTargetProperties>;
  9601. /**
  9602. * Apply the plugin
  9603. */
  9604. apply(compiler: Compiler): void;
  9605. }
  9606. declare interface PlatformTargetProperties {
  9607. /**
  9608. * web platform, importing of http(s) and std: is available
  9609. */
  9610. web: null | boolean;
  9611. /**
  9612. * browser platform, running in a normal web browser
  9613. */
  9614. browser: null | boolean;
  9615. /**
  9616. * (Web)Worker platform, running in a web/shared/service worker
  9617. */
  9618. webworker: null | boolean;
  9619. /**
  9620. * node platform, require of node built-in modules is available
  9621. */
  9622. node: null | boolean;
  9623. /**
  9624. * nwjs platform, require of legacy nw.gui is available
  9625. */
  9626. nwjs: null | boolean;
  9627. /**
  9628. * electron platform, require of some electron built-in modules is available
  9629. */
  9630. electron: null | boolean;
  9631. }
  9632. type Plugin =
  9633. | undefined
  9634. | null
  9635. | false
  9636. | ""
  9637. | 0
  9638. | { apply: (arg0: Resolver) => void }
  9639. | ((this: Resolver, arg1: Resolver) => void);
  9640. declare interface PnpApi {
  9641. resolveToUnqualified: (
  9642. arg0: string,
  9643. arg1: string,
  9644. arg2: object
  9645. ) => null | string;
  9646. }
  9647. declare class PrefetchPlugin {
  9648. constructor(context: string, request?: string);
  9649. context: null | string;
  9650. request: string;
  9651. /**
  9652. * Apply the plugin
  9653. */
  9654. apply(compiler: Compiler): void;
  9655. }
  9656. declare class PrefixSource extends Source {
  9657. constructor(prefix: string, source: string | Source);
  9658. original(): Source;
  9659. getPrefix(): string;
  9660. }
  9661. declare interface PreparsedAst {
  9662. [index: string]: any;
  9663. }
  9664. declare interface PrintedElement {
  9665. element: string;
  9666. content: string;
  9667. }
  9668. declare interface Problem {
  9669. type: ProblemType;
  9670. path: string;
  9671. argument: string;
  9672. value?: any;
  9673. index?: number;
  9674. expected?: string;
  9675. }
  9676. type ProblemType =
  9677. | "unknown-argument"
  9678. | "unexpected-non-array-in-path"
  9679. | "unexpected-non-object-in-path"
  9680. | "multiple-values-unexpected"
  9681. | "invalid-value";
  9682. declare interface ProcessAssetsAdditionalOptions {
  9683. additionalAssets?: true | Function;
  9684. }
  9685. declare class Profiler {
  9686. constructor(inspector?: any);
  9687. session: any;
  9688. inspector: any;
  9689. hasSession(): boolean;
  9690. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  9691. sendCommand(method: string, params?: object): Promise<any>;
  9692. destroy(): Promise<void>;
  9693. stopProfiling(): Promise<{ profile: any }>;
  9694. }
  9695. declare class ProfilingPlugin {
  9696. constructor(options?: ProfilingPluginOptions);
  9697. outputPath: string;
  9698. /**
  9699. * Apply the plugin
  9700. */
  9701. apply(compiler: Compiler): void;
  9702. static Profiler: typeof Profiler;
  9703. }
  9704. declare interface ProfilingPluginOptions {
  9705. /**
  9706. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  9707. */
  9708. outputPath?: string;
  9709. }
  9710. declare class ProgressPlugin {
  9711. constructor(options?: ProgressPluginArgument);
  9712. profile?: null | boolean;
  9713. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9714. modulesCount?: number;
  9715. dependenciesCount?: number;
  9716. showEntries?: boolean;
  9717. showModules?: boolean;
  9718. showDependencies?: boolean;
  9719. showActiveModules?: boolean;
  9720. percentBy?: null | "entries" | "modules" | "dependencies";
  9721. apply(compiler: Compiler | MultiCompiler): void;
  9722. static getReporter(
  9723. compiler: Compiler
  9724. ): undefined | ((p: number, ...args: string[]) => void);
  9725. static defaultOptions: {
  9726. profile: boolean;
  9727. modulesCount: number;
  9728. dependenciesCount: number;
  9729. modules: boolean;
  9730. dependencies: boolean;
  9731. activeModules: boolean;
  9732. entries: boolean;
  9733. };
  9734. static createDefaultHandler: (
  9735. profile: undefined | null | boolean,
  9736. logger: WebpackLogger
  9737. ) => (percentage: number, msg: string, ...args: string[]) => void;
  9738. }
  9739. type ProgressPluginArgument =
  9740. | ProgressPluginOptions
  9741. | ((percentage: number, msg: string, ...args: string[]) => void);
  9742. /**
  9743. * Options object for the ProgressPlugin.
  9744. */
  9745. declare interface ProgressPluginOptions {
  9746. /**
  9747. * Show active modules count and one active module in progress message.
  9748. */
  9749. activeModules?: boolean;
  9750. /**
  9751. * Show dependencies count in progress message.
  9752. */
  9753. dependencies?: boolean;
  9754. /**
  9755. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  9756. */
  9757. dependenciesCount?: number;
  9758. /**
  9759. * Show entries count in progress message.
  9760. */
  9761. entries?: boolean;
  9762. /**
  9763. * Function that executes for every progress step.
  9764. */
  9765. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  9766. /**
  9767. * Show modules count in progress message.
  9768. */
  9769. modules?: boolean;
  9770. /**
  9771. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  9772. */
  9773. modulesCount?: number;
  9774. /**
  9775. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  9776. */
  9777. percentBy?: null | "entries" | "modules" | "dependencies";
  9778. /**
  9779. * Collect profile data for progress steps. Default: false.
  9780. */
  9781. profile?: null | boolean;
  9782. }
  9783. declare class ProvidePlugin {
  9784. constructor(definitions: Record<string, string | string[]>);
  9785. definitions: Record<string, string | string[]>;
  9786. /**
  9787. * Apply the plugin
  9788. */
  9789. apply(compiler: Compiler): void;
  9790. }
  9791. declare class ProvideSharedPlugin {
  9792. constructor(options: ProvideSharedPluginOptions);
  9793. /**
  9794. * Apply the plugin
  9795. */
  9796. apply(compiler: Compiler): void;
  9797. }
  9798. declare interface ProvideSharedPluginOptions {
  9799. /**
  9800. * 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.
  9801. */
  9802. provides: Provides;
  9803. /**
  9804. * Share scope name used for all provided modules (defaults to 'default').
  9805. */
  9806. shareScope?: string;
  9807. }
  9808. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  9809. /**
  9810. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  9811. */
  9812. declare interface ProvidesConfig {
  9813. /**
  9814. * 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.
  9815. */
  9816. eager?: boolean;
  9817. /**
  9818. * Key in the share scope under which the shared modules should be stored.
  9819. */
  9820. shareKey?: string;
  9821. /**
  9822. * Share scope name.
  9823. */
  9824. shareScope?: string;
  9825. /**
  9826. * Version of the provided module. Will replace lower matching versions, but not higher.
  9827. */
  9828. version?: string | false;
  9829. }
  9830. /**
  9831. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  9832. */
  9833. declare interface ProvidesObject {
  9834. [index: string]: string | ProvidesConfig;
  9835. }
  9836. declare interface RawChunkGroupOptions {
  9837. preloadOrder?: number;
  9838. prefetchOrder?: number;
  9839. fetchPriority?: "auto" | "low" | "high";
  9840. }
  9841. type RawLoaderDefinition<
  9842. OptionsType = {},
  9843. ContextAdditions = {}
  9844. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  9845. raw: true;
  9846. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9847. };
  9848. declare interface RawLoaderDefinitionFunction<
  9849. OptionsType = {},
  9850. ContextAdditions = {}
  9851. > {
  9852. (
  9853. this: NormalModuleLoaderContext<OptionsType> &
  9854. LoaderRunnerLoaderContext<OptionsType> &
  9855. LoaderPluginLoaderContext &
  9856. HotModuleReplacementPluginLoaderContext &
  9857. ContextAdditions,
  9858. content: Buffer,
  9859. sourceMap?: string | SourceMap,
  9860. additionalData?: AdditionalData
  9861. ): string | void | Buffer | Promise<string | Buffer>;
  9862. }
  9863. declare class RawSource extends Source {
  9864. constructor(source: string | Buffer, convertToString?: boolean);
  9865. isBuffer(): boolean;
  9866. }
  9867. declare interface RawSourceMap {
  9868. version: number;
  9869. sources: string[];
  9870. names: string[];
  9871. sourceRoot?: string;
  9872. sourcesContent?: string[];
  9873. mappings: string;
  9874. file: string;
  9875. }
  9876. declare interface Read<TBuffer extends ArrayBufferView = Buffer> {
  9877. (
  9878. fd: number,
  9879. buffer: TBuffer,
  9880. offset: number,
  9881. length: number,
  9882. position: null | number | bigint,
  9883. callback: (
  9884. err: null | NodeJS.ErrnoException,
  9885. bytesRead: number,
  9886. buffer: TBuffer
  9887. ) => void
  9888. ): void;
  9889. (
  9890. fd: number,
  9891. options: ReadAsyncOptions<TBuffer>,
  9892. callback: (
  9893. err: null | NodeJS.ErrnoException,
  9894. bytesRead: number,
  9895. buffer: TBuffer
  9896. ) => void
  9897. ): void;
  9898. (
  9899. fd: number,
  9900. callback: (
  9901. err: null | NodeJS.ErrnoException,
  9902. bytesRead: number,
  9903. buffer: ArrayBufferView
  9904. ) => void
  9905. ): void;
  9906. }
  9907. declare interface ReadAsyncOptions<TBuffer extends ArrayBufferView> {
  9908. offset?: number;
  9909. length?: number;
  9910. position?: null | number | bigint;
  9911. buffer?: TBuffer;
  9912. }
  9913. declare class ReadFileCompileWasmPlugin {
  9914. constructor(options?: ReadFileCompileWasmPluginOptions);
  9915. options: ReadFileCompileWasmPluginOptions;
  9916. /**
  9917. * Apply the plugin
  9918. */
  9919. apply(compiler: Compiler): void;
  9920. }
  9921. declare interface ReadFileCompileWasmPluginOptions {
  9922. /**
  9923. * mangle imports
  9924. */
  9925. mangleImports?: boolean;
  9926. }
  9927. declare interface ReadFileFs {
  9928. (
  9929. path: PathOrFileDescriptorFs,
  9930. options:
  9931. | undefined
  9932. | null
  9933. | ({ encoding?: null; flag?: string } & Abortable),
  9934. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  9935. ): void;
  9936. (
  9937. path: PathOrFileDescriptorFs,
  9938. options:
  9939. | "ascii"
  9940. | "utf8"
  9941. | "utf-8"
  9942. | "utf16le"
  9943. | "utf-16le"
  9944. | "ucs2"
  9945. | "ucs-2"
  9946. | "latin1"
  9947. | "binary"
  9948. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  9949. | "base64"
  9950. | "base64url"
  9951. | "hex",
  9952. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  9953. ): void;
  9954. (
  9955. path: PathOrFileDescriptorFs,
  9956. options:
  9957. | undefined
  9958. | null
  9959. | "ascii"
  9960. | "utf8"
  9961. | "utf-8"
  9962. | "utf16le"
  9963. | "utf-16le"
  9964. | "ucs2"
  9965. | "ucs-2"
  9966. | "latin1"
  9967. | "binary"
  9968. | "base64"
  9969. | "base64url"
  9970. | "hex"
  9971. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  9972. callback: (
  9973. arg0: null | NodeJS.ErrnoException,
  9974. arg1?: string | Buffer
  9975. ) => void
  9976. ): void;
  9977. (
  9978. path: PathOrFileDescriptorFs,
  9979. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  9980. ): void;
  9981. }
  9982. declare interface ReadFileSync {
  9983. (
  9984. path: PathOrFileDescriptorFs,
  9985. options?: null | { encoding?: null; flag?: string }
  9986. ): Buffer;
  9987. (
  9988. path: PathOrFileDescriptorFs,
  9989. options:
  9990. | "ascii"
  9991. | "utf8"
  9992. | "utf-8"
  9993. | "utf16le"
  9994. | "utf-16le"
  9995. | "ucs2"
  9996. | "ucs-2"
  9997. | "latin1"
  9998. | "binary"
  9999. | "base64"
  10000. | "base64url"
  10001. | "hex"
  10002. | { encoding: BufferEncoding; flag?: string }
  10003. ): string;
  10004. (
  10005. path: PathOrFileDescriptorFs,
  10006. options?:
  10007. | null
  10008. | "ascii"
  10009. | "utf8"
  10010. | "utf-8"
  10011. | "utf16le"
  10012. | "utf-16le"
  10013. | "ucs2"
  10014. | "ucs-2"
  10015. | "latin1"
  10016. | "binary"
  10017. | "base64"
  10018. | "base64url"
  10019. | "hex"
  10020. | (ObjectEncodingOptions & { flag?: string })
  10021. ): string | Buffer;
  10022. }
  10023. declare interface ReadFileTypes {
  10024. (
  10025. path: PathOrFileDescriptorTypes,
  10026. options:
  10027. | undefined
  10028. | null
  10029. | ({ encoding?: null; flag?: string } & Abortable),
  10030. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10031. ): void;
  10032. (
  10033. path: PathOrFileDescriptorTypes,
  10034. options:
  10035. | "ascii"
  10036. | "utf8"
  10037. | "utf-8"
  10038. | "utf16le"
  10039. | "utf-16le"
  10040. | "ucs2"
  10041. | "ucs-2"
  10042. | "latin1"
  10043. | "binary"
  10044. | "base64"
  10045. | "base64url"
  10046. | "hex"
  10047. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  10048. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10049. ): void;
  10050. (
  10051. path: PathOrFileDescriptorTypes,
  10052. options:
  10053. | undefined
  10054. | null
  10055. | "ascii"
  10056. | "utf8"
  10057. | "utf-8"
  10058. | "utf16le"
  10059. | "utf-16le"
  10060. | "ucs2"
  10061. | "ucs-2"
  10062. | "latin1"
  10063. | "binary"
  10064. | "base64"
  10065. | "base64url"
  10066. | "hex"
  10067. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  10068. callback: (
  10069. arg0: null | NodeJS.ErrnoException,
  10070. arg1?: string | Buffer
  10071. ) => void
  10072. ): void;
  10073. (
  10074. path: PathOrFileDescriptorTypes,
  10075. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10076. ): void;
  10077. }
  10078. declare interface ReaddirFs {
  10079. (
  10080. path: PathLikeFs,
  10081. options:
  10082. | undefined
  10083. | null
  10084. | "ascii"
  10085. | "utf8"
  10086. | "utf-8"
  10087. | "utf16le"
  10088. | "utf-16le"
  10089. | "ucs2"
  10090. | "ucs-2"
  10091. | "latin1"
  10092. | "binary"
  10093. | "base64"
  10094. | "base64url"
  10095. | "hex"
  10096. | {
  10097. encoding:
  10098. | null
  10099. | "ascii"
  10100. | "utf8"
  10101. | "utf-8"
  10102. | "utf16le"
  10103. | "utf-16le"
  10104. | "ucs2"
  10105. | "ucs-2"
  10106. | "latin1"
  10107. | "binary"
  10108. | "base64"
  10109. | "base64url"
  10110. | "hex";
  10111. withFileTypes?: false;
  10112. recursive?: boolean;
  10113. },
  10114. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10115. ): void;
  10116. (
  10117. path: PathLikeFs,
  10118. options:
  10119. | "buffer"
  10120. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  10121. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  10122. ): void;
  10123. (
  10124. path: PathLikeFs,
  10125. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10126. ): void;
  10127. (
  10128. path: PathLikeFs,
  10129. options:
  10130. | undefined
  10131. | null
  10132. | "ascii"
  10133. | "utf8"
  10134. | "utf-8"
  10135. | "utf16le"
  10136. | "utf-16le"
  10137. | "ucs2"
  10138. | "ucs-2"
  10139. | "latin1"
  10140. | "binary"
  10141. | "base64"
  10142. | "base64url"
  10143. | "hex"
  10144. | (ObjectEncodingOptions & {
  10145. withFileTypes?: false;
  10146. recursive?: boolean;
  10147. }),
  10148. callback: (
  10149. arg0: null | NodeJS.ErrnoException,
  10150. arg1?: string[] | Buffer[]
  10151. ) => void
  10152. ): void;
  10153. (
  10154. path: PathLikeFs,
  10155. options: ObjectEncodingOptions & {
  10156. withFileTypes: true;
  10157. recursive?: boolean;
  10158. },
  10159. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  10160. ): void;
  10161. }
  10162. declare interface ReaddirSync {
  10163. (
  10164. path: PathLikeFs,
  10165. options?:
  10166. | null
  10167. | "ascii"
  10168. | "utf8"
  10169. | "utf-8"
  10170. | "utf16le"
  10171. | "utf-16le"
  10172. | "ucs2"
  10173. | "ucs-2"
  10174. | "latin1"
  10175. | "binary"
  10176. | "base64"
  10177. | "base64url"
  10178. | "hex"
  10179. | {
  10180. encoding:
  10181. | null
  10182. | "ascii"
  10183. | "utf8"
  10184. | "utf-8"
  10185. | "utf16le"
  10186. | "utf-16le"
  10187. | "ucs2"
  10188. | "ucs-2"
  10189. | "latin1"
  10190. | "binary"
  10191. | "base64"
  10192. | "base64url"
  10193. | "hex";
  10194. withFileTypes?: false;
  10195. recursive?: boolean;
  10196. }
  10197. ): string[];
  10198. (
  10199. path: PathLikeFs,
  10200. options:
  10201. | "buffer"
  10202. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  10203. ): Buffer[];
  10204. (
  10205. path: PathLikeFs,
  10206. options?:
  10207. | null
  10208. | "ascii"
  10209. | "utf8"
  10210. | "utf-8"
  10211. | "utf16le"
  10212. | "utf-16le"
  10213. | "ucs2"
  10214. | "ucs-2"
  10215. | "latin1"
  10216. | "binary"
  10217. | "base64"
  10218. | "base64url"
  10219. | "hex"
  10220. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  10221. ): string[] | Buffer[];
  10222. (
  10223. path: PathLikeFs,
  10224. options: ObjectEncodingOptions & {
  10225. withFileTypes: true;
  10226. recursive?: boolean;
  10227. }
  10228. ): Dirent[];
  10229. }
  10230. declare interface ReaddirTypes {
  10231. (
  10232. path: PathLikeTypes,
  10233. options:
  10234. | undefined
  10235. | null
  10236. | "ascii"
  10237. | "utf8"
  10238. | "utf-8"
  10239. | "utf16le"
  10240. | "utf-16le"
  10241. | "ucs2"
  10242. | "ucs-2"
  10243. | "latin1"
  10244. | "binary"
  10245. | "base64"
  10246. | "base64url"
  10247. | "hex"
  10248. | {
  10249. encoding:
  10250. | null
  10251. | "ascii"
  10252. | "utf8"
  10253. | "utf-8"
  10254. | "utf16le"
  10255. | "utf-16le"
  10256. | "ucs2"
  10257. | "ucs-2"
  10258. | "latin1"
  10259. | "binary"
  10260. | "base64"
  10261. | "base64url"
  10262. | "hex";
  10263. withFileTypes?: false;
  10264. recursive?: boolean;
  10265. },
  10266. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10267. ): void;
  10268. (
  10269. path: PathLikeTypes,
  10270. options:
  10271. | "buffer"
  10272. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  10273. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  10274. ): void;
  10275. (
  10276. path: PathLikeTypes,
  10277. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  10278. ): void;
  10279. (
  10280. path: PathLikeTypes,
  10281. options:
  10282. | undefined
  10283. | null
  10284. | "ascii"
  10285. | "utf8"
  10286. | "utf-8"
  10287. | "utf16le"
  10288. | "utf-16le"
  10289. | "ucs2"
  10290. | "ucs-2"
  10291. | "latin1"
  10292. | "binary"
  10293. | "base64"
  10294. | "base64url"
  10295. | "hex"
  10296. | (ObjectEncodingOptions & {
  10297. withFileTypes?: false;
  10298. recursive?: boolean;
  10299. }),
  10300. callback: (
  10301. arg0: null | NodeJS.ErrnoException,
  10302. arg1?: string[] | Buffer[]
  10303. ) => void
  10304. ): void;
  10305. (
  10306. path: PathLikeTypes,
  10307. options: ObjectEncodingOptions & {
  10308. withFileTypes: true;
  10309. recursive?: boolean;
  10310. },
  10311. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  10312. ): void;
  10313. }
  10314. declare interface ReadlinkFs {
  10315. (
  10316. path: PathLikeFs,
  10317. options: EncodingOption,
  10318. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10319. ): void;
  10320. (
  10321. path: PathLikeFs,
  10322. options: BufferEncodingOption,
  10323. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10324. ): void;
  10325. (
  10326. path: PathLikeFs,
  10327. options: EncodingOption,
  10328. callback: (
  10329. arg0: null | NodeJS.ErrnoException,
  10330. arg1?: string | Buffer
  10331. ) => void
  10332. ): void;
  10333. (
  10334. path: PathLikeFs,
  10335. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10336. ): void;
  10337. }
  10338. declare interface ReadlinkSync {
  10339. (path: PathLikeFs, options?: EncodingOption): string;
  10340. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  10341. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  10342. }
  10343. declare interface ReadlinkTypes {
  10344. (
  10345. path: PathLikeTypes,
  10346. options: EncodingOption,
  10347. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10348. ): void;
  10349. (
  10350. path: PathLikeTypes,
  10351. options: BufferEncodingOption,
  10352. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10353. ): void;
  10354. (
  10355. path: PathLikeTypes,
  10356. options: EncodingOption,
  10357. callback: (
  10358. arg0: null | NodeJS.ErrnoException,
  10359. arg1?: string | Buffer
  10360. ) => void
  10361. ): void;
  10362. (
  10363. path: PathLikeTypes,
  10364. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10365. ): void;
  10366. }
  10367. declare class RealContentHashPlugin {
  10368. constructor(__0: {
  10369. /**
  10370. * the hash function to use
  10371. */
  10372. hashFunction: string | typeof Hash;
  10373. /**
  10374. * the hash digest to use
  10375. */
  10376. hashDigest: string;
  10377. });
  10378. /**
  10379. * Apply the plugin
  10380. */
  10381. apply(compiler: Compiler): void;
  10382. static getCompilationHooks(
  10383. compilation: Compilation
  10384. ): CompilationHooksRealContentHashPlugin;
  10385. }
  10386. declare interface RealDependencyLocation {
  10387. start: SourcePosition;
  10388. end?: SourcePosition;
  10389. index?: number;
  10390. }
  10391. declare interface RealPathFs {
  10392. (
  10393. path: PathLikeFs,
  10394. options: EncodingOption,
  10395. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10396. ): void;
  10397. (
  10398. path: PathLikeFs,
  10399. options: BufferEncodingOption,
  10400. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10401. ): void;
  10402. (
  10403. path: PathLikeFs,
  10404. options: EncodingOption,
  10405. callback: (
  10406. arg0: null | NodeJS.ErrnoException,
  10407. arg1?: string | Buffer
  10408. ) => void
  10409. ): void;
  10410. (
  10411. path: PathLikeFs,
  10412. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10413. ): void;
  10414. }
  10415. declare interface RealPathSync {
  10416. (path: PathLikeFs, options?: EncodingOption): string;
  10417. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  10418. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  10419. }
  10420. declare interface RealPathTypes {
  10421. (
  10422. path: PathLikeTypes,
  10423. options: EncodingOption,
  10424. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10425. ): void;
  10426. (
  10427. path: PathLikeTypes,
  10428. options: BufferEncodingOption,
  10429. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  10430. ): void;
  10431. (
  10432. path: PathLikeTypes,
  10433. options: EncodingOption,
  10434. callback: (
  10435. arg0: null | NodeJS.ErrnoException,
  10436. arg1?: string | Buffer
  10437. ) => void
  10438. ): void;
  10439. (
  10440. path: PathLikeTypes,
  10441. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  10442. ): void;
  10443. }
  10444. type RecursiveArrayOrRecord<T> =
  10445. | { [index: string]: RecursiveArrayOrRecord<T> }
  10446. | RecursiveArrayOrRecord<T>[]
  10447. | T;
  10448. declare interface ReferencedExport {
  10449. /**
  10450. * name of the referenced export
  10451. */
  10452. name: string[];
  10453. /**
  10454. * when false, referenced export can not be mangled, defaults to true
  10455. */
  10456. canMangle?: boolean;
  10457. }
  10458. type Remotes = (string | RemotesObject)[] | RemotesObject;
  10459. /**
  10460. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  10461. */
  10462. declare interface RemotesConfig {
  10463. /**
  10464. * Container locations from which modules should be resolved and loaded at runtime.
  10465. */
  10466. external: string | string[];
  10467. /**
  10468. * The name of the share scope shared with this remote.
  10469. */
  10470. shareScope?: string;
  10471. }
  10472. /**
  10473. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  10474. */
  10475. declare interface RemotesObject {
  10476. [index: string]: string | RemotesConfig | string[];
  10477. }
  10478. declare interface RenderBootstrapContext {
  10479. /**
  10480. * the chunk
  10481. */
  10482. chunk: Chunk;
  10483. /**
  10484. * results of code generation
  10485. */
  10486. codeGenerationResults: CodeGenerationResults;
  10487. /**
  10488. * the runtime template
  10489. */
  10490. runtimeTemplate: RuntimeTemplate;
  10491. /**
  10492. * the module graph
  10493. */
  10494. moduleGraph: ModuleGraph;
  10495. /**
  10496. * the chunk graph
  10497. */
  10498. chunkGraph: ChunkGraph;
  10499. /**
  10500. * hash to be used for render call
  10501. */
  10502. hash: string;
  10503. }
  10504. declare interface RenderContext {
  10505. /**
  10506. * the chunk
  10507. */
  10508. chunk: Chunk;
  10509. /**
  10510. * the dependency templates
  10511. */
  10512. dependencyTemplates: DependencyTemplates;
  10513. /**
  10514. * the runtime template
  10515. */
  10516. runtimeTemplate: RuntimeTemplate;
  10517. /**
  10518. * the module graph
  10519. */
  10520. moduleGraph: ModuleGraph;
  10521. /**
  10522. * the chunk graph
  10523. */
  10524. chunkGraph: ChunkGraph;
  10525. /**
  10526. * results of code generation
  10527. */
  10528. codeGenerationResults: CodeGenerationResults;
  10529. /**
  10530. * rendering in strict context
  10531. */
  10532. strictMode: boolean;
  10533. }
  10534. type RenderManifestEntry =
  10535. | RenderManifestEntryTemplated
  10536. | RenderManifestEntryStatic;
  10537. declare interface RenderManifestEntryStatic {
  10538. render: () => Source;
  10539. filename: string;
  10540. info: AssetInfo;
  10541. identifier: string;
  10542. hash?: string;
  10543. auxiliary?: boolean;
  10544. }
  10545. declare interface RenderManifestEntryTemplated {
  10546. render: () => Source;
  10547. filenameTemplate: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  10548. pathOptions?: PathData;
  10549. info?: AssetInfo;
  10550. identifier: string;
  10551. hash?: string;
  10552. auxiliary?: boolean;
  10553. }
  10554. declare interface RenderManifestOptions {
  10555. /**
  10556. * the chunk used to render
  10557. */
  10558. chunk: Chunk;
  10559. hash: string;
  10560. fullHash: string;
  10561. outputOptions: Output;
  10562. codeGenerationResults: CodeGenerationResults;
  10563. moduleTemplates: { javascript: ModuleTemplate };
  10564. dependencyTemplates: DependencyTemplates;
  10565. runtimeTemplate: RuntimeTemplate;
  10566. moduleGraph: ModuleGraph;
  10567. chunkGraph: ChunkGraph;
  10568. }
  10569. declare class ReplaceSource extends Source {
  10570. constructor(source: Source, name?: string);
  10571. replace(start: number, end: number, newValue: string, name?: string): void;
  10572. insert(pos: number, newValue: string, name?: string): void;
  10573. getName(): string;
  10574. original(): string;
  10575. getReplacements(): {
  10576. start: number;
  10577. end: number;
  10578. content: string;
  10579. insertIndex: number;
  10580. name: string;
  10581. }[];
  10582. }
  10583. declare interface RequestRecord {
  10584. [index: string]: string | string[];
  10585. }
  10586. declare abstract class RequestShortener {
  10587. contextify: (arg0: string) => string;
  10588. shorten(request?: null | string): undefined | null | string;
  10589. }
  10590. declare interface ResolveBuildDependenciesResult {
  10591. /**
  10592. * list of files
  10593. */
  10594. files: Set<string>;
  10595. /**
  10596. * list of directories
  10597. */
  10598. directories: Set<string>;
  10599. /**
  10600. * list of missing entries
  10601. */
  10602. missing: Set<string>;
  10603. /**
  10604. * stored resolve results
  10605. */
  10606. resolveResults: Map<string, string | false>;
  10607. /**
  10608. * dependencies of the resolving
  10609. */
  10610. resolveDependencies: {
  10611. /**
  10612. * list of files
  10613. */
  10614. files: Set<string>;
  10615. /**
  10616. * list of directories
  10617. */
  10618. directories: Set<string>;
  10619. /**
  10620. * list of missing entries
  10621. */
  10622. missing: Set<string>;
  10623. };
  10624. }
  10625. declare interface ResolveContext {
  10626. contextDependencies?: WriteOnlySet<string>;
  10627. /**
  10628. * files that was found on file system
  10629. */
  10630. fileDependencies?: WriteOnlySet<string>;
  10631. /**
  10632. * dependencies that was not found on file system
  10633. */
  10634. missingDependencies?: WriteOnlySet<string>;
  10635. /**
  10636. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  10637. */
  10638. stack?: Set<string>;
  10639. /**
  10640. * log function
  10641. */
  10642. log?: (arg0: string) => void;
  10643. /**
  10644. * yield result, if provided plugins can return several results
  10645. */
  10646. yield?: (arg0: ResolveRequest) => void;
  10647. }
  10648. declare interface ResolveData {
  10649. contextInfo: ModuleFactoryCreateDataContextInfo;
  10650. resolveOptions?: ResolveOptions;
  10651. context: string;
  10652. request: string;
  10653. assertions?: Record<string, any>;
  10654. dependencies: ModuleDependency[];
  10655. dependencyType: string;
  10656. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  10657. fileDependencies: LazySet<string>;
  10658. missingDependencies: LazySet<string>;
  10659. contextDependencies: LazySet<string>;
  10660. /**
  10661. * allow to use the unsafe cache
  10662. */
  10663. cacheable: boolean;
  10664. }
  10665. /**
  10666. * Options object for resolving requests.
  10667. */
  10668. declare interface ResolveOptions {
  10669. /**
  10670. * Redirect module requests.
  10671. */
  10672. alias?:
  10673. | {
  10674. /**
  10675. * New request.
  10676. */
  10677. alias: string | false | string[];
  10678. /**
  10679. * Request to be redirected.
  10680. */
  10681. name: string;
  10682. /**
  10683. * Redirect only exact matching request.
  10684. */
  10685. onlyModule?: boolean;
  10686. }[]
  10687. | { [index: string]: string | false | string[] };
  10688. /**
  10689. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  10690. */
  10691. aliasFields?: (string | string[])[];
  10692. /**
  10693. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  10694. */
  10695. byDependency?: { [index: string]: ResolveOptions };
  10696. /**
  10697. * Enable caching of successfully resolved requests (cache entries are revalidated).
  10698. */
  10699. cache?: boolean;
  10700. /**
  10701. * Predicate function to decide which requests should be cached.
  10702. */
  10703. cachePredicate?: (request: ResolveRequest) => boolean;
  10704. /**
  10705. * Include the context information in the cache identifier when caching.
  10706. */
  10707. cacheWithContext?: boolean;
  10708. /**
  10709. * Condition names for exports field entry point.
  10710. */
  10711. conditionNames?: string[];
  10712. /**
  10713. * Filenames used to find a description file (like a package.json).
  10714. */
  10715. descriptionFiles?: string[];
  10716. /**
  10717. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  10718. */
  10719. enforceExtension?: boolean;
  10720. /**
  10721. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  10722. */
  10723. exportsFields?: string[];
  10724. /**
  10725. * An object which maps extension to extension aliases.
  10726. */
  10727. extensionAlias?: { [index: string]: string | string[] };
  10728. /**
  10729. * Extensions added to the request when trying to find the file.
  10730. */
  10731. extensions?: string[];
  10732. /**
  10733. * Redirect module requests when normal resolving fails.
  10734. */
  10735. fallback?:
  10736. | {
  10737. /**
  10738. * New request.
  10739. */
  10740. alias: string | false | string[];
  10741. /**
  10742. * Request to be redirected.
  10743. */
  10744. name: string;
  10745. /**
  10746. * Redirect only exact matching request.
  10747. */
  10748. onlyModule?: boolean;
  10749. }[]
  10750. | { [index: string]: string | false | string[] };
  10751. /**
  10752. * Filesystem for the resolver.
  10753. */
  10754. fileSystem?: InputFileSystem;
  10755. /**
  10756. * 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).
  10757. */
  10758. fullySpecified?: boolean;
  10759. /**
  10760. * 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).
  10761. */
  10762. importsFields?: string[];
  10763. /**
  10764. * Field names from the description file (package.json) which are used to find the default entry point.
  10765. */
  10766. mainFields?: (string | string[])[];
  10767. /**
  10768. * Filenames used to find the default entry point if there is no description file or main field.
  10769. */
  10770. mainFiles?: string[];
  10771. /**
  10772. * Folder names or directory paths where to find modules.
  10773. */
  10774. modules?: string[];
  10775. /**
  10776. * Plugins for the resolver.
  10777. */
  10778. plugins?: (
  10779. | undefined
  10780. | null
  10781. | false
  10782. | ""
  10783. | 0
  10784. | {
  10785. [index: string]: any;
  10786. /**
  10787. * The run point of the plugin, required method.
  10788. */
  10789. apply: (arg0: Resolver) => void;
  10790. }
  10791. | ((this: Resolver, arg1: Resolver) => void)
  10792. | "..."
  10793. )[];
  10794. /**
  10795. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  10796. */
  10797. preferAbsolute?: boolean;
  10798. /**
  10799. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  10800. */
  10801. preferRelative?: boolean;
  10802. /**
  10803. * Custom resolver.
  10804. */
  10805. resolver?: Resolver;
  10806. /**
  10807. * 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.
  10808. */
  10809. restrictions?: (string | RegExp)[];
  10810. /**
  10811. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  10812. */
  10813. roots?: string[];
  10814. /**
  10815. * Enable resolving symlinks to the original location.
  10816. */
  10817. symlinks?: boolean;
  10818. /**
  10819. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  10820. */
  10821. unsafeCache?: boolean | { [index: string]: any };
  10822. /**
  10823. * Use synchronous filesystem calls for the resolver.
  10824. */
  10825. useSyncFileSystemCalls?: boolean;
  10826. }
  10827. declare interface ResolveOptionsResolverFactoryObject1 {
  10828. alias: AliasOption[];
  10829. fallback: AliasOption[];
  10830. aliasFields: Set<string | string[]>;
  10831. extensionAlias: ExtensionAliasOption[];
  10832. cachePredicate: (arg0: ResolveRequest) => boolean;
  10833. cacheWithContext: boolean;
  10834. /**
  10835. * A list of exports field condition names.
  10836. */
  10837. conditionNames: Set<string>;
  10838. descriptionFiles: string[];
  10839. enforceExtension: boolean;
  10840. exportsFields: Set<string | string[]>;
  10841. importsFields: Set<string | string[]>;
  10842. extensions: Set<string>;
  10843. fileSystem: FileSystem;
  10844. unsafeCache: false | object;
  10845. symlinks: boolean;
  10846. resolver?: Resolver;
  10847. modules: (string | string[])[];
  10848. mainFields: { name: string[]; forceRelative: boolean }[];
  10849. mainFiles: Set<string>;
  10850. plugins: Plugin[];
  10851. pnpApi: null | PnpApi;
  10852. roots: Set<string>;
  10853. fullySpecified: boolean;
  10854. resolveToContext: boolean;
  10855. restrictions: Set<string | RegExp>;
  10856. preferRelative: boolean;
  10857. preferAbsolute: boolean;
  10858. }
  10859. declare interface ResolveOptionsResolverFactoryObject2 {
  10860. /**
  10861. * A list of module alias configurations or an object which maps key to value
  10862. */
  10863. alias?: AliasOption[] | AliasOptions;
  10864. /**
  10865. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  10866. */
  10867. fallback?: AliasOption[] | AliasOptions;
  10868. /**
  10869. * An object which maps extension to extension aliases
  10870. */
  10871. extensionAlias?: ExtensionAliasOptions;
  10872. /**
  10873. * A list of alias fields in description files
  10874. */
  10875. aliasFields?: (string | string[])[];
  10876. /**
  10877. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  10878. */
  10879. cachePredicate?: (arg0: ResolveRequest) => boolean;
  10880. /**
  10881. * Whether or not the unsafeCache should include request context as part of the cache key.
  10882. */
  10883. cacheWithContext?: boolean;
  10884. /**
  10885. * A list of description files to read from
  10886. */
  10887. descriptionFiles?: string[];
  10888. /**
  10889. * A list of exports field condition names.
  10890. */
  10891. conditionNames?: string[];
  10892. /**
  10893. * Enforce that a extension from extensions must be used
  10894. */
  10895. enforceExtension?: boolean;
  10896. /**
  10897. * A list of exports fields in description files
  10898. */
  10899. exportsFields?: (string | string[])[];
  10900. /**
  10901. * A list of imports fields in description files
  10902. */
  10903. importsFields?: (string | string[])[];
  10904. /**
  10905. * A list of extensions which should be tried for files
  10906. */
  10907. extensions?: string[];
  10908. /**
  10909. * The file system which should be used
  10910. */
  10911. fileSystem: FileSystem;
  10912. /**
  10913. * Use this cache object to unsafely cache the successful requests
  10914. */
  10915. unsafeCache?: boolean | object;
  10916. /**
  10917. * Resolve symlinks to their symlinked location
  10918. */
  10919. symlinks?: boolean;
  10920. /**
  10921. * A prepared Resolver to which the plugins are attached
  10922. */
  10923. resolver?: Resolver;
  10924. /**
  10925. * A list of directories to resolve modules from, can be absolute path or folder name
  10926. */
  10927. modules?: string | string[];
  10928. /**
  10929. * A list of main fields in description files
  10930. */
  10931. mainFields?: (
  10932. | string
  10933. | string[]
  10934. | { name: string | string[]; forceRelative: boolean }
  10935. )[];
  10936. /**
  10937. * A list of main files in directories
  10938. */
  10939. mainFiles?: string[];
  10940. /**
  10941. * A list of additional resolve plugins which should be applied
  10942. */
  10943. plugins?: Plugin[];
  10944. /**
  10945. * A PnP API that should be used - null is "never", undefined is "auto"
  10946. */
  10947. pnpApi?: null | PnpApi;
  10948. /**
  10949. * A list of root paths
  10950. */
  10951. roots?: string[];
  10952. /**
  10953. * The request is already fully specified and no extensions or directories are resolved for it
  10954. */
  10955. fullySpecified?: boolean;
  10956. /**
  10957. * Resolve to a context instead of a file
  10958. */
  10959. resolveToContext?: boolean;
  10960. /**
  10961. * A list of resolve restrictions
  10962. */
  10963. restrictions?: (string | RegExp)[];
  10964. /**
  10965. * Use only the sync constraints of the file system calls
  10966. */
  10967. useSyncFileSystemCalls?: boolean;
  10968. /**
  10969. * Prefer to resolve module requests as relative requests before falling back to modules
  10970. */
  10971. preferRelative?: boolean;
  10972. /**
  10973. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  10974. */
  10975. preferAbsolute?: boolean;
  10976. }
  10977. type ResolveOptionsWithDependencyType = ResolveOptions & {
  10978. dependencyType?: string;
  10979. resolveToContext?: boolean;
  10980. };
  10981. type ResolvePluginInstance =
  10982. | {
  10983. [index: string]: any;
  10984. /**
  10985. * The run point of the plugin, required method.
  10986. */
  10987. apply: (arg0: Resolver) => void;
  10988. }
  10989. | ((this: Resolver, arg1: Resolver) => void);
  10990. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  10991. declare interface ResolvedContextFileSystemInfoEntry {
  10992. safeTime: number;
  10993. timestampHash?: string;
  10994. }
  10995. declare interface ResolvedContextTimestampAndHash {
  10996. safeTime: number;
  10997. timestampHash?: string;
  10998. hash: string;
  10999. }
  11000. declare interface ResolvedOptions {
  11001. /**
  11002. * - platform target properties
  11003. */
  11004. platform: false | PlatformTargetProperties;
  11005. }
  11006. declare abstract class Resolver {
  11007. fileSystem: FileSystem;
  11008. options: ResolveOptionsResolverFactoryObject1;
  11009. hooks: KnownHooks;
  11010. ensureHook(
  11011. name:
  11012. | string
  11013. | AsyncSeriesBailHook<
  11014. [ResolveRequest, ResolveContext],
  11015. null | ResolveRequest
  11016. >
  11017. ): AsyncSeriesBailHook<
  11018. [ResolveRequest, ResolveContext],
  11019. null | ResolveRequest
  11020. >;
  11021. getHook(
  11022. name:
  11023. | string
  11024. | AsyncSeriesBailHook<
  11025. [ResolveRequest, ResolveContext],
  11026. null | ResolveRequest
  11027. >
  11028. ): AsyncSeriesBailHook<
  11029. [ResolveRequest, ResolveContext],
  11030. null | ResolveRequest
  11031. >;
  11032. resolveSync(context: object, path: string, request: string): string | false;
  11033. resolve(
  11034. context: object,
  11035. path: string,
  11036. request: string,
  11037. resolveContext: ResolveContext,
  11038. callback: (
  11039. err: null | ErrorWithDetail,
  11040. res?: string | false,
  11041. req?: ResolveRequest
  11042. ) => void
  11043. ): void;
  11044. doResolve(
  11045. hook: AsyncSeriesBailHook<
  11046. [ResolveRequest, ResolveContext],
  11047. null | ResolveRequest
  11048. >,
  11049. request: ResolveRequest,
  11050. message: null | string,
  11051. resolveContext: ResolveContext,
  11052. callback: (err?: null | Error, result?: ResolveRequest) => void
  11053. ): void;
  11054. parse(identifier: string): ParsedIdentifier;
  11055. isModule(path: string): boolean;
  11056. isPrivate(path: string): boolean;
  11057. isDirectory(path: string): boolean;
  11058. join(path: string, request: string): string;
  11059. normalize(path: string): string;
  11060. }
  11061. declare interface ResolverCache {
  11062. direct: WeakMap<object, ResolverWithOptions>;
  11063. stringified: Map<string, ResolverWithOptions>;
  11064. }
  11065. declare abstract class ResolverFactory {
  11066. hooks: Readonly<{
  11067. resolveOptions: HookMap<
  11068. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  11069. >;
  11070. resolver: HookMap<
  11071. SyncHook<
  11072. [
  11073. Resolver,
  11074. ResolveOptionsResolverFactoryObject2,
  11075. ResolveOptionsWithDependencyType
  11076. ]
  11077. >
  11078. >;
  11079. }>;
  11080. cache: Map<string, ResolverCache>;
  11081. get(
  11082. type: string,
  11083. resolveOptions?: ResolveOptionsWithDependencyType
  11084. ): ResolverWithOptions;
  11085. }
  11086. type ResolverWithOptions = Resolver & WithOptions;
  11087. declare interface ResourceDataWithData {
  11088. resource: string;
  11089. path?: string;
  11090. query?: string;
  11091. fragment?: string;
  11092. context?: string;
  11093. data: Record<string, any>;
  11094. }
  11095. declare interface RmDirOptions {
  11096. maxRetries?: number;
  11097. recursive?: boolean;
  11098. retryDelay?: number;
  11099. }
  11100. declare interface Rmdir {
  11101. (
  11102. file: PathLikeFs,
  11103. callback: (arg0: null | NodeJS.ErrnoException) => void
  11104. ): void;
  11105. (
  11106. file: PathLikeFs,
  11107. options: RmDirOptions,
  11108. callback: (arg0: null | NodeJS.ErrnoException) => void
  11109. ): void;
  11110. }
  11111. type Rule = string | RegExp;
  11112. declare interface RuleSet {
  11113. /**
  11114. * map of references in the rule set (may grow over time)
  11115. */
  11116. references: Map<string, any>;
  11117. /**
  11118. * execute the rule set
  11119. */
  11120. exec: (arg0: object) => Effect[];
  11121. }
  11122. type RuleSetCondition =
  11123. | string
  11124. | RegExp
  11125. | ((value: string) => boolean)
  11126. | RuleSetLogicalConditions
  11127. | RuleSetCondition[];
  11128. type RuleSetConditionAbsolute =
  11129. | string
  11130. | RegExp
  11131. | ((value: string) => boolean)
  11132. | RuleSetLogicalConditionsAbsolute
  11133. | RuleSetConditionAbsolute[];
  11134. type RuleSetConditionOrConditions =
  11135. | string
  11136. | RegExp
  11137. | ((value: string) => boolean)
  11138. | RuleSetLogicalConditions
  11139. | RuleSetCondition[];
  11140. /**
  11141. * Logic operators used in a condition matcher.
  11142. */
  11143. declare interface RuleSetLogicalConditions {
  11144. /**
  11145. * Logical AND.
  11146. */
  11147. and?: RuleSetCondition[];
  11148. /**
  11149. * Logical NOT.
  11150. */
  11151. not?:
  11152. | string
  11153. | RegExp
  11154. | ((value: string) => boolean)
  11155. | RuleSetLogicalConditions
  11156. | RuleSetCondition[];
  11157. /**
  11158. * Logical OR.
  11159. */
  11160. or?: RuleSetCondition[];
  11161. }
  11162. /**
  11163. * Logic operators used in a condition matcher.
  11164. */
  11165. declare interface RuleSetLogicalConditionsAbsolute {
  11166. /**
  11167. * Logical AND.
  11168. */
  11169. and?: RuleSetConditionAbsolute[];
  11170. /**
  11171. * Logical NOT.
  11172. */
  11173. not?:
  11174. | string
  11175. | RegExp
  11176. | ((value: string) => boolean)
  11177. | RuleSetLogicalConditionsAbsolute
  11178. | RuleSetConditionAbsolute[];
  11179. /**
  11180. * Logical OR.
  11181. */
  11182. or?: RuleSetConditionAbsolute[];
  11183. }
  11184. /**
  11185. * A rule description with conditions and effects for modules.
  11186. */
  11187. declare interface RuleSetRule {
  11188. /**
  11189. * Match on import assertions of the dependency.
  11190. */
  11191. assert?: { [index: string]: RuleSetConditionOrConditions };
  11192. /**
  11193. * Match the child compiler name.
  11194. */
  11195. compiler?:
  11196. | string
  11197. | RegExp
  11198. | ((value: string) => boolean)
  11199. | RuleSetLogicalConditions
  11200. | RuleSetCondition[];
  11201. /**
  11202. * Match dependency type.
  11203. */
  11204. dependency?:
  11205. | string
  11206. | RegExp
  11207. | ((value: string) => boolean)
  11208. | RuleSetLogicalConditions
  11209. | RuleSetCondition[];
  11210. /**
  11211. * Match values of properties in the description file (usually package.json).
  11212. */
  11213. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  11214. /**
  11215. * Enforce this rule as pre or post step.
  11216. */
  11217. enforce?: "pre" | "post";
  11218. /**
  11219. * Shortcut for resource.exclude.
  11220. */
  11221. exclude?:
  11222. | string
  11223. | RegExp
  11224. | ((value: string) => boolean)
  11225. | RuleSetLogicalConditionsAbsolute
  11226. | RuleSetConditionAbsolute[];
  11227. /**
  11228. * The options for the module generator.
  11229. */
  11230. generator?: { [index: string]: any };
  11231. /**
  11232. * Shortcut for resource.include.
  11233. */
  11234. include?:
  11235. | string
  11236. | RegExp
  11237. | ((value: string) => boolean)
  11238. | RuleSetLogicalConditionsAbsolute
  11239. | RuleSetConditionAbsolute[];
  11240. /**
  11241. * Match the issuer of the module (The module pointing to this module).
  11242. */
  11243. issuer?:
  11244. | string
  11245. | RegExp
  11246. | ((value: string) => boolean)
  11247. | RuleSetLogicalConditionsAbsolute
  11248. | RuleSetConditionAbsolute[];
  11249. /**
  11250. * Match layer of the issuer of this module (The module pointing to this module).
  11251. */
  11252. issuerLayer?:
  11253. | string
  11254. | RegExp
  11255. | ((value: string) => boolean)
  11256. | RuleSetLogicalConditions
  11257. | RuleSetCondition[];
  11258. /**
  11259. * Specifies the layer in which the module should be placed in.
  11260. */
  11261. layer?: string;
  11262. /**
  11263. * Shortcut for use.loader.
  11264. */
  11265. loader?: string;
  11266. /**
  11267. * Match module mimetype when load from Data URI.
  11268. */
  11269. mimetype?:
  11270. | string
  11271. | RegExp
  11272. | ((value: string) => boolean)
  11273. | RuleSetLogicalConditions
  11274. | RuleSetCondition[];
  11275. /**
  11276. * Only execute the first matching rule in this array.
  11277. */
  11278. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  11279. /**
  11280. * Shortcut for use.options.
  11281. */
  11282. options?: string | { [index: string]: any };
  11283. /**
  11284. * Options for parsing.
  11285. */
  11286. parser?: { [index: string]: any };
  11287. /**
  11288. * Match the real resource path of the module.
  11289. */
  11290. realResource?:
  11291. | string
  11292. | RegExp
  11293. | ((value: string) => boolean)
  11294. | RuleSetLogicalConditionsAbsolute
  11295. | RuleSetConditionAbsolute[];
  11296. /**
  11297. * Options for the resolver.
  11298. */
  11299. resolve?: ResolveOptions;
  11300. /**
  11301. * Match the resource path of the module.
  11302. */
  11303. resource?:
  11304. | string
  11305. | RegExp
  11306. | ((value: string) => boolean)
  11307. | RuleSetLogicalConditionsAbsolute
  11308. | RuleSetConditionAbsolute[];
  11309. /**
  11310. * Match the resource fragment of the module.
  11311. */
  11312. resourceFragment?:
  11313. | string
  11314. | RegExp
  11315. | ((value: string) => boolean)
  11316. | RuleSetLogicalConditions
  11317. | RuleSetCondition[];
  11318. /**
  11319. * Match the resource query of the module.
  11320. */
  11321. resourceQuery?:
  11322. | string
  11323. | RegExp
  11324. | ((value: string) => boolean)
  11325. | RuleSetLogicalConditions
  11326. | RuleSetCondition[];
  11327. /**
  11328. * Match and execute these rules when this rule is matched.
  11329. */
  11330. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  11331. /**
  11332. * Match module scheme.
  11333. */
  11334. scheme?:
  11335. | string
  11336. | RegExp
  11337. | ((value: string) => boolean)
  11338. | RuleSetLogicalConditions
  11339. | RuleSetCondition[];
  11340. /**
  11341. * Flags a module as with or without side effects.
  11342. */
  11343. sideEffects?: boolean;
  11344. /**
  11345. * Shortcut for resource.test.
  11346. */
  11347. test?:
  11348. | string
  11349. | RegExp
  11350. | ((value: string) => boolean)
  11351. | RuleSetLogicalConditionsAbsolute
  11352. | RuleSetConditionAbsolute[];
  11353. /**
  11354. * Module type to use for the module.
  11355. */
  11356. type?: string;
  11357. /**
  11358. * Modifiers applied to the module when rule is matched.
  11359. */
  11360. use?:
  11361. | string
  11362. | (
  11363. | undefined
  11364. | null
  11365. | string
  11366. | false
  11367. | 0
  11368. | {
  11369. /**
  11370. * Unique loader options identifier.
  11371. */
  11372. ident?: string;
  11373. /**
  11374. * Loader name.
  11375. */
  11376. loader?: string;
  11377. /**
  11378. * Loader options.
  11379. */
  11380. options?: string | { [index: string]: any };
  11381. }
  11382. | ((data: object) =>
  11383. | string
  11384. | {
  11385. /**
  11386. * Unique loader options identifier.
  11387. */
  11388. ident?: string;
  11389. /**
  11390. * Loader name.
  11391. */
  11392. loader?: string;
  11393. /**
  11394. * Loader options.
  11395. */
  11396. options?: string | { [index: string]: any };
  11397. }
  11398. | __TypeWebpackOptions
  11399. | __Type_2[])
  11400. )[]
  11401. | ((data: {
  11402. resource: string;
  11403. realResource: string;
  11404. resourceQuery: string;
  11405. issuer: string;
  11406. compiler: string;
  11407. }) => __Type_2[])
  11408. | {
  11409. /**
  11410. * Unique loader options identifier.
  11411. */
  11412. ident?: string;
  11413. /**
  11414. * Loader name.
  11415. */
  11416. loader?: string;
  11417. /**
  11418. * Loader options.
  11419. */
  11420. options?: string | { [index: string]: any };
  11421. }
  11422. | __TypeWebpackOptions;
  11423. /**
  11424. * Match on import attributes of the dependency.
  11425. */
  11426. with?: { [index: string]: RuleSetConditionOrConditions };
  11427. }
  11428. type RuleSetUse =
  11429. | string
  11430. | (
  11431. | undefined
  11432. | null
  11433. | string
  11434. | false
  11435. | 0
  11436. | {
  11437. /**
  11438. * Unique loader options identifier.
  11439. */
  11440. ident?: string;
  11441. /**
  11442. * Loader name.
  11443. */
  11444. loader?: string;
  11445. /**
  11446. * Loader options.
  11447. */
  11448. options?: string | { [index: string]: any };
  11449. }
  11450. | ((data: object) =>
  11451. | string
  11452. | {
  11453. /**
  11454. * Unique loader options identifier.
  11455. */
  11456. ident?: string;
  11457. /**
  11458. * Loader name.
  11459. */
  11460. loader?: string;
  11461. /**
  11462. * Loader options.
  11463. */
  11464. options?: string | { [index: string]: any };
  11465. }
  11466. | __TypeWebpackOptions
  11467. | __Type_2[])
  11468. )[]
  11469. | ((data: {
  11470. resource: string;
  11471. realResource: string;
  11472. resourceQuery: string;
  11473. issuer: string;
  11474. compiler: string;
  11475. }) => __Type_2[])
  11476. | {
  11477. /**
  11478. * Unique loader options identifier.
  11479. */
  11480. ident?: string;
  11481. /**
  11482. * Loader name.
  11483. */
  11484. loader?: string;
  11485. /**
  11486. * Loader options.
  11487. */
  11488. options?: string | { [index: string]: any };
  11489. }
  11490. | __TypeWebpackOptions;
  11491. type RuleSetUseItem =
  11492. | string
  11493. | {
  11494. /**
  11495. * Unique loader options identifier.
  11496. */
  11497. ident?: string;
  11498. /**
  11499. * Loader name.
  11500. */
  11501. loader?: string;
  11502. /**
  11503. * Loader options.
  11504. */
  11505. options?: string | { [index: string]: any };
  11506. }
  11507. | __TypeWebpackOptions;
  11508. declare interface RunCallback<T> {
  11509. (err: null | Error, result?: T): any;
  11510. }
  11511. declare class RuntimeChunkPlugin {
  11512. constructor(options: { name?: (entrypoint: { name: string }) => string });
  11513. options: {
  11514. name:
  11515. | ((entrypoint: { name: string }) => string)
  11516. | ((entrypoint: Entrypoint) => string);
  11517. };
  11518. /**
  11519. * Apply the plugin
  11520. */
  11521. apply(compiler: Compiler): void;
  11522. }
  11523. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  11524. declare class RuntimeModule extends Module {
  11525. constructor(name: string, stage?: number);
  11526. name: string;
  11527. stage: number;
  11528. compilation?: Compilation;
  11529. chunk?: Chunk;
  11530. chunkGraph?: ChunkGraph;
  11531. fullHash: boolean;
  11532. dependentHash: boolean;
  11533. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  11534. generate(): null | string;
  11535. getGeneratedCode(): null | string;
  11536. shouldIsolate(): boolean;
  11537. /**
  11538. * Runtime modules without any dependencies to other runtime modules
  11539. */
  11540. static STAGE_NORMAL: number;
  11541. /**
  11542. * Runtime modules with simple dependencies on other runtime modules
  11543. */
  11544. static STAGE_BASIC: number;
  11545. /**
  11546. * Runtime modules which attach to handlers of other runtime modules
  11547. */
  11548. static STAGE_ATTACH: number;
  11549. /**
  11550. * Runtime modules which trigger actions on bootstrap
  11551. */
  11552. static STAGE_TRIGGER: number;
  11553. }
  11554. declare interface RuntimeRequirementsContext {
  11555. /**
  11556. * the chunk graph
  11557. */
  11558. chunkGraph: ChunkGraph;
  11559. /**
  11560. * the code generation results
  11561. */
  11562. codeGenerationResults: CodeGenerationResults;
  11563. }
  11564. type RuntimeSpec = undefined | string | SortableSet<string>;
  11565. declare class RuntimeSpecMap<T> {
  11566. constructor(clone?: RuntimeSpecMap<T>);
  11567. get(runtime: RuntimeSpec): undefined | T;
  11568. has(runtime: RuntimeSpec): boolean;
  11569. set(runtime: RuntimeSpec, value: T): void;
  11570. provide(runtime: RuntimeSpec, computer: () => any): any;
  11571. delete(runtime: RuntimeSpec): void;
  11572. update(runtime: RuntimeSpec, fn: (arg0?: T) => T): void;
  11573. keys(): RuntimeSpec[];
  11574. values(): IterableIterator<T>;
  11575. get size(): number;
  11576. }
  11577. declare class RuntimeSpecSet {
  11578. constructor(iterable?: Iterable<RuntimeSpec>);
  11579. add(runtime: RuntimeSpec): void;
  11580. has(runtime: RuntimeSpec): boolean;
  11581. get size(): number;
  11582. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  11583. }
  11584. declare abstract class RuntimeTemplate {
  11585. compilation: Compilation;
  11586. outputOptions: OutputNormalized;
  11587. requestShortener: RequestShortener;
  11588. globalObject: string;
  11589. contentHashReplacement: string;
  11590. isIIFE(): undefined | boolean;
  11591. isModule(): undefined | boolean;
  11592. supportsConst(): undefined | boolean;
  11593. supportsArrowFunction(): undefined | boolean;
  11594. supportsAsyncFunction(): undefined | boolean;
  11595. supportsOptionalChaining(): undefined | boolean;
  11596. supportsForOf(): undefined | boolean;
  11597. supportsDestructuring(): undefined | boolean;
  11598. supportsBigIntLiteral(): undefined | boolean;
  11599. supportsDynamicImport(): undefined | boolean;
  11600. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  11601. supportTemplateLiteral(): undefined | boolean;
  11602. supportNodePrefixForCoreModules(): undefined | boolean;
  11603. returningFunction(returnValue: string, args?: string): string;
  11604. basicFunction(args: string, body: string | string[]): string;
  11605. concatenation(...args: (string | { expr: string })[]): string;
  11606. expressionFunction(expression: string, args?: string): string;
  11607. emptyFunction(): string;
  11608. destructureArray(items: string[], value: string): string;
  11609. destructureObject(items: string[], value: string): string;
  11610. iife(args: string, body: string): string;
  11611. forEach(variable: string, array: string, body: string | string[]): string;
  11612. /**
  11613. * Add a comment
  11614. */
  11615. comment(__0: {
  11616. /**
  11617. * request string used originally
  11618. */
  11619. request?: string;
  11620. /**
  11621. * name of the chunk referenced
  11622. */
  11623. chunkName?: string;
  11624. /**
  11625. * reason information of the chunk
  11626. */
  11627. chunkReason?: string;
  11628. /**
  11629. * additional message
  11630. */
  11631. message?: string;
  11632. /**
  11633. * name of the export
  11634. */
  11635. exportName?: string;
  11636. }): string;
  11637. throwMissingModuleErrorBlock(__0: {
  11638. /**
  11639. * request string used originally
  11640. */
  11641. request?: string;
  11642. }): string;
  11643. throwMissingModuleErrorFunction(__0: {
  11644. /**
  11645. * request string used originally
  11646. */
  11647. request?: string;
  11648. }): string;
  11649. missingModule(__0: {
  11650. /**
  11651. * request string used originally
  11652. */
  11653. request?: string;
  11654. }): string;
  11655. missingModuleStatement(__0: {
  11656. /**
  11657. * request string used originally
  11658. */
  11659. request?: string;
  11660. }): string;
  11661. missingModulePromise(__0: {
  11662. /**
  11663. * request string used originally
  11664. */
  11665. request?: string;
  11666. }): string;
  11667. weakError(__0: {
  11668. /**
  11669. * the chunk graph
  11670. */
  11671. chunkGraph: ChunkGraph;
  11672. /**
  11673. * the module
  11674. */
  11675. module: Module;
  11676. /**
  11677. * the request that should be printed as comment
  11678. */
  11679. request?: string;
  11680. /**
  11681. * expression to use as id expression
  11682. */
  11683. idExpr?: string;
  11684. /**
  11685. * which kind of code should be returned
  11686. */
  11687. type: "promise" | "expression" | "statements";
  11688. }): string;
  11689. moduleId(__0: {
  11690. /**
  11691. * the module
  11692. */
  11693. module: Module;
  11694. /**
  11695. * the chunk graph
  11696. */
  11697. chunkGraph: ChunkGraph;
  11698. /**
  11699. * the request that should be printed as comment
  11700. */
  11701. request?: string;
  11702. /**
  11703. * if the dependency is weak (will create a nice error message)
  11704. */
  11705. weak?: boolean;
  11706. }): string;
  11707. moduleRaw(__0: {
  11708. /**
  11709. * the module
  11710. */
  11711. module: null | Module;
  11712. /**
  11713. * the chunk graph
  11714. */
  11715. chunkGraph: ChunkGraph;
  11716. /**
  11717. * the request that should be printed as comment
  11718. */
  11719. request?: string;
  11720. /**
  11721. * if the dependency is weak (will create a nice error message)
  11722. */
  11723. weak?: boolean;
  11724. /**
  11725. * if set, will be filled with runtime requirements
  11726. */
  11727. runtimeRequirements: Set<string>;
  11728. }): string;
  11729. moduleExports(__0: {
  11730. /**
  11731. * the module
  11732. */
  11733. module: null | Module;
  11734. /**
  11735. * the chunk graph
  11736. */
  11737. chunkGraph: ChunkGraph;
  11738. /**
  11739. * the request that should be printed as comment
  11740. */
  11741. request: string;
  11742. /**
  11743. * if the dependency is weak (will create a nice error message)
  11744. */
  11745. weak?: boolean;
  11746. /**
  11747. * if set, will be filled with runtime requirements
  11748. */
  11749. runtimeRequirements: Set<string>;
  11750. }): string;
  11751. moduleNamespace(__0: {
  11752. /**
  11753. * the module
  11754. */
  11755. module: Module;
  11756. /**
  11757. * the chunk graph
  11758. */
  11759. chunkGraph: ChunkGraph;
  11760. /**
  11761. * the request that should be printed as comment
  11762. */
  11763. request: string;
  11764. /**
  11765. * if the current module is in strict esm mode
  11766. */
  11767. strict?: boolean;
  11768. /**
  11769. * if the dependency is weak (will create a nice error message)
  11770. */
  11771. weak?: boolean;
  11772. /**
  11773. * if set, will be filled with runtime requirements
  11774. */
  11775. runtimeRequirements: Set<string>;
  11776. }): string;
  11777. moduleNamespacePromise(__0: {
  11778. /**
  11779. * the chunk graph
  11780. */
  11781. chunkGraph: ChunkGraph;
  11782. /**
  11783. * the current dependencies block
  11784. */
  11785. block?: AsyncDependenciesBlock;
  11786. /**
  11787. * the module
  11788. */
  11789. module: Module;
  11790. /**
  11791. * the request that should be printed as comment
  11792. */
  11793. request: string;
  11794. /**
  11795. * a message for the comment
  11796. */
  11797. message: string;
  11798. /**
  11799. * if the current module is in strict esm mode
  11800. */
  11801. strict?: boolean;
  11802. /**
  11803. * if the dependency is weak (will create a nice error message)
  11804. */
  11805. weak?: boolean;
  11806. /**
  11807. * if set, will be filled with runtime requirements
  11808. */
  11809. runtimeRequirements: Set<string>;
  11810. }): string;
  11811. runtimeConditionExpression(__0: {
  11812. /**
  11813. * the chunk graph
  11814. */
  11815. chunkGraph: ChunkGraph;
  11816. /**
  11817. * runtime for which this code will be generated
  11818. */
  11819. runtime?: RuntimeSpec;
  11820. /**
  11821. * only execute the statement in some runtimes
  11822. */
  11823. runtimeCondition?: string | boolean | SortableSet<string>;
  11824. /**
  11825. * if set, will be filled with runtime requirements
  11826. */
  11827. runtimeRequirements: Set<string>;
  11828. }): string;
  11829. importStatement(__0: {
  11830. /**
  11831. * whether a new variable should be created or the existing one updated
  11832. */
  11833. update?: boolean;
  11834. /**
  11835. * the module
  11836. */
  11837. module: Module;
  11838. /**
  11839. * the chunk graph
  11840. */
  11841. chunkGraph: ChunkGraph;
  11842. /**
  11843. * the request that should be printed as comment
  11844. */
  11845. request: string;
  11846. /**
  11847. * name of the import variable
  11848. */
  11849. importVar: string;
  11850. /**
  11851. * module in which the statement is emitted
  11852. */
  11853. originModule: Module;
  11854. /**
  11855. * true, if this is a weak dependency
  11856. */
  11857. weak?: boolean;
  11858. /**
  11859. * if set, will be filled with runtime requirements
  11860. */
  11861. runtimeRequirements: Set<string>;
  11862. }): [string, string];
  11863. exportFromImport(__0: {
  11864. /**
  11865. * the module graph
  11866. */
  11867. moduleGraph: ModuleGraph;
  11868. /**
  11869. * the module
  11870. */
  11871. module: Module;
  11872. /**
  11873. * the request
  11874. */
  11875. request: string;
  11876. /**
  11877. * the export name
  11878. */
  11879. exportName: string | string[];
  11880. /**
  11881. * the origin module
  11882. */
  11883. originModule: Module;
  11884. /**
  11885. * true, if location is safe for ASI, a bracket can be emitted
  11886. */
  11887. asiSafe?: boolean;
  11888. /**
  11889. * true, if expression will be called
  11890. */
  11891. isCall: boolean;
  11892. /**
  11893. * when false, call context will not be preserved
  11894. */
  11895. callContext: null | boolean;
  11896. /**
  11897. * when true and accessing the default exports, interop code will be generated
  11898. */
  11899. defaultInterop: boolean;
  11900. /**
  11901. * the identifier name of the import variable
  11902. */
  11903. importVar: string;
  11904. /**
  11905. * init fragments will be added here
  11906. */
  11907. initFragments: InitFragment<any>[];
  11908. /**
  11909. * runtime for which this code will be generated
  11910. */
  11911. runtime: RuntimeSpec;
  11912. /**
  11913. * if set, will be filled with runtime requirements
  11914. */
  11915. runtimeRequirements: Set<string>;
  11916. }): string;
  11917. blockPromise(__0: {
  11918. /**
  11919. * the async block
  11920. */
  11921. block?: AsyncDependenciesBlock;
  11922. /**
  11923. * the message
  11924. */
  11925. message: string;
  11926. /**
  11927. * the chunk graph
  11928. */
  11929. chunkGraph: ChunkGraph;
  11930. /**
  11931. * if set, will be filled with runtime requirements
  11932. */
  11933. runtimeRequirements: Set<string>;
  11934. }): string;
  11935. asyncModuleFactory(__0: {
  11936. /**
  11937. * the async block
  11938. */
  11939. block: AsyncDependenciesBlock;
  11940. /**
  11941. * the chunk graph
  11942. */
  11943. chunkGraph: ChunkGraph;
  11944. /**
  11945. * if set, will be filled with runtime requirements
  11946. */
  11947. runtimeRequirements: Set<string>;
  11948. /**
  11949. * request string used originally
  11950. */
  11951. request?: string;
  11952. }): string;
  11953. syncModuleFactory(__0: {
  11954. /**
  11955. * the dependency
  11956. */
  11957. dependency: Dependency;
  11958. /**
  11959. * the chunk graph
  11960. */
  11961. chunkGraph: ChunkGraph;
  11962. /**
  11963. * if set, will be filled with runtime requirements
  11964. */
  11965. runtimeRequirements: Set<string>;
  11966. /**
  11967. * request string used originally
  11968. */
  11969. request?: string;
  11970. }): string;
  11971. defineEsModuleFlagStatement(__0: {
  11972. /**
  11973. * the name of the exports object
  11974. */
  11975. exportsArgument: string;
  11976. /**
  11977. * if set, will be filled with runtime requirements
  11978. */
  11979. runtimeRequirements: Set<string>;
  11980. }): string;
  11981. assetUrl(__0: {
  11982. /**
  11983. * the module
  11984. */
  11985. module: Module;
  11986. /**
  11987. * runtime
  11988. */
  11989. runtime?: RuntimeSpec;
  11990. /**
  11991. * the code generation results
  11992. */
  11993. codeGenerationResults: CodeGenerationResults;
  11994. }): string;
  11995. }
  11996. declare abstract class RuntimeValue {
  11997. fn: (arg0: {
  11998. module: NormalModule;
  11999. key: string;
  12000. readonly version?: string;
  12001. }) => CodeValuePrimitive;
  12002. options: true | RuntimeValueOptions;
  12003. get fileDependencies(): true | string[];
  12004. exec(
  12005. parser: JavascriptParser,
  12006. valueCacheVersions: Map<string, string | Set<string>>,
  12007. key: string
  12008. ): CodeValuePrimitive;
  12009. getCacheVersion(): undefined | string;
  12010. }
  12011. declare interface RuntimeValueOptions {
  12012. fileDependencies?: string[];
  12013. contextDependencies?: string[];
  12014. missingDependencies?: string[];
  12015. buildDependencies?: string[];
  12016. version?: string | (() => string);
  12017. }
  12018. /**
  12019. * Helper function for joining two ranges into a single range. This is useful
  12020. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  12021. * to create the range of the _parent node_.
  12022. */
  12023. declare interface ScopeInfo {
  12024. definitions: StackedMap<string, ScopeInfo | VariableInfo>;
  12025. topLevelScope: boolean | "arrow";
  12026. inShorthand: string | boolean;
  12027. inTaggedTemplateTag: boolean;
  12028. inTry: boolean;
  12029. isStrict: boolean;
  12030. isAsmJs: boolean;
  12031. }
  12032. declare interface Selector<A, B> {
  12033. (input: A): undefined | null | B;
  12034. }
  12035. declare abstract class Serializer {
  12036. serializeMiddlewares: SerializerMiddleware<any, any>[];
  12037. deserializeMiddlewares: SerializerMiddleware<any, any>[];
  12038. context: any;
  12039. serialize(obj?: any, context?: any): Promise<any>;
  12040. deserialize(value?: any, context?: any): Promise<any>;
  12041. }
  12042. declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
  12043. serialize(
  12044. data: DeserializedType,
  12045. context: object
  12046. ): SerializedType | Promise<SerializedType>;
  12047. deserialize(
  12048. data: SerializedType,
  12049. context: object
  12050. ): DeserializedType | Promise<DeserializedType>;
  12051. }
  12052. type ServerOptionsHttps<
  12053. Request extends typeof IncomingMessage = typeof IncomingMessage,
  12054. Response extends typeof ServerResponse = typeof ServerResponse
  12055. > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
  12056. declare class SharePlugin {
  12057. constructor(options: SharePluginOptions);
  12058. /**
  12059. * Apply the plugin
  12060. */
  12061. apply(compiler: Compiler): void;
  12062. }
  12063. /**
  12064. * Options for shared modules.
  12065. */
  12066. declare interface SharePluginOptions {
  12067. /**
  12068. * Share scope name used for all shared modules (defaults to 'default').
  12069. */
  12070. shareScope?: string;
  12071. /**
  12072. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  12073. */
  12074. shared: Shared;
  12075. }
  12076. type Shared = (string | SharedObject)[] | SharedObject;
  12077. /**
  12078. * Advanced configuration for modules that should be shared in the share scope.
  12079. */
  12080. declare interface SharedConfig {
  12081. /**
  12082. * 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.
  12083. */
  12084. eager?: boolean;
  12085. /**
  12086. * 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.
  12087. */
  12088. import?: string | false;
  12089. /**
  12090. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  12091. */
  12092. packageName?: string;
  12093. /**
  12094. * Version requirement from module in share scope.
  12095. */
  12096. requiredVersion?: string | false;
  12097. /**
  12098. * Module is looked up under this key from the share scope.
  12099. */
  12100. shareKey?: string;
  12101. /**
  12102. * Share scope name.
  12103. */
  12104. shareScope?: string;
  12105. /**
  12106. * Allow only a single version of the shared module in share scope (disabled by default).
  12107. */
  12108. singleton?: boolean;
  12109. /**
  12110. * 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).
  12111. */
  12112. strictVersion?: boolean;
  12113. /**
  12114. * Version of the provided module. Will replace lower matching versions, but not higher.
  12115. */
  12116. version?: string | false;
  12117. }
  12118. /**
  12119. * 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.
  12120. */
  12121. declare interface SharedObject {
  12122. [index: string]: string | SharedConfig;
  12123. }
  12124. declare class SideEffectsFlagPlugin {
  12125. constructor(analyseSource?: boolean);
  12126. /**
  12127. * Apply the plugin
  12128. */
  12129. apply(compiler: Compiler): void;
  12130. static moduleHasSideEffects(
  12131. moduleName: string,
  12132. flagValue: undefined | string | boolean | string[],
  12133. cache: Map<string, RegExp>
  12134. ): undefined | boolean;
  12135. }
  12136. declare class SizeOnlySource extends Source {
  12137. constructor(size: number);
  12138. }
  12139. declare abstract class Snapshot {
  12140. startTime?: number;
  12141. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  12142. fileHashes?: Map<string, null | string>;
  12143. fileTshs?: Map<string, null | string | TimestampAndHash>;
  12144. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  12145. contextHashes?: Map<string, null | string>;
  12146. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  12147. missingExistence?: Map<string, boolean>;
  12148. managedItemInfo?: Map<string, string>;
  12149. managedFiles?: Set<string>;
  12150. managedContexts?: Set<string>;
  12151. managedMissing?: Set<string>;
  12152. children?: Set<Snapshot>;
  12153. hasStartTime(): boolean;
  12154. setStartTime(value: number): void;
  12155. setMergedStartTime(value?: any, snapshot?: any): void;
  12156. hasFileTimestamps(): boolean;
  12157. setFileTimestamps(value?: any): void;
  12158. hasFileHashes(): boolean;
  12159. setFileHashes(value?: any): void;
  12160. hasFileTshs(): boolean;
  12161. setFileTshs(value?: any): void;
  12162. hasContextTimestamps(): boolean;
  12163. setContextTimestamps(value?: any): void;
  12164. hasContextHashes(): boolean;
  12165. setContextHashes(value?: any): void;
  12166. hasContextTshs(): boolean;
  12167. setContextTshs(value?: any): void;
  12168. hasMissingExistence(): boolean;
  12169. setMissingExistence(value?: any): void;
  12170. hasManagedItemInfo(): boolean;
  12171. setManagedItemInfo(value?: any): void;
  12172. hasManagedFiles(): boolean;
  12173. setManagedFiles(value?: any): void;
  12174. hasManagedContexts(): boolean;
  12175. setManagedContexts(value?: any): void;
  12176. hasManagedMissing(): boolean;
  12177. setManagedMissing(value?: any): void;
  12178. hasChildren(): boolean;
  12179. setChildren(value?: any): void;
  12180. addChild(child?: any): void;
  12181. serialize(__0: ObjectSerializerContext): void;
  12182. deserialize(__0: ObjectDeserializerContext): void;
  12183. getFileIterable(): Iterable<string>;
  12184. getContextIterable(): Iterable<string>;
  12185. getMissingIterable(): Iterable<string>;
  12186. }
  12187. declare interface SnapshotOptionsFileSystemInfo {
  12188. /**
  12189. * should use hash to snapshot
  12190. */
  12191. hash?: boolean;
  12192. /**
  12193. * should use timestamp to snapshot
  12194. */
  12195. timestamp?: boolean;
  12196. }
  12197. /**
  12198. * Options affecting how file system snapshots are created and validated.
  12199. */
  12200. declare interface SnapshotOptionsWebpackOptions {
  12201. /**
  12202. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  12203. */
  12204. buildDependencies?: {
  12205. /**
  12206. * Use hashes of the content of the files/directories to determine invalidation.
  12207. */
  12208. hash?: boolean;
  12209. /**
  12210. * Use timestamps of the files/directories to determine invalidation.
  12211. */
  12212. timestamp?: boolean;
  12213. };
  12214. /**
  12215. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  12216. */
  12217. immutablePaths?: (string | RegExp)[];
  12218. /**
  12219. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  12220. */
  12221. managedPaths?: (string | RegExp)[];
  12222. /**
  12223. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  12224. */
  12225. module?: {
  12226. /**
  12227. * Use hashes of the content of the files/directories to determine invalidation.
  12228. */
  12229. hash?: boolean;
  12230. /**
  12231. * Use timestamps of the files/directories to determine invalidation.
  12232. */
  12233. timestamp?: boolean;
  12234. };
  12235. /**
  12236. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  12237. */
  12238. resolve?: {
  12239. /**
  12240. * Use hashes of the content of the files/directories to determine invalidation.
  12241. */
  12242. hash?: boolean;
  12243. /**
  12244. * Use timestamps of the files/directories to determine invalidation.
  12245. */
  12246. timestamp?: boolean;
  12247. };
  12248. /**
  12249. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  12250. */
  12251. resolveBuildDependencies?: {
  12252. /**
  12253. * Use hashes of the content of the files/directories to determine invalidation.
  12254. */
  12255. hash?: boolean;
  12256. /**
  12257. * Use timestamps of the files/directories to determine invalidation.
  12258. */
  12259. timestamp?: boolean;
  12260. };
  12261. /**
  12262. * List of paths that are not managed by a package manager and the contents are subject to change.
  12263. */
  12264. unmanagedPaths?: (string | RegExp)[];
  12265. }
  12266. declare abstract class SortableSet<T> extends Set<T> {
  12267. /**
  12268. * Sort with a comparer function
  12269. */
  12270. sortWith(sortFn: (arg0: T, arg1: T) => number): void;
  12271. sort(): SortableSet<T>;
  12272. /**
  12273. * Get data from cache
  12274. */
  12275. getFromCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  12276. /**
  12277. * Get data from cache (ignoring sorting)
  12278. */
  12279. getFromUnorderedCache<R>(fn: (arg0: SortableSet<T>) => R): R;
  12280. toJSON(): T[];
  12281. /**
  12282. * Iterates over values in the set.
  12283. */
  12284. [Symbol.iterator](): IterableIterator<T>;
  12285. }
  12286. declare class Source {
  12287. constructor();
  12288. size(): number;
  12289. map(options?: MapOptions): null | RawSourceMap;
  12290. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  12291. updateHash(hash: Hash): void;
  12292. source(): string | Buffer;
  12293. buffer(): Buffer;
  12294. }
  12295. declare interface SourceLike {
  12296. source(): string | Buffer;
  12297. }
  12298. declare interface SourceMap {
  12299. version: number;
  12300. sources: string[];
  12301. mappings: string;
  12302. file?: string;
  12303. sourceRoot?: string;
  12304. sourcesContent?: string[];
  12305. names?: string[];
  12306. }
  12307. declare class SourceMapDevToolPlugin {
  12308. constructor(options?: SourceMapDevToolPluginOptions);
  12309. sourceMapFilename: string | false;
  12310. sourceMappingURLComment:
  12311. | string
  12312. | false
  12313. | ((arg0: PathData, arg1?: AssetInfo) => string);
  12314. moduleFilenameTemplate: string | Function;
  12315. fallbackModuleFilenameTemplate: string | Function;
  12316. namespace: string;
  12317. options: SourceMapDevToolPluginOptions;
  12318. /**
  12319. * Apply the plugin
  12320. */
  12321. apply(compiler: Compiler): void;
  12322. }
  12323. declare interface SourceMapDevToolPluginOptions {
  12324. /**
  12325. * 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.
  12326. */
  12327. append?:
  12328. | null
  12329. | string
  12330. | false
  12331. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12332. /**
  12333. * Indicates whether column mappings should be used (defaults to true).
  12334. */
  12335. columns?: boolean;
  12336. /**
  12337. * Exclude modules that match the given value from source map generation.
  12338. */
  12339. exclude?: string | RegExp | Rule[];
  12340. /**
  12341. * 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.
  12342. */
  12343. fallbackModuleFilenameTemplate?: string | Function;
  12344. /**
  12345. * Path prefix to which the [file] placeholder is relative to.
  12346. */
  12347. fileContext?: string;
  12348. /**
  12349. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  12350. */
  12351. filename?: null | string | false;
  12352. /**
  12353. * Include source maps for module paths that match the given value.
  12354. */
  12355. include?: string | RegExp | Rule[];
  12356. /**
  12357. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  12358. */
  12359. module?: boolean;
  12360. /**
  12361. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  12362. */
  12363. moduleFilenameTemplate?: string | Function;
  12364. /**
  12365. * Namespace prefix to allow multiple webpack roots in the devtools.
  12366. */
  12367. namespace?: string;
  12368. /**
  12369. * Omit the 'sourceContents' array from the SourceMap.
  12370. */
  12371. noSources?: boolean;
  12372. /**
  12373. * Provide a custom public path for the SourceMapping comment.
  12374. */
  12375. publicPath?: string;
  12376. /**
  12377. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  12378. */
  12379. sourceRoot?: string;
  12380. /**
  12381. * Include source maps for modules based on their extension (defaults to .js and .css).
  12382. */
  12383. test?: string | RegExp | Rule[];
  12384. }
  12385. declare class SourceMapSource extends Source {
  12386. constructor(
  12387. source: string | Buffer,
  12388. name: string,
  12389. sourceMap: string | Object | Buffer,
  12390. originalSource?: string | Buffer,
  12391. innerSourceMap?: string | Object | Buffer,
  12392. removeOriginalSource?: boolean
  12393. );
  12394. getArgsAsBuffers(): [
  12395. Buffer,
  12396. string,
  12397. Buffer,
  12398. undefined | Buffer,
  12399. undefined | Buffer,
  12400. boolean
  12401. ];
  12402. }
  12403. declare interface SourcePosition {
  12404. line: number;
  12405. column?: number;
  12406. }
  12407. declare interface SplitChunksOptions {
  12408. chunksFilter: (chunk: Chunk) => undefined | boolean;
  12409. defaultSizeTypes: string[];
  12410. minSize: SplitChunksSizes;
  12411. minSizeReduction: SplitChunksSizes;
  12412. minRemainingSize: SplitChunksSizes;
  12413. enforceSizeThreshold: SplitChunksSizes;
  12414. maxInitialSize: SplitChunksSizes;
  12415. maxAsyncSize: SplitChunksSizes;
  12416. minChunks: number;
  12417. maxAsyncRequests: number;
  12418. maxInitialRequests: number;
  12419. hidePathInfo: boolean;
  12420. filename: string | ((arg0: PathData, arg1?: AssetInfo) => string);
  12421. automaticNameDelimiter: string;
  12422. getCacheGroups: (
  12423. module: Module,
  12424. context: CacheGroupsContext
  12425. ) => CacheGroupSource[];
  12426. getName: (
  12427. module?: Module,
  12428. chunks?: Chunk[],
  12429. key?: string
  12430. ) => undefined | string;
  12431. usedExports: boolean;
  12432. fallbackCacheGroup: FallbackCacheGroup;
  12433. }
  12434. declare class SplitChunksPlugin {
  12435. constructor(options?: OptimizationSplitChunksOptions);
  12436. options: SplitChunksOptions;
  12437. /**
  12438. * Apply the plugin
  12439. */
  12440. apply(compiler: Compiler): void;
  12441. }
  12442. declare interface SplitChunksSizes {
  12443. [index: string]: number;
  12444. }
  12445. declare abstract class StackedMap<K, V> {
  12446. map: Map<K, InternalCell<V>>;
  12447. stack: Map<K, InternalCell<V>>[];
  12448. set(item: K, value: V): void;
  12449. delete(item: K): void;
  12450. has(item: K): boolean;
  12451. get(item: K): Cell<V>;
  12452. asArray(): K[];
  12453. asSet(): Set<K>;
  12454. asPairArray(): [K, Cell<V>][];
  12455. asMap(): Map<K, Cell<V>>;
  12456. get size(): number;
  12457. createChild(): StackedMap<K, V>;
  12458. }
  12459. type StartupRenderContext = RenderContext & { inlined: boolean };
  12460. declare interface StatFs {
  12461. (
  12462. path: PathLikeFs,
  12463. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12464. ): void;
  12465. (
  12466. path: PathLikeFs,
  12467. options: undefined | (StatOptions & { bigint?: false }),
  12468. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12469. ): void;
  12470. (
  12471. path: PathLikeFs,
  12472. options: StatOptions & { bigint: true },
  12473. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  12474. ): void;
  12475. (
  12476. path: PathLikeFs,
  12477. options: undefined | StatOptions,
  12478. callback: (
  12479. arg0: null | NodeJS.ErrnoException,
  12480. arg1?: IStats | IBigIntStats
  12481. ) => void
  12482. ): void;
  12483. }
  12484. declare interface StatOptions {
  12485. bigint?: boolean;
  12486. }
  12487. declare interface StatSync {
  12488. (path: PathLikeFs, options?: undefined): IStats;
  12489. (
  12490. path: PathLikeFs,
  12491. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  12492. ): undefined | IStats;
  12493. (
  12494. path: PathLikeFs,
  12495. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  12496. ): undefined | IBigIntStats;
  12497. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  12498. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  12499. (
  12500. path: PathLikeFs,
  12501. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  12502. ): IStats | IBigIntStats;
  12503. (
  12504. path: PathLikeFs,
  12505. options?: StatSyncOptions
  12506. ): undefined | IStats | IBigIntStats;
  12507. }
  12508. declare interface StatSyncOptions {
  12509. bigint?: boolean;
  12510. throwIfNoEntry?: boolean;
  12511. }
  12512. declare interface StatTypes {
  12513. (
  12514. path: PathLikeTypes,
  12515. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12516. ): void;
  12517. (
  12518. path: PathLikeTypes,
  12519. options: undefined | (StatOptions & { bigint?: false }),
  12520. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  12521. ): void;
  12522. (
  12523. path: PathLikeTypes,
  12524. options: StatOptions & { bigint: true },
  12525. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  12526. ): void;
  12527. (
  12528. path: PathLikeTypes,
  12529. options: undefined | StatOptions,
  12530. callback: (
  12531. arg0: null | NodeJS.ErrnoException,
  12532. arg1?: IStats | IBigIntStats
  12533. ) => void
  12534. ): void;
  12535. }
  12536. type Statement =
  12537. | FunctionDeclaration
  12538. | VariableDeclaration
  12539. | ClassDeclaration
  12540. | ExpressionStatement
  12541. | BlockStatement
  12542. | StaticBlock
  12543. | EmptyStatement
  12544. | DebuggerStatement
  12545. | WithStatement
  12546. | ReturnStatement
  12547. | LabeledStatement
  12548. | BreakStatement
  12549. | ContinueStatement
  12550. | IfStatement
  12551. | SwitchStatement
  12552. | ThrowStatement
  12553. | TryStatement
  12554. | WhileStatement
  12555. | DoWhileStatement
  12556. | ForStatement
  12557. | ForInStatement
  12558. | ForOfStatement;
  12559. type StatementPathItem =
  12560. | UnaryExpression
  12561. | ArrayExpression
  12562. | ArrowFunctionExpression
  12563. | AssignmentExpression
  12564. | AwaitExpression
  12565. | BinaryExpression
  12566. | SimpleCallExpression
  12567. | NewExpression
  12568. | ChainExpression
  12569. | ClassExpression
  12570. | ConditionalExpression
  12571. | FunctionExpression
  12572. | Identifier
  12573. | ImportExpression
  12574. | SimpleLiteral
  12575. | RegExpLiteral
  12576. | BigIntLiteral
  12577. | LogicalExpression
  12578. | MemberExpression
  12579. | MetaProperty
  12580. | ObjectExpression
  12581. | SequenceExpression
  12582. | TaggedTemplateExpression
  12583. | TemplateLiteral
  12584. | ThisExpression
  12585. | UpdateExpression
  12586. | YieldExpression
  12587. | FunctionDeclaration
  12588. | VariableDeclaration
  12589. | ClassDeclaration
  12590. | ExpressionStatement
  12591. | BlockStatement
  12592. | StaticBlock
  12593. | EmptyStatement
  12594. | DebuggerStatement
  12595. | WithStatement
  12596. | ReturnStatement
  12597. | LabeledStatement
  12598. | BreakStatement
  12599. | ContinueStatement
  12600. | IfStatement
  12601. | SwitchStatement
  12602. | ThrowStatement
  12603. | TryStatement
  12604. | WhileStatement
  12605. | DoWhileStatement
  12606. | ForStatement
  12607. | ForInStatement
  12608. | ForOfStatement
  12609. | ImportDeclaration
  12610. | ExportNamedDeclaration
  12611. | ExportDefaultDeclaration
  12612. | ExportAllDeclaration;
  12613. declare class Stats {
  12614. constructor(compilation: Compilation);
  12615. compilation: Compilation;
  12616. get hash(): string;
  12617. get startTime(): number;
  12618. get endTime(): number;
  12619. hasWarnings(): boolean;
  12620. hasErrors(): boolean;
  12621. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  12622. toString(options?: string | boolean | StatsOptions): string;
  12623. }
  12624. type StatsAsset = KnownStatsAsset & Record<string, any>;
  12625. type StatsChunk = KnownStatsChunk & Record<string, any>;
  12626. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  12627. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  12628. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  12629. type StatsError = KnownStatsError & Record<string, any>;
  12630. declare abstract class StatsFactory {
  12631. hooks: Readonly<{
  12632. extract: HookMap<SyncBailHook<[object, any, StatsFactoryContext], any>>;
  12633. filter: HookMap<
  12634. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12635. >;
  12636. sort: HookMap<
  12637. SyncBailHook<
  12638. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  12639. any
  12640. >
  12641. >;
  12642. filterSorted: HookMap<
  12643. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12644. >;
  12645. groupResults: HookMap<
  12646. SyncBailHook<[GroupConfig[], StatsFactoryContext], any>
  12647. >;
  12648. sortResults: HookMap<
  12649. SyncBailHook<
  12650. [((arg0?: any, arg1?: any) => number)[], StatsFactoryContext],
  12651. any
  12652. >
  12653. >;
  12654. filterResults: HookMap<
  12655. SyncBailHook<[any, StatsFactoryContext, number, number], any>
  12656. >;
  12657. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  12658. result: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  12659. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  12660. getItemFactory: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  12661. }>;
  12662. create(
  12663. type: string,
  12664. data: any,
  12665. baseContext: Omit<StatsFactoryContext, "type">
  12666. ): any;
  12667. }
  12668. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  12669. type StatsLogging = KnownStatsLogging & Record<string, any>;
  12670. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  12671. type StatsModule = KnownStatsModule & Record<string, any>;
  12672. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  12673. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  12674. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  12675. Record<string, any>;
  12676. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  12677. /**
  12678. * Stats options object.
  12679. */
  12680. declare interface StatsOptions {
  12681. /**
  12682. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  12683. */
  12684. all?: boolean;
  12685. /**
  12686. * Add assets information.
  12687. */
  12688. assets?: boolean;
  12689. /**
  12690. * Sort the assets by that field.
  12691. */
  12692. assetsSort?: string;
  12693. /**
  12694. * Space to display assets (groups will be collapsed to fit this space).
  12695. */
  12696. assetsSpace?: number;
  12697. /**
  12698. * Add built at time information.
  12699. */
  12700. builtAt?: boolean;
  12701. /**
  12702. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  12703. */
  12704. cached?: boolean;
  12705. /**
  12706. * Show cached assets (setting this to `false` only shows emitted files).
  12707. */
  12708. cachedAssets?: boolean;
  12709. /**
  12710. * Add information about cached (not built) modules.
  12711. */
  12712. cachedModules?: boolean;
  12713. /**
  12714. * Add children information.
  12715. */
  12716. children?: boolean;
  12717. /**
  12718. * Display auxiliary assets in chunk groups.
  12719. */
  12720. chunkGroupAuxiliary?: boolean;
  12721. /**
  12722. * Display children of chunk groups.
  12723. */
  12724. chunkGroupChildren?: boolean;
  12725. /**
  12726. * Limit of assets displayed in chunk groups.
  12727. */
  12728. chunkGroupMaxAssets?: number;
  12729. /**
  12730. * Display all chunk groups with the corresponding bundles.
  12731. */
  12732. chunkGroups?: boolean;
  12733. /**
  12734. * Add built modules information to chunk information.
  12735. */
  12736. chunkModules?: boolean;
  12737. /**
  12738. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  12739. */
  12740. chunkModulesSpace?: number;
  12741. /**
  12742. * Add the origins of chunks and chunk merging info.
  12743. */
  12744. chunkOrigins?: boolean;
  12745. /**
  12746. * Add information about parent, children and sibling chunks to chunk information.
  12747. */
  12748. chunkRelations?: boolean;
  12749. /**
  12750. * Add chunk information.
  12751. */
  12752. chunks?: boolean;
  12753. /**
  12754. * Sort the chunks by that field.
  12755. */
  12756. chunksSort?: string;
  12757. /**
  12758. * Enables/Disables colorful output.
  12759. */
  12760. colors?:
  12761. | boolean
  12762. | {
  12763. /**
  12764. * Custom color for bold text.
  12765. */
  12766. bold?: string;
  12767. /**
  12768. * Custom color for cyan text.
  12769. */
  12770. cyan?: string;
  12771. /**
  12772. * Custom color for green text.
  12773. */
  12774. green?: string;
  12775. /**
  12776. * Custom color for magenta text.
  12777. */
  12778. magenta?: string;
  12779. /**
  12780. * Custom color for red text.
  12781. */
  12782. red?: string;
  12783. /**
  12784. * Custom color for yellow text.
  12785. */
  12786. yellow?: string;
  12787. };
  12788. /**
  12789. * Context directory for request shortening.
  12790. */
  12791. context?: string;
  12792. /**
  12793. * Show chunk modules that are dependencies of other modules of the chunk.
  12794. */
  12795. dependentModules?: boolean;
  12796. /**
  12797. * Add module depth in module graph.
  12798. */
  12799. depth?: boolean;
  12800. /**
  12801. * Display the entry points with the corresponding bundles.
  12802. */
  12803. entrypoints?: boolean | "auto";
  12804. /**
  12805. * Add --env information.
  12806. */
  12807. env?: boolean;
  12808. /**
  12809. * Add details to errors (like resolving log).
  12810. */
  12811. errorDetails?: boolean | "auto";
  12812. /**
  12813. * Add internal stack trace to errors.
  12814. */
  12815. errorStack?: boolean;
  12816. /**
  12817. * Add errors.
  12818. */
  12819. errors?: boolean;
  12820. /**
  12821. * Add errors count.
  12822. */
  12823. errorsCount?: boolean;
  12824. /**
  12825. * Space to display errors (value is in number of lines).
  12826. */
  12827. errorsSpace?: number;
  12828. /**
  12829. * Please use excludeModules instead.
  12830. */
  12831. exclude?:
  12832. | string
  12833. | boolean
  12834. | RegExp
  12835. | ModuleFilterItemTypes[]
  12836. | ((
  12837. name: string,
  12838. module: StatsModule,
  12839. type: "module" | "chunk" | "root-of-chunk" | "nested"
  12840. ) => boolean);
  12841. /**
  12842. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  12843. */
  12844. excludeAssets?:
  12845. | string
  12846. | RegExp
  12847. | AssetFilterItemTypes[]
  12848. | ((name: string, asset: StatsAsset) => boolean);
  12849. /**
  12850. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  12851. */
  12852. excludeModules?:
  12853. | string
  12854. | boolean
  12855. | RegExp
  12856. | ModuleFilterItemTypes[]
  12857. | ((
  12858. name: string,
  12859. module: StatsModule,
  12860. type: "module" | "chunk" | "root-of-chunk" | "nested"
  12861. ) => boolean);
  12862. /**
  12863. * Group assets by how their are related to chunks.
  12864. */
  12865. groupAssetsByChunk?: boolean;
  12866. /**
  12867. * Group assets by their status (emitted, compared for emit or cached).
  12868. */
  12869. groupAssetsByEmitStatus?: boolean;
  12870. /**
  12871. * Group assets by their extension.
  12872. */
  12873. groupAssetsByExtension?: boolean;
  12874. /**
  12875. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  12876. */
  12877. groupAssetsByInfo?: boolean;
  12878. /**
  12879. * Group assets by their path.
  12880. */
  12881. groupAssetsByPath?: boolean;
  12882. /**
  12883. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  12884. */
  12885. groupModulesByAttributes?: boolean;
  12886. /**
  12887. * Group modules by their status (cached or built and cacheable).
  12888. */
  12889. groupModulesByCacheStatus?: boolean;
  12890. /**
  12891. * Group modules by their extension.
  12892. */
  12893. groupModulesByExtension?: boolean;
  12894. /**
  12895. * Group modules by their layer.
  12896. */
  12897. groupModulesByLayer?: boolean;
  12898. /**
  12899. * Group modules by their path.
  12900. */
  12901. groupModulesByPath?: boolean;
  12902. /**
  12903. * Group modules by their type.
  12904. */
  12905. groupModulesByType?: boolean;
  12906. /**
  12907. * Group reasons by their origin module.
  12908. */
  12909. groupReasonsByOrigin?: boolean;
  12910. /**
  12911. * Add the hash of the compilation.
  12912. */
  12913. hash?: boolean;
  12914. /**
  12915. * Add ids.
  12916. */
  12917. ids?: boolean;
  12918. /**
  12919. * Add logging output.
  12920. */
  12921. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  12922. /**
  12923. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  12924. */
  12925. loggingDebug?:
  12926. | string
  12927. | boolean
  12928. | RegExp
  12929. | FilterItemTypes[]
  12930. | ((value: string) => boolean);
  12931. /**
  12932. * Add stack traces to logging output.
  12933. */
  12934. loggingTrace?: boolean;
  12935. /**
  12936. * Add information about assets inside modules.
  12937. */
  12938. moduleAssets?: boolean;
  12939. /**
  12940. * Add dependencies and origin of warnings/errors.
  12941. */
  12942. moduleTrace?: boolean;
  12943. /**
  12944. * Add built modules information.
  12945. */
  12946. modules?: boolean;
  12947. /**
  12948. * Sort the modules by that field.
  12949. */
  12950. modulesSort?: string;
  12951. /**
  12952. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  12953. */
  12954. modulesSpace?: number;
  12955. /**
  12956. * Add information about modules nested in other modules (like with module concatenation).
  12957. */
  12958. nestedModules?: boolean;
  12959. /**
  12960. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  12961. */
  12962. nestedModulesSpace?: number;
  12963. /**
  12964. * Show reasons why optimization bailed out for modules.
  12965. */
  12966. optimizationBailout?: boolean;
  12967. /**
  12968. * Add information about orphan modules.
  12969. */
  12970. orphanModules?: boolean;
  12971. /**
  12972. * Add output path information.
  12973. */
  12974. outputPath?: boolean;
  12975. /**
  12976. * Add performance hint flags.
  12977. */
  12978. performance?: boolean;
  12979. /**
  12980. * Preset for the default values.
  12981. */
  12982. preset?: string | boolean;
  12983. /**
  12984. * Show exports provided by modules.
  12985. */
  12986. providedExports?: boolean;
  12987. /**
  12988. * Add public path information.
  12989. */
  12990. publicPath?: boolean;
  12991. /**
  12992. * Add information about the reasons why modules are included.
  12993. */
  12994. reasons?: boolean;
  12995. /**
  12996. * Space to display reasons (groups will be collapsed to fit this space).
  12997. */
  12998. reasonsSpace?: number;
  12999. /**
  13000. * Add information about assets that are related to other assets (like SourceMaps for assets).
  13001. */
  13002. relatedAssets?: boolean;
  13003. /**
  13004. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  13005. */
  13006. runtime?: boolean;
  13007. /**
  13008. * Add information about runtime modules.
  13009. */
  13010. runtimeModules?: boolean;
  13011. /**
  13012. * Add the source code of modules.
  13013. */
  13014. source?: boolean;
  13015. /**
  13016. * Add timing information.
  13017. */
  13018. timings?: boolean;
  13019. /**
  13020. * Show exports used by modules.
  13021. */
  13022. usedExports?: boolean;
  13023. /**
  13024. * Add webpack version information.
  13025. */
  13026. version?: boolean;
  13027. /**
  13028. * Add warnings.
  13029. */
  13030. warnings?: boolean;
  13031. /**
  13032. * Add warnings count.
  13033. */
  13034. warningsCount?: boolean;
  13035. /**
  13036. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  13037. */
  13038. warningsFilter?:
  13039. | string
  13040. | RegExp
  13041. | WarningFilterItemTypes[]
  13042. | ((warning: StatsError, value: string) => boolean);
  13043. /**
  13044. * Space to display warnings (value is in number of lines).
  13045. */
  13046. warningsSpace?: number;
  13047. }
  13048. declare abstract class StatsPrinter {
  13049. hooks: Readonly<{
  13050. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], true>>;
  13051. printElements: HookMap<
  13052. SyncBailHook<[PrintedElement[], StatsPrinterContext], string>
  13053. >;
  13054. sortItems: HookMap<SyncBailHook<[any[], StatsPrinterContext], true>>;
  13055. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string>>;
  13056. printItems: HookMap<SyncBailHook<[string[], StatsPrinterContext], string>>;
  13057. print: HookMap<SyncBailHook<[{}, StatsPrinterContext], string>>;
  13058. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  13059. }>;
  13060. print(type: string, object: object, baseContext?: object): string;
  13061. }
  13062. type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
  13063. type StatsProfile = KnownStatsProfile & Record<string, any>;
  13064. type StatsValue =
  13065. | boolean
  13066. | StatsOptions
  13067. | "none"
  13068. | "verbose"
  13069. | "summary"
  13070. | "errors-only"
  13071. | "errors-warnings"
  13072. | "minimal"
  13073. | "normal"
  13074. | "detailed";
  13075. declare class SyncModuleIdsPlugin {
  13076. constructor(__0: {
  13077. /**
  13078. * path to file
  13079. */
  13080. path: string;
  13081. /**
  13082. * context for module names
  13083. */
  13084. context?: string;
  13085. /**
  13086. * selector for modules
  13087. */
  13088. test: (arg0: Module) => boolean;
  13089. /**
  13090. * operation mode (defaults to merge)
  13091. */
  13092. mode?: "read" | "merge" | "create" | "update";
  13093. });
  13094. /**
  13095. * Apply the plugin
  13096. */
  13097. apply(compiler: Compiler): void;
  13098. }
  13099. declare interface SyntheticDependencyLocation {
  13100. name: string;
  13101. index?: number;
  13102. }
  13103. declare const TOMBSTONE: unique symbol;
  13104. declare const TRANSITIVE: unique symbol;
  13105. declare const TRANSITIVE_ONLY: unique symbol;
  13106. /**
  13107. * Helper function for joining two ranges into a single range. This is useful
  13108. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  13109. * to create the range of the _parent node_.
  13110. */
  13111. declare interface TagInfo {
  13112. tag: any;
  13113. data: any;
  13114. next?: TagInfo;
  13115. }
  13116. declare class Template {
  13117. constructor();
  13118. static getFunctionContent(fn: Function): string;
  13119. static toIdentifier(str: string): string;
  13120. static toComment(str: string): string;
  13121. static toNormalComment(str: string): string;
  13122. static toPath(str: string): string;
  13123. static numberToIdentifier(n: number): string;
  13124. static numberToIdentifierContinuation(n: number): string;
  13125. static indent(s: string | string[]): string;
  13126. static prefix(s: string | string[], prefix: string): string;
  13127. static asString(str: string | string[]): string;
  13128. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  13129. static renderChunkModules(
  13130. renderContext: ChunkRenderContext,
  13131. modules: Module[],
  13132. renderModule: (arg0: Module) => Source,
  13133. prefix?: string
  13134. ): null | Source;
  13135. static renderRuntimeModules(
  13136. runtimeModules: RuntimeModule[],
  13137. renderContext: RenderContext & {
  13138. codeGenerationResults?: CodeGenerationResults;
  13139. }
  13140. ): Source;
  13141. static renderChunkRuntimeModules(
  13142. runtimeModules: RuntimeModule[],
  13143. renderContext: RenderContext
  13144. ): Source;
  13145. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  13146. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  13147. }
  13148. declare interface TimestampAndHash {
  13149. safeTime: number;
  13150. timestamp?: number;
  13151. hash: string;
  13152. }
  13153. declare class TopLevelSymbol {
  13154. constructor(name: string);
  13155. name: string;
  13156. }
  13157. /**
  13158. * Use a Trusted Types policy to create urls for chunks.
  13159. */
  13160. declare interface TrustedTypes {
  13161. /**
  13162. * 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'.
  13163. */
  13164. onPolicyCreationFailure?: "continue" | "stop";
  13165. /**
  13166. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  13167. */
  13168. policyName?: string;
  13169. }
  13170. declare const UNDEFINED_MARKER: unique symbol;
  13171. /**
  13172. * `URL` class is a global reference for `require('url').URL`
  13173. * https://nodejs.org/api/url.html#the-whatwg-url-api
  13174. */
  13175. declare interface URL_url extends URL {}
  13176. declare interface UnsafeCacheData {
  13177. factoryMeta?: FactoryMeta;
  13178. resolveOptions?: ResolveOptions;
  13179. }
  13180. declare interface UpdateHashContextDependency {
  13181. chunkGraph: ChunkGraph;
  13182. runtime: RuntimeSpec;
  13183. runtimeTemplate?: RuntimeTemplate;
  13184. }
  13185. declare interface UpdateHashContextGenerator {
  13186. /**
  13187. * the module
  13188. */
  13189. module: NormalModule;
  13190. chunkGraph: ChunkGraph;
  13191. runtime: RuntimeSpec;
  13192. runtimeTemplate?: RuntimeTemplate;
  13193. }
  13194. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  13195. declare abstract class VariableInfo {
  13196. declaredScope: ScopeInfo;
  13197. freeName?: string | true;
  13198. tagInfo?: TagInfo;
  13199. }
  13200. declare interface VariableInfoInterface {
  13201. declaredScope: ScopeInfo;
  13202. freeName: string | true;
  13203. tagInfo?: TagInfo;
  13204. }
  13205. type WarningFilterItemTypes =
  13206. | string
  13207. | RegExp
  13208. | ((warning: StatsError, value: string) => boolean);
  13209. declare interface WatchFileSystem {
  13210. watch: (
  13211. files: Iterable<string>,
  13212. directories: Iterable<string>,
  13213. missing: Iterable<string>,
  13214. startTime: number,
  13215. options: WatchOptions,
  13216. callback: (
  13217. arg0: null | Error,
  13218. arg1: Map<string, FileSystemInfoEntry | "ignore">,
  13219. arg2: Map<string, FileSystemInfoEntry | "ignore">,
  13220. arg3: Set<string>,
  13221. arg4: Set<string>
  13222. ) => void,
  13223. callbackUndelayed: (arg0: string, arg1: number) => void
  13224. ) => Watcher;
  13225. }
  13226. declare class WatchIgnorePlugin {
  13227. constructor(options: WatchIgnorePluginOptions);
  13228. paths: (string | RegExp)[];
  13229. /**
  13230. * Apply the plugin
  13231. */
  13232. apply(compiler: Compiler): void;
  13233. }
  13234. declare interface WatchIgnorePluginOptions {
  13235. /**
  13236. * A list of RegExps or absolute paths to directories or files that should be ignored.
  13237. */
  13238. paths: (string | RegExp)[];
  13239. }
  13240. /**
  13241. * Options for the watcher.
  13242. */
  13243. declare interface WatchOptions {
  13244. /**
  13245. * Delay the rebuilt after the first change. Value is a time in ms.
  13246. */
  13247. aggregateTimeout?: number;
  13248. /**
  13249. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  13250. */
  13251. followSymlinks?: boolean;
  13252. /**
  13253. * Ignore some files from watching (glob pattern or regexp).
  13254. */
  13255. ignored?: string | RegExp | string[];
  13256. /**
  13257. * Enable polling mode for watching.
  13258. */
  13259. poll?: number | boolean;
  13260. /**
  13261. * Stop watching when stdin stream has ended.
  13262. */
  13263. stdin?: boolean;
  13264. }
  13265. declare interface Watcher {
  13266. /**
  13267. * closes the watcher and all underlying file watchers
  13268. */
  13269. close: () => void;
  13270. /**
  13271. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  13272. */
  13273. pause: () => void;
  13274. /**
  13275. * get current aggregated changes that have not yet send to callback
  13276. */
  13277. getAggregatedChanges?: () => Set<string>;
  13278. /**
  13279. * get current aggregated removals that have not yet send to callback
  13280. */
  13281. getAggregatedRemovals?: () => Set<string>;
  13282. /**
  13283. * get info about files
  13284. */
  13285. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  13286. /**
  13287. * get info about directories
  13288. */
  13289. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  13290. /**
  13291. * get info about timestamps and changes
  13292. */
  13293. getInfo?: () => WatcherInfo;
  13294. }
  13295. declare interface WatcherInfo {
  13296. /**
  13297. * get current aggregated changes that have not yet send to callback
  13298. */
  13299. changes: Set<string>;
  13300. /**
  13301. * get current aggregated removals that have not yet send to callback
  13302. */
  13303. removals: Set<string>;
  13304. /**
  13305. * get info about files
  13306. */
  13307. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  13308. /**
  13309. * get info about directories
  13310. */
  13311. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  13312. }
  13313. declare abstract class Watching {
  13314. startTime: null | number;
  13315. invalid: boolean;
  13316. handler: CallbackFunction_1<Stats>;
  13317. callbacks: CallbackFunction_1<void>[];
  13318. closed: boolean;
  13319. suspended: boolean;
  13320. blocked: boolean;
  13321. watchOptions: {
  13322. /**
  13323. * Delay the rebuilt after the first change. Value is a time in ms.
  13324. */
  13325. aggregateTimeout?: number;
  13326. /**
  13327. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  13328. */
  13329. followSymlinks?: boolean;
  13330. /**
  13331. * Ignore some files from watching (glob pattern or regexp).
  13332. */
  13333. ignored?: string | RegExp | string[];
  13334. /**
  13335. * Enable polling mode for watching.
  13336. */
  13337. poll?: number | boolean;
  13338. /**
  13339. * Stop watching when stdin stream has ended.
  13340. */
  13341. stdin?: boolean;
  13342. };
  13343. compiler: Compiler;
  13344. running: boolean;
  13345. watcher?: null | Watcher;
  13346. pausedWatcher?: null | Watcher;
  13347. lastWatcherStartTime?: number;
  13348. watch(
  13349. files: Iterable<string>,
  13350. dirs: Iterable<string>,
  13351. missing: Iterable<string>
  13352. ): void;
  13353. invalidate(callback?: CallbackFunction_1<void>): void;
  13354. suspend(): void;
  13355. resume(): void;
  13356. close(callback: CallbackFunction_1<void>): void;
  13357. }
  13358. declare abstract class WeakTupleMap<T extends any[], V> {
  13359. set(...args: [T, ...V[]]): void;
  13360. has(...args: T): boolean;
  13361. get(...args: T): undefined | V;
  13362. provide(...args: [T, ...(() => V)[]]): V;
  13363. delete(...args: T): void;
  13364. clear(): void;
  13365. }
  13366. declare interface WebAssemblyRenderContext {
  13367. /**
  13368. * the chunk
  13369. */
  13370. chunk: Chunk;
  13371. /**
  13372. * the dependency templates
  13373. */
  13374. dependencyTemplates: DependencyTemplates;
  13375. /**
  13376. * the runtime template
  13377. */
  13378. runtimeTemplate: RuntimeTemplate;
  13379. /**
  13380. * the module graph
  13381. */
  13382. moduleGraph: ModuleGraph;
  13383. /**
  13384. * the chunk graph
  13385. */
  13386. chunkGraph: ChunkGraph;
  13387. /**
  13388. * results of code generation
  13389. */
  13390. codeGenerationResults: CodeGenerationResults;
  13391. }
  13392. declare class WebWorkerTemplatePlugin {
  13393. constructor();
  13394. /**
  13395. * Apply the plugin
  13396. */
  13397. apply(compiler: Compiler): void;
  13398. }
  13399. declare class WebpackError extends Error {
  13400. /**
  13401. * Creates an instance of WebpackError.
  13402. */
  13403. constructor(message?: string);
  13404. details?: string;
  13405. module?: null | Module;
  13406. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  13407. hideStack?: boolean;
  13408. chunk?: Chunk;
  13409. file?: string;
  13410. serialize(__0: ObjectSerializerContext): void;
  13411. deserialize(__0: ObjectDeserializerContext): void;
  13412. /**
  13413. * Create .stack property on a target object
  13414. */
  13415. static captureStackTrace(
  13416. targetObject: object,
  13417. constructorOpt?: Function
  13418. ): void;
  13419. /**
  13420. * Optional override for formatting stack traces
  13421. */
  13422. static prepareStackTrace?: (
  13423. err: Error,
  13424. stackTraces: NodeJS.CallSite[]
  13425. ) => any;
  13426. static stackTraceLimit: number;
  13427. }
  13428. declare abstract class WebpackLogger {
  13429. getChildLogger: (arg0: string | (() => string)) => WebpackLogger;
  13430. error(...args: any[]): void;
  13431. warn(...args: any[]): void;
  13432. info(...args: any[]): void;
  13433. log(...args: any[]): void;
  13434. debug(...args: any[]): void;
  13435. assert(assertion: any, ...args: any[]): void;
  13436. trace(): void;
  13437. clear(): void;
  13438. status(...args: any[]): void;
  13439. group(...args: any[]): void;
  13440. groupCollapsed(...args: any[]): void;
  13441. groupEnd(...args: any[]): void;
  13442. profile(label?: string): void;
  13443. profileEnd(label?: string): void;
  13444. time(label: string): void;
  13445. timeLog(label?: string): void;
  13446. timeEnd(label?: string): void;
  13447. timeAggregate(label?: string): void;
  13448. timeAggregateEnd(label?: string): void;
  13449. }
  13450. declare class WebpackOptionsApply extends OptionsApply {
  13451. constructor();
  13452. }
  13453. declare class WebpackOptionsDefaulter {
  13454. constructor();
  13455. process(options: Configuration): WebpackOptionsNormalized;
  13456. }
  13457. /**
  13458. * Normalized webpack options object.
  13459. */
  13460. declare interface WebpackOptionsNormalized {
  13461. /**
  13462. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  13463. */
  13464. amd?: false | { [index: string]: any };
  13465. /**
  13466. * Report the first error as a hard error instead of tolerating it.
  13467. */
  13468. bail?: boolean;
  13469. /**
  13470. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  13471. */
  13472. cache: CacheOptionsNormalized;
  13473. /**
  13474. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  13475. */
  13476. context?: string;
  13477. /**
  13478. * References to other configurations to depend on.
  13479. */
  13480. dependencies?: string[];
  13481. /**
  13482. * Options for the webpack-dev-server.
  13483. */
  13484. devServer?: false | { [index: string]: any };
  13485. /**
  13486. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  13487. */
  13488. devtool?: string | false;
  13489. /**
  13490. * The entry point(s) of the compilation.
  13491. */
  13492. entry: EntryNormalized;
  13493. /**
  13494. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  13495. */
  13496. experiments: ExperimentsNormalized;
  13497. /**
  13498. * 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`.
  13499. */
  13500. externals: Externals;
  13501. /**
  13502. * Enable presets of externals for specific targets.
  13503. */
  13504. externalsPresets: ExternalsPresets;
  13505. /**
  13506. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  13507. */
  13508. externalsType?:
  13509. | "import"
  13510. | "var"
  13511. | "module"
  13512. | "assign"
  13513. | "this"
  13514. | "window"
  13515. | "self"
  13516. | "global"
  13517. | "commonjs"
  13518. | "commonjs2"
  13519. | "commonjs-module"
  13520. | "commonjs-static"
  13521. | "amd"
  13522. | "amd-require"
  13523. | "umd"
  13524. | "umd2"
  13525. | "jsonp"
  13526. | "system"
  13527. | "promise"
  13528. | "script"
  13529. | "node-commonjs";
  13530. /**
  13531. * Ignore specific warnings.
  13532. */
  13533. ignoreWarnings?: ((
  13534. warning: WebpackError,
  13535. compilation: Compilation
  13536. ) => boolean)[];
  13537. /**
  13538. * Options for infrastructure level logging.
  13539. */
  13540. infrastructureLogging: InfrastructureLogging;
  13541. /**
  13542. * Custom values available in the loader context.
  13543. */
  13544. loader?: Loader;
  13545. /**
  13546. * Enable production optimizations or development hints.
  13547. */
  13548. mode?: "none" | "development" | "production";
  13549. /**
  13550. * Options affecting the normal modules (`NormalModuleFactory`).
  13551. */
  13552. module: ModuleOptionsNormalized;
  13553. /**
  13554. * Name of the configuration. Used when loading multiple configurations.
  13555. */
  13556. name?: string;
  13557. /**
  13558. * Include polyfills or mocks for various node stuff.
  13559. */
  13560. node: Node;
  13561. /**
  13562. * Enables/Disables integrated optimizations.
  13563. */
  13564. optimization: Optimization;
  13565. /**
  13566. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  13567. */
  13568. output: OutputNormalized;
  13569. /**
  13570. * The number of parallel processed modules in the compilation.
  13571. */
  13572. parallelism?: number;
  13573. /**
  13574. * Configuration for web performance recommendations.
  13575. */
  13576. performance?: false | PerformanceOptions;
  13577. /**
  13578. * Add additional plugins to the compiler.
  13579. */
  13580. plugins: (
  13581. | undefined
  13582. | null
  13583. | false
  13584. | ""
  13585. | 0
  13586. | ((this: Compiler, compiler: Compiler) => void)
  13587. | WebpackPluginInstance
  13588. )[];
  13589. /**
  13590. * Capture timing information for each module.
  13591. */
  13592. profile?: boolean;
  13593. /**
  13594. * Store compiler state to a json file.
  13595. */
  13596. recordsInputPath?: string | false;
  13597. /**
  13598. * Load compiler state from a json file.
  13599. */
  13600. recordsOutputPath?: string | false;
  13601. /**
  13602. * Options for the resolver.
  13603. */
  13604. resolve: ResolveOptions;
  13605. /**
  13606. * Options for the resolver when resolving loaders.
  13607. */
  13608. resolveLoader: ResolveOptions;
  13609. /**
  13610. * Options affecting how file system snapshots are created and validated.
  13611. */
  13612. snapshot: SnapshotOptionsWebpackOptions;
  13613. /**
  13614. * Stats options object or preset name.
  13615. */
  13616. stats: StatsValue;
  13617. /**
  13618. * Environment to build for. An array of environments to build for all of them when possible.
  13619. */
  13620. target?: string | false | string[];
  13621. /**
  13622. * Enter watch mode, which rebuilds on file change.
  13623. */
  13624. watch?: boolean;
  13625. /**
  13626. * Options for the watcher.
  13627. */
  13628. watchOptions: WatchOptions;
  13629. }
  13630. /**
  13631. * Plugin instance.
  13632. */
  13633. declare interface WebpackPluginInstance {
  13634. [index: string]: any;
  13635. /**
  13636. * The run point of the plugin, required method.
  13637. */
  13638. apply: (compiler: Compiler) => void;
  13639. }
  13640. declare interface WithId {
  13641. id: string | number;
  13642. }
  13643. declare interface WithOptions {
  13644. /**
  13645. * create a resolver with additional/different options
  13646. */
  13647. withOptions: (
  13648. arg0: Partial<ResolveOptionsWithDependencyType>
  13649. ) => ResolverWithOptions;
  13650. }
  13651. declare interface WriteFile {
  13652. (
  13653. file: PathOrFileDescriptorFs,
  13654. data:
  13655. | string
  13656. | Uint8Array
  13657. | Uint8ClampedArray
  13658. | Uint16Array
  13659. | Uint32Array
  13660. | Int8Array
  13661. | Int16Array
  13662. | Int32Array
  13663. | BigUint64Array
  13664. | BigInt64Array
  13665. | Float32Array
  13666. | Float64Array
  13667. | DataView,
  13668. options: WriteFileOptions,
  13669. callback: (arg0: null | NodeJS.ErrnoException) => void
  13670. ): void;
  13671. (
  13672. file: PathOrFileDescriptorFs,
  13673. data:
  13674. | string
  13675. | Uint8Array
  13676. | Uint8ClampedArray
  13677. | Uint16Array
  13678. | Uint32Array
  13679. | Int8Array
  13680. | Int16Array
  13681. | Int32Array
  13682. | BigUint64Array
  13683. | BigInt64Array
  13684. | Float32Array
  13685. | Float64Array
  13686. | DataView,
  13687. callback: (arg0: null | NodeJS.ErrnoException) => void
  13688. ): void;
  13689. }
  13690. type WriteFileOptions =
  13691. | null
  13692. | "ascii"
  13693. | "utf8"
  13694. | "utf-8"
  13695. | "utf16le"
  13696. | "utf-16le"
  13697. | "ucs2"
  13698. | "ucs-2"
  13699. | "latin1"
  13700. | "binary"
  13701. | "base64"
  13702. | "base64url"
  13703. | "hex"
  13704. | (ObjectEncodingOptions &
  13705. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  13706. declare interface WriteOnlySet<T> {
  13707. add: (item: T) => void;
  13708. }
  13709. declare interface WriteStreamOptions {
  13710. flags?: string;
  13711. encoding?:
  13712. | "ascii"
  13713. | "utf8"
  13714. | "utf-8"
  13715. | "utf16le"
  13716. | "utf-16le"
  13717. | "ucs2"
  13718. | "ucs-2"
  13719. | "latin1"
  13720. | "binary"
  13721. | "base64"
  13722. | "base64url"
  13723. | "hex";
  13724. fd?: any;
  13725. mode?: number;
  13726. autoClose?: boolean;
  13727. emitClose?: boolean;
  13728. start?: number;
  13729. signal?: null | AbortSignal;
  13730. fs?: null | CreateWriteStreamFSImplementation;
  13731. }
  13732. type __TypeWebpackOptions = (data: object) =>
  13733. | string
  13734. | {
  13735. /**
  13736. * Unique loader options identifier.
  13737. */
  13738. ident?: string;
  13739. /**
  13740. * Loader name.
  13741. */
  13742. loader?: string;
  13743. /**
  13744. * Loader options.
  13745. */
  13746. options?: string | { [index: string]: any };
  13747. }
  13748. | __TypeWebpackOptions
  13749. | __Type_2[];
  13750. type __Type_2 =
  13751. | undefined
  13752. | null
  13753. | string
  13754. | false
  13755. | 0
  13756. | {
  13757. /**
  13758. * Unique loader options identifier.
  13759. */
  13760. ident?: string;
  13761. /**
  13762. * Loader name.
  13763. */
  13764. loader?: string;
  13765. /**
  13766. * Loader options.
  13767. */
  13768. options?: string | { [index: string]: any };
  13769. }
  13770. | ((data: object) =>
  13771. | string
  13772. | {
  13773. /**
  13774. * Unique loader options identifier.
  13775. */
  13776. ident?: string;
  13777. /**
  13778. * Loader name.
  13779. */
  13780. loader?: string;
  13781. /**
  13782. * Loader options.
  13783. */
  13784. options?: string | { [index: string]: any };
  13785. }
  13786. | __TypeWebpackOptions
  13787. | __Type_2[]);
  13788. declare function exports(
  13789. options: Configuration,
  13790. callback?: CallbackWebpack<Stats>
  13791. ): Compiler;
  13792. declare function exports(
  13793. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  13794. callback?: CallbackWebpack<MultiStats>
  13795. ): MultiCompiler;
  13796. declare namespace exports {
  13797. export const webpack: {
  13798. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  13799. (
  13800. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  13801. callback?: CallbackWebpack<MultiStats>
  13802. ): MultiCompiler;
  13803. };
  13804. export const validate: (options?: any) => void;
  13805. export const validateSchema: (
  13806. schema: Parameters<typeof validateFunction>[0],
  13807. options: Parameters<typeof validateFunction>[1],
  13808. validationConfiguration?: ValidationErrorConfiguration
  13809. ) => void;
  13810. export const version: string;
  13811. export namespace cli {
  13812. export let getArguments: (schema?: any) => Record<string, Argument>;
  13813. export let processArguments: (
  13814. args: Record<string, Argument>,
  13815. config: any,
  13816. values: Record<
  13817. string,
  13818. | string
  13819. | number
  13820. | boolean
  13821. | RegExp
  13822. | (string | number | boolean | RegExp)[]
  13823. >
  13824. ) => null | Problem[];
  13825. }
  13826. export namespace ModuleFilenameHelpers {
  13827. export let ALL_LOADERS_RESOURCE: string;
  13828. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  13829. export let LOADERS_RESOURCE: string;
  13830. export let REGEXP_LOADERS_RESOURCE: RegExp;
  13831. export let RESOURCE: string;
  13832. export let REGEXP_RESOURCE: RegExp;
  13833. export let ABSOLUTE_RESOURCE_PATH: string;
  13834. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  13835. export let RESOURCE_PATH: string;
  13836. export let REGEXP_RESOURCE_PATH: RegExp;
  13837. export let ALL_LOADERS: string;
  13838. export let REGEXP_ALL_LOADERS: RegExp;
  13839. export let LOADERS: string;
  13840. export let REGEXP_LOADERS: RegExp;
  13841. export let QUERY: string;
  13842. export let REGEXP_QUERY: RegExp;
  13843. export let ID: string;
  13844. export let REGEXP_ID: RegExp;
  13845. export let HASH: string;
  13846. export let REGEXP_HASH: RegExp;
  13847. export let NAMESPACE: string;
  13848. export let REGEXP_NAMESPACE: RegExp;
  13849. export let createFilename: (
  13850. module: string | Module,
  13851. options: any,
  13852. __2: {
  13853. /**
  13854. * requestShortener
  13855. */
  13856. requestShortener: RequestShortener;
  13857. /**
  13858. * chunk graph
  13859. */
  13860. chunkGraph: ChunkGraph;
  13861. /**
  13862. * the hash function to use
  13863. */
  13864. hashFunction?: string | typeof Hash;
  13865. }
  13866. ) => string;
  13867. export let replaceDuplicates: <T>(
  13868. array: T[],
  13869. fn: (
  13870. duplicateItem: T,
  13871. duplicateItemIndex: number,
  13872. numberOfTimesReplaced: number
  13873. ) => T,
  13874. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  13875. ) => T[];
  13876. export let matchPart: (str: string, test: Matcher) => boolean;
  13877. export let matchObject: (obj: MatchObject, str: string) => boolean;
  13878. }
  13879. export namespace OptimizationStages {
  13880. export let STAGE_BASIC: -10;
  13881. export let STAGE_DEFAULT: 0;
  13882. export let STAGE_ADVANCED: 10;
  13883. }
  13884. export namespace RuntimeGlobals {
  13885. export let require: "__webpack_require__";
  13886. export let requireScope: "__webpack_require__.*";
  13887. export let exports: "__webpack_exports__";
  13888. export let thisAsExports: "top-level-this-exports";
  13889. export let returnExportsFromRuntime: "return-exports-from-runtime";
  13890. export let module: "module";
  13891. export let moduleId: "module.id";
  13892. export let moduleLoaded: "module.loaded";
  13893. export let publicPath: "__webpack_require__.p";
  13894. export let entryModuleId: "__webpack_require__.s";
  13895. export let moduleCache: "__webpack_require__.c";
  13896. export let moduleFactories: "__webpack_require__.m";
  13897. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  13898. export let ensureChunk: "__webpack_require__.e";
  13899. export let ensureChunkHandlers: "__webpack_require__.f";
  13900. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  13901. export let prefetchChunk: "__webpack_require__.E";
  13902. export let prefetchChunkHandlers: "__webpack_require__.F";
  13903. export let preloadChunk: "__webpack_require__.G";
  13904. export let preloadChunkHandlers: "__webpack_require__.H";
  13905. export let definePropertyGetters: "__webpack_require__.d";
  13906. export let makeNamespaceObject: "__webpack_require__.r";
  13907. export let createFakeNamespaceObject: "__webpack_require__.t";
  13908. export let compatGetDefaultExport: "__webpack_require__.n";
  13909. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  13910. export let nodeModuleDecorator: "__webpack_require__.nmd";
  13911. export let getFullHash: "__webpack_require__.h";
  13912. export let wasmInstances: "__webpack_require__.w";
  13913. export let instantiateWasm: "__webpack_require__.v";
  13914. export let uncaughtErrorHandler: "__webpack_require__.oe";
  13915. export let scriptNonce: "__webpack_require__.nc";
  13916. export let loadScript: "__webpack_require__.l";
  13917. export let createScript: "__webpack_require__.ts";
  13918. export let createScriptUrl: "__webpack_require__.tu";
  13919. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  13920. export let hasFetchPriority: "has fetch priority";
  13921. export let chunkName: "__webpack_require__.cn";
  13922. export let runtimeId: "__webpack_require__.j";
  13923. export let getChunkScriptFilename: "__webpack_require__.u";
  13924. export let getChunkCssFilename: "__webpack_require__.k";
  13925. export let hasCssModules: "has css modules";
  13926. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  13927. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  13928. export let startup: "__webpack_require__.x";
  13929. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  13930. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  13931. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  13932. export let chunkCallback: "webpackChunk";
  13933. export let startupEntrypoint: "__webpack_require__.X";
  13934. export let onChunksLoaded: "__webpack_require__.O";
  13935. export let externalInstallChunk: "__webpack_require__.C";
  13936. export let interceptModuleExecution: "__webpack_require__.i";
  13937. export let global: "__webpack_require__.g";
  13938. export let shareScopeMap: "__webpack_require__.S";
  13939. export let initializeSharing: "__webpack_require__.I";
  13940. export let currentRemoteGetScope: "__webpack_require__.R";
  13941. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  13942. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  13943. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  13944. export let hmrModuleData: "__webpack_require__.hmrD";
  13945. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  13946. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  13947. export let amdDefine: "__webpack_require__.amdD";
  13948. export let amdOptions: "__webpack_require__.amdO";
  13949. export let system: "__webpack_require__.System";
  13950. export let hasOwnProperty: "__webpack_require__.o";
  13951. export let systemContext: "__webpack_require__.y";
  13952. export let baseURI: "__webpack_require__.b";
  13953. export let relativeUrl: "__webpack_require__.U";
  13954. export let asyncModule: "__webpack_require__.a";
  13955. }
  13956. export const UsageState: Readonly<{
  13957. Unused: 0;
  13958. OnlyPropertiesUsed: 1;
  13959. NoInfo: 2;
  13960. Unknown: 3;
  13961. Used: 4;
  13962. }>;
  13963. export namespace cache {
  13964. export { MemoryCachePlugin };
  13965. }
  13966. export namespace config {
  13967. export const getNormalizedWebpackOptions: (
  13968. config: Configuration
  13969. ) => WebpackOptionsNormalized;
  13970. export const applyWebpackOptionsDefaults: (
  13971. options: WebpackOptionsNormalized,
  13972. compilerIndex?: number
  13973. ) => ResolvedOptions;
  13974. }
  13975. export namespace dependencies {
  13976. export {
  13977. ModuleDependency,
  13978. HarmonyImportDependency,
  13979. ConstDependency,
  13980. NullDependency
  13981. };
  13982. }
  13983. export namespace ids {
  13984. export {
  13985. ChunkModuleIdRangePlugin,
  13986. NaturalModuleIdsPlugin,
  13987. OccurrenceModuleIdsPlugin,
  13988. NamedModuleIdsPlugin,
  13989. DeterministicChunkIdsPlugin,
  13990. DeterministicModuleIdsPlugin,
  13991. NamedChunkIdsPlugin,
  13992. OccurrenceChunkIdsPlugin,
  13993. HashedModuleIdsPlugin
  13994. };
  13995. }
  13996. export namespace javascript {
  13997. export {
  13998. EnableChunkLoadingPlugin,
  13999. JavascriptModulesPlugin,
  14000. JavascriptParser
  14001. };
  14002. }
  14003. export namespace optimize {
  14004. export namespace InnerGraph {
  14005. export let bailout: (parserState: ParserState) => void;
  14006. export let enable: (parserState: ParserState) => void;
  14007. export let isEnabled: (parserState: ParserState) => boolean;
  14008. export let addUsage: (
  14009. state: ParserState,
  14010. symbol: null | TopLevelSymbol,
  14011. usage: string | true | TopLevelSymbol
  14012. ) => void;
  14013. export let addVariableUsage: (
  14014. parser: JavascriptParser,
  14015. name: string,
  14016. usage: string | true | TopLevelSymbol
  14017. ) => void;
  14018. export let inferDependencyUsage: (state: ParserState) => void;
  14019. export let onUsage: (
  14020. state: ParserState,
  14021. onUsageCallback: (arg0?: boolean | Set<string>) => void
  14022. ) => void;
  14023. export let setTopLevelSymbol: (
  14024. state: ParserState,
  14025. symbol?: TopLevelSymbol
  14026. ) => void;
  14027. export let getTopLevelSymbol: (
  14028. state: ParserState
  14029. ) => void | TopLevelSymbol;
  14030. export let tagTopLevelSymbol: (
  14031. parser: JavascriptParser,
  14032. name: string
  14033. ) => undefined | TopLevelSymbol;
  14034. export let isDependencyUsedByExports: (
  14035. dependency: Dependency,
  14036. usedByExports: boolean | Set<string>,
  14037. moduleGraph: ModuleGraph,
  14038. runtime: RuntimeSpec
  14039. ) => boolean;
  14040. export let getDependencyUsedByExportsCondition: (
  14041. dependency: Dependency,
  14042. usedByExports: undefined | boolean | Set<string>,
  14043. moduleGraph: ModuleGraph
  14044. ) =>
  14045. | null
  14046. | false
  14047. | ((arg0: ModuleGraphConnection, arg1: RuntimeSpec) => ConnectionState);
  14048. export { TopLevelSymbol, topLevelSymbolTag };
  14049. }
  14050. export {
  14051. AggressiveMergingPlugin,
  14052. AggressiveSplittingPlugin,
  14053. LimitChunkCountPlugin,
  14054. MinChunkSizePlugin,
  14055. ModuleConcatenationPlugin,
  14056. RealContentHashPlugin,
  14057. RuntimeChunkPlugin,
  14058. SideEffectsFlagPlugin,
  14059. SplitChunksPlugin
  14060. };
  14061. }
  14062. export namespace runtime {
  14063. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  14064. }
  14065. export namespace prefetch {
  14066. export { ChunkPrefetchPreloadPlugin };
  14067. }
  14068. export namespace web {
  14069. export {
  14070. FetchCompileAsyncWasmPlugin,
  14071. FetchCompileWasmPlugin,
  14072. JsonpChunkLoadingRuntimeModule,
  14073. JsonpTemplatePlugin
  14074. };
  14075. }
  14076. export namespace webworker {
  14077. export { WebWorkerTemplatePlugin };
  14078. }
  14079. export namespace node {
  14080. export {
  14081. NodeEnvironmentPlugin,
  14082. NodeSourcePlugin,
  14083. NodeTargetPlugin,
  14084. NodeTemplatePlugin,
  14085. ReadFileCompileWasmPlugin
  14086. };
  14087. }
  14088. export namespace electron {
  14089. export { ElectronTargetPlugin };
  14090. }
  14091. export namespace wasm {
  14092. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  14093. }
  14094. export namespace library {
  14095. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  14096. }
  14097. export namespace container {
  14098. export const scope: <T>(
  14099. scope: string,
  14100. options: ContainerOptionsFormat<T>
  14101. ) => Record<string, string | string[] | T>;
  14102. export {
  14103. ContainerPlugin,
  14104. ContainerReferencePlugin,
  14105. ModuleFederationPlugin
  14106. };
  14107. }
  14108. export namespace sharing {
  14109. export const scope: <T>(
  14110. scope: string,
  14111. options: ContainerOptionsFormat<T>
  14112. ) => Record<string, string | string[] | T>;
  14113. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  14114. }
  14115. export namespace debug {
  14116. export { ProfilingPlugin };
  14117. }
  14118. export namespace util {
  14119. export const createHash: (algorithm: string | typeof Hash) => Hash;
  14120. export namespace comparators {
  14121. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  14122. export let compareModulesByIdentifier: (
  14123. a: Module,
  14124. b: Module
  14125. ) => 0 | 1 | -1;
  14126. export let compareModulesById: ParameterizedComparator<
  14127. ChunkGraph,
  14128. Module
  14129. >;
  14130. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  14131. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  14132. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  14133. ModuleGraph,
  14134. Module
  14135. >;
  14136. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  14137. ModuleGraph,
  14138. Module
  14139. >;
  14140. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  14141. ChunkGraph,
  14142. Module
  14143. >;
  14144. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  14145. export let compareIds: (
  14146. a: string | number,
  14147. b: string | number
  14148. ) => 0 | 1 | -1;
  14149. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  14150. export let compareChunkGroupsByIndex: (
  14151. a: ChunkGroup,
  14152. b: ChunkGroup
  14153. ) => 0 | 1 | -1;
  14154. export let concatComparators: <T>(
  14155. c1: Comparator<T>,
  14156. c2: Comparator<T>,
  14157. ...cRest: Comparator<T>[]
  14158. ) => Comparator<T>;
  14159. export let compareSelect: <T, R>(
  14160. getter: Selector<T, R>,
  14161. comparator: Comparator<R>
  14162. ) => Comparator<T>;
  14163. export let compareIterables: <T>(
  14164. elementComparator: Comparator<T>
  14165. ) => Comparator<Iterable<T>>;
  14166. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  14167. export let compareChunksNatural: (
  14168. chunkGraph: ChunkGraph
  14169. ) => Comparator<Chunk>;
  14170. export let compareLocations: (
  14171. a: DependencyLocation,
  14172. b: DependencyLocation
  14173. ) => 0 | 1 | -1;
  14174. }
  14175. export namespace runtime {
  14176. export let getEntryRuntime: (
  14177. compilation: Compilation,
  14178. name: string,
  14179. options?: EntryOptions
  14180. ) => RuntimeSpec;
  14181. export let forEachRuntime: (
  14182. runtime: RuntimeSpec,
  14183. fn: (arg0?: string) => void,
  14184. deterministicOrder?: boolean
  14185. ) => void;
  14186. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  14187. export let keyToRuntime: (key: string) => RuntimeSpec;
  14188. export let runtimeToString: (runtime: RuntimeSpec) => string;
  14189. export let runtimeConditionToString: (
  14190. runtimeCondition: RuntimeCondition
  14191. ) => string;
  14192. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  14193. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  14194. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  14195. export let mergeRuntimeCondition: (
  14196. a: RuntimeCondition,
  14197. b: RuntimeCondition,
  14198. runtime: RuntimeSpec
  14199. ) => RuntimeCondition;
  14200. export let mergeRuntimeConditionNonFalse: (
  14201. a: undefined | string | true | SortableSet<string>,
  14202. b: undefined | string | true | SortableSet<string>,
  14203. runtime: RuntimeSpec
  14204. ) => undefined | string | true | SortableSet<string>;
  14205. export let mergeRuntimeOwned: (
  14206. a: RuntimeSpec,
  14207. b: RuntimeSpec
  14208. ) => RuntimeSpec;
  14209. export let intersectRuntime: (
  14210. a: RuntimeSpec,
  14211. b: RuntimeSpec
  14212. ) => RuntimeSpec;
  14213. export let subtractRuntime: (
  14214. a: RuntimeSpec,
  14215. b: RuntimeSpec
  14216. ) => RuntimeSpec;
  14217. export let subtractRuntimeCondition: (
  14218. a: RuntimeCondition,
  14219. b: RuntimeCondition,
  14220. runtime: RuntimeSpec
  14221. ) => RuntimeCondition;
  14222. export let filterRuntime: (
  14223. runtime: RuntimeSpec,
  14224. filter: (arg0: RuntimeSpec) => boolean
  14225. ) => undefined | string | boolean | SortableSet<string>;
  14226. export { RuntimeSpecMap, RuntimeSpecSet };
  14227. }
  14228. export namespace serialization {
  14229. export const register: (
  14230. Constructor: Constructor,
  14231. request: string,
  14232. name: null | string,
  14233. serializer: ObjectSerializer
  14234. ) => void;
  14235. export const registerLoader: (
  14236. regExp: RegExp,
  14237. loader: (arg0: string) => boolean
  14238. ) => void;
  14239. export const registerNotSerializable: (Constructor: Constructor) => void;
  14240. export const NOT_SERIALIZABLE: object;
  14241. export const buffersSerializer: Serializer;
  14242. export let createFileSerializer: (
  14243. fs: IntermediateFileSystem,
  14244. hashFunction: string | typeof Hash
  14245. ) => Serializer;
  14246. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  14247. }
  14248. export const cleverMerge: <T, O>(first: T, second: O) => T | O | (T & O);
  14249. export function compileBooleanMatcher(
  14250. map: Record<string | number, boolean>
  14251. ): boolean | ((arg0: string) => string);
  14252. export namespace compileBooleanMatcher {
  14253. export let fromLists: (
  14254. positiveItems: string[],
  14255. negativeItems: string[]
  14256. ) => (arg0: string) => string;
  14257. export let itemsToRegexp: (itemsArr: string[]) => string;
  14258. }
  14259. export { LazySet };
  14260. }
  14261. export namespace sources {
  14262. export {
  14263. Source,
  14264. RawSource,
  14265. OriginalSource,
  14266. ReplaceSource,
  14267. SourceMapSource,
  14268. ConcatSource,
  14269. PrefixSource,
  14270. CachedSource,
  14271. SizeOnlySource,
  14272. CompatSource
  14273. };
  14274. }
  14275. export namespace experiments {
  14276. export namespace schemes {
  14277. export { HttpUriPlugin };
  14278. }
  14279. export namespace ids {
  14280. export { SyncModuleIdsPlugin };
  14281. }
  14282. }
  14283. export type WebpackPluginFunction = (
  14284. this: Compiler,
  14285. compiler: Compiler
  14286. ) => void;
  14287. export {
  14288. AutomaticPrefetchPlugin,
  14289. AsyncDependenciesBlock,
  14290. BannerPlugin,
  14291. Cache,
  14292. Chunk,
  14293. ChunkGraph,
  14294. CleanPlugin,
  14295. Compilation,
  14296. Compiler,
  14297. ConcatenationScope,
  14298. ContextExclusionPlugin,
  14299. ContextReplacementPlugin,
  14300. DefinePlugin,
  14301. DelegatedPlugin,
  14302. Dependency,
  14303. DllPlugin,
  14304. DllReferencePlugin,
  14305. DynamicEntryPlugin,
  14306. EntryOptionPlugin,
  14307. EntryPlugin,
  14308. EnvironmentPlugin,
  14309. EvalDevToolModulePlugin,
  14310. EvalSourceMapDevToolPlugin,
  14311. ExternalModule,
  14312. ExternalsPlugin,
  14313. Generator,
  14314. HotUpdateChunk,
  14315. HotModuleReplacementPlugin,
  14316. InitFragment,
  14317. IgnorePlugin,
  14318. JavascriptModulesPlugin,
  14319. LibManifestPlugin,
  14320. LibraryTemplatePlugin,
  14321. LoaderOptionsPlugin,
  14322. LoaderTargetPlugin,
  14323. Module,
  14324. ModuleGraph,
  14325. ModuleGraphConnection,
  14326. NoEmitOnErrorsPlugin,
  14327. NormalModule,
  14328. NormalModuleReplacementPlugin,
  14329. MultiCompiler,
  14330. Parser,
  14331. PlatformPlugin,
  14332. PrefetchPlugin,
  14333. ProgressPlugin,
  14334. ProvidePlugin,
  14335. RuntimeModule,
  14336. EntryPlugin as SingleEntryPlugin,
  14337. SourceMapDevToolPlugin,
  14338. Stats,
  14339. Template,
  14340. WatchIgnorePlugin,
  14341. WebpackError,
  14342. WebpackOptionsApply,
  14343. WebpackOptionsDefaulter,
  14344. ValidationError as WebpackOptionsValidationError,
  14345. ValidationError,
  14346. Entry,
  14347. EntryNormalized,
  14348. EntryObject,
  14349. ExternalItemFunctionData,
  14350. ExternalItemObjectKnown,
  14351. ExternalItemObjectUnknown,
  14352. ExternalItemValue,
  14353. Externals,
  14354. FileCacheOptions,
  14355. LibraryOptions,
  14356. MemoryCacheOptions,
  14357. ModuleOptions,
  14358. ResolveOptions,
  14359. RuleSetCondition,
  14360. RuleSetConditionAbsolute,
  14361. RuleSetRule,
  14362. RuleSetUse,
  14363. RuleSetUseItem,
  14364. StatsOptions,
  14365. Configuration,
  14366. WebpackOptionsNormalized,
  14367. WebpackPluginInstance,
  14368. ChunkGroup,
  14369. Asset,
  14370. AssetInfo,
  14371. EntryOptions,
  14372. PathData,
  14373. AssetEmittedInfo,
  14374. MultiCompilerOptions,
  14375. MultiStats,
  14376. ResolveData,
  14377. ParserState,
  14378. ResolvePluginInstance,
  14379. Resolver,
  14380. Watching,
  14381. Argument,
  14382. Problem,
  14383. StatsAsset,
  14384. StatsChunk,
  14385. StatsChunkGroup,
  14386. StatsChunkOrigin,
  14387. StatsCompilation,
  14388. StatsError,
  14389. StatsLogging,
  14390. StatsLoggingEntry,
  14391. StatsModule,
  14392. StatsModuleIssuer,
  14393. StatsModuleReason,
  14394. StatsModuleTraceDependency,
  14395. StatsModuleTraceItem,
  14396. StatsProfile,
  14397. InputFileSystem,
  14398. OutputFileSystem,
  14399. LoaderModule,
  14400. RawLoaderDefinition,
  14401. LoaderDefinition,
  14402. LoaderDefinitionFunction,
  14403. PitchLoaderDefinitionFunction,
  14404. RawLoaderDefinitionFunction,
  14405. LoaderContext
  14406. };
  14407. }
  14408. declare const topLevelSymbolTag: unique symbol;
  14409. export = exports;