types.d.ts 488 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn fix:special` to update
  5. */
  6. import { Parser as ParserImport } from "acorn";
  7. import { Buffer } from "buffer";
  8. import { Scope } from "eslint-scope";
  9. import {
  10. ArrayExpression,
  11. ArrayPattern,
  12. ArrowFunctionExpression,
  13. AssignmentExpression,
  14. AssignmentPattern,
  15. AssignmentProperty,
  16. AwaitExpression,
  17. BigIntLiteral,
  18. BinaryExpression,
  19. BlockStatement,
  20. BreakStatement,
  21. CatchClause,
  22. ChainExpression,
  23. ClassBody,
  24. ClassDeclaration,
  25. ClassExpression,
  26. Comment as CommentImport,
  27. ConditionalExpression,
  28. ContinueStatement,
  29. DebuggerStatement,
  30. Directive,
  31. DoWhileStatement,
  32. EmptyStatement,
  33. ExportAllDeclaration,
  34. ExportDefaultDeclaration,
  35. ExportNamedDeclaration,
  36. ExportSpecifier,
  37. ExpressionStatement,
  38. ForInStatement,
  39. ForOfStatement,
  40. ForStatement,
  41. FunctionDeclaration,
  42. FunctionExpression,
  43. Identifier,
  44. IfStatement,
  45. ImportDeclaration,
  46. ImportDefaultSpecifier,
  47. ImportExpression as ImportExpressionImport,
  48. ImportNamespaceSpecifier,
  49. ImportSpecifier,
  50. LabeledStatement,
  51. LogicalExpression,
  52. MaybeNamedClassDeclaration,
  53. MaybeNamedFunctionDeclaration,
  54. MemberExpression,
  55. MetaProperty,
  56. MethodDefinition,
  57. NewExpression,
  58. ObjectExpression,
  59. ObjectPattern,
  60. PrivateIdentifier,
  61. Program,
  62. Property,
  63. PropertyDefinition,
  64. RegExpLiteral,
  65. RestElement,
  66. ReturnStatement,
  67. SequenceExpression,
  68. SimpleCallExpression,
  69. SimpleLiteral,
  70. SourceLocation,
  71. SpreadElement,
  72. StaticBlock,
  73. Super,
  74. SwitchCase,
  75. SwitchStatement,
  76. TaggedTemplateExpression,
  77. TemplateElement,
  78. TemplateLiteral,
  79. ThisExpression,
  80. ThrowStatement,
  81. TryStatement,
  82. UnaryExpression,
  83. UpdateExpression,
  84. VariableDeclaration,
  85. VariableDeclarator,
  86. WhileStatement,
  87. WithStatement,
  88. YieldExpression
  89. } from "estree";
  90. import {
  91. IncomingMessage,
  92. Server as ServerImportHttp,
  93. ServerOptions as ServerOptionsImportHttp
  94. } from "http";
  95. import {
  96. Server as ServerImportHttps,
  97. ServerOptions as ServerOptionsImportHttps
  98. } from "https";
  99. import {
  100. Session as SessionImportInspectorClass_1,
  101. Session as SessionImportInspectorClass_2
  102. } from "inspector";
  103. import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
  104. import { ListenOptions } from "net";
  105. import {
  106. ValidationErrorConfiguration,
  107. validate as validateFunction
  108. } from "schema-utils";
  109. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  110. import {
  111. AsArray,
  112. AsyncParallelHook,
  113. AsyncSeriesBailHook,
  114. AsyncSeriesHook,
  115. AsyncSeriesWaterfallHook,
  116. HookMap,
  117. IfSet,
  118. MultiHook,
  119. SyncBailHook,
  120. SyncHook,
  121. SyncWaterfallHook,
  122. TapOptions,
  123. TypedHookMap
  124. } from "tapable";
  125. import { URL } from "url";
  126. import { Context as ContextImport } from "vm";
  127. declare interface Abortable {
  128. signal?: AbortSignal;
  129. }
  130. declare class AbstractLibraryPlugin<T> {
  131. constructor(__0: AbstractLibraryPluginOptions);
  132. /**
  133. * Apply the plugin
  134. */
  135. apply(compiler: Compiler): void;
  136. parseOptions(library: LibraryOptions): T;
  137. finishEntryModule(
  138. module: Module,
  139. entryName: string,
  140. libraryContext: LibraryContext<T>
  141. ): void;
  142. embedInRuntimeBailout(
  143. module: Module,
  144. renderContext: RenderContextJavascriptModulesPlugin,
  145. libraryContext: LibraryContext<T>
  146. ): undefined | string;
  147. strictRuntimeBailout(
  148. renderContext: RenderContextJavascriptModulesPlugin,
  149. libraryContext: LibraryContext<T>
  150. ): undefined | string;
  151. runtimeRequirements(
  152. chunk: Chunk,
  153. set: Set<string>,
  154. libraryContext: LibraryContext<T>
  155. ): void;
  156. render(
  157. source: Source,
  158. renderContext: RenderContextJavascriptModulesPlugin,
  159. libraryContext: LibraryContext<T>
  160. ): Source;
  161. renderStartup(
  162. source: Source,
  163. module: Module,
  164. renderContext: StartupRenderContext,
  165. libraryContext: LibraryContext<T>
  166. ): Source;
  167. renderModuleContent(
  168. source: Source,
  169. module: Module,
  170. renderContext: ModuleRenderContext,
  171. libraryContext: Omit<LibraryContext<T>, "options">
  172. ): Source;
  173. chunkHash(
  174. chunk: Chunk,
  175. hash: Hash,
  176. chunkHashContext: ChunkHashContext,
  177. libraryContext: LibraryContext<T>
  178. ): void;
  179. static COMMON_LIBRARY_NAME_MESSAGE: string;
  180. }
  181. declare interface AbstractLibraryPluginOptions {
  182. /**
  183. * name of the plugin
  184. */
  185. pluginName: string;
  186. /**
  187. * used library type
  188. */
  189. type: string;
  190. }
  191. declare interface AdditionalData {
  192. [index: string]: any;
  193. webpackAST: object;
  194. }
  195. type AfterContextResolveData = ContextResolveData &
  196. ContextOptions & {
  197. resource: string | string[];
  198. resourceQuery?: string;
  199. resourceFragment?: string;
  200. resolveDependencies: (
  201. fs: InputFileSystem,
  202. options: ContextModuleOptions,
  203. callback: (
  204. err: null | Error,
  205. dependencies?: ContextElementDependency[]
  206. ) => void
  207. ) => void;
  208. };
  209. declare class AggressiveMergingPlugin {
  210. constructor(options?: AggressiveMergingPluginOptions);
  211. options: AggressiveMergingPluginOptions;
  212. /**
  213. * Apply the plugin
  214. */
  215. apply(compiler: Compiler): void;
  216. }
  217. declare interface AggressiveMergingPluginOptions {
  218. /**
  219. * minimal size reduction to trigger merging
  220. */
  221. minSizeReduce?: number;
  222. }
  223. declare class AggressiveSplittingPlugin {
  224. constructor(options?: AggressiveSplittingPluginOptions);
  225. options: AggressiveSplittingPluginOptions;
  226. /**
  227. * Apply the plugin
  228. */
  229. apply(compiler: Compiler): void;
  230. static wasChunkRecorded(chunk: Chunk): boolean;
  231. }
  232. declare interface AggressiveSplittingPluginOptions {
  233. /**
  234. * Extra cost for each chunk (Default: 9.8kiB).
  235. */
  236. chunkOverhead?: number;
  237. /**
  238. * Extra cost multiplicator for entry chunks (Default: 10).
  239. */
  240. entryChunkMultiplicator?: number;
  241. /**
  242. * Byte, max size of per file (Default: 50kiB).
  243. */
  244. maxSize?: number;
  245. /**
  246. * Byte, split point. (Default: 30kiB).
  247. */
  248. minSize?: number;
  249. }
  250. type Alias = string | false | string[];
  251. declare interface AliasOption {
  252. alias: Alias;
  253. name: string;
  254. onlyModule?: boolean;
  255. }
  256. type AliasOptionNewRequest = string | false | string[];
  257. declare interface AliasOptions {
  258. [index: string]: AliasOptionNewRequest;
  259. }
  260. declare interface AllCodeGenerationSchemas {
  261. /**
  262. * top level declarations for javascript modules
  263. */
  264. topLevelDeclarations: Set<string>;
  265. /**
  266. * chunk init fragments for javascript modules
  267. */
  268. chunkInitFragments: InitFragment<any>[];
  269. /**
  270. * url for css and javascript modules
  271. */
  272. url: { javascript?: string; "css-url"?: string };
  273. /**
  274. * a filename for asset modules
  275. */
  276. filename: string;
  277. /**
  278. * an asset info for asset modules
  279. */
  280. assetInfo: AssetInfo;
  281. /**
  282. * a full content hash for asset modules
  283. */
  284. fullContentHash: string;
  285. /**
  286. * share-init for modules federation
  287. */
  288. "share-init": [{ shareScope: string; initStage: number; init: string }];
  289. }
  290. type AnyLoaderContext = NormalModuleLoaderContext<any> &
  291. LoaderRunnerLoaderContext<any> &
  292. LoaderPluginLoaderContext &
  293. HotModuleReplacementPluginLoaderContext;
  294. declare abstract class AppendOnlyStackedSet<T> {
  295. add(el: T): void;
  296. has(el: T): boolean;
  297. clear(): void;
  298. createChild(): AppendOnlyStackedSet<T>;
  299. [Symbol.iterator](): Iterator<T>;
  300. }
  301. declare interface Argument {
  302. description?: string;
  303. simpleType: SimpleType;
  304. multiple: boolean;
  305. configs: ArgumentConfig[];
  306. }
  307. declare interface ArgumentConfig {
  308. description?: string;
  309. negatedDescription?: string;
  310. path: string;
  311. multiple: boolean;
  312. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  313. values?: EnumValue[];
  314. }
  315. declare interface Asset {
  316. /**
  317. * the filename of the asset
  318. */
  319. name: string;
  320. /**
  321. * source of the asset
  322. */
  323. source: Source;
  324. /**
  325. * info about the asset
  326. */
  327. info: AssetInfo;
  328. }
  329. declare abstract class AssetBytesGenerator extends Generator {
  330. generateError(
  331. error: Error,
  332. module: NormalModule,
  333. generateContext: GenerateContext
  334. ): null | Source;
  335. }
  336. declare abstract class AssetBytesParser extends ParserClass {}
  337. declare interface AssetDependencyMeta {
  338. sourceType: "css-url";
  339. }
  340. declare interface AssetEmittedInfo {
  341. content: Buffer;
  342. source: Source;
  343. compilation: Compilation;
  344. outputPath: string;
  345. targetPath: string;
  346. }
  347. type AssetFilterItemTypes =
  348. | string
  349. | RegExp
  350. | ((name: string, asset: StatsAsset) => boolean);
  351. declare abstract class AssetGenerator extends Generator {
  352. dataUrlOptions?:
  353. | AssetGeneratorDataUrlOptions
  354. | ((
  355. source: string | Buffer,
  356. context: { filename: string; module: Module }
  357. ) => string);
  358. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  359. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  360. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  361. emit?: boolean;
  362. getMimeType(module: NormalModule): string;
  363. generateDataUri(module: NormalModule): string;
  364. generateError(
  365. error: Error,
  366. module: NormalModule,
  367. generateContext: GenerateContext
  368. ): null | Source;
  369. }
  370. /**
  371. * Options object for data url generation.
  372. */
  373. declare interface AssetGeneratorDataUrlOptions {
  374. /**
  375. * Asset encoding (defaults to base64).
  376. */
  377. encoding?: false | "base64";
  378. /**
  379. * Asset mimetype (getting from file extension by default).
  380. */
  381. mimetype?: string;
  382. }
  383. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  384. AssetResourceGeneratorOptions;
  385. type AssetInfo = KnownAssetInfo & Record<string, any>;
  386. /**
  387. * Generator options for asset/inline modules.
  388. */
  389. declare interface AssetInlineGeneratorOptions {
  390. /**
  391. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  392. */
  393. binary?: boolean;
  394. /**
  395. * The options for data url generator.
  396. */
  397. dataUrl?:
  398. | AssetGeneratorDataUrlOptions
  399. | ((
  400. source: string | Buffer,
  401. context: { filename: string; module: Module }
  402. ) => string);
  403. }
  404. declare abstract class AssetParser extends ParserClass {
  405. dataUrlCondition?:
  406. | boolean
  407. | AssetParserDataUrlOptions
  408. | ((
  409. source: string | Buffer,
  410. context: { filename: string; module: Module }
  411. ) => boolean);
  412. }
  413. /**
  414. * Options object for DataUrl condition.
  415. */
  416. declare interface AssetParserDataUrlOptions {
  417. /**
  418. * Maximum size of asset that should be inline as modules. Default: 8kb.
  419. */
  420. maxSize?: number;
  421. }
  422. /**
  423. * Parser options for asset modules.
  424. */
  425. declare interface AssetParserOptions {
  426. /**
  427. * The condition for inlining the asset as DataUrl.
  428. */
  429. dataUrlCondition?:
  430. | AssetParserDataUrlOptions
  431. | ((
  432. source: string | Buffer,
  433. context: { filename: string; module: Module }
  434. ) => boolean);
  435. }
  436. /**
  437. * Generator options for asset/resource modules.
  438. */
  439. declare interface AssetResourceGeneratorOptions {
  440. /**
  441. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  442. */
  443. binary?: boolean;
  444. /**
  445. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  446. */
  447. emit?: boolean;
  448. /**
  449. * 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.
  450. */
  451. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  452. /**
  453. * 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.
  454. */
  455. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  456. /**
  457. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  458. */
  459. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  460. }
  461. declare abstract class AssetSourceGenerator extends Generator {
  462. generateError(
  463. error: Error,
  464. module: NormalModule,
  465. generateContext: GenerateContext
  466. ): null | Source;
  467. }
  468. declare abstract class AssetSourceParser extends ParserClass {}
  469. declare class AsyncDependenciesBlock extends DependenciesBlock {
  470. constructor(
  471. groupOptions: null | string | GroupOptionsAsyncDependenciesBlock,
  472. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  473. request?: null | string
  474. );
  475. groupOptions: GroupOptionsAsyncDependenciesBlock;
  476. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  477. request?: null | string;
  478. chunkName?: null | string;
  479. get circular(): boolean;
  480. module: any;
  481. }
  482. declare abstract class AsyncQueue<T, K, R> {
  483. hooks: {
  484. beforeAdd: AsyncSeriesHook<[T]>;
  485. added: SyncHook<[T]>;
  486. beforeStart: AsyncSeriesHook<[T]>;
  487. started: SyncHook<[T]>;
  488. result: SyncHook<
  489. [T, undefined | null | WebpackError, undefined | null | R]
  490. >;
  491. };
  492. getContext(): string;
  493. setContext(value: string): void;
  494. add(item: T, callback: CallbackAsyncQueue<R>): void;
  495. invalidate(item: T): void;
  496. /**
  497. * Waits for an already started item
  498. */
  499. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  500. stop(): void;
  501. increaseParallelism(): void;
  502. decreaseParallelism(): void;
  503. isProcessing(item: T): boolean;
  504. isQueued(item: T): boolean;
  505. isDone(item: T): boolean;
  506. clear(): void;
  507. }
  508. declare class AsyncWebAssemblyModulesPlugin {
  509. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  510. options: AsyncWebAssemblyModulesPluginOptions;
  511. /**
  512. * Apply the plugin
  513. */
  514. apply(compiler: Compiler): void;
  515. renderModule(
  516. module: Module,
  517. renderContext: WebAssemblyRenderContext,
  518. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  519. ): Source;
  520. static getCompilationHooks(
  521. compilation: Compilation
  522. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  523. }
  524. declare interface AsyncWebAssemblyModulesPluginOptions {
  525. /**
  526. * mangle imports
  527. */
  528. mangleImports?: boolean;
  529. }
  530. declare abstract class AsyncWebAssemblyParser extends ParserClass {}
  531. declare class AutomaticPrefetchPlugin {
  532. constructor();
  533. /**
  534. * Apply the plugin
  535. */
  536. apply(compiler: Compiler): void;
  537. }
  538. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  539. declare interface BackendApi {
  540. dispose: (callback: (err?: null | Error) => void) => void;
  541. module: (module: Module) => ModuleResult;
  542. }
  543. declare class BannerPlugin {
  544. constructor(options: BannerPluginArgument);
  545. options: BannerPluginOptions;
  546. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  547. /**
  548. * Apply the plugin
  549. */
  550. apply(compiler: Compiler): void;
  551. }
  552. type BannerPluginArgument =
  553. | string
  554. | BannerPluginOptions
  555. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  556. declare interface BannerPluginOptions {
  557. /**
  558. * Specifies the banner.
  559. */
  560. banner:
  561. | string
  562. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  563. /**
  564. * If true, the banner will only be added to the entry chunks.
  565. */
  566. entryOnly?: boolean;
  567. /**
  568. * Exclude all modules matching any of these conditions.
  569. */
  570. exclude?: string | RegExp | ((str: string) => boolean) | Rule[];
  571. /**
  572. * If true, banner will be placed at the end of the output.
  573. */
  574. footer?: boolean;
  575. /**
  576. * Include all modules matching any of these conditions.
  577. */
  578. include?: string | RegExp | ((str: string) => boolean) | Rule[];
  579. /**
  580. * If true, banner will not be wrapped in a comment.
  581. */
  582. raw?: boolean;
  583. /**
  584. * Specifies the stage when add a banner.
  585. */
  586. stage?: number;
  587. /**
  588. * Include all modules that pass test assertion.
  589. */
  590. test?: string | RegExp | ((str: string) => boolean) | Rule[];
  591. }
  592. declare interface BaseResolveRequest {
  593. /**
  594. * path
  595. */
  596. path: string | false;
  597. /**
  598. * content
  599. */
  600. context?: ContextTypes;
  601. /**
  602. * description file path
  603. */
  604. descriptionFilePath?: string;
  605. /**
  606. * description file root
  607. */
  608. descriptionFileRoot?: string;
  609. /**
  610. * description file data
  611. */
  612. descriptionFileData?: JsonObjectTypes;
  613. /**
  614. * tsconfig paths map
  615. */
  616. tsconfigPathsMap?: null | TsconfigPathsMap;
  617. /**
  618. * relative path
  619. */
  620. relativePath?: string;
  621. /**
  622. * true when need to ignore symlinks, otherwise false
  623. */
  624. ignoreSymlinks?: boolean;
  625. /**
  626. * true when full specified, otherwise false
  627. */
  628. fullySpecified?: boolean;
  629. /**
  630. * inner request for internal usage
  631. */
  632. __innerRequest?: string;
  633. /**
  634. * inner request for internal usage
  635. */
  636. __innerRequest_request?: string;
  637. /**
  638. * inner relative path for internal usage
  639. */
  640. __innerRequest_relativePath?: string;
  641. }
  642. declare abstract class BasicEvaluatedExpression {
  643. type: number;
  644. range?: [number, number];
  645. falsy: boolean;
  646. truthy: boolean;
  647. nullish?: boolean;
  648. sideEffects: boolean;
  649. bool?: boolean;
  650. number?: number;
  651. bigint?: bigint;
  652. regExp?: RegExp;
  653. string?: string;
  654. quasis?: BasicEvaluatedExpression[];
  655. parts?: BasicEvaluatedExpression[];
  656. array?: any[];
  657. items?: BasicEvaluatedExpression[];
  658. options?: BasicEvaluatedExpression[];
  659. prefix?: null | BasicEvaluatedExpression;
  660. postfix?: null | BasicEvaluatedExpression;
  661. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  662. identifier?: string | VariableInfo;
  663. rootInfo?: string | VariableInfo;
  664. getMembers?: () => string[];
  665. getMembersOptionals?: () => boolean[];
  666. getMemberRanges?: () => [number, number][];
  667. expression?:
  668. | Program
  669. | ImportDeclaration
  670. | ExportNamedDeclaration
  671. | ExportAllDeclaration
  672. | ImportExpressionImport
  673. | UnaryExpression
  674. | ArrayExpression
  675. | ArrowFunctionExpression
  676. | AssignmentExpression
  677. | AwaitExpression
  678. | BinaryExpression
  679. | SimpleCallExpression
  680. | NewExpression
  681. | ChainExpression
  682. | ClassExpression
  683. | ConditionalExpression
  684. | FunctionExpression
  685. | Identifier
  686. | SimpleLiteral
  687. | RegExpLiteral
  688. | BigIntLiteral
  689. | LogicalExpression
  690. | MemberExpression
  691. | MetaProperty
  692. | ObjectExpression
  693. | SequenceExpression
  694. | TaggedTemplateExpression
  695. | TemplateLiteral
  696. | ThisExpression
  697. | UpdateExpression
  698. | YieldExpression
  699. | SpreadElement
  700. | PrivateIdentifier
  701. | Super
  702. | FunctionDeclaration
  703. | VariableDeclaration
  704. | ClassDeclaration
  705. | ExpressionStatement
  706. | BlockStatement
  707. | StaticBlock
  708. | EmptyStatement
  709. | DebuggerStatement
  710. | WithStatement
  711. | ReturnStatement
  712. | LabeledStatement
  713. | BreakStatement
  714. | ContinueStatement
  715. | IfStatement
  716. | SwitchStatement
  717. | ThrowStatement
  718. | TryStatement
  719. | WhileStatement
  720. | DoWhileStatement
  721. | ForStatement
  722. | ForInStatement
  723. | ForOfStatement
  724. | ExportDefaultDeclaration
  725. | MethodDefinition
  726. | PropertyDefinition
  727. | VariableDeclarator
  728. | ObjectPattern
  729. | ArrayPattern
  730. | RestElement
  731. | AssignmentPattern
  732. | SwitchCase
  733. | CatchClause
  734. | Property
  735. | AssignmentProperty
  736. | ClassBody
  737. | ImportSpecifier
  738. | ImportDefaultSpecifier
  739. | ImportNamespaceSpecifier
  740. | ExportSpecifier
  741. | TemplateElement;
  742. isUnknown(): boolean;
  743. isNull(): boolean;
  744. isUndefined(): boolean;
  745. isString(): boolean;
  746. isNumber(): boolean;
  747. isBigInt(): boolean;
  748. isBoolean(): boolean;
  749. isRegExp(): boolean;
  750. isConditional(): boolean;
  751. isArray(): boolean;
  752. isConstArray(): boolean;
  753. isIdentifier(): boolean;
  754. isWrapped(): boolean;
  755. isTemplateString(): boolean;
  756. /**
  757. * Is expression a primitive or an object type value?
  758. */
  759. isPrimitiveType(): undefined | boolean;
  760. /**
  761. * Is expression a runtime or compile-time value?
  762. */
  763. isCompileTimeValue(): boolean;
  764. /**
  765. * Gets the compile-time value of the expression
  766. */
  767. asCompileTimeValue():
  768. | undefined
  769. | null
  770. | string
  771. | number
  772. | bigint
  773. | boolean
  774. | RegExp
  775. | any[];
  776. isTruthy(): boolean;
  777. isFalsy(): boolean;
  778. isNullish(): undefined | boolean;
  779. /**
  780. * Can this expression have side effects?
  781. */
  782. couldHaveSideEffects(): boolean;
  783. /**
  784. * Creates a boolean representation of this evaluated expression.
  785. */
  786. asBool(): undefined | boolean;
  787. /**
  788. * Creates a nullish coalescing representation of this evaluated expression.
  789. */
  790. asNullish(): undefined | boolean;
  791. /**
  792. * Creates a string representation of this evaluated expression.
  793. */
  794. asString(): undefined | string;
  795. setString(string: string): BasicEvaluatedExpression;
  796. setUndefined(): BasicEvaluatedExpression;
  797. setNull(): BasicEvaluatedExpression;
  798. /**
  799. * Set's the value of this expression to a number
  800. */
  801. setNumber(number: number): BasicEvaluatedExpression;
  802. /**
  803. * Set's the value of this expression to a BigInt
  804. */
  805. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  806. /**
  807. * Set's the value of this expression to a boolean
  808. */
  809. setBoolean(bool: boolean): BasicEvaluatedExpression;
  810. /**
  811. * Set's the value of this expression to a regular expression
  812. */
  813. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  814. /**
  815. * Set's the value of this expression to a particular identifier and its members.
  816. */
  817. setIdentifier(
  818. identifier: string | VariableInfo,
  819. rootInfo: string | VariableInfo,
  820. getMembers: () => string[],
  821. getMembersOptionals?: () => boolean[],
  822. getMemberRanges?: () => [number, number][]
  823. ): BasicEvaluatedExpression;
  824. /**
  825. * Wraps an array of expressions with a prefix and postfix expression.
  826. */
  827. setWrapped(
  828. prefix?: null | BasicEvaluatedExpression,
  829. postfix?: null | BasicEvaluatedExpression,
  830. innerExpressions?: BasicEvaluatedExpression[]
  831. ): BasicEvaluatedExpression;
  832. /**
  833. * Stores the options of a conditional expression.
  834. */
  835. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  836. /**
  837. * Adds options to a conditional expression.
  838. */
  839. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  840. /**
  841. * Set's the value of this expression to an array of expressions.
  842. */
  843. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  844. /**
  845. * Set's the value of this expression to an array of strings.
  846. */
  847. setArray(array: string[]): BasicEvaluatedExpression;
  848. /**
  849. * Set's the value of this expression to a processed/unprocessed template string. Used
  850. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  851. */
  852. setTemplateString(
  853. quasis: BasicEvaluatedExpression[],
  854. parts: BasicEvaluatedExpression[],
  855. kind: "raw" | "cooked"
  856. ): BasicEvaluatedExpression;
  857. templateStringKind?: "raw" | "cooked";
  858. setTruthy(): BasicEvaluatedExpression;
  859. setFalsy(): BasicEvaluatedExpression;
  860. /**
  861. * Set's the value of the expression to nullish.
  862. */
  863. setNullish(value: boolean): BasicEvaluatedExpression;
  864. /**
  865. * Set's the range for the expression.
  866. */
  867. setRange(range: [number, number]): BasicEvaluatedExpression;
  868. /**
  869. * Set whether or not the expression has side effects.
  870. */
  871. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  872. /**
  873. * Set the expression node for the expression.
  874. */
  875. setExpression(
  876. expression?:
  877. | Program
  878. | ImportDeclaration
  879. | ExportNamedDeclaration
  880. | ExportAllDeclaration
  881. | ImportExpressionImport
  882. | UnaryExpression
  883. | ArrayExpression
  884. | ArrowFunctionExpression
  885. | AssignmentExpression
  886. | AwaitExpression
  887. | BinaryExpression
  888. | SimpleCallExpression
  889. | NewExpression
  890. | ChainExpression
  891. | ClassExpression
  892. | ConditionalExpression
  893. | FunctionExpression
  894. | Identifier
  895. | SimpleLiteral
  896. | RegExpLiteral
  897. | BigIntLiteral
  898. | LogicalExpression
  899. | MemberExpression
  900. | MetaProperty
  901. | ObjectExpression
  902. | SequenceExpression
  903. | TaggedTemplateExpression
  904. | TemplateLiteral
  905. | ThisExpression
  906. | UpdateExpression
  907. | YieldExpression
  908. | SpreadElement
  909. | PrivateIdentifier
  910. | Super
  911. | FunctionDeclaration
  912. | VariableDeclaration
  913. | ClassDeclaration
  914. | ExpressionStatement
  915. | BlockStatement
  916. | StaticBlock
  917. | EmptyStatement
  918. | DebuggerStatement
  919. | WithStatement
  920. | ReturnStatement
  921. | LabeledStatement
  922. | BreakStatement
  923. | ContinueStatement
  924. | IfStatement
  925. | SwitchStatement
  926. | ThrowStatement
  927. | TryStatement
  928. | WhileStatement
  929. | DoWhileStatement
  930. | ForStatement
  931. | ForInStatement
  932. | ForOfStatement
  933. | ExportDefaultDeclaration
  934. | MethodDefinition
  935. | PropertyDefinition
  936. | VariableDeclarator
  937. | ObjectPattern
  938. | ArrayPattern
  939. | RestElement
  940. | AssignmentPattern
  941. | SwitchCase
  942. | CatchClause
  943. | Property
  944. | AssignmentProperty
  945. | ClassBody
  946. | ImportSpecifier
  947. | ImportDefaultSpecifier
  948. | ImportNamespaceSpecifier
  949. | ExportSpecifier
  950. | TemplateElement
  951. ): BasicEvaluatedExpression;
  952. }
  953. type BeforeContextResolveData = ContextResolveData & ContextOptions;
  954. declare interface Bootstrap {
  955. header: string[];
  956. beforeStartup: string[];
  957. startup: string[];
  958. afterStartup: string[];
  959. allowInlineStartup: boolean;
  960. }
  961. type BufferEncoding =
  962. | "ascii"
  963. | "utf8"
  964. | "utf-8"
  965. | "utf16le"
  966. | "utf-16le"
  967. | "ucs2"
  968. | "ucs-2"
  969. | "base64"
  970. | "base64url"
  971. | "latin1"
  972. | "binary"
  973. | "hex";
  974. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  975. declare interface BufferEntry {
  976. map?: null | RawSourceMap;
  977. bufferedMap?: null | BufferedMap;
  978. }
  979. declare interface BufferedMap {
  980. /**
  981. * version
  982. */
  983. version: number;
  984. /**
  985. * sources
  986. */
  987. sources: string[];
  988. /**
  989. * name
  990. */
  991. names: string[];
  992. /**
  993. * source root
  994. */
  995. sourceRoot?: string;
  996. /**
  997. * sources content
  998. */
  999. sourcesContent?: ("" | Buffer)[];
  1000. /**
  1001. * mappings
  1002. */
  1003. mappings?: Buffer;
  1004. /**
  1005. * file
  1006. */
  1007. file: string;
  1008. }
  1009. type BuildInfo = KnownBuildInfo & Record<string, any>;
  1010. type BuildMeta = KnownBuildMeta & Record<string, any>;
  1011. declare abstract class ByTypeGenerator extends Generator {
  1012. map: { [index: string]: undefined | Generator };
  1013. generateError?: (
  1014. error: Error,
  1015. module: NormalModule,
  1016. generateContext: GenerateContext
  1017. ) => null | Source;
  1018. }
  1019. declare const CIRCULAR_CONNECTION: unique symbol;
  1020. declare class CacheClass {
  1021. constructor();
  1022. hooks: {
  1023. get: AsyncSeriesBailHook<[string, null | Etag, GotHandler<any>[]], any>;
  1024. store: AsyncParallelHook<[string, null | Etag, any]>;
  1025. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  1026. beginIdle: SyncHook<[]>;
  1027. endIdle: AsyncParallelHook<[]>;
  1028. shutdown: AsyncParallelHook<[]>;
  1029. };
  1030. get<T>(
  1031. identifier: string,
  1032. etag: null | Etag,
  1033. callback: CallbackCacheCache<T>
  1034. ): void;
  1035. store<T>(
  1036. identifier: string,
  1037. etag: null | Etag,
  1038. data: T,
  1039. callback: CallbackCacheCache<void>
  1040. ): void;
  1041. /**
  1042. * After this method has succeeded the cache can only be restored when build dependencies are
  1043. */
  1044. storeBuildDependencies(
  1045. dependencies: Iterable<string>,
  1046. callback: CallbackCacheCache<void>
  1047. ): void;
  1048. beginIdle(): void;
  1049. endIdle(callback: CallbackCacheCache<void>): void;
  1050. shutdown(callback: CallbackCacheCache<void>): void;
  1051. static STAGE_MEMORY: number;
  1052. static STAGE_DEFAULT: number;
  1053. static STAGE_DISK: number;
  1054. static STAGE_NETWORK: number;
  1055. }
  1056. declare abstract class CacheFacade {
  1057. getChildCache(name: string): CacheFacade;
  1058. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  1059. getLazyHashedEtag(obj: HashableObject): Etag;
  1060. mergeEtags(a: Etag, b: Etag): Etag;
  1061. get<T>(
  1062. identifier: string,
  1063. etag: null | Etag,
  1064. callback: CallbackCacheCacheFacade<T>
  1065. ): void;
  1066. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  1067. store<T>(
  1068. identifier: string,
  1069. etag: null | Etag,
  1070. data: T,
  1071. callback: CallbackCacheCacheFacade<void>
  1072. ): void;
  1073. storePromise<T>(
  1074. identifier: string,
  1075. etag: null | Etag,
  1076. data: T
  1077. ): Promise<void>;
  1078. provide<T>(
  1079. identifier: string,
  1080. etag: null | Etag,
  1081. computer: (callback: CallbackNormalErrorCache<T>) => void,
  1082. callback: CallbackNormalErrorCache<T>
  1083. ): void;
  1084. providePromise<T>(
  1085. identifier: string,
  1086. etag: null | Etag,
  1087. computer: () => T | Promise<T>
  1088. ): Promise<T>;
  1089. }
  1090. declare interface CacheGroupSource {
  1091. key: string;
  1092. priority?: number;
  1093. getName?: (
  1094. module: Module,
  1095. chunks: Chunk[],
  1096. key: string
  1097. ) => undefined | string;
  1098. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  1099. enforce?: boolean;
  1100. minSize: SplitChunksSizes;
  1101. minSizeReduction: SplitChunksSizes;
  1102. minRemainingSize: SplitChunksSizes;
  1103. enforceSizeThreshold: SplitChunksSizes;
  1104. maxAsyncSize: SplitChunksSizes;
  1105. maxInitialSize: SplitChunksSizes;
  1106. minChunks?: number;
  1107. maxAsyncRequests?: number;
  1108. maxInitialRequests?: number;
  1109. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1110. idHint?: string;
  1111. automaticNameDelimiter?: string;
  1112. reuseExistingChunk?: boolean;
  1113. usedExports?: boolean;
  1114. }
  1115. declare interface CacheGroupsContext {
  1116. moduleGraph: ModuleGraph;
  1117. chunkGraph: ChunkGraph;
  1118. }
  1119. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  1120. declare interface CacheTypes {
  1121. [index: string]: undefined | ResolveRequest | ResolveRequest[];
  1122. }
  1123. declare interface CachedData {
  1124. /**
  1125. * source
  1126. */
  1127. source?: boolean;
  1128. /**
  1129. * buffer
  1130. */
  1131. buffer: Buffer;
  1132. /**
  1133. * size
  1134. */
  1135. size?: number;
  1136. /**
  1137. * maps
  1138. */
  1139. maps: Map<string, BufferEntry>;
  1140. /**
  1141. * hash
  1142. */
  1143. hash?: (string | Buffer)[];
  1144. }
  1145. declare class CachedSource extends Source {
  1146. constructor(source: Source | (() => Source), cachedData?: CachedData);
  1147. getCachedData(): CachedData;
  1148. originalLazy(): Source | (() => Source);
  1149. original(): Source;
  1150. streamChunks(
  1151. options: StreamChunksOptions,
  1152. onChunk: (
  1153. chunk: undefined | string,
  1154. generatedLine: number,
  1155. generatedColumn: number,
  1156. sourceIndex: number,
  1157. originalLine: number,
  1158. originalColumn: number,
  1159. nameIndex: number
  1160. ) => void,
  1161. onSource: (
  1162. sourceIndex: number,
  1163. source: null | string,
  1164. sourceContent?: string
  1165. ) => void,
  1166. onName: (nameIndex: number, name: string) => void
  1167. ): GeneratedSourceInfo;
  1168. }
  1169. declare interface CalculatedStringResult {
  1170. range?: [number, number];
  1171. value: string;
  1172. code: boolean;
  1173. conditional: false | CalculatedStringResult[];
  1174. }
  1175. type CallExpression = SimpleCallExpression | NewExpression;
  1176. declare interface CallExpressionInfo {
  1177. type: "call";
  1178. call: CallExpression;
  1179. calleeName: string;
  1180. rootInfo: string | VariableInfo;
  1181. getCalleeMembers: () => string[];
  1182. name: string;
  1183. getMembers: () => string[];
  1184. getMembersOptionals: () => boolean[];
  1185. getMemberRanges: () => [number, number][];
  1186. }
  1187. declare interface CallbackAsyncQueue<T> {
  1188. (err?: null | WebpackError, result?: null | T): void;
  1189. }
  1190. declare interface CallbackCacheCache<T> {
  1191. (err: null | WebpackError, result?: T): void;
  1192. }
  1193. declare interface CallbackCacheCacheFacade<T> {
  1194. (err?: null | Error, result?: null | T): void;
  1195. }
  1196. declare interface CallbackNormalErrorCache<T> {
  1197. (err?: null | Error, result?: T): void;
  1198. }
  1199. declare interface CallbackWebpackFunction_1<T> {
  1200. (err: null | Error, result?: T): void;
  1201. }
  1202. declare interface CallbackWebpackFunction_2<T, R = void> {
  1203. (err: null | Error, result?: T): R;
  1204. }
  1205. type Cell<T> = undefined | T;
  1206. declare class Chunk {
  1207. constructor(name?: null | string, backCompat?: boolean);
  1208. id: null | string | number;
  1209. ids: null | ChunkId[];
  1210. debugId: number;
  1211. name?: null | string;
  1212. idNameHints: SortableSet<string>;
  1213. preventIntegration: boolean;
  1214. filenameTemplate?:
  1215. | string
  1216. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1217. cssFilenameTemplate?:
  1218. | string
  1219. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1220. runtime: RuntimeSpec;
  1221. files: Set<string>;
  1222. auxiliaryFiles: Set<string>;
  1223. rendered: boolean;
  1224. hash?: string;
  1225. contentHash: Record<string, string>;
  1226. renderedHash?: string;
  1227. chunkReason?: string;
  1228. extraAsync: boolean;
  1229. get entryModule(): Module;
  1230. hasEntryModule(): boolean;
  1231. addModule(module: Module): boolean;
  1232. removeModule(module: Module): void;
  1233. getNumberOfModules(): number;
  1234. get modulesIterable(): Iterable<Module>;
  1235. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  1236. containsModule(module: Module): boolean;
  1237. getModules(): Module[];
  1238. remove(): void;
  1239. moveModule(module: Module, otherChunk: Chunk): void;
  1240. integrate(otherChunk: Chunk): boolean;
  1241. canBeIntegrated(otherChunk: Chunk): boolean;
  1242. isEmpty(): boolean;
  1243. modulesSize(): number;
  1244. size(options?: ChunkSizeOptions): number;
  1245. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  1246. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  1247. hasModuleInGraph(
  1248. filterFn: (m: Module) => boolean,
  1249. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1250. ): boolean;
  1251. getChunkMaps(realHash: boolean): ChunkMaps;
  1252. hasRuntime(): boolean;
  1253. canBeInitial(): boolean;
  1254. isOnlyInitial(): boolean;
  1255. getEntryOptions(): undefined | EntryOptions;
  1256. addGroup(chunkGroup: ChunkGroup): void;
  1257. removeGroup(chunkGroup: ChunkGroup): void;
  1258. isInGroup(chunkGroup: ChunkGroup): boolean;
  1259. getNumberOfGroups(): number;
  1260. get groupsIterable(): SortableSet<ChunkGroup>;
  1261. disconnectFromGroups(): void;
  1262. split(newChunk: Chunk): void;
  1263. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1264. getAllAsyncChunks(): Set<Chunk>;
  1265. getAllInitialChunks(): Set<Chunk>;
  1266. getAllReferencedChunks(): Set<Chunk>;
  1267. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1268. hasAsyncChunks(): boolean;
  1269. getChildIdsByOrders(
  1270. chunkGraph: ChunkGraph,
  1271. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1272. ): Record<string, ChunkId[]>;
  1273. getChildrenOfTypeInOrder(
  1274. chunkGraph: ChunkGraph,
  1275. type: string
  1276. ): undefined | ChunkChildOfTypeInOrder[];
  1277. getChildIdsByOrdersMap(
  1278. chunkGraph: ChunkGraph,
  1279. includeDirectChildren?: boolean,
  1280. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1281. ): ChunkChildIdsByOrdersMapByData;
  1282. hasChildByOrder(
  1283. chunkGraph: ChunkGraph,
  1284. type: string,
  1285. includeDirectChildren?: boolean,
  1286. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1287. ): boolean;
  1288. }
  1289. declare interface ChunkChildIdsByOrdersMap {
  1290. [index: string]: ChunkId[];
  1291. }
  1292. declare interface ChunkChildIdsByOrdersMapByData {
  1293. [index: string]: ChunkChildIdsByOrdersMap;
  1294. }
  1295. declare interface ChunkChildOfTypeInOrder {
  1296. onChunks: Chunk[];
  1297. chunks: Set<Chunk>;
  1298. }
  1299. declare interface ChunkConditionMap {
  1300. [index: number]: boolean;
  1301. [index: string]: boolean;
  1302. }
  1303. declare class ChunkGraph {
  1304. constructor(moduleGraph: ModuleGraph, hashFunction?: HashFunction);
  1305. moduleGraph: ModuleGraph;
  1306. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1307. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1308. disconnectChunk(chunk: Chunk): void;
  1309. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1310. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1311. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1312. attachDependentHashModules(
  1313. chunk: Chunk,
  1314. modules: Iterable<RuntimeModule>
  1315. ): void;
  1316. replaceModule(oldModule: Module, newModule: Module): void;
  1317. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1318. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1319. isEntryModule(module: Module): boolean;
  1320. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1321. getOrderedModuleChunksIterable(
  1322. module: Module,
  1323. sortFn: (a: Chunk, b: Chunk) => 0 | 1 | -1
  1324. ): Iterable<Chunk>;
  1325. getModuleChunks(module: Module): Chunk[];
  1326. getNumberOfModuleChunks(module: Module): number;
  1327. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1328. getNumberOfChunkModules(chunk: Chunk): number;
  1329. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1330. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1331. getChunkModulesIterableBySourceType(
  1332. chunk: Chunk,
  1333. sourceType: string
  1334. ): undefined | Iterable<Module>;
  1335. setChunkModuleSourceTypes(
  1336. chunk: Chunk,
  1337. module: Module,
  1338. sourceTypes: ReadonlySet<string>
  1339. ): void;
  1340. getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet<string>;
  1341. getModuleSourceTypes(module: Module): ReadonlySet<string>;
  1342. getOrderedChunkModulesIterable(
  1343. chunk: Chunk,
  1344. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1345. ): Iterable<Module>;
  1346. getOrderedChunkModulesIterableBySourceType(
  1347. chunk: Chunk,
  1348. sourceType: string,
  1349. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1350. ): undefined | Iterable<Module>;
  1351. getChunkModules(chunk: Chunk): Module[];
  1352. getOrderedChunkModules(
  1353. chunk: Chunk,
  1354. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1355. ): Module[];
  1356. getChunkModuleIdMap(
  1357. chunk: Chunk,
  1358. filterFn: (m: Module) => boolean,
  1359. includeAllChunks?: boolean
  1360. ): ChunkModuleIdMapEs5Alias_2;
  1361. getChunkModuleRenderedHashMap(
  1362. chunk: Chunk,
  1363. filterFn: (m: Module) => boolean,
  1364. hashLength?: number,
  1365. includeAllChunks?: boolean
  1366. ): ChunkModuleHashMap;
  1367. getChunkConditionMap(
  1368. chunk: Chunk,
  1369. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1370. ): ChunkConditionMap;
  1371. hasModuleInGraph(
  1372. chunk: Chunk,
  1373. filterFn: (m: Module) => boolean,
  1374. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1375. ): boolean;
  1376. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1377. getChunkModulesSize(chunk: Chunk): number;
  1378. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1379. getChunkRootModules(chunk: Chunk): Module[];
  1380. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1381. getIntegratedChunksSize(
  1382. chunkA: Chunk,
  1383. chunkB: Chunk,
  1384. options?: ChunkSizeOptions
  1385. ): number;
  1386. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1387. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1388. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1389. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1390. connectChunkAndEntryModule(
  1391. chunk: Chunk,
  1392. module: Module,
  1393. entrypoint: Entrypoint
  1394. ): void;
  1395. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1396. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1397. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1398. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1399. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1400. disconnectEntryModule(module: Module): void;
  1401. disconnectEntries(chunk: Chunk): void;
  1402. getNumberOfEntryModules(chunk: Chunk): number;
  1403. getNumberOfRuntimeModules(chunk: Chunk): number;
  1404. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1405. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1406. getRuntimeChunkDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1407. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1408. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1409. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1410. getChunkFullHashModulesIterable(
  1411. chunk: Chunk
  1412. ): undefined | Iterable<RuntimeModule>;
  1413. getChunkFullHashModulesSet(
  1414. chunk: Chunk
  1415. ): undefined | ReadonlySet<RuntimeModule>;
  1416. getChunkDependentHashModulesIterable(
  1417. chunk: Chunk
  1418. ): undefined | Iterable<RuntimeModule>;
  1419. getChunkEntryModulesWithChunkGroupIterable(
  1420. chunk: Chunk
  1421. ): Iterable<[Module, undefined | Entrypoint]>;
  1422. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1423. connectBlockAndChunkGroup(
  1424. depBlock: AsyncDependenciesBlock,
  1425. chunkGroup: ChunkGroup
  1426. ): void;
  1427. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1428. getModuleId(module: Module): null | string | number;
  1429. setModuleId(module: Module, id: ModuleId): void;
  1430. getRuntimeId(runtime: string): RuntimeId;
  1431. setRuntimeId(runtime: string, id: RuntimeId): void;
  1432. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1433. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1434. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1435. setModuleHashes(
  1436. module: Module,
  1437. runtime: RuntimeSpec,
  1438. hash: string,
  1439. renderedHash: string
  1440. ): void;
  1441. addModuleRuntimeRequirements(
  1442. module: Module,
  1443. runtime: RuntimeSpec,
  1444. items: Set<string>,
  1445. transferOwnership?: boolean
  1446. ): void;
  1447. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1448. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1449. getModuleRuntimeRequirements(
  1450. module: Module,
  1451. runtime: RuntimeSpec
  1452. ): ReadonlySet<string>;
  1453. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1454. getModuleGraphHash(
  1455. module: Module,
  1456. runtime: RuntimeSpec,
  1457. withConnections?: boolean
  1458. ): string;
  1459. getModuleGraphHashBigInt(
  1460. module: Module,
  1461. runtime: RuntimeSpec,
  1462. withConnections?: boolean
  1463. ): bigint;
  1464. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1465. static getChunkGraphForModule(
  1466. module: Module,
  1467. deprecateMessage: string,
  1468. deprecationCode: string
  1469. ): ChunkGraph;
  1470. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1471. static clearChunkGraphForModule(module: Module): void;
  1472. static getChunkGraphForChunk(
  1473. chunk: Chunk,
  1474. deprecateMessage: string,
  1475. deprecationCode: string
  1476. ): ChunkGraph;
  1477. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1478. static clearChunkGraphForChunk(chunk: Chunk): void;
  1479. }
  1480. declare abstract class ChunkGroup {
  1481. groupDebugId: number;
  1482. options: ChunkGroupOptions;
  1483. chunks: Chunk[];
  1484. origins: OriginRecord[];
  1485. index?: number;
  1486. /**
  1487. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1488. */
  1489. addOptions(options: ChunkGroupOptions): void;
  1490. /**
  1491. * returns the name of current ChunkGroup
  1492. * sets a new name for current ChunkGroup
  1493. */
  1494. name?: null | string;
  1495. /**
  1496. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1497. */
  1498. get debugId(): string;
  1499. /**
  1500. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1501. */
  1502. get id(): string;
  1503. /**
  1504. * Performs an unshift of a specific chunk
  1505. */
  1506. unshiftChunk(chunk: Chunk): boolean;
  1507. /**
  1508. * inserts a chunk before another existing chunk in group
  1509. */
  1510. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1511. /**
  1512. * add a chunk into ChunkGroup. Is pushed on or prepended
  1513. */
  1514. pushChunk(chunk: Chunk): boolean;
  1515. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1516. removeChunk(chunk: Chunk): boolean;
  1517. isInitial(): boolean;
  1518. addChild(group: ChunkGroup): boolean;
  1519. getChildren(): ChunkGroup[];
  1520. getNumberOfChildren(): number;
  1521. get childrenIterable(): SortableSet<ChunkGroup>;
  1522. removeChild(group: ChunkGroup): boolean;
  1523. addParent(parentChunk: ChunkGroup): boolean;
  1524. getParents(): ChunkGroup[];
  1525. getNumberOfParents(): number;
  1526. hasParent(parent: ChunkGroup): boolean;
  1527. get parentsIterable(): SortableSet<ChunkGroup>;
  1528. removeParent(chunkGroup: ChunkGroup): boolean;
  1529. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1530. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1531. getBlocks(): AsyncDependenciesBlock[];
  1532. getNumberOfBlocks(): number;
  1533. hasBlock(block: AsyncDependenciesBlock): boolean;
  1534. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1535. addBlock(block: AsyncDependenciesBlock): boolean;
  1536. addOrigin(
  1537. module: null | Module,
  1538. loc: DependencyLocation,
  1539. request: string
  1540. ): void;
  1541. getFiles(): string[];
  1542. remove(): void;
  1543. sortItems(): void;
  1544. /**
  1545. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1546. * Sorting values are based off of number of chunks in ChunkGroup.
  1547. */
  1548. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1549. getChildrenByOrders(
  1550. moduleGraph: ModuleGraph,
  1551. chunkGraph: ChunkGraph
  1552. ): Record<string, ChunkGroup[]>;
  1553. /**
  1554. * Sets the top-down index of a module in this ChunkGroup
  1555. */
  1556. setModulePreOrderIndex(module: Module, index: number): void;
  1557. /**
  1558. * Gets the top-down index of a module in this ChunkGroup
  1559. */
  1560. getModulePreOrderIndex(module: Module): undefined | number;
  1561. /**
  1562. * Sets the bottom-up index of a module in this ChunkGroup
  1563. */
  1564. setModulePostOrderIndex(module: Module, index: number): void;
  1565. /**
  1566. * Gets the bottom-up index of a module in this ChunkGroup
  1567. */
  1568. getModulePostOrderIndex(module: Module): undefined | number;
  1569. checkConstraints(): void;
  1570. getModuleIndex: (module: Module) => undefined | number;
  1571. getModuleIndex2: (module: Module) => undefined | number;
  1572. }
  1573. declare interface ChunkGroupInfoWithName {
  1574. name: string;
  1575. chunkGroup: ChunkGroup;
  1576. }
  1577. type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string };
  1578. declare interface ChunkHashContext {
  1579. /**
  1580. * results of code generation
  1581. */
  1582. codeGenerationResults: CodeGenerationResults;
  1583. /**
  1584. * the runtime template
  1585. */
  1586. runtimeTemplate: RuntimeTemplate;
  1587. /**
  1588. * the module graph
  1589. */
  1590. moduleGraph: ModuleGraph;
  1591. /**
  1592. * the chunk graph
  1593. */
  1594. chunkGraph: ChunkGraph;
  1595. }
  1596. declare interface ChunkHashes {
  1597. [index: number]: string;
  1598. [index: string]: string;
  1599. }
  1600. type ChunkId = string | number;
  1601. declare interface ChunkMaps {
  1602. hash: Record<ChunkId, string>;
  1603. contentHash: Record<ChunkId, Record<string, string>>;
  1604. name: Record<ChunkId, string>;
  1605. }
  1606. declare interface ChunkModuleHashMap {
  1607. [index: number]: IdToHashMap;
  1608. [index: string]: IdToHashMap;
  1609. }
  1610. declare interface ChunkModuleHashes {
  1611. [index: string]: string;
  1612. }
  1613. declare interface ChunkModuleIdMapEs5Alias_1 {
  1614. [index: number]: ChunkId[];
  1615. [index: string]: ChunkId[];
  1616. }
  1617. declare interface ChunkModuleIdMapEs5Alias_2 {
  1618. [index: number]: ModuleId[];
  1619. [index: string]: ModuleId[];
  1620. }
  1621. declare class ChunkModuleIdRangePlugin {
  1622. constructor(options: ChunkModuleIdRangePluginOptions);
  1623. options: ChunkModuleIdRangePluginOptions;
  1624. /**
  1625. * Apply the plugin
  1626. */
  1627. apply(compiler: Compiler): void;
  1628. }
  1629. declare interface ChunkModuleIdRangePluginOptions {
  1630. /**
  1631. * the chunk name
  1632. */
  1633. name: string;
  1634. /**
  1635. * order
  1636. */
  1637. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1638. /**
  1639. * start id
  1640. */
  1641. start?: number;
  1642. /**
  1643. * end id
  1644. */
  1645. end?: number;
  1646. }
  1647. declare interface ChunkModuleIds {
  1648. [index: number]: ModuleId[];
  1649. [index: string]: ModuleId[];
  1650. }
  1651. declare interface ChunkModuleMaps {
  1652. id: ChunkModuleIdMapEs5Alias_1;
  1653. hash: chunkModuleHashMap;
  1654. }
  1655. type ChunkName = null | string;
  1656. declare interface ChunkPathData {
  1657. id: string | number;
  1658. name?: string;
  1659. hash: string;
  1660. hashWithLength?: (length: number) => string;
  1661. contentHash?: Record<string, string>;
  1662. contentHashWithLength?: Record<string, (length: number) => string>;
  1663. }
  1664. declare class ChunkPrefetchPreloadPlugin {
  1665. constructor();
  1666. apply(compiler: Compiler): void;
  1667. }
  1668. declare interface ChunkRenderContextCssModulesPlugin {
  1669. /**
  1670. * the chunk
  1671. */
  1672. chunk?: Chunk;
  1673. /**
  1674. * the chunk graph
  1675. */
  1676. chunkGraph?: ChunkGraph;
  1677. /**
  1678. * results of code generation
  1679. */
  1680. codeGenerationResults?: CodeGenerationResults;
  1681. /**
  1682. * the runtime template
  1683. */
  1684. runtimeTemplate: RuntimeTemplate;
  1685. /**
  1686. * undo path to css file
  1687. */
  1688. undoPath: string;
  1689. /**
  1690. * moduleFactoryCache
  1691. */
  1692. moduleFactoryCache: WeakMap<Source, ModuleFactoryCacheEntry>;
  1693. /**
  1694. * content
  1695. */
  1696. moduleSourceContent: Source;
  1697. }
  1698. declare interface ChunkRenderContextJavascriptModulesPlugin {
  1699. /**
  1700. * the chunk
  1701. */
  1702. chunk: Chunk;
  1703. /**
  1704. * the dependency templates
  1705. */
  1706. dependencyTemplates: DependencyTemplates;
  1707. /**
  1708. * the runtime template
  1709. */
  1710. runtimeTemplate: RuntimeTemplate;
  1711. /**
  1712. * the module graph
  1713. */
  1714. moduleGraph: ModuleGraph;
  1715. /**
  1716. * the chunk graph
  1717. */
  1718. chunkGraph: ChunkGraph;
  1719. /**
  1720. * results of code generation
  1721. */
  1722. codeGenerationResults: CodeGenerationResults;
  1723. /**
  1724. * init fragments for the chunk
  1725. */
  1726. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  1727. /**
  1728. * rendering in strict context
  1729. */
  1730. strictMode?: boolean;
  1731. }
  1732. declare interface ChunkRuntime {
  1733. [index: number]: string;
  1734. [index: string]: string;
  1735. }
  1736. declare interface ChunkSizeOptions {
  1737. /**
  1738. * constant overhead for a chunk
  1739. */
  1740. chunkOverhead?: number;
  1741. /**
  1742. * multiplicator for initial chunks
  1743. */
  1744. entryChunkMultiplicator?: number;
  1745. }
  1746. declare abstract class ChunkTemplate {
  1747. hooks: Readonly<{
  1748. renderManifest: {
  1749. tap: <AdditionalOptions>(
  1750. options:
  1751. | string
  1752. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1753. fn: (
  1754. renderManifestEntries: RenderManifestEntry[],
  1755. renderManifestOptions: RenderManifestOptions
  1756. ) => RenderManifestEntry[]
  1757. ) => void;
  1758. };
  1759. modules: {
  1760. tap: <AdditionalOptions>(
  1761. options:
  1762. | string
  1763. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1764. fn: (
  1765. source: Source,
  1766. moduleTemplate: ModuleTemplate,
  1767. renderContext: RenderContextJavascriptModulesPlugin
  1768. ) => Source
  1769. ) => void;
  1770. };
  1771. render: {
  1772. tap: <AdditionalOptions>(
  1773. options:
  1774. | string
  1775. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1776. fn: (
  1777. source: Source,
  1778. moduleTemplate: ModuleTemplate,
  1779. renderContext: RenderContextJavascriptModulesPlugin
  1780. ) => Source
  1781. ) => void;
  1782. };
  1783. renderWithEntry: {
  1784. tap: <AdditionalOptions>(
  1785. options:
  1786. | string
  1787. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1788. fn: (source: Source, chunk: Chunk) => Source
  1789. ) => void;
  1790. };
  1791. hash: {
  1792. tap: <AdditionalOptions>(
  1793. options:
  1794. | string
  1795. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1796. fn: (hash: Hash) => void
  1797. ) => void;
  1798. };
  1799. hashForChunk: {
  1800. tap: <AdditionalOptions>(
  1801. options:
  1802. | string
  1803. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1804. fn: (
  1805. hash: Hash,
  1806. chunk: Chunk,
  1807. chunkHashContext: ChunkHashContext
  1808. ) => void
  1809. ) => void;
  1810. };
  1811. }>;
  1812. get outputOptions(): OutputNormalizedWithDefaults;
  1813. }
  1814. /**
  1815. * Advanced options for cleaning assets.
  1816. */
  1817. declare interface CleanOptions {
  1818. /**
  1819. * Log the assets that should be removed instead of deleting them.
  1820. */
  1821. dry?: boolean;
  1822. /**
  1823. * Keep these assets.
  1824. */
  1825. keep?: string | RegExp | ((path: string) => undefined | boolean);
  1826. }
  1827. declare class CleanPlugin {
  1828. constructor(options?: CleanOptions);
  1829. options: CleanOptions & { dry: boolean };
  1830. /**
  1831. * Apply the plugin
  1832. */
  1833. apply(compiler: Compiler): void;
  1834. static getCompilationHooks(
  1835. compilation: Compilation
  1836. ): CleanPluginCompilationHooks;
  1837. }
  1838. declare interface CleanPluginCompilationHooks {
  1839. /**
  1840. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1841. */
  1842. keep: SyncBailHook<[string], boolean | void>;
  1843. }
  1844. declare interface CodeGenMapOverloads {
  1845. get: <K extends string>(key: K) => undefined | CodeGenValue<K>;
  1846. set: <K extends string>(
  1847. key: K,
  1848. value: CodeGenValue<K>
  1849. ) => CodeGenerationResultData;
  1850. has: <K extends string>(key: K) => boolean;
  1851. delete: <K extends string>(key: K) => boolean;
  1852. }
  1853. type CodeGenValue<K extends string> = K extends
  1854. | "filename"
  1855. | "assetInfo"
  1856. | "share-init"
  1857. | "topLevelDeclarations"
  1858. | "chunkInitFragments"
  1859. | "url"
  1860. | "fullContentHash"
  1861. ? AllCodeGenerationSchemas[K]
  1862. : any;
  1863. declare interface CodeGenerationContext {
  1864. /**
  1865. * the dependency templates
  1866. */
  1867. dependencyTemplates: DependencyTemplates;
  1868. /**
  1869. * the runtime template
  1870. */
  1871. runtimeTemplate: RuntimeTemplate;
  1872. /**
  1873. * the module graph
  1874. */
  1875. moduleGraph: ModuleGraph;
  1876. /**
  1877. * the chunk graph
  1878. */
  1879. chunkGraph: ChunkGraph;
  1880. /**
  1881. * the runtimes code should be generated for
  1882. */
  1883. runtime: RuntimeSpec;
  1884. /**
  1885. * all runtimes code should be generated for
  1886. */
  1887. runtimes: RuntimeSpec[];
  1888. /**
  1889. * when in concatenated module, information about other concatenated modules
  1890. */
  1891. concatenationScope?: ConcatenationScope;
  1892. /**
  1893. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1894. */
  1895. codeGenerationResults?: CodeGenerationResults;
  1896. /**
  1897. * the compilation
  1898. */
  1899. compilation?: Compilation;
  1900. /**
  1901. * source types
  1902. */
  1903. sourceTypes?: ReadonlySet<string>;
  1904. }
  1905. declare interface CodeGenerationJob {
  1906. module: Module;
  1907. hash: string;
  1908. runtime: RuntimeSpec;
  1909. runtimes: RuntimeSpec[];
  1910. }
  1911. declare interface CodeGenerationResult {
  1912. /**
  1913. * the resulting sources for all source types
  1914. */
  1915. sources: Map<string, Source>;
  1916. /**
  1917. * the resulting data for all source types
  1918. */
  1919. data?: CodeGenerationResultData;
  1920. /**
  1921. * the runtime requirements
  1922. */
  1923. runtimeRequirements: null | ReadonlySet<string>;
  1924. /**
  1925. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1926. */
  1927. hash?: string;
  1928. }
  1929. type CodeGenerationResultData = Omit<
  1930. Map<string, any>,
  1931. "get" | "set" | "has" | "delete"
  1932. > &
  1933. CodeGenMapOverloads;
  1934. declare abstract class CodeGenerationResults {
  1935. map: Map<Module, RuntimeSpecMap<CodeGenerationResult, CodeGenerationResult>>;
  1936. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1937. has(module: Module, runtime: RuntimeSpec): boolean;
  1938. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1939. getRuntimeRequirements(
  1940. module: Module,
  1941. runtime: RuntimeSpec
  1942. ): null | ReadonlySet<string>;
  1943. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1944. getHash(module: Module, runtime: RuntimeSpec): string;
  1945. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1946. }
  1947. type CodeValue =
  1948. | undefined
  1949. | null
  1950. | string
  1951. | number
  1952. | bigint
  1953. | boolean
  1954. | Function
  1955. | RegExp
  1956. | RuntimeValue
  1957. | {
  1958. [index: string]: RecursiveArrayOrRecord<
  1959. | undefined
  1960. | null
  1961. | string
  1962. | number
  1963. | bigint
  1964. | boolean
  1965. | Function
  1966. | RegExp
  1967. | RuntimeValue
  1968. >;
  1969. }
  1970. | RecursiveArrayOrRecord<
  1971. | undefined
  1972. | null
  1973. | string
  1974. | number
  1975. | bigint
  1976. | boolean
  1977. | Function
  1978. | RegExp
  1979. | RuntimeValue
  1980. >[];
  1981. type CodeValuePrimitive =
  1982. | undefined
  1983. | null
  1984. | string
  1985. | number
  1986. | bigint
  1987. | boolean
  1988. | Function
  1989. | RegExp;
  1990. declare interface Colors {
  1991. reset: (value?: any) => string;
  1992. bold: (value?: any) => string;
  1993. dim: (value?: any) => string;
  1994. italic: (value?: any) => string;
  1995. underline: (value?: any) => string;
  1996. inverse: (value?: any) => string;
  1997. hidden: (value?: any) => string;
  1998. strikethrough: (value?: any) => string;
  1999. black: (value?: any) => string;
  2000. red: (value?: any) => string;
  2001. green: (value?: any) => string;
  2002. yellow: (value?: any) => string;
  2003. blue: (value?: any) => string;
  2004. magenta: (value?: any) => string;
  2005. cyan: (value?: any) => string;
  2006. white: (value?: any) => string;
  2007. gray: (value?: any) => string;
  2008. bgBlack: (value?: any) => string;
  2009. bgRed: (value?: any) => string;
  2010. bgGreen: (value?: any) => string;
  2011. bgYellow: (value?: any) => string;
  2012. bgBlue: (value?: any) => string;
  2013. bgMagenta: (value?: any) => string;
  2014. bgCyan: (value?: any) => string;
  2015. bgWhite: (value?: any) => string;
  2016. blackBright: (value?: any) => string;
  2017. redBright: (value?: any) => string;
  2018. greenBright: (value?: any) => string;
  2019. yellowBright: (value?: any) => string;
  2020. blueBright: (value?: any) => string;
  2021. magentaBright: (value?: any) => string;
  2022. cyanBright: (value?: any) => string;
  2023. whiteBright: (value?: any) => string;
  2024. bgBlackBright: (value?: any) => string;
  2025. bgRedBright: (value?: any) => string;
  2026. bgGreenBright: (value?: any) => string;
  2027. bgYellowBright: (value?: any) => string;
  2028. bgBlueBright: (value?: any) => string;
  2029. bgMagentaBright: (value?: any) => string;
  2030. bgCyanBright: (value?: any) => string;
  2031. bgWhiteBright: (value?: any) => string;
  2032. }
  2033. declare interface ColorsOptions {
  2034. /**
  2035. * force use colors
  2036. */
  2037. useColor?: boolean;
  2038. }
  2039. declare interface CommentCssParser {
  2040. value: string;
  2041. range: [number, number];
  2042. loc: { start: Position; end: Position };
  2043. }
  2044. type CommentJavascriptParser = CommentImport & {
  2045. start: number;
  2046. end: number;
  2047. loc: SourceLocation;
  2048. };
  2049. declare interface CommonJsImportSettings {
  2050. name?: string;
  2051. context: string;
  2052. }
  2053. declare interface Comparator<T> {
  2054. (a: T, b: T): 0 | 1 | -1;
  2055. }
  2056. declare class CompatSource extends Source {
  2057. constructor(sourceLike: SourceLike);
  2058. static from(sourceLike: SourceLike): Source;
  2059. }
  2060. declare interface CompatibilitySettings {
  2061. name: string;
  2062. declaration: CompatibilitySettingsDeclaration;
  2063. }
  2064. declare interface CompatibilitySettingsDeclaration {
  2065. updated: boolean;
  2066. loc: DependencyLocation;
  2067. range: [number, number];
  2068. }
  2069. declare class Compilation {
  2070. /**
  2071. * Creates an instance of Compilation.
  2072. */
  2073. constructor(compiler: Compiler, params: CompilationParams);
  2074. hooks: Readonly<{
  2075. buildModule: SyncHook<[Module]>;
  2076. rebuildModule: SyncHook<[Module]>;
  2077. failedModule: SyncHook<[Module, WebpackError]>;
  2078. succeedModule: SyncHook<[Module]>;
  2079. stillValidModule: SyncHook<[Module]>;
  2080. addEntry: SyncHook<[Dependency, EntryOptions]>;
  2081. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  2082. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  2083. dependencyReferencedExports: SyncWaterfallHook<
  2084. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec],
  2085. (string[] | ReferencedExport)[]
  2086. >;
  2087. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  2088. prepareModuleExecution: AsyncParallelHook<
  2089. [ExecuteModuleArgument, ExecuteModuleContext]
  2090. >;
  2091. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  2092. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  2093. unseal: SyncHook<[]>;
  2094. seal: SyncHook<[]>;
  2095. beforeChunks: SyncHook<[]>;
  2096. /**
  2097. * The `afterChunks` hook is called directly after the chunks and module graph have
  2098. * been created and before the chunks and modules have been optimized. This hook is useful to
  2099. * inspect, analyze, and/or modify the chunk graph.
  2100. */
  2101. afterChunks: SyncHook<[Iterable<Chunk>]>;
  2102. optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
  2103. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  2104. optimize: SyncHook<[]>;
  2105. optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
  2106. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  2107. optimizeChunks: SyncBailHook<
  2108. [Iterable<Chunk>, ChunkGroup[]],
  2109. boolean | void
  2110. >;
  2111. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  2112. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  2113. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  2114. optimizeChunkModules: AsyncSeriesBailHook<
  2115. [Iterable<Chunk>, Iterable<Module>],
  2116. void
  2117. >;
  2118. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  2119. shouldRecord: SyncBailHook<[], boolean | void>;
  2120. additionalChunkRuntimeRequirements: SyncHook<
  2121. [Chunk, Set<string>, RuntimeRequirementsContext]
  2122. >;
  2123. runtimeRequirementInChunk: HookMap<
  2124. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  2125. >;
  2126. additionalModuleRuntimeRequirements: SyncHook<
  2127. [Module, Set<string>, RuntimeRequirementsContext]
  2128. >;
  2129. runtimeRequirementInModule: HookMap<
  2130. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
  2131. >;
  2132. additionalTreeRuntimeRequirements: SyncHook<
  2133. [Chunk, Set<string>, RuntimeRequirementsContext]
  2134. >;
  2135. runtimeRequirementInTree: HookMap<
  2136. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  2137. >;
  2138. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  2139. reviveModules: SyncHook<[Iterable<Module>, Records]>;
  2140. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  2141. moduleIds: SyncHook<[Iterable<Module>]>;
  2142. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  2143. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  2144. reviveChunks: SyncHook<[Iterable<Chunk>, Records]>;
  2145. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2146. chunkIds: SyncHook<[Iterable<Chunk>]>;
  2147. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2148. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2149. recordModules: SyncHook<[Iterable<Module>, Records]>;
  2150. recordChunks: SyncHook<[Iterable<Chunk>, Records]>;
  2151. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  2152. beforeModuleHash: SyncHook<[]>;
  2153. afterModuleHash: SyncHook<[]>;
  2154. beforeCodeGeneration: SyncHook<[]>;
  2155. afterCodeGeneration: SyncHook<[]>;
  2156. beforeRuntimeRequirements: SyncHook<[]>;
  2157. afterRuntimeRequirements: SyncHook<[]>;
  2158. beforeHash: SyncHook<[]>;
  2159. contentHash: SyncHook<[Chunk]>;
  2160. afterHash: SyncHook<[]>;
  2161. recordHash: SyncHook<[Records]>;
  2162. record: SyncHook<[Compilation, Records]>;
  2163. beforeModuleAssets: SyncHook<[]>;
  2164. shouldGenerateChunkAssets: SyncBailHook<[], boolean | void>;
  2165. beforeChunkAssets: SyncHook<[]>;
  2166. additionalChunkAssets: FakeHook<
  2167. Pick<
  2168. AsyncSeriesHook<[Set<Chunk>]>,
  2169. "name" | "tap" | "tapAsync" | "tapPromise"
  2170. >
  2171. >;
  2172. additionalAssets: FakeHook<
  2173. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  2174. >;
  2175. optimizeChunkAssets: FakeHook<
  2176. Pick<
  2177. AsyncSeriesHook<[Set<Chunk>]>,
  2178. "name" | "tap" | "tapAsync" | "tapPromise"
  2179. >
  2180. >;
  2181. afterOptimizeChunkAssets: FakeHook<
  2182. Pick<
  2183. AsyncSeriesHook<[Set<Chunk>]>,
  2184. "name" | "tap" | "tapAsync" | "tapPromise"
  2185. >
  2186. >;
  2187. optimizeAssets: AsyncSeriesHook<
  2188. [CompilationAssets],
  2189. ProcessAssetsAdditionalOptions
  2190. >;
  2191. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  2192. processAssets: AsyncSeriesHook<
  2193. [CompilationAssets],
  2194. ProcessAssetsAdditionalOptions
  2195. >;
  2196. afterProcessAssets: SyncHook<[CompilationAssets]>;
  2197. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  2198. needAdditionalSeal: SyncBailHook<[], boolean | void>;
  2199. afterSeal: AsyncSeriesHook<[]>;
  2200. renderManifest: SyncWaterfallHook<
  2201. [RenderManifestEntry[], RenderManifestOptions],
  2202. RenderManifestEntry[]
  2203. >;
  2204. fullHash: SyncHook<[Hash]>;
  2205. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2206. moduleAsset: SyncHook<[Module, string]>;
  2207. chunkAsset: SyncHook<[Chunk, string]>;
  2208. assetPath: SyncWaterfallHook<
  2209. [string, PathData, undefined | AssetInfo],
  2210. string
  2211. >;
  2212. needAdditionalPass: SyncBailHook<[], boolean | void>;
  2213. childCompiler: SyncHook<[Compiler, string, number]>;
  2214. log: SyncBailHook<[string, LogEntry], boolean | void>;
  2215. processWarnings: SyncWaterfallHook<[Error[]], Error[]>;
  2216. processErrors: SyncWaterfallHook<[Error[]], Error[]>;
  2217. statsPreset: HookMap<
  2218. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  2219. >;
  2220. statsNormalize: SyncHook<
  2221. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  2222. >;
  2223. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  2224. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  2225. get normalModuleLoader(): SyncHook<[AnyLoaderContext, NormalModule]>;
  2226. }>;
  2227. name?: string;
  2228. startTime?: number;
  2229. endTime?: number;
  2230. compiler: Compiler;
  2231. resolverFactory: ResolverFactory;
  2232. inputFileSystem: InputFileSystem;
  2233. fileSystemInfo: FileSystemInfo;
  2234. valueCacheVersions: Map<string, ValueCacheVersion>;
  2235. requestShortener: RequestShortener;
  2236. compilerPath: string;
  2237. logger: WebpackLogger;
  2238. options: WebpackOptionsNormalizedWithDefaults;
  2239. outputOptions: OutputNormalizedWithDefaults;
  2240. bail: boolean;
  2241. profile: boolean;
  2242. params: CompilationParams;
  2243. mainTemplate: MainTemplate;
  2244. chunkTemplate: ChunkTemplate;
  2245. runtimeTemplate: RuntimeTemplate;
  2246. moduleTemplates: ModuleTemplates;
  2247. moduleMemCaches?: Map<Module, WeakTupleMap<any[], any>>;
  2248. moduleMemCaches2?: Map<Module, WeakTupleMap<any[], any>>;
  2249. moduleGraph: ModuleGraph;
  2250. chunkGraph: ChunkGraph;
  2251. codeGenerationResults?: CodeGenerationResults;
  2252. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  2253. addModuleQueue: AsyncQueue<Module, string, Module>;
  2254. factorizeQueue: AsyncQueue<
  2255. FactorizeModuleOptions,
  2256. string,
  2257. Module | ModuleFactoryResult
  2258. >;
  2259. buildQueue: AsyncQueue<Module, Module, Module>;
  2260. rebuildQueue: AsyncQueue<Module, Module, Module>;
  2261. /**
  2262. * Modules in value are building during the build of Module in key.
  2263. * Means value blocking key from finishing.
  2264. * Needed to detect build cycles.
  2265. */
  2266. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  2267. entries: Map<string, EntryData>;
  2268. globalEntry: EntryData;
  2269. entrypoints: Map<string, Entrypoint>;
  2270. asyncEntrypoints: Entrypoint[];
  2271. chunks: Set<Chunk>;
  2272. chunkGroups: ChunkGroup[];
  2273. namedChunkGroups: Map<string, ChunkGroup>;
  2274. namedChunks: Map<string, Chunk>;
  2275. modules: Set<Module>;
  2276. records: null | Records;
  2277. additionalChunkAssets: string[];
  2278. assets: CompilationAssets;
  2279. assetsInfo: Map<string, AssetInfo>;
  2280. errors: Error[];
  2281. warnings: Error[];
  2282. children: Compilation[];
  2283. logging: Map<string, LogEntry[]>;
  2284. dependencyFactories: Map<DependencyConstructor, ModuleFactory>;
  2285. dependencyTemplates: DependencyTemplates;
  2286. childrenCounters: Record<string, number>;
  2287. usedChunkIds: null | Set<number>;
  2288. usedModuleIds: null | Set<number>;
  2289. needAdditionalPass: boolean;
  2290. builtModules: WeakSet<Module>;
  2291. codeGeneratedModules: WeakSet<Module>;
  2292. buildTimeExecutedModules: WeakSet<Module>;
  2293. emittedAssets: Set<string>;
  2294. comparedForEmitAssets: Set<string>;
  2295. fileDependencies: LazySet<string>;
  2296. contextDependencies: LazySet<string>;
  2297. missingDependencies: LazySet<string>;
  2298. buildDependencies: LazySet<string>;
  2299. compilationDependencies: { add: (item: string) => LazySet<string> };
  2300. getStats(): Stats;
  2301. createStatsOptions(
  2302. optionsOrPreset?: string | boolean | StatsOptions,
  2303. context?: CreateStatsOptionsContext
  2304. ): NormalizedStatsOptions;
  2305. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  2306. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  2307. getCache(name: string): CacheFacade;
  2308. getLogger(name: string | (() => string)): WebpackLogger;
  2309. addModule(
  2310. module: Module,
  2311. callback: (err?: null | WebpackError, result?: null | Module) => void
  2312. ): void;
  2313. /**
  2314. * Fetches a module from a compilation by its identifier
  2315. */
  2316. getModule(module: Module): Module;
  2317. /**
  2318. * Attempts to search for a module by its identifier
  2319. */
  2320. findModule(identifier: string): undefined | Module;
  2321. /**
  2322. * Schedules a build of the module object
  2323. */
  2324. buildModule(
  2325. module: Module,
  2326. callback: (err?: null | WebpackError, result?: null | Module) => void
  2327. ): void;
  2328. processModuleDependencies(
  2329. module: Module,
  2330. callback: (err?: null | WebpackError, result?: null | Module) => void
  2331. ): void;
  2332. processModuleDependenciesNonRecursive(module: Module): void;
  2333. factorizeModule(
  2334. options: FactorizeModuleOptions & { factoryResult?: false },
  2335. callback: (err?: null | WebpackError, result?: null | Module) => void
  2336. ): void;
  2337. factorizeModule(
  2338. options: FactorizeModuleOptions & { factoryResult: true },
  2339. callback: (
  2340. err?: null | WebpackError,
  2341. result?: null | ModuleFactoryResult
  2342. ) => void
  2343. ): void;
  2344. handleModuleCreation(
  2345. __0: HandleModuleCreationOptions,
  2346. callback: (err?: null | WebpackError, result?: null | Module) => void
  2347. ): void;
  2348. addModuleChain(
  2349. context: string,
  2350. dependency: Dependency,
  2351. callback: (err?: null | WebpackError, result?: null | Module) => void
  2352. ): void;
  2353. addModuleTree(
  2354. __0: {
  2355. /**
  2356. * context string path
  2357. */
  2358. context: string;
  2359. /**
  2360. * dependency used to create Module chain
  2361. */
  2362. dependency: Dependency;
  2363. /**
  2364. * additional context info for the root module
  2365. */
  2366. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  2367. },
  2368. callback: (err?: null | WebpackError, result?: null | Module) => void
  2369. ): void;
  2370. addEntry(
  2371. context: string,
  2372. entry: Dependency,
  2373. optionsOrName: string | EntryOptions,
  2374. callback: (err?: null | WebpackError, result?: null | Module) => void
  2375. ): void;
  2376. addInclude(
  2377. context: string,
  2378. dependency: Dependency,
  2379. options: EntryOptions,
  2380. callback: (err?: null | WebpackError, result?: null | Module) => void
  2381. ): void;
  2382. rebuildModule(
  2383. module: Module,
  2384. callback: (err?: null | WebpackError, result?: null | Module) => void
  2385. ): void;
  2386. finish(callback: (err?: null | WebpackError) => void): void;
  2387. unseal(): void;
  2388. seal(callback: (err?: null | WebpackError) => void): void;
  2389. reportDependencyErrorsAndWarnings(
  2390. module: Module,
  2391. blocks: DependenciesBlock[]
  2392. ): boolean;
  2393. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  2394. processRuntimeRequirements(__0?: {
  2395. /**
  2396. * the chunk graph
  2397. */
  2398. chunkGraph?: ChunkGraph;
  2399. /**
  2400. * modules
  2401. */
  2402. modules?: Iterable<Module>;
  2403. /**
  2404. * chunks
  2405. */
  2406. chunks?: Iterable<Chunk>;
  2407. /**
  2408. * codeGenerationResults
  2409. */
  2410. codeGenerationResults?: CodeGenerationResults;
  2411. /**
  2412. * chunkGraphEntries
  2413. */
  2414. chunkGraphEntries?: Iterable<Chunk>;
  2415. }): void;
  2416. addRuntimeModule(
  2417. chunk: Chunk,
  2418. module: RuntimeModule,
  2419. chunkGraph?: ChunkGraph
  2420. ): void;
  2421. /**
  2422. * If `module` is passed, `loc` and `request` must also be passed.
  2423. */
  2424. addChunkInGroup(
  2425. groupOptions: string | ChunkGroupOptions,
  2426. module?: Module,
  2427. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  2428. request?: string
  2429. ): ChunkGroup;
  2430. addAsyncEntrypoint(
  2431. options: EntryOptions,
  2432. module: Module,
  2433. loc: DependencyLocation,
  2434. request: string
  2435. ): Entrypoint;
  2436. /**
  2437. * This method first looks to see if a name is provided for a new chunk,
  2438. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  2439. */
  2440. addChunk(name?: null | string): Chunk;
  2441. assignDepth(module: Module): void;
  2442. assignDepths(modules: Set<Module>): void;
  2443. getDependencyReferencedExports(
  2444. dependency: Dependency,
  2445. runtime: RuntimeSpec
  2446. ): (string[] | ReferencedExport)[];
  2447. removeReasonsOfDependencyBlock(
  2448. module: Module,
  2449. block: DependenciesBlockLike
  2450. ): void;
  2451. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  2452. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  2453. assignRuntimeIds(): void;
  2454. sortItemsWithChunkIds(): void;
  2455. summarizeDependencies(): void;
  2456. createModuleHashes(): void;
  2457. createHash(): CodeGenerationJob[];
  2458. fullHash?: string;
  2459. hash?: string;
  2460. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  2461. updateAsset(
  2462. file: string,
  2463. newSourceOrFunction: Source | ((source: Source) => Source),
  2464. assetInfoUpdateOrFunction?:
  2465. | AssetInfo
  2466. | ((assetInfo?: AssetInfo) => undefined | AssetInfo)
  2467. ): void;
  2468. renameAsset(file: string, newFile: string): void;
  2469. deleteAsset(file: string): void;
  2470. getAssets(): Readonly<Asset>[];
  2471. getAsset(name: string): undefined | Readonly<Asset>;
  2472. clearAssets(): void;
  2473. createModuleAssets(): void;
  2474. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  2475. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  2476. getPath(filename: TemplatePath, data?: PathData): string;
  2477. getPathWithInfo(
  2478. filename: TemplatePath,
  2479. data?: PathData
  2480. ): InterpolatedPathAndAssetInfo;
  2481. getAssetPath(filename: TemplatePath, data: PathData): string;
  2482. getAssetPathWithInfo(
  2483. filename: TemplatePath,
  2484. data: PathData
  2485. ): InterpolatedPathAndAssetInfo;
  2486. getWarnings(): Error[];
  2487. getErrors(): Error[];
  2488. /**
  2489. * This function allows you to run another instance of webpack inside of webpack however as
  2490. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  2491. * from parent (or top level compiler) and creates a child Compilation
  2492. */
  2493. createChildCompiler(
  2494. name: string,
  2495. outputOptions?: Partial<OutputNormalized>,
  2496. plugins?: (
  2497. | undefined
  2498. | null
  2499. | false
  2500. | ""
  2501. | 0
  2502. | ((this: Compiler, compiler: Compiler) => void)
  2503. | WebpackPluginInstance
  2504. )[]
  2505. ): Compiler;
  2506. executeModule(
  2507. module: Module,
  2508. options: ExecuteModuleOptions,
  2509. callback: (
  2510. err?: null | WebpackError,
  2511. result?: null | ExecuteModuleResult
  2512. ) => void
  2513. ): void;
  2514. checkConstraints(): void;
  2515. /**
  2516. * Add additional assets to the compilation.
  2517. */
  2518. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2519. /**
  2520. * Basic preprocessing of assets.
  2521. */
  2522. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2523. /**
  2524. * Derive new assets from existing assets.
  2525. * Existing assets should not be treated as complete.
  2526. */
  2527. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2528. /**
  2529. * Add additional sections to existing assets, like a banner or initialization code.
  2530. */
  2531. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2532. /**
  2533. * Optimize existing assets in a general way.
  2534. */
  2535. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2536. /**
  2537. * Optimize the count of existing assets, e. g. by merging them.
  2538. * Only assets of the same type should be merged.
  2539. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2540. */
  2541. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2542. /**
  2543. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2544. */
  2545. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2546. /**
  2547. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2548. */
  2549. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2550. /**
  2551. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2552. */
  2553. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2554. /**
  2555. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2556. * Only assets of different types should be inlined.
  2557. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2558. */
  2559. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2560. /**
  2561. * Summarize the list of existing assets
  2562. * e. g. creating an assets manifest of Service Workers.
  2563. */
  2564. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2565. /**
  2566. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2567. */
  2568. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2569. /**
  2570. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2571. */
  2572. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2573. /**
  2574. * Analyse existing assets.
  2575. */
  2576. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2577. /**
  2578. * Creating assets for reporting purposes.
  2579. */
  2580. static PROCESS_ASSETS_STAGE_REPORT: number;
  2581. }
  2582. declare interface CompilationAssets {
  2583. [index: string]: Source;
  2584. }
  2585. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2586. renderModuleContent: SyncWaterfallHook<
  2587. [Source, Module, WebAssemblyRenderContext],
  2588. Source
  2589. >;
  2590. }
  2591. declare interface CompilationHooksCssModulesPlugin {
  2592. renderModulePackage: SyncWaterfallHook<
  2593. [Source, Module, ChunkRenderContextCssModulesPlugin],
  2594. Source
  2595. >;
  2596. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2597. }
  2598. declare interface CompilationHooksJavascriptModulesPlugin {
  2599. renderModuleContent: SyncWaterfallHook<
  2600. [Source, Module, ModuleRenderContext],
  2601. Source
  2602. >;
  2603. renderModuleContainer: SyncWaterfallHook<
  2604. [Source, Module, ModuleRenderContext],
  2605. Source
  2606. >;
  2607. renderModulePackage: SyncWaterfallHook<
  2608. [Source, Module, ModuleRenderContext],
  2609. Source
  2610. >;
  2611. renderChunk: SyncWaterfallHook<
  2612. [Source, RenderContextJavascriptModulesPlugin],
  2613. Source
  2614. >;
  2615. renderMain: SyncWaterfallHook<
  2616. [Source, RenderContextJavascriptModulesPlugin],
  2617. Source
  2618. >;
  2619. renderContent: SyncWaterfallHook<
  2620. [Source, RenderContextJavascriptModulesPlugin],
  2621. Source
  2622. >;
  2623. render: SyncWaterfallHook<
  2624. [Source, RenderContextJavascriptModulesPlugin],
  2625. Source
  2626. >;
  2627. renderStartup: SyncWaterfallHook<
  2628. [Source, Module, StartupRenderContext],
  2629. Source
  2630. >;
  2631. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext], string>;
  2632. inlineInRuntimeBailout: SyncBailHook<
  2633. [Module, Partial<RenderBootstrapContext>],
  2634. string | void
  2635. >;
  2636. embedInRuntimeBailout: SyncBailHook<
  2637. [Module, RenderContextJavascriptModulesPlugin],
  2638. string | void
  2639. >;
  2640. strictRuntimeBailout: SyncBailHook<
  2641. [RenderContextJavascriptModulesPlugin],
  2642. string | void
  2643. >;
  2644. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2645. useSourceMap: SyncBailHook<
  2646. [Chunk, RenderContextJavascriptModulesPlugin],
  2647. boolean | void
  2648. >;
  2649. }
  2650. declare interface CompilationHooksModuleFederationPlugin {
  2651. addContainerEntryDependency: SyncHook<Dependency>;
  2652. addFederationRuntimeDependency: SyncHook<Dependency>;
  2653. }
  2654. declare interface CompilationHooksRealContentHashPlugin {
  2655. updateHash: SyncBailHook<[Buffer[], string], string | void>;
  2656. }
  2657. declare interface CompilationParams {
  2658. normalModuleFactory: NormalModuleFactory;
  2659. contextModuleFactory: ContextModuleFactory;
  2660. }
  2661. declare class Compiler {
  2662. constructor(context: string, options?: WebpackOptionsNormalized);
  2663. hooks: Readonly<{
  2664. initialize: SyncHook<[]>;
  2665. shouldEmit: SyncBailHook<[Compilation], boolean | void>;
  2666. done: AsyncSeriesHook<[Stats]>;
  2667. afterDone: SyncHook<[Stats]>;
  2668. additionalPass: AsyncSeriesHook<[]>;
  2669. beforeRun: AsyncSeriesHook<[Compiler]>;
  2670. run: AsyncSeriesHook<[Compiler]>;
  2671. emit: AsyncSeriesHook<[Compilation]>;
  2672. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2673. afterEmit: AsyncSeriesHook<[Compilation]>;
  2674. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2675. compilation: SyncHook<[Compilation, CompilationParams]>;
  2676. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2677. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2678. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2679. compile: SyncHook<[CompilationParams]>;
  2680. make: AsyncParallelHook<[Compilation]>;
  2681. finishMake: AsyncParallelHook<[Compilation]>;
  2682. afterCompile: AsyncSeriesHook<[Compilation]>;
  2683. readRecords: AsyncSeriesHook<[]>;
  2684. emitRecords: AsyncSeriesHook<[]>;
  2685. watchRun: AsyncSeriesHook<[Compiler]>;
  2686. failed: SyncHook<[Error]>;
  2687. invalid: SyncHook<[null | string, number]>;
  2688. watchClose: SyncHook<[]>;
  2689. shutdown: AsyncSeriesHook<[]>;
  2690. infrastructureLog: SyncBailHook<
  2691. [string, string, undefined | any[]],
  2692. true | void
  2693. >;
  2694. environment: SyncHook<[]>;
  2695. afterEnvironment: SyncHook<[]>;
  2696. afterPlugins: SyncHook<[Compiler]>;
  2697. afterResolvers: SyncHook<[Compiler]>;
  2698. entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>;
  2699. }>;
  2700. webpack: typeof exports;
  2701. name?: string;
  2702. parentCompilation?: Compilation;
  2703. root: Compiler;
  2704. outputPath: string;
  2705. watching?: Watching;
  2706. outputFileSystem: null | OutputFileSystem;
  2707. intermediateFileSystem: null | IntermediateFileSystem;
  2708. inputFileSystem: null | InputFileSystem;
  2709. watchFileSystem: null | WatchFileSystem;
  2710. recordsInputPath: null | string;
  2711. recordsOutputPath: null | string;
  2712. records: Records;
  2713. managedPaths: Set<string | RegExp>;
  2714. unmanagedPaths: Set<string | RegExp>;
  2715. immutablePaths: Set<string | RegExp>;
  2716. modifiedFiles?: ReadonlySet<string>;
  2717. removedFiles?: ReadonlySet<string>;
  2718. fileTimestamps?: Map<
  2719. string,
  2720. | null
  2721. | EntryTypesIndex
  2722. | OnlySafeTimeEntry
  2723. | ExistenceOnlyTimeEntryTypesIndex
  2724. | "ignore"
  2725. >;
  2726. contextTimestamps?: Map<
  2727. string,
  2728. | null
  2729. | EntryTypesIndex
  2730. | OnlySafeTimeEntry
  2731. | ExistenceOnlyTimeEntryTypesIndex
  2732. | "ignore"
  2733. >;
  2734. fsStartTime?: number;
  2735. resolverFactory: ResolverFactory;
  2736. infrastructureLogger?: (
  2737. value: string,
  2738. type: LogTypeEnum,
  2739. args?: any[]
  2740. ) => void;
  2741. platform: Readonly<PlatformTargetProperties>;
  2742. options: WebpackOptionsNormalized;
  2743. context: string;
  2744. requestShortener: RequestShortener;
  2745. cache: CacheClass;
  2746. moduleMemCaches?: Map<Module, ModuleMemCachesItem>;
  2747. compilerPath: string;
  2748. running: boolean;
  2749. idle: boolean;
  2750. watchMode: boolean;
  2751. getCache(name: string): CacheFacade;
  2752. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2753. watch(
  2754. watchOptions: WatchOptions,
  2755. handler: CallbackWebpackFunction_2<Stats, void>
  2756. ): undefined | Watching;
  2757. run(callback: CallbackWebpackFunction_2<Stats, void>): void;
  2758. runAsChild(
  2759. callback: (
  2760. err: null | Error,
  2761. entries?: Chunk[],
  2762. compilation?: Compilation
  2763. ) => void
  2764. ): void;
  2765. purgeInputFileSystem(): void;
  2766. emitAssets(
  2767. compilation: Compilation,
  2768. callback: (err: null | Error, result?: void) => void
  2769. ): void;
  2770. emitRecords(callback: (err: null | Error, result?: void) => void): void;
  2771. readRecords(callback: (err: null | Error, result?: void) => void): void;
  2772. createChildCompiler(
  2773. compilation: Compilation,
  2774. compilerName: string,
  2775. compilerIndex: number,
  2776. outputOptions?: Partial<OutputNormalized>,
  2777. plugins?: (
  2778. | undefined
  2779. | null
  2780. | false
  2781. | ""
  2782. | 0
  2783. | ((this: Compiler, compiler: Compiler) => void)
  2784. | WebpackPluginInstance
  2785. )[]
  2786. ): Compiler;
  2787. isChild(): boolean;
  2788. createCompilation(params: CompilationParams): Compilation;
  2789. newCompilation(params: CompilationParams): Compilation;
  2790. createNormalModuleFactory(): NormalModuleFactory;
  2791. createContextModuleFactory(): ContextModuleFactory;
  2792. newCompilationParams(): {
  2793. normalModuleFactory: NormalModuleFactory;
  2794. contextModuleFactory: ContextModuleFactory;
  2795. };
  2796. compile(callback: CallbackWebpackFunction_2<Compilation, void>): void;
  2797. close(callback: (err: null | Error, result?: void) => void): void;
  2798. }
  2799. declare class ConcatSource extends Source {
  2800. constructor(...args: ConcatSourceChild[]);
  2801. getChildren(): Source[];
  2802. add(item: ConcatSourceChild): void;
  2803. addAllSkipOptimizing(items: ConcatSourceChild[]): void;
  2804. streamChunks(
  2805. options: StreamChunksOptions,
  2806. onChunk: (
  2807. chunk: undefined | string,
  2808. generatedLine: number,
  2809. generatedColumn: number,
  2810. sourceIndex: number,
  2811. originalLine: number,
  2812. originalColumn: number,
  2813. nameIndex: number
  2814. ) => void,
  2815. onSource: (
  2816. sourceIndex: number,
  2817. source: null | string,
  2818. sourceContent?: string
  2819. ) => void,
  2820. onName: (nameIndex: number, name: string) => void
  2821. ): GeneratedSourceInfo;
  2822. }
  2823. type ConcatSourceChild = string | Source | SourceLike;
  2824. declare interface ConcatenatedModuleInfo {
  2825. type: "concatenated";
  2826. module: Module;
  2827. index: number;
  2828. ast?: Program;
  2829. internalSource?: Source;
  2830. source?: ReplaceSource;
  2831. chunkInitFragments?: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  2832. runtimeRequirements?: ReadonlySet<string>;
  2833. globalScope?: Scope;
  2834. moduleScope?: Scope;
  2835. internalNames: Map<string, string>;
  2836. exportMap?: Map<string, string>;
  2837. rawExportMap?: Map<string, string>;
  2838. namespaceExportSymbol?: string;
  2839. namespaceObjectName?: string;
  2840. concatenationScope?: ConcatenationScope;
  2841. /**
  2842. * "default-with-named" namespace
  2843. */
  2844. interopNamespaceObjectUsed: boolean;
  2845. /**
  2846. * "default-with-named" namespace
  2847. */
  2848. interopNamespaceObjectName?: string;
  2849. /**
  2850. * "default-only" namespace
  2851. */
  2852. interopNamespaceObject2Used: boolean;
  2853. /**
  2854. * "default-only" namespace
  2855. */
  2856. interopNamespaceObject2Name?: string;
  2857. /**
  2858. * runtime namespace object that detects "__esModule"
  2859. */
  2860. interopDefaultAccessUsed: boolean;
  2861. /**
  2862. * runtime namespace object that detects "__esModule"
  2863. */
  2864. interopDefaultAccessName?: string;
  2865. }
  2866. declare interface ConcatenationBailoutReasonContext {
  2867. /**
  2868. * the module graph
  2869. */
  2870. moduleGraph: ModuleGraph;
  2871. /**
  2872. * the chunk graph
  2873. */
  2874. chunkGraph: ChunkGraph;
  2875. }
  2876. declare class ConcatenationScope {
  2877. constructor(
  2878. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2879. currentModule: ConcatenatedModuleInfo,
  2880. usedNames: Set<string>
  2881. );
  2882. usedNames: Set<string>;
  2883. isModuleInScope(module: Module): boolean;
  2884. registerExport(exportName: string, symbol: string): void;
  2885. registerRawExport(exportName: string, expression: string): void;
  2886. getRawExport(exportName: string): undefined | string;
  2887. setRawExportMap(exportName: string, expression: string): void;
  2888. registerNamespaceExport(symbol: string): void;
  2889. createModuleReference(
  2890. module: Module,
  2891. __1: Partial<ModuleReferenceOptions>
  2892. ): string;
  2893. static isModuleReference(name: string): boolean;
  2894. static matchModuleReference(
  2895. name: string
  2896. ): null | (ModuleReferenceOptions & { index: number });
  2897. static DEFAULT_EXPORT: string;
  2898. static NAMESPACE_OBJECT_EXPORT: string;
  2899. }
  2900. /**
  2901. * Options object as provided by the user.
  2902. */
  2903. declare interface Configuration {
  2904. /**
  2905. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2906. */
  2907. amd?: false | { [index: string]: any };
  2908. /**
  2909. * Report the first error as a hard error instead of tolerating it.
  2910. */
  2911. bail?: boolean;
  2912. /**
  2913. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2914. */
  2915. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2916. /**
  2917. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2918. */
  2919. context?: string;
  2920. /**
  2921. * References to other configurations to depend on.
  2922. */
  2923. dependencies?: string[];
  2924. /**
  2925. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2926. */
  2927. devtool?:
  2928. | string
  2929. | false
  2930. | {
  2931. /**
  2932. * Which asset type should receive this devtool value.
  2933. */
  2934. type: "all" | "javascript" | "css";
  2935. /**
  2936. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2937. */
  2938. use: RawDevTool;
  2939. }[];
  2940. /**
  2941. * Enable and configure the Dotenv plugin to load environment variables from .env files.
  2942. */
  2943. dotenv?: boolean | DotenvPluginOptions;
  2944. /**
  2945. * The entry point(s) of the compilation.
  2946. */
  2947. entry?:
  2948. | string
  2949. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2950. | EntryObject
  2951. | string[];
  2952. /**
  2953. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2954. */
  2955. experiments?: Experiments;
  2956. /**
  2957. * Extend configuration from another configuration (only works when using webpack-cli).
  2958. */
  2959. extends?: string | string[];
  2960. /**
  2961. * 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`.
  2962. */
  2963. externals?:
  2964. | string
  2965. | RegExp
  2966. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2967. | ((
  2968. data: ExternalItemFunctionData,
  2969. callback: (
  2970. err?: null | Error,
  2971. result?: string | boolean | string[] | { [index: string]: any }
  2972. ) => void
  2973. ) => void)
  2974. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
  2975. | ExternalItem[];
  2976. /**
  2977. * Enable presets of externals for specific targets.
  2978. */
  2979. externalsPresets?: ExternalsPresets;
  2980. /**
  2981. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2982. */
  2983. externalsType?:
  2984. | "import"
  2985. | "var"
  2986. | "module"
  2987. | "assign"
  2988. | "this"
  2989. | "window"
  2990. | "self"
  2991. | "global"
  2992. | "commonjs"
  2993. | "commonjs2"
  2994. | "commonjs-module"
  2995. | "commonjs-static"
  2996. | "amd"
  2997. | "amd-require"
  2998. | "umd"
  2999. | "umd2"
  3000. | "jsonp"
  3001. | "system"
  3002. | "promise"
  3003. | "module-import"
  3004. | "script"
  3005. | "node-commonjs"
  3006. | "asset"
  3007. | "css-import"
  3008. | "css-url";
  3009. /**
  3010. * Ignore specific warnings.
  3011. */
  3012. ignoreWarnings?: (
  3013. | RegExp
  3014. | {
  3015. /**
  3016. * A RegExp to select the origin file for the warning.
  3017. */
  3018. file?: RegExp;
  3019. /**
  3020. * A RegExp to select the warning message.
  3021. */
  3022. message?: RegExp;
  3023. /**
  3024. * A RegExp to select the origin module for the warning.
  3025. */
  3026. module?: RegExp;
  3027. }
  3028. | ((warning: Error, compilation: Compilation) => boolean)
  3029. )[];
  3030. /**
  3031. * Options for infrastructure level logging.
  3032. */
  3033. infrastructureLogging?: InfrastructureLogging;
  3034. /**
  3035. * Custom values available in the loader context.
  3036. */
  3037. loader?: Loader;
  3038. /**
  3039. * Enable production optimizations or development hints.
  3040. */
  3041. mode?: "none" | "development" | "production";
  3042. /**
  3043. * Options affecting the normal modules (`NormalModuleFactory`).
  3044. */
  3045. module?: ModuleOptions;
  3046. /**
  3047. * Name of the configuration. Used when loading multiple configurations.
  3048. */
  3049. name?: string;
  3050. /**
  3051. * Include polyfills or mocks for various node stuff.
  3052. */
  3053. node?: false | NodeOptions;
  3054. /**
  3055. * Enables/Disables integrated optimizations.
  3056. */
  3057. optimization?: Optimization;
  3058. /**
  3059. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  3060. */
  3061. output?: Output;
  3062. /**
  3063. * The number of parallel processed modules in the compilation.
  3064. */
  3065. parallelism?: number;
  3066. /**
  3067. * Configuration for web performance recommendations.
  3068. */
  3069. performance?: false | PerformanceOptions;
  3070. /**
  3071. * Add additional plugins to the compiler.
  3072. */
  3073. plugins?: (
  3074. | undefined
  3075. | null
  3076. | false
  3077. | ""
  3078. | 0
  3079. | ((this: Compiler, compiler: Compiler) => void)
  3080. | WebpackPluginInstance
  3081. )[];
  3082. /**
  3083. * Capture timing information for each module.
  3084. */
  3085. profile?: boolean;
  3086. /**
  3087. * Store compiler state to a json file.
  3088. */
  3089. recordsInputPath?: string | false;
  3090. /**
  3091. * Load compiler state from a json file.
  3092. */
  3093. recordsOutputPath?: string | false;
  3094. /**
  3095. * 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.
  3096. */
  3097. recordsPath?: string | false;
  3098. /**
  3099. * Options for the resolver.
  3100. */
  3101. resolve?: ResolveOptions;
  3102. /**
  3103. * Options for the resolver when resolving loaders.
  3104. */
  3105. resolveLoader?: ResolveOptions;
  3106. /**
  3107. * Options affecting how file system snapshots are created and validated.
  3108. */
  3109. snapshot?: SnapshotOptionsWebpackOptions;
  3110. /**
  3111. * Stats options object or preset name.
  3112. */
  3113. stats?:
  3114. | boolean
  3115. | StatsOptions
  3116. | "none"
  3117. | "summary"
  3118. | "errors-only"
  3119. | "errors-warnings"
  3120. | "minimal"
  3121. | "normal"
  3122. | "detailed"
  3123. | "verbose";
  3124. /**
  3125. * Environment to build for. An array of environments to build for all of them when possible.
  3126. */
  3127. target?: string | false | string[];
  3128. /**
  3129. * Enter watch mode, which rebuilds on file change.
  3130. */
  3131. watch?: boolean;
  3132. /**
  3133. * Options for the watcher.
  3134. */
  3135. watchOptions?: WatchOptions;
  3136. }
  3137. type ConnectionState =
  3138. | boolean
  3139. | typeof CIRCULAR_CONNECTION
  3140. | typeof TRANSITIVE_ONLY;
  3141. declare class ConstDependency extends NullDependency {
  3142. constructor(
  3143. expression: string,
  3144. range: number | [number, number],
  3145. runtimeRequirements?: null | string[]
  3146. );
  3147. expression: string;
  3148. range: number | [number, number];
  3149. runtimeRequirements: null | Set<string>;
  3150. static Template: typeof ConstDependencyTemplate;
  3151. static NO_EXPORTS_REFERENCED: string[][];
  3152. static EXPORTS_OBJECT_REFERENCED: string[][];
  3153. static isLowPriorityDependency(dependency: Dependency): boolean;
  3154. static TRANSITIVE: typeof TRANSITIVE;
  3155. }
  3156. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  3157. constructor();
  3158. }
  3159. declare interface Constructor {
  3160. new (...params: any[]): any;
  3161. }
  3162. declare class ConsumeSharedPlugin {
  3163. constructor(options: ConsumeSharedPluginOptions);
  3164. /**
  3165. * Apply the plugin
  3166. */
  3167. apply(compiler: Compiler): void;
  3168. }
  3169. /**
  3170. * Options for consuming shared modules.
  3171. */
  3172. declare interface ConsumeSharedPluginOptions {
  3173. /**
  3174. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  3175. */
  3176. consumes: Consumes;
  3177. /**
  3178. * Share scope name used for all consumed modules (defaults to 'default').
  3179. */
  3180. shareScope?: string;
  3181. }
  3182. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  3183. /**
  3184. * Advanced configuration for modules that should be consumed from share scope.
  3185. */
  3186. declare interface ConsumesConfig {
  3187. /**
  3188. * 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.
  3189. */
  3190. eager?: boolean;
  3191. /**
  3192. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  3193. */
  3194. import?: string | false;
  3195. /**
  3196. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  3197. */
  3198. packageName?: string;
  3199. /**
  3200. * Version requirement from module in share scope.
  3201. */
  3202. requiredVersion?: string | false;
  3203. /**
  3204. * Module is looked up under this key from the share scope.
  3205. */
  3206. shareKey?: string;
  3207. /**
  3208. * Share scope name.
  3209. */
  3210. shareScope?: string;
  3211. /**
  3212. * Allow only a single version of the shared module in share scope (disabled by default).
  3213. */
  3214. singleton?: boolean;
  3215. /**
  3216. * 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).
  3217. */
  3218. strictVersion?: boolean;
  3219. }
  3220. /**
  3221. * 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.
  3222. */
  3223. declare interface ConsumesObject {
  3224. [index: string]: string | ConsumesConfig;
  3225. }
  3226. type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
  3227. declare class ContainerPlugin {
  3228. constructor(options: ContainerPluginOptions);
  3229. /**
  3230. * Apply the plugin
  3231. */
  3232. apply(compiler: Compiler): void;
  3233. }
  3234. declare interface ContainerPluginOptions {
  3235. /**
  3236. * 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.
  3237. */
  3238. exposes: Exposes;
  3239. /**
  3240. * The filename for this container relative path inside the `output.path` directory.
  3241. */
  3242. filename?: string;
  3243. /**
  3244. * Options for library.
  3245. */
  3246. library?: LibraryOptions;
  3247. /**
  3248. * The name for this container.
  3249. */
  3250. name: string;
  3251. /**
  3252. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3253. */
  3254. runtime?: string | false;
  3255. /**
  3256. * The name of the share scope which is shared with the host (defaults to 'default').
  3257. */
  3258. shareScope?: string;
  3259. }
  3260. declare class ContainerReferencePlugin {
  3261. constructor(options: ContainerReferencePluginOptions);
  3262. /**
  3263. * Apply the plugin
  3264. */
  3265. apply(compiler: Compiler): void;
  3266. }
  3267. declare interface ContainerReferencePluginOptions {
  3268. /**
  3269. * The external type of the remote containers.
  3270. */
  3271. remoteType: ExternalsType;
  3272. /**
  3273. * 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.
  3274. */
  3275. remotes: Remotes;
  3276. /**
  3277. * The name of the share scope shared with all remotes (defaults to 'default').
  3278. */
  3279. shareScope?: string;
  3280. }
  3281. declare interface ContextAlternativeRequest {
  3282. context: string;
  3283. request: string;
  3284. }
  3285. declare abstract class ContextDependency extends Dependency {
  3286. options: ContextDependencyOptions;
  3287. userRequest: string;
  3288. critical?: string | false;
  3289. hadGlobalOrStickyRegExp: boolean;
  3290. request?: string;
  3291. range?: [number, number];
  3292. valueRange?: [number, number];
  3293. inShorthand?: string | boolean;
  3294. replaces?: { value: string; range: [number, number] }[];
  3295. }
  3296. type ContextDependencyOptions = ContextOptions & { request: string };
  3297. declare abstract class ContextElementDependency extends ModuleDependency {
  3298. referencedExports?: null | string[][];
  3299. attributes?: ImportAttributes;
  3300. }
  3301. declare class ContextExclusionPlugin {
  3302. constructor(negativeMatcher: RegExp);
  3303. negativeMatcher: RegExp;
  3304. /**
  3305. * Apply the plugin
  3306. */
  3307. apply(compiler: Compiler): void;
  3308. }
  3309. declare interface ContextFileSystemInfoEntry {
  3310. safeTime: number;
  3311. timestampHash?: string;
  3312. resolved?: ResolvedContextFileSystemInfoEntry;
  3313. symlinks?: Set<string>;
  3314. }
  3315. declare interface ContextHash {
  3316. hash: string;
  3317. resolved?: string;
  3318. symlinks?: Set<string>;
  3319. }
  3320. type ContextMode =
  3321. | "weak"
  3322. | "eager"
  3323. | "lazy"
  3324. | "lazy-once"
  3325. | "sync"
  3326. | "async-weak";
  3327. declare abstract class ContextModuleFactory extends ModuleFactory {
  3328. hooks: Readonly<{
  3329. beforeResolve: AsyncSeriesWaterfallHook<
  3330. [BeforeContextResolveData],
  3331. false | void | BeforeContextResolveData
  3332. >;
  3333. afterResolve: AsyncSeriesWaterfallHook<
  3334. [AfterContextResolveData],
  3335. false | void | AfterContextResolveData
  3336. >;
  3337. contextModuleFiles: SyncWaterfallHook<[string[]], string[]>;
  3338. alternatives: FakeHook<
  3339. Pick<
  3340. AsyncSeriesWaterfallHook<
  3341. [ContextAlternativeRequest[]],
  3342. ContextAlternativeRequest[]
  3343. >,
  3344. "name" | "tap" | "tapAsync" | "tapPromise"
  3345. >
  3346. >;
  3347. alternativeRequests: AsyncSeriesWaterfallHook<
  3348. [ContextAlternativeRequest[], ContextModuleOptions],
  3349. ContextAlternativeRequest[]
  3350. >;
  3351. }>;
  3352. resolverFactory: ResolverFactory;
  3353. resolveDependencies(
  3354. fs: InputFileSystem,
  3355. options: ContextModuleOptions,
  3356. callback: (
  3357. err: null | Error,
  3358. dependencies?: ContextElementDependency[]
  3359. ) => void
  3360. ): void;
  3361. }
  3362. type ContextModuleOptions = ContextOptions & ContextModuleOptionsExtras;
  3363. declare interface ContextModuleOptionsExtras {
  3364. resource: string | false | string[];
  3365. resourceQuery?: string;
  3366. resourceFragment?: string;
  3367. resolveOptions?: ResolveOptions;
  3368. }
  3369. declare interface ContextOptions {
  3370. mode: ContextMode;
  3371. recursive: boolean;
  3372. regExp: null | false | RegExp;
  3373. namespaceObject?: boolean | "strict";
  3374. addon?: string;
  3375. chunkName?: null | string;
  3376. include?: null | RegExp;
  3377. exclude?: null | RegExp;
  3378. groupOptions?: RawChunkGroupOptions;
  3379. typePrefix?: string;
  3380. category?: string;
  3381. /**
  3382. * exports referenced from modules (won't be mangled)
  3383. */
  3384. referencedExports?: null | string[][];
  3385. layer?: null | string;
  3386. attributes?: ImportAttributes;
  3387. phase?: 0 | 1 | 2;
  3388. }
  3389. declare class ContextReplacementPlugin {
  3390. constructor(
  3391. resourceRegExp: RegExp,
  3392. newContentResource?:
  3393. | string
  3394. | boolean
  3395. | RegExp
  3396. | ((context: BeforeContextResolveData | AfterContextResolveData) => void),
  3397. newContentRecursive?: boolean | RegExp | NewContentCreateContextMap,
  3398. newContentRegExp?: RegExp
  3399. );
  3400. resourceRegExp: RegExp;
  3401. newContentCallback?: (
  3402. context: BeforeContextResolveData | AfterContextResolveData
  3403. ) => void;
  3404. newContentResource?: string;
  3405. newContentCreateContextMap?: (
  3406. fs: InputFileSystem,
  3407. callback: (
  3408. err: null | Error,
  3409. newContentRecursive: NewContentCreateContextMap
  3410. ) => void
  3411. ) => void;
  3412. newContentRecursive?: boolean;
  3413. newContentRegExp?: RegExp;
  3414. /**
  3415. * Apply the plugin
  3416. */
  3417. apply(compiler: Compiler): void;
  3418. }
  3419. declare interface ContextResolveData {
  3420. context: string;
  3421. request: string;
  3422. resolveOptions?: ResolveOptions;
  3423. fileDependencies: LazySet<string>;
  3424. missingDependencies: LazySet<string>;
  3425. contextDependencies: LazySet<string>;
  3426. dependencies: ContextDependency[];
  3427. }
  3428. declare interface ContextTimestampAndHash {
  3429. safeTime: number;
  3430. timestampHash?: string;
  3431. hash: string;
  3432. resolved?: ResolvedContextTimestampAndHash;
  3433. symlinks?: Set<string>;
  3434. }
  3435. type ContextTypes = KnownContext & Record<any, any>;
  3436. type CreateReadStreamFSImplementation = FSImplementation & {
  3437. read: (...args: any[]) => any;
  3438. };
  3439. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  3440. Record<string, any>;
  3441. type CreateWriteStreamFSImplementation = FSImplementation & {
  3442. write: (...args: any[]) => any;
  3443. close?: (...args: any[]) => any;
  3444. };
  3445. type CreatedObject<T, F> = T extends ChunkGroupInfoWithName[]
  3446. ? Record<string, StatsChunkGroup>
  3447. : T extends (infer V)[]
  3448. ? StatsObject<V, F>[]
  3449. : StatsObject<T, F>;
  3450. declare interface CssData {
  3451. /**
  3452. * whether export __esModule
  3453. */
  3454. esModule: boolean;
  3455. /**
  3456. * the css exports
  3457. */
  3458. exports: Map<string, string>;
  3459. }
  3460. declare abstract class CssGenerator extends Generator {
  3461. options: CssModuleGeneratorOptions;
  3462. sourceDependency(
  3463. module: NormalModule,
  3464. dependency: Dependency,
  3465. initFragments: InitFragment<GenerateContext>[],
  3466. source: ReplaceSource,
  3467. generateContext: GenerateContext & { cssData: CssData }
  3468. ): void;
  3469. sourceModule(
  3470. module: NormalModule,
  3471. initFragments: InitFragment<GenerateContext>[],
  3472. source: ReplaceSource,
  3473. generateContext: GenerateContext & { cssData: CssData }
  3474. ): void;
  3475. generateError(
  3476. error: Error,
  3477. module: NormalModule,
  3478. generateContext: GenerateContext
  3479. ): null | Source;
  3480. }
  3481. /**
  3482. * Generator options for css modules.
  3483. */
  3484. declare interface CssGeneratorOptions {
  3485. /**
  3486. * Configure the generated JS modules that use the ES modules syntax.
  3487. */
  3488. esModule?: boolean;
  3489. /**
  3490. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3491. */
  3492. exportsOnly?: boolean;
  3493. }
  3494. declare interface CssImportDependencyMeta {
  3495. layer?: string;
  3496. supports?: string;
  3497. media?: string;
  3498. }
  3499. type CssLayer = undefined | string;
  3500. declare class CssLoadingRuntimeModule extends RuntimeModule {
  3501. constructor(runtimeRequirements: ReadonlySet<string>);
  3502. static getCompilationHooks(
  3503. compilation: Compilation
  3504. ): CssLoadingRuntimeModulePluginHooks;
  3505. /**
  3506. * Runtime modules without any dependencies to other runtime modules
  3507. */
  3508. static STAGE_NORMAL: number;
  3509. /**
  3510. * Runtime modules with simple dependencies on other runtime modules
  3511. */
  3512. static STAGE_BASIC: number;
  3513. /**
  3514. * Runtime modules which attach to handlers of other runtime modules
  3515. */
  3516. static STAGE_ATTACH: number;
  3517. /**
  3518. * Runtime modules which trigger actions on bootstrap
  3519. */
  3520. static STAGE_TRIGGER: number;
  3521. }
  3522. declare interface CssLoadingRuntimeModulePluginHooks {
  3523. createStylesheet: SyncWaterfallHook<[string, Chunk], string>;
  3524. linkPreload: SyncWaterfallHook<[string, Chunk], string>;
  3525. linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
  3526. }
  3527. declare abstract class CssModule extends NormalModule {
  3528. cssLayer: CssLayer;
  3529. supports: Supports;
  3530. media: Media;
  3531. inheritance?: [CssLayer, Supports, Media][];
  3532. }
  3533. /**
  3534. * Generator options for css/module modules.
  3535. */
  3536. declare interface CssModuleGeneratorOptions {
  3537. /**
  3538. * Configure the generated JS modules that use the ES modules syntax.
  3539. */
  3540. esModule?: boolean;
  3541. /**
  3542. * Configure how CSS content is exported as default.
  3543. */
  3544. exportType?: "link" | "text" | "css-style-sheet";
  3545. /**
  3546. * Specifies the convention of exported names.
  3547. */
  3548. exportsConvention?:
  3549. | "as-is"
  3550. | "camel-case"
  3551. | "camel-case-only"
  3552. | "dashes"
  3553. | "dashes-only"
  3554. | ((name: string) => string);
  3555. /**
  3556. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3557. */
  3558. exportsOnly?: boolean;
  3559. /**
  3560. * Digest types used for the hash.
  3561. */
  3562. localIdentHashDigest?: string;
  3563. /**
  3564. * Number of chars which are used for the hash.
  3565. */
  3566. localIdentHashDigestLength?: number;
  3567. /**
  3568. * Any string which is added to the hash to salt it.
  3569. */
  3570. localIdentHashSalt?: string;
  3571. /**
  3572. * Configure the generated local ident name.
  3573. */
  3574. localIdentName?: string;
  3575. }
  3576. /**
  3577. * Parser options for css/module modules.
  3578. */
  3579. declare interface CssModuleParserOptions {
  3580. /**
  3581. * Enable/disable renaming of `@keyframes`.
  3582. */
  3583. animation?: boolean;
  3584. /**
  3585. * Enable/disable renaming of `@container` names.
  3586. */
  3587. container?: boolean;
  3588. /**
  3589. * Enable/disable renaming of custom identifiers.
  3590. */
  3591. customIdents?: boolean;
  3592. /**
  3593. * Enable/disable renaming of dashed identifiers, e. g. custom properties.
  3594. */
  3595. dashedIdents?: boolean;
  3596. /**
  3597. * Configure how CSS content is exported as default.
  3598. */
  3599. exportType?: "link" | "text" | "css-style-sheet";
  3600. /**
  3601. * Enable/disable renaming of `@function` names.
  3602. */
  3603. function?: boolean;
  3604. /**
  3605. * Enable/disable renaming of grid identifiers.
  3606. */
  3607. grid?: boolean;
  3608. /**
  3609. * Enable/disable `@import` at-rules handling.
  3610. */
  3611. import?: boolean;
  3612. /**
  3613. * Use ES modules named export for css exports.
  3614. */
  3615. namedExports?: boolean;
  3616. /**
  3617. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3618. */
  3619. url?: boolean;
  3620. }
  3621. declare class CssModulesPlugin {
  3622. constructor();
  3623. /**
  3624. * Apply the plugin
  3625. */
  3626. apply(compiler: Compiler): void;
  3627. getModulesInOrder(
  3628. chunk: Chunk,
  3629. modules: undefined | Iterable<Module>,
  3630. compilation: Compilation
  3631. ): Module[];
  3632. getOrderedChunkCssModules(
  3633. chunk: Chunk,
  3634. chunkGraph: ChunkGraph,
  3635. compilation: Compilation
  3636. ): CssModule[];
  3637. renderChunk(
  3638. __0: RenderContextCssModulesPlugin,
  3639. hooks: CompilationHooksCssModulesPlugin
  3640. ): Source;
  3641. static getCompilationHooks(
  3642. compilation: Compilation
  3643. ): CompilationHooksCssModulesPlugin;
  3644. static renderModule(
  3645. module: CssModule,
  3646. renderContext: ChunkRenderContextCssModulesPlugin,
  3647. hooks: CompilationHooksCssModulesPlugin
  3648. ): null | Source;
  3649. static getChunkFilenameTemplate(
  3650. chunk: Chunk,
  3651. outputOptions: OutputNormalizedWithDefaults
  3652. ): TemplatePath;
  3653. static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
  3654. }
  3655. declare abstract class CssParser extends ParserClass {
  3656. defaultMode: "global" | "auto" | "pure" | "local";
  3657. options: {
  3658. /**
  3659. * Enable/disable renaming of `@keyframes`.
  3660. */
  3661. animation: boolean;
  3662. /**
  3663. * Enable/disable renaming of `@container` names.
  3664. */
  3665. container: boolean;
  3666. /**
  3667. * Enable/disable renaming of custom identifiers.
  3668. */
  3669. customIdents: boolean;
  3670. /**
  3671. * Enable/disable renaming of dashed identifiers, e. g. custom properties.
  3672. */
  3673. dashedIdents: boolean;
  3674. /**
  3675. * Configure how CSS content is exported as default.
  3676. */
  3677. exportType?: "link" | "text" | "css-style-sheet";
  3678. /**
  3679. * Enable/disable renaming of `@function` names.
  3680. */
  3681. function: boolean;
  3682. /**
  3683. * Enable/disable renaming of grid identifiers.
  3684. */
  3685. grid: boolean;
  3686. /**
  3687. * Enable/disable `@import` at-rules handling.
  3688. */
  3689. import: boolean;
  3690. /**
  3691. * Use ES modules named export for css exports.
  3692. */
  3693. namedExports: boolean;
  3694. /**
  3695. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3696. */
  3697. url: boolean;
  3698. /**
  3699. * default mode
  3700. */
  3701. defaultMode?: "global" | "auto" | "pure" | "local";
  3702. };
  3703. comments?: CommentCssParser[];
  3704. magicCommentContext: ContextImport;
  3705. getComments(range: [number, number]): CommentCssParser[];
  3706. parseCommentOptions(range: [number, number]): {
  3707. options: null | Record<string, any>;
  3708. errors: null | (Error & { comment: CommentCssParser })[];
  3709. };
  3710. }
  3711. /**
  3712. * Parser options for css modules.
  3713. */
  3714. declare interface CssParserOptions {
  3715. /**
  3716. * Configure how CSS content is exported as default.
  3717. */
  3718. exportType?: "link" | "text" | "css-style-sheet";
  3719. /**
  3720. * Enable/disable `@import` at-rules handling.
  3721. */
  3722. import?: boolean;
  3723. /**
  3724. * Use ES modules named export for css exports.
  3725. */
  3726. namedExports?: boolean;
  3727. /**
  3728. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3729. */
  3730. url?: boolean;
  3731. }
  3732. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  3733. declare class DefinePlugin {
  3734. /**
  3735. * Create a new define plugin
  3736. */
  3737. constructor(definitions: Definitions);
  3738. definitions: Definitions;
  3739. /**
  3740. * Apply the plugin
  3741. */
  3742. apply(compiler: Compiler): void;
  3743. static getCompilationHooks(compilation: Compilation): DefinePluginHooks;
  3744. static runtimeValue(
  3745. fn: (value: {
  3746. module: NormalModule;
  3747. key: string;
  3748. readonly version: ValueCacheVersion;
  3749. }) => CodeValuePrimitive,
  3750. options?: true | string[] | RuntimeValueOptions
  3751. ): RuntimeValue;
  3752. }
  3753. declare interface DefinePluginHooks {
  3754. definitions: SyncWaterfallHook<
  3755. [Record<string, CodeValue>],
  3756. Record<string, CodeValue>
  3757. >;
  3758. }
  3759. declare interface Definitions {
  3760. [index: string]: CodeValue;
  3761. }
  3762. declare class DelegatedPlugin {
  3763. constructor(options: Options);
  3764. options: Options;
  3765. /**
  3766. * Apply the plugin
  3767. */
  3768. apply(compiler: Compiler): void;
  3769. }
  3770. declare abstract class DependenciesBlock {
  3771. dependencies: Dependency[];
  3772. blocks: AsyncDependenciesBlock[];
  3773. parent?: DependenciesBlock;
  3774. getRootBlock(): DependenciesBlock;
  3775. /**
  3776. * Adds a DependencyBlock to DependencyBlock relationship.
  3777. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  3778. */
  3779. addBlock(block: AsyncDependenciesBlock): void;
  3780. addDependency(dependency: Dependency): void;
  3781. removeDependency(dependency: Dependency): void;
  3782. /**
  3783. * Removes all dependencies and blocks
  3784. */
  3785. clearDependenciesAndBlocks(): void;
  3786. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3787. serialize(__0: ObjectSerializerContext): void;
  3788. deserialize(__0: ObjectDeserializerContext): void;
  3789. }
  3790. declare interface DependenciesBlockLike {
  3791. dependencies: Dependency[];
  3792. blocks: AsyncDependenciesBlock[];
  3793. }
  3794. declare class Dependency {
  3795. constructor();
  3796. weak: boolean;
  3797. optional?: boolean;
  3798. get type(): string;
  3799. get category(): string;
  3800. loc: DependencyLocation;
  3801. setLoc(
  3802. startLine: number,
  3803. startColumn: number,
  3804. endLine: number,
  3805. endColumn: number
  3806. ): void;
  3807. getContext(): undefined | string;
  3808. getResourceIdentifier(): null | string;
  3809. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  3810. /**
  3811. * Returns the referenced module and export
  3812. */
  3813. getReference(moduleGraph: ModuleGraph): never;
  3814. /**
  3815. * Returns list of exports referenced by this dependency
  3816. */
  3817. getReferencedExports(
  3818. moduleGraph: ModuleGraph,
  3819. runtime: RuntimeSpec
  3820. ): (string[] | ReferencedExport)[];
  3821. getCondition(
  3822. moduleGraph: ModuleGraph
  3823. ):
  3824. | null
  3825. | false
  3826. | ((
  3827. moduleGraphConnection: ModuleGraphConnection,
  3828. runtime: RuntimeSpec
  3829. ) => ConnectionState);
  3830. /**
  3831. * Returns the exported names
  3832. */
  3833. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  3834. /**
  3835. * Returns warnings
  3836. */
  3837. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3838. /**
  3839. * Returns errors
  3840. */
  3841. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3842. /**
  3843. * Update the hash
  3844. */
  3845. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3846. /**
  3847. * implement this method to allow the occurrence order plugin to count correctly
  3848. */
  3849. getNumberOfIdOccurrences(): number;
  3850. getModuleEvaluationSideEffectsState(
  3851. moduleGraph: ModuleGraph
  3852. ): ConnectionState;
  3853. createIgnoredModule(context: string): Module;
  3854. serialize(__0: ObjectSerializerContext): void;
  3855. deserialize(__0: ObjectDeserializerContext): void;
  3856. module: any;
  3857. get disconnect(): any;
  3858. static NO_EXPORTS_REFERENCED: string[][];
  3859. static EXPORTS_OBJECT_REFERENCED: string[][];
  3860. static isLowPriorityDependency(dependency: Dependency): boolean;
  3861. static TRANSITIVE: typeof TRANSITIVE;
  3862. }
  3863. declare interface DependencyConstructor {
  3864. new (...args: any[]): Dependency;
  3865. }
  3866. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3867. declare interface DependencySourceOrder {
  3868. /**
  3869. * the main source order
  3870. */
  3871. main: number;
  3872. /**
  3873. * the sub source order
  3874. */
  3875. sub: number;
  3876. }
  3877. declare class DependencyTemplate {
  3878. constructor();
  3879. apply(
  3880. dependency: Dependency,
  3881. source: ReplaceSource,
  3882. templateContext: DependencyTemplateContext
  3883. ): void;
  3884. }
  3885. declare interface DependencyTemplateContext {
  3886. /**
  3887. * the runtime template
  3888. */
  3889. runtimeTemplate: RuntimeTemplate;
  3890. /**
  3891. * the dependency templates
  3892. */
  3893. dependencyTemplates: DependencyTemplates;
  3894. /**
  3895. * the module graph
  3896. */
  3897. moduleGraph: ModuleGraph;
  3898. /**
  3899. * the chunk graph
  3900. */
  3901. chunkGraph: ChunkGraph;
  3902. /**
  3903. * the requirements for runtime
  3904. */
  3905. runtimeRequirements: Set<string>;
  3906. /**
  3907. * current module
  3908. */
  3909. module: Module;
  3910. /**
  3911. * current runtimes, for which code is generated
  3912. */
  3913. runtime: RuntimeSpec;
  3914. /**
  3915. * mutable array of init fragments for the current module
  3916. */
  3917. initFragments: InitFragment<GenerateContext>[];
  3918. /**
  3919. * when in a concatenated module, information about other concatenated modules
  3920. */
  3921. concatenationScope?: ConcatenationScope;
  3922. /**
  3923. * the code generation results
  3924. */
  3925. codeGenerationResults: CodeGenerationResults;
  3926. /**
  3927. * chunkInitFragments
  3928. */
  3929. chunkInitFragments: InitFragment<GenerateContext>[];
  3930. }
  3931. declare abstract class DependencyTemplates {
  3932. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3933. set(
  3934. dependency: DependencyConstructor,
  3935. dependencyTemplate: DependencyTemplate
  3936. ): void;
  3937. updateHash(part: string): void;
  3938. getHash(): string;
  3939. clone(): DependencyTemplates;
  3940. }
  3941. /**
  3942. * Helper function for joining two ranges into a single range. This is useful
  3943. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3944. * to create the range of the _parent node_.
  3945. */
  3946. declare interface DestructuringAssignmentProperty {
  3947. id: string;
  3948. range: [number, number];
  3949. loc: SourceLocation;
  3950. pattern?: Set<DestructuringAssignmentProperty>;
  3951. shorthand: string | boolean;
  3952. }
  3953. declare class DeterministicChunkIdsPlugin {
  3954. constructor(options?: DeterministicChunkIdsPluginOptions);
  3955. options: DeterministicChunkIdsPluginOptions;
  3956. /**
  3957. * Apply the plugin
  3958. */
  3959. apply(compiler: Compiler): void;
  3960. }
  3961. declare interface DeterministicChunkIdsPluginOptions {
  3962. /**
  3963. * context for ids
  3964. */
  3965. context?: string;
  3966. /**
  3967. * maximum length of ids
  3968. */
  3969. maxLength?: number;
  3970. }
  3971. declare class DeterministicModuleIdsPlugin {
  3972. constructor(options?: DeterministicModuleIdsPluginOptions);
  3973. options: DeterministicModuleIdsPluginOptions;
  3974. /**
  3975. * Apply the plugin
  3976. */
  3977. apply(compiler: Compiler): void;
  3978. }
  3979. declare interface DeterministicModuleIdsPluginOptions {
  3980. /**
  3981. * context relative to which module identifiers are computed
  3982. */
  3983. context?: string;
  3984. /**
  3985. * selector function for modules
  3986. */
  3987. test?: (module: Module) => boolean;
  3988. /**
  3989. * maximum id length in digits (used as starting point)
  3990. */
  3991. maxLength?: number;
  3992. /**
  3993. * hash salt for ids
  3994. */
  3995. salt?: number;
  3996. /**
  3997. * do not increase the maxLength to find an optimal id space size
  3998. */
  3999. fixedLength?: boolean;
  4000. /**
  4001. * throw an error when id conflicts occur (instead of rehashing)
  4002. */
  4003. failOnConflict?: boolean;
  4004. }
  4005. type DevtoolFallbackModuleFilenameTemplate =
  4006. | string
  4007. | ((context: ModuleFilenameTemplateContext) => string);
  4008. type DevtoolModuleFilenameTemplate =
  4009. | string
  4010. | ((context: ModuleFilenameTemplateContext) => string);
  4011. declare interface Dirent<T extends string | Buffer = string> {
  4012. /**
  4013. * true when is file, otherwise false
  4014. */
  4015. isFile: () => boolean;
  4016. /**
  4017. * true when is directory, otherwise false
  4018. */
  4019. isDirectory: () => boolean;
  4020. /**
  4021. * true when is block device, otherwise false
  4022. */
  4023. isBlockDevice: () => boolean;
  4024. /**
  4025. * true when is character device, otherwise false
  4026. */
  4027. isCharacterDevice: () => boolean;
  4028. /**
  4029. * true when is symbolic link, otherwise false
  4030. */
  4031. isSymbolicLink: () => boolean;
  4032. /**
  4033. * true when is FIFO, otherwise false
  4034. */
  4035. isFIFO: () => boolean;
  4036. /**
  4037. * true when is socket, otherwise false
  4038. */
  4039. isSocket: () => boolean;
  4040. /**
  4041. * name
  4042. */
  4043. name: T;
  4044. /**
  4045. * path
  4046. */
  4047. parentPath: string;
  4048. /**
  4049. * path
  4050. */
  4051. path?: string;
  4052. }
  4053. declare interface Disposable {
  4054. [Symbol.dispose](): void;
  4055. }
  4056. declare class DllPlugin {
  4057. constructor(options: DllPluginOptions);
  4058. options: {
  4059. entryOnly: boolean;
  4060. /**
  4061. * Context of requests in the manifest file (defaults to the webpack context).
  4062. */
  4063. context?: string;
  4064. /**
  4065. * If true, manifest json file (output) will be formatted.
  4066. */
  4067. format?: boolean;
  4068. /**
  4069. * Name of the exposed dll function (external name, use value of 'output.library').
  4070. */
  4071. name?: string;
  4072. /**
  4073. * Absolute path to the manifest json file (output).
  4074. */
  4075. path: string;
  4076. /**
  4077. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  4078. */
  4079. type?: string;
  4080. };
  4081. /**
  4082. * Apply the plugin
  4083. */
  4084. apply(compiler: Compiler): void;
  4085. }
  4086. declare interface DllPluginOptions {
  4087. /**
  4088. * Context of requests in the manifest file (defaults to the webpack context).
  4089. */
  4090. context?: string;
  4091. /**
  4092. * If true, only entry points will be exposed (default: true).
  4093. */
  4094. entryOnly?: boolean;
  4095. /**
  4096. * If true, manifest json file (output) will be formatted.
  4097. */
  4098. format?: boolean;
  4099. /**
  4100. * Name of the exposed dll function (external name, use value of 'output.library').
  4101. */
  4102. name?: string;
  4103. /**
  4104. * Absolute path to the manifest json file (output).
  4105. */
  4106. path: string;
  4107. /**
  4108. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  4109. */
  4110. type?: string;
  4111. }
  4112. declare class DllReferencePlugin {
  4113. constructor(options: DllReferencePluginOptions);
  4114. options: DllReferencePluginOptions;
  4115. /**
  4116. * Apply the plugin
  4117. */
  4118. apply(compiler: Compiler): void;
  4119. }
  4120. type DllReferencePluginOptions =
  4121. | {
  4122. /**
  4123. * Context of requests in the manifest (or content property) as absolute path.
  4124. */
  4125. context?: string;
  4126. /**
  4127. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  4128. */
  4129. extensions?: string[];
  4130. /**
  4131. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  4132. */
  4133. manifest: string | DllReferencePluginOptionsManifest;
  4134. /**
  4135. * The name where the dll is exposed (external name, defaults to manifest.name).
  4136. */
  4137. name?: string;
  4138. /**
  4139. * Prefix which is used for accessing the content of the dll.
  4140. */
  4141. scope?: string;
  4142. /**
  4143. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  4144. */
  4145. sourceType?:
  4146. | "var"
  4147. | "assign"
  4148. | "this"
  4149. | "window"
  4150. | "global"
  4151. | "commonjs"
  4152. | "commonjs2"
  4153. | "commonjs-module"
  4154. | "amd"
  4155. | "amd-require"
  4156. | "umd"
  4157. | "umd2"
  4158. | "jsonp"
  4159. | "system";
  4160. /**
  4161. * The way how the export of the dll bundle is used.
  4162. */
  4163. type?: "object" | "require";
  4164. }
  4165. | {
  4166. /**
  4167. * The mappings from request to module info.
  4168. */
  4169. content: DllReferencePluginOptionsContent;
  4170. /**
  4171. * Context of requests in the manifest (or content property) as absolute path.
  4172. */
  4173. context?: string;
  4174. /**
  4175. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  4176. */
  4177. extensions?: string[];
  4178. /**
  4179. * The name where the dll is exposed (external name).
  4180. */
  4181. name: string;
  4182. /**
  4183. * Prefix which is used for accessing the content of the dll.
  4184. */
  4185. scope?: string;
  4186. /**
  4187. * How the dll is exposed (libraryTarget).
  4188. */
  4189. sourceType?:
  4190. | "var"
  4191. | "assign"
  4192. | "this"
  4193. | "window"
  4194. | "global"
  4195. | "commonjs"
  4196. | "commonjs2"
  4197. | "commonjs-module"
  4198. | "amd"
  4199. | "amd-require"
  4200. | "umd"
  4201. | "umd2"
  4202. | "jsonp"
  4203. | "system";
  4204. /**
  4205. * The way how the export of the dll bundle is used.
  4206. */
  4207. type?: "object" | "require";
  4208. };
  4209. /**
  4210. * The mappings from request to module info.
  4211. */
  4212. declare interface DllReferencePluginOptionsContent {
  4213. [index: string]: {
  4214. /**
  4215. * Meta information about the module.
  4216. */
  4217. buildMeta?: { [index: string]: any };
  4218. /**
  4219. * Information about the provided exports of the module.
  4220. */
  4221. exports?: true | string[];
  4222. /**
  4223. * Module ID.
  4224. */
  4225. id: string | number;
  4226. };
  4227. }
  4228. /**
  4229. * An object containing content, name and type.
  4230. */
  4231. declare interface DllReferencePluginOptionsManifest {
  4232. /**
  4233. * The mappings from request to module info.
  4234. */
  4235. content: DllReferencePluginOptionsContent;
  4236. /**
  4237. * The name where the dll is exposed (external name).
  4238. */
  4239. name?: string;
  4240. /**
  4241. * The type how the dll is exposed (external type).
  4242. */
  4243. type?:
  4244. | "var"
  4245. | "assign"
  4246. | "this"
  4247. | "window"
  4248. | "global"
  4249. | "commonjs"
  4250. | "commonjs2"
  4251. | "commonjs-module"
  4252. | "amd"
  4253. | "amd-require"
  4254. | "umd"
  4255. | "umd2"
  4256. | "jsonp"
  4257. | "system";
  4258. }
  4259. declare class DotenvPlugin {
  4260. constructor(options?: DotenvPluginOptions);
  4261. options: {
  4262. /**
  4263. * The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.
  4264. */
  4265. dir?: string | false;
  4266. /**
  4267. * Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.
  4268. */
  4269. prefix?: string | string[];
  4270. /**
  4271. * Template patterns for .env file names. Use [mode] as placeholder for the webpack mode. Defaults to ['.env', '.env.local', '.env.[mode]', '.env.[mode].local'].
  4272. */
  4273. template?: string[];
  4274. };
  4275. apply(compiler: Compiler): void;
  4276. }
  4277. /**
  4278. * Options for Dotenv plugin.
  4279. */
  4280. declare interface DotenvPluginOptions {
  4281. /**
  4282. * The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.
  4283. */
  4284. dir?: string | false;
  4285. /**
  4286. * Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.
  4287. */
  4288. prefix?: string | string[];
  4289. /**
  4290. * Template patterns for .env file names. Use [mode] as placeholder for the webpack mode. Defaults to ['.env', '.env.local', '.env.[mode]', '.env.[mode].local'].
  4291. */
  4292. template?: string[];
  4293. }
  4294. declare class DynamicEntryPlugin {
  4295. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  4296. context: string;
  4297. entry: () => Promise<EntryStaticNormalized>;
  4298. /**
  4299. * Apply the plugin
  4300. */
  4301. apply(compiler: Compiler): void;
  4302. }
  4303. type Effect = EffectUse | EffectBasic;
  4304. declare interface EffectBasic {
  4305. type: string;
  4306. value: any;
  4307. }
  4308. declare interface EffectData {
  4309. resource?: string;
  4310. realResource?: string;
  4311. resourceQuery?: string;
  4312. resourceFragment?: string;
  4313. scheme?: string;
  4314. attributes?: ImportAttributes;
  4315. mimetype?: string;
  4316. dependency: string;
  4317. descriptionData?: JsonObjectTypes;
  4318. compiler?: string;
  4319. issuer: string;
  4320. issuerLayer: string;
  4321. }
  4322. declare interface EffectUse {
  4323. type: EffectUseType;
  4324. value: {
  4325. loader: string;
  4326. options?: null | string | Record<string, any>;
  4327. ident?: string;
  4328. };
  4329. }
  4330. type EffectUseType = "use" | "use-pre" | "use-post";
  4331. declare class ElectronTargetPlugin {
  4332. constructor(context?: "main" | "preload" | "renderer");
  4333. /**
  4334. * Apply the plugin
  4335. */
  4336. apply(compiler: Compiler): void;
  4337. }
  4338. /**
  4339. * No generator options are supported for this module type.
  4340. */
  4341. declare interface EmptyGeneratorOptions {}
  4342. /**
  4343. * No parser options are supported for this module type.
  4344. */
  4345. declare interface EmptyParserOptions {}
  4346. declare class EnableChunkLoadingPlugin {
  4347. constructor(type: string);
  4348. type: string;
  4349. /**
  4350. * Apply the plugin
  4351. */
  4352. apply(compiler: Compiler): void;
  4353. static setEnabled(compiler: Compiler, type: string): void;
  4354. static checkEnabled(compiler: Compiler, type: string): void;
  4355. }
  4356. declare class EnableLibraryPlugin {
  4357. constructor(type: string, options?: EnableLibraryPluginOptions);
  4358. type: string;
  4359. options: EnableLibraryPluginOptions;
  4360. /**
  4361. * Apply the plugin
  4362. */
  4363. apply(compiler: Compiler): void;
  4364. static setEnabled(compiler: Compiler, type: string): void;
  4365. static checkEnabled(compiler: Compiler, type: string): void;
  4366. }
  4367. declare interface EnableLibraryPluginOptions {
  4368. /**
  4369. * function that runs when applying the current plugin.
  4370. */
  4371. additionalApply?: () => void;
  4372. }
  4373. declare class EnableWasmLoadingPlugin {
  4374. constructor(type: string);
  4375. type: string;
  4376. /**
  4377. * Apply the plugin
  4378. */
  4379. apply(compiler: Compiler): void;
  4380. static setEnabled(compiler: Compiler, type: string): void;
  4381. static checkEnabled(compiler: Compiler, type: string): void;
  4382. }
  4383. type EncodingOption =
  4384. | undefined
  4385. | null
  4386. | "ascii"
  4387. | "utf8"
  4388. | "utf-8"
  4389. | "utf16le"
  4390. | "utf-16le"
  4391. | "ucs2"
  4392. | "ucs-2"
  4393. | "base64"
  4394. | "base64url"
  4395. | "latin1"
  4396. | "binary"
  4397. | "hex"
  4398. | ObjectEncodingOptions;
  4399. declare interface EntryData {
  4400. /**
  4401. * dependencies of the entrypoint that should be evaluated at startup
  4402. */
  4403. dependencies: Dependency[];
  4404. /**
  4405. * dependencies of the entrypoint that should be included but not evaluated
  4406. */
  4407. includeDependencies: Dependency[];
  4408. /**
  4409. * options of the entrypoint
  4410. */
  4411. options: EntryOptions;
  4412. }
  4413. declare abstract class EntryDependency extends ModuleDependency {}
  4414. /**
  4415. * An object with entry point description.
  4416. */
  4417. declare interface EntryDescription {
  4418. /**
  4419. * Enable/disable creating async chunks that are loaded on demand.
  4420. */
  4421. asyncChunks?: boolean;
  4422. /**
  4423. * Base uri for this entry.
  4424. */
  4425. baseUri?: string;
  4426. /**
  4427. * 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).
  4428. */
  4429. chunkLoading?: string | false;
  4430. /**
  4431. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  4432. */
  4433. dependOn?: string | string[];
  4434. /**
  4435. * 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.
  4436. */
  4437. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4438. /**
  4439. * Module(s) that are loaded upon startup.
  4440. */
  4441. import: EntryItem;
  4442. /**
  4443. * Specifies the layer in which modules of this entrypoint are placed.
  4444. */
  4445. layer?: null | string;
  4446. /**
  4447. * Options for library.
  4448. */
  4449. library?: LibraryOptions;
  4450. /**
  4451. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  4452. */
  4453. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4454. /**
  4455. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  4456. */
  4457. runtime?: string | false;
  4458. /**
  4459. * 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).
  4460. */
  4461. wasmLoading?: string | false;
  4462. }
  4463. /**
  4464. * An object with entry point description.
  4465. */
  4466. declare interface EntryDescriptionNormalized {
  4467. /**
  4468. * Enable/disable creating async chunks that are loaded on demand.
  4469. */
  4470. asyncChunks?: boolean;
  4471. /**
  4472. * Base uri for this entry.
  4473. */
  4474. baseUri?: string;
  4475. /**
  4476. * 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).
  4477. */
  4478. chunkLoading?: string | false;
  4479. /**
  4480. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  4481. */
  4482. dependOn?: string[];
  4483. /**
  4484. * 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.
  4485. */
  4486. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4487. /**
  4488. * Module(s) that are loaded upon startup. The last one is exported.
  4489. */
  4490. import?: string[];
  4491. /**
  4492. * Specifies the layer in which modules of this entrypoint are placed.
  4493. */
  4494. layer?: null | string;
  4495. /**
  4496. * Options for library.
  4497. */
  4498. library?: LibraryOptions;
  4499. /**
  4500. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  4501. */
  4502. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4503. /**
  4504. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  4505. */
  4506. runtime?: string | false;
  4507. /**
  4508. * 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).
  4509. */
  4510. wasmLoading?: string | false;
  4511. }
  4512. type EntryItem = string | string[];
  4513. type EntryLibIndex =
  4514. | string
  4515. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  4516. | EntryObject
  4517. | string[];
  4518. type EntryNormalized =
  4519. | (() => Promise<EntryStaticNormalized>)
  4520. | EntryStaticNormalized;
  4521. /**
  4522. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  4523. */
  4524. declare interface EntryObject {
  4525. [index: string]: string | string[] | EntryDescription;
  4526. }
  4527. declare class EntryOptionPlugin {
  4528. constructor();
  4529. apply(compiler: Compiler): void;
  4530. static applyEntryOption(
  4531. compiler: Compiler,
  4532. context: string,
  4533. entry: EntryNormalized
  4534. ): void;
  4535. static entryDescriptionToOptions(
  4536. compiler: Compiler,
  4537. name: string,
  4538. desc: EntryDescriptionNormalized
  4539. ): EntryOptions;
  4540. }
  4541. type EntryOptions = { name?: string } & Omit<
  4542. EntryDescriptionNormalized,
  4543. "import"
  4544. >;
  4545. declare class EntryPlugin {
  4546. /**
  4547. * An entry plugin which will handle creation of the EntryDependency
  4548. */
  4549. constructor(context: string, entry: string, options?: string | EntryOptions);
  4550. context: string;
  4551. entry: string;
  4552. options: string | EntryOptions;
  4553. /**
  4554. * Apply the plugin
  4555. */
  4556. apply(compiler: Compiler): void;
  4557. static createDependency(
  4558. entry: string,
  4559. options: string | EntryOptions
  4560. ): EntryDependency;
  4561. }
  4562. type EntryStatic = string | EntryObject | string[];
  4563. /**
  4564. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  4565. */
  4566. declare interface EntryStaticNormalized {
  4567. [index: string]: EntryDescriptionNormalized;
  4568. }
  4569. declare interface EntryTypesIndex {
  4570. safeTime: number;
  4571. timestamp: number;
  4572. accuracy: number;
  4573. }
  4574. declare abstract class Entrypoint extends ChunkGroup {
  4575. /**
  4576. * Sets the runtimeChunk for an entrypoint.
  4577. */
  4578. setRuntimeChunk(chunk: Chunk): void;
  4579. /**
  4580. * Fetches the chunk reference containing the webpack bootstrap code
  4581. */
  4582. getRuntimeChunk(): null | Chunk;
  4583. /**
  4584. * Sets the chunk with the entrypoint modules for an entrypoint.
  4585. */
  4586. setEntrypointChunk(chunk: Chunk): void;
  4587. /**
  4588. * Returns the chunk which contains the entrypoint modules
  4589. * (or at least the execution of them)
  4590. */
  4591. getEntrypointChunk(): Chunk;
  4592. addDependOn(entrypoint: Entrypoint): void;
  4593. dependOn(entrypoint: Entrypoint): boolean;
  4594. }
  4595. type EnumValue =
  4596. | null
  4597. | string
  4598. | number
  4599. | boolean
  4600. | EnumValueObject
  4601. | EnumValue[];
  4602. declare interface EnumValueObject {
  4603. [index: string]: EnumValue;
  4604. }
  4605. /**
  4606. * The abilities of the environment where the webpack generated code should run.
  4607. */
  4608. declare interface Environment {
  4609. /**
  4610. * The environment supports arrow functions ('() => { ... }').
  4611. */
  4612. arrowFunction?: boolean;
  4613. /**
  4614. * The environment supports async function and await ('async function () { await ... }').
  4615. */
  4616. asyncFunction?: boolean;
  4617. /**
  4618. * The environment supports BigInt as literal (123n).
  4619. */
  4620. bigIntLiteral?: boolean;
  4621. /**
  4622. * The environment supports const and let for variable declarations.
  4623. */
  4624. const?: boolean;
  4625. /**
  4626. * The environment supports destructuring ('{ a, b } = obj').
  4627. */
  4628. destructuring?: boolean;
  4629. /**
  4630. * The environment supports 'document'.
  4631. */
  4632. document?: boolean;
  4633. /**
  4634. * The environment supports an async import() function to import EcmaScript modules.
  4635. */
  4636. dynamicImport?: boolean;
  4637. /**
  4638. * The environment supports an async import() is available when creating a worker.
  4639. */
  4640. dynamicImportInWorker?: boolean;
  4641. /**
  4642. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  4643. */
  4644. forOf?: boolean;
  4645. /**
  4646. * The environment supports 'globalThis'.
  4647. */
  4648. globalThis?: boolean;
  4649. /**
  4650. * The environment supports `import.meta.dirname` and `import.meta.filename`.
  4651. */
  4652. importMetaDirnameAndFilename?: boolean;
  4653. /**
  4654. * The environment supports object method shorthand ('{ module() {} }').
  4655. */
  4656. methodShorthand?: boolean;
  4657. /**
  4658. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  4659. */
  4660. module?: boolean;
  4661. /**
  4662. * The environment supports `node:` prefix for Node.js core modules.
  4663. */
  4664. nodePrefixForCoreModules?: boolean;
  4665. /**
  4666. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  4667. */
  4668. optionalChaining?: boolean;
  4669. /**
  4670. * The environment supports template literals.
  4671. */
  4672. templateLiteral?: boolean;
  4673. }
  4674. declare class EnvironmentPlugin {
  4675. constructor(...keys: (string | string[] | Record<string, any>)[]);
  4676. keys: string[];
  4677. defaultValues: Record<string, any>;
  4678. /**
  4679. * Apply the plugin
  4680. */
  4681. apply(compiler: Compiler): void;
  4682. }
  4683. type ErrorWithDetail = Error & { details?: string };
  4684. declare interface Etag {
  4685. toString: () => string;
  4686. }
  4687. declare class EvalDevToolModulePlugin {
  4688. constructor(options?: EvalDevToolModulePluginOptions);
  4689. namespace: string;
  4690. sourceUrlComment: string;
  4691. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  4692. /**
  4693. * Apply the plugin
  4694. */
  4695. apply(compiler: Compiler): void;
  4696. }
  4697. declare interface EvalDevToolModulePluginOptions {
  4698. /**
  4699. * namespace
  4700. */
  4701. namespace?: string;
  4702. /**
  4703. * source url comment
  4704. */
  4705. sourceUrlComment?: string;
  4706. /**
  4707. * module filename template
  4708. */
  4709. moduleFilenameTemplate?:
  4710. | string
  4711. | ((context: ModuleFilenameTemplateContext) => string);
  4712. }
  4713. declare class EvalSourceMapDevToolPlugin {
  4714. constructor(inputOptions?: string | SourceMapDevToolPluginOptions);
  4715. sourceMapComment: string;
  4716. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  4717. namespace: string;
  4718. options: SourceMapDevToolPluginOptions;
  4719. /**
  4720. * Apply the plugin
  4721. */
  4722. apply(compiler: Compiler): void;
  4723. }
  4724. type ExcludeModulesType = "module" | "chunk" | "root-of-chunk" | "nested";
  4725. declare interface ExecuteModuleArgument {
  4726. module: Module;
  4727. moduleObject?: ExecuteModuleObject;
  4728. codeGenerationResult: CodeGenerationResult;
  4729. }
  4730. declare interface ExecuteModuleContext {
  4731. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4732. chunk: Chunk;
  4733. chunkGraph: ChunkGraph;
  4734. __webpack_require__?: WebpackRequire;
  4735. }
  4736. declare interface ExecuteModuleObject {
  4737. /**
  4738. * module id
  4739. */
  4740. id?: string;
  4741. /**
  4742. * exports
  4743. */
  4744. exports: any;
  4745. /**
  4746. * is loaded
  4747. */
  4748. loaded: boolean;
  4749. /**
  4750. * error
  4751. */
  4752. error?: Error;
  4753. }
  4754. declare interface ExecuteModuleOptions {
  4755. entryOptions?: EntryOptions;
  4756. }
  4757. declare interface ExecuteModuleResult {
  4758. exports: any;
  4759. cacheable: boolean;
  4760. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4761. fileDependencies: LazySet<string>;
  4762. contextDependencies: LazySet<string>;
  4763. missingDependencies: LazySet<string>;
  4764. buildDependencies: LazySet<string>;
  4765. }
  4766. declare interface ExecuteOptions {
  4767. /**
  4768. * module id
  4769. */
  4770. id?: string;
  4771. /**
  4772. * module
  4773. */
  4774. module: ExecuteModuleObject;
  4775. /**
  4776. * require function
  4777. */
  4778. require: WebpackRequire;
  4779. }
  4780. declare interface ExistenceOnlyTimeEntryFileSystemInfo {}
  4781. declare interface ExistenceOnlyTimeEntryTypesIndex {}
  4782. type Experiments = ExperimentsCommon & ExperimentsExtra;
  4783. /**
  4784. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4785. */
  4786. declare interface ExperimentsCommon {
  4787. /**
  4788. * Support WebAssembly as asynchronous EcmaScript Module.
  4789. */
  4790. asyncWebAssembly?: boolean;
  4791. /**
  4792. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  4793. */
  4794. backCompat?: boolean;
  4795. /**
  4796. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  4797. */
  4798. cacheUnaffected?: boolean;
  4799. /**
  4800. * Apply defaults of next major version.
  4801. */
  4802. futureDefaults?: boolean;
  4803. /**
  4804. * Allow output javascript files as module source type.
  4805. */
  4806. outputModule?: boolean;
  4807. /**
  4808. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  4809. */
  4810. syncWebAssembly?: boolean;
  4811. }
  4812. /**
  4813. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4814. */
  4815. declare interface ExperimentsExtra {
  4816. [index: string]: any;
  4817. /**
  4818. * Build http(s): urls using a lockfile and resource content cache.
  4819. */
  4820. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  4821. /**
  4822. * Enable css support.
  4823. */
  4824. css?: boolean;
  4825. /**
  4826. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  4827. */
  4828. deferImport?: boolean;
  4829. /**
  4830. * Compile entrypoints and import()s only when they are accessed.
  4831. */
  4832. lazyCompilation?: boolean | LazyCompilationOptions;
  4833. }
  4834. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  4835. /**
  4836. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4837. */
  4838. declare interface ExperimentsNormalizedExtra {
  4839. /**
  4840. * Build http(s): urls using a lockfile and resource content cache.
  4841. */
  4842. buildHttp?: HttpUriOptions;
  4843. /**
  4844. * Enable css support.
  4845. */
  4846. css?: boolean;
  4847. /**
  4848. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  4849. */
  4850. deferImport?: boolean;
  4851. /**
  4852. * Compile entrypoints and import()s only when they are accessed.
  4853. */
  4854. lazyCompilation?: false | LazyCompilationOptions;
  4855. }
  4856. declare abstract class ExportInfo {
  4857. name: string;
  4858. /**
  4859. * true: it is provided
  4860. * false: it is not provided
  4861. * null: only the runtime knows if it is provided
  4862. * undefined: it was not determined if it is provided
  4863. */
  4864. provided?: null | boolean;
  4865. /**
  4866. * is the export a terminal binding that should be checked for export star conflicts
  4867. */
  4868. terminalBinding: boolean;
  4869. /**
  4870. * true: it can be mangled
  4871. * false: is can not be mangled
  4872. * undefined: it was not determined if it can be mangled
  4873. */
  4874. canMangleProvide?: boolean;
  4875. /**
  4876. * true: it can be mangled
  4877. * false: is can not be mangled
  4878. * undefined: it was not determined if it can be mangled
  4879. */
  4880. canMangleUse?: boolean;
  4881. exportsInfoOwned: boolean;
  4882. exportsInfo?: ExportsInfo;
  4883. get canMangle(): boolean;
  4884. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4885. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4886. setHasUseInfo(): void;
  4887. setUsedConditionally(
  4888. condition: (condition: UsageStateType) => boolean,
  4889. newValue: UsageStateType,
  4890. runtime: RuntimeSpec
  4891. ): boolean;
  4892. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  4893. unsetTarget(key: Dependency): boolean;
  4894. setTarget(
  4895. key: Dependency,
  4896. connection: ModuleGraphConnection,
  4897. exportName?: null | string[],
  4898. priority?: number
  4899. ): boolean;
  4900. getUsed(runtime: RuntimeSpec): UsageStateType;
  4901. /**
  4902. * get used name
  4903. */
  4904. getUsedName(
  4905. fallbackName: undefined | string,
  4906. runtime: RuntimeSpec
  4907. ): string | false;
  4908. hasUsedName(): boolean;
  4909. /**
  4910. * Sets the mangled name of this export
  4911. */
  4912. setUsedName(name: string): void;
  4913. getTerminalBinding(
  4914. moduleGraph: ModuleGraph,
  4915. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4916. ): undefined | ExportsInfo | ExportInfo;
  4917. isReexport(): undefined | boolean;
  4918. findTarget(
  4919. moduleGraph: ModuleGraph,
  4920. validTargetModuleFilter: (module: Module) => boolean
  4921. ): undefined | null | false | TargetItemWithoutConnection;
  4922. getTarget(
  4923. moduleGraph: ModuleGraph,
  4924. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4925. ): undefined | TargetItemWithConnection;
  4926. /**
  4927. * Move the target forward as long resolveTargetFilter is fulfilled
  4928. */
  4929. moveTarget(
  4930. moduleGraph: ModuleGraph,
  4931. resolveTargetFilter: (target: TargetItemWithConnection) => boolean,
  4932. updateOriginalConnection?: (
  4933. target: TargetItemWithConnection
  4934. ) => ModuleGraphConnection
  4935. ): undefined | TargetItemWithConnection;
  4936. createNestedExportsInfo(): ExportsInfo;
  4937. getNestedExportsInfo(): undefined | ExportsInfo;
  4938. hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
  4939. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4940. getUsedInfo(): string;
  4941. getProvidedInfo():
  4942. | "no provided info"
  4943. | "maybe provided (runtime-defined)"
  4944. | "provided"
  4945. | "not provided";
  4946. getRenameInfo(): string;
  4947. }
  4948. declare abstract class ExportMode {
  4949. type: ExportModeType;
  4950. items: null | NormalReexportItem[];
  4951. name: null | string;
  4952. partialNamespaceExportInfo: null | ExportInfo;
  4953. ignored: null | Set<string>;
  4954. hidden?: null | Set<string>;
  4955. userRequest: null | string;
  4956. fakeType: number;
  4957. }
  4958. type ExportModeType =
  4959. | "unused"
  4960. | "missing"
  4961. | "empty-star"
  4962. | "reexport-dynamic-default"
  4963. | "reexport-named-default"
  4964. | "reexport-namespace-object"
  4965. | "reexport-fake-namespace-object"
  4966. | "reexport-undefined"
  4967. | "normal-reexport"
  4968. | "dynamic-reexport";
  4969. type ExportPresenceMode = 0 | 1 | 2 | 3;
  4970. declare interface ExportSpec {
  4971. /**
  4972. * the name of the export
  4973. */
  4974. name: string;
  4975. /**
  4976. * can the export be renamed (defaults to true)
  4977. */
  4978. canMangle?: boolean;
  4979. /**
  4980. * is the export a terminal binding that should be checked for export star conflicts
  4981. */
  4982. terminalBinding?: boolean;
  4983. /**
  4984. * nested exports
  4985. */
  4986. exports?: (string | ExportSpec)[];
  4987. /**
  4988. * when reexported: from which module
  4989. */
  4990. from?: ModuleGraphConnection;
  4991. /**
  4992. * when reexported: from which export
  4993. */
  4994. export?: null | string[];
  4995. /**
  4996. * when reexported: with which priority
  4997. */
  4998. priority?: number;
  4999. /**
  5000. * export is not visible, because another export blends over it
  5001. */
  5002. hidden?: boolean;
  5003. }
  5004. type ExportedVariableInfo = string | VariableInfo | ScopeInfo;
  5005. declare abstract class ExportsInfo {
  5006. get ownedExports(): Iterable<ExportInfo>;
  5007. get orderedOwnedExports(): Iterable<ExportInfo>;
  5008. get exports(): Iterable<ExportInfo>;
  5009. get orderedExports(): Iterable<ExportInfo>;
  5010. get otherExportsInfo(): ExportInfo;
  5011. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  5012. setHasProvideInfo(): void;
  5013. setHasUseInfo(): void;
  5014. getOwnExportInfo(name: string): ExportInfo;
  5015. getExportInfo(name: string): ExportInfo;
  5016. getReadOnlyExportInfo(name: string): ExportInfo;
  5017. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  5018. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  5019. setUnknownExportsProvided(
  5020. canMangle?: boolean,
  5021. excludeExports?: Set<string>,
  5022. targetKey?: Dependency,
  5023. targetModule?: ModuleGraphConnection,
  5024. priority?: number
  5025. ): boolean;
  5026. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  5027. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  5028. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  5029. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  5030. isUsed(runtime: RuntimeSpec): boolean;
  5031. isModuleUsed(runtime: RuntimeSpec): boolean;
  5032. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  5033. getProvidedExports(): null | true | string[];
  5034. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  5035. isExportProvided(name: string | string[]): undefined | null | boolean;
  5036. getUsageKey(runtime: RuntimeSpec): string;
  5037. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  5038. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  5039. getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
  5040. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  5041. getRestoreProvidedData(): RestoreProvidedData;
  5042. restoreProvided(__0: RestoreProvidedData): void;
  5043. }
  5044. declare interface ExportsSpec {
  5045. /**
  5046. * exported names, true for unknown exports or null for no exports
  5047. */
  5048. exports: null | true | (string | ExportSpec)[];
  5049. /**
  5050. * when exports = true, list of unaffected exports
  5051. */
  5052. excludeExports?: Set<string>;
  5053. /**
  5054. * list of maybe prior exposed, but now hidden exports
  5055. */
  5056. hideExports?: null | Set<string>;
  5057. /**
  5058. * when reexported: from which module
  5059. */
  5060. from?: ModuleGraphConnection;
  5061. /**
  5062. * when reexported: with which priority
  5063. */
  5064. priority?: number;
  5065. /**
  5066. * can the export be renamed (defaults to true)
  5067. */
  5068. canMangle?: boolean;
  5069. /**
  5070. * are the exports terminal bindings that should be checked for export star conflicts
  5071. */
  5072. terminalBinding?: boolean;
  5073. /**
  5074. * module on which the result depends on
  5075. */
  5076. dependencies?: Module[];
  5077. }
  5078. type ExportsType =
  5079. | "namespace"
  5080. | "default-only"
  5081. | "default-with-named"
  5082. | "dynamic";
  5083. type Exposes = (string | ExposesObject)[] | ExposesObject;
  5084. /**
  5085. * Advanced configuration for modules that should be exposed by this container.
  5086. */
  5087. declare interface ExposesConfig {
  5088. /**
  5089. * Request to a module that should be exposed by this container.
  5090. */
  5091. import: string | string[];
  5092. /**
  5093. * Custom chunk name for the exposed module.
  5094. */
  5095. name?: string;
  5096. }
  5097. /**
  5098. * Modules that should be exposed by this container. Property names are used as public paths.
  5099. */
  5100. declare interface ExposesObject {
  5101. [index: string]: string | ExposesConfig | string[];
  5102. }
  5103. type Expression =
  5104. | ImportExpressionImport
  5105. | UnaryExpression
  5106. | ArrayExpression
  5107. | ArrowFunctionExpression
  5108. | AssignmentExpression
  5109. | AwaitExpression
  5110. | BinaryExpression
  5111. | SimpleCallExpression
  5112. | NewExpression
  5113. | ChainExpression
  5114. | ClassExpression
  5115. | ConditionalExpression
  5116. | FunctionExpression
  5117. | Identifier
  5118. | SimpleLiteral
  5119. | RegExpLiteral
  5120. | BigIntLiteral
  5121. | LogicalExpression
  5122. | MemberExpression
  5123. | MetaProperty
  5124. | ObjectExpression
  5125. | SequenceExpression
  5126. | TaggedTemplateExpression
  5127. | TemplateLiteral
  5128. | ThisExpression
  5129. | UpdateExpression
  5130. | YieldExpression;
  5131. declare interface ExpressionExpressionInfo {
  5132. type: "expression";
  5133. rootInfo: string | VariableInfo;
  5134. name: string;
  5135. getMembers: () => string[];
  5136. getMembersOptionals: () => boolean[];
  5137. getMemberRanges: () => [number, number][];
  5138. }
  5139. declare interface ExtensionAliasOption {
  5140. alias: string | string[];
  5141. extension: string;
  5142. }
  5143. declare interface ExtensionAliasOptions {
  5144. [index: string]: string | string[];
  5145. }
  5146. type ExternalItem =
  5147. | string
  5148. | RegExp
  5149. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  5150. | ((
  5151. data: ExternalItemFunctionData,
  5152. callback: (
  5153. err?: null | Error,
  5154. result?: string | boolean | string[] | { [index: string]: any }
  5155. ) => void
  5156. ) => void)
  5157. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  5158. type ExternalItemFunction =
  5159. | ((
  5160. data: ExternalItemFunctionData,
  5161. callback: (
  5162. err?: null | Error,
  5163. result?: string | boolean | string[] | { [index: string]: any }
  5164. ) => void
  5165. ) => void)
  5166. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  5167. declare interface ExternalItemFunctionData {
  5168. /**
  5169. * the directory in which the request is placed
  5170. */
  5171. context: string;
  5172. /**
  5173. * contextual information
  5174. */
  5175. contextInfo: ModuleFactoryCreateDataContextInfo;
  5176. /**
  5177. * the category of the referencing dependency
  5178. */
  5179. dependencyType: string;
  5180. /**
  5181. * get a resolve function with the current resolver options
  5182. */
  5183. getResolve: (
  5184. options?: ResolveOptions
  5185. ) =>
  5186. | ((
  5187. context: string,
  5188. request: string,
  5189. callback: (
  5190. err?: null | Error,
  5191. result?: string | false,
  5192. resolveRequest?: ResolveRequest
  5193. ) => void
  5194. ) => void)
  5195. | ((context: string, request: string) => Promise<string>);
  5196. /**
  5197. * the request as written by the user in the require/import expression/statement
  5198. */
  5199. request: string;
  5200. }
  5201. /**
  5202. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  5203. */
  5204. declare interface ExternalItemObjectKnown {
  5205. /**
  5206. * Specify externals depending on the layer.
  5207. */
  5208. byLayer?:
  5209. | { [index: string]: ExternalItem }
  5210. | ((layer: null | string) => ExternalItem);
  5211. }
  5212. /**
  5213. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  5214. */
  5215. declare interface ExternalItemObjectUnknown {
  5216. [index: string]: ExternalItemValue;
  5217. }
  5218. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  5219. declare class ExternalModule extends Module {
  5220. constructor(
  5221. request: ExternalModuleRequest,
  5222. type: ExternalsType,
  5223. userRequest: string,
  5224. dependencyMeta?:
  5225. | ImportDependencyMeta
  5226. | CssImportDependencyMeta
  5227. | AssetDependencyMeta
  5228. );
  5229. request: ExternalModuleRequest;
  5230. externalType: ExternalsType;
  5231. userRequest: string;
  5232. dependencyMeta?:
  5233. | ImportDependencyMeta
  5234. | CssImportDependencyMeta
  5235. | AssetDependencyMeta;
  5236. /**
  5237. * restore unsafe cache data
  5238. */
  5239. restoreFromUnsafeCache(
  5240. unsafeCacheData: UnsafeCacheData,
  5241. normalModuleFactory: NormalModuleFactory
  5242. ): void;
  5243. static ModuleExternalInitFragment: typeof ModuleExternalInitFragment;
  5244. static getExternalModuleNodeCommonjsInitFragment: (
  5245. runtimeTemplate: RuntimeTemplate
  5246. ) => InitFragment<ChunkRenderContextJavascriptModulesPlugin>;
  5247. }
  5248. declare interface ExternalModuleInfo {
  5249. type: "external";
  5250. module: Module;
  5251. runtimeCondition?: string | boolean | SortableSet<string>;
  5252. nonDeferAccess: boolean;
  5253. index: number;
  5254. /**
  5255. * module.exports / harmony namespace object
  5256. */
  5257. name?: string;
  5258. /**
  5259. * deferred module.exports / harmony namespace object
  5260. */
  5261. deferredName?: string;
  5262. /**
  5263. * the module is deferred at least once
  5264. */
  5265. deferred: boolean;
  5266. /**
  5267. * deferred namespace object that being used in a not-analyzable way so it must be materialized
  5268. */
  5269. deferredNamespaceObjectUsed: boolean;
  5270. /**
  5271. * deferred namespace object that being used in a not-analyzable way so it must be materialized
  5272. */
  5273. deferredNamespaceObjectName?: string;
  5274. /**
  5275. * "default-with-named" namespace
  5276. */
  5277. interopNamespaceObjectUsed: boolean;
  5278. /**
  5279. * "default-with-named" namespace
  5280. */
  5281. interopNamespaceObjectName?: string;
  5282. /**
  5283. * "default-only" namespace
  5284. */
  5285. interopNamespaceObject2Used: boolean;
  5286. /**
  5287. * "default-only" namespace
  5288. */
  5289. interopNamespaceObject2Name?: string;
  5290. /**
  5291. * runtime namespace object that detects "__esModule"
  5292. */
  5293. interopDefaultAccessUsed: boolean;
  5294. /**
  5295. * runtime namespace object that detects "__esModule"
  5296. */
  5297. interopDefaultAccessName?: string;
  5298. }
  5299. type ExternalModuleRequest = string | string[] | RequestRecord;
  5300. type Externals =
  5301. | string
  5302. | RegExp
  5303. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  5304. | ((
  5305. data: ExternalItemFunctionData,
  5306. callback: (
  5307. err?: null | Error,
  5308. result?: string | boolean | string[] | { [index: string]: any }
  5309. ) => void
  5310. ) => void)
  5311. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
  5312. | ExternalItem[];
  5313. declare class ExternalsPlugin {
  5314. constructor(
  5315. type:
  5316. | "import"
  5317. | "var"
  5318. | "module"
  5319. | "assign"
  5320. | "this"
  5321. | "window"
  5322. | "self"
  5323. | "global"
  5324. | "commonjs"
  5325. | "commonjs2"
  5326. | "commonjs-module"
  5327. | "commonjs-static"
  5328. | "amd"
  5329. | "amd-require"
  5330. | "umd"
  5331. | "umd2"
  5332. | "jsonp"
  5333. | "system"
  5334. | "promise"
  5335. | "module-import"
  5336. | "script"
  5337. | "node-commonjs"
  5338. | "asset"
  5339. | "css-import"
  5340. | "css-url"
  5341. | ((dependency: Dependency) => ExternalsType),
  5342. externals: Externals
  5343. );
  5344. type:
  5345. | "import"
  5346. | "var"
  5347. | "module"
  5348. | "assign"
  5349. | "this"
  5350. | "window"
  5351. | "self"
  5352. | "global"
  5353. | "commonjs"
  5354. | "commonjs2"
  5355. | "commonjs-module"
  5356. | "commonjs-static"
  5357. | "amd"
  5358. | "amd-require"
  5359. | "umd"
  5360. | "umd2"
  5361. | "jsonp"
  5362. | "system"
  5363. | "promise"
  5364. | "module-import"
  5365. | "script"
  5366. | "node-commonjs"
  5367. | "asset"
  5368. | "css-import"
  5369. | "css-url"
  5370. | ((dependency: Dependency) => ExternalsType);
  5371. externals: Externals;
  5372. /**
  5373. * Apply the plugin
  5374. */
  5375. apply(compiler: Compiler): void;
  5376. }
  5377. /**
  5378. * Enable presets of externals for specific targets.
  5379. */
  5380. declare interface ExternalsPresets {
  5381. /**
  5382. * 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.
  5383. */
  5384. electron?: boolean;
  5385. /**
  5386. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  5387. */
  5388. electronMain?: boolean;
  5389. /**
  5390. * 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.
  5391. */
  5392. electronPreload?: boolean;
  5393. /**
  5394. * 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.
  5395. */
  5396. electronRenderer?: boolean;
  5397. /**
  5398. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  5399. */
  5400. node?: boolean;
  5401. /**
  5402. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  5403. */
  5404. nwjs?: boolean;
  5405. /**
  5406. * 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).
  5407. */
  5408. web?: boolean;
  5409. /**
  5410. * 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).
  5411. */
  5412. webAsync?: boolean;
  5413. }
  5414. type ExternalsPresetsNormalizedWithDefaults = ExternalsPresets & {
  5415. web: NonNullable<undefined | boolean>;
  5416. node: NonNullable<undefined | boolean>;
  5417. nwjs: NonNullable<undefined | boolean>;
  5418. electron: NonNullable<undefined | boolean>;
  5419. electronMain: NonNullable<undefined | boolean>;
  5420. electronPreload: NonNullable<undefined | boolean>;
  5421. electronRenderer: NonNullable<undefined | boolean>;
  5422. };
  5423. type ExternalsType =
  5424. | "import"
  5425. | "var"
  5426. | "module"
  5427. | "assign"
  5428. | "this"
  5429. | "window"
  5430. | "self"
  5431. | "global"
  5432. | "commonjs"
  5433. | "commonjs2"
  5434. | "commonjs-module"
  5435. | "commonjs-static"
  5436. | "amd"
  5437. | "amd-require"
  5438. | "umd"
  5439. | "umd2"
  5440. | "jsonp"
  5441. | "system"
  5442. | "promise"
  5443. | "module-import"
  5444. | "script"
  5445. | "node-commonjs"
  5446. | "asset"
  5447. | "css-import"
  5448. | "css-url";
  5449. declare interface FSImplementation {
  5450. open?: (...args: any[]) => any;
  5451. close?: (...args: any[]) => any;
  5452. }
  5453. declare interface FactorizeModuleOptions {
  5454. currentProfile?: ModuleProfile;
  5455. factory: ModuleFactory;
  5456. dependencies: Dependency[];
  5457. /**
  5458. * return full ModuleFactoryResult instead of only module
  5459. */
  5460. factoryResult?: boolean;
  5461. originModule: null | Module;
  5462. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  5463. context?: string;
  5464. }
  5465. declare interface FactoryMeta {
  5466. sideEffectFree?: boolean;
  5467. }
  5468. type FakeHook<T> = T & FakeHookMarker;
  5469. declare interface FakeHookMarker {}
  5470. declare interface FallbackCacheGroup {
  5471. chunksFilter: (chunk: Chunk) => undefined | boolean;
  5472. minSize: SplitChunksSizes;
  5473. maxAsyncSize: SplitChunksSizes;
  5474. maxInitialSize: SplitChunksSizes;
  5475. automaticNameDelimiter: string;
  5476. }
  5477. declare class FetchCompileAsyncWasmPlugin {
  5478. constructor();
  5479. /**
  5480. * Apply the plugin
  5481. */
  5482. apply(compiler: Compiler): void;
  5483. }
  5484. declare class FetchCompileWasmPlugin {
  5485. constructor(options?: FetchCompileWasmPluginOptions);
  5486. options: FetchCompileWasmPluginOptions;
  5487. /**
  5488. * Apply the plugin
  5489. */
  5490. apply(compiler: Compiler): void;
  5491. }
  5492. declare interface FetchCompileWasmPluginOptions {
  5493. /**
  5494. * mangle imports
  5495. */
  5496. mangleImports?: boolean;
  5497. }
  5498. /**
  5499. * Options object for persistent file-based caching.
  5500. */
  5501. declare interface FileCacheOptions {
  5502. /**
  5503. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  5504. */
  5505. allowCollectingMemory?: boolean;
  5506. /**
  5507. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  5508. */
  5509. buildDependencies?: { [index: string]: string[] };
  5510. /**
  5511. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  5512. */
  5513. cacheDirectory?: string;
  5514. /**
  5515. * Locations for the cache (defaults to cacheDirectory / name).
  5516. */
  5517. cacheLocation?: string;
  5518. /**
  5519. * Compression type used for the cache files.
  5520. */
  5521. compression?: false | "gzip" | "brotli";
  5522. /**
  5523. * Algorithm used for generation the hash (see node.js crypto package).
  5524. */
  5525. hashAlgorithm?: string;
  5526. /**
  5527. * Time in ms after which idle period the cache storing should happen.
  5528. */
  5529. idleTimeout?: number;
  5530. /**
  5531. * 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).
  5532. */
  5533. idleTimeoutAfterLargeChanges?: number;
  5534. /**
  5535. * Time in ms after which idle period the initial cache storing should happen.
  5536. */
  5537. idleTimeoutForInitialStore?: number;
  5538. /**
  5539. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  5540. */
  5541. immutablePaths?: (string | RegExp)[];
  5542. /**
  5543. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  5544. */
  5545. managedPaths?: (string | RegExp)[];
  5546. /**
  5547. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  5548. */
  5549. maxAge?: number;
  5550. /**
  5551. * 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.
  5552. */
  5553. maxMemoryGenerations?: number;
  5554. /**
  5555. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  5556. */
  5557. memoryCacheUnaffected?: boolean;
  5558. /**
  5559. * Name for the cache. Different names will lead to different coexisting caches.
  5560. */
  5561. name?: string;
  5562. /**
  5563. * Track and log detailed timing information for individual cache items.
  5564. */
  5565. profile?: boolean;
  5566. /**
  5567. * Enable/disable readonly mode.
  5568. */
  5569. readonly?: boolean;
  5570. /**
  5571. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  5572. */
  5573. store?: "pack";
  5574. /**
  5575. * Filesystem caching.
  5576. */
  5577. type: "filesystem";
  5578. /**
  5579. * 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.
  5580. */
  5581. version?: string;
  5582. }
  5583. declare interface FileSystem {
  5584. /**
  5585. * read file method
  5586. */
  5587. readFile: ReadFileTypes;
  5588. /**
  5589. * readdir method
  5590. */
  5591. readdir: ReaddirTypes;
  5592. /**
  5593. * read json method
  5594. */
  5595. readJson?: (
  5596. pathOrFileDescription: PathOrFileDescriptorTypes,
  5597. callback: (
  5598. err: null | Error | NodeJS.ErrnoException,
  5599. result?: JsonObjectTypes
  5600. ) => void
  5601. ) => void;
  5602. /**
  5603. * read link method
  5604. */
  5605. readlink: ReadlinkTypes;
  5606. /**
  5607. * lstat method
  5608. */
  5609. lstat?: LStatTypes;
  5610. /**
  5611. * stat method
  5612. */
  5613. stat: StatTypes;
  5614. /**
  5615. * realpath method
  5616. */
  5617. realpath?: RealPathTypes;
  5618. }
  5619. declare abstract class FileSystemInfo {
  5620. fs: InputFileSystem;
  5621. logger?: WebpackLogger;
  5622. fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
  5623. fileHashQueue: AsyncQueue<string, string, string>;
  5624. contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
  5625. contextHashQueue: AsyncQueue<string, string, ContextHash>;
  5626. contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
  5627. managedItemQueue: AsyncQueue<string, string, string>;
  5628. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  5629. unmanagedPathsWithSlash: string[];
  5630. unmanagedPathsRegExps: RegExp[];
  5631. managedPaths: (string | RegExp)[];
  5632. managedPathsWithSlash: string[];
  5633. managedPathsRegExps: RegExp[];
  5634. immutablePaths: (string | RegExp)[];
  5635. immutablePathsWithSlash: string[];
  5636. immutablePathsRegExps: RegExp[];
  5637. logStatistics(): void;
  5638. clear(): void;
  5639. addFileTimestamps(
  5640. map: ReadonlyMap<
  5641. string,
  5642. | null
  5643. | FileSystemInfoEntry
  5644. | "ignore"
  5645. | ExistenceOnlyTimeEntryFileSystemInfo
  5646. >,
  5647. immutable?: boolean
  5648. ): void;
  5649. addContextTimestamps(
  5650. map: ReadonlyMap<
  5651. string,
  5652. | null
  5653. | ContextFileSystemInfoEntry
  5654. | "ignore"
  5655. | ExistenceOnlyTimeEntryFileSystemInfo
  5656. >,
  5657. immutable?: boolean
  5658. ): void;
  5659. getFileTimestamp(
  5660. path: string,
  5661. callback: (
  5662. err?: null | WebpackError,
  5663. fileTimestamp?: null | FileSystemInfoEntry | "ignore"
  5664. ) => void
  5665. ): void;
  5666. getContextTimestamp(
  5667. path: string,
  5668. callback: (
  5669. err?: null | WebpackError,
  5670. resolvedContextTimestamp?:
  5671. | null
  5672. | "ignore"
  5673. | ResolvedContextFileSystemInfoEntry
  5674. ) => void
  5675. ): void;
  5676. getFileHash(
  5677. path: string,
  5678. callback: (err?: null | WebpackError, hash?: null | string) => void
  5679. ): void;
  5680. getContextHash(
  5681. path: string,
  5682. callback: (err?: null | WebpackError, contextHash?: string) => void
  5683. ): void;
  5684. getContextTsh(
  5685. path: string,
  5686. callback: (
  5687. err?: null | WebpackError,
  5688. resolvedContextTimestampAndHash?: null | ResolvedContextTimestampAndHash
  5689. ) => void
  5690. ): void;
  5691. resolveBuildDependencies(
  5692. context: string,
  5693. deps: Iterable<string>,
  5694. callback: (
  5695. err?: null | Error,
  5696. resolveBuildDependenciesResult?: ResolveBuildDependenciesResult
  5697. ) => void
  5698. ): void;
  5699. checkResolveResultsValid(
  5700. resolveResults: Map<string, undefined | string | false>,
  5701. callback: (err?: null | Error, result?: boolean) => void
  5702. ): void;
  5703. createSnapshot(
  5704. startTime: undefined | null | number,
  5705. files: undefined | null | Iterable<string>,
  5706. directories: undefined | null | Iterable<string>,
  5707. missing: undefined | null | Iterable<string>,
  5708. options: undefined | null | SnapshotOptionsFileSystemInfo,
  5709. callback: (err: null | WebpackError, snapshot: null | Snapshot) => void
  5710. ): void;
  5711. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  5712. checkSnapshotValid(
  5713. snapshot: Snapshot,
  5714. callback: (err?: null | WebpackError, result?: boolean) => void
  5715. ): void;
  5716. getDeprecatedFileTimestamps(): Map<string, null | number>;
  5717. getDeprecatedContextTimestamps(): Map<string, null | number>;
  5718. }
  5719. declare interface FileSystemInfoEntry {
  5720. safeTime: number;
  5721. timestamp?: number;
  5722. }
  5723. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  5724. declare interface Flags {
  5725. [index: string]: Argument;
  5726. }
  5727. declare interface FullHashChunkModuleHashes {
  5728. [index: string]: string;
  5729. }
  5730. declare interface GenerateContext {
  5731. /**
  5732. * mapping from dependencies to templates
  5733. */
  5734. dependencyTemplates: DependencyTemplates;
  5735. /**
  5736. * the runtime template
  5737. */
  5738. runtimeTemplate: RuntimeTemplate;
  5739. /**
  5740. * the module graph
  5741. */
  5742. moduleGraph: ModuleGraph;
  5743. /**
  5744. * the chunk graph
  5745. */
  5746. chunkGraph: ChunkGraph;
  5747. /**
  5748. * the requirements for runtime
  5749. */
  5750. runtimeRequirements: Set<string>;
  5751. /**
  5752. * the runtime
  5753. */
  5754. runtime: RuntimeSpec;
  5755. /**
  5756. * when in concatenated module, information about other concatenated modules
  5757. */
  5758. concatenationScope?: ConcatenationScope;
  5759. /**
  5760. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  5761. */
  5762. codeGenerationResults?: CodeGenerationResults;
  5763. /**
  5764. * which kind of code should be generated
  5765. */
  5766. type: string;
  5767. /**
  5768. * get access to the code generation data
  5769. */
  5770. getData?: () => CodeGenerationResultData;
  5771. }
  5772. declare interface GeneratedSourceInfo {
  5773. /**
  5774. * generated line
  5775. */
  5776. generatedLine?: number;
  5777. /**
  5778. * generated column
  5779. */
  5780. generatedColumn?: number;
  5781. /**
  5782. * source
  5783. */
  5784. source?: string;
  5785. }
  5786. declare class Generator {
  5787. constructor();
  5788. getTypes(module: NormalModule): ReadonlySet<string>;
  5789. getSize(module: NormalModule, type?: string): number;
  5790. generate(module: NormalModule, __1: GenerateContext): null | Source;
  5791. getConcatenationBailoutReason(
  5792. module: NormalModule,
  5793. context: ConcatenationBailoutReasonContext
  5794. ): undefined | string;
  5795. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  5796. static byType(map: {
  5797. [index: string]: undefined | Generator;
  5798. }): ByTypeGenerator;
  5799. }
  5800. declare interface GeneratorOptions {
  5801. [index: string]: any;
  5802. }
  5803. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  5804. GeneratorOptionsByModuleTypeUnknown;
  5805. /**
  5806. * Specify options for each generator.
  5807. */
  5808. declare interface GeneratorOptionsByModuleTypeKnown {
  5809. /**
  5810. * Generator options for asset modules.
  5811. */
  5812. asset?: AssetGeneratorOptions;
  5813. /**
  5814. * No generator options are supported for this module type.
  5815. */
  5816. "asset/bytes"?: EmptyGeneratorOptions;
  5817. /**
  5818. * Generator options for asset/inline modules.
  5819. */
  5820. "asset/inline"?: AssetInlineGeneratorOptions;
  5821. /**
  5822. * Generator options for asset/resource modules.
  5823. */
  5824. "asset/resource"?: AssetResourceGeneratorOptions;
  5825. /**
  5826. * No generator options are supported for this module type.
  5827. */
  5828. "asset/source"?: EmptyGeneratorOptions;
  5829. /**
  5830. * Generator options for css modules.
  5831. */
  5832. css?: CssGeneratorOptions;
  5833. /**
  5834. * Generator options for css/module modules.
  5835. */
  5836. "css/auto"?: CssModuleGeneratorOptions;
  5837. /**
  5838. * Generator options for css/module modules.
  5839. */
  5840. "css/global"?: CssModuleGeneratorOptions;
  5841. /**
  5842. * Generator options for css/module modules.
  5843. */
  5844. "css/module"?: CssModuleGeneratorOptions;
  5845. /**
  5846. * No generator options are supported for this module type.
  5847. */
  5848. javascript?: EmptyGeneratorOptions;
  5849. /**
  5850. * No generator options are supported for this module type.
  5851. */
  5852. "javascript/auto"?: EmptyGeneratorOptions;
  5853. /**
  5854. * No generator options are supported for this module type.
  5855. */
  5856. "javascript/dynamic"?: EmptyGeneratorOptions;
  5857. /**
  5858. * No generator options are supported for this module type.
  5859. */
  5860. "javascript/esm"?: EmptyGeneratorOptions;
  5861. /**
  5862. * Generator options for json modules.
  5863. */
  5864. json?: JsonGeneratorOptions;
  5865. }
  5866. /**
  5867. * Specify options for each generator.
  5868. */
  5869. declare interface GeneratorOptionsByModuleTypeUnknown {
  5870. [index: string]: { [index: string]: any };
  5871. }
  5872. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  5873. constructor(
  5874. contentType: string,
  5875. name: string,
  5876. global: string,
  5877. getFilenameForChunk: (
  5878. chunk: Chunk
  5879. ) =>
  5880. | string
  5881. | false
  5882. | ((pathData: PathData, assetInfo?: AssetInfo) => string),
  5883. allChunks: boolean
  5884. );
  5885. contentType: string;
  5886. global: string;
  5887. getFilenameForChunk: (
  5888. chunk: Chunk
  5889. ) => string | false | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  5890. allChunks: boolean;
  5891. /**
  5892. * Runtime modules without any dependencies to other runtime modules
  5893. */
  5894. static STAGE_NORMAL: number;
  5895. /**
  5896. * Runtime modules with simple dependencies on other runtime modules
  5897. */
  5898. static STAGE_BASIC: number;
  5899. /**
  5900. * Runtime modules which attach to handlers of other runtime modules
  5901. */
  5902. static STAGE_ATTACH: number;
  5903. /**
  5904. * Runtime modules which trigger actions on bootstrap
  5905. */
  5906. static STAGE_TRIGGER: number;
  5907. }
  5908. declare interface GotHandler<T> {
  5909. (result: T, callback: () => void): void;
  5910. }
  5911. declare interface GroupConfig<T, R> {
  5912. getKeys: (item: T) => undefined | string[];
  5913. getOptions?: (name: string, items: T[]) => GroupOptionsSmartGrouping;
  5914. createGroup: (key: string, children: T[], items: T[]) => R;
  5915. }
  5916. type GroupOptionsAsyncDependenciesBlock = RawChunkGroupOptions & {
  5917. name?: null | string;
  5918. } & { entryOptions?: EntryOptions } & { circular?: boolean };
  5919. declare interface GroupOptionsSmartGrouping {
  5920. groupChildren?: boolean;
  5921. force?: boolean;
  5922. targetGroupCount?: number;
  5923. }
  5924. declare interface HMRJavascriptParserHooks {
  5925. hotAcceptCallback: SyncBailHook<
  5926. [
  5927. (
  5928. | ImportExpressionImport
  5929. | UnaryExpression
  5930. | ArrayExpression
  5931. | ArrowFunctionExpression
  5932. | AssignmentExpression
  5933. | AwaitExpression
  5934. | BinaryExpression
  5935. | SimpleCallExpression
  5936. | NewExpression
  5937. | ChainExpression
  5938. | ClassExpression
  5939. | ConditionalExpression
  5940. | FunctionExpression
  5941. | Identifier
  5942. | SimpleLiteral
  5943. | RegExpLiteral
  5944. | BigIntLiteral
  5945. | LogicalExpression
  5946. | MemberExpression
  5947. | MetaProperty
  5948. | ObjectExpression
  5949. | SequenceExpression
  5950. | TaggedTemplateExpression
  5951. | TemplateLiteral
  5952. | ThisExpression
  5953. | UpdateExpression
  5954. | YieldExpression
  5955. | SpreadElement
  5956. ),
  5957. string[]
  5958. ],
  5959. void
  5960. >;
  5961. hotAcceptWithoutCallback: SyncBailHook<[CallExpression, string[]], void>;
  5962. }
  5963. declare interface HandleModuleCreationOptions {
  5964. factory: ModuleFactory;
  5965. dependencies: Dependency[];
  5966. originModule: null | Module;
  5967. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  5968. context?: string;
  5969. /**
  5970. * recurse into dependencies of the created module
  5971. */
  5972. recursive?: boolean;
  5973. /**
  5974. * connect the resolved module with the origin module
  5975. */
  5976. connectOrigin?: boolean;
  5977. /**
  5978. * check the cycle dependencies of the created module
  5979. */
  5980. checkCycle?: boolean;
  5981. }
  5982. declare abstract class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
  5983. ids: string[];
  5984. name: null | string;
  5985. activeExports: Set<string>;
  5986. otherStarExports: null | ReadonlyArray<HarmonyExportImportedSpecifierDependency>;
  5987. exportPresenceMode: ExportPresenceMode;
  5988. allStarExports: null | HarmonyStarExportsList;
  5989. get id(): void;
  5990. getId(): void;
  5991. setId(): void;
  5992. getIds(moduleGraph: ModuleGraph): string[];
  5993. setIds(moduleGraph: ModuleGraph, ids: string[]): void;
  5994. getMode(moduleGraph: ModuleGraph, runtime: RuntimeSpec): ExportMode;
  5995. getStarReexports(
  5996. moduleGraph: ModuleGraph,
  5997. runtime: RuntimeSpec,
  5998. exportsInfo?: ExportsInfo,
  5999. importedModule?: Module
  6000. ): {
  6001. exports?: Set<string>;
  6002. checked?: Set<string>;
  6003. ignoredExports: Set<string>;
  6004. hidden?: Set<string>;
  6005. };
  6006. }
  6007. declare class HarmonyImportDependency extends ModuleDependency {
  6008. constructor(
  6009. request: string,
  6010. sourceOrder: number,
  6011. phase?: 0 | 1 | 2,
  6012. attributes?: ImportAttributes
  6013. );
  6014. phase: ImportPhaseType;
  6015. attributes?: ImportAttributes;
  6016. getImportVar(moduleGraph: ModuleGraph): string;
  6017. getModuleExports(__0: DependencyTemplateContext): string;
  6018. getImportStatement(
  6019. update: boolean,
  6020. __1: DependencyTemplateContext
  6021. ): [string, string];
  6022. getLinkingErrors(
  6023. moduleGraph: ModuleGraph,
  6024. ids: string[],
  6025. additionalMessage: string
  6026. ): undefined | WebpackError[];
  6027. static Template: typeof HarmonyImportDependencyTemplate;
  6028. static ExportPresenceModes: {
  6029. NONE: ExportPresenceMode;
  6030. WARN: ExportPresenceMode;
  6031. AUTO: ExportPresenceMode;
  6032. ERROR: ExportPresenceMode;
  6033. fromUserOption(str: string | false): ExportPresenceMode;
  6034. /**
  6035. * Resolve export presence mode from parser options with a specific key and shared fallbacks.
  6036. */
  6037. resolveFromOptions(
  6038. specificValue: undefined | string | false,
  6039. options: JavascriptParserOptions
  6040. ): ExportPresenceMode;
  6041. };
  6042. static getNonOptionalPart: (
  6043. members: string[],
  6044. membersOptionals: boolean[]
  6045. ) => string[];
  6046. static NO_EXPORTS_REFERENCED: string[][];
  6047. static EXPORTS_OBJECT_REFERENCED: string[][];
  6048. static isLowPriorityDependency(dependency: Dependency): boolean;
  6049. static TRANSITIVE: typeof TRANSITIVE;
  6050. }
  6051. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  6052. constructor();
  6053. static getImportEmittedRuntime(
  6054. module: Module,
  6055. referencedModule: Module
  6056. ): undefined | string | boolean | SortableSet<string>;
  6057. }
  6058. declare interface HarmonySettings {
  6059. ids: string[];
  6060. source: string;
  6061. sourceOrder: number;
  6062. name: string;
  6063. await: boolean;
  6064. attributes?: ImportAttributes;
  6065. phase: ImportPhaseType;
  6066. }
  6067. declare interface HarmonySpecifierGuards {
  6068. guards?: AppendOnlyStackedSet<string>;
  6069. }
  6070. declare abstract class HarmonyStarExportsList {
  6071. dependencies: HarmonyExportImportedSpecifierDependency[];
  6072. push(dep: HarmonyExportImportedSpecifierDependency): void;
  6073. slice(): HarmonyExportImportedSpecifierDependency[];
  6074. serialize(__0: ObjectSerializerContext): void;
  6075. deserialize(__0: ObjectDeserializerContext): void;
  6076. }
  6077. declare class Hash {
  6078. constructor();
  6079. /**
  6080. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  6081. */
  6082. update(data: string | Buffer): Hash;
  6083. /**
  6084. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  6085. */
  6086. update(data: string, inputEncoding: string): Hash;
  6087. /**
  6088. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  6089. */
  6090. digest(): Buffer;
  6091. /**
  6092. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  6093. */
  6094. digest(encoding: string): string;
  6095. }
  6096. type HashFunction = string | typeof Hash;
  6097. declare interface HashLike {
  6098. /**
  6099. * make hash update
  6100. */
  6101. update: (data: string | Buffer, inputEncoding?: string) => HashLike;
  6102. /**
  6103. * get hash digest
  6104. */
  6105. digest: (encoding?: string) => string | Buffer;
  6106. }
  6107. declare interface HashableObject {
  6108. updateHash: (hash: Hash) => void;
  6109. }
  6110. declare class HashedModuleIdsPlugin {
  6111. constructor(options?: HashedModuleIdsPluginOptions);
  6112. options: Required<Omit<HashedModuleIdsPluginOptions, "context">> & {
  6113. context?: string;
  6114. };
  6115. /**
  6116. * Apply the plugin
  6117. */
  6118. apply(compiler: Compiler): void;
  6119. }
  6120. declare interface HashedModuleIdsPluginOptions {
  6121. /**
  6122. * The context directory for creating names.
  6123. */
  6124. context?: string;
  6125. /**
  6126. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  6127. */
  6128. hashDigest?:
  6129. | "ascii"
  6130. | "utf8"
  6131. | "utf-8"
  6132. | "utf16le"
  6133. | "utf-16le"
  6134. | "ucs2"
  6135. | "ucs-2"
  6136. | "base64"
  6137. | "base64url"
  6138. | "latin1"
  6139. | "binary"
  6140. | "hex";
  6141. /**
  6142. * The prefix length of the hash digest to use, defaults to 4.
  6143. */
  6144. hashDigestLength?: number;
  6145. /**
  6146. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  6147. */
  6148. hashFunction?: string | typeof Hash;
  6149. }
  6150. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  6151. declare class HotModuleReplacementPlugin {
  6152. constructor();
  6153. /**
  6154. * Apply the plugin
  6155. */
  6156. apply(compiler: Compiler): void;
  6157. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  6158. }
  6159. /**
  6160. * These properties are added by the HotModuleReplacementPlugin
  6161. */
  6162. declare interface HotModuleReplacementPluginLoaderContext {
  6163. hot?: boolean;
  6164. }
  6165. declare class HotUpdateChunk extends Chunk {
  6166. constructor();
  6167. }
  6168. /**
  6169. * Options for building http resources.
  6170. */
  6171. declare interface HttpUriOptions {
  6172. /**
  6173. * List of allowed URIs (resp. the beginning of them).
  6174. */
  6175. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  6176. /**
  6177. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  6178. */
  6179. cacheLocation?: string | false;
  6180. /**
  6181. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  6182. */
  6183. frozen?: boolean;
  6184. /**
  6185. * Location of the lockfile.
  6186. */
  6187. lockfileLocation?: string;
  6188. /**
  6189. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  6190. */
  6191. proxy?: string;
  6192. /**
  6193. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  6194. */
  6195. upgrade?: boolean;
  6196. }
  6197. declare class HttpUriPlugin {
  6198. constructor(options: HttpUriOptions);
  6199. options: HttpUriOptions;
  6200. /**
  6201. * Apply the plugin
  6202. */
  6203. apply(compiler: Compiler): void;
  6204. }
  6205. type IBigIntStats = IStatsBase<bigint> & {
  6206. atimeNs: bigint;
  6207. mtimeNs: bigint;
  6208. ctimeNs: bigint;
  6209. birthtimeNs: bigint;
  6210. };
  6211. declare interface IStats {
  6212. isFile: () => boolean;
  6213. isDirectory: () => boolean;
  6214. isBlockDevice: () => boolean;
  6215. isCharacterDevice: () => boolean;
  6216. isSymbolicLink: () => boolean;
  6217. isFIFO: () => boolean;
  6218. isSocket: () => boolean;
  6219. dev: number;
  6220. ino: number;
  6221. mode: number;
  6222. nlink: number;
  6223. uid: number;
  6224. gid: number;
  6225. rdev: number;
  6226. size: number;
  6227. blksize: number;
  6228. blocks: number;
  6229. atimeMs: number;
  6230. mtimeMs: number;
  6231. ctimeMs: number;
  6232. birthtimeMs: number;
  6233. atime: Date;
  6234. mtime: Date;
  6235. ctime: Date;
  6236. birthtime: Date;
  6237. }
  6238. declare interface IStatsBase<T> {
  6239. isFile: () => boolean;
  6240. isDirectory: () => boolean;
  6241. isBlockDevice: () => boolean;
  6242. isCharacterDevice: () => boolean;
  6243. isSymbolicLink: () => boolean;
  6244. isFIFO: () => boolean;
  6245. isSocket: () => boolean;
  6246. dev: T;
  6247. ino: T;
  6248. mode: T;
  6249. nlink: T;
  6250. uid: T;
  6251. gid: T;
  6252. rdev: T;
  6253. size: T;
  6254. blksize: T;
  6255. blocks: T;
  6256. atimeMs: T;
  6257. mtimeMs: T;
  6258. ctimeMs: T;
  6259. birthtimeMs: T;
  6260. atime: Date;
  6261. mtime: Date;
  6262. ctime: Date;
  6263. birthtime: Date;
  6264. }
  6265. declare interface IdToHashMap {
  6266. [index: number]: string;
  6267. [index: string]: string;
  6268. }
  6269. declare class IgnorePlugin {
  6270. constructor(options: IgnorePluginOptions);
  6271. options: IgnorePluginOptions;
  6272. /**
  6273. * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
  6274. */
  6275. checkIgnore(
  6276. resolveData: ResolveData | BeforeContextResolveData
  6277. ): undefined | false;
  6278. /**
  6279. * Apply the plugin
  6280. */
  6281. apply(compiler: Compiler): void;
  6282. }
  6283. type IgnorePluginOptions =
  6284. | {
  6285. /**
  6286. * A RegExp to test the context (directory) against.
  6287. */
  6288. contextRegExp?: RegExp;
  6289. /**
  6290. * A RegExp to test the request against.
  6291. */
  6292. resourceRegExp: RegExp;
  6293. }
  6294. | {
  6295. /**
  6296. * A filter function for resource and context.
  6297. */
  6298. checkResource: (resource: string, context: string) => boolean;
  6299. };
  6300. type ImportAttributes = Record<string, string> & {};
  6301. declare interface ImportDependencyMeta {
  6302. attributes?: ImportAttributes;
  6303. externalType?: "import" | "module";
  6304. }
  6305. type ImportExpressionJavascriptParser = ImportExpressionImport & {
  6306. phase?: "defer";
  6307. };
  6308. declare interface ImportModuleOptions {
  6309. /**
  6310. * the target layer
  6311. */
  6312. layer?: string;
  6313. /**
  6314. * the target public path
  6315. */
  6316. publicPath?: string;
  6317. /**
  6318. * target base uri
  6319. */
  6320. baseUri?: string;
  6321. }
  6322. type ImportPhaseType = 0 | 1 | 2;
  6323. declare interface ImportSettings {
  6324. references: string[][];
  6325. expression: ImportExpressionJavascriptParser;
  6326. }
  6327. type ImportSource =
  6328. | undefined
  6329. | null
  6330. | string
  6331. | SimpleLiteral
  6332. | RegExpLiteral
  6333. | BigIntLiteral;
  6334. type Imported = true | [string, string][];
  6335. /**
  6336. * Options for infrastructure level logging.
  6337. */
  6338. declare interface InfrastructureLogging {
  6339. /**
  6340. * 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.
  6341. */
  6342. appendOnly?: boolean;
  6343. /**
  6344. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  6345. */
  6346. colors?: boolean;
  6347. /**
  6348. * Custom console used for logging.
  6349. */
  6350. console?: Console;
  6351. /**
  6352. * Enable debug logging for specific loggers.
  6353. */
  6354. debug?:
  6355. | string
  6356. | boolean
  6357. | RegExp
  6358. | FilterItemTypes[]
  6359. | ((value: string) => boolean);
  6360. /**
  6361. * Log level.
  6362. */
  6363. level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
  6364. /**
  6365. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  6366. */
  6367. stream?: NodeJS.WritableStream & {
  6368. isTTY?: boolean;
  6369. columns?: number;
  6370. rows?: number;
  6371. };
  6372. }
  6373. type InfrastructureLoggingNormalizedWithDefaults = InfrastructureLogging & {
  6374. stream: NodeJS.WritableStream & {
  6375. isTTY?: boolean;
  6376. columns?: number;
  6377. rows?: number;
  6378. };
  6379. level: NonNullable<
  6380. undefined | "none" | "verbose" | "error" | "warn" | "info" | "log"
  6381. >;
  6382. debug: NonNullable<
  6383. | undefined
  6384. | string
  6385. | boolean
  6386. | RegExp
  6387. | FilterItemTypes[]
  6388. | ((value: string) => boolean)
  6389. >;
  6390. colors: NonNullable<undefined | boolean>;
  6391. appendOnly: NonNullable<undefined | boolean>;
  6392. };
  6393. declare class InitFragment<GenerateContext> {
  6394. constructor(
  6395. content: undefined | string | Source,
  6396. stage: number,
  6397. position: number,
  6398. key?: string,
  6399. endContent?: string | Source
  6400. );
  6401. content?: string | Source;
  6402. stage: number;
  6403. position: number;
  6404. key?: string;
  6405. endContent?: string | Source;
  6406. getContent(context: GenerateContext): undefined | string | Source;
  6407. getEndContent(context: GenerateContext): undefined | string | Source;
  6408. serialize(context: ObjectSerializerContext): void;
  6409. deserialize(context: ObjectDeserializerContext): void;
  6410. static addToSource<Context>(
  6411. source: Source,
  6412. initFragments: MaybeMergeableInitFragment<Context>[],
  6413. context: Context
  6414. ): Source;
  6415. static STAGE_CONSTANTS: number;
  6416. static STAGE_ASYNC_BOUNDARY: number;
  6417. static STAGE_HARMONY_EXPORTS: number;
  6418. static STAGE_HARMONY_IMPORTS: number;
  6419. static STAGE_PROVIDES: number;
  6420. static STAGE_ASYNC_DEPENDENCIES: number;
  6421. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  6422. }
  6423. declare interface InputFileSystem {
  6424. readFile: ReadFileFs;
  6425. readFileSync?: ReadFileSync;
  6426. readlink: ReadlinkFs;
  6427. readlinkSync?: ReadlinkSync;
  6428. readdir: ReaddirFs;
  6429. readdirSync?: ReaddirSync;
  6430. stat: StatFs;
  6431. statSync?: StatSync;
  6432. lstat?: LStatFs;
  6433. lstatSync?: LStatSync;
  6434. realpath?: RealPathFs;
  6435. realpathSync?: RealPathSync;
  6436. readJson?: (
  6437. pathOrFileDescriptor: PathOrFileDescriptorFs,
  6438. callback: (
  6439. err: null | Error | NodeJS.ErrnoException,
  6440. result?: JsonObjectFs
  6441. ) => void
  6442. ) => void;
  6443. readJsonSync?: (pathOrFileDescriptor: PathOrFileDescriptorFs) => JsonObjectFs;
  6444. purge?: (value?: string | string[] | Set<string>) => void;
  6445. join?: (path1: string, path2: string) => string;
  6446. relative?: (from: string, to: string) => string;
  6447. dirname?: (dirname: string) => string;
  6448. }
  6449. declare interface Inspector {
  6450. Session: typeof SessionImportInspectorClass_1;
  6451. }
  6452. type IntermediateFileSystem = InputFileSystem &
  6453. OutputFileSystem &
  6454. IntermediateFileSystemExtras;
  6455. declare interface IntermediateFileSystemExtras {
  6456. mkdirSync: MkdirSync;
  6457. createWriteStream: (
  6458. pathLike: PathLikeFs,
  6459. result?:
  6460. | "ascii"
  6461. | "utf8"
  6462. | "utf-8"
  6463. | "utf16le"
  6464. | "utf-16le"
  6465. | "ucs2"
  6466. | "ucs-2"
  6467. | "base64"
  6468. | "base64url"
  6469. | "latin1"
  6470. | "binary"
  6471. | "hex"
  6472. | WriteStreamOptions
  6473. ) => NodeJS.WritableStream;
  6474. open: Open;
  6475. read: Read<NodeJS.ArrayBufferView>;
  6476. close: (
  6477. df: number,
  6478. callback: (err: null | NodeJS.ErrnoException) => void
  6479. ) => void;
  6480. rename: (
  6481. a: PathLikeFs,
  6482. b: PathLikeFs,
  6483. callback: (err: null | NodeJS.ErrnoException) => void
  6484. ) => void;
  6485. }
  6486. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  6487. declare interface InterpolatedPathAndAssetInfo {
  6488. path: string;
  6489. info: AssetInfo;
  6490. }
  6491. type Issuer = undefined | null | Module;
  6492. type IssuerLayer = null | string;
  6493. declare interface Item<T> {
  6494. [index: string]: string | string[] | T;
  6495. }
  6496. declare abstract class ItemCacheFacade {
  6497. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  6498. getPromise<T>(): Promise<T>;
  6499. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  6500. storePromise<T>(data: T): Promise<void>;
  6501. provide<T>(
  6502. computer: (callback: CallbackNormalErrorCache<T>) => void,
  6503. callback: CallbackNormalErrorCache<T>
  6504. ): void;
  6505. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  6506. }
  6507. declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
  6508. extends Iterator<T, TReturn, TNext>, Disposable {
  6509. [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
  6510. [Symbol.dispose](): void;
  6511. }
  6512. declare abstract class JavascriptGenerator extends Generator {
  6513. sourceDependency(
  6514. module: Module,
  6515. dependency: Dependency,
  6516. initFragments: InitFragment<GenerateContext>[],
  6517. source: ReplaceSource,
  6518. generateContext: GenerateContext
  6519. ): void;
  6520. sourceBlock(
  6521. module: Module,
  6522. block: DependenciesBlock,
  6523. initFragments: InitFragment<GenerateContext>[],
  6524. source: ReplaceSource,
  6525. generateContext: GenerateContext
  6526. ): void;
  6527. sourceModule(
  6528. module: Module,
  6529. initFragments: InitFragment<GenerateContext>[],
  6530. source: ReplaceSource,
  6531. generateContext: GenerateContext
  6532. ): void;
  6533. generateError(
  6534. error: Error,
  6535. module: NormalModule,
  6536. generateContext: GenerateContext
  6537. ): null | Source;
  6538. }
  6539. declare class JavascriptModulesPlugin {
  6540. constructor(options?: object);
  6541. options: object;
  6542. /**
  6543. * Apply the plugin
  6544. */
  6545. apply(compiler: Compiler): void;
  6546. renderModule(
  6547. module: Module,
  6548. renderContext: ModuleRenderContext,
  6549. hooks: CompilationHooksJavascriptModulesPlugin
  6550. ): null | Source;
  6551. renderChunk(
  6552. renderContext: RenderContextJavascriptModulesPlugin,
  6553. hooks: CompilationHooksJavascriptModulesPlugin
  6554. ): Source;
  6555. renderMain(
  6556. renderContext: MainRenderContext,
  6557. hooks: CompilationHooksJavascriptModulesPlugin,
  6558. compilation: Compilation
  6559. ): Source;
  6560. updateHashWithBootstrap(
  6561. hash: Hash,
  6562. renderContext: RenderBootstrapContext,
  6563. hooks: CompilationHooksJavascriptModulesPlugin
  6564. ): void;
  6565. renderBootstrap(
  6566. renderContext: RenderBootstrapContext,
  6567. hooks: CompilationHooksJavascriptModulesPlugin
  6568. ): Bootstrap;
  6569. renderRequire(
  6570. renderContext: RenderBootstrapContext,
  6571. hooks: CompilationHooksJavascriptModulesPlugin
  6572. ): string;
  6573. static getCompilationHooks(
  6574. compilation: Compilation
  6575. ): CompilationHooksJavascriptModulesPlugin;
  6576. static getChunkFilenameTemplate(
  6577. chunk: Chunk,
  6578. outputOptions: OutputNormalizedWithDefaults
  6579. ): TemplatePath;
  6580. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  6581. }
  6582. declare class JavascriptParser extends ParserClass {
  6583. constructor(
  6584. sourceType?: "module" | "auto" | "script",
  6585. options?: { parse?: (code: string, options: ParseOptions) => ParseResult }
  6586. );
  6587. hooks: Readonly<{
  6588. evaluateTypeof: HookMap<
  6589. SyncBailHook<
  6590. [UnaryExpression],
  6591. undefined | null | BasicEvaluatedExpression
  6592. >
  6593. >;
  6594. evaluate: HookMap<
  6595. SyncBailHook<
  6596. [
  6597. | ImportExpressionImport
  6598. | UnaryExpression
  6599. | ArrayExpression
  6600. | ArrowFunctionExpression
  6601. | AssignmentExpression
  6602. | AwaitExpression
  6603. | BinaryExpression
  6604. | SimpleCallExpression
  6605. | NewExpression
  6606. | ChainExpression
  6607. | ClassExpression
  6608. | ConditionalExpression
  6609. | FunctionExpression
  6610. | Identifier
  6611. | SimpleLiteral
  6612. | RegExpLiteral
  6613. | BigIntLiteral
  6614. | LogicalExpression
  6615. | MemberExpression
  6616. | MetaProperty
  6617. | ObjectExpression
  6618. | SequenceExpression
  6619. | TaggedTemplateExpression
  6620. | TemplateLiteral
  6621. | ThisExpression
  6622. | UpdateExpression
  6623. | YieldExpression
  6624. | SpreadElement
  6625. | PrivateIdentifier
  6626. | Super
  6627. ],
  6628. undefined | null | BasicEvaluatedExpression
  6629. >
  6630. >;
  6631. evaluateIdentifier: HookMap<
  6632. SyncBailHook<
  6633. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  6634. undefined | null | BasicEvaluatedExpression
  6635. >
  6636. >;
  6637. evaluateDefinedIdentifier: HookMap<
  6638. SyncBailHook<
  6639. [Identifier | MemberExpression | ThisExpression],
  6640. undefined | null | BasicEvaluatedExpression
  6641. >
  6642. >;
  6643. evaluateNewExpression: HookMap<
  6644. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  6645. >;
  6646. evaluateCallExpression: HookMap<
  6647. SyncBailHook<
  6648. [CallExpression],
  6649. undefined | null | BasicEvaluatedExpression
  6650. >
  6651. >;
  6652. evaluateCallExpressionMember: HookMap<
  6653. SyncBailHook<
  6654. [CallExpression, BasicEvaluatedExpression],
  6655. undefined | null | BasicEvaluatedExpression
  6656. >
  6657. >;
  6658. isPure: HookMap<
  6659. SyncBailHook<
  6660. [
  6661. (
  6662. | ImportExpressionImport
  6663. | UnaryExpression
  6664. | ArrayExpression
  6665. | ArrowFunctionExpression
  6666. | AssignmentExpression
  6667. | AwaitExpression
  6668. | BinaryExpression
  6669. | SimpleCallExpression
  6670. | NewExpression
  6671. | ChainExpression
  6672. | ClassExpression
  6673. | ConditionalExpression
  6674. | FunctionExpression
  6675. | Identifier
  6676. | SimpleLiteral
  6677. | RegExpLiteral
  6678. | BigIntLiteral
  6679. | LogicalExpression
  6680. | MemberExpression
  6681. | MetaProperty
  6682. | ObjectExpression
  6683. | SequenceExpression
  6684. | TaggedTemplateExpression
  6685. | TemplateLiteral
  6686. | ThisExpression
  6687. | UpdateExpression
  6688. | YieldExpression
  6689. | PrivateIdentifier
  6690. | FunctionDeclaration
  6691. | MaybeNamedFunctionDeclaration
  6692. | VariableDeclaration
  6693. | ClassDeclaration
  6694. | MaybeNamedClassDeclaration
  6695. ),
  6696. number
  6697. ],
  6698. boolean | void
  6699. >
  6700. >;
  6701. preStatement: SyncBailHook<
  6702. [
  6703. | ImportDeclaration
  6704. | ExportNamedDeclaration
  6705. | ExportAllDeclaration
  6706. | FunctionDeclaration
  6707. | MaybeNamedFunctionDeclaration
  6708. | VariableDeclaration
  6709. | ClassDeclaration
  6710. | MaybeNamedClassDeclaration
  6711. | ExpressionStatement
  6712. | BlockStatement
  6713. | StaticBlock
  6714. | EmptyStatement
  6715. | DebuggerStatement
  6716. | WithStatement
  6717. | ReturnStatement
  6718. | LabeledStatement
  6719. | BreakStatement
  6720. | ContinueStatement
  6721. | IfStatement
  6722. | SwitchStatement
  6723. | ThrowStatement
  6724. | TryStatement
  6725. | WhileStatement
  6726. | DoWhileStatement
  6727. | ForStatement
  6728. | ForInStatement
  6729. | ForOfStatement
  6730. | ExportDefaultDeclaration
  6731. ],
  6732. boolean | void
  6733. >;
  6734. blockPreStatement: SyncBailHook<
  6735. [
  6736. | ImportDeclaration
  6737. | ExportNamedDeclaration
  6738. | ExportAllDeclaration
  6739. | FunctionDeclaration
  6740. | MaybeNamedFunctionDeclaration
  6741. | VariableDeclaration
  6742. | ClassDeclaration
  6743. | MaybeNamedClassDeclaration
  6744. | ExpressionStatement
  6745. | BlockStatement
  6746. | StaticBlock
  6747. | EmptyStatement
  6748. | DebuggerStatement
  6749. | WithStatement
  6750. | ReturnStatement
  6751. | LabeledStatement
  6752. | BreakStatement
  6753. | ContinueStatement
  6754. | IfStatement
  6755. | SwitchStatement
  6756. | ThrowStatement
  6757. | TryStatement
  6758. | WhileStatement
  6759. | DoWhileStatement
  6760. | ForStatement
  6761. | ForInStatement
  6762. | ForOfStatement
  6763. | ExportDefaultDeclaration
  6764. ],
  6765. boolean | void
  6766. >;
  6767. statement: SyncBailHook<
  6768. [
  6769. | ImportDeclaration
  6770. | ExportNamedDeclaration
  6771. | ExportAllDeclaration
  6772. | FunctionDeclaration
  6773. | MaybeNamedFunctionDeclaration
  6774. | VariableDeclaration
  6775. | ClassDeclaration
  6776. | MaybeNamedClassDeclaration
  6777. | ExpressionStatement
  6778. | BlockStatement
  6779. | StaticBlock
  6780. | EmptyStatement
  6781. | DebuggerStatement
  6782. | WithStatement
  6783. | ReturnStatement
  6784. | LabeledStatement
  6785. | BreakStatement
  6786. | ContinueStatement
  6787. | IfStatement
  6788. | SwitchStatement
  6789. | ThrowStatement
  6790. | TryStatement
  6791. | WhileStatement
  6792. | DoWhileStatement
  6793. | ForStatement
  6794. | ForInStatement
  6795. | ForOfStatement
  6796. | ExportDefaultDeclaration
  6797. ],
  6798. boolean | void
  6799. >;
  6800. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  6801. collectGuards: SyncBailHook<
  6802. [Expression],
  6803. void | ((walk: () => void) => void)
  6804. >;
  6805. classExtendsExpression: SyncBailHook<
  6806. [
  6807. Expression,
  6808. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6809. ],
  6810. boolean | void
  6811. >;
  6812. classBodyElement: SyncBailHook<
  6813. [
  6814. StaticBlock | MethodDefinition | PropertyDefinition,
  6815. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6816. ],
  6817. boolean | void
  6818. >;
  6819. classBodyValue: SyncBailHook<
  6820. [
  6821. Expression,
  6822. MethodDefinition | PropertyDefinition,
  6823. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6824. ],
  6825. boolean | void
  6826. >;
  6827. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  6828. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  6829. importSpecifier: SyncBailHook<
  6830. [ImportDeclaration, ImportSource, null | string, string],
  6831. boolean | void
  6832. >;
  6833. export: SyncBailHook<
  6834. [ExportNamedDeclaration | ExportDefaultDeclaration],
  6835. boolean | void
  6836. >;
  6837. exportImport: SyncBailHook<
  6838. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  6839. boolean | void
  6840. >;
  6841. exportDeclaration: SyncBailHook<
  6842. [
  6843. (
  6844. | ExportNamedDeclaration
  6845. | ExportAllDeclaration
  6846. | ExportDefaultDeclaration
  6847. ),
  6848. Declaration
  6849. ],
  6850. boolean | void
  6851. >;
  6852. exportExpression: SyncBailHook<
  6853. [
  6854. ExportDefaultDeclaration,
  6855. (
  6856. | ImportExpressionImport
  6857. | UnaryExpression
  6858. | ArrayExpression
  6859. | ArrowFunctionExpression
  6860. | AssignmentExpression
  6861. | AwaitExpression
  6862. | BinaryExpression
  6863. | SimpleCallExpression
  6864. | NewExpression
  6865. | ChainExpression
  6866. | ClassExpression
  6867. | ConditionalExpression
  6868. | FunctionExpression
  6869. | Identifier
  6870. | SimpleLiteral
  6871. | RegExpLiteral
  6872. | BigIntLiteral
  6873. | LogicalExpression
  6874. | MemberExpression
  6875. | MetaProperty
  6876. | ObjectExpression
  6877. | SequenceExpression
  6878. | TaggedTemplateExpression
  6879. | TemplateLiteral
  6880. | ThisExpression
  6881. | UpdateExpression
  6882. | YieldExpression
  6883. | MaybeNamedFunctionDeclaration
  6884. | MaybeNamedClassDeclaration
  6885. )
  6886. ],
  6887. boolean | void
  6888. >;
  6889. exportSpecifier: SyncBailHook<
  6890. [
  6891. (
  6892. | ExportNamedDeclaration
  6893. | ExportAllDeclaration
  6894. | ExportDefaultDeclaration
  6895. ),
  6896. string,
  6897. string,
  6898. undefined | number
  6899. ],
  6900. boolean | void
  6901. >;
  6902. exportImportSpecifier: SyncBailHook<
  6903. [
  6904. ExportNamedDeclaration | ExportAllDeclaration,
  6905. ImportSource,
  6906. null | string,
  6907. null | string,
  6908. undefined | number
  6909. ],
  6910. boolean | void
  6911. >;
  6912. preDeclarator: SyncBailHook<
  6913. [VariableDeclarator, Statement],
  6914. boolean | void
  6915. >;
  6916. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  6917. varDeclaration: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6918. varDeclarationLet: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6919. varDeclarationConst: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6920. varDeclarationUsing: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6921. varDeclarationVar: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6922. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6923. collectDestructuringAssignmentProperties: SyncBailHook<
  6924. [Expression],
  6925. boolean | void
  6926. >;
  6927. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6928. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6929. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  6930. assignMemberChain: HookMap<
  6931. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  6932. >;
  6933. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6934. importCall: SyncBailHook<
  6935. [
  6936. ImportExpressionJavascriptParser,
  6937. undefined | SimpleCallExpression | NewExpression
  6938. ],
  6939. boolean | void
  6940. >;
  6941. topLevelAwait: SyncBailHook<
  6942. [
  6943. | ImportExpressionImport
  6944. | UnaryExpression
  6945. | ArrayExpression
  6946. | ArrowFunctionExpression
  6947. | AssignmentExpression
  6948. | AwaitExpression
  6949. | BinaryExpression
  6950. | SimpleCallExpression
  6951. | NewExpression
  6952. | ChainExpression
  6953. | ClassExpression
  6954. | ConditionalExpression
  6955. | FunctionExpression
  6956. | Identifier
  6957. | SimpleLiteral
  6958. | RegExpLiteral
  6959. | BigIntLiteral
  6960. | LogicalExpression
  6961. | MemberExpression
  6962. | MetaProperty
  6963. | ObjectExpression
  6964. | SequenceExpression
  6965. | TaggedTemplateExpression
  6966. | TemplateLiteral
  6967. | ThisExpression
  6968. | UpdateExpression
  6969. | YieldExpression
  6970. | ForOfStatement
  6971. ],
  6972. boolean | void
  6973. >;
  6974. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  6975. callMemberChain: HookMap<
  6976. SyncBailHook<
  6977. [CallExpression, string[], boolean[], [number, number][]],
  6978. boolean | void
  6979. >
  6980. >;
  6981. memberChainOfCallMemberChain: HookMap<
  6982. SyncBailHook<
  6983. [Expression, string[], CallExpression, string[], [number, number][]],
  6984. boolean | void
  6985. >
  6986. >;
  6987. callMemberChainOfCallMemberChain: HookMap<
  6988. SyncBailHook<
  6989. [
  6990. CallExpression,
  6991. string[],
  6992. CallExpression,
  6993. string[],
  6994. [number, number][]
  6995. ],
  6996. boolean | void
  6997. >
  6998. >;
  6999. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  7000. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  7001. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  7002. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  7003. expressionMemberChain: HookMap<
  7004. SyncBailHook<
  7005. [MemberExpression, string[], boolean[], [number, number][]],
  7006. boolean | void
  7007. >
  7008. >;
  7009. unhandledExpressionMemberChain: HookMap<
  7010. SyncBailHook<[MemberExpression, string[]], boolean | void>
  7011. >;
  7012. expressionConditionalOperator: SyncBailHook<
  7013. [ConditionalExpression],
  7014. boolean | void
  7015. >;
  7016. expressionLogicalOperator: SyncBailHook<
  7017. [LogicalExpression],
  7018. boolean | void
  7019. >;
  7020. program: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
  7021. terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
  7022. finish: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
  7023. unusedStatement: SyncBailHook<[Statement], boolean | void>;
  7024. }>;
  7025. sourceType: "module" | "auto" | "script";
  7026. options: { parse?: (code: string, options: ParseOptions) => ParseResult };
  7027. scope: ScopeInfo;
  7028. state: JavascriptParserState;
  7029. comments?: CommentJavascriptParser[];
  7030. semicolons?: Set<number>;
  7031. statementPath?: StatementPathItem[];
  7032. prevStatement?:
  7033. | ImportDeclaration
  7034. | ExportNamedDeclaration
  7035. | ExportAllDeclaration
  7036. | ImportExpressionImport
  7037. | UnaryExpression
  7038. | ArrayExpression
  7039. | ArrowFunctionExpression
  7040. | AssignmentExpression
  7041. | AwaitExpression
  7042. | BinaryExpression
  7043. | SimpleCallExpression
  7044. | NewExpression
  7045. | ChainExpression
  7046. | ClassExpression
  7047. | ConditionalExpression
  7048. | FunctionExpression
  7049. | Identifier
  7050. | SimpleLiteral
  7051. | RegExpLiteral
  7052. | BigIntLiteral
  7053. | LogicalExpression
  7054. | MemberExpression
  7055. | MetaProperty
  7056. | ObjectExpression
  7057. | SequenceExpression
  7058. | TaggedTemplateExpression
  7059. | TemplateLiteral
  7060. | ThisExpression
  7061. | UpdateExpression
  7062. | YieldExpression
  7063. | FunctionDeclaration
  7064. | MaybeNamedFunctionDeclaration
  7065. | VariableDeclaration
  7066. | ClassDeclaration
  7067. | MaybeNamedClassDeclaration
  7068. | ExpressionStatement
  7069. | BlockStatement
  7070. | StaticBlock
  7071. | EmptyStatement
  7072. | DebuggerStatement
  7073. | WithStatement
  7074. | ReturnStatement
  7075. | LabeledStatement
  7076. | BreakStatement
  7077. | ContinueStatement
  7078. | IfStatement
  7079. | SwitchStatement
  7080. | ThrowStatement
  7081. | TryStatement
  7082. | WhileStatement
  7083. | DoWhileStatement
  7084. | ForStatement
  7085. | ForInStatement
  7086. | ForOfStatement
  7087. | ExportDefaultDeclaration;
  7088. destructuringAssignmentProperties?: WeakMap<
  7089. Expression,
  7090. Set<DestructuringAssignmentProperty>
  7091. >;
  7092. currentTagData?:
  7093. | Record<string, any>
  7094. | TopLevelSymbol
  7095. | HarmonySettings
  7096. | ImportSettings
  7097. | CommonJsImportSettings
  7098. | CompatibilitySettings
  7099. | HarmonySpecifierGuards;
  7100. magicCommentContext: ContextImport;
  7101. destructuringAssignmentPropertiesFor(
  7102. node: Expression
  7103. ): undefined | Set<DestructuringAssignmentProperty>;
  7104. getRenameIdentifier(
  7105. expr:
  7106. | ImportExpressionImport
  7107. | UnaryExpression
  7108. | ArrayExpression
  7109. | ArrowFunctionExpression
  7110. | AssignmentExpression
  7111. | AwaitExpression
  7112. | BinaryExpression
  7113. | SimpleCallExpression
  7114. | NewExpression
  7115. | ChainExpression
  7116. | ClassExpression
  7117. | ConditionalExpression
  7118. | FunctionExpression
  7119. | Identifier
  7120. | SimpleLiteral
  7121. | RegExpLiteral
  7122. | BigIntLiteral
  7123. | LogicalExpression
  7124. | MemberExpression
  7125. | MetaProperty
  7126. | ObjectExpression
  7127. | SequenceExpression
  7128. | TaggedTemplateExpression
  7129. | TemplateLiteral
  7130. | ThisExpression
  7131. | UpdateExpression
  7132. | YieldExpression
  7133. | SpreadElement
  7134. ): undefined | string | VariableInfo;
  7135. walkClass(
  7136. classy: ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  7137. ): void;
  7138. /**
  7139. * Module pre walking iterates the scope for import entries
  7140. */
  7141. modulePreWalkStatements(
  7142. statements: (
  7143. | ImportDeclaration
  7144. | ExportNamedDeclaration
  7145. | ExportAllDeclaration
  7146. | FunctionDeclaration
  7147. | VariableDeclaration
  7148. | ClassDeclaration
  7149. | ExpressionStatement
  7150. | BlockStatement
  7151. | StaticBlock
  7152. | EmptyStatement
  7153. | DebuggerStatement
  7154. | WithStatement
  7155. | ReturnStatement
  7156. | LabeledStatement
  7157. | BreakStatement
  7158. | ContinueStatement
  7159. | IfStatement
  7160. | SwitchStatement
  7161. | ThrowStatement
  7162. | TryStatement
  7163. | WhileStatement
  7164. | DoWhileStatement
  7165. | ForStatement
  7166. | ForInStatement
  7167. | ForOfStatement
  7168. | ExportDefaultDeclaration
  7169. )[]
  7170. ): void;
  7171. /**
  7172. * Pre walking iterates the scope for variable declarations
  7173. */
  7174. preWalkStatements(
  7175. statements: (
  7176. | ImportDeclaration
  7177. | ExportNamedDeclaration
  7178. | ExportAllDeclaration
  7179. | FunctionDeclaration
  7180. | VariableDeclaration
  7181. | ClassDeclaration
  7182. | ExpressionStatement
  7183. | BlockStatement
  7184. | StaticBlock
  7185. | EmptyStatement
  7186. | DebuggerStatement
  7187. | WithStatement
  7188. | ReturnStatement
  7189. | LabeledStatement
  7190. | BreakStatement
  7191. | ContinueStatement
  7192. | IfStatement
  7193. | SwitchStatement
  7194. | ThrowStatement
  7195. | TryStatement
  7196. | WhileStatement
  7197. | DoWhileStatement
  7198. | ForStatement
  7199. | ForInStatement
  7200. | ForOfStatement
  7201. | ExportDefaultDeclaration
  7202. )[]
  7203. ): void;
  7204. /**
  7205. * Block pre walking iterates the scope for block variable declarations
  7206. */
  7207. blockPreWalkStatements(
  7208. statements: (
  7209. | ImportDeclaration
  7210. | ExportNamedDeclaration
  7211. | ExportAllDeclaration
  7212. | FunctionDeclaration
  7213. | VariableDeclaration
  7214. | ClassDeclaration
  7215. | ExpressionStatement
  7216. | BlockStatement
  7217. | StaticBlock
  7218. | EmptyStatement
  7219. | DebuggerStatement
  7220. | WithStatement
  7221. | ReturnStatement
  7222. | LabeledStatement
  7223. | BreakStatement
  7224. | ContinueStatement
  7225. | IfStatement
  7226. | SwitchStatement
  7227. | ThrowStatement
  7228. | TryStatement
  7229. | WhileStatement
  7230. | DoWhileStatement
  7231. | ForStatement
  7232. | ForInStatement
  7233. | ForOfStatement
  7234. | ExportDefaultDeclaration
  7235. )[]
  7236. ): void;
  7237. /**
  7238. * Walking iterates the statements and expressions and processes them
  7239. */
  7240. walkStatements(
  7241. statements: (
  7242. | ImportDeclaration
  7243. | ExportNamedDeclaration
  7244. | ExportAllDeclaration
  7245. | FunctionDeclaration
  7246. | VariableDeclaration
  7247. | ClassDeclaration
  7248. | ExpressionStatement
  7249. | BlockStatement
  7250. | StaticBlock
  7251. | EmptyStatement
  7252. | DebuggerStatement
  7253. | WithStatement
  7254. | ReturnStatement
  7255. | LabeledStatement
  7256. | BreakStatement
  7257. | ContinueStatement
  7258. | IfStatement
  7259. | SwitchStatement
  7260. | ThrowStatement
  7261. | TryStatement
  7262. | WhileStatement
  7263. | DoWhileStatement
  7264. | ForStatement
  7265. | ForInStatement
  7266. | ForOfStatement
  7267. | ExportDefaultDeclaration
  7268. )[]
  7269. ): void;
  7270. /**
  7271. * Walking iterates the statements and expressions and processes them
  7272. */
  7273. preWalkStatement(
  7274. statement:
  7275. | ImportDeclaration
  7276. | ExportNamedDeclaration
  7277. | ExportAllDeclaration
  7278. | FunctionDeclaration
  7279. | MaybeNamedFunctionDeclaration
  7280. | VariableDeclaration
  7281. | ClassDeclaration
  7282. | MaybeNamedClassDeclaration
  7283. | ExpressionStatement
  7284. | BlockStatement
  7285. | StaticBlock
  7286. | EmptyStatement
  7287. | DebuggerStatement
  7288. | WithStatement
  7289. | ReturnStatement
  7290. | LabeledStatement
  7291. | BreakStatement
  7292. | ContinueStatement
  7293. | IfStatement
  7294. | SwitchStatement
  7295. | ThrowStatement
  7296. | TryStatement
  7297. | WhileStatement
  7298. | DoWhileStatement
  7299. | ForStatement
  7300. | ForInStatement
  7301. | ForOfStatement
  7302. | ExportDefaultDeclaration
  7303. ): void;
  7304. blockPreWalkStatement(
  7305. statement:
  7306. | ImportDeclaration
  7307. | ExportNamedDeclaration
  7308. | ExportAllDeclaration
  7309. | FunctionDeclaration
  7310. | MaybeNamedFunctionDeclaration
  7311. | VariableDeclaration
  7312. | ClassDeclaration
  7313. | MaybeNamedClassDeclaration
  7314. | ExpressionStatement
  7315. | BlockStatement
  7316. | StaticBlock
  7317. | EmptyStatement
  7318. | DebuggerStatement
  7319. | WithStatement
  7320. | ReturnStatement
  7321. | LabeledStatement
  7322. | BreakStatement
  7323. | ContinueStatement
  7324. | IfStatement
  7325. | SwitchStatement
  7326. | ThrowStatement
  7327. | TryStatement
  7328. | WhileStatement
  7329. | DoWhileStatement
  7330. | ForStatement
  7331. | ForInStatement
  7332. | ForOfStatement
  7333. | ExportDefaultDeclaration
  7334. ): void;
  7335. walkStatement(
  7336. statement:
  7337. | ImportDeclaration
  7338. | ExportNamedDeclaration
  7339. | ExportAllDeclaration
  7340. | FunctionDeclaration
  7341. | MaybeNamedFunctionDeclaration
  7342. | VariableDeclaration
  7343. | ClassDeclaration
  7344. | MaybeNamedClassDeclaration
  7345. | ExpressionStatement
  7346. | BlockStatement
  7347. | StaticBlock
  7348. | EmptyStatement
  7349. | DebuggerStatement
  7350. | WithStatement
  7351. | ReturnStatement
  7352. | LabeledStatement
  7353. | BreakStatement
  7354. | ContinueStatement
  7355. | IfStatement
  7356. | SwitchStatement
  7357. | ThrowStatement
  7358. | TryStatement
  7359. | WhileStatement
  7360. | DoWhileStatement
  7361. | ForStatement
  7362. | ForInStatement
  7363. | ForOfStatement
  7364. | ExportDefaultDeclaration
  7365. ): void;
  7366. /**
  7367. * Walks a statements that is nested within a parent statement
  7368. * and can potentially be a non-block statement.
  7369. * This enforces the nested statement to never be in ASI position.
  7370. */
  7371. walkNestedStatement(statement: Statement): void;
  7372. preWalkBlockStatement(statement: BlockStatement): void;
  7373. walkBlockStatement(statement: BlockStatement | StaticBlock): void;
  7374. walkExpressionStatement(statement: ExpressionStatement): void;
  7375. preWalkIfStatement(statement: IfStatement): void;
  7376. walkIfStatement(statement: IfStatement): void;
  7377. preWalkLabeledStatement(statement: LabeledStatement): void;
  7378. walkLabeledStatement(statement: LabeledStatement): void;
  7379. preWalkWithStatement(statement: WithStatement): void;
  7380. walkWithStatement(statement: WithStatement): void;
  7381. preWalkSwitchStatement(statement: SwitchStatement): void;
  7382. walkSwitchStatement(statement: SwitchStatement): void;
  7383. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  7384. walkReturnStatement(statement: ReturnStatement): void;
  7385. walkThrowStatement(statement: ThrowStatement): void;
  7386. preWalkTryStatement(statement: TryStatement): void;
  7387. walkTryStatement(statement: TryStatement): void;
  7388. preWalkWhileStatement(statement: WhileStatement): void;
  7389. walkWhileStatement(statement: WhileStatement): void;
  7390. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  7391. walkDoWhileStatement(statement: DoWhileStatement): void;
  7392. preWalkForStatement(statement: ForStatement): void;
  7393. walkForStatement(statement: ForStatement): void;
  7394. preWalkForInStatement(statement: ForInStatement): void;
  7395. walkForInStatement(statement: ForInStatement): void;
  7396. preWalkForOfStatement(statement: ForOfStatement): void;
  7397. walkForOfStatement(statement: ForOfStatement): void;
  7398. preWalkFunctionDeclaration(
  7399. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  7400. ): void;
  7401. walkFunctionDeclaration(
  7402. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  7403. ): void;
  7404. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  7405. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  7406. enterDestructuringAssignment(
  7407. pattern: Pattern,
  7408. expression: Expression
  7409. ):
  7410. | undefined
  7411. | ImportExpressionImport
  7412. | UnaryExpression
  7413. | ArrayExpression
  7414. | ArrowFunctionExpression
  7415. | AssignmentExpression
  7416. | AwaitExpression
  7417. | BinaryExpression
  7418. | SimpleCallExpression
  7419. | NewExpression
  7420. | ChainExpression
  7421. | ClassExpression
  7422. | ConditionalExpression
  7423. | FunctionExpression
  7424. | Identifier
  7425. | SimpleLiteral
  7426. | RegExpLiteral
  7427. | BigIntLiteral
  7428. | LogicalExpression
  7429. | MemberExpression
  7430. | MetaProperty
  7431. | ObjectExpression
  7432. | SequenceExpression
  7433. | TaggedTemplateExpression
  7434. | TemplateLiteral
  7435. | ThisExpression
  7436. | UpdateExpression
  7437. | YieldExpression;
  7438. modulePreWalkImportDeclaration(statement: ImportDeclaration): void;
  7439. enterDeclaration(
  7440. declaration: Declaration,
  7441. onIdent: (ident: string, identifier: Identifier) => void
  7442. ): void;
  7443. modulePreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7444. blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7445. walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7446. blockPreWalkExportDefaultDeclaration(
  7447. statement: ExportDefaultDeclaration
  7448. ): void;
  7449. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  7450. modulePreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
  7451. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  7452. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  7453. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  7454. walkVariableDeclaration(statement: VariableDeclaration): void;
  7455. blockPreWalkClassDeclaration(
  7456. statement: ClassDeclaration | MaybeNamedClassDeclaration
  7457. ): void;
  7458. walkClassDeclaration(
  7459. statement: ClassDeclaration | MaybeNamedClassDeclaration
  7460. ): void;
  7461. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  7462. walkSwitchCases(switchCases: SwitchCase[]): void;
  7463. preWalkCatchClause(catchClause: CatchClause): void;
  7464. walkCatchClause(catchClause: CatchClause): void;
  7465. walkPattern(pattern: Pattern): void;
  7466. walkAssignmentPattern(pattern: AssignmentPattern): void;
  7467. walkObjectPattern(pattern: ObjectPattern): void;
  7468. walkArrayPattern(pattern: ArrayPattern): void;
  7469. walkRestElement(pattern: RestElement): void;
  7470. walkExpressions(
  7471. expressions: (
  7472. | null
  7473. | ImportExpressionImport
  7474. | UnaryExpression
  7475. | ArrayExpression
  7476. | ArrowFunctionExpression
  7477. | AssignmentExpression
  7478. | AwaitExpression
  7479. | BinaryExpression
  7480. | SimpleCallExpression
  7481. | NewExpression
  7482. | ChainExpression
  7483. | ClassExpression
  7484. | ConditionalExpression
  7485. | FunctionExpression
  7486. | Identifier
  7487. | SimpleLiteral
  7488. | RegExpLiteral
  7489. | BigIntLiteral
  7490. | LogicalExpression
  7491. | MemberExpression
  7492. | MetaProperty
  7493. | ObjectExpression
  7494. | SequenceExpression
  7495. | TaggedTemplateExpression
  7496. | TemplateLiteral
  7497. | ThisExpression
  7498. | UpdateExpression
  7499. | YieldExpression
  7500. | SpreadElement
  7501. )[]
  7502. ): void;
  7503. walkExpression(
  7504. expression:
  7505. | ImportExpressionImport
  7506. | UnaryExpression
  7507. | ArrayExpression
  7508. | ArrowFunctionExpression
  7509. | AssignmentExpression
  7510. | AwaitExpression
  7511. | BinaryExpression
  7512. | SimpleCallExpression
  7513. | NewExpression
  7514. | ChainExpression
  7515. | ClassExpression
  7516. | ConditionalExpression
  7517. | FunctionExpression
  7518. | Identifier
  7519. | SimpleLiteral
  7520. | RegExpLiteral
  7521. | BigIntLiteral
  7522. | LogicalExpression
  7523. | MemberExpression
  7524. | MetaProperty
  7525. | ObjectExpression
  7526. | SequenceExpression
  7527. | TaggedTemplateExpression
  7528. | TemplateLiteral
  7529. | ThisExpression
  7530. | UpdateExpression
  7531. | YieldExpression
  7532. | SpreadElement
  7533. | PrivateIdentifier
  7534. | Super
  7535. ): void;
  7536. walkAwaitExpression(expression: AwaitExpression): void;
  7537. walkArrayExpression(expression: ArrayExpression): void;
  7538. walkSpreadElement(expression: SpreadElement): void;
  7539. walkObjectExpression(expression: ObjectExpression): void;
  7540. walkProperty(prop: SpreadElement | Property): void;
  7541. walkFunctionExpression(expression: FunctionExpression): void;
  7542. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  7543. walkSequenceExpression(expression: SequenceExpression): void;
  7544. walkUpdateExpression(expression: UpdateExpression): void;
  7545. walkUnaryExpression(expression: UnaryExpression): void;
  7546. walkLeftRightExpression(
  7547. expression: BinaryExpression | LogicalExpression
  7548. ): void;
  7549. walkBinaryExpression(expression: BinaryExpression): void;
  7550. walkLogicalExpression(expression: LogicalExpression): void;
  7551. walkAssignmentExpression(expression: AssignmentExpression): void;
  7552. walkConditionalExpression(expression: ConditionalExpression): void;
  7553. walkNewExpression(expression: NewExpression): void;
  7554. walkYieldExpression(expression: YieldExpression): void;
  7555. walkTemplateLiteral(expression: TemplateLiteral): void;
  7556. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  7557. walkClassExpression(expression: ClassExpression): void;
  7558. walkChainExpression(expression: ChainExpression): void;
  7559. walkImportExpression(expression: ImportExpressionJavascriptParser): void;
  7560. walkCallExpression(expression: CallExpression): void;
  7561. walkMemberExpression(expression: MemberExpression): void;
  7562. walkMemberExpressionWithExpressionName<R>(
  7563. expression: MemberExpression,
  7564. name: string,
  7565. rootInfo: string | VariableInfo,
  7566. members: string[],
  7567. onUnhandled: () => undefined | R
  7568. ): void;
  7569. walkThisExpression(expression: ThisExpression): void;
  7570. walkIdentifier(expression: Identifier): void;
  7571. walkMetaProperty(metaProperty: MetaProperty): void;
  7572. callHooksForExpression<T, R>(
  7573. hookMap: HookMap<SyncBailHook<T, R>>,
  7574. expr:
  7575. | ImportExpressionImport
  7576. | UnaryExpression
  7577. | ArrayExpression
  7578. | ArrowFunctionExpression
  7579. | AssignmentExpression
  7580. | AwaitExpression
  7581. | BinaryExpression
  7582. | SimpleCallExpression
  7583. | NewExpression
  7584. | ChainExpression
  7585. | ClassExpression
  7586. | ConditionalExpression
  7587. | FunctionExpression
  7588. | Identifier
  7589. | SimpleLiteral
  7590. | RegExpLiteral
  7591. | BigIntLiteral
  7592. | LogicalExpression
  7593. | MemberExpression
  7594. | MetaProperty
  7595. | ObjectExpression
  7596. | SequenceExpression
  7597. | TaggedTemplateExpression
  7598. | TemplateLiteral
  7599. | ThisExpression
  7600. | UpdateExpression
  7601. | YieldExpression
  7602. | Super,
  7603. ...args: AsArray<T>
  7604. ): undefined | R;
  7605. callHooksForExpressionWithFallback<T, R>(
  7606. hookMap: HookMap<SyncBailHook<T, R>>,
  7607. expr:
  7608. | ImportExpressionImport
  7609. | UnaryExpression
  7610. | ArrayExpression
  7611. | ArrowFunctionExpression
  7612. | AssignmentExpression
  7613. | AwaitExpression
  7614. | BinaryExpression
  7615. | SimpleCallExpression
  7616. | NewExpression
  7617. | ChainExpression
  7618. | ClassExpression
  7619. | ConditionalExpression
  7620. | FunctionExpression
  7621. | Identifier
  7622. | SimpleLiteral
  7623. | RegExpLiteral
  7624. | BigIntLiteral
  7625. | LogicalExpression
  7626. | MemberExpression
  7627. | MetaProperty
  7628. | ObjectExpression
  7629. | SequenceExpression
  7630. | TaggedTemplateExpression
  7631. | TemplateLiteral
  7632. | ThisExpression
  7633. | UpdateExpression
  7634. | YieldExpression
  7635. | Super,
  7636. fallback:
  7637. | undefined
  7638. | ((
  7639. name: string,
  7640. rootInfo: string | VariableInfo | ScopeInfo,
  7641. getMembers: () => string[]
  7642. ) => R),
  7643. defined: undefined | ((result?: string) => undefined | R),
  7644. ...args: AsArray<T>
  7645. ): undefined | R;
  7646. callHooksForName<T, R>(
  7647. hookMap: HookMap<SyncBailHook<T, R>>,
  7648. name: string,
  7649. ...args: AsArray<T>
  7650. ): undefined | R;
  7651. callHooksForInfo<T, R>(
  7652. hookMap: HookMap<SyncBailHook<T, R>>,
  7653. info: ExportedVariableInfo,
  7654. ...args: AsArray<T>
  7655. ): undefined | R;
  7656. callHooksForInfoWithFallback<T, R>(
  7657. hookMap: HookMap<SyncBailHook<T, R>>,
  7658. info: ExportedVariableInfo,
  7659. fallback: undefined | ((name: string) => undefined | R),
  7660. defined: undefined | ((result?: string) => undefined | R),
  7661. ...args: AsArray<T>
  7662. ): undefined | R;
  7663. callHooksForNameWithFallback<T, R>(
  7664. hookMap: HookMap<SyncBailHook<T, R>>,
  7665. name: string,
  7666. fallback: undefined | ((value: string) => undefined | R),
  7667. defined: undefined | (() => R),
  7668. ...args: AsArray<T>
  7669. ): undefined | R;
  7670. inScope(
  7671. params: (
  7672. | string
  7673. | Identifier
  7674. | MemberExpression
  7675. | ObjectPattern
  7676. | ArrayPattern
  7677. | RestElement
  7678. | AssignmentPattern
  7679. | Property
  7680. )[],
  7681. fn: () => void
  7682. ): void;
  7683. inClassScope(hasThis: boolean, params: Identifier[], fn: () => void): void;
  7684. inFunctionScope(
  7685. hasThis: boolean,
  7686. params: (
  7687. | string
  7688. | Identifier
  7689. | MemberExpression
  7690. | ObjectPattern
  7691. | ArrayPattern
  7692. | RestElement
  7693. | AssignmentPattern
  7694. )[],
  7695. fn: () => void
  7696. ): void;
  7697. inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
  7698. detectMode(
  7699. statements: (
  7700. | ImportDeclaration
  7701. | ExportNamedDeclaration
  7702. | ExportAllDeclaration
  7703. | FunctionDeclaration
  7704. | VariableDeclaration
  7705. | ClassDeclaration
  7706. | ExpressionStatement
  7707. | BlockStatement
  7708. | StaticBlock
  7709. | EmptyStatement
  7710. | DebuggerStatement
  7711. | WithStatement
  7712. | ReturnStatement
  7713. | LabeledStatement
  7714. | BreakStatement
  7715. | ContinueStatement
  7716. | IfStatement
  7717. | SwitchStatement
  7718. | ThrowStatement
  7719. | TryStatement
  7720. | WhileStatement
  7721. | DoWhileStatement
  7722. | ForStatement
  7723. | ForInStatement
  7724. | ForOfStatement
  7725. | ExportDefaultDeclaration
  7726. | Directive
  7727. )[]
  7728. ): void;
  7729. enterPatterns(
  7730. patterns: (
  7731. | string
  7732. | Identifier
  7733. | MemberExpression
  7734. | ObjectPattern
  7735. | ArrayPattern
  7736. | RestElement
  7737. | AssignmentPattern
  7738. | Property
  7739. )[],
  7740. onIdent: (ident: string) => void
  7741. ): void;
  7742. enterPattern(
  7743. pattern:
  7744. | Identifier
  7745. | MemberExpression
  7746. | ObjectPattern
  7747. | ArrayPattern
  7748. | RestElement
  7749. | AssignmentPattern
  7750. | Property,
  7751. onIdent: (ident: string, identifier: Identifier) => void
  7752. ): void;
  7753. enterIdentifier(
  7754. pattern: Identifier,
  7755. onIdent: (ident: string, identifier: Identifier) => void
  7756. ): void;
  7757. enterObjectPattern(
  7758. pattern: ObjectPattern,
  7759. onIdent: (ident: string, identifier: Identifier) => void
  7760. ): void;
  7761. enterArrayPattern(
  7762. pattern: ArrayPattern,
  7763. onIdent: (ident: string, identifier: Identifier) => void
  7764. ): void;
  7765. enterRestElement(
  7766. pattern: RestElement,
  7767. onIdent: (ident: string, identifier: Identifier) => void
  7768. ): void;
  7769. enterAssignmentPattern(
  7770. pattern: AssignmentPattern,
  7771. onIdent: (ident: string, identifier: Identifier) => void
  7772. ): void;
  7773. evaluateExpression(
  7774. expression:
  7775. | ImportExpressionImport
  7776. | UnaryExpression
  7777. | ArrayExpression
  7778. | ArrowFunctionExpression
  7779. | AssignmentExpression
  7780. | AwaitExpression
  7781. | BinaryExpression
  7782. | SimpleCallExpression
  7783. | NewExpression
  7784. | ChainExpression
  7785. | ClassExpression
  7786. | ConditionalExpression
  7787. | FunctionExpression
  7788. | Identifier
  7789. | SimpleLiteral
  7790. | RegExpLiteral
  7791. | BigIntLiteral
  7792. | LogicalExpression
  7793. | MemberExpression
  7794. | MetaProperty
  7795. | ObjectExpression
  7796. | SequenceExpression
  7797. | TaggedTemplateExpression
  7798. | TemplateLiteral
  7799. | ThisExpression
  7800. | UpdateExpression
  7801. | YieldExpression
  7802. | SpreadElement
  7803. | PrivateIdentifier
  7804. | Super
  7805. ): BasicEvaluatedExpression;
  7806. parseString(expression: Expression): string;
  7807. parseCalculatedString(expression: Expression): CalculatedStringResult;
  7808. evaluate(source: string): BasicEvaluatedExpression;
  7809. isPure(
  7810. expr:
  7811. | undefined
  7812. | null
  7813. | ImportExpressionImport
  7814. | UnaryExpression
  7815. | ArrayExpression
  7816. | ArrowFunctionExpression
  7817. | AssignmentExpression
  7818. | AwaitExpression
  7819. | BinaryExpression
  7820. | SimpleCallExpression
  7821. | NewExpression
  7822. | ChainExpression
  7823. | ClassExpression
  7824. | ConditionalExpression
  7825. | FunctionExpression
  7826. | Identifier
  7827. | SimpleLiteral
  7828. | RegExpLiteral
  7829. | BigIntLiteral
  7830. | LogicalExpression
  7831. | MemberExpression
  7832. | MetaProperty
  7833. | ObjectExpression
  7834. | SequenceExpression
  7835. | TaggedTemplateExpression
  7836. | TemplateLiteral
  7837. | ThisExpression
  7838. | UpdateExpression
  7839. | YieldExpression
  7840. | PrivateIdentifier
  7841. | FunctionDeclaration
  7842. | MaybeNamedFunctionDeclaration
  7843. | VariableDeclaration
  7844. | ClassDeclaration
  7845. | MaybeNamedClassDeclaration,
  7846. commentsStartPos: number
  7847. ): boolean;
  7848. getComments(range: [number, number]): CommentJavascriptParser[];
  7849. isAsiPosition(pos: number): boolean;
  7850. setAsiPosition(pos: number): void;
  7851. unsetAsiPosition(pos: number): void;
  7852. isStatementLevelExpression(expr: Expression): boolean;
  7853. getTagData(
  7854. name: string,
  7855. tag: symbol
  7856. ):
  7857. | undefined
  7858. | Record<string, any>
  7859. | TopLevelSymbol
  7860. | HarmonySettings
  7861. | ImportSettings
  7862. | CommonJsImportSettings
  7863. | CompatibilitySettings
  7864. | HarmonySpecifierGuards;
  7865. tagVariable(
  7866. name: string,
  7867. tag: symbol,
  7868. data?:
  7869. | Record<string, any>
  7870. | TopLevelSymbol
  7871. | HarmonySettings
  7872. | ImportSettings
  7873. | CommonJsImportSettings
  7874. | CompatibilitySettings
  7875. | HarmonySpecifierGuards,
  7876. flags?: 0 | 1 | 2 | 4
  7877. ): void;
  7878. defineVariable(name: string): void;
  7879. undefineVariable(name: string): void;
  7880. isVariableDefined(name: string): boolean;
  7881. getVariableInfo(name: string): ExportedVariableInfo;
  7882. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  7883. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  7884. parseCommentOptions(range: [number, number]): {
  7885. options: null | Record<string, any>;
  7886. errors: null | (Error & { comment: CommentJavascriptParser })[];
  7887. };
  7888. extractMemberExpressionChain(
  7889. expression:
  7890. | ImportExpressionImport
  7891. | UnaryExpression
  7892. | ArrayExpression
  7893. | ArrowFunctionExpression
  7894. | AssignmentExpression
  7895. | AwaitExpression
  7896. | BinaryExpression
  7897. | SimpleCallExpression
  7898. | NewExpression
  7899. | ChainExpression
  7900. | ClassExpression
  7901. | ConditionalExpression
  7902. | FunctionExpression
  7903. | Identifier
  7904. | SimpleLiteral
  7905. | RegExpLiteral
  7906. | BigIntLiteral
  7907. | LogicalExpression
  7908. | MemberExpression
  7909. | MetaProperty
  7910. | ObjectExpression
  7911. | SequenceExpression
  7912. | TaggedTemplateExpression
  7913. | TemplateLiteral
  7914. | ThisExpression
  7915. | UpdateExpression
  7916. | YieldExpression
  7917. | Super
  7918. ): {
  7919. members: string[];
  7920. object:
  7921. | ImportExpressionImport
  7922. | UnaryExpression
  7923. | ArrayExpression
  7924. | ArrowFunctionExpression
  7925. | AssignmentExpression
  7926. | AwaitExpression
  7927. | BinaryExpression
  7928. | SimpleCallExpression
  7929. | NewExpression
  7930. | ChainExpression
  7931. | ClassExpression
  7932. | ConditionalExpression
  7933. | FunctionExpression
  7934. | Identifier
  7935. | SimpleLiteral
  7936. | RegExpLiteral
  7937. | BigIntLiteral
  7938. | LogicalExpression
  7939. | MemberExpression
  7940. | MetaProperty
  7941. | ObjectExpression
  7942. | SequenceExpression
  7943. | TaggedTemplateExpression
  7944. | TemplateLiteral
  7945. | ThisExpression
  7946. | UpdateExpression
  7947. | YieldExpression
  7948. | Super;
  7949. membersOptionals: boolean[];
  7950. memberRanges: [number, number][];
  7951. };
  7952. getFreeInfoFromVariable(
  7953. varName: string
  7954. ): undefined | { name: string; info: string | VariableInfo };
  7955. getNameInfoFromVariable(
  7956. varName: string
  7957. ): undefined | { name: string; info: string | VariableInfo };
  7958. getMemberExpressionInfo(
  7959. expression:
  7960. | ImportExpressionImport
  7961. | UnaryExpression
  7962. | ArrayExpression
  7963. | ArrowFunctionExpression
  7964. | AssignmentExpression
  7965. | AwaitExpression
  7966. | BinaryExpression
  7967. | SimpleCallExpression
  7968. | NewExpression
  7969. | ChainExpression
  7970. | ClassExpression
  7971. | ConditionalExpression
  7972. | FunctionExpression
  7973. | Identifier
  7974. | SimpleLiteral
  7975. | RegExpLiteral
  7976. | BigIntLiteral
  7977. | LogicalExpression
  7978. | MemberExpression
  7979. | MetaProperty
  7980. | ObjectExpression
  7981. | SequenceExpression
  7982. | TaggedTemplateExpression
  7983. | TemplateLiteral
  7984. | ThisExpression
  7985. | UpdateExpression
  7986. | YieldExpression
  7987. | Super,
  7988. allowedTypes: number
  7989. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  7990. getNameForExpression(
  7991. expression: Expression
  7992. ):
  7993. | undefined
  7994. | {
  7995. name: string;
  7996. rootInfo: ExportedVariableInfo;
  7997. getMembers: () => string[];
  7998. };
  7999. static extend(
  8000. ...plugins: ((BaseParser: typeof ParserImport) => typeof ParserImport)[]
  8001. ): typeof JavascriptParser;
  8002. static ALLOWED_MEMBER_TYPES_ALL: 3;
  8003. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  8004. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  8005. static VariableInfo: typeof VariableInfo;
  8006. static VariableInfoFlags: Readonly<{
  8007. Evaluated: 0;
  8008. Free: 1;
  8009. Normal: 2;
  8010. Tagged: 4;
  8011. }>;
  8012. static getImportAttributes: (
  8013. node:
  8014. | ImportDeclaration
  8015. | ExportNamedDeclaration
  8016. | ExportAllDeclaration
  8017. | ImportExpressionJavascriptParser
  8018. ) => undefined | ImportAttributes;
  8019. }
  8020. /**
  8021. * Parser options for javascript modules.
  8022. */
  8023. declare interface JavascriptParserOptions {
  8024. /**
  8025. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  8026. */
  8027. amd?: false | { [index: string]: any };
  8028. /**
  8029. * Enable/disable special handling for browserify bundles.
  8030. */
  8031. browserify?: boolean;
  8032. /**
  8033. * Enable/disable parsing of CommonJs syntax.
  8034. */
  8035. commonjs?: boolean;
  8036. /**
  8037. * Enable/disable parsing of magic comments in CommonJs syntax.
  8038. */
  8039. commonjsMagicComments?: boolean;
  8040. /**
  8041. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  8042. */
  8043. createRequire?: string | boolean;
  8044. /**
  8045. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  8046. */
  8047. deferImport?: boolean;
  8048. /**
  8049. * Specifies global fetchPriority for dynamic import.
  8050. */
  8051. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  8052. /**
  8053. * Specifies global mode for dynamic import.
  8054. */
  8055. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  8056. /**
  8057. * Specifies global prefetch for dynamic import.
  8058. */
  8059. dynamicImportPrefetch?: number | boolean;
  8060. /**
  8061. * Specifies global preload for dynamic import.
  8062. */
  8063. dynamicImportPreload?: number | boolean;
  8064. /**
  8065. * Enable/disable parsing of dynamic URL.
  8066. */
  8067. dynamicUrl?: boolean;
  8068. /**
  8069. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  8070. */
  8071. exportsPresence?: false | "auto" | "error" | "warn";
  8072. /**
  8073. * Enable warnings for full dynamic dependencies.
  8074. */
  8075. exprContextCritical?: boolean;
  8076. /**
  8077. * Enable recursive directory lookup for full dynamic dependencies.
  8078. */
  8079. exprContextRecursive?: boolean;
  8080. /**
  8081. * Sets the default regular expression for full dynamic dependencies.
  8082. */
  8083. exprContextRegExp?: boolean | RegExp;
  8084. /**
  8085. * Set the default request for full dynamic dependencies.
  8086. */
  8087. exprContextRequest?: string;
  8088. /**
  8089. * Enable/disable parsing of EcmaScript Modules syntax.
  8090. */
  8091. harmony?: boolean;
  8092. /**
  8093. * Enable/disable parsing of import() syntax.
  8094. */
  8095. import?: boolean;
  8096. /**
  8097. * Specifies the behavior of invalid export names in "import ... from ...".
  8098. */
  8099. importExportsPresence?: false | "auto" | "error" | "warn";
  8100. /**
  8101. * Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
  8102. */
  8103. importMeta?: boolean | "preserve-unknown";
  8104. /**
  8105. * Enable/disable evaluating import.meta.webpackContext.
  8106. */
  8107. importMetaContext?: boolean;
  8108. /**
  8109. * Include polyfills or mocks for various node stuff.
  8110. */
  8111. node?: false | NodeOptions;
  8112. /**
  8113. * Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
  8114. */
  8115. overrideStrict?: "strict" | "non-strict";
  8116. /**
  8117. * Function to parser source code.
  8118. */
  8119. parse?: (code: string, options: ParseOptions) => ParseResult;
  8120. /**
  8121. * 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.
  8122. */
  8123. reexportExportsPresence?: false | "auto" | "error" | "warn";
  8124. /**
  8125. * Enable/disable parsing of require.context syntax.
  8126. */
  8127. requireContext?: boolean;
  8128. /**
  8129. * Enable/disable parsing of require.ensure syntax.
  8130. */
  8131. requireEnsure?: boolean;
  8132. /**
  8133. * Enable/disable parsing of require.include syntax.
  8134. */
  8135. requireInclude?: boolean;
  8136. /**
  8137. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  8138. */
  8139. requireJs?: boolean;
  8140. /**
  8141. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  8142. */
  8143. strictExportPresence?: boolean;
  8144. /**
  8145. * Handle the this context correctly according to the spec for namespace objects.
  8146. */
  8147. strictThisContextOnImports?: boolean;
  8148. /**
  8149. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  8150. */
  8151. system?: boolean;
  8152. /**
  8153. * Enable warnings when using the require function in a not statically analyse-able way.
  8154. */
  8155. unknownContextCritical?: boolean;
  8156. /**
  8157. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  8158. */
  8159. unknownContextRecursive?: boolean;
  8160. /**
  8161. * Sets the regular expression when using the require function in a not statically analyse-able way.
  8162. */
  8163. unknownContextRegExp?: boolean | RegExp;
  8164. /**
  8165. * Sets the request when using the require function in a not statically analyse-able way.
  8166. */
  8167. unknownContextRequest?: string;
  8168. /**
  8169. * Enable/disable parsing of new URL() syntax.
  8170. */
  8171. url?: boolean | "relative";
  8172. /**
  8173. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  8174. */
  8175. worker?: boolean | string[];
  8176. /**
  8177. * Enable warnings for partial dynamic dependencies.
  8178. */
  8179. wrappedContextCritical?: boolean;
  8180. /**
  8181. * Enable recursive directory lookup for partial dynamic dependencies.
  8182. */
  8183. wrappedContextRecursive?: boolean;
  8184. /**
  8185. * Set the inner regular expression for partial dynamic dependencies.
  8186. */
  8187. wrappedContextRegExp?: RegExp;
  8188. }
  8189. type JavascriptParserState = ParserStateBase &
  8190. Record<string, any> &
  8191. KnownJavascriptParserState;
  8192. declare abstract class JsonData {
  8193. get():
  8194. | undefined
  8195. | null
  8196. | string
  8197. | number
  8198. | boolean
  8199. | JsonObjectFs
  8200. | JsonValueFs[];
  8201. updateHash(hash: Hash): void;
  8202. }
  8203. declare abstract class JsonGenerator extends Generator {
  8204. options: JsonGeneratorOptions;
  8205. generateError(
  8206. error: Error,
  8207. module: NormalModule,
  8208. generateContext: GenerateContext
  8209. ): null | Source;
  8210. }
  8211. /**
  8212. * Generator options for json modules.
  8213. */
  8214. declare interface JsonGeneratorOptions {
  8215. /**
  8216. * Use `JSON.parse` when the JSON string is longer than 20 characters.
  8217. */
  8218. JSONParse?: boolean;
  8219. }
  8220. declare interface JsonModulesPluginParserOptions {
  8221. /**
  8222. * The depth of json dependency flagged as `exportInfo`.
  8223. */
  8224. exportsDepth?: number;
  8225. /**
  8226. * Allow named exports for json of object type
  8227. */
  8228. namedExports?: boolean;
  8229. /**
  8230. * Function that executes for a module source string and should return json-compatible data.
  8231. */
  8232. parse?: (input: string) => any;
  8233. }
  8234. declare interface JsonObjectFs {
  8235. [index: string]:
  8236. | undefined
  8237. | null
  8238. | string
  8239. | number
  8240. | boolean
  8241. | JsonObjectFs
  8242. | JsonValueFs[];
  8243. }
  8244. declare interface JsonObjectTypes {
  8245. [index: string]:
  8246. | undefined
  8247. | null
  8248. | string
  8249. | number
  8250. | boolean
  8251. | JsonObjectTypes
  8252. | JsonValueTypes[];
  8253. }
  8254. declare abstract class JsonParser extends ParserClass {
  8255. options: JsonModulesPluginParserOptions;
  8256. }
  8257. /**
  8258. * Parser options for JSON modules.
  8259. */
  8260. declare interface JsonParserOptions {
  8261. /**
  8262. * The depth of json dependency flagged as `exportInfo`.
  8263. */
  8264. exportsDepth?: number;
  8265. /**
  8266. * Allow named exports for json of object type.
  8267. */
  8268. namedExports?: boolean;
  8269. /**
  8270. * Function to parser content and return JSON.
  8271. */
  8272. parse?: (
  8273. input: string
  8274. ) => null | string | number | boolean | Buffer | JsonObjectFs | JsonValueFs[];
  8275. }
  8276. type JsonValueFs =
  8277. | null
  8278. | string
  8279. | number
  8280. | boolean
  8281. | JsonObjectFs
  8282. | JsonValueFs[];
  8283. type JsonValueTypes =
  8284. | null
  8285. | string
  8286. | number
  8287. | boolean
  8288. | JsonObjectTypes
  8289. | JsonValueTypes[];
  8290. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  8291. constructor(runtimeRequirements: ReadonlySet<string>);
  8292. static getCompilationHooks(
  8293. compilation: Compilation
  8294. ): JsonpCompilationPluginHooks;
  8295. /**
  8296. * Runtime modules without any dependencies to other runtime modules
  8297. */
  8298. static STAGE_NORMAL: number;
  8299. /**
  8300. * Runtime modules with simple dependencies on other runtime modules
  8301. */
  8302. static STAGE_BASIC: number;
  8303. /**
  8304. * Runtime modules which attach to handlers of other runtime modules
  8305. */
  8306. static STAGE_ATTACH: number;
  8307. /**
  8308. * Runtime modules which trigger actions on bootstrap
  8309. */
  8310. static STAGE_TRIGGER: number;
  8311. }
  8312. declare interface JsonpCompilationPluginHooks {
  8313. linkPreload: SyncWaterfallHook<[string, Chunk], string>;
  8314. linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
  8315. }
  8316. declare class JsonpTemplatePlugin {
  8317. constructor();
  8318. /**
  8319. * Apply the plugin
  8320. */
  8321. apply(compiler: Compiler): void;
  8322. static getCompilationHooks(
  8323. compilation: Compilation
  8324. ): JsonpCompilationPluginHooks;
  8325. }
  8326. declare interface KnownAssetInfo {
  8327. /**
  8328. * true, if the asset can be long term cached forever (contains a hash)
  8329. */
  8330. immutable?: boolean;
  8331. /**
  8332. * whether the asset is minimized
  8333. */
  8334. minimized?: boolean;
  8335. /**
  8336. * the value(s) of the full hash used for this asset
  8337. */
  8338. fullhash?: string | string[];
  8339. /**
  8340. * the value(s) of the chunk hash used for this asset
  8341. */
  8342. chunkhash?: string | string[];
  8343. /**
  8344. * the value(s) of the module hash used for this asset
  8345. */
  8346. modulehash?: string | string[];
  8347. /**
  8348. * the value(s) of the content hash used for this asset
  8349. */
  8350. contenthash?: string | string[];
  8351. /**
  8352. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  8353. */
  8354. sourceFilename?: string;
  8355. /**
  8356. * size in bytes, only set after asset has been emitted
  8357. */
  8358. size?: number;
  8359. /**
  8360. * true, when asset is only used for development and doesn't count towards user-facing assets
  8361. */
  8362. development?: boolean;
  8363. /**
  8364. * true, when asset ships data for updating an existing application (HMR)
  8365. */
  8366. hotModuleReplacement?: boolean;
  8367. /**
  8368. * true, when asset is javascript and an ESM
  8369. */
  8370. javascriptModule?: boolean;
  8371. /**
  8372. * true, when file is a manifest
  8373. */
  8374. manifest?: boolean;
  8375. /**
  8376. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  8377. */
  8378. related?: Record<string, null | string | string[]>;
  8379. }
  8380. declare interface KnownBuildInfo {
  8381. cacheable?: boolean;
  8382. parsed?: boolean;
  8383. strict?: boolean;
  8384. /**
  8385. * using in AMD
  8386. */
  8387. moduleArgument?: string;
  8388. /**
  8389. * using in AMD
  8390. */
  8391. exportsArgument?: string;
  8392. /**
  8393. * using in CommonJs
  8394. */
  8395. moduleConcatenationBailout?: string;
  8396. /**
  8397. * using in APIPlugin
  8398. */
  8399. needCreateRequire?: boolean;
  8400. /**
  8401. * using in HttpUriPlugin
  8402. */
  8403. resourceIntegrity?: string;
  8404. /**
  8405. * using in NormalModule
  8406. */
  8407. fileDependencies?: LazySet<string>;
  8408. /**
  8409. * using in NormalModule
  8410. */
  8411. contextDependencies?: LazySet<string>;
  8412. /**
  8413. * using in NormalModule
  8414. */
  8415. missingDependencies?: LazySet<string>;
  8416. /**
  8417. * using in NormalModule
  8418. */
  8419. buildDependencies?: LazySet<string>;
  8420. /**
  8421. * using in NormalModule
  8422. */
  8423. valueDependencies?: Map<string, ValueCacheVersion>;
  8424. /**
  8425. * using in NormalModule
  8426. */
  8427. assets?: Record<string, Source>;
  8428. /**
  8429. * using in NormalModule
  8430. */
  8431. assetsInfo?: Map<string, undefined | AssetInfo>;
  8432. /**
  8433. * using in NormalModule
  8434. */
  8435. hash?: string;
  8436. /**
  8437. * using in ContextModule
  8438. */
  8439. snapshot?: null | Snapshot;
  8440. /**
  8441. * for assets modules
  8442. */
  8443. fullContentHash?: string;
  8444. /**
  8445. * for assets modules
  8446. */
  8447. filename?: string;
  8448. /**
  8449. * for assets modules
  8450. */
  8451. dataUrl?: boolean;
  8452. /**
  8453. * for assets modules
  8454. */
  8455. assetInfo?: AssetInfo;
  8456. /**
  8457. * for external modules
  8458. */
  8459. javascriptModule?: boolean;
  8460. /**
  8461. * for lazy compilation modules
  8462. */
  8463. active?: boolean;
  8464. /**
  8465. * for css modules
  8466. */
  8467. cssData?: CssData;
  8468. /**
  8469. * for json modules
  8470. */
  8471. jsonData?: JsonData;
  8472. /**
  8473. * top level declaration names
  8474. */
  8475. topLevelDeclarations?: Set<string>;
  8476. }
  8477. declare interface KnownBuildMeta {
  8478. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  8479. exportType?: "link" | "text" | "css-style-sheet";
  8480. defaultObject?: false | "redirect" | "redirect-warn";
  8481. strictHarmonyModule?: boolean;
  8482. treatAsCommonJs?: boolean;
  8483. async?: boolean;
  8484. sideEffectFree?: boolean;
  8485. isCSSModule?: boolean;
  8486. jsIncompatibleExports?: Record<string, string>;
  8487. exportsFinalNameByRuntime?: Map<string, Record<string, string>>;
  8488. exportsSourceByRuntime?: Map<string, string>;
  8489. }
  8490. declare interface KnownContext {
  8491. /**
  8492. * environments
  8493. */
  8494. environments?: string[];
  8495. }
  8496. declare interface KnownCreateStatsOptionsContext {
  8497. forToString?: boolean;
  8498. }
  8499. declare interface KnownHooks {
  8500. /**
  8501. * resolve step hook
  8502. */
  8503. resolveStep: SyncHook<
  8504. [
  8505. AsyncSeriesBailHook<
  8506. [ResolveRequest, ResolveContext],
  8507. null | ResolveRequest
  8508. >,
  8509. ResolveRequest
  8510. ]
  8511. >;
  8512. /**
  8513. * no resolve hook
  8514. */
  8515. noResolve: SyncHook<[ResolveRequest, Error]>;
  8516. /**
  8517. * resolve hook
  8518. */
  8519. resolve: AsyncSeriesBailHook<
  8520. [ResolveRequest, ResolveContext],
  8521. null | ResolveRequest
  8522. >;
  8523. /**
  8524. * result hook
  8525. */
  8526. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  8527. }
  8528. declare interface KnownJavascriptParserState {
  8529. harmonyNamedExports?: Set<string>;
  8530. harmonyStarExports?: HarmonyStarExportsList;
  8531. lastHarmonyImportOrder?: number;
  8532. localModules?: LocalModule[];
  8533. }
  8534. declare interface KnownMeta {
  8535. importVarMap?: Map<Module, string>;
  8536. deferredImportVarMap?: Map<Module, string>;
  8537. }
  8538. declare interface KnownNormalizedStatsOptions {
  8539. context: string;
  8540. requestShortener: RequestShortener;
  8541. chunksSort: string | false;
  8542. modulesSort: string | false;
  8543. chunkModulesSort: string | false;
  8544. nestedModulesSort: string | false;
  8545. assetsSort: string | false;
  8546. ids: boolean;
  8547. cachedAssets: boolean;
  8548. groupAssetsByEmitStatus: boolean;
  8549. groupAssetsByPath: boolean;
  8550. groupAssetsByExtension: boolean;
  8551. assetsSpace: number;
  8552. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  8553. excludeModules: ((
  8554. name: string,
  8555. module: StatsModule,
  8556. type: ExcludeModulesType
  8557. ) => boolean)[];
  8558. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  8559. cachedModules: boolean;
  8560. orphanModules: boolean;
  8561. dependentModules: boolean;
  8562. runtimeModules: boolean;
  8563. groupModulesByCacheStatus: boolean;
  8564. groupModulesByLayer: boolean;
  8565. groupModulesByAttributes: boolean;
  8566. groupModulesByPath: boolean;
  8567. groupModulesByExtension: boolean;
  8568. groupModulesByType: boolean;
  8569. entrypoints: boolean | "auto";
  8570. chunkGroups: boolean;
  8571. chunkGroupAuxiliary: boolean;
  8572. chunkGroupChildren: boolean;
  8573. chunkGroupMaxAssets: number;
  8574. modulesSpace: number;
  8575. chunkModulesSpace: number;
  8576. nestedModulesSpace: number;
  8577. logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
  8578. loggingDebug: ((value: string) => boolean)[];
  8579. loggingTrace: boolean;
  8580. }
  8581. declare interface KnownRecords {
  8582. aggressiveSplits?: SplitData[];
  8583. chunks?: RecordsChunks;
  8584. modules?: RecordsModules;
  8585. hash?: string;
  8586. hotIndex?: number;
  8587. fullHashChunkModuleHashes?: FullHashChunkModuleHashes;
  8588. chunkModuleHashes?: ChunkModuleHashes;
  8589. chunkHashes?: ChunkHashes;
  8590. chunkRuntime?: ChunkRuntime;
  8591. chunkModuleIds?: ChunkModuleIds;
  8592. }
  8593. declare interface KnownStatsAsset {
  8594. type: string;
  8595. name: string;
  8596. info: AssetInfo;
  8597. size: number;
  8598. emitted: boolean;
  8599. comparedForEmit: boolean;
  8600. cached: boolean;
  8601. related?: StatsAsset[];
  8602. chunks?: ChunkId[];
  8603. chunkNames?: ChunkName[];
  8604. chunkIdHints?: string[];
  8605. auxiliaryChunks?: ChunkId[];
  8606. auxiliaryChunkNames?: ChunkName[];
  8607. auxiliaryChunkIdHints?: string[];
  8608. filteredRelated?: number;
  8609. isOverSizeLimit?: boolean;
  8610. }
  8611. declare interface KnownStatsChunk {
  8612. rendered: boolean;
  8613. initial: boolean;
  8614. entry: boolean;
  8615. recorded: boolean;
  8616. reason?: string;
  8617. size: number;
  8618. sizes: Record<string, number>;
  8619. names: string[];
  8620. idHints: string[];
  8621. runtime?: string[];
  8622. files: string[];
  8623. auxiliaryFiles: string[];
  8624. hash: string;
  8625. childrenByOrder: Record<string, ChunkId[]>;
  8626. id?: string | number;
  8627. siblings?: ChunkId[];
  8628. parents?: ChunkId[];
  8629. children?: ChunkId[];
  8630. modules?: StatsModule[];
  8631. filteredModules?: number;
  8632. origins?: StatsChunkOrigin[];
  8633. }
  8634. declare interface KnownStatsChunkGroup {
  8635. name?: null | string;
  8636. chunks?: ChunkId[];
  8637. assets?: { name: string; size?: number }[];
  8638. filteredAssets?: number;
  8639. assetsSize?: number;
  8640. auxiliaryAssets?: { name: string; size?: number }[];
  8641. filteredAuxiliaryAssets?: number;
  8642. auxiliaryAssetsSize?: number;
  8643. children?: Record<string, StatsChunkGroup[]>;
  8644. childAssets?: Record<string, string[]>;
  8645. isOverSizeLimit?: boolean;
  8646. }
  8647. declare interface KnownStatsChunkOrigin {
  8648. module: string;
  8649. moduleIdentifier: string;
  8650. moduleName: string;
  8651. loc: string;
  8652. request: string;
  8653. moduleId?: string | number;
  8654. }
  8655. declare interface KnownStatsCompilation {
  8656. env?: any;
  8657. name?: string;
  8658. hash?: string;
  8659. version?: string;
  8660. time?: number;
  8661. builtAt?: number;
  8662. needAdditionalPass?: boolean;
  8663. publicPath?: string;
  8664. outputPath?: string;
  8665. assetsByChunkName?: Record<string, string[]>;
  8666. assets?: StatsAsset[];
  8667. filteredAssets?: number;
  8668. chunks?: StatsChunk[];
  8669. modules?: StatsModule[];
  8670. filteredModules?: number;
  8671. entrypoints?: Record<string, StatsChunkGroup>;
  8672. namedChunkGroups?: Record<string, StatsChunkGroup>;
  8673. errors?: StatsError[];
  8674. errorsCount?: number;
  8675. warnings?: StatsError[];
  8676. warningsCount?: number;
  8677. children?: StatsCompilation[];
  8678. logging?: Record<string, StatsLogging>;
  8679. filteredWarningDetailsCount?: number;
  8680. filteredErrorDetailsCount?: number;
  8681. }
  8682. declare interface KnownStatsError {
  8683. message: string;
  8684. chunkName?: string;
  8685. chunkEntry?: boolean;
  8686. chunkInitial?: boolean;
  8687. file?: string;
  8688. moduleIdentifier?: string;
  8689. moduleName?: string;
  8690. loc?: string;
  8691. chunkId?: string | number;
  8692. moduleId?: string | number;
  8693. moduleTrace?: StatsModuleTraceItem[];
  8694. details?: string;
  8695. stack?: string;
  8696. cause?: KnownStatsError;
  8697. errors?: KnownStatsError[];
  8698. compilerPath?: string;
  8699. }
  8700. declare interface KnownStatsFactoryContext {
  8701. type: string;
  8702. compilation: Compilation;
  8703. makePathsRelative: (path: string) => string;
  8704. rootModules: Set<Module>;
  8705. compilationFileToChunks: Map<string, Chunk[]>;
  8706. compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
  8707. runtime: RuntimeSpec;
  8708. cachedGetErrors: (compilation: Compilation) => Error[];
  8709. cachedGetWarnings: (compilation: Compilation) => Error[];
  8710. }
  8711. declare interface KnownStatsLogging {
  8712. entries: StatsLoggingEntry[];
  8713. filteredEntries: number;
  8714. debug: boolean;
  8715. }
  8716. declare interface KnownStatsLoggingEntry {
  8717. type: string;
  8718. message?: string;
  8719. trace?: string[];
  8720. children?: StatsLoggingEntry[];
  8721. args?: any[];
  8722. time?: number;
  8723. }
  8724. declare interface KnownStatsModule {
  8725. type?: string;
  8726. moduleType?: string;
  8727. layer?: null | string;
  8728. identifier?: string;
  8729. name?: string;
  8730. nameForCondition?: null | string;
  8731. index?: number;
  8732. preOrderIndex?: number;
  8733. index2?: number;
  8734. postOrderIndex?: number;
  8735. size?: number;
  8736. sizes?: Record<string, number>;
  8737. cacheable?: boolean;
  8738. built?: boolean;
  8739. codeGenerated?: boolean;
  8740. buildTimeExecuted?: boolean;
  8741. cached?: boolean;
  8742. optional?: boolean;
  8743. orphan?: boolean;
  8744. id?: string | number;
  8745. issuerId?: null | string | number;
  8746. chunks?: ChunkId[];
  8747. assets?: string[];
  8748. dependent?: boolean;
  8749. issuer?: null | string;
  8750. issuerName?: null | string;
  8751. issuerPath?: null | StatsModuleIssuer[];
  8752. failed?: boolean;
  8753. errors?: number;
  8754. warnings?: number;
  8755. profile?: StatsProfile;
  8756. reasons?: StatsModuleReason[];
  8757. usedExports?: null | boolean | string[];
  8758. providedExports?: null | string[];
  8759. optimizationBailout?: string[];
  8760. depth?: null | number;
  8761. modules?: StatsModule[];
  8762. filteredModules?: number;
  8763. source?: string | Buffer;
  8764. }
  8765. declare interface KnownStatsModuleIssuer {
  8766. identifier: string;
  8767. name: string;
  8768. id?: string | number;
  8769. profile: StatsProfile;
  8770. }
  8771. declare interface KnownStatsModuleReason {
  8772. moduleIdentifier: null | string;
  8773. module: null | string;
  8774. moduleName: null | string;
  8775. resolvedModuleIdentifier: null | string;
  8776. resolvedModule: null | string;
  8777. type: null | string;
  8778. active: boolean;
  8779. explanation: null | string;
  8780. userRequest: null | string;
  8781. loc?: null | string;
  8782. moduleId?: null | string | number;
  8783. resolvedModuleId?: null | string | number;
  8784. }
  8785. declare interface KnownStatsModuleTraceDependency {
  8786. loc?: string;
  8787. }
  8788. declare interface KnownStatsModuleTraceItem {
  8789. originIdentifier?: string;
  8790. originName?: string;
  8791. moduleIdentifier?: string;
  8792. moduleName?: string;
  8793. dependencies?: StatsModuleTraceDependency[];
  8794. originId?: string | number;
  8795. moduleId?: string | number;
  8796. }
  8797. declare interface KnownStatsPrinterColorFunctions {
  8798. bold?: (value: string | number) => string;
  8799. yellow?: (value: string | number) => string;
  8800. red?: (value: string | number) => string;
  8801. green?: (value: string | number) => string;
  8802. magenta?: (value: string | number) => string;
  8803. cyan?: (value: string | number) => string;
  8804. }
  8805. declare interface KnownStatsPrinterContext {
  8806. type?: string;
  8807. compilation?: StatsCompilation;
  8808. chunkGroup?: StatsChunkGroup;
  8809. chunkGroupKind?: string;
  8810. asset?: StatsAsset;
  8811. module?: StatsModule;
  8812. chunk?: StatsChunk;
  8813. moduleReason?: StatsModuleReason;
  8814. moduleIssuer?: StatsModuleIssuer;
  8815. error?: StatsError;
  8816. profile?: StatsProfile;
  8817. logging?: StatsLogging;
  8818. moduleTraceItem?: StatsModuleTraceItem;
  8819. moduleTraceDependency?: StatsModuleTraceDependency;
  8820. }
  8821. declare interface KnownStatsPrinterFormatters {
  8822. formatFilename?: (file: string, oversize?: boolean) => string;
  8823. formatModuleId?: (id: string | number) => string;
  8824. formatChunkId?: (
  8825. id: string | number,
  8826. direction?: "parent" | "child" | "sibling"
  8827. ) => string;
  8828. formatSize?: (size: number) => string;
  8829. formatLayer?: (size: string) => string;
  8830. formatDateTime?: (dateTime: number) => string;
  8831. formatFlag?: (flag: string) => string;
  8832. formatTime?: (time: number, boldQuantity?: boolean) => string;
  8833. formatError?: (message: string) => string;
  8834. }
  8835. declare interface KnownStatsProfile {
  8836. total: number;
  8837. resolving: number;
  8838. restoring: number;
  8839. building: number;
  8840. integration: number;
  8841. storing: number;
  8842. additionalResolving: number;
  8843. additionalIntegration: number;
  8844. factory: number;
  8845. dependencies: number;
  8846. }
  8847. declare interface KnownUnsafeCacheData {
  8848. /**
  8849. * factory meta
  8850. */
  8851. factoryMeta?: FactoryMeta;
  8852. /**
  8853. * resolve options
  8854. */
  8855. resolveOptions?: ResolveOptions;
  8856. parserOptions?: ParserOptions;
  8857. generatorOptions?: GeneratorOptions;
  8858. }
  8859. declare interface LStatFs {
  8860. (
  8861. path: PathLikeFs,
  8862. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8863. ): void;
  8864. (
  8865. path: PathLikeFs,
  8866. options: undefined | (StatOptions & { bigint?: false }),
  8867. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8868. ): void;
  8869. (
  8870. path: PathLikeFs,
  8871. options: StatOptions & { bigint: true },
  8872. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  8873. ): void;
  8874. (
  8875. path: PathLikeFs,
  8876. options: undefined | StatOptions,
  8877. callback: (
  8878. err: null | NodeJS.ErrnoException,
  8879. result?: IStats | IBigIntStats
  8880. ) => void
  8881. ): void;
  8882. }
  8883. declare interface LStatSync {
  8884. (path: PathLikeFs, options?: undefined): IStats;
  8885. (
  8886. path: PathLikeFs,
  8887. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  8888. ): undefined | IStats;
  8889. (
  8890. path: PathLikeFs,
  8891. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  8892. ): undefined | IBigIntStats;
  8893. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  8894. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  8895. (
  8896. path: PathLikeFs,
  8897. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  8898. ): IStats | IBigIntStats;
  8899. (
  8900. path: PathLikeFs,
  8901. options?: StatSyncOptions
  8902. ): undefined | IStats | IBigIntStats;
  8903. }
  8904. declare interface LStatTypes {
  8905. (
  8906. path: PathLikeTypes,
  8907. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8908. ): void;
  8909. (
  8910. path: PathLikeTypes,
  8911. options: undefined | (StatOptions & { bigint?: false }),
  8912. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8913. ): void;
  8914. (
  8915. path: PathLikeTypes,
  8916. options: StatOptions & { bigint: true },
  8917. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  8918. ): void;
  8919. (
  8920. path: PathLikeTypes,
  8921. options: undefined | StatOptions,
  8922. callback: (
  8923. err: null | NodeJS.ErrnoException,
  8924. result?: IStats | IBigIntStats
  8925. ) => void
  8926. ): void;
  8927. }
  8928. /**
  8929. * Options for the default backend.
  8930. */
  8931. declare interface LazyCompilationDefaultBackendOptions {
  8932. /**
  8933. * A custom client.
  8934. */
  8935. client?: string;
  8936. /**
  8937. * Specifies where to listen to from the server.
  8938. */
  8939. listen?:
  8940. | number
  8941. | ListenOptions
  8942. | ((server: ServerLazyCompilationBackend) => void);
  8943. /**
  8944. * Specifies the protocol the client should use to connect to the server.
  8945. */
  8946. protocol?: "http" | "https";
  8947. /**
  8948. * Specifies how to create the server handling the EventSource requests.
  8949. */
  8950. server?:
  8951. | ServerOptionsImportHttps<typeof IncomingMessage>
  8952. | ServerOptionsImportHttp<typeof IncomingMessage>
  8953. | (() => ServerLazyCompilationBackend);
  8954. }
  8955. /**
  8956. * Options for compiling entrypoints and import()s only when they are accessed.
  8957. */
  8958. declare interface LazyCompilationOptions {
  8959. /**
  8960. * Specifies the backend that should be used for handling client keep alive.
  8961. */
  8962. backend?:
  8963. | ((
  8964. compiler: Compiler,
  8965. callback: (err: null | Error, backendApi?: BackendApi) => void
  8966. ) => void)
  8967. | ((compiler: Compiler) => Promise<BackendApi>)
  8968. | LazyCompilationDefaultBackendOptions;
  8969. /**
  8970. * Enable/disable lazy compilation for entries.
  8971. */
  8972. entries?: boolean;
  8973. /**
  8974. * Enable/disable lazy compilation for import() modules.
  8975. */
  8976. imports?: boolean;
  8977. /**
  8978. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  8979. */
  8980. test?: string | RegExp | ((module: Module) => boolean);
  8981. }
  8982. type LazyFunction<
  8983. InputValue,
  8984. OutputValue,
  8985. InternalLazyTarget extends SerializerMiddleware<
  8986. any,
  8987. any,
  8988. Record<string, any>
  8989. >,
  8990. InternalLazyOptions extends undefined | LazyOptions
  8991. > = (() => InputValue | Promise<InputValue>) &
  8992. Partial<{ options: InternalLazyOptions }>;
  8993. declare interface LazyOptions {
  8994. [index: string]: any;
  8995. }
  8996. declare class LazySet<T> {
  8997. constructor(iterable?: Iterable<T>);
  8998. get size(): number;
  8999. add(item: T): LazySet<T>;
  9000. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  9001. clear(): void;
  9002. delete(value: T): boolean;
  9003. entries(): SetIterator<[T, T]>;
  9004. forEach<K>(
  9005. callbackFn: (value: T, value2: T, set: Set<T>) => void,
  9006. thisArg: K
  9007. ): void;
  9008. has(item: T): boolean;
  9009. keys(): SetIterator<T>;
  9010. values(): SetIterator<T>;
  9011. serialize(__0: ObjectSerializerContext): void;
  9012. [Symbol.iterator](): SetIterator<T>;
  9013. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  9014. }
  9015. declare interface LibIdentOptions {
  9016. /**
  9017. * absolute context path to which lib ident is relative to
  9018. */
  9019. context: string;
  9020. /**
  9021. * object for caching
  9022. */
  9023. associatedObjectForCache?: object;
  9024. }
  9025. declare class LibManifestPlugin {
  9026. constructor(options: LibManifestPluginOptions);
  9027. options: LibManifestPluginOptions;
  9028. /**
  9029. * Apply the plugin
  9030. */
  9031. apply(compiler: Compiler): void;
  9032. }
  9033. declare interface LibManifestPluginOptions {
  9034. /**
  9035. * Context of requests in the manifest file (defaults to the webpack context).
  9036. */
  9037. context?: string;
  9038. /**
  9039. * If true, only entry points will be exposed (default: true).
  9040. */
  9041. entryOnly?: boolean;
  9042. /**
  9043. * If true, manifest json file (output) will be formatted.
  9044. */
  9045. format?: boolean;
  9046. /**
  9047. * Name of the exposed dll function (external name, use value of 'output.library').
  9048. */
  9049. name?: string;
  9050. /**
  9051. * Absolute path to the manifest json file (output).
  9052. */
  9053. path: string;
  9054. /**
  9055. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  9056. */
  9057. type?: string;
  9058. }
  9059. declare interface LibraryContext<T> {
  9060. compilation: Compilation;
  9061. chunkGraph: ChunkGraph;
  9062. options: T;
  9063. }
  9064. /**
  9065. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  9066. */
  9067. declare interface LibraryCustomUmdCommentObject {
  9068. /**
  9069. * Set comment for `amd` section in UMD.
  9070. */
  9071. amd?: string;
  9072. /**
  9073. * Set comment for `commonjs` (exports) section in UMD.
  9074. */
  9075. commonjs?: string;
  9076. /**
  9077. * Set comment for `commonjs2` (module.exports) section in UMD.
  9078. */
  9079. commonjs2?: string;
  9080. /**
  9081. * Set comment for `root` (global variable) section in UMD.
  9082. */
  9083. root?: string;
  9084. }
  9085. /**
  9086. * Description object for all UMD variants of the library name.
  9087. */
  9088. declare interface LibraryCustomUmdObject {
  9089. /**
  9090. * Name of the exposed AMD library in the UMD.
  9091. */
  9092. amd?: string;
  9093. /**
  9094. * Name of the exposed commonjs export in the UMD.
  9095. */
  9096. commonjs?: string;
  9097. /**
  9098. * Name of the property exposed globally by a UMD library.
  9099. */
  9100. root?: string | string[];
  9101. }
  9102. type LibraryExport = string | string[];
  9103. type LibraryName = string | string[] | LibraryCustomUmdObject;
  9104. /**
  9105. * Options for library.
  9106. */
  9107. declare interface LibraryOptions {
  9108. /**
  9109. * Add a container for define/require functions in the AMD module.
  9110. */
  9111. amdContainer?: string;
  9112. /**
  9113. * Add a comment in the UMD wrapper.
  9114. */
  9115. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  9116. /**
  9117. * Specify which export should be exposed as library.
  9118. */
  9119. export?: string | string[];
  9120. /**
  9121. * The name of the library (some types allow unnamed libraries too).
  9122. */
  9123. name?: string | string[] | LibraryCustomUmdObject;
  9124. /**
  9125. * 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).
  9126. */
  9127. type: string;
  9128. /**
  9129. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  9130. */
  9131. umdNamedDefine?: boolean;
  9132. }
  9133. declare class LibraryTemplatePlugin {
  9134. constructor(
  9135. name: LibraryName,
  9136. target: string,
  9137. umdNamedDefine: boolean,
  9138. auxiliaryComment: AuxiliaryComment,
  9139. exportProperty: LibraryExport
  9140. );
  9141. library: {
  9142. type: string;
  9143. name: LibraryName;
  9144. umdNamedDefine: boolean;
  9145. auxiliaryComment: AuxiliaryComment;
  9146. export: LibraryExport;
  9147. };
  9148. /**
  9149. * Apply the plugin
  9150. */
  9151. apply(compiler: Compiler): void;
  9152. }
  9153. declare class LimitChunkCountPlugin {
  9154. constructor(options?: LimitChunkCountPluginOptions);
  9155. options: LimitChunkCountPluginOptions;
  9156. apply(compiler: Compiler): void;
  9157. }
  9158. declare interface LimitChunkCountPluginOptions {
  9159. /**
  9160. * Constant overhead for a chunk.
  9161. */
  9162. chunkOverhead?: number;
  9163. /**
  9164. * Multiplicator for initial chunks.
  9165. */
  9166. entryChunkMultiplicator?: number;
  9167. /**
  9168. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  9169. */
  9170. maxChunks: number;
  9171. }
  9172. declare interface LoadScriptCompilationHooks {
  9173. createScript: SyncWaterfallHook<[string, Chunk], string>;
  9174. }
  9175. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  9176. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  9177. static getCompilationHooks(
  9178. compilation: Compilation
  9179. ): LoadScriptCompilationHooks;
  9180. /**
  9181. * Runtime modules without any dependencies to other runtime modules
  9182. */
  9183. static STAGE_NORMAL: number;
  9184. /**
  9185. * Runtime modules with simple dependencies on other runtime modules
  9186. */
  9187. static STAGE_BASIC: number;
  9188. /**
  9189. * Runtime modules which attach to handlers of other runtime modules
  9190. */
  9191. static STAGE_ATTACH: number;
  9192. /**
  9193. * Runtime modules which trigger actions on bootstrap
  9194. */
  9195. static STAGE_TRIGGER: number;
  9196. }
  9197. /**
  9198. * Custom values available in the loader context.
  9199. */
  9200. declare interface Loader {
  9201. [index: string]: any;
  9202. }
  9203. type LoaderContextDeclarationsIndex<OptionsType> =
  9204. NormalModuleLoaderContext<OptionsType> &
  9205. LoaderRunnerLoaderContext<OptionsType> &
  9206. LoaderPluginLoaderContext &
  9207. HotModuleReplacementPluginLoaderContext;
  9208. type LoaderContextVirtualUrlPlugin<T> = NormalModuleLoaderContext<T> &
  9209. LoaderRunnerLoaderContext<T> &
  9210. LoaderPluginLoaderContext &
  9211. HotModuleReplacementPluginLoaderContext;
  9212. type LoaderDefinition<
  9213. OptionsType = {},
  9214. ContextAdditions = {}
  9215. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  9216. raw?: false;
  9217. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9218. };
  9219. declare interface LoaderDefinitionFunction<
  9220. OptionsType = {},
  9221. ContextAdditions = {}
  9222. > {
  9223. (
  9224. this: NormalModuleLoaderContext<OptionsType> &
  9225. LoaderRunnerLoaderContext<OptionsType> &
  9226. LoaderPluginLoaderContext &
  9227. HotModuleReplacementPluginLoaderContext &
  9228. ContextAdditions,
  9229. content: string,
  9230. sourceMap?: string | RawSourceMap,
  9231. additionalData?: AdditionalData
  9232. ): string | void | Buffer | Promise<string | Buffer>;
  9233. }
  9234. declare interface LoaderItem {
  9235. loader: string;
  9236. options?: null | string | Record<string, any>;
  9237. ident?: null | string;
  9238. type?: null | string;
  9239. }
  9240. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  9241. default?:
  9242. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  9243. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9244. raw?: false;
  9245. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9246. }
  9247. declare class LoaderOptionsPlugin {
  9248. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  9249. options: LoaderOptionsPluginOptions & MatchObject;
  9250. /**
  9251. * Apply the plugin
  9252. */
  9253. apply(compiler: Compiler): void;
  9254. }
  9255. declare interface LoaderOptionsPluginOptions {
  9256. [index: string]: any;
  9257. /**
  9258. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  9259. */
  9260. debug?: boolean;
  9261. /**
  9262. * Where loaders can be switched to minimize mode.
  9263. */
  9264. minimize?: boolean;
  9265. /**
  9266. * A configuration object that can be used to configure older loaders.
  9267. */
  9268. options?: {
  9269. [index: string]: any;
  9270. /**
  9271. * The context that can be used to configure older loaders.
  9272. */
  9273. context?: string;
  9274. };
  9275. }
  9276. /**
  9277. * These properties are added by the LoaderPlugin
  9278. */
  9279. declare interface LoaderPluginLoaderContext {
  9280. /**
  9281. * Resolves the given request to a module, applies all configured loaders and calls
  9282. * back with the generated source, the sourceMap and the module instance (usually an
  9283. * instance of NormalModule). Use this function if you need to know the source code
  9284. * of another module to generate the result.
  9285. */
  9286. loadModule(
  9287. request: string,
  9288. callback: (
  9289. err: null | Error,
  9290. source?: string | Buffer,
  9291. sourceMap?: null | object,
  9292. module?: Module
  9293. ) => void
  9294. ): void;
  9295. importModule(
  9296. request: string,
  9297. options: undefined | ImportModuleOptions,
  9298. callback: (err?: null | Error, exports?: any) => void
  9299. ): void;
  9300. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  9301. }
  9302. /**
  9303. * The properties are added by https://github.com/webpack/loader-runner
  9304. */
  9305. declare interface LoaderRunnerLoaderContext<OptionsType> {
  9306. /**
  9307. * Add a directory as dependency of the loader result.
  9308. */
  9309. addContextDependency(context: string): void;
  9310. /**
  9311. * Adds a file as dependency of the loader result in order to make them watchable.
  9312. * For example, html-loader uses this technique as it finds src and src-set attributes.
  9313. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  9314. */
  9315. addDependency(file: string): void;
  9316. addMissingDependency(context: string): void;
  9317. /**
  9318. * Make this loader async.
  9319. */
  9320. async(): (
  9321. err?: null | Error,
  9322. content?: string | Buffer,
  9323. sourceMap?: null | string | RawSourceMap,
  9324. additionalData?: AdditionalData
  9325. ) => void;
  9326. /**
  9327. * Make this loader result cacheable. By default it's cacheable.
  9328. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  9329. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  9330. * Most loaders are deterministic and cacheable.
  9331. */
  9332. cacheable(flag?: boolean): void;
  9333. callback: (
  9334. err?: null | Error,
  9335. content?: string | Buffer,
  9336. sourceMap?: null | string | RawSourceMap,
  9337. additionalData?: AdditionalData
  9338. ) => void;
  9339. /**
  9340. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  9341. */
  9342. clearDependencies(): void;
  9343. /**
  9344. * The directory of the module. Can be used as context for resolving other stuff.
  9345. * eg '/workspaces/ts-loader/examples/vanilla/src'
  9346. */
  9347. context: string;
  9348. readonly currentRequest: string;
  9349. readonly data: any;
  9350. /**
  9351. * alias of addDependency
  9352. * Adds a file as dependency of the loader result in order to make them watchable.
  9353. * For example, html-loader uses this technique as it finds src and src-set attributes.
  9354. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  9355. */
  9356. dependency(file: string): void;
  9357. getContextDependencies(): string[];
  9358. getDependencies(): string[];
  9359. getMissingDependencies(): string[];
  9360. /**
  9361. * The index in the loaders array of the current loader.
  9362. * In the example: in loader1: 0, in loader2: 1
  9363. */
  9364. loaderIndex: number;
  9365. readonly previousRequest: string;
  9366. readonly query: string | OptionsType;
  9367. readonly remainingRequest: string;
  9368. readonly request: string;
  9369. /**
  9370. * An array of all the loaders. It is writeable in the pitch phase.
  9371. * loaders = [{request: string, path: string, query: string, module: function}]
  9372. * In the example:
  9373. * [
  9374. * { request: "/abc/loader1.js?xyz",
  9375. * path: "/abc/loader1.js",
  9376. * query: "?xyz",
  9377. * module: [Function]
  9378. * },
  9379. * { request: "/abc/node_modules/loader2/index.js",
  9380. * path: "/abc/node_modules/loader2/index.js",
  9381. * query: "",
  9382. * module: [Function]
  9383. * }
  9384. * ]
  9385. */
  9386. loaders: {
  9387. request: string;
  9388. path: string;
  9389. query: string;
  9390. fragment: string;
  9391. options?: string | object;
  9392. ident: string;
  9393. normal?: Function;
  9394. pitch?: Function;
  9395. raw?: boolean;
  9396. data?: object;
  9397. pitchExecuted: boolean;
  9398. normalExecuted: boolean;
  9399. type?: "module" | "commonjs";
  9400. }[];
  9401. /**
  9402. * The resource path.
  9403. * In the example: "/abc/resource.js"
  9404. */
  9405. resourcePath: string;
  9406. /**
  9407. * The resource query string.
  9408. * Example: "?query"
  9409. */
  9410. resourceQuery: string;
  9411. /**
  9412. * The resource fragment.
  9413. * Example: "#frag"
  9414. */
  9415. resourceFragment: string;
  9416. /**
  9417. * The resource inclusive query and fragment.
  9418. * Example: "/abc/resource.js?query#frag"
  9419. */
  9420. resource: string;
  9421. /**
  9422. * Target of compilation.
  9423. * Example: "web"
  9424. */
  9425. target: string;
  9426. /**
  9427. * Tell what kind of ES-features may be used in the generated runtime-code.
  9428. * Example: { arrowFunction: true }
  9429. */
  9430. environment: Environment;
  9431. }
  9432. declare class LoaderTargetPlugin {
  9433. constructor(target: string);
  9434. target: string;
  9435. /**
  9436. * Apply the plugin
  9437. */
  9438. apply(compiler: Compiler): void;
  9439. }
  9440. declare abstract class LocalModule {
  9441. name: string;
  9442. idx: number;
  9443. used: boolean;
  9444. flagUsed(): void;
  9445. variableName(): string;
  9446. serialize(context: ObjectSerializerContext): void;
  9447. deserialize(context: ObjectDeserializerContext): void;
  9448. }
  9449. declare interface LogEntry {
  9450. type:
  9451. | "error"
  9452. | "warn"
  9453. | "info"
  9454. | "log"
  9455. | "debug"
  9456. | "clear"
  9457. | "profile"
  9458. | "trace"
  9459. | "group"
  9460. | "groupCollapsed"
  9461. | "groupEnd"
  9462. | "profileEnd"
  9463. | "time"
  9464. | "status";
  9465. args?: any[];
  9466. time: number;
  9467. trace?: string[];
  9468. }
  9469. type LogTypeEnum =
  9470. | "error"
  9471. | "warn"
  9472. | "info"
  9473. | "log"
  9474. | "debug"
  9475. | "clear"
  9476. | "profile"
  9477. | "trace"
  9478. | "group"
  9479. | "groupCollapsed"
  9480. | "groupEnd"
  9481. | "profileEnd"
  9482. | "time"
  9483. | "status";
  9484. declare const MEASURE_END_OPERATION: unique symbol;
  9485. declare const MEASURE_START_OPERATION: unique symbol;
  9486. declare interface MainRenderContext {
  9487. /**
  9488. * the chunk
  9489. */
  9490. chunk: Chunk;
  9491. /**
  9492. * the dependency templates
  9493. */
  9494. dependencyTemplates: DependencyTemplates;
  9495. /**
  9496. * the runtime template
  9497. */
  9498. runtimeTemplate: RuntimeTemplate;
  9499. /**
  9500. * the module graph
  9501. */
  9502. moduleGraph: ModuleGraph;
  9503. /**
  9504. * the chunk graph
  9505. */
  9506. chunkGraph: ChunkGraph;
  9507. /**
  9508. * results of code generation
  9509. */
  9510. codeGenerationResults: CodeGenerationResults;
  9511. /**
  9512. * hash to be used for render call
  9513. */
  9514. hash: string;
  9515. /**
  9516. * rendering in strict context
  9517. */
  9518. strictMode?: boolean;
  9519. }
  9520. declare abstract class MainTemplate {
  9521. hooks: Readonly<{
  9522. renderManifest: {
  9523. tap: <AdditionalOptions>(
  9524. options:
  9525. | string
  9526. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9527. fn: (
  9528. renderManifestEntries: RenderManifestEntry[],
  9529. renderManifestOptions: RenderManifestOptions
  9530. ) => RenderManifestEntry[]
  9531. ) => void;
  9532. };
  9533. modules: { tap: () => never };
  9534. moduleObj: { tap: () => never };
  9535. require: {
  9536. tap: <AdditionalOptions>(
  9537. options:
  9538. | string
  9539. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9540. fn: (
  9541. value: string,
  9542. renderBootstrapContext: RenderBootstrapContext
  9543. ) => string
  9544. ) => void;
  9545. };
  9546. beforeStartup: { tap: () => never };
  9547. startup: { tap: () => never };
  9548. afterStartup: { tap: () => never };
  9549. render: {
  9550. tap: <AdditionalOptions>(
  9551. options:
  9552. | string
  9553. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9554. fn: (
  9555. source: Source,
  9556. chunk: Chunk,
  9557. hash: undefined | string,
  9558. moduleTemplate: ModuleTemplate,
  9559. dependencyTemplates: DependencyTemplates
  9560. ) => Source
  9561. ) => void;
  9562. };
  9563. renderWithEntry: {
  9564. tap: <AdditionalOptions>(
  9565. options:
  9566. | string
  9567. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9568. fn: (source: Source, chunk: Chunk, hash?: string) => Source
  9569. ) => void;
  9570. };
  9571. assetPath: {
  9572. tap: <AdditionalOptions>(
  9573. options:
  9574. | string
  9575. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9576. fn: (value: string, path: PathData, assetInfo?: AssetInfo) => string
  9577. ) => void;
  9578. call: (filename: TemplatePath, options: PathData) => string;
  9579. };
  9580. hash: {
  9581. tap: <AdditionalOptions>(
  9582. options:
  9583. | string
  9584. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9585. fn: (hash: Hash) => void
  9586. ) => void;
  9587. };
  9588. hashForChunk: {
  9589. tap: <AdditionalOptions>(
  9590. options:
  9591. | string
  9592. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9593. fn: (hash: Hash, chunk: Chunk) => void
  9594. ) => void;
  9595. };
  9596. globalHashPaths: { tap: () => void };
  9597. globalHash: { tap: () => void };
  9598. hotBootstrap: { tap: () => never };
  9599. bootstrap: SyncWaterfallHook<
  9600. [string, Chunk, string, ModuleTemplate, DependencyTemplates],
  9601. string
  9602. >;
  9603. localVars: SyncWaterfallHook<[string, Chunk, string], string>;
  9604. requireExtensions: SyncWaterfallHook<[string, Chunk, string], string>;
  9605. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string], string>;
  9606. get jsonpScript(): SyncWaterfallHook<[string, Chunk], string>;
  9607. get linkPrefetch(): SyncWaterfallHook<[string, Chunk], string>;
  9608. get linkPreload(): SyncWaterfallHook<[string, Chunk], string>;
  9609. }>;
  9610. renderCurrentHashCode: (hash: string, length?: number) => string;
  9611. getPublicPath: (options: PathData) => string;
  9612. getAssetPath: (path: TemplatePath, options: PathData) => string;
  9613. getAssetPathWithInfo: (
  9614. path: TemplatePath,
  9615. options: PathData
  9616. ) => InterpolatedPathAndAssetInfo;
  9617. get requireFn(): "__webpack_require__";
  9618. get outputOptions(): Output;
  9619. }
  9620. declare interface MakeDirectoryOptions {
  9621. recursive?: boolean;
  9622. mode?: string | number;
  9623. }
  9624. /**
  9625. * Describes a manifest entrypoint.
  9626. */
  9627. declare interface ManifestEntrypoint {
  9628. /**
  9629. * Contains the names of entrypoints.
  9630. */
  9631. imports: string[];
  9632. /**
  9633. * Contains the names of parent entrypoints.
  9634. */
  9635. parents?: string[];
  9636. }
  9637. /**
  9638. * Describes a manifest asset that links the emitted path to the producing asset.
  9639. */
  9640. declare interface ManifestItem {
  9641. /**
  9642. * The path absolute URL (this indicates that the path is absolute from the server's root directory) to file.
  9643. */
  9644. file: string;
  9645. /**
  9646. * The source path relative to the context.
  9647. */
  9648. src?: string;
  9649. }
  9650. /**
  9651. * The manifest object.
  9652. */
  9653. declare interface ManifestObject {
  9654. [index: string]: any;
  9655. /**
  9656. * Contains the names of assets.
  9657. */
  9658. assets: Record<string, ManifestItem>;
  9659. /**
  9660. * Contains the names of entrypoints.
  9661. */
  9662. entrypoints: Record<string, ManifestEntrypoint>;
  9663. }
  9664. declare class ManifestPlugin {
  9665. constructor(options: ManifestPluginOptions);
  9666. options: ManifestPluginOptions &
  9667. Required<Omit<ManifestPluginOptions, "filter" | "generate">>;
  9668. /**
  9669. * Apply the plugin
  9670. */
  9671. apply(compiler: Compiler): void;
  9672. }
  9673. declare interface ManifestPluginOptions {
  9674. /**
  9675. * Enables/disables generation of the entrypoints manifest section.
  9676. */
  9677. entrypoints?: boolean;
  9678. /**
  9679. * Specifies the filename of the output file on disk. By default the plugin will emit `manifest.json` inside the 'output.path' directory.
  9680. */
  9681. filename?: string;
  9682. /**
  9683. * Allows filtering the files which make up the manifest.
  9684. */
  9685. filter?: (item: ManifestItem) => boolean;
  9686. /**
  9687. * A function that receives the manifest object, modifies it, and returns the modified manifest.
  9688. */
  9689. generate?: (manifest: ManifestObject) => ManifestObject;
  9690. /**
  9691. * Specifies a path prefix for all keys in the manifest.
  9692. */
  9693. prefix?: string;
  9694. /**
  9695. * A function that receives the manifest object and returns the manifest string.
  9696. */
  9697. serialize?: (manifest: ManifestObject) => string;
  9698. }
  9699. declare interface MapOptions {
  9700. /**
  9701. * need columns?
  9702. */
  9703. columns?: boolean;
  9704. /**
  9705. * is module
  9706. */
  9707. module?: boolean;
  9708. }
  9709. declare interface MatchObject {
  9710. test?:
  9711. | string
  9712. | RegExp
  9713. | ((str: string) => boolean)
  9714. | (string | RegExp | ((str: string) => boolean))[];
  9715. include?:
  9716. | string
  9717. | RegExp
  9718. | ((str: string) => boolean)
  9719. | (string | RegExp | ((str: string) => boolean))[];
  9720. exclude?:
  9721. | string
  9722. | RegExp
  9723. | ((str: string) => boolean)
  9724. | (string | RegExp | ((str: string) => boolean))[];
  9725. }
  9726. type Matcher =
  9727. | string
  9728. | RegExp
  9729. | ((str: string) => boolean)
  9730. | (string | RegExp | ((str: string) => boolean))[];
  9731. declare interface MaybeMergeableInitFragment<GenerateContext> {
  9732. key?: string;
  9733. stage: number;
  9734. position: number;
  9735. getContent: (context: GenerateContext) => undefined | string | Source;
  9736. getEndContent: (context: GenerateContext) => undefined | string | Source;
  9737. merge?: (
  9738. fragments: MaybeMergeableInitFragment<GenerateContext>
  9739. ) => MaybeMergeableInitFragment<GenerateContext>;
  9740. mergeAll?: (
  9741. fragments: MaybeMergeableInitFragment<GenerateContext>[]
  9742. ) => MaybeMergeableInitFragment<GenerateContext>[];
  9743. }
  9744. type Media = undefined | string;
  9745. /**
  9746. * Options object for in-memory caching.
  9747. */
  9748. declare interface MemoryCacheOptions {
  9749. /**
  9750. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  9751. */
  9752. cacheUnaffected?: boolean;
  9753. /**
  9754. * 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).
  9755. */
  9756. maxGenerations?: number;
  9757. /**
  9758. * In memory caching.
  9759. */
  9760. type: "memory";
  9761. }
  9762. declare class MemoryCachePlugin {
  9763. constructor();
  9764. /**
  9765. * Apply the plugin
  9766. */
  9767. apply(compiler: Compiler): void;
  9768. }
  9769. declare class MergeDuplicateChunksPlugin {
  9770. constructor(options?: MergeDuplicateChunksPluginOptions);
  9771. options: MergeDuplicateChunksPluginOptions;
  9772. apply(compiler: Compiler): void;
  9773. }
  9774. declare interface MergeDuplicateChunksPluginOptions {
  9775. /**
  9776. * Specifies the stage for merging duplicate chunks.
  9777. */
  9778. stage?: number;
  9779. }
  9780. type Meta = KnownMeta &
  9781. Record<
  9782. | typeof idsSymbolCommonJsExportRequireDependency
  9783. | typeof idsSymbolHarmonyImportSpecifierDependency
  9784. | typeof idsSymbolHarmonyExportImportedSpecifierDependency,
  9785. string[]
  9786. > &
  9787. Record<string, any>;
  9788. declare class MinChunkSizePlugin {
  9789. constructor(options: MinChunkSizePluginOptions);
  9790. options: MinChunkSizePluginOptions;
  9791. /**
  9792. * Apply the plugin
  9793. */
  9794. apply(compiler: Compiler): void;
  9795. }
  9796. declare interface MinChunkSizePluginOptions {
  9797. /**
  9798. * Constant overhead for a chunk.
  9799. */
  9800. chunkOverhead?: number;
  9801. /**
  9802. * Multiplicator for initial chunks.
  9803. */
  9804. entryChunkMultiplicator?: number;
  9805. /**
  9806. * Minimum number of characters.
  9807. */
  9808. minChunkSize: number;
  9809. }
  9810. declare interface Mkdir {
  9811. (
  9812. file: PathLikeFs,
  9813. options: MakeDirectoryOptions & { recursive: true },
  9814. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  9815. ): void;
  9816. (
  9817. file: PathLikeFs,
  9818. options:
  9819. | undefined
  9820. | null
  9821. | string
  9822. | number
  9823. | (MakeDirectoryOptions & { recursive?: false }),
  9824. callback: (err: null | NodeJS.ErrnoException) => void
  9825. ): void;
  9826. (
  9827. file: PathLikeFs,
  9828. options: undefined | null | string | number | MakeDirectoryOptions,
  9829. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  9830. ): void;
  9831. (
  9832. file: PathLikeFs,
  9833. callback: (err: null | NodeJS.ErrnoException) => void
  9834. ): void;
  9835. }
  9836. declare interface MkdirSync {
  9837. (
  9838. path: PathLikeFs,
  9839. options: MakeDirectoryOptions & { recursive: true }
  9840. ): undefined | string;
  9841. (
  9842. path: PathLikeFs,
  9843. options?:
  9844. | null
  9845. | string
  9846. | number
  9847. | (MakeDirectoryOptions & { recursive?: false })
  9848. ): void;
  9849. (
  9850. path: PathLikeFs,
  9851. options?: null | string | number | MakeDirectoryOptions
  9852. ): undefined | string;
  9853. }
  9854. declare class Module extends DependenciesBlock {
  9855. constructor(type: string, context?: null | string, layer?: null | string);
  9856. type: string;
  9857. context: null | string;
  9858. layer: null | string;
  9859. needId: boolean;
  9860. debugId: number;
  9861. resolveOptions?: ResolveOptions;
  9862. factoryMeta?: FactoryMeta;
  9863. useSourceMap: boolean;
  9864. useSimpleSourceMap: boolean;
  9865. hot: boolean;
  9866. buildMeta?: BuildMeta;
  9867. buildInfo?: BuildInfo;
  9868. presentationalDependencies?: Dependency[];
  9869. codeGenerationDependencies?: Dependency[];
  9870. id: null | string | number;
  9871. get hash(): string;
  9872. get renderedHash(): string;
  9873. profile?: ModuleProfile;
  9874. index: null | number;
  9875. index2: null | number;
  9876. depth: null | number;
  9877. issuer?: null | Module;
  9878. get usedExports(): null | boolean | SortableSet<string>;
  9879. get optimizationBailout(): (
  9880. | string
  9881. | ((requestShortener: RequestShortener) => string)
  9882. )[];
  9883. get optional(): boolean;
  9884. addChunk(chunk: Chunk): boolean;
  9885. removeChunk(chunk: Chunk): void;
  9886. isInChunk(chunk: Chunk): boolean;
  9887. isEntryModule(): boolean;
  9888. getChunks(): Chunk[];
  9889. getNumberOfChunks(): number;
  9890. get chunksIterable(): Iterable<Chunk>;
  9891. isProvided(exportName: string): null | boolean;
  9892. get exportsArgument(): string;
  9893. get moduleArgument(): string;
  9894. getExportsType(moduleGraph: ModuleGraph, strict?: boolean): ExportsType;
  9895. addPresentationalDependency(presentationalDependency: Dependency): void;
  9896. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  9897. addWarning(warning: WebpackError): void;
  9898. getWarnings(): undefined | Iterable<WebpackError>;
  9899. getNumberOfWarnings(): number;
  9900. addError(error: WebpackError): void;
  9901. getErrors(): undefined | Iterable<WebpackError>;
  9902. getNumberOfErrors(): number;
  9903. /**
  9904. * removes all warnings and errors
  9905. */
  9906. clearWarningsAndErrors(): void;
  9907. isOptional(moduleGraph: ModuleGraph): boolean;
  9908. isAccessibleInChunk(
  9909. chunkGraph: ChunkGraph,
  9910. chunk: Chunk,
  9911. ignoreChunk?: Chunk
  9912. ): boolean;
  9913. isAccessibleInChunkGroup(
  9914. chunkGraph: ChunkGraph,
  9915. chunkGroup: ChunkGroup,
  9916. ignoreChunk?: Chunk
  9917. ): boolean;
  9918. hasReasonForChunk(
  9919. chunk: Chunk,
  9920. moduleGraph: ModuleGraph,
  9921. chunkGraph: ChunkGraph
  9922. ): boolean;
  9923. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  9924. needBuild(
  9925. context: NeedBuildContext,
  9926. callback: (err?: null | WebpackError, needBuild?: boolean) => void
  9927. ): void;
  9928. needRebuild(
  9929. fileTimestamps: Map<string, null | number>,
  9930. contextTimestamps: Map<string, null | number>
  9931. ): boolean;
  9932. invalidateBuild(): void;
  9933. identifier(): string;
  9934. readableIdentifier(requestShortener: RequestShortener): string;
  9935. build(
  9936. options: WebpackOptionsNormalizedWithDefaults,
  9937. compilation: Compilation,
  9938. resolver: ResolverWithOptions,
  9939. fs: InputFileSystem,
  9940. callback: (err?: WebpackError) => void
  9941. ): void;
  9942. getSourceTypes(): ReadonlySet<string>;
  9943. /**
  9944. * Basic source types are high-level categories like javascript, css, webassembly, etc.
  9945. * We only have built-in knowledge about the javascript basic type here; other basic types may be
  9946. * added or changed over time by generators and do not need to be handled or detected here.
  9947. * Some modules, e.g. RemoteModule, may return non-basic source types like "remote" and "share-init"
  9948. * from getSourceTypes(), but their generated output is still JavaScript, i.e. their basic type is JS.
  9949. */
  9950. getSourceBasicTypes(): ReadonlySet<string>;
  9951. source(
  9952. dependencyTemplates: DependencyTemplates,
  9953. runtimeTemplate: RuntimeTemplate,
  9954. type?: string
  9955. ): Source;
  9956. size(type?: string): number;
  9957. libIdent(options: LibIdentOptions): null | string;
  9958. nameForCondition(): null | string;
  9959. getConcatenationBailoutReason(
  9960. context: ConcatenationBailoutReasonContext
  9961. ): undefined | string;
  9962. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  9963. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  9964. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  9965. hasChunkCondition(): boolean;
  9966. /**
  9967. * Assuming this module is in the cache. Update the (cached) module with
  9968. * the fresh module from the factory. Usually updates internal references
  9969. * and properties.
  9970. */
  9971. updateCacheModule(module: Module): void;
  9972. /**
  9973. * Module should be unsafe cached. Get data that's needed for that.
  9974. * This data will be passed to restoreFromUnsafeCache later.
  9975. */
  9976. getUnsafeCacheData(): UnsafeCacheData;
  9977. /**
  9978. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  9979. */
  9980. cleanupForCache(): void;
  9981. originalSource(): null | Source;
  9982. addCacheDependencies(
  9983. fileDependencies: LazySet<string>,
  9984. contextDependencies: LazySet<string>,
  9985. missingDependencies: LazySet<string>,
  9986. buildDependencies: LazySet<string>
  9987. ): void;
  9988. get hasEqualsChunks(): any;
  9989. get isUsed(): any;
  9990. get errors(): any;
  9991. get warnings(): any;
  9992. used: any;
  9993. }
  9994. declare class ModuleChunkLoadingRuntimeModule extends RuntimeModule {
  9995. constructor(runtimeRequirements: ReadonlySet<string>);
  9996. static getCompilationHooks(
  9997. compilation: Compilation
  9998. ): JsonpCompilationPluginHooks;
  9999. /**
  10000. * Runtime modules without any dependencies to other runtime modules
  10001. */
  10002. static STAGE_NORMAL: number;
  10003. /**
  10004. * Runtime modules with simple dependencies on other runtime modules
  10005. */
  10006. static STAGE_BASIC: number;
  10007. /**
  10008. * Runtime modules which attach to handlers of other runtime modules
  10009. */
  10010. static STAGE_ATTACH: number;
  10011. /**
  10012. * Runtime modules which trigger actions on bootstrap
  10013. */
  10014. static STAGE_TRIGGER: number;
  10015. }
  10016. declare class ModuleConcatenationPlugin {
  10017. constructor();
  10018. /**
  10019. * Apply the plugin
  10020. */
  10021. apply(compiler: Compiler): void;
  10022. }
  10023. declare class ModuleDependency extends Dependency {
  10024. constructor(request: string, sourceOrder?: number);
  10025. request: string;
  10026. userRequest: string;
  10027. sourceOrder?: number;
  10028. range?: [number, number];
  10029. static Template: typeof DependencyTemplate;
  10030. static NO_EXPORTS_REFERENCED: string[][];
  10031. static EXPORTS_OBJECT_REFERENCED: string[][];
  10032. static isLowPriorityDependency(dependency: Dependency): boolean;
  10033. static TRANSITIVE: typeof TRANSITIVE;
  10034. }
  10035. declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
  10036. constructor(
  10037. request: string,
  10038. imported: Imported,
  10039. ident?: string,
  10040. dependencyMeta?: ImportDependencyMeta,
  10041. hashFunction?: string | typeof Hash
  10042. );
  10043. getImported(): Imported;
  10044. setImported(imported: Imported): void;
  10045. getNamespaceIdentifier(): string;
  10046. buildIdentifier(ident: string): string;
  10047. buildImported(imported: Imported): Imported;
  10048. static addToSource<Context>(
  10049. source: Source,
  10050. initFragments: MaybeMergeableInitFragment<Context>[],
  10051. context: Context
  10052. ): Source;
  10053. static STAGE_CONSTANTS: number;
  10054. static STAGE_ASYNC_BOUNDARY: number;
  10055. static STAGE_HARMONY_EXPORTS: number;
  10056. static STAGE_HARMONY_IMPORTS: number;
  10057. static STAGE_PROVIDES: number;
  10058. static STAGE_ASYNC_DEPENDENCIES: number;
  10059. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  10060. }
  10061. declare class ModuleFactory {
  10062. constructor();
  10063. create(
  10064. data: ModuleFactoryCreateData,
  10065. callback: (err?: null | Error, result?: ModuleFactoryResult) => void
  10066. ): void;
  10067. }
  10068. declare interface ModuleFactoryCacheEntry {
  10069. /**
  10070. * - The undo path to the CSS file
  10071. */
  10072. undoPath: string;
  10073. /**
  10074. * - The inheritance chain
  10075. */
  10076. inheritance: [CssLayer, Supports, Media][];
  10077. /**
  10078. * - The cached source
  10079. */
  10080. source: CachedSource;
  10081. }
  10082. declare interface ModuleFactoryCreateData {
  10083. contextInfo: ModuleFactoryCreateDataContextInfo;
  10084. resolveOptions?: ResolveOptions;
  10085. context: string;
  10086. dependencies: Dependency[];
  10087. }
  10088. declare interface ModuleFactoryCreateDataContextInfo {
  10089. issuer: string;
  10090. issuerLayer: IssuerLayer;
  10091. compiler?: string;
  10092. }
  10093. declare interface ModuleFactoryResult {
  10094. /**
  10095. * the created module or unset if no module was created
  10096. */
  10097. module?: Module;
  10098. fileDependencies?: Set<string>;
  10099. contextDependencies?: Set<string>;
  10100. missingDependencies?: Set<string>;
  10101. /**
  10102. * allow to use the unsafe cache
  10103. */
  10104. cacheable?: boolean;
  10105. }
  10106. declare class ModuleFederationPlugin {
  10107. constructor(options: ModuleFederationPluginOptions);
  10108. /**
  10109. * Apply the plugin
  10110. */
  10111. apply(compiler: Compiler): void;
  10112. /**
  10113. * Get the compilation hooks associated with this plugin.
  10114. */
  10115. static getCompilationHooks(
  10116. compilation: Compilation
  10117. ): CompilationHooksModuleFederationPlugin;
  10118. }
  10119. declare interface ModuleFederationPluginOptions {
  10120. /**
  10121. * 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.
  10122. */
  10123. exposes?: (string | ExposesObject)[] | ExposesObject;
  10124. /**
  10125. * The filename of the container as relative path inside the `output.path` directory.
  10126. */
  10127. filename?: string;
  10128. /**
  10129. * Options for library.
  10130. */
  10131. library?: LibraryOptions;
  10132. /**
  10133. * The name of the container.
  10134. */
  10135. name?: string;
  10136. /**
  10137. * The external type of the remote containers.
  10138. */
  10139. remoteType?:
  10140. | "import"
  10141. | "var"
  10142. | "module"
  10143. | "assign"
  10144. | "this"
  10145. | "window"
  10146. | "self"
  10147. | "global"
  10148. | "commonjs"
  10149. | "commonjs2"
  10150. | "commonjs-module"
  10151. | "commonjs-static"
  10152. | "amd"
  10153. | "amd-require"
  10154. | "umd"
  10155. | "umd2"
  10156. | "jsonp"
  10157. | "system"
  10158. | "promise"
  10159. | "module-import"
  10160. | "script"
  10161. | "node-commonjs"
  10162. | "asset"
  10163. | "css-import"
  10164. | "css-url";
  10165. /**
  10166. * 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.
  10167. */
  10168. remotes?: (string | RemotesObject)[] | RemotesObject;
  10169. /**
  10170. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  10171. */
  10172. runtime?: string | false;
  10173. /**
  10174. * Share scope name used for all shared modules (defaults to 'default').
  10175. */
  10176. shareScope?: string;
  10177. /**
  10178. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  10179. */
  10180. shared?: (string | SharedObject)[] | SharedObject;
  10181. }
  10182. declare interface ModuleFilenameTemplateContext {
  10183. /**
  10184. * the identifier of the module
  10185. */
  10186. identifier: string;
  10187. /**
  10188. * the shortened identifier of the module
  10189. */
  10190. shortIdentifier: string;
  10191. /**
  10192. * the resource of the module request
  10193. */
  10194. resource: string;
  10195. /**
  10196. * the resource path of the module request
  10197. */
  10198. resourcePath: string;
  10199. /**
  10200. * the absolute resource path of the module request
  10201. */
  10202. absoluteResourcePath: string;
  10203. /**
  10204. * the loaders of the module request
  10205. */
  10206. loaders: string;
  10207. /**
  10208. * the all loaders of the module request
  10209. */
  10210. allLoaders: string;
  10211. /**
  10212. * the query of the module identifier
  10213. */
  10214. query: string;
  10215. /**
  10216. * the module id of the module
  10217. */
  10218. moduleId: string;
  10219. /**
  10220. * the hash of the module identifier
  10221. */
  10222. hash: string;
  10223. /**
  10224. * the module namespace
  10225. */
  10226. namespace: string;
  10227. }
  10228. type ModuleFilterItemTypes =
  10229. | string
  10230. | RegExp
  10231. | ((
  10232. name: string,
  10233. module: StatsModule,
  10234. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10235. ) => boolean);
  10236. declare class ModuleGraph {
  10237. constructor();
  10238. setParents(
  10239. dependency: Dependency,
  10240. block: DependenciesBlock,
  10241. module: Module,
  10242. indexInBlock?: number
  10243. ): void;
  10244. setParentDependenciesBlockIndex(dependency: Dependency, index: number): void;
  10245. getParentModule(dependency: Dependency): undefined | Module;
  10246. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  10247. getParentBlockIndex(dependency: Dependency): number;
  10248. setResolvedModule(
  10249. originModule: null | Module,
  10250. dependency: Dependency,
  10251. module: Module
  10252. ): void;
  10253. updateModule(dependency: Dependency, module: Module): void;
  10254. updateParent(
  10255. dependency: Dependency,
  10256. connection?: ModuleGraphConnection,
  10257. parentModule?: Module
  10258. ): void;
  10259. finishUpdateParent(): void;
  10260. removeConnection(dependency: Dependency): void;
  10261. addExplanation(dependency: Dependency, explanation: string): void;
  10262. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  10263. removeModuleAttributes(module: Module): void;
  10264. removeAllModuleAttributes(): void;
  10265. moveModuleConnections(
  10266. oldModule: Module,
  10267. newModule: Module,
  10268. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  10269. ): void;
  10270. copyOutgoingModuleConnections(
  10271. oldModule: Module,
  10272. newModule: Module,
  10273. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  10274. ): void;
  10275. addExtraReason(module: Module, explanation: string): void;
  10276. getResolvedModule(dependency: Dependency): null | Module;
  10277. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  10278. getModule(dependency: Dependency): null | Module;
  10279. getOrigin(dependency: Dependency): null | Module;
  10280. getResolvedOrigin(dependency: Dependency): null | Module;
  10281. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  10282. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  10283. getIncomingConnectionsByOriginModule(
  10284. module: Module
  10285. ): ReadonlyMap<
  10286. undefined | null | Module,
  10287. ReadonlyArray<ModuleGraphConnection>
  10288. >;
  10289. getOutgoingConnectionsByModule(
  10290. module: Module
  10291. ):
  10292. | undefined
  10293. | ReadonlyMap<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  10294. getProfile(module: Module): undefined | ModuleProfile;
  10295. setProfile(module: Module, profile?: ModuleProfile): void;
  10296. getIssuer(module: Module): Issuer;
  10297. setIssuer(module: Module, issuer: null | Module): void;
  10298. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  10299. getOptimizationBailout(
  10300. module: Module
  10301. ): (string | ((requestShortener: RequestShortener) => string))[];
  10302. getProvidedExports(module: Module): null | true | string[];
  10303. isExportProvided(
  10304. module: Module,
  10305. exportName: string | string[]
  10306. ): null | boolean;
  10307. getExportsInfo(module: Module): ExportsInfo;
  10308. getExportInfo(module: Module, exportName: string): ExportInfo;
  10309. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  10310. getUsedExports(
  10311. module: Module,
  10312. runtime: RuntimeSpec
  10313. ): null | boolean | SortableSet<string>;
  10314. getPreOrderIndex(module: Module): null | number;
  10315. getPostOrderIndex(module: Module): null | number;
  10316. setPreOrderIndex(module: Module, index: number): void;
  10317. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  10318. setPostOrderIndex(module: Module, index: number): void;
  10319. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  10320. getDepth(module: Module): null | number;
  10321. setDepth(module: Module, depth: number): void;
  10322. setDepthIfLower(module: Module, depth: number): boolean;
  10323. isAsync(module: Module): boolean;
  10324. isDeferred(module: Module): boolean;
  10325. setAsync(module: Module): void;
  10326. getMeta(thing: object): Meta;
  10327. getMetaIfExisting(thing: object): undefined | Meta;
  10328. freeze(cacheStage?: string): void;
  10329. unfreeze(): void;
  10330. cached<T extends any[], R>(
  10331. fn: (moduleGraph: ModuleGraph, ...args: T) => R,
  10332. ...args: T
  10333. ): R;
  10334. setModuleMemCaches(
  10335. moduleMemCaches: Map<Module, WeakTupleMap<any[], any>>
  10336. ): void;
  10337. dependencyCacheProvide<D extends Dependency, ARGS extends any[], R>(
  10338. dependency: D,
  10339. ...args: [
  10340. ARGS,
  10341. ...((moduleGraph: ModuleGraph, dependency: D, ...args: ARGS) => R)[]
  10342. ]
  10343. ): R;
  10344. static getModuleGraphForModule(
  10345. module: Module,
  10346. deprecateMessage: string,
  10347. deprecationCode: string
  10348. ): ModuleGraph;
  10349. static setModuleGraphForModule(
  10350. module: Module,
  10351. moduleGraph: ModuleGraph
  10352. ): void;
  10353. static clearModuleGraphForModule(module: Module): void;
  10354. static ModuleGraphConnection: typeof ModuleGraphConnection;
  10355. }
  10356. declare class ModuleGraphConnection {
  10357. constructor(
  10358. originModule: null | Module,
  10359. dependency: null | Dependency,
  10360. module: Module,
  10361. explanation?: string,
  10362. weak?: boolean,
  10363. condition?:
  10364. | null
  10365. | false
  10366. | ((
  10367. moduleGraphConnection: ModuleGraphConnection,
  10368. runtime: RuntimeSpec
  10369. ) => ConnectionState)
  10370. );
  10371. originModule: null | Module;
  10372. resolvedOriginModule: null | Module;
  10373. dependency: null | Dependency;
  10374. resolvedModule: Module;
  10375. module: Module;
  10376. weak?: boolean;
  10377. conditional: boolean;
  10378. condition?:
  10379. | null
  10380. | false
  10381. | ((
  10382. moduleGraphConnection: ModuleGraphConnection,
  10383. runtime: RuntimeSpec
  10384. ) => ConnectionState);
  10385. explanations?: Set<string>;
  10386. clone(): ModuleGraphConnection;
  10387. addCondition(
  10388. condition: (
  10389. moduleGraphConnection: ModuleGraphConnection,
  10390. runtime: RuntimeSpec
  10391. ) => ConnectionState
  10392. ): void;
  10393. addExplanation(explanation: string): void;
  10394. get explanation(): string;
  10395. isActive(runtime: RuntimeSpec): boolean;
  10396. isTargetActive(runtime: RuntimeSpec): boolean;
  10397. getActiveState(runtime: RuntimeSpec): ConnectionState;
  10398. setActive(value: boolean): void;
  10399. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  10400. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  10401. static addConnectionStates: (
  10402. a: ConnectionState,
  10403. b: ConnectionState
  10404. ) => ConnectionState;
  10405. }
  10406. type ModuleId = string | number;
  10407. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  10408. declare interface ModuleMemCachesItem {
  10409. buildInfo: BuildInfo;
  10410. references?: WeakMap<Dependency, Module>;
  10411. memCache: WeakTupleMap<any[], any>;
  10412. }
  10413. /**
  10414. * Options affecting the normal modules (`NormalModuleFactory`).
  10415. */
  10416. declare interface ModuleOptions {
  10417. /**
  10418. * An array of rules applied by default for modules.
  10419. */
  10420. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10421. /**
  10422. * Enable warnings for full dynamic dependencies.
  10423. */
  10424. exprContextCritical?: boolean;
  10425. /**
  10426. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  10427. */
  10428. exprContextRecursive?: boolean;
  10429. /**
  10430. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  10431. */
  10432. exprContextRegExp?: boolean | RegExp;
  10433. /**
  10434. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  10435. */
  10436. exprContextRequest?: string;
  10437. /**
  10438. * Specify options for each generator.
  10439. */
  10440. generator?: GeneratorOptionsByModuleType;
  10441. /**
  10442. * Don't parse files matching. It's matched against the full resolved request.
  10443. */
  10444. noParse?:
  10445. | string
  10446. | RegExp
  10447. | ((content: string) => boolean)
  10448. | (string | RegExp | ((content: string) => boolean))[];
  10449. /**
  10450. * Specify options for each parser.
  10451. */
  10452. parser?: ParserOptionsByModuleType;
  10453. /**
  10454. * An array of rules applied for modules.
  10455. */
  10456. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10457. /**
  10458. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  10459. */
  10460. strictExportPresence?: boolean;
  10461. /**
  10462. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  10463. */
  10464. strictThisContextOnImports?: boolean;
  10465. /**
  10466. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  10467. */
  10468. unknownContextCritical?: boolean;
  10469. /**
  10470. * 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'.
  10471. */
  10472. unknownContextRecursive?: boolean;
  10473. /**
  10474. * 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'.
  10475. */
  10476. unknownContextRegExp?: boolean | RegExp;
  10477. /**
  10478. * 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'.
  10479. */
  10480. unknownContextRequest?: string;
  10481. /**
  10482. * Cache the resolving of module requests.
  10483. */
  10484. unsafeCache?: boolean | ((module: Module) => boolean);
  10485. /**
  10486. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  10487. */
  10488. wrappedContextCritical?: boolean;
  10489. /**
  10490. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  10491. */
  10492. wrappedContextRecursive?: boolean;
  10493. /**
  10494. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  10495. */
  10496. wrappedContextRegExp?: RegExp;
  10497. }
  10498. /**
  10499. * Options affecting the normal modules (`NormalModuleFactory`).
  10500. */
  10501. declare interface ModuleOptionsNormalized {
  10502. /**
  10503. * An array of rules applied by default for modules.
  10504. */
  10505. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10506. /**
  10507. * Specify options for each generator.
  10508. */
  10509. generator: GeneratorOptionsByModuleType;
  10510. /**
  10511. * Don't parse files matching. It's matched against the full resolved request.
  10512. */
  10513. noParse?:
  10514. | string
  10515. | RegExp
  10516. | ((content: string) => boolean)
  10517. | (string | RegExp | ((content: string) => boolean))[];
  10518. /**
  10519. * Specify options for each parser.
  10520. */
  10521. parser: ParserOptionsByModuleType;
  10522. /**
  10523. * An array of rules applied for modules.
  10524. */
  10525. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10526. /**
  10527. * Cache the resolving of module requests.
  10528. */
  10529. unsafeCache?: boolean | ((module: Module) => boolean);
  10530. }
  10531. declare interface ModulePathData {
  10532. id: string | number;
  10533. hash: string;
  10534. hashWithLength?: (length: number) => string;
  10535. }
  10536. declare abstract class ModuleProfile {
  10537. startTime: number;
  10538. factoryStartTime: number;
  10539. factoryEndTime: number;
  10540. factory: number;
  10541. factoryParallelismFactor: number;
  10542. restoringStartTime: number;
  10543. restoringEndTime: number;
  10544. restoring: number;
  10545. restoringParallelismFactor: number;
  10546. integrationStartTime: number;
  10547. integrationEndTime: number;
  10548. integration: number;
  10549. integrationParallelismFactor: number;
  10550. buildingStartTime: number;
  10551. buildingEndTime: number;
  10552. building: number;
  10553. buildingParallelismFactor: number;
  10554. storingStartTime: number;
  10555. storingEndTime: number;
  10556. storing: number;
  10557. storingParallelismFactor: number;
  10558. additionalFactoryTimes?: { start: number; end: number }[];
  10559. additionalFactories: number;
  10560. additionalFactoriesParallelismFactor: number;
  10561. additionalIntegration: number;
  10562. markFactoryStart(): void;
  10563. markFactoryEnd(): void;
  10564. markRestoringStart(): void;
  10565. markRestoringEnd(): void;
  10566. markIntegrationStart(): void;
  10567. markIntegrationEnd(): void;
  10568. markBuildingStart(): void;
  10569. markBuildingEnd(): void;
  10570. markStoringStart(): void;
  10571. markStoringEnd(): void;
  10572. /**
  10573. * Merge this profile into another one
  10574. */
  10575. mergeInto(realProfile: ModuleProfile): void;
  10576. }
  10577. declare interface ModuleReferenceOptions {
  10578. /**
  10579. * the properties/exports of the module
  10580. */
  10581. ids: string[];
  10582. /**
  10583. * true, when this referenced export is called
  10584. */
  10585. call: boolean;
  10586. /**
  10587. * true, when this referenced export is directly imported (not via property access)
  10588. */
  10589. directImport: boolean;
  10590. /**
  10591. * true, when this referenced export is deferred
  10592. */
  10593. deferredImport: boolean;
  10594. /**
  10595. * if the position is ASI safe or unknown
  10596. */
  10597. asiSafe?: boolean;
  10598. }
  10599. declare interface ModuleRenderContext {
  10600. /**
  10601. * the chunk
  10602. */
  10603. chunk: Chunk;
  10604. /**
  10605. * the dependency templates
  10606. */
  10607. dependencyTemplates: DependencyTemplates;
  10608. /**
  10609. * the runtime template
  10610. */
  10611. runtimeTemplate: RuntimeTemplate;
  10612. /**
  10613. * the module graph
  10614. */
  10615. moduleGraph: ModuleGraph;
  10616. /**
  10617. * the chunk graph
  10618. */
  10619. chunkGraph: ChunkGraph;
  10620. /**
  10621. * results of code generation
  10622. */
  10623. codeGenerationResults: CodeGenerationResults;
  10624. /**
  10625. * init fragments for the chunk
  10626. */
  10627. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  10628. /**
  10629. * rendering in strict context
  10630. */
  10631. strictMode?: boolean;
  10632. /**
  10633. * true: renders as factory method, false: pure module content
  10634. */
  10635. factory: boolean;
  10636. /**
  10637. * the inlined entry module is wrapped in an IIFE, existing only when `factory` is set to false
  10638. */
  10639. inlinedInIIFE?: boolean;
  10640. /**
  10641. * render module in object container
  10642. */
  10643. renderInObject?: boolean;
  10644. }
  10645. declare interface ModuleResult {
  10646. client: string;
  10647. data: string;
  10648. active: boolean;
  10649. }
  10650. declare interface ModuleSettings {
  10651. /**
  10652. * Specifies the layer in which the module should be placed in.
  10653. */
  10654. layer?: string;
  10655. /**
  10656. * Module type to use for the module.
  10657. */
  10658. type?: string;
  10659. /**
  10660. * Options for parsing.
  10661. */
  10662. parser?: { [index: string]: any };
  10663. /**
  10664. * The options for the module generator.
  10665. */
  10666. generator?: { [index: string]: any };
  10667. /**
  10668. * Enable/Disable extracting source map.
  10669. */
  10670. extractSourceMap?: boolean;
  10671. /**
  10672. * Options for the resolver.
  10673. */
  10674. resolve?: ResolveOptions;
  10675. /**
  10676. * Flags a module as with or without side effects.
  10677. */
  10678. sideEffects?: boolean;
  10679. }
  10680. declare abstract class ModuleTemplate {
  10681. type: string;
  10682. hooks: Readonly<{
  10683. content: {
  10684. tap: <AdditionalOptions>(
  10685. options:
  10686. | string
  10687. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10688. fn: (
  10689. source: Source,
  10690. module: Module,
  10691. moduleRenderContext: ModuleRenderContext,
  10692. dependencyTemplates: DependencyTemplates
  10693. ) => Source
  10694. ) => void;
  10695. };
  10696. module: {
  10697. tap: <AdditionalOptions>(
  10698. options:
  10699. | string
  10700. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10701. fn: (
  10702. source: Source,
  10703. module: Module,
  10704. moduleRenderContext: ModuleRenderContext,
  10705. dependencyTemplates: DependencyTemplates
  10706. ) => Source
  10707. ) => void;
  10708. };
  10709. render: {
  10710. tap: <AdditionalOptions>(
  10711. options:
  10712. | string
  10713. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10714. fn: (
  10715. source: Source,
  10716. module: Module,
  10717. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  10718. dependencyTemplates: DependencyTemplates
  10719. ) => Source
  10720. ) => void;
  10721. };
  10722. package: {
  10723. tap: <AdditionalOptions>(
  10724. options:
  10725. | string
  10726. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10727. fn: (
  10728. source: Source,
  10729. module: Module,
  10730. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  10731. dependencyTemplates: DependencyTemplates
  10732. ) => Source
  10733. ) => void;
  10734. };
  10735. hash: {
  10736. tap: <AdditionalOptions>(
  10737. options:
  10738. | string
  10739. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10740. fn: (hash: Hash) => void
  10741. ) => void;
  10742. };
  10743. }>;
  10744. get runtimeTemplate(): RuntimeTemplate;
  10745. }
  10746. declare interface ModuleTemplates {
  10747. javascript: ModuleTemplate;
  10748. }
  10749. declare interface ModuleTrace {
  10750. origin: Module;
  10751. module: Module;
  10752. }
  10753. declare class MultiCompiler {
  10754. constructor(
  10755. compilers: Compiler[] | Record<string, Compiler>,
  10756. options: MultiCompilerOptions
  10757. );
  10758. hooks: Readonly<{
  10759. done: SyncHook<[MultiStats]>;
  10760. invalid: MultiHook<SyncHook<[null | string, number]>>;
  10761. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  10762. watchClose: SyncHook<[]>;
  10763. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  10764. infrastructureLog: MultiHook<
  10765. SyncBailHook<[string, string, undefined | any[]], true | void>
  10766. >;
  10767. }>;
  10768. compilers: Compiler[];
  10769. dependencies: WeakMap<Compiler, string[]>;
  10770. running: boolean;
  10771. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  10772. get outputPath(): string;
  10773. inputFileSystem: InputFileSystem;
  10774. outputFileSystem: OutputFileSystem;
  10775. watchFileSystem: WatchFileSystem;
  10776. intermediateFileSystem: IntermediateFileSystem;
  10777. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  10778. setDependencies(compiler: Compiler, dependencies: string[]): void;
  10779. validateDependencies(
  10780. callback: CallbackWebpackFunction_2<MultiStats, void>
  10781. ): boolean;
  10782. runWithDependencies(
  10783. compilers: Compiler[],
  10784. fn: (
  10785. compiler: Compiler,
  10786. callback: CallbackWebpackFunction_2<MultiStats, void>
  10787. ) => void,
  10788. callback: CallbackWebpackFunction_2<Stats[], void>
  10789. ): void;
  10790. watch(
  10791. watchOptions: WatchOptions | WatchOptions[],
  10792. handler: CallbackWebpackFunction_2<MultiStats, void>
  10793. ): undefined | MultiWatching;
  10794. run(callback: CallbackWebpackFunction_2<MultiStats, void>): void;
  10795. purgeInputFileSystem(): void;
  10796. close(callback: (err: null | Error, result?: void) => void): void;
  10797. }
  10798. declare interface MultiCompilerOptions {
  10799. /**
  10800. * how many Compilers are allows to run at the same time in parallel
  10801. */
  10802. parallelism?: number;
  10803. }
  10804. type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
  10805. declare abstract class MultiStats {
  10806. stats: Stats[];
  10807. get hash(): string;
  10808. hasErrors(): boolean;
  10809. hasWarnings(): boolean;
  10810. toJson(
  10811. options?:
  10812. | boolean
  10813. | StatsOptions
  10814. | "none"
  10815. | "summary"
  10816. | "errors-only"
  10817. | "errors-warnings"
  10818. | "minimal"
  10819. | "normal"
  10820. | "detailed"
  10821. | "verbose"
  10822. ): StatsCompilation;
  10823. toString(
  10824. options?:
  10825. | boolean
  10826. | StatsOptions
  10827. | "none"
  10828. | "summary"
  10829. | "errors-only"
  10830. | "errors-warnings"
  10831. | "minimal"
  10832. | "normal"
  10833. | "detailed"
  10834. | "verbose"
  10835. ): string;
  10836. }
  10837. declare abstract class MultiWatching {
  10838. watchings: Watching[];
  10839. compiler: MultiCompiler;
  10840. invalidate(callback?: (err: null | Error, result?: void) => void): void;
  10841. suspend(): void;
  10842. resume(): void;
  10843. close(callback: (err: null | Error, result?: void) => void): void;
  10844. }
  10845. declare class NamedChunkIdsPlugin {
  10846. constructor(options?: NamedChunkIdsPluginOptions);
  10847. options: NamedChunkIdsPluginOptions;
  10848. /**
  10849. * Apply the plugin
  10850. */
  10851. apply(compiler: Compiler): void;
  10852. }
  10853. declare interface NamedChunkIdsPluginOptions {
  10854. /**
  10855. * context
  10856. */
  10857. context?: string;
  10858. /**
  10859. * delimiter
  10860. */
  10861. delimiter?: string;
  10862. }
  10863. declare class NamedModuleIdsPlugin {
  10864. constructor(options?: NamedModuleIdsPluginOptions);
  10865. options: NamedModuleIdsPluginOptions;
  10866. /**
  10867. * Apply the plugin
  10868. */
  10869. apply(compiler: Compiler): void;
  10870. }
  10871. declare interface NamedModuleIdsPluginOptions {
  10872. /**
  10873. * context
  10874. */
  10875. context?: string;
  10876. }
  10877. declare class NaturalModuleIdsPlugin {
  10878. constructor();
  10879. /**
  10880. * Apply the plugin
  10881. */
  10882. apply(compiler: Compiler): void;
  10883. }
  10884. declare interface NeedBuildContext {
  10885. compilation: Compilation;
  10886. fileSystemInfo: FileSystemInfo;
  10887. valueCacheVersions: Map<string, ValueCacheVersion>;
  10888. }
  10889. declare interface NewContentCreateContextMap {
  10890. [index: string]: string;
  10891. }
  10892. declare class NoEmitOnErrorsPlugin {
  10893. constructor();
  10894. /**
  10895. * Apply the plugin
  10896. */
  10897. apply(compiler: Compiler): void;
  10898. }
  10899. type Node = false | NodeOptions;
  10900. declare class NodeEnvironmentPlugin {
  10901. constructor(options: NodeEnvironmentPluginOptions);
  10902. options: NodeEnvironmentPluginOptions;
  10903. /**
  10904. * Apply the plugin
  10905. */
  10906. apply(compiler: Compiler): void;
  10907. }
  10908. declare interface NodeEnvironmentPluginOptions {
  10909. /**
  10910. * infrastructure logging options
  10911. */
  10912. infrastructureLogging: InfrastructureLogging;
  10913. }
  10914. /**
  10915. * Options object for node compatibility features.
  10916. */
  10917. declare interface NodeOptions {
  10918. /**
  10919. * Include a polyfill for the '__dirname' variable.
  10920. */
  10921. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  10922. /**
  10923. * Include a polyfill for the '__filename' variable.
  10924. */
  10925. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  10926. /**
  10927. * Include a polyfill for the 'global' variable.
  10928. */
  10929. global?: boolean | "warn";
  10930. }
  10931. declare class NodeSourcePlugin {
  10932. constructor();
  10933. /**
  10934. * Apply the plugin
  10935. */
  10936. apply(compiler: Compiler): void;
  10937. }
  10938. declare class NodeTargetPlugin {
  10939. constructor(type?: ExternalsType);
  10940. type: ExternalsType;
  10941. /**
  10942. * Apply the plugin
  10943. */
  10944. apply(compiler: Compiler): void;
  10945. }
  10946. declare class NodeTemplatePlugin {
  10947. constructor(options?: NodeTemplatePluginOptions);
  10948. /**
  10949. * Apply the plugin
  10950. */
  10951. apply(compiler: Compiler): void;
  10952. }
  10953. declare interface NodeTemplatePluginOptions {
  10954. /**
  10955. * enable async chunk loading
  10956. */
  10957. asyncChunkLoading?: boolean;
  10958. }
  10959. type NonNullable<T> = T & {};
  10960. declare class NormalModule extends Module {
  10961. constructor(__0: NormalModuleCreateData);
  10962. request: string;
  10963. userRequest: string;
  10964. rawRequest: string;
  10965. binary: boolean;
  10966. parser?: ParserClass;
  10967. parserOptions?: ParserOptions;
  10968. generator?: Generator;
  10969. generatorOptions?: GeneratorOptions;
  10970. resource: string;
  10971. resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
  10972. matchResource?: string;
  10973. loaders: LoaderItem[];
  10974. extractSourceMap: boolean;
  10975. error: null | WebpackError;
  10976. getResource(): null | string;
  10977. /**
  10978. * restore unsafe cache data
  10979. */
  10980. restoreFromUnsafeCache(
  10981. unsafeCacheData: UnsafeCacheData,
  10982. normalModuleFactory: NormalModuleFactory
  10983. ): void;
  10984. createSourceForAsset(
  10985. context: string,
  10986. name: string,
  10987. content: string | Buffer,
  10988. sourceMap?: string | RawSourceMap,
  10989. associatedObjectForCache?: object
  10990. ): Source;
  10991. getCurrentLoader(
  10992. loaderContext: AnyLoaderContext,
  10993. index?: number
  10994. ): null | LoaderItem;
  10995. createSource(
  10996. context: string,
  10997. content: string | Buffer,
  10998. sourceMap?: null | string | RawSourceMap,
  10999. associatedObjectForCache?: object
  11000. ): Source;
  11001. markModuleAsErrored(error: WebpackError): void;
  11002. applyNoParseRule(
  11003. rule: string | RegExp | ((content: string) => boolean),
  11004. content: string
  11005. ): boolean;
  11006. shouldPreventParsing(
  11007. noParseRule:
  11008. | undefined
  11009. | string
  11010. | RegExp
  11011. | ((content: string) => boolean)
  11012. | (string | RegExp | ((content: string) => boolean))[],
  11013. request: string
  11014. ): boolean;
  11015. static getCompilationHooks(
  11016. compilation: Compilation
  11017. ): NormalModuleCompilationHooks;
  11018. static deserialize(context: ObjectDeserializerContext): NormalModule;
  11019. }
  11020. declare interface NormalModuleCompilationHooks {
  11021. loader: SyncHook<[AnyLoaderContext, NormalModule]>;
  11022. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, AnyLoaderContext]>;
  11023. beforeParse: SyncHook<[NormalModule]>;
  11024. beforeSnapshot: SyncHook<[NormalModule]>;
  11025. readResourceForScheme: HookMap<
  11026. FakeHook<
  11027. AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
  11028. >
  11029. >;
  11030. readResource: HookMap<
  11031. AsyncSeriesBailHook<[AnyLoaderContext], null | string | Buffer>
  11032. >;
  11033. processResult: SyncWaterfallHook<
  11034. [
  11035. [
  11036. string | Buffer,
  11037. undefined | string | RawSourceMap,
  11038. undefined | PreparsedAst
  11039. ],
  11040. NormalModule
  11041. ],
  11042. [
  11043. string | Buffer,
  11044. undefined | string | RawSourceMap,
  11045. undefined | PreparsedAst
  11046. ]
  11047. >;
  11048. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  11049. }
  11050. declare interface NormalModuleCreateData {
  11051. /**
  11052. * an optional layer in which the module is
  11053. */
  11054. layer?: string;
  11055. /**
  11056. * module type. When deserializing, this is set to an empty string "".
  11057. */
  11058. type: string;
  11059. /**
  11060. * request string
  11061. */
  11062. request: string;
  11063. /**
  11064. * request intended by user (without loaders from config)
  11065. */
  11066. userRequest: string;
  11067. /**
  11068. * request without resolving
  11069. */
  11070. rawRequest: string;
  11071. /**
  11072. * list of loaders
  11073. */
  11074. loaders: LoaderItem[];
  11075. /**
  11076. * path + query of the real resource
  11077. */
  11078. resource: string;
  11079. /**
  11080. * resource resolve data
  11081. */
  11082. resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
  11083. /**
  11084. * context directory for resolving
  11085. */
  11086. context: string;
  11087. /**
  11088. * path + query of the matched resource (virtual)
  11089. */
  11090. matchResource?: string;
  11091. /**
  11092. * the parser used
  11093. */
  11094. parser: ParserClass;
  11095. /**
  11096. * the options of the parser used
  11097. */
  11098. parserOptions?: ParserOptions;
  11099. /**
  11100. * the generator used
  11101. */
  11102. generator: Generator;
  11103. /**
  11104. * the options of the generator used
  11105. */
  11106. generatorOptions?: GeneratorOptions;
  11107. /**
  11108. * options used for resolving requests from this module
  11109. */
  11110. resolveOptions?: ResolveOptions;
  11111. /**
  11112. * enable/disable extracting source map
  11113. */
  11114. extractSourceMap: boolean;
  11115. }
  11116. declare abstract class NormalModuleFactory extends ModuleFactory {
  11117. hooks: Readonly<{
  11118. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  11119. resolveForScheme: HookMap<
  11120. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  11121. >;
  11122. resolveInScheme: HookMap<
  11123. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  11124. >;
  11125. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  11126. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  11127. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  11128. createModule: AsyncSeriesBailHook<
  11129. [
  11130. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  11131. ResolveData
  11132. ],
  11133. void | Module
  11134. >;
  11135. module: SyncWaterfallHook<
  11136. [
  11137. Module,
  11138. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  11139. ResolveData
  11140. ],
  11141. Module
  11142. >;
  11143. createParser: TypedHookMap<
  11144. Record<
  11145. "javascript/auto",
  11146. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  11147. > &
  11148. Record<
  11149. "javascript/dynamic",
  11150. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  11151. > &
  11152. Record<
  11153. "javascript/esm",
  11154. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  11155. > &
  11156. Record<"json", SyncBailHook<[JsonParserOptions], JsonParser>> &
  11157. Record<"asset", SyncBailHook<[AssetParserOptions], AssetParser>> &
  11158. Record<
  11159. "asset/inline",
  11160. SyncBailHook<[EmptyParserOptions], AssetParser>
  11161. > &
  11162. Record<
  11163. "asset/resource",
  11164. SyncBailHook<[EmptyParserOptions], AssetParser>
  11165. > &
  11166. Record<
  11167. "asset/source",
  11168. SyncBailHook<[EmptyParserOptions], AssetSourceParser>
  11169. > &
  11170. Record<
  11171. "asset/bytes",
  11172. SyncBailHook<[EmptyParserOptions], AssetBytesParser>
  11173. > &
  11174. Record<
  11175. "webassembly/async",
  11176. SyncBailHook<[EmptyParserOptions], AsyncWebAssemblyParser>
  11177. > &
  11178. Record<
  11179. "webassembly/sync",
  11180. SyncBailHook<[EmptyParserOptions], WebAssemblyParser>
  11181. > &
  11182. Record<"css", SyncBailHook<[CssParserOptions], CssParser>> &
  11183. Record<"css/auto", SyncBailHook<[CssModuleParserOptions], CssParser>> &
  11184. Record<
  11185. "css/module",
  11186. SyncBailHook<[CssModuleParserOptions], CssParser>
  11187. > &
  11188. Record<
  11189. "css/global",
  11190. SyncBailHook<[CssModuleParserOptions], CssParser>
  11191. > &
  11192. Record<string, SyncBailHook<[ParserOptions], ParserClass>>
  11193. >;
  11194. parser: TypedHookMap<
  11195. Record<
  11196. "javascript/auto",
  11197. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  11198. > &
  11199. Record<
  11200. "javascript/dynamic",
  11201. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  11202. > &
  11203. Record<
  11204. "javascript/esm",
  11205. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  11206. > &
  11207. Record<"json", SyncBailHook<[JsonParser, JsonParserOptions], void>> &
  11208. Record<"asset", SyncBailHook<[AssetParser, AssetParserOptions], void>> &
  11209. Record<
  11210. "asset/inline",
  11211. SyncBailHook<[AssetParser, EmptyParserOptions], void>
  11212. > &
  11213. Record<
  11214. "asset/resource",
  11215. SyncBailHook<[AssetParser, EmptyParserOptions], void>
  11216. > &
  11217. Record<
  11218. "asset/source",
  11219. SyncBailHook<[AssetSourceParser, EmptyParserOptions], void>
  11220. > &
  11221. Record<
  11222. "asset/bytes",
  11223. SyncBailHook<[AssetBytesParser, EmptyParserOptions], void>
  11224. > &
  11225. Record<
  11226. "webassembly/async",
  11227. SyncBailHook<[AsyncWebAssemblyParser, EmptyParserOptions], void>
  11228. > &
  11229. Record<
  11230. "webassembly/sync",
  11231. SyncBailHook<[WebAssemblyParser, EmptyParserOptions], void>
  11232. > &
  11233. Record<"css", SyncBailHook<[CssParser, CssParserOptions], void>> &
  11234. Record<
  11235. "css/auto",
  11236. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11237. > &
  11238. Record<
  11239. "css/module",
  11240. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11241. > &
  11242. Record<
  11243. "css/global",
  11244. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11245. > &
  11246. Record<string, SyncBailHook<[ParserClass, ParserOptions], void>>
  11247. >;
  11248. createGenerator: TypedHookMap<
  11249. Record<
  11250. "javascript/auto",
  11251. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11252. > &
  11253. Record<
  11254. "javascript/dynamic",
  11255. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11256. > &
  11257. Record<
  11258. "javascript/esm",
  11259. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11260. > &
  11261. Record<"json", SyncBailHook<[JsonGeneratorOptions], JsonGenerator>> &
  11262. Record<"asset", SyncBailHook<[AssetGeneratorOptions], AssetGenerator>> &
  11263. Record<
  11264. "asset/inline",
  11265. SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
  11266. > &
  11267. Record<
  11268. "asset/resource",
  11269. SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
  11270. > &
  11271. Record<
  11272. "asset/source",
  11273. SyncBailHook<[EmptyGeneratorOptions], AssetSourceGenerator>
  11274. > &
  11275. Record<
  11276. "asset/bytes",
  11277. SyncBailHook<[EmptyGeneratorOptions], AssetBytesGenerator>
  11278. > &
  11279. Record<
  11280. "webassembly/async",
  11281. SyncBailHook<[EmptyParserOptions], Generator>
  11282. > &
  11283. Record<
  11284. "webassembly/sync",
  11285. SyncBailHook<[EmptyParserOptions], Generator>
  11286. > &
  11287. Record<"css", SyncBailHook<[CssGeneratorOptions], CssGenerator>> &
  11288. Record<
  11289. "css/auto",
  11290. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11291. > &
  11292. Record<
  11293. "css/module",
  11294. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11295. > &
  11296. Record<
  11297. "css/global",
  11298. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11299. > &
  11300. Record<string, SyncBailHook<[GeneratorOptions], Generator>>
  11301. >;
  11302. generator: TypedHookMap<
  11303. Record<
  11304. "javascript/auto",
  11305. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11306. > &
  11307. Record<
  11308. "javascript/dynamic",
  11309. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11310. > &
  11311. Record<
  11312. "javascript/esm",
  11313. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11314. > &
  11315. Record<
  11316. "json",
  11317. SyncBailHook<[JsonGenerator, JsonGeneratorOptions], void>
  11318. > &
  11319. Record<
  11320. "asset",
  11321. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11322. > &
  11323. Record<
  11324. "asset/inline",
  11325. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11326. > &
  11327. Record<
  11328. "asset/resource",
  11329. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11330. > &
  11331. Record<
  11332. "asset/source",
  11333. SyncBailHook<[AssetSourceGenerator, EmptyGeneratorOptions], void>
  11334. > &
  11335. Record<
  11336. "asset/bytes",
  11337. SyncBailHook<[AssetBytesGenerator, EmptyGeneratorOptions], void>
  11338. > &
  11339. Record<
  11340. "webassembly/async",
  11341. SyncBailHook<[Generator, EmptyParserOptions], void>
  11342. > &
  11343. Record<
  11344. "webassembly/sync",
  11345. SyncBailHook<[Generator, EmptyParserOptions], void>
  11346. > &
  11347. Record<"css", SyncBailHook<[CssGenerator, CssGeneratorOptions], void>> &
  11348. Record<
  11349. "css/auto",
  11350. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11351. > &
  11352. Record<
  11353. "css/module",
  11354. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11355. > &
  11356. Record<
  11357. "css/global",
  11358. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11359. > &
  11360. Record<string, SyncBailHook<[Generator, GeneratorOptions], void>>
  11361. >;
  11362. createModuleClass: HookMap<
  11363. SyncBailHook<
  11364. [
  11365. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  11366. ResolveData
  11367. ],
  11368. void | Module
  11369. >
  11370. >;
  11371. }>;
  11372. resolverFactory: ResolverFactory;
  11373. ruleSet: RuleSet;
  11374. context: string;
  11375. fs: InputFileSystem;
  11376. parserCache: Map<string, WeakMap<ParserOptions, ParserClass>>;
  11377. generatorCache: Map<string, WeakMap<GeneratorOptions, Generator>>;
  11378. cleanupForCache(): void;
  11379. resolveResource(
  11380. contextInfo: ModuleFactoryCreateDataContextInfo,
  11381. context: string,
  11382. unresolvedResource: string,
  11383. resolver: ResolverWithOptions,
  11384. resolveContext: ResolveContext,
  11385. callback: (
  11386. err: null | Error,
  11387. res?: string | false,
  11388. req?: ResolveRequest
  11389. ) => void
  11390. ): void;
  11391. resolveRequestArray(
  11392. contextInfo: ModuleFactoryCreateDataContextInfo,
  11393. context: string,
  11394. array: LoaderItem[],
  11395. resolver: ResolverWithOptions,
  11396. resolveContext: ResolveContext,
  11397. callback: CallbackWebpackFunction_1<LoaderItem[]>
  11398. ): void;
  11399. getParser(type: string, parserOptions?: ParserOptions): ParserClass;
  11400. createParser(type: string, parserOptions?: ParserOptions): ParserClass;
  11401. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  11402. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  11403. getResolver(
  11404. type: string,
  11405. resolveOptions?: ResolveOptionsWithDependencyType
  11406. ): ResolverWithOptions;
  11407. }
  11408. /**
  11409. * These properties are added by the NormalModule
  11410. */
  11411. declare interface NormalModuleLoaderContext<OptionsType> {
  11412. version: number;
  11413. getOptions(): OptionsType;
  11414. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  11415. emitWarning(warning: Error): void;
  11416. emitError(error: Error): void;
  11417. getLogger(name?: string): WebpackLogger;
  11418. resolve(
  11419. context: string,
  11420. request: string,
  11421. callback: (
  11422. err: null | ErrorWithDetail,
  11423. res?: string | false,
  11424. req?: ResolveRequest
  11425. ) => void
  11426. ): void;
  11427. getResolve(options?: ResolveOptionsWithDependencyType): {
  11428. (
  11429. context: string,
  11430. request: string,
  11431. callback: (
  11432. err: null | ErrorWithDetail,
  11433. res?: string | false,
  11434. req?: ResolveRequest
  11435. ) => void
  11436. ): void;
  11437. (context: string, request: string): Promise<string>;
  11438. };
  11439. emitFile(
  11440. name: string,
  11441. content: string | Buffer,
  11442. sourceMap?: string,
  11443. assetInfo?: AssetInfo
  11444. ): void;
  11445. addBuildDependency(dep: string): void;
  11446. utils: {
  11447. absolutify: (context: string, request: string) => string;
  11448. contextify: (context: string, request: string) => string;
  11449. createHash: (algorithm?: string | typeof Hash) => Hash;
  11450. };
  11451. rootContext: string;
  11452. fs: InputFileSystem;
  11453. sourceMap?: boolean;
  11454. mode: "none" | "development" | "production";
  11455. webpack?: boolean;
  11456. hashFunction: HashFunction;
  11457. hashDigest: string;
  11458. hashDigestLength: number;
  11459. hashSalt?: string;
  11460. _module?: NormalModule;
  11461. _compilation?: Compilation;
  11462. _compiler?: Compiler;
  11463. }
  11464. declare class NormalModuleReplacementPlugin {
  11465. /**
  11466. * Create an instance of the plugin
  11467. */
  11468. constructor(
  11469. resourceRegExp: RegExp,
  11470. newResource: string | ((resolveData: ResolveData) => void)
  11471. );
  11472. resourceRegExp: RegExp;
  11473. newResource: string | ((resolveData: ResolveData) => void);
  11474. /**
  11475. * Apply the plugin
  11476. */
  11477. apply(compiler: Compiler): void;
  11478. }
  11479. declare abstract class NormalReexportItem {
  11480. name: string;
  11481. ids: string[];
  11482. exportInfo: ExportInfo;
  11483. checked: boolean;
  11484. hidden: boolean;
  11485. }
  11486. declare interface NormalizedModules {
  11487. [index: string]: VirtualModuleConfig;
  11488. }
  11489. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  11490. Omit<
  11491. StatsOptions,
  11492. | "context"
  11493. | "chunkGroups"
  11494. | "requestShortener"
  11495. | "chunksSort"
  11496. | "modulesSort"
  11497. | "chunkModulesSort"
  11498. | "nestedModulesSort"
  11499. | "assetsSort"
  11500. | "ids"
  11501. | "cachedAssets"
  11502. | "groupAssetsByEmitStatus"
  11503. | "groupAssetsByPath"
  11504. | "groupAssetsByExtension"
  11505. | "assetsSpace"
  11506. | "excludeAssets"
  11507. | "excludeModules"
  11508. | "warningsFilter"
  11509. | "cachedModules"
  11510. | "orphanModules"
  11511. | "dependentModules"
  11512. | "runtimeModules"
  11513. | "groupModulesByCacheStatus"
  11514. | "groupModulesByLayer"
  11515. | "groupModulesByAttributes"
  11516. | "groupModulesByPath"
  11517. | "groupModulesByExtension"
  11518. | "groupModulesByType"
  11519. | "entrypoints"
  11520. | "chunkGroupAuxiliary"
  11521. | "chunkGroupChildren"
  11522. | "chunkGroupMaxAssets"
  11523. | "modulesSpace"
  11524. | "chunkModulesSpace"
  11525. | "nestedModulesSpace"
  11526. | "logging"
  11527. | "loggingDebug"
  11528. | "loggingTrace"
  11529. | "_env"
  11530. > &
  11531. Record<string, any>;
  11532. declare class NullDependency extends Dependency {
  11533. constructor();
  11534. static Template: typeof NullDependencyTemplate;
  11535. static NO_EXPORTS_REFERENCED: string[][];
  11536. static EXPORTS_OBJECT_REFERENCED: string[][];
  11537. static isLowPriorityDependency(dependency: Dependency): boolean;
  11538. static TRANSITIVE: typeof TRANSITIVE;
  11539. }
  11540. declare class NullDependencyTemplate extends DependencyTemplate {
  11541. constructor();
  11542. }
  11543. declare interface ObjectConfiguration {
  11544. [index: string]: any;
  11545. }
  11546. declare interface ObjectDeserializerContext {
  11547. read: () => any;
  11548. setCircularReference: (value: ReferenceableItem) => void;
  11549. }
  11550. declare interface ObjectEncodingOptions {
  11551. encoding?:
  11552. | null
  11553. | "ascii"
  11554. | "utf8"
  11555. | "utf-8"
  11556. | "utf16le"
  11557. | "utf-16le"
  11558. | "ucs2"
  11559. | "ucs-2"
  11560. | "base64"
  11561. | "base64url"
  11562. | "latin1"
  11563. | "binary"
  11564. | "hex";
  11565. }
  11566. declare interface ObjectSerializer {
  11567. serialize: (value: any, context: ObjectSerializerContext) => void;
  11568. deserialize: (context: ObjectDeserializerContext) => any;
  11569. }
  11570. declare interface ObjectSerializerContext {
  11571. write: (value?: any) => void;
  11572. setCircularReference: (value: ReferenceableItem) => void;
  11573. snapshot: () => ObjectSerializerSnapshot;
  11574. rollback: (snapshot: ObjectSerializerSnapshot) => void;
  11575. writeLazy?: (item?: any) => void;
  11576. writeSeparate?: (
  11577. item: any,
  11578. obj?: LazyOptions
  11579. ) => LazyFunction<any, any, any, LazyOptions>;
  11580. }
  11581. declare interface ObjectSerializerSnapshot {
  11582. length: number;
  11583. cycleStackSize: number;
  11584. referenceableSize: number;
  11585. currentPos: number;
  11586. objectTypeLookupSize: number;
  11587. currentPosTypeLookup: number;
  11588. }
  11589. declare class OccurrenceChunkIdsPlugin {
  11590. constructor(options?: OccurrenceChunkIdsPluginOptions);
  11591. options: OccurrenceChunkIdsPluginOptions;
  11592. /**
  11593. * Apply the plugin
  11594. */
  11595. apply(compiler: Compiler): void;
  11596. }
  11597. declare interface OccurrenceChunkIdsPluginOptions {
  11598. /**
  11599. * Prioritise initial size over total size.
  11600. */
  11601. prioritiseInitial?: boolean;
  11602. }
  11603. declare class OccurrenceModuleIdsPlugin {
  11604. constructor(options?: OccurrenceModuleIdsPluginOptions);
  11605. options: OccurrenceModuleIdsPluginOptions;
  11606. /**
  11607. * Apply the plugin
  11608. */
  11609. apply(compiler: Compiler): void;
  11610. }
  11611. declare interface OccurrenceModuleIdsPluginOptions {
  11612. /**
  11613. * Prioritise initial size over total size.
  11614. */
  11615. prioritiseInitial?: boolean;
  11616. }
  11617. declare interface OnlySafeTimeEntry {
  11618. safeTime: number;
  11619. }
  11620. declare interface Open {
  11621. (
  11622. file: PathLikeFs,
  11623. flags: undefined | string | number,
  11624. mode: undefined | null | string | number,
  11625. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11626. ): void;
  11627. (
  11628. file: PathLikeFs,
  11629. flags: undefined | string | number,
  11630. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11631. ): void;
  11632. (
  11633. file: PathLikeFs,
  11634. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11635. ): void;
  11636. }
  11637. /**
  11638. * Enables/Disables integrated optimizations.
  11639. */
  11640. declare interface Optimization {
  11641. /**
  11642. * Avoid wrapping the entry module in an IIFE.
  11643. */
  11644. avoidEntryIife?: boolean;
  11645. /**
  11646. * Check for incompatible wasm types when importing/exporting from/to ESM.
  11647. */
  11648. checkWasmTypes?: boolean;
  11649. /**
  11650. * 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).
  11651. */
  11652. chunkIds?:
  11653. | false
  11654. | "natural"
  11655. | "named"
  11656. | "deterministic"
  11657. | "size"
  11658. | "total-size";
  11659. /**
  11660. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  11661. */
  11662. concatenateModules?: boolean;
  11663. /**
  11664. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  11665. */
  11666. emitOnErrors?: boolean;
  11667. /**
  11668. * Also flag chunks as loaded which contain a subset of the modules.
  11669. */
  11670. flagIncludedChunks?: boolean;
  11671. /**
  11672. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  11673. */
  11674. innerGraph?: boolean;
  11675. /**
  11676. * 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).
  11677. */
  11678. mangleExports?: boolean | "deterministic" | "size";
  11679. /**
  11680. * Reduce size of WASM by changing imports to shorter strings.
  11681. */
  11682. mangleWasmImports?: boolean;
  11683. /**
  11684. * Merge chunks which contain the same modules.
  11685. */
  11686. mergeDuplicateChunks?: boolean;
  11687. /**
  11688. * Enable minimizing the output. Uses optimization.minimizer.
  11689. */
  11690. minimize?: boolean;
  11691. /**
  11692. * Minimizer(s) to use for minimizing the output.
  11693. */
  11694. minimizer?: (
  11695. | undefined
  11696. | null
  11697. | false
  11698. | ""
  11699. | 0
  11700. | ((this: Compiler, compiler: Compiler) => void)
  11701. | WebpackPluginInstance
  11702. | "..."
  11703. )[];
  11704. /**
  11705. * 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).
  11706. */
  11707. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  11708. /**
  11709. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  11710. */
  11711. noEmitOnErrors?: boolean;
  11712. /**
  11713. * Set process.env.NODE_ENV to a specific value.
  11714. */
  11715. nodeEnv?: string | false;
  11716. /**
  11717. * Generate records with relative paths to be able to move the context folder.
  11718. */
  11719. portableRecords?: boolean;
  11720. /**
  11721. * Figure out which exports are provided by modules to generate more efficient code.
  11722. */
  11723. providedExports?: boolean;
  11724. /**
  11725. * Use real [contenthash] based on final content of the assets.
  11726. */
  11727. realContentHash?: boolean;
  11728. /**
  11729. * Removes modules from chunks when these modules are already included in all parents.
  11730. */
  11731. removeAvailableModules?: boolean;
  11732. /**
  11733. * Remove chunks which are empty.
  11734. */
  11735. removeEmptyChunks?: boolean;
  11736. /**
  11737. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  11738. */
  11739. runtimeChunk?:
  11740. | boolean
  11741. | "single"
  11742. | "multiple"
  11743. | {
  11744. /**
  11745. * The name or name factory for the runtime chunks.
  11746. */
  11747. name?: string | ((entrypoint: { name: string }) => string);
  11748. };
  11749. /**
  11750. * 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).
  11751. */
  11752. sideEffects?: boolean | "flag";
  11753. /**
  11754. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  11755. */
  11756. splitChunks?: false | OptimizationSplitChunksOptions;
  11757. /**
  11758. * 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).
  11759. */
  11760. usedExports?: boolean | "global";
  11761. }
  11762. /**
  11763. * Enables/Disables integrated optimizations.
  11764. */
  11765. declare interface OptimizationNormalized {
  11766. /**
  11767. * Avoid wrapping the entry module in an IIFE.
  11768. */
  11769. avoidEntryIife?: boolean;
  11770. /**
  11771. * Check for incompatible wasm types when importing/exporting from/to ESM.
  11772. */
  11773. checkWasmTypes?: boolean;
  11774. /**
  11775. * 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).
  11776. */
  11777. chunkIds?:
  11778. | false
  11779. | "natural"
  11780. | "named"
  11781. | "deterministic"
  11782. | "size"
  11783. | "total-size";
  11784. /**
  11785. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  11786. */
  11787. concatenateModules?: boolean;
  11788. /**
  11789. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  11790. */
  11791. emitOnErrors?: boolean;
  11792. /**
  11793. * Also flag chunks as loaded which contain a subset of the modules.
  11794. */
  11795. flagIncludedChunks?: boolean;
  11796. /**
  11797. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  11798. */
  11799. innerGraph?: boolean;
  11800. /**
  11801. * 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).
  11802. */
  11803. mangleExports?: boolean | "deterministic" | "size";
  11804. /**
  11805. * Reduce size of WASM by changing imports to shorter strings.
  11806. */
  11807. mangleWasmImports?: boolean;
  11808. /**
  11809. * Merge chunks which contain the same modules.
  11810. */
  11811. mergeDuplicateChunks?: boolean;
  11812. /**
  11813. * Enable minimizing the output. Uses optimization.minimizer.
  11814. */
  11815. minimize?: boolean;
  11816. /**
  11817. * Minimizer(s) to use for minimizing the output.
  11818. */
  11819. minimizer?: (
  11820. | ((this: Compiler, compiler: Compiler) => void)
  11821. | WebpackPluginInstance
  11822. | "..."
  11823. )[];
  11824. /**
  11825. * 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).
  11826. */
  11827. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  11828. /**
  11829. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  11830. */
  11831. noEmitOnErrors?: boolean;
  11832. /**
  11833. * Set process.env.NODE_ENV to a specific value.
  11834. */
  11835. nodeEnv?: string | false;
  11836. /**
  11837. * Generate records with relative paths to be able to move the context folder.
  11838. */
  11839. portableRecords?: boolean;
  11840. /**
  11841. * Figure out which exports are provided by modules to generate more efficient code.
  11842. */
  11843. providedExports?: boolean;
  11844. /**
  11845. * Use real [contenthash] based on final content of the assets.
  11846. */
  11847. realContentHash?: boolean;
  11848. /**
  11849. * Removes modules from chunks when these modules are already included in all parents.
  11850. */
  11851. removeAvailableModules?: boolean;
  11852. /**
  11853. * Remove chunks which are empty.
  11854. */
  11855. removeEmptyChunks?: boolean;
  11856. /**
  11857. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  11858. */
  11859. runtimeChunk?:
  11860. | false
  11861. | {
  11862. /**
  11863. * The name factory for the runtime chunks.
  11864. */
  11865. name?: (entrypoint: { name: string }) => string;
  11866. };
  11867. /**
  11868. * 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).
  11869. */
  11870. sideEffects?: boolean | "flag";
  11871. /**
  11872. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  11873. */
  11874. splitChunks?: false | OptimizationSplitChunksOptions;
  11875. /**
  11876. * 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).
  11877. */
  11878. usedExports?: boolean | "global";
  11879. }
  11880. type OptimizationNormalizedWithDefaults = OptimizationNormalized & {
  11881. runtimeChunk: NonNullable<
  11882. | undefined
  11883. | false
  11884. | {
  11885. /**
  11886. * The name factory for the runtime chunks.
  11887. */
  11888. name?: (entrypoint: { name: string }) => string;
  11889. }
  11890. >;
  11891. splitChunks: NonNullable<undefined | false | OptimizationSplitChunksOptions>;
  11892. mergeDuplicateChunks: NonNullable<undefined | boolean>;
  11893. removeAvailableModules: NonNullable<undefined | boolean>;
  11894. removeEmptyChunks: NonNullable<undefined | boolean>;
  11895. flagIncludedChunks: NonNullable<undefined | boolean>;
  11896. moduleIds: NonNullable<
  11897. | undefined
  11898. | false
  11899. | "natural"
  11900. | "named"
  11901. | "deterministic"
  11902. | "size"
  11903. | "hashed"
  11904. >;
  11905. chunkIds: NonNullable<
  11906. | undefined
  11907. | false
  11908. | "natural"
  11909. | "named"
  11910. | "deterministic"
  11911. | "size"
  11912. | "total-size"
  11913. >;
  11914. sideEffects: NonNullable<undefined | boolean | "flag">;
  11915. providedExports: NonNullable<undefined | boolean>;
  11916. usedExports: NonNullable<undefined | boolean | "global">;
  11917. mangleExports: NonNullable<undefined | boolean | "deterministic" | "size">;
  11918. innerGraph: NonNullable<undefined | boolean>;
  11919. concatenateModules: NonNullable<undefined | boolean>;
  11920. avoidEntryIife: NonNullable<undefined | boolean>;
  11921. emitOnErrors: NonNullable<undefined | boolean>;
  11922. checkWasmTypes: NonNullable<undefined | boolean>;
  11923. mangleWasmImports: NonNullable<undefined | boolean>;
  11924. portableRecords: NonNullable<undefined | boolean>;
  11925. realContentHash: NonNullable<undefined | boolean>;
  11926. minimize: NonNullable<undefined | boolean>;
  11927. minimizer: (
  11928. | ((this: Compiler, compiler: Compiler) => void)
  11929. | WebpackPluginInstance
  11930. | "..."
  11931. )[];
  11932. nodeEnv: NonNullable<undefined | string | false>;
  11933. };
  11934. /**
  11935. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  11936. */
  11937. declare interface OptimizationSplitChunksCacheGroup {
  11938. /**
  11939. * Sets the name delimiter for created chunks.
  11940. */
  11941. automaticNameDelimiter?: string;
  11942. /**
  11943. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  11944. */
  11945. chunks?:
  11946. | RegExp
  11947. | "all"
  11948. | "initial"
  11949. | "async"
  11950. | ((chunk: Chunk) => undefined | boolean);
  11951. /**
  11952. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  11953. */
  11954. enforce?: boolean;
  11955. /**
  11956. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  11957. */
  11958. enforceSizeThreshold?: number | { [index: string]: number };
  11959. /**
  11960. * Sets the template for the filename for created chunks.
  11961. */
  11962. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  11963. /**
  11964. * Sets the hint for chunk id.
  11965. */
  11966. idHint?: string;
  11967. /**
  11968. * Assign modules to a cache group by module layer.
  11969. */
  11970. layer?: string | RegExp | ((layer: null | string) => boolean);
  11971. /**
  11972. * Maximum number of requests which are accepted for on-demand loading.
  11973. */
  11974. maxAsyncRequests?: number;
  11975. /**
  11976. * Maximal size hint for the on-demand chunks.
  11977. */
  11978. maxAsyncSize?: number | { [index: string]: number };
  11979. /**
  11980. * Maximum number of initial chunks which are accepted for an entry point.
  11981. */
  11982. maxInitialRequests?: number;
  11983. /**
  11984. * Maximal size hint for the initial chunks.
  11985. */
  11986. maxInitialSize?: number | { [index: string]: number };
  11987. /**
  11988. * Maximal size hint for the created chunks.
  11989. */
  11990. maxSize?: number | { [index: string]: number };
  11991. /**
  11992. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  11993. */
  11994. minChunks?: number;
  11995. /**
  11996. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  11997. */
  11998. minRemainingSize?: number | { [index: string]: number };
  11999. /**
  12000. * Minimal size for the created chunk.
  12001. */
  12002. minSize?: number | { [index: string]: number };
  12003. /**
  12004. * Minimum size reduction due to the created chunk.
  12005. */
  12006. minSizeReduction?: number | { [index: string]: number };
  12007. /**
  12008. * Give chunks for this cache group a name (chunks with equal name are merged).
  12009. */
  12010. name?:
  12011. | string
  12012. | false
  12013. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  12014. /**
  12015. * Priority of this cache group.
  12016. */
  12017. priority?: number;
  12018. /**
  12019. * Try to reuse existing chunk (with name) when it has matching modules.
  12020. */
  12021. reuseExistingChunk?: boolean;
  12022. /**
  12023. * Assign modules to a cache group by module name.
  12024. */
  12025. test?:
  12026. | string
  12027. | RegExp
  12028. | ((module: Module, context: CacheGroupsContext) => boolean);
  12029. /**
  12030. * Assign modules to a cache group by module type.
  12031. */
  12032. type?: string | RegExp | ((type: string) => boolean);
  12033. /**
  12034. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  12035. */
  12036. usedExports?: boolean;
  12037. }
  12038. /**
  12039. * Options object for splitting chunks into smaller chunks.
  12040. */
  12041. declare interface OptimizationSplitChunksOptions {
  12042. /**
  12043. * Sets the name delimiter for created chunks.
  12044. */
  12045. automaticNameDelimiter?: string;
  12046. /**
  12047. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  12048. */
  12049. cacheGroups?: {
  12050. [index: string]:
  12051. | string
  12052. | false
  12053. | RegExp
  12054. | ((
  12055. module: Module
  12056. ) =>
  12057. | void
  12058. | OptimizationSplitChunksCacheGroup
  12059. | OptimizationSplitChunksCacheGroup[])
  12060. | OptimizationSplitChunksCacheGroup;
  12061. };
  12062. /**
  12063. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  12064. */
  12065. chunks?:
  12066. | RegExp
  12067. | "all"
  12068. | "initial"
  12069. | "async"
  12070. | ((chunk: Chunk) => undefined | boolean);
  12071. /**
  12072. * Sets the size types which are used when a number is used for sizes.
  12073. */
  12074. defaultSizeTypes?: string[];
  12075. /**
  12076. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  12077. */
  12078. enforceSizeThreshold?: number | { [index: string]: number };
  12079. /**
  12080. * Options for modules not selected by any other cache group.
  12081. */
  12082. fallbackCacheGroup?: {
  12083. /**
  12084. * Sets the name delimiter for created chunks.
  12085. */
  12086. automaticNameDelimiter?: string;
  12087. /**
  12088. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  12089. */
  12090. chunks?:
  12091. | RegExp
  12092. | "all"
  12093. | "initial"
  12094. | "async"
  12095. | ((chunk: Chunk) => undefined | boolean);
  12096. /**
  12097. * Maximal size hint for the on-demand chunks.
  12098. */
  12099. maxAsyncSize?: number | { [index: string]: number };
  12100. /**
  12101. * Maximal size hint for the initial chunks.
  12102. */
  12103. maxInitialSize?: number | { [index: string]: number };
  12104. /**
  12105. * Maximal size hint for the created chunks.
  12106. */
  12107. maxSize?: number | { [index: string]: number };
  12108. /**
  12109. * Minimal size for the created chunk.
  12110. */
  12111. minSize?: number | { [index: string]: number };
  12112. /**
  12113. * Minimum size reduction due to the created chunk.
  12114. */
  12115. minSizeReduction?: number | { [index: string]: number };
  12116. };
  12117. /**
  12118. * Sets the template for the filename for created chunks.
  12119. */
  12120. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12121. /**
  12122. * Prevents exposing path info when creating names for parts splitted by maxSize.
  12123. */
  12124. hidePathInfo?: boolean;
  12125. /**
  12126. * Maximum number of requests which are accepted for on-demand loading.
  12127. */
  12128. maxAsyncRequests?: number;
  12129. /**
  12130. * Maximal size hint for the on-demand chunks.
  12131. */
  12132. maxAsyncSize?: number | { [index: string]: number };
  12133. /**
  12134. * Maximum number of initial chunks which are accepted for an entry point.
  12135. */
  12136. maxInitialRequests?: number;
  12137. /**
  12138. * Maximal size hint for the initial chunks.
  12139. */
  12140. maxInitialSize?: number | { [index: string]: number };
  12141. /**
  12142. * Maximal size hint for the created chunks.
  12143. */
  12144. maxSize?: number | { [index: string]: number };
  12145. /**
  12146. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  12147. */
  12148. minChunks?: number;
  12149. /**
  12150. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  12151. */
  12152. minRemainingSize?: number | { [index: string]: number };
  12153. /**
  12154. * Minimal size for the created chunks.
  12155. */
  12156. minSize?: number | { [index: string]: number };
  12157. /**
  12158. * Minimum size reduction due to the created chunk.
  12159. */
  12160. minSizeReduction?: number | { [index: string]: number };
  12161. /**
  12162. * Give chunks created a name (chunks with equal name are merged).
  12163. */
  12164. name?:
  12165. | string
  12166. | false
  12167. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  12168. /**
  12169. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  12170. */
  12171. usedExports?: boolean;
  12172. }
  12173. declare interface Options {
  12174. /**
  12175. * source
  12176. */
  12177. source: string;
  12178. /**
  12179. * absolute context path to which lib ident is relative to
  12180. */
  12181. context: string;
  12182. /**
  12183. * content
  12184. */
  12185. content: DllReferencePluginOptionsContent;
  12186. /**
  12187. * type
  12188. */
  12189. type?: "object" | "require";
  12190. /**
  12191. * extensions
  12192. */
  12193. extensions?: string[];
  12194. /**
  12195. * scope
  12196. */
  12197. scope?: string;
  12198. /**
  12199. * object for caching
  12200. */
  12201. associatedObjectForCache?: object;
  12202. }
  12203. declare abstract class OptionsApply {
  12204. process(
  12205. options: WebpackOptionsNormalizedWithDefaults,
  12206. compiler: Compiler,
  12207. interception?: WebpackOptionsInterception
  12208. ): WebpackOptionsNormalizedWithDefaults;
  12209. }
  12210. declare interface OriginRecord {
  12211. module: null | Module;
  12212. loc: DependencyLocation;
  12213. request: string;
  12214. }
  12215. declare class OriginalSource extends Source {
  12216. constructor(value: string | Buffer, name: string);
  12217. getName(): string;
  12218. streamChunks(
  12219. options: StreamChunksOptions,
  12220. onChunk: (
  12221. chunk: undefined | string,
  12222. generatedLine: number,
  12223. generatedColumn: number,
  12224. sourceIndex: number,
  12225. originalLine: number,
  12226. originalColumn: number,
  12227. nameIndex: number
  12228. ) => void,
  12229. onSource: (
  12230. sourceIndex: number,
  12231. source: null | string,
  12232. sourceContent?: string
  12233. ) => void,
  12234. _onName: (nameIndex: number, name: string) => void
  12235. ): GeneratedSourceInfo;
  12236. }
  12237. /**
  12238. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  12239. */
  12240. declare interface Output {
  12241. /**
  12242. * Add a container for define/require functions in the AMD module.
  12243. */
  12244. amdContainer?: string;
  12245. /**
  12246. * The filename of asset modules as relative path inside the 'output.path' directory.
  12247. */
  12248. assetModuleFilename?:
  12249. | string
  12250. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12251. /**
  12252. * Enable/disable creating async chunks that are loaded on demand.
  12253. */
  12254. asyncChunks?: boolean;
  12255. /**
  12256. * Add a comment in the UMD wrapper.
  12257. */
  12258. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  12259. /**
  12260. * Add charset attribute for script tag.
  12261. */
  12262. charset?: boolean;
  12263. /**
  12264. * 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.
  12265. */
  12266. chunkFilename?:
  12267. | string
  12268. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12269. /**
  12270. * 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).
  12271. */
  12272. chunkFormat?: string | false;
  12273. /**
  12274. * Number of milliseconds before chunk request expires.
  12275. */
  12276. chunkLoadTimeout?: number;
  12277. /**
  12278. * 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).
  12279. */
  12280. chunkLoading?: string | false;
  12281. /**
  12282. * The global variable used by webpack for loading of chunks.
  12283. */
  12284. chunkLoadingGlobal?: string;
  12285. /**
  12286. * Clean the output directory before emit.
  12287. */
  12288. clean?: boolean | CleanOptions;
  12289. /**
  12290. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  12291. */
  12292. compareBeforeEmit?: boolean;
  12293. /**
  12294. * This option enables cross-origin loading of chunks.
  12295. */
  12296. crossOriginLoading?: false | "anonymous" | "use-credentials";
  12297. /**
  12298. * 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.
  12299. */
  12300. cssChunkFilename?:
  12301. | string
  12302. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12303. /**
  12304. * 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.
  12305. */
  12306. cssFilename?:
  12307. | string
  12308. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12309. /**
  12310. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  12311. */
  12312. devtoolFallbackModuleFilenameTemplate?:
  12313. | string
  12314. | ((context: ModuleFilenameTemplateContext) => string);
  12315. /**
  12316. * Filename template string of function for the sources array in a generated SourceMap.
  12317. */
  12318. devtoolModuleFilenameTemplate?:
  12319. | string
  12320. | ((context: ModuleFilenameTemplateContext) => string);
  12321. /**
  12322. * 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.
  12323. */
  12324. devtoolNamespace?: string;
  12325. /**
  12326. * List of chunk loading types enabled for use by entry points.
  12327. */
  12328. enabledChunkLoadingTypes?: string[];
  12329. /**
  12330. * List of library types enabled for use by entry points.
  12331. */
  12332. enabledLibraryTypes?: string[];
  12333. /**
  12334. * List of wasm loading types enabled for use by entry points.
  12335. */
  12336. enabledWasmLoadingTypes?: string[];
  12337. /**
  12338. * The abilities of the environment where the webpack generated code should run.
  12339. */
  12340. environment?: Environment;
  12341. /**
  12342. * 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.
  12343. */
  12344. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12345. /**
  12346. * An expression which is used to address the global object/scope in runtime code.
  12347. */
  12348. globalObject?: string;
  12349. /**
  12350. * Digest types used for the hash.
  12351. */
  12352. hashDigest?: string;
  12353. /**
  12354. * Number of chars which are used for the hash.
  12355. */
  12356. hashDigestLength?: number;
  12357. /**
  12358. * Algorithm used for generation the hash (see node.js crypto package).
  12359. */
  12360. hashFunction?: string | typeof Hash;
  12361. /**
  12362. * Any string which is added to the hash to salt it.
  12363. */
  12364. hashSalt?: string;
  12365. /**
  12366. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  12367. */
  12368. hotUpdateChunkFilename?: string;
  12369. /**
  12370. * The global variable used by webpack for loading of hot update chunks.
  12371. */
  12372. hotUpdateGlobal?: string;
  12373. /**
  12374. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  12375. */
  12376. hotUpdateMainFilename?: string;
  12377. /**
  12378. * Ignore warnings in the browser.
  12379. */
  12380. ignoreBrowserWarnings?: boolean;
  12381. /**
  12382. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  12383. */
  12384. iife?: boolean;
  12385. /**
  12386. * The name of the native import() function (can be exchanged for a polyfill).
  12387. */
  12388. importFunctionName?: string;
  12389. /**
  12390. * The name of the native import.meta object (can be exchanged for a polyfill).
  12391. */
  12392. importMetaName?: string;
  12393. /**
  12394. * Make the output files a library, exporting the exports of the entry point.
  12395. */
  12396. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  12397. /**
  12398. * Specify which export should be exposed as library.
  12399. */
  12400. libraryExport?: string | string[];
  12401. /**
  12402. * 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).
  12403. */
  12404. libraryTarget?: string;
  12405. /**
  12406. * Output javascript files as module source type.
  12407. */
  12408. module?: boolean;
  12409. /**
  12410. * The output directory as **absolute path** (required).
  12411. */
  12412. path?: string;
  12413. /**
  12414. * Include comments with information about the modules.
  12415. */
  12416. pathinfo?: boolean | "verbose";
  12417. /**
  12418. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  12419. */
  12420. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12421. /**
  12422. * This option enables loading async chunks via a custom script type, such as script type="module".
  12423. */
  12424. scriptType?: false | "module" | "text/javascript";
  12425. /**
  12426. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  12427. */
  12428. sourceMapFilename?: string;
  12429. /**
  12430. * Prefixes every line of the source in the bundle with this string.
  12431. */
  12432. sourcePrefix?: string;
  12433. /**
  12434. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  12435. */
  12436. strictModuleErrorHandling?: boolean;
  12437. /**
  12438. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  12439. */
  12440. strictModuleExceptionHandling?: boolean;
  12441. /**
  12442. * 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.
  12443. */
  12444. trustedTypes?: string | true | TrustedTypes;
  12445. /**
  12446. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  12447. */
  12448. umdNamedDefine?: boolean;
  12449. /**
  12450. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  12451. */
  12452. uniqueName?: string;
  12453. /**
  12454. * 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).
  12455. */
  12456. wasmLoading?: string | false;
  12457. /**
  12458. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  12459. */
  12460. webassemblyModuleFilename?: string;
  12461. /**
  12462. * 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).
  12463. */
  12464. workerChunkLoading?: string | false;
  12465. /**
  12466. * 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.
  12467. */
  12468. workerPublicPath?: string;
  12469. /**
  12470. * 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).
  12471. */
  12472. workerWasmLoading?: string | false;
  12473. }
  12474. declare interface OutputFileSystem {
  12475. mkdir: Mkdir;
  12476. readdir?: ReaddirFs;
  12477. rmdir?: (
  12478. file: PathLikeFs,
  12479. callback: (err: null | NodeJS.ErrnoException) => void
  12480. ) => void;
  12481. writeFile: WriteFile;
  12482. unlink?: (
  12483. pathLike: PathLikeFs,
  12484. callback: (err: null | NodeJS.ErrnoException) => void
  12485. ) => void;
  12486. stat: StatFs;
  12487. lstat?: LStatFs;
  12488. readFile: ReadFileFs;
  12489. createReadStream?: (
  12490. path: PathLikeFs,
  12491. options?:
  12492. | "ascii"
  12493. | "utf8"
  12494. | "utf-8"
  12495. | "utf16le"
  12496. | "utf-16le"
  12497. | "ucs2"
  12498. | "ucs-2"
  12499. | "base64"
  12500. | "base64url"
  12501. | "latin1"
  12502. | "binary"
  12503. | "hex"
  12504. | ReadStreamOptions
  12505. ) => NodeJS.ReadableStream;
  12506. join?: (path1: string, path2: string) => string;
  12507. relative?: (from: string, to: string) => string;
  12508. dirname?: (dirname: string) => string;
  12509. }
  12510. /**
  12511. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  12512. */
  12513. declare interface OutputNormalized {
  12514. /**
  12515. * The filename of asset modules as relative path inside the 'output.path' directory.
  12516. */
  12517. assetModuleFilename?:
  12518. | string
  12519. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12520. /**
  12521. * Enable/disable creating async chunks that are loaded on demand.
  12522. */
  12523. asyncChunks?: boolean;
  12524. /**
  12525. * Add charset attribute for script tag.
  12526. */
  12527. charset?: boolean;
  12528. /**
  12529. * 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.
  12530. */
  12531. chunkFilename?:
  12532. | string
  12533. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12534. /**
  12535. * 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).
  12536. */
  12537. chunkFormat?: string | false;
  12538. /**
  12539. * Number of milliseconds before chunk request expires.
  12540. */
  12541. chunkLoadTimeout?: number;
  12542. /**
  12543. * 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).
  12544. */
  12545. chunkLoading?: string | false;
  12546. /**
  12547. * The global variable used by webpack for loading of chunks.
  12548. */
  12549. chunkLoadingGlobal?: string;
  12550. /**
  12551. * Clean the output directory before emit.
  12552. */
  12553. clean?: boolean | CleanOptions;
  12554. /**
  12555. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  12556. */
  12557. compareBeforeEmit?: boolean;
  12558. /**
  12559. * This option enables cross-origin loading of chunks.
  12560. */
  12561. crossOriginLoading?: false | "anonymous" | "use-credentials";
  12562. /**
  12563. * 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.
  12564. */
  12565. cssChunkFilename?:
  12566. | string
  12567. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12568. /**
  12569. * 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.
  12570. */
  12571. cssFilename?:
  12572. | string
  12573. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12574. /**
  12575. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  12576. */
  12577. devtoolFallbackModuleFilenameTemplate?:
  12578. | string
  12579. | ((context: ModuleFilenameTemplateContext) => string);
  12580. /**
  12581. * Filename template string of function for the sources array in a generated SourceMap.
  12582. */
  12583. devtoolModuleFilenameTemplate?:
  12584. | string
  12585. | ((context: ModuleFilenameTemplateContext) => string);
  12586. /**
  12587. * 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.
  12588. */
  12589. devtoolNamespace?: string;
  12590. /**
  12591. * List of chunk loading types enabled for use by entry points.
  12592. */
  12593. enabledChunkLoadingTypes: string[];
  12594. /**
  12595. * List of library types enabled for use by entry points.
  12596. */
  12597. enabledLibraryTypes: string[];
  12598. /**
  12599. * List of wasm loading types enabled for use by entry points.
  12600. */
  12601. enabledWasmLoadingTypes: string[];
  12602. /**
  12603. * The abilities of the environment where the webpack generated code should run.
  12604. */
  12605. environment: Environment;
  12606. /**
  12607. * 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.
  12608. */
  12609. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12610. /**
  12611. * An expression which is used to address the global object/scope in runtime code.
  12612. */
  12613. globalObject?: string;
  12614. /**
  12615. * Digest types used for the hash.
  12616. */
  12617. hashDigest?: string;
  12618. /**
  12619. * Number of chars which are used for the hash.
  12620. */
  12621. hashDigestLength?: number;
  12622. /**
  12623. * Algorithm used for generation the hash (see node.js crypto package).
  12624. */
  12625. hashFunction?: string | typeof Hash;
  12626. /**
  12627. * Any string which is added to the hash to salt it.
  12628. */
  12629. hashSalt?: string;
  12630. /**
  12631. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  12632. */
  12633. hotUpdateChunkFilename?: string;
  12634. /**
  12635. * The global variable used by webpack for loading of hot update chunks.
  12636. */
  12637. hotUpdateGlobal?: string;
  12638. /**
  12639. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  12640. */
  12641. hotUpdateMainFilename?: string;
  12642. /**
  12643. * Ignore warnings in the browser.
  12644. */
  12645. ignoreBrowserWarnings?: boolean;
  12646. /**
  12647. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  12648. */
  12649. iife?: boolean;
  12650. /**
  12651. * The name of the native import() function (can be exchanged for a polyfill).
  12652. */
  12653. importFunctionName?: string;
  12654. /**
  12655. * The name of the native import.meta object (can be exchanged for a polyfill).
  12656. */
  12657. importMetaName?: string;
  12658. /**
  12659. * Options for library.
  12660. */
  12661. library?: LibraryOptions;
  12662. /**
  12663. * Output javascript files as module source type.
  12664. */
  12665. module?: boolean;
  12666. /**
  12667. * The output directory as **absolute path** (required).
  12668. */
  12669. path?: string;
  12670. /**
  12671. * Include comments with information about the modules.
  12672. */
  12673. pathinfo?: boolean | "verbose";
  12674. /**
  12675. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  12676. */
  12677. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12678. /**
  12679. * This option enables loading async chunks via a custom script type, such as script type="module".
  12680. */
  12681. scriptType?: false | "module" | "text/javascript";
  12682. /**
  12683. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  12684. */
  12685. sourceMapFilename?: string;
  12686. /**
  12687. * Prefixes every line of the source in the bundle with this string.
  12688. */
  12689. sourcePrefix?: string;
  12690. /**
  12691. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  12692. */
  12693. strictModuleErrorHandling?: boolean;
  12694. /**
  12695. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  12696. */
  12697. strictModuleExceptionHandling?: boolean;
  12698. /**
  12699. * Use a Trusted Types policy to create urls for chunks.
  12700. */
  12701. trustedTypes?: TrustedTypes;
  12702. /**
  12703. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  12704. */
  12705. uniqueName?: string;
  12706. /**
  12707. * 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).
  12708. */
  12709. wasmLoading?: string | false;
  12710. /**
  12711. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  12712. */
  12713. webassemblyModuleFilename?: string;
  12714. /**
  12715. * 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).
  12716. */
  12717. workerChunkLoading?: string | false;
  12718. /**
  12719. * 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.
  12720. */
  12721. workerPublicPath?: string;
  12722. /**
  12723. * 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).
  12724. */
  12725. workerWasmLoading?: string | false;
  12726. }
  12727. type OutputNormalizedWithDefaults = OutputNormalized & {
  12728. uniqueName: string;
  12729. filename: NonNullable<
  12730. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12731. >;
  12732. cssFilename: NonNullable<
  12733. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12734. >;
  12735. chunkFilename: NonNullable<
  12736. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12737. >;
  12738. cssChunkFilename: NonNullable<
  12739. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12740. >;
  12741. hotUpdateChunkFilename: string;
  12742. hotUpdateGlobal: string;
  12743. assetModuleFilename: NonNullable<
  12744. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12745. >;
  12746. webassemblyModuleFilename: string;
  12747. sourceMapFilename: string;
  12748. hotUpdateMainFilename: string;
  12749. devtoolNamespace: string;
  12750. publicPath: NonNullable<
  12751. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12752. >;
  12753. workerPublicPath: string;
  12754. workerWasmLoading: NonNullable<undefined | string | false>;
  12755. workerChunkLoading: NonNullable<undefined | string | false>;
  12756. chunkFormat: NonNullable<undefined | string | false>;
  12757. module: NonNullable<undefined | boolean>;
  12758. asyncChunks: NonNullable<undefined | boolean>;
  12759. charset: NonNullable<undefined | boolean>;
  12760. iife: NonNullable<undefined | boolean>;
  12761. globalObject: string;
  12762. scriptType: NonNullable<undefined | false | "module" | "text/javascript">;
  12763. path: string;
  12764. pathinfo: NonNullable<undefined | boolean | "verbose">;
  12765. hashFunction: NonNullable<undefined | string | typeof Hash>;
  12766. hashDigest: string;
  12767. hashDigestLength: number;
  12768. chunkLoadTimeout: number;
  12769. chunkLoading: NonNullable<undefined | string | false>;
  12770. chunkLoadingGlobal: string;
  12771. compareBeforeEmit: NonNullable<undefined | boolean>;
  12772. strictModuleErrorHandling: NonNullable<undefined | boolean>;
  12773. strictModuleExceptionHandling: NonNullable<undefined | boolean>;
  12774. importFunctionName: string;
  12775. importMetaName: string;
  12776. environment: RecursiveNonNullable<Environment>;
  12777. crossOriginLoading: NonNullable<
  12778. undefined | false | "anonymous" | "use-credentials"
  12779. >;
  12780. wasmLoading: NonNullable<undefined | string | false>;
  12781. };
  12782. declare interface ParameterizedComparator<TArg extends object, T> {
  12783. (tArg: TArg): Comparator<T>;
  12784. }
  12785. declare interface ParseOptions {
  12786. sourceType: "module" | "script";
  12787. ecmaVersion: ecmaVersion;
  12788. locations?: boolean;
  12789. comments?: boolean;
  12790. ranges?: boolean;
  12791. semicolons?: boolean;
  12792. allowHashBang?: boolean;
  12793. allowReturnOutsideFunction?: boolean;
  12794. }
  12795. declare interface ParseResult {
  12796. ast: Program;
  12797. comments: CommentJavascriptParser[];
  12798. semicolons: Set<number>;
  12799. }
  12800. declare interface ParsedIdentifier {
  12801. /**
  12802. * request
  12803. */
  12804. request: string;
  12805. /**
  12806. * query
  12807. */
  12808. query: string;
  12809. /**
  12810. * fragment
  12811. */
  12812. fragment: string;
  12813. /**
  12814. * is directory
  12815. */
  12816. directory: boolean;
  12817. /**
  12818. * is module
  12819. */
  12820. module: boolean;
  12821. /**
  12822. * is file
  12823. */
  12824. file: boolean;
  12825. /**
  12826. * is internal
  12827. */
  12828. internal: boolean;
  12829. }
  12830. declare class ParserClass {
  12831. constructor();
  12832. parse(
  12833. source: string | Buffer | PreparsedAst,
  12834. state: ParserState
  12835. ): ParserState;
  12836. }
  12837. declare interface ParserOptions {
  12838. [index: string]: any;
  12839. }
  12840. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  12841. ParserOptionsByModuleTypeUnknown;
  12842. /**
  12843. * Specify options for each parser.
  12844. */
  12845. declare interface ParserOptionsByModuleTypeKnown {
  12846. /**
  12847. * Parser options for asset modules.
  12848. */
  12849. asset?: AssetParserOptions;
  12850. /**
  12851. * No parser options are supported for this module type.
  12852. */
  12853. "asset/bytes"?: EmptyParserOptions;
  12854. /**
  12855. * No parser options are supported for this module type.
  12856. */
  12857. "asset/inline"?: EmptyParserOptions;
  12858. /**
  12859. * No parser options are supported for this module type.
  12860. */
  12861. "asset/resource"?: EmptyParserOptions;
  12862. /**
  12863. * No parser options are supported for this module type.
  12864. */
  12865. "asset/source"?: EmptyParserOptions;
  12866. /**
  12867. * Parser options for css modules.
  12868. */
  12869. css?: CssParserOptions;
  12870. /**
  12871. * Parser options for css/module modules.
  12872. */
  12873. "css/auto"?: CssModuleParserOptions;
  12874. /**
  12875. * Parser options for css/module modules.
  12876. */
  12877. "css/global"?: CssModuleParserOptions;
  12878. /**
  12879. * Parser options for css/module modules.
  12880. */
  12881. "css/module"?: CssModuleParserOptions;
  12882. /**
  12883. * Parser options for javascript modules.
  12884. */
  12885. javascript?: JavascriptParserOptions;
  12886. /**
  12887. * Parser options for javascript modules.
  12888. */
  12889. "javascript/auto"?: JavascriptParserOptions;
  12890. /**
  12891. * Parser options for javascript modules.
  12892. */
  12893. "javascript/dynamic"?: JavascriptParserOptions;
  12894. /**
  12895. * Parser options for javascript modules.
  12896. */
  12897. "javascript/esm"?: JavascriptParserOptions;
  12898. /**
  12899. * Parser options for JSON modules.
  12900. */
  12901. json?: JsonParserOptions;
  12902. }
  12903. /**
  12904. * Specify options for each parser.
  12905. */
  12906. declare interface ParserOptionsByModuleTypeUnknown {
  12907. [index: string]: { [index: string]: any };
  12908. }
  12909. type ParserState = ParserStateBase & Record<string, any>;
  12910. declare interface ParserStateBase {
  12911. source: string | Buffer;
  12912. current: NormalModule;
  12913. module: NormalModule;
  12914. compilation: Compilation;
  12915. options: WebpackOptionsNormalizedWithDefaults;
  12916. }
  12917. declare interface PathData {
  12918. chunkGraph?: ChunkGraph;
  12919. hash?: string;
  12920. hashWithLength?: (length: number) => string;
  12921. chunk?: Chunk | ChunkPathData;
  12922. module?: Module | ModulePathData;
  12923. runtime?: RuntimeSpec;
  12924. filename?: string;
  12925. basename?: string;
  12926. query?: string;
  12927. contentHashType?: string;
  12928. contentHash?: string;
  12929. contentHashWithLength?: (length: number) => string;
  12930. noChunkHash?: boolean;
  12931. url?: string;
  12932. prepareId?: (id: string | number) => string | number;
  12933. }
  12934. type PathLikeFs = string | Buffer | URL;
  12935. type PathLikeTypes = string | URL_url | Buffer;
  12936. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  12937. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  12938. type Pattern =
  12939. | Identifier
  12940. | MemberExpression
  12941. | ObjectPattern
  12942. | ArrayPattern
  12943. | RestElement
  12944. | AssignmentPattern;
  12945. /**
  12946. * Configuration object for web performance recommendations.
  12947. */
  12948. declare interface PerformanceOptions {
  12949. /**
  12950. * Filter function to select assets that are checked.
  12951. */
  12952. assetFilter?: (name: string, source: Source, assetInfo: AssetInfo) => boolean;
  12953. /**
  12954. * Sets the format of the hints: warnings, errors or nothing at all.
  12955. */
  12956. hints?: false | "error" | "warning";
  12957. /**
  12958. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  12959. */
  12960. maxAssetSize?: number;
  12961. /**
  12962. * Total size of an entry point (in bytes).
  12963. */
  12964. maxEntrypointSize?: number;
  12965. }
  12966. declare interface PitchLoaderDefinitionFunction<
  12967. OptionsType = {},
  12968. ContextAdditions = {}
  12969. > {
  12970. (
  12971. this: NormalModuleLoaderContext<OptionsType> &
  12972. LoaderRunnerLoaderContext<OptionsType> &
  12973. LoaderPluginLoaderContext &
  12974. HotModuleReplacementPluginLoaderContext &
  12975. ContextAdditions,
  12976. remainingRequest: string,
  12977. previousRequest: string,
  12978. data: object
  12979. ): string | void | Buffer | Promise<string | Buffer>;
  12980. }
  12981. declare class PlatformPlugin {
  12982. constructor(platform: Partial<PlatformTargetProperties>);
  12983. platform: Partial<PlatformTargetProperties>;
  12984. /**
  12985. * Apply the plugin
  12986. */
  12987. apply(compiler: Compiler): void;
  12988. }
  12989. declare interface PlatformTargetProperties {
  12990. /**
  12991. * web platform, importing of http(s) and std: is available
  12992. */
  12993. web?: null | boolean;
  12994. /**
  12995. * browser platform, running in a normal web browser
  12996. */
  12997. browser?: null | boolean;
  12998. /**
  12999. * (Web)Worker platform, running in a web/shared/service worker
  13000. */
  13001. webworker?: null | boolean;
  13002. /**
  13003. * node platform, require of node built-in modules is available
  13004. */
  13005. node?: null | boolean;
  13006. /**
  13007. * nwjs platform, require of legacy nw.gui is available
  13008. */
  13009. nwjs?: null | boolean;
  13010. /**
  13011. * electron platform, require of some electron built-in modules is available
  13012. */
  13013. electron?: null | boolean;
  13014. }
  13015. type Plugin =
  13016. | undefined
  13017. | null
  13018. | false
  13019. | ""
  13020. | 0
  13021. | { apply: (this: Resolver, resolver: Resolver) => void }
  13022. | ((this: Resolver, resolver: Resolver) => void);
  13023. declare interface PnpApi {
  13024. /**
  13025. * resolve to unqualified
  13026. */
  13027. resolveToUnqualified: (
  13028. packageName: string,
  13029. issuer: string,
  13030. options: { considerBuiltins: boolean }
  13031. ) => null | string;
  13032. }
  13033. declare interface Position {
  13034. line: number;
  13035. column: number;
  13036. }
  13037. declare class PrefetchPlugin {
  13038. constructor(context: string, request?: string);
  13039. context: null | string;
  13040. request: string;
  13041. /**
  13042. * Apply the plugin
  13043. */
  13044. apply(compiler: Compiler): void;
  13045. }
  13046. declare class PrefixSource extends Source {
  13047. constructor(prefix: string, source: string | Buffer | Source);
  13048. getPrefix(): string;
  13049. original(): Source;
  13050. streamChunks(
  13051. options: StreamChunksOptions,
  13052. onChunk: (
  13053. chunk: undefined | string,
  13054. generatedLine: number,
  13055. generatedColumn: number,
  13056. sourceIndex: number,
  13057. originalLine: number,
  13058. originalColumn: number,
  13059. nameIndex: number
  13060. ) => void,
  13061. onSource: (
  13062. sourceIndex: number,
  13063. source: null | string,
  13064. sourceContent?: string
  13065. ) => void,
  13066. onName: (nameIndex: number, name: string) => void
  13067. ): GeneratedSourceInfo;
  13068. }
  13069. declare interface PreparsedAst {
  13070. [index: string]: any;
  13071. }
  13072. declare interface PrintedElement {
  13073. element: string;
  13074. content?: string;
  13075. }
  13076. declare interface Problem {
  13077. type: ProblemType;
  13078. path: string;
  13079. argument: string;
  13080. value?: string | number | boolean | RegExp;
  13081. index?: number;
  13082. expected?: string;
  13083. }
  13084. type ProblemType =
  13085. | "unknown-argument"
  13086. | "unexpected-non-array-in-path"
  13087. | "unexpected-non-object-in-path"
  13088. | "multiple-values-unexpected"
  13089. | "invalid-value";
  13090. declare interface ProcessAssetsAdditionalOptions {
  13091. additionalAssets?: boolean | ((assets: CompilationAssets) => void);
  13092. }
  13093. declare class Profiler {
  13094. constructor(inspector: Inspector);
  13095. session?: SessionImportInspectorClass_2;
  13096. inspector: Inspector;
  13097. hasSession(): boolean;
  13098. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  13099. sendCommand(method: string, params?: object): Promise<any>;
  13100. destroy(): Promise<void>;
  13101. stopProfiling(): Promise<{ profile: { startTime: number; endTime: number } }>;
  13102. }
  13103. declare class ProfilingPlugin {
  13104. constructor(options?: ProfilingPluginOptions);
  13105. outputPath: string;
  13106. /**
  13107. * Apply the plugin
  13108. */
  13109. apply(compiler: Compiler): void;
  13110. static Profiler: typeof Profiler;
  13111. }
  13112. declare interface ProfilingPluginOptions {
  13113. /**
  13114. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  13115. */
  13116. outputPath?: string;
  13117. }
  13118. declare class ProgressPlugin {
  13119. constructor(options?: ProgressPluginArgument);
  13120. profile?: null | boolean;
  13121. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  13122. modulesCount?: number;
  13123. dependenciesCount?: number;
  13124. showEntries?: boolean;
  13125. showModules?: boolean;
  13126. showDependencies?: boolean;
  13127. showActiveModules?: boolean;
  13128. percentBy?: null | "entries" | "modules" | "dependencies";
  13129. apply(compiler: MultiCompiler | Compiler): void;
  13130. static getReporter(
  13131. compiler: Compiler
  13132. ): undefined | ((p: number, ...args: string[]) => void);
  13133. static defaultOptions: {
  13134. profile: boolean;
  13135. modulesCount: number;
  13136. dependenciesCount: number;
  13137. modules: boolean;
  13138. dependencies: boolean;
  13139. activeModules: boolean;
  13140. entries: boolean;
  13141. };
  13142. static createDefaultHandler: (
  13143. profile: undefined | null | boolean,
  13144. logger: WebpackLogger
  13145. ) => (percentage: number, msg: string, ...args: string[]) => void;
  13146. }
  13147. type ProgressPluginArgument =
  13148. | ProgressPluginOptions
  13149. | ((percentage: number, msg: string, ...args: string[]) => void);
  13150. /**
  13151. * Options object for the ProgressPlugin.
  13152. */
  13153. declare interface ProgressPluginOptions {
  13154. /**
  13155. * Show active modules count and one active module in progress message.
  13156. */
  13157. activeModules?: boolean;
  13158. /**
  13159. * Show dependencies count in progress message.
  13160. */
  13161. dependencies?: boolean;
  13162. /**
  13163. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  13164. */
  13165. dependenciesCount?: number;
  13166. /**
  13167. * Show entries count in progress message.
  13168. */
  13169. entries?: boolean;
  13170. /**
  13171. * Function that executes for every progress step.
  13172. */
  13173. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  13174. /**
  13175. * Show modules count in progress message.
  13176. */
  13177. modules?: boolean;
  13178. /**
  13179. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  13180. */
  13181. modulesCount?: number;
  13182. /**
  13183. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  13184. */
  13185. percentBy?: null | "entries" | "modules" | "dependencies";
  13186. /**
  13187. * Collect profile data for progress steps. Default: false.
  13188. */
  13189. profile?: null | boolean;
  13190. }
  13191. declare class ProvidePlugin {
  13192. constructor(definitions: Record<string, string | string[]>);
  13193. definitions: Record<string, string | string[]>;
  13194. /**
  13195. * Apply the plugin
  13196. */
  13197. apply(compiler: Compiler): void;
  13198. }
  13199. declare class ProvideSharedPlugin {
  13200. constructor(options: ProvideSharedPluginOptions);
  13201. /**
  13202. * Apply the plugin
  13203. */
  13204. apply(compiler: Compiler): void;
  13205. }
  13206. declare interface ProvideSharedPluginOptions {
  13207. /**
  13208. * 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.
  13209. */
  13210. provides: Provides;
  13211. /**
  13212. * Share scope name used for all provided modules (defaults to 'default').
  13213. */
  13214. shareScope?: string;
  13215. }
  13216. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  13217. /**
  13218. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  13219. */
  13220. declare interface ProvidesConfig {
  13221. /**
  13222. * 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.
  13223. */
  13224. eager?: boolean;
  13225. /**
  13226. * Key in the share scope under which the shared modules should be stored.
  13227. */
  13228. shareKey?: string;
  13229. /**
  13230. * Share scope name.
  13231. */
  13232. shareScope?: string;
  13233. /**
  13234. * Version of the provided module. Will replace lower matching versions, but not higher.
  13235. */
  13236. version?: string | false;
  13237. }
  13238. /**
  13239. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  13240. */
  13241. declare interface ProvidesObject {
  13242. [index: string]: string | ProvidesConfig;
  13243. }
  13244. declare interface RawChunkGroupOptions {
  13245. preloadOrder?: number;
  13246. prefetchOrder?: number;
  13247. fetchPriority?: "auto" | "low" | "high";
  13248. }
  13249. type RawDevTool = string | false;
  13250. type RawLoaderDefinition<
  13251. OptionsType = {},
  13252. ContextAdditions = {}
  13253. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  13254. raw: true;
  13255. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  13256. };
  13257. declare interface RawLoaderDefinitionFunction<
  13258. OptionsType = {},
  13259. ContextAdditions = {}
  13260. > {
  13261. (
  13262. this: NormalModuleLoaderContext<OptionsType> &
  13263. LoaderRunnerLoaderContext<OptionsType> &
  13264. LoaderPluginLoaderContext &
  13265. HotModuleReplacementPluginLoaderContext &
  13266. ContextAdditions,
  13267. content: Buffer,
  13268. sourceMap?: string | RawSourceMap,
  13269. additionalData?: AdditionalData
  13270. ): string | void | Buffer | Promise<string | Buffer>;
  13271. }
  13272. declare class RawSource extends Source {
  13273. constructor(value: string | Buffer, convertToString?: boolean);
  13274. isBuffer(): boolean;
  13275. streamChunks(
  13276. options: StreamChunksOptions,
  13277. onChunk: (
  13278. chunk: undefined | string,
  13279. generatedLine: number,
  13280. generatedColumn: number,
  13281. sourceIndex: number,
  13282. originalLine: number,
  13283. originalColumn: number,
  13284. nameIndex: number
  13285. ) => void,
  13286. onSource: (
  13287. sourceIndex: number,
  13288. source: null | string,
  13289. sourceContent?: string
  13290. ) => void,
  13291. onName: (nameIndex: number, name: string) => void
  13292. ): GeneratedSourceInfo;
  13293. }
  13294. declare interface RawSourceMap {
  13295. /**
  13296. * version
  13297. */
  13298. version: number;
  13299. /**
  13300. * sources
  13301. */
  13302. sources: string[];
  13303. /**
  13304. * names
  13305. */
  13306. names: string[];
  13307. /**
  13308. * source root
  13309. */
  13310. sourceRoot?: string;
  13311. /**
  13312. * sources content
  13313. */
  13314. sourcesContent?: string[];
  13315. /**
  13316. * mappings
  13317. */
  13318. mappings: string;
  13319. /**
  13320. * file
  13321. */
  13322. file: string;
  13323. /**
  13324. * debug id
  13325. */
  13326. debugId?: string;
  13327. /**
  13328. * ignore list
  13329. */
  13330. ignoreList?: number[];
  13331. }
  13332. declare interface Read<
  13333. TBuffer extends NodeJS.ArrayBufferView = NodeJS.ArrayBufferView
  13334. > {
  13335. (
  13336. fd: number,
  13337. buffer: TBuffer,
  13338. offset: number,
  13339. length: number,
  13340. position: null | number | bigint,
  13341. callback: (
  13342. err: null | NodeJS.ErrnoException,
  13343. bytesRead: number,
  13344. buffer: TBuffer
  13345. ) => void
  13346. ): void;
  13347. (
  13348. fd: number,
  13349. options: ReadAsyncOptions<TBuffer>,
  13350. callback: (
  13351. err: null | NodeJS.ErrnoException,
  13352. bytesRead: number,
  13353. buffer: TBuffer
  13354. ) => void
  13355. ): void;
  13356. (
  13357. fd: number,
  13358. callback: (
  13359. err: null | NodeJS.ErrnoException,
  13360. bytesRead: number,
  13361. buffer: NodeJS.ArrayBufferView
  13362. ) => void
  13363. ): void;
  13364. }
  13365. declare interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> {
  13366. offset?: number;
  13367. length?: number;
  13368. position?: null | number | bigint;
  13369. buffer?: TBuffer;
  13370. }
  13371. declare class ReadFileCompileAsyncWasmPlugin {
  13372. constructor(__0?: ReadFileCompileAsyncWasmPluginOptions);
  13373. /**
  13374. * Apply the plugin
  13375. */
  13376. apply(compiler: Compiler): void;
  13377. }
  13378. declare interface ReadFileCompileAsyncWasmPluginOptions {
  13379. /**
  13380. * use import?
  13381. */
  13382. import?: boolean;
  13383. }
  13384. declare class ReadFileCompileWasmPlugin {
  13385. constructor(options?: ReadFileCompileWasmPluginOptions);
  13386. options: ReadFileCompileWasmPluginOptions;
  13387. /**
  13388. * Apply the plugin
  13389. */
  13390. apply(compiler: Compiler): void;
  13391. }
  13392. declare interface ReadFileCompileWasmPluginOptions {
  13393. /**
  13394. * mangle imports
  13395. */
  13396. mangleImports?: boolean;
  13397. /**
  13398. * use import?
  13399. */
  13400. import?: boolean;
  13401. }
  13402. declare interface ReadFileFs {
  13403. (
  13404. path: PathOrFileDescriptorFs,
  13405. options:
  13406. | undefined
  13407. | null
  13408. | ({ encoding?: null; flag?: string } & Abortable),
  13409. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13410. ): void;
  13411. (
  13412. path: PathOrFileDescriptorFs,
  13413. options:
  13414. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  13415. | "ascii"
  13416. | "utf8"
  13417. | "utf-8"
  13418. | "utf16le"
  13419. | "utf-16le"
  13420. | "ucs2"
  13421. | "ucs-2"
  13422. | "base64"
  13423. | "base64url"
  13424. | "latin1"
  13425. | "binary"
  13426. | "hex",
  13427. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13428. ): void;
  13429. (
  13430. path: PathOrFileDescriptorFs,
  13431. options:
  13432. | undefined
  13433. | null
  13434. | "ascii"
  13435. | "utf8"
  13436. | "utf-8"
  13437. | "utf16le"
  13438. | "utf-16le"
  13439. | "ucs2"
  13440. | "ucs-2"
  13441. | "base64"
  13442. | "base64url"
  13443. | "latin1"
  13444. | "binary"
  13445. | "hex"
  13446. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  13447. callback: (
  13448. err: null | NodeJS.ErrnoException,
  13449. result?: string | Buffer
  13450. ) => void
  13451. ): void;
  13452. (
  13453. path: PathOrFileDescriptorFs,
  13454. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13455. ): void;
  13456. }
  13457. declare interface ReadFileSync {
  13458. (
  13459. path: PathOrFileDescriptorFs,
  13460. options?: null | { encoding?: null; flag?: string }
  13461. ): Buffer;
  13462. (
  13463. path: PathOrFileDescriptorFs,
  13464. options:
  13465. | "ascii"
  13466. | "utf8"
  13467. | "utf-8"
  13468. | "utf16le"
  13469. | "utf-16le"
  13470. | "ucs2"
  13471. | "ucs-2"
  13472. | "base64"
  13473. | "base64url"
  13474. | "latin1"
  13475. | "binary"
  13476. | "hex"
  13477. | { encoding: BufferEncoding; flag?: string }
  13478. ): string;
  13479. (
  13480. path: PathOrFileDescriptorFs,
  13481. options?:
  13482. | null
  13483. | "ascii"
  13484. | "utf8"
  13485. | "utf-8"
  13486. | "utf16le"
  13487. | "utf-16le"
  13488. | "ucs2"
  13489. | "ucs-2"
  13490. | "base64"
  13491. | "base64url"
  13492. | "latin1"
  13493. | "binary"
  13494. | "hex"
  13495. | (ObjectEncodingOptions & { flag?: string })
  13496. ): string | Buffer;
  13497. }
  13498. declare interface ReadFileTypes {
  13499. (
  13500. path: PathOrFileDescriptorTypes,
  13501. options:
  13502. | undefined
  13503. | null
  13504. | ({ encoding?: null; flag?: string } & Abortable),
  13505. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13506. ): void;
  13507. (
  13508. path: PathOrFileDescriptorTypes,
  13509. options:
  13510. | "ascii"
  13511. | "utf8"
  13512. | "utf-8"
  13513. | "utf16le"
  13514. | "utf-16le"
  13515. | "ucs2"
  13516. | "ucs-2"
  13517. | "base64"
  13518. | "base64url"
  13519. | "latin1"
  13520. | "binary"
  13521. | "hex"
  13522. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  13523. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13524. ): void;
  13525. (
  13526. path: PathOrFileDescriptorTypes,
  13527. options:
  13528. | undefined
  13529. | null
  13530. | "ascii"
  13531. | "utf8"
  13532. | "utf-8"
  13533. | "utf16le"
  13534. | "utf-16le"
  13535. | "ucs2"
  13536. | "ucs-2"
  13537. | "base64"
  13538. | "base64url"
  13539. | "latin1"
  13540. | "binary"
  13541. | "hex"
  13542. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  13543. callback: (
  13544. err: null | NodeJS.ErrnoException,
  13545. result?: string | Buffer
  13546. ) => void
  13547. ): void;
  13548. (
  13549. path: PathOrFileDescriptorTypes,
  13550. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13551. ): void;
  13552. }
  13553. type ReadStreamOptions = StreamOptions & {
  13554. fs?: null | CreateReadStreamFSImplementation;
  13555. end?: number;
  13556. };
  13557. declare interface ReaddirFs {
  13558. (
  13559. path: PathLikeFs,
  13560. options:
  13561. | undefined
  13562. | null
  13563. | "ascii"
  13564. | "utf8"
  13565. | "utf-8"
  13566. | "utf16le"
  13567. | "utf-16le"
  13568. | "ucs2"
  13569. | "ucs-2"
  13570. | "base64"
  13571. | "base64url"
  13572. | "latin1"
  13573. | "binary"
  13574. | "hex"
  13575. | {
  13576. encoding:
  13577. | null
  13578. | "ascii"
  13579. | "utf8"
  13580. | "utf-8"
  13581. | "utf16le"
  13582. | "utf-16le"
  13583. | "ucs2"
  13584. | "ucs-2"
  13585. | "base64"
  13586. | "base64url"
  13587. | "latin1"
  13588. | "binary"
  13589. | "hex";
  13590. withFileTypes?: false;
  13591. recursive?: boolean;
  13592. },
  13593. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13594. ): void;
  13595. (
  13596. path: PathLikeFs,
  13597. options:
  13598. | "buffer"
  13599. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  13600. callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void
  13601. ): void;
  13602. (
  13603. path: PathLikeFs,
  13604. options:
  13605. | undefined
  13606. | null
  13607. | "ascii"
  13608. | "utf8"
  13609. | "utf-8"
  13610. | "utf16le"
  13611. | "utf-16le"
  13612. | "ucs2"
  13613. | "ucs-2"
  13614. | "base64"
  13615. | "base64url"
  13616. | "latin1"
  13617. | "binary"
  13618. | "hex"
  13619. | (ObjectEncodingOptions & {
  13620. withFileTypes?: false;
  13621. recursive?: boolean;
  13622. }),
  13623. callback: (
  13624. err: null | NodeJS.ErrnoException,
  13625. files?: string[] | Buffer[]
  13626. ) => void
  13627. ): void;
  13628. (
  13629. path: PathLikeFs,
  13630. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13631. ): void;
  13632. (
  13633. path: PathLikeFs,
  13634. options: ObjectEncodingOptions & {
  13635. withFileTypes: true;
  13636. recursive?: boolean;
  13637. },
  13638. callback: (
  13639. err: null | NodeJS.ErrnoException,
  13640. files?: Dirent<string>[]
  13641. ) => void
  13642. ): void;
  13643. (
  13644. path: PathLikeFs,
  13645. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean },
  13646. callback: (
  13647. err: null | NodeJS.ErrnoException,
  13648. files: Dirent<Buffer>[]
  13649. ) => void
  13650. ): void;
  13651. }
  13652. declare interface ReaddirSync {
  13653. (
  13654. path: PathLikeFs,
  13655. options?:
  13656. | null
  13657. | "ascii"
  13658. | "utf8"
  13659. | "utf-8"
  13660. | "utf16le"
  13661. | "utf-16le"
  13662. | "ucs2"
  13663. | "ucs-2"
  13664. | "base64"
  13665. | "base64url"
  13666. | "latin1"
  13667. | "binary"
  13668. | "hex"
  13669. | {
  13670. encoding:
  13671. | null
  13672. | "ascii"
  13673. | "utf8"
  13674. | "utf-8"
  13675. | "utf16le"
  13676. | "utf-16le"
  13677. | "ucs2"
  13678. | "ucs-2"
  13679. | "base64"
  13680. | "base64url"
  13681. | "latin1"
  13682. | "binary"
  13683. | "hex";
  13684. withFileTypes?: false;
  13685. recursive?: boolean;
  13686. }
  13687. ): string[];
  13688. (
  13689. path: PathLikeFs,
  13690. options:
  13691. | "buffer"
  13692. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  13693. ): Buffer[];
  13694. (
  13695. path: PathLikeFs,
  13696. options?:
  13697. | null
  13698. | "ascii"
  13699. | "utf8"
  13700. | "utf-8"
  13701. | "utf16le"
  13702. | "utf-16le"
  13703. | "ucs2"
  13704. | "ucs-2"
  13705. | "base64"
  13706. | "base64url"
  13707. | "latin1"
  13708. | "binary"
  13709. | "hex"
  13710. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  13711. ): string[] | Buffer[];
  13712. (
  13713. path: PathLikeFs,
  13714. options: ObjectEncodingOptions & {
  13715. withFileTypes: true;
  13716. recursive?: boolean;
  13717. }
  13718. ): Dirent<string>[];
  13719. (
  13720. path: PathLikeFs,
  13721. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }
  13722. ): Dirent<Buffer>[];
  13723. }
  13724. declare interface ReaddirTypes {
  13725. (
  13726. path: PathLikeTypes,
  13727. options:
  13728. | undefined
  13729. | null
  13730. | "ascii"
  13731. | "utf8"
  13732. | "utf-8"
  13733. | "utf16le"
  13734. | "utf-16le"
  13735. | "ucs2"
  13736. | "ucs-2"
  13737. | "base64"
  13738. | "base64url"
  13739. | "latin1"
  13740. | "binary"
  13741. | "hex"
  13742. | {
  13743. encoding:
  13744. | null
  13745. | "ascii"
  13746. | "utf8"
  13747. | "utf-8"
  13748. | "utf16le"
  13749. | "utf-16le"
  13750. | "ucs2"
  13751. | "ucs-2"
  13752. | "base64"
  13753. | "base64url"
  13754. | "latin1"
  13755. | "binary"
  13756. | "hex";
  13757. withFileTypes?: false;
  13758. recursive?: boolean;
  13759. },
  13760. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13761. ): void;
  13762. (
  13763. path: PathLikeTypes,
  13764. options:
  13765. | "buffer"
  13766. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  13767. callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void
  13768. ): void;
  13769. (
  13770. path: PathLikeTypes,
  13771. options:
  13772. | undefined
  13773. | null
  13774. | "ascii"
  13775. | "utf8"
  13776. | "utf-8"
  13777. | "utf16le"
  13778. | "utf-16le"
  13779. | "ucs2"
  13780. | "ucs-2"
  13781. | "base64"
  13782. | "base64url"
  13783. | "latin1"
  13784. | "binary"
  13785. | "hex"
  13786. | (ObjectEncodingOptions & {
  13787. withFileTypes?: false;
  13788. recursive?: boolean;
  13789. }),
  13790. callback: (
  13791. err: null | NodeJS.ErrnoException,
  13792. files?: string[] | Buffer[]
  13793. ) => void
  13794. ): void;
  13795. (
  13796. path: PathLikeTypes,
  13797. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13798. ): void;
  13799. (
  13800. path: PathLikeTypes,
  13801. options: ObjectEncodingOptions & {
  13802. withFileTypes: true;
  13803. recursive?: boolean;
  13804. },
  13805. callback: (
  13806. err: null | NodeJS.ErrnoException,
  13807. files?: Dirent<string>[]
  13808. ) => void
  13809. ): void;
  13810. (
  13811. path: PathLikeTypes,
  13812. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean },
  13813. callback: (
  13814. err: null | NodeJS.ErrnoException,
  13815. files: Dirent<Buffer>[]
  13816. ) => void
  13817. ): void;
  13818. }
  13819. declare interface ReadlinkFs {
  13820. (
  13821. path: PathLikeFs,
  13822. options: EncodingOption,
  13823. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13824. ): void;
  13825. (
  13826. path: PathLikeFs,
  13827. options: BufferEncodingOption,
  13828. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13829. ): void;
  13830. (
  13831. path: PathLikeFs,
  13832. options: EncodingOption,
  13833. callback: (
  13834. err: null | NodeJS.ErrnoException,
  13835. result?: string | Buffer
  13836. ) => void
  13837. ): void;
  13838. (
  13839. path: PathLikeFs,
  13840. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13841. ): void;
  13842. }
  13843. declare interface ReadlinkSync {
  13844. (path: PathLikeFs, options?: EncodingOption): string;
  13845. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  13846. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  13847. }
  13848. declare interface ReadlinkTypes {
  13849. (
  13850. path: PathLikeTypes,
  13851. options: EncodingOption,
  13852. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13853. ): void;
  13854. (
  13855. path: PathLikeTypes,
  13856. options: BufferEncodingOption,
  13857. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13858. ): void;
  13859. (
  13860. path: PathLikeTypes,
  13861. options: EncodingOption,
  13862. callback: (
  13863. err: null | NodeJS.ErrnoException,
  13864. result?: string | Buffer
  13865. ) => void
  13866. ): void;
  13867. (
  13868. path: PathLikeTypes,
  13869. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13870. ): void;
  13871. }
  13872. declare class RealContentHashPlugin {
  13873. constructor(__0: RealContentHashPluginOptions);
  13874. /**
  13875. * Apply the plugin
  13876. */
  13877. apply(compiler: Compiler): void;
  13878. static getCompilationHooks(
  13879. compilation: Compilation
  13880. ): CompilationHooksRealContentHashPlugin;
  13881. }
  13882. declare interface RealContentHashPluginOptions {
  13883. /**
  13884. * the hash function to use
  13885. */
  13886. hashFunction: HashFunction;
  13887. /**
  13888. * the hash digest to use
  13889. */
  13890. hashDigest: string;
  13891. }
  13892. declare interface RealDependencyLocation {
  13893. start: SourcePosition;
  13894. end?: SourcePosition;
  13895. index?: number;
  13896. }
  13897. declare interface RealPathFs {
  13898. (
  13899. path: PathLikeFs,
  13900. options: EncodingOption,
  13901. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13902. ): void;
  13903. (
  13904. path: PathLikeFs,
  13905. options: BufferEncodingOption,
  13906. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13907. ): void;
  13908. (
  13909. path: PathLikeFs,
  13910. options: EncodingOption,
  13911. callback: (
  13912. err: null | NodeJS.ErrnoException,
  13913. result?: string | Buffer
  13914. ) => void
  13915. ): void;
  13916. (
  13917. path: PathLikeFs,
  13918. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13919. ): void;
  13920. }
  13921. declare interface RealPathSync {
  13922. (path: PathLikeFs, options?: EncodingOption): string;
  13923. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  13924. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  13925. }
  13926. declare interface RealPathTypes {
  13927. (
  13928. path: PathLikeTypes,
  13929. options: EncodingOption,
  13930. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13931. ): void;
  13932. (
  13933. path: PathLikeTypes,
  13934. options: BufferEncodingOption,
  13935. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13936. ): void;
  13937. (
  13938. path: PathLikeTypes,
  13939. options: EncodingOption,
  13940. callback: (
  13941. err: null | NodeJS.ErrnoException,
  13942. result?: string | Buffer
  13943. ) => void
  13944. ): void;
  13945. (
  13946. path: PathLikeTypes,
  13947. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13948. ): void;
  13949. }
  13950. type Records = KnownRecords &
  13951. Record<string, KnownRecords[]> &
  13952. Record<string, any>;
  13953. declare interface RecordsChunks {
  13954. byName?: Record<string, number>;
  13955. bySource?: Record<string, number>;
  13956. usedIds?: number[];
  13957. }
  13958. declare interface RecordsModules {
  13959. byIdentifier?: Record<string, number>;
  13960. usedIds?: number[];
  13961. }
  13962. type RecursiveArrayOrRecord<T> =
  13963. | { [index: string]: RecursiveArrayOrRecord<T> }
  13964. | RecursiveArrayOrRecord<T>[]
  13965. | T;
  13966. declare interface RecursiveNonNullable<T> {}
  13967. type ReferenceableItem = string | object;
  13968. declare interface ReferencedExport {
  13969. /**
  13970. * name of the referenced export
  13971. */
  13972. name: string[];
  13973. /**
  13974. * when false, referenced export can not be mangled, defaults to true
  13975. */
  13976. canMangle?: boolean;
  13977. }
  13978. type Remotes = (string | RemotesObject)[] | RemotesObject;
  13979. /**
  13980. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  13981. */
  13982. declare interface RemotesConfig {
  13983. /**
  13984. * Container locations from which modules should be resolved and loaded at runtime.
  13985. */
  13986. external: string | string[];
  13987. /**
  13988. * The name of the share scope shared with this remote.
  13989. */
  13990. shareScope?: string;
  13991. }
  13992. /**
  13993. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  13994. */
  13995. declare interface RemotesObject {
  13996. [index: string]: string | RemotesConfig | string[];
  13997. }
  13998. declare interface RenderBootstrapContext {
  13999. /**
  14000. * the chunk
  14001. */
  14002. chunk: Chunk;
  14003. /**
  14004. * results of code generation
  14005. */
  14006. codeGenerationResults: CodeGenerationResults;
  14007. /**
  14008. * the runtime template
  14009. */
  14010. runtimeTemplate: RuntimeTemplate;
  14011. /**
  14012. * the module graph
  14013. */
  14014. moduleGraph: ModuleGraph;
  14015. /**
  14016. * the chunk graph
  14017. */
  14018. chunkGraph: ChunkGraph;
  14019. /**
  14020. * hash to be used for render call
  14021. */
  14022. hash: string;
  14023. }
  14024. declare interface RenderContextCssModulesPlugin {
  14025. /**
  14026. * the chunk
  14027. */
  14028. chunk: Chunk;
  14029. /**
  14030. * the chunk graph
  14031. */
  14032. chunkGraph: ChunkGraph;
  14033. /**
  14034. * results of code generation
  14035. */
  14036. codeGenerationResults: CodeGenerationResults;
  14037. /**
  14038. * the runtime template
  14039. */
  14040. runtimeTemplate: RuntimeTemplate;
  14041. /**
  14042. * the unique name
  14043. */
  14044. uniqueName: string;
  14045. /**
  14046. * undo path to css file
  14047. */
  14048. undoPath: string;
  14049. /**
  14050. * modules
  14051. */
  14052. modules: CssModule[];
  14053. }
  14054. declare interface RenderContextJavascriptModulesPlugin {
  14055. /**
  14056. * the chunk
  14057. */
  14058. chunk: Chunk;
  14059. /**
  14060. * the dependency templates
  14061. */
  14062. dependencyTemplates: DependencyTemplates;
  14063. /**
  14064. * the runtime template
  14065. */
  14066. runtimeTemplate: RuntimeTemplate;
  14067. /**
  14068. * the module graph
  14069. */
  14070. moduleGraph: ModuleGraph;
  14071. /**
  14072. * the chunk graph
  14073. */
  14074. chunkGraph: ChunkGraph;
  14075. /**
  14076. * results of code generation
  14077. */
  14078. codeGenerationResults: CodeGenerationResults;
  14079. /**
  14080. * rendering in strict context
  14081. */
  14082. strictMode?: boolean;
  14083. }
  14084. type RenderManifestEntry =
  14085. | RenderManifestEntryTemplated
  14086. | RenderManifestEntryStatic;
  14087. declare interface RenderManifestEntryStatic {
  14088. render: () => Source;
  14089. filename: string;
  14090. info: AssetInfo;
  14091. identifier: string;
  14092. hash?: string;
  14093. auxiliary?: boolean;
  14094. }
  14095. declare interface RenderManifestEntryTemplated {
  14096. render: () => Source;
  14097. filenameTemplate: TemplatePath;
  14098. pathOptions?: PathData;
  14099. info?: AssetInfo;
  14100. identifier: string;
  14101. hash?: string;
  14102. auxiliary?: boolean;
  14103. }
  14104. declare interface RenderManifestOptions {
  14105. /**
  14106. * the chunk used to render
  14107. */
  14108. chunk: Chunk;
  14109. hash: string;
  14110. fullHash: string;
  14111. outputOptions: OutputNormalizedWithDefaults;
  14112. codeGenerationResults: CodeGenerationResults;
  14113. moduleTemplates: { javascript: ModuleTemplate };
  14114. dependencyTemplates: DependencyTemplates;
  14115. runtimeTemplate: RuntimeTemplate;
  14116. moduleGraph: ModuleGraph;
  14117. chunkGraph: ChunkGraph;
  14118. }
  14119. declare class ReplaceSource extends Source {
  14120. constructor(source: Source, name?: string);
  14121. getName(): undefined | string;
  14122. getReplacements(): Replacement[];
  14123. replace(start: number, end: number, newValue: string, name?: string): void;
  14124. insert(pos: number, newValue: string, name?: string): void;
  14125. original(): Source;
  14126. streamChunks(
  14127. options: StreamChunksOptions,
  14128. onChunk: (
  14129. chunk: undefined | string,
  14130. generatedLine: number,
  14131. generatedColumn: number,
  14132. sourceIndex: number,
  14133. originalLine: number,
  14134. originalColumn: number,
  14135. nameIndex: number
  14136. ) => void,
  14137. onSource: (
  14138. sourceIndex: number,
  14139. source: null | string,
  14140. sourceContent?: string
  14141. ) => void,
  14142. onName: (nameIndex: number, name: string) => void
  14143. ): GeneratedSourceInfo;
  14144. static Replacement: typeof Replacement;
  14145. }
  14146. declare class Replacement {
  14147. constructor(start: number, end: number, content: string, name?: string);
  14148. start: number;
  14149. end: number;
  14150. content: string;
  14151. name?: string;
  14152. index?: number;
  14153. }
  14154. declare interface RequestRecord {
  14155. [index: string]: string | string[];
  14156. }
  14157. declare abstract class RequestShortener {
  14158. contextify: (value: string) => string;
  14159. shorten(request?: null | string): undefined | null | string;
  14160. }
  14161. declare interface ResolveBuildDependenciesResult {
  14162. /**
  14163. * list of files
  14164. */
  14165. files: Set<string>;
  14166. /**
  14167. * list of directories
  14168. */
  14169. directories: Set<string>;
  14170. /**
  14171. * list of missing entries
  14172. */
  14173. missing: Set<string>;
  14174. /**
  14175. * stored resolve results
  14176. */
  14177. resolveResults: Map<string, undefined | string | false>;
  14178. /**
  14179. * dependencies of the resolving
  14180. */
  14181. resolveDependencies: ResolveDependencies;
  14182. }
  14183. declare interface ResolveContext {
  14184. /**
  14185. * directories that was found on file system
  14186. */
  14187. contextDependencies?: WriteOnlySet<string>;
  14188. /**
  14189. * files that was found on file system
  14190. */
  14191. fileDependencies?: WriteOnlySet<string>;
  14192. /**
  14193. * dependencies that was not found on file system
  14194. */
  14195. missingDependencies?: WriteOnlySet<string>;
  14196. /**
  14197. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  14198. */
  14199. stack?: Set<string>;
  14200. /**
  14201. * log function
  14202. */
  14203. log?: (str: string) => void;
  14204. /**
  14205. * yield result, if provided plugins can return several results
  14206. */
  14207. yield?: (request: ResolveRequest) => void;
  14208. }
  14209. declare interface ResolveData {
  14210. contextInfo: ModuleFactoryCreateDataContextInfo;
  14211. resolveOptions?: ResolveOptions;
  14212. context: string;
  14213. request: string;
  14214. attributes?: ImportAttributes;
  14215. dependencies: ModuleDependency[];
  14216. dependencyType: string;
  14217. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  14218. fileDependencies: LazySet<string>;
  14219. missingDependencies: LazySet<string>;
  14220. contextDependencies: LazySet<string>;
  14221. ignoredModule?: Module;
  14222. /**
  14223. * allow to use the unsafe cache
  14224. */
  14225. cacheable: boolean;
  14226. }
  14227. declare interface ResolveDependencies {
  14228. /**
  14229. * list of files
  14230. */
  14231. files: Set<string>;
  14232. /**
  14233. * list of directories
  14234. */
  14235. directories: Set<string>;
  14236. /**
  14237. * list of missing entries
  14238. */
  14239. missing: Set<string>;
  14240. }
  14241. /**
  14242. * Options object for resolving requests.
  14243. */
  14244. declare interface ResolveOptions {
  14245. /**
  14246. * Redirect module requests.
  14247. */
  14248. alias?:
  14249. | {
  14250. /**
  14251. * New request.
  14252. */
  14253. alias: string | false | string[];
  14254. /**
  14255. * Request to be redirected.
  14256. */
  14257. name: string;
  14258. /**
  14259. * Redirect only exact matching request.
  14260. */
  14261. onlyModule?: boolean;
  14262. }[]
  14263. | { [index: string]: string | false | string[] };
  14264. /**
  14265. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  14266. */
  14267. aliasFields?: (string | string[])[];
  14268. /**
  14269. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  14270. */
  14271. byDependency?: { [index: string]: ResolveOptions };
  14272. /**
  14273. * Enable caching of successfully resolved requests (cache entries are revalidated).
  14274. */
  14275. cache?: boolean;
  14276. /**
  14277. * Predicate function to decide which requests should be cached.
  14278. */
  14279. cachePredicate?: (request: ResolveRequest) => boolean;
  14280. /**
  14281. * Include the context information in the cache identifier when caching.
  14282. */
  14283. cacheWithContext?: boolean;
  14284. /**
  14285. * Condition names for exports field entry point.
  14286. */
  14287. conditionNames?: string[];
  14288. /**
  14289. * Filenames used to find a description file (like a package.json).
  14290. */
  14291. descriptionFiles?: string[];
  14292. /**
  14293. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  14294. */
  14295. enforceExtension?: boolean;
  14296. /**
  14297. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  14298. */
  14299. exportsFields?: string[];
  14300. /**
  14301. * An object which maps extension to extension aliases.
  14302. */
  14303. extensionAlias?: { [index: string]: string | string[] };
  14304. /**
  14305. * Extensions added to the request when trying to find the file.
  14306. */
  14307. extensions?: string[];
  14308. /**
  14309. * Redirect module requests when normal resolving fails.
  14310. */
  14311. fallback?:
  14312. | {
  14313. /**
  14314. * New request.
  14315. */
  14316. alias: string | false | string[];
  14317. /**
  14318. * Request to be redirected.
  14319. */
  14320. name: string;
  14321. /**
  14322. * Redirect only exact matching request.
  14323. */
  14324. onlyModule?: boolean;
  14325. }[]
  14326. | { [index: string]: string | false | string[] };
  14327. /**
  14328. * Filesystem for the resolver.
  14329. */
  14330. fileSystem?: InputFileSystem;
  14331. /**
  14332. * 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).
  14333. */
  14334. fullySpecified?: boolean;
  14335. /**
  14336. * 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).
  14337. */
  14338. importsFields?: string[];
  14339. /**
  14340. * Field names from the description file (package.json) which are used to find the default entry point.
  14341. */
  14342. mainFields?: (string | string[])[];
  14343. /**
  14344. * Filenames used to find the default entry point if there is no description file or main field.
  14345. */
  14346. mainFiles?: string[];
  14347. /**
  14348. * Folder names or directory paths where to find modules.
  14349. */
  14350. modules?: string[];
  14351. /**
  14352. * Plugins for the resolver.
  14353. */
  14354. plugins?: (
  14355. | undefined
  14356. | null
  14357. | false
  14358. | ""
  14359. | 0
  14360. | {
  14361. [index: string]: any;
  14362. /**
  14363. * The run point of the plugin, required method.
  14364. */
  14365. apply: (arg0: Resolver) => void;
  14366. }
  14367. | ((this: Resolver, arg1: Resolver) => void)
  14368. | "..."
  14369. )[];
  14370. /**
  14371. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  14372. */
  14373. preferAbsolute?: boolean;
  14374. /**
  14375. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  14376. */
  14377. preferRelative?: boolean;
  14378. /**
  14379. * Custom resolver.
  14380. */
  14381. resolver?: Resolver;
  14382. /**
  14383. * 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.
  14384. */
  14385. restrictions?: (string | RegExp)[];
  14386. /**
  14387. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  14388. */
  14389. roots?: string[];
  14390. /**
  14391. * Enable resolving symlinks to the original location.
  14392. */
  14393. symlinks?: boolean;
  14394. /**
  14395. * TypeScript config for paths mapping. Can be `false` (disabled), `true` (use default `tsconfig.json`), a string path to `tsconfig.json`, or an object with `configFile` and `references` options.
  14396. */
  14397. tsconfig?:
  14398. | string
  14399. | boolean
  14400. | {
  14401. /**
  14402. * A path to the tsconfig file.
  14403. */
  14404. configFile?: string;
  14405. /**
  14406. * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.
  14407. */
  14408. references?: string;
  14409. };
  14410. /**
  14411. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  14412. */
  14413. unsafeCache?: boolean | { [index: string]: any };
  14414. /**
  14415. * Use synchronous filesystem calls for the resolver.
  14416. */
  14417. useSyncFileSystemCalls?: boolean;
  14418. }
  14419. declare interface ResolveOptionsResolverFactoryObject1 {
  14420. /**
  14421. * alias
  14422. */
  14423. alias: AliasOption[];
  14424. /**
  14425. * fallback
  14426. */
  14427. fallback: AliasOption[];
  14428. /**
  14429. * alias fields
  14430. */
  14431. aliasFields: Set<string | string[]>;
  14432. /**
  14433. * extension alias
  14434. */
  14435. extensionAlias: ExtensionAliasOption[];
  14436. /**
  14437. * cache predicate
  14438. */
  14439. cachePredicate: (predicate: ResolveRequest) => boolean;
  14440. /**
  14441. * cache with context
  14442. */
  14443. cacheWithContext: boolean;
  14444. /**
  14445. * A list of exports field condition names.
  14446. */
  14447. conditionNames: Set<string>;
  14448. /**
  14449. * description files
  14450. */
  14451. descriptionFiles: string[];
  14452. /**
  14453. * enforce extension
  14454. */
  14455. enforceExtension: boolean;
  14456. /**
  14457. * exports fields
  14458. */
  14459. exportsFields: Set<string | string[]>;
  14460. /**
  14461. * imports fields
  14462. */
  14463. importsFields: Set<string | string[]>;
  14464. /**
  14465. * extensions
  14466. */
  14467. extensions: Set<string>;
  14468. /**
  14469. * fileSystem
  14470. */
  14471. fileSystem: FileSystem;
  14472. /**
  14473. * unsafe cache
  14474. */
  14475. unsafeCache: false | CacheTypes;
  14476. /**
  14477. * symlinks
  14478. */
  14479. symlinks: boolean;
  14480. /**
  14481. * resolver
  14482. */
  14483. resolver?: Resolver;
  14484. /**
  14485. * modules
  14486. */
  14487. modules: (string | string[])[];
  14488. /**
  14489. * main fields
  14490. */
  14491. mainFields: { name: string[]; forceRelative: boolean }[];
  14492. /**
  14493. * main files
  14494. */
  14495. mainFiles: Set<string>;
  14496. /**
  14497. * plugins
  14498. */
  14499. plugins: Plugin[];
  14500. /**
  14501. * pnp API
  14502. */
  14503. pnpApi: null | PnpApi;
  14504. /**
  14505. * roots
  14506. */
  14507. roots: Set<string>;
  14508. /**
  14509. * fully specified
  14510. */
  14511. fullySpecified: boolean;
  14512. /**
  14513. * resolve to context
  14514. */
  14515. resolveToContext: boolean;
  14516. /**
  14517. * restrictions
  14518. */
  14519. restrictions: Set<string | RegExp>;
  14520. /**
  14521. * prefer relative
  14522. */
  14523. preferRelative: boolean;
  14524. /**
  14525. * prefer absolute
  14526. */
  14527. preferAbsolute: boolean;
  14528. /**
  14529. * tsconfig file path or config object
  14530. */
  14531. tsconfig: string | boolean | TsconfigOptions;
  14532. }
  14533. declare interface ResolveOptionsResolverFactoryObject2 {
  14534. /**
  14535. * A list of module alias configurations or an object which maps key to value
  14536. */
  14537. alias?: AliasOption[] | AliasOptions;
  14538. /**
  14539. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  14540. */
  14541. fallback?: AliasOption[] | AliasOptions;
  14542. /**
  14543. * An object which maps extension to extension aliases
  14544. */
  14545. extensionAlias?: ExtensionAliasOptions;
  14546. /**
  14547. * A list of alias fields in description files
  14548. */
  14549. aliasFields?: (string | string[])[];
  14550. /**
  14551. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  14552. */
  14553. cachePredicate?: (predicate: ResolveRequest) => boolean;
  14554. /**
  14555. * Whether or not the unsafeCache should include request context as part of the cache key.
  14556. */
  14557. cacheWithContext?: boolean;
  14558. /**
  14559. * A list of description files to read from
  14560. */
  14561. descriptionFiles?: string[];
  14562. /**
  14563. * A list of exports field condition names.
  14564. */
  14565. conditionNames?: string[];
  14566. /**
  14567. * Enforce that a extension from extensions must be used
  14568. */
  14569. enforceExtension?: boolean;
  14570. /**
  14571. * A list of exports fields in description files
  14572. */
  14573. exportsFields?: (string | string[])[];
  14574. /**
  14575. * A list of imports fields in description files
  14576. */
  14577. importsFields?: (string | string[])[];
  14578. /**
  14579. * A list of extensions which should be tried for files
  14580. */
  14581. extensions?: string[];
  14582. /**
  14583. * The file system which should be used
  14584. */
  14585. fileSystem: FileSystem;
  14586. /**
  14587. * Use this cache object to unsafely cache the successful requests
  14588. */
  14589. unsafeCache?: boolean | CacheTypes;
  14590. /**
  14591. * Resolve symlinks to their symlinked location
  14592. */
  14593. symlinks?: boolean;
  14594. /**
  14595. * A prepared Resolver to which the plugins are attached
  14596. */
  14597. resolver?: Resolver;
  14598. /**
  14599. * A list of directories to resolve modules from, can be absolute path or folder name
  14600. */
  14601. modules?: string | string[];
  14602. /**
  14603. * A list of main fields in description files
  14604. */
  14605. mainFields?: (
  14606. | string
  14607. | string[]
  14608. | { name: string | string[]; forceRelative: boolean }
  14609. )[];
  14610. /**
  14611. * A list of main files in directories
  14612. */
  14613. mainFiles?: string[];
  14614. /**
  14615. * A list of additional resolve plugins which should be applied
  14616. */
  14617. plugins?: Plugin[];
  14618. /**
  14619. * A PnP API that should be used - null is "never", undefined is "auto"
  14620. */
  14621. pnpApi?: null | PnpApi;
  14622. /**
  14623. * A list of root paths
  14624. */
  14625. roots?: string[];
  14626. /**
  14627. * The request is already fully specified and no extensions or directories are resolved for it
  14628. */
  14629. fullySpecified?: boolean;
  14630. /**
  14631. * Resolve to a context instead of a file
  14632. */
  14633. resolveToContext?: boolean;
  14634. /**
  14635. * A list of resolve restrictions
  14636. */
  14637. restrictions?: (string | RegExp)[];
  14638. /**
  14639. * Use only the sync constraints of the file system calls
  14640. */
  14641. useSyncFileSystemCalls?: boolean;
  14642. /**
  14643. * Prefer to resolve module requests as relative requests before falling back to modules
  14644. */
  14645. preferRelative?: boolean;
  14646. /**
  14647. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  14648. */
  14649. preferAbsolute?: boolean;
  14650. /**
  14651. * TypeScript config file path or config object with configFile and references
  14652. */
  14653. tsconfig?: string | boolean | TsconfigOptions;
  14654. }
  14655. type ResolveOptionsWithDependencyType = ResolveOptions & {
  14656. dependencyType?: string;
  14657. resolveToContext?: boolean;
  14658. };
  14659. type ResolvePluginInstance =
  14660. | {
  14661. [index: string]: any;
  14662. /**
  14663. * The run point of the plugin, required method.
  14664. */
  14665. apply: (arg0: Resolver) => void;
  14666. }
  14667. | ((this: Resolver, arg1: Resolver) => void);
  14668. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  14669. declare interface ResolvedContextFileSystemInfoEntry {
  14670. safeTime: number;
  14671. timestampHash?: string;
  14672. }
  14673. declare interface ResolvedContextTimestampAndHash {
  14674. safeTime: number;
  14675. timestampHash?: string;
  14676. hash: string;
  14677. }
  14678. declare interface ResolvedOptions {
  14679. /**
  14680. * - platform target properties
  14681. */
  14682. platform: false | PlatformTargetProperties;
  14683. }
  14684. declare abstract class Resolver {
  14685. fileSystem: FileSystem;
  14686. options: ResolveOptionsResolverFactoryObject1;
  14687. hooks: KnownHooks;
  14688. ensureHook(
  14689. name:
  14690. | string
  14691. | AsyncSeriesBailHook<
  14692. [ResolveRequest, ResolveContext],
  14693. null | ResolveRequest
  14694. >
  14695. ): AsyncSeriesBailHook<
  14696. [ResolveRequest, ResolveContext],
  14697. null | ResolveRequest
  14698. >;
  14699. getHook(
  14700. name:
  14701. | string
  14702. | AsyncSeriesBailHook<
  14703. [ResolveRequest, ResolveContext],
  14704. null | ResolveRequest
  14705. >
  14706. ): AsyncSeriesBailHook<
  14707. [ResolveRequest, ResolveContext],
  14708. null | ResolveRequest
  14709. >;
  14710. resolveSync(
  14711. context: ContextTypes,
  14712. path: string,
  14713. request: string
  14714. ): string | false;
  14715. resolve(
  14716. context: ContextTypes,
  14717. path: string,
  14718. request: string,
  14719. resolveContext: ResolveContext,
  14720. callback: (
  14721. err: null | ErrorWithDetail,
  14722. res?: string | false,
  14723. req?: ResolveRequest
  14724. ) => void
  14725. ): void;
  14726. doResolve(
  14727. hook: AsyncSeriesBailHook<
  14728. [ResolveRequest, ResolveContext],
  14729. null | ResolveRequest
  14730. >,
  14731. request: ResolveRequest,
  14732. message: null | string,
  14733. resolveContext: ResolveContext,
  14734. callback: (err?: null | Error, result?: ResolveRequest) => void
  14735. ): void;
  14736. parse(identifier: string): ParsedIdentifier;
  14737. isModule(path: string): boolean;
  14738. isPrivate(path: string): boolean;
  14739. isDirectory(path: string): boolean;
  14740. join(path: string, request: string): string;
  14741. normalize(path: string): string;
  14742. }
  14743. declare interface ResolverCache {
  14744. direct: WeakMap<ResolveOptionsWithDependencyType, ResolverWithOptions>;
  14745. stringified: Map<string, ResolverWithOptions>;
  14746. }
  14747. declare abstract class ResolverFactory {
  14748. hooks: Readonly<{
  14749. resolveOptions: HookMap<
  14750. SyncWaterfallHook<
  14751. [ResolveOptionsWithDependencyType],
  14752. ResolveOptionsWithDependencyType
  14753. >
  14754. >;
  14755. resolver: HookMap<
  14756. SyncHook<
  14757. [
  14758. Resolver,
  14759. ResolveOptionsResolverFactoryObject2,
  14760. ResolveOptionsWithDependencyType
  14761. ]
  14762. >
  14763. >;
  14764. }>;
  14765. cache: Map<string, ResolverCache>;
  14766. get(
  14767. type: string,
  14768. resolveOptions?: ResolveOptionsWithDependencyType
  14769. ): ResolverWithOptions;
  14770. }
  14771. type ResolverWithOptions = Resolver & WithOptions;
  14772. declare interface ResourceDataWithData {
  14773. resource: string;
  14774. path?: string;
  14775. query?: string;
  14776. fragment?: string;
  14777. context?: string;
  14778. data: ResourceSchemeData & Partial<ResolveRequest>;
  14779. }
  14780. declare interface ResourceSchemeData {
  14781. /**
  14782. * mime type of the resource
  14783. */
  14784. mimetype?: string;
  14785. /**
  14786. * additional parameters for the resource
  14787. */
  14788. parameters?: string;
  14789. /**
  14790. * encoding of the resource
  14791. */
  14792. encoding?: false | "base64";
  14793. /**
  14794. * encoded content of the resource
  14795. */
  14796. encodedContent?: string;
  14797. }
  14798. declare abstract class RestoreProvidedData {
  14799. exports: RestoreProvidedDataExports[];
  14800. otherProvided?: null | boolean;
  14801. otherCanMangleProvide?: boolean;
  14802. otherTerminalBinding: boolean;
  14803. serialize(__0: ObjectSerializerContext): void;
  14804. }
  14805. declare interface RestoreProvidedDataExports {
  14806. name: string;
  14807. provided?: null | boolean;
  14808. canMangleProvide?: boolean;
  14809. terminalBinding: boolean;
  14810. exportsInfo?: RestoreProvidedData;
  14811. }
  14812. type Rule = string | RegExp | ((str: string) => boolean);
  14813. declare interface RuleSet {
  14814. /**
  14815. * map of references in the rule set (may grow over time)
  14816. */
  14817. references: Map<string, RuleSetLoaderOptions>;
  14818. /**
  14819. * execute the rule set
  14820. */
  14821. exec: (effectData: EffectData) => Effect[];
  14822. }
  14823. type RuleSetCondition =
  14824. | string
  14825. | RegExp
  14826. | ((value: string) => boolean)
  14827. | RuleSetLogicalConditions
  14828. | RuleSetCondition[];
  14829. type RuleSetConditionAbsolute =
  14830. | string
  14831. | RegExp
  14832. | ((value: string) => boolean)
  14833. | RuleSetLogicalConditionsAbsolute
  14834. | RuleSetConditionAbsolute[];
  14835. type RuleSetConditionOrConditions =
  14836. | string
  14837. | RegExp
  14838. | ((value: string) => boolean)
  14839. | RuleSetLogicalConditions
  14840. | RuleSetCondition[];
  14841. type RuleSetLoaderOptions = string | { [index: string]: any };
  14842. /**
  14843. * Logic operators used in a condition matcher.
  14844. */
  14845. declare interface RuleSetLogicalConditions {
  14846. /**
  14847. * Logical AND.
  14848. */
  14849. and?: RuleSetCondition[];
  14850. /**
  14851. * Logical NOT.
  14852. */
  14853. not?:
  14854. | string
  14855. | RegExp
  14856. | ((value: string) => boolean)
  14857. | RuleSetLogicalConditions
  14858. | RuleSetCondition[];
  14859. /**
  14860. * Logical OR.
  14861. */
  14862. or?: RuleSetCondition[];
  14863. }
  14864. /**
  14865. * Logic operators used in a condition matcher.
  14866. */
  14867. declare interface RuleSetLogicalConditionsAbsolute {
  14868. /**
  14869. * Logical AND.
  14870. */
  14871. and?: RuleSetConditionAbsolute[];
  14872. /**
  14873. * Logical NOT.
  14874. */
  14875. not?:
  14876. | string
  14877. | RegExp
  14878. | ((value: string) => boolean)
  14879. | RuleSetLogicalConditionsAbsolute
  14880. | RuleSetConditionAbsolute[];
  14881. /**
  14882. * Logical OR.
  14883. */
  14884. or?: RuleSetConditionAbsolute[];
  14885. }
  14886. /**
  14887. * A rule description with conditions and effects for modules.
  14888. */
  14889. declare interface RuleSetRule {
  14890. /**
  14891. * Match on import assertions of the dependency.
  14892. */
  14893. assert?: { [index: string]: RuleSetConditionOrConditions };
  14894. /**
  14895. * Match the child compiler name.
  14896. */
  14897. compiler?:
  14898. | string
  14899. | RegExp
  14900. | ((value: string) => boolean)
  14901. | RuleSetLogicalConditions
  14902. | RuleSetCondition[];
  14903. /**
  14904. * Match dependency type.
  14905. */
  14906. dependency?:
  14907. | string
  14908. | RegExp
  14909. | ((value: string) => boolean)
  14910. | RuleSetLogicalConditions
  14911. | RuleSetCondition[];
  14912. /**
  14913. * Match values of properties in the description file (usually package.json).
  14914. */
  14915. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  14916. /**
  14917. * Enforce this rule as pre or post step.
  14918. */
  14919. enforce?: "pre" | "post";
  14920. /**
  14921. * Shortcut for resource.exclude.
  14922. */
  14923. exclude?:
  14924. | string
  14925. | RegExp
  14926. | ((value: string) => boolean)
  14927. | RuleSetLogicalConditionsAbsolute
  14928. | RuleSetConditionAbsolute[];
  14929. /**
  14930. * Enable/Disable extracting source map.
  14931. */
  14932. extractSourceMap?: boolean;
  14933. /**
  14934. * The options for the module generator.
  14935. */
  14936. generator?: { [index: string]: any };
  14937. /**
  14938. * Shortcut for resource.include.
  14939. */
  14940. include?:
  14941. | string
  14942. | RegExp
  14943. | ((value: string) => boolean)
  14944. | RuleSetLogicalConditionsAbsolute
  14945. | RuleSetConditionAbsolute[];
  14946. /**
  14947. * Match the issuer of the module (The module pointing to this module).
  14948. */
  14949. issuer?:
  14950. | string
  14951. | RegExp
  14952. | ((value: string) => boolean)
  14953. | RuleSetLogicalConditionsAbsolute
  14954. | RuleSetConditionAbsolute[];
  14955. /**
  14956. * Match layer of the issuer of this module (The module pointing to this module).
  14957. */
  14958. issuerLayer?:
  14959. | string
  14960. | RegExp
  14961. | ((value: string) => boolean)
  14962. | RuleSetLogicalConditions
  14963. | RuleSetCondition[];
  14964. /**
  14965. * Specifies the layer in which the module should be placed in.
  14966. */
  14967. layer?: string;
  14968. /**
  14969. * Shortcut for use.loader.
  14970. */
  14971. loader?: string;
  14972. /**
  14973. * Match module mimetype when load from Data URI.
  14974. */
  14975. mimetype?:
  14976. | string
  14977. | RegExp
  14978. | ((value: string) => boolean)
  14979. | RuleSetLogicalConditions
  14980. | RuleSetCondition[];
  14981. /**
  14982. * Only execute the first matching rule in this array.
  14983. */
  14984. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  14985. /**
  14986. * Shortcut for use.options.
  14987. */
  14988. options?: string | { [index: string]: any };
  14989. /**
  14990. * Options for parsing.
  14991. */
  14992. parser?: { [index: string]: any };
  14993. /**
  14994. * Match the real resource path of the module.
  14995. */
  14996. realResource?:
  14997. | string
  14998. | RegExp
  14999. | ((value: string) => boolean)
  15000. | RuleSetLogicalConditionsAbsolute
  15001. | RuleSetConditionAbsolute[];
  15002. /**
  15003. * Options for the resolver.
  15004. */
  15005. resolve?: ResolveOptions;
  15006. /**
  15007. * Match the resource path of the module.
  15008. */
  15009. resource?:
  15010. | string
  15011. | RegExp
  15012. | ((value: string) => boolean)
  15013. | RuleSetLogicalConditionsAbsolute
  15014. | RuleSetConditionAbsolute[];
  15015. /**
  15016. * Match the resource fragment of the module.
  15017. */
  15018. resourceFragment?:
  15019. | string
  15020. | RegExp
  15021. | ((value: string) => boolean)
  15022. | RuleSetLogicalConditions
  15023. | RuleSetCondition[];
  15024. /**
  15025. * Match the resource query of the module.
  15026. */
  15027. resourceQuery?:
  15028. | string
  15029. | RegExp
  15030. | ((value: string) => boolean)
  15031. | RuleSetLogicalConditions
  15032. | RuleSetCondition[];
  15033. /**
  15034. * Match and execute these rules when this rule is matched.
  15035. */
  15036. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  15037. /**
  15038. * Match module scheme.
  15039. */
  15040. scheme?:
  15041. | string
  15042. | RegExp
  15043. | ((value: string) => boolean)
  15044. | RuleSetLogicalConditions
  15045. | RuleSetCondition[];
  15046. /**
  15047. * Flags a module as with or without side effects.
  15048. */
  15049. sideEffects?: boolean;
  15050. /**
  15051. * Shortcut for resource.test.
  15052. */
  15053. test?:
  15054. | string
  15055. | RegExp
  15056. | ((value: string) => boolean)
  15057. | RuleSetLogicalConditionsAbsolute
  15058. | RuleSetConditionAbsolute[];
  15059. /**
  15060. * Module type to use for the module.
  15061. */
  15062. type?: string;
  15063. /**
  15064. * Modifiers applied to the module when rule is matched.
  15065. */
  15066. use?:
  15067. | string
  15068. | (
  15069. | undefined
  15070. | null
  15071. | string
  15072. | false
  15073. | 0
  15074. | RuleSetUseFunction
  15075. | {
  15076. /**
  15077. * Unique loader options identifier.
  15078. */
  15079. ident?: string;
  15080. /**
  15081. * Loader name.
  15082. */
  15083. loader?: string;
  15084. /**
  15085. * Loader options.
  15086. */
  15087. options?: string | { [index: string]: any };
  15088. }
  15089. )[]
  15090. | RuleSetUseFunction
  15091. | {
  15092. /**
  15093. * Unique loader options identifier.
  15094. */
  15095. ident?: string;
  15096. /**
  15097. * Loader name.
  15098. */
  15099. loader?: string;
  15100. /**
  15101. * Loader options.
  15102. */
  15103. options?: string | { [index: string]: any };
  15104. };
  15105. /**
  15106. * Match on import attributes of the dependency.
  15107. */
  15108. with?: { [index: string]: RuleSetConditionOrConditions };
  15109. }
  15110. type RuleSetUse =
  15111. | string
  15112. | (
  15113. | undefined
  15114. | null
  15115. | string
  15116. | false
  15117. | 0
  15118. | RuleSetUseFunction
  15119. | {
  15120. /**
  15121. * Unique loader options identifier.
  15122. */
  15123. ident?: string;
  15124. /**
  15125. * Loader name.
  15126. */
  15127. loader?: string;
  15128. /**
  15129. * Loader options.
  15130. */
  15131. options?: string | { [index: string]: any };
  15132. }
  15133. )[]
  15134. | RuleSetUseFunction
  15135. | {
  15136. /**
  15137. * Unique loader options identifier.
  15138. */
  15139. ident?: string;
  15140. /**
  15141. * Loader name.
  15142. */
  15143. loader?: string;
  15144. /**
  15145. * Loader options.
  15146. */
  15147. options?: string | { [index: string]: any };
  15148. };
  15149. type RuleSetUseFunction = (data: EffectData) =>
  15150. | string
  15151. | RuleSetUseFunction
  15152. | {
  15153. /**
  15154. * Unique loader options identifier.
  15155. */
  15156. ident?: string;
  15157. /**
  15158. * Loader name.
  15159. */
  15160. loader?: string;
  15161. /**
  15162. * Loader options.
  15163. */
  15164. options?: string | { [index: string]: any };
  15165. }
  15166. | (
  15167. | undefined
  15168. | null
  15169. | string
  15170. | false
  15171. | 0
  15172. | RuleSetUseFunction
  15173. | {
  15174. /**
  15175. * Unique loader options identifier.
  15176. */
  15177. ident?: string;
  15178. /**
  15179. * Loader name.
  15180. */
  15181. loader?: string;
  15182. /**
  15183. * Loader options.
  15184. */
  15185. options?: string | { [index: string]: any };
  15186. }
  15187. )[];
  15188. type RuleSetUseItem =
  15189. | string
  15190. | RuleSetUseFunction
  15191. | {
  15192. /**
  15193. * Unique loader options identifier.
  15194. */
  15195. ident?: string;
  15196. /**
  15197. * Loader name.
  15198. */
  15199. loader?: string;
  15200. /**
  15201. * Loader options.
  15202. */
  15203. options?: string | { [index: string]: any };
  15204. };
  15205. declare class RuntimeChunkPlugin {
  15206. constructor(options?: {
  15207. /**
  15208. * The name factory for the runtime chunks.
  15209. */
  15210. name?: (entrypoint: { name: string }) => string;
  15211. });
  15212. options: { name: string | ((entrypoint: { name: string }) => string) };
  15213. /**
  15214. * Apply the plugin
  15215. */
  15216. apply(compiler: Compiler): void;
  15217. }
  15218. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  15219. type RuntimeId = string | number;
  15220. declare class RuntimeModule extends Module {
  15221. constructor(name: string, stage?: number);
  15222. name: string;
  15223. stage: number;
  15224. compilation?: Compilation;
  15225. chunk?: Chunk;
  15226. chunkGraph?: ChunkGraph;
  15227. fullHash: boolean;
  15228. dependentHash: boolean;
  15229. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  15230. generate(): null | string;
  15231. getGeneratedCode(): null | string;
  15232. shouldIsolate(): boolean;
  15233. /**
  15234. * Runtime modules without any dependencies to other runtime modules
  15235. */
  15236. static STAGE_NORMAL: number;
  15237. /**
  15238. * Runtime modules with simple dependencies on other runtime modules
  15239. */
  15240. static STAGE_BASIC: number;
  15241. /**
  15242. * Runtime modules which attach to handlers of other runtime modules
  15243. */
  15244. static STAGE_ATTACH: number;
  15245. /**
  15246. * Runtime modules which trigger actions on bootstrap
  15247. */
  15248. static STAGE_TRIGGER: number;
  15249. }
  15250. declare interface RuntimeRequirementsContext {
  15251. /**
  15252. * the chunk graph
  15253. */
  15254. chunkGraph: ChunkGraph;
  15255. /**
  15256. * the code generation results
  15257. */
  15258. codeGenerationResults: CodeGenerationResults;
  15259. }
  15260. type RuntimeSpec = undefined | string | SortableSet<string>;
  15261. declare class RuntimeSpecMap<T, R = T> {
  15262. constructor(clone?: RuntimeSpecMap<T, R>);
  15263. get(runtime: RuntimeSpec): undefined | R;
  15264. has(runtime: RuntimeSpec): boolean;
  15265. set(runtime: RuntimeSpec, value: R): void;
  15266. provide(runtime: RuntimeSpec, computer: () => R): R;
  15267. delete(runtime: RuntimeSpec): void;
  15268. update(runtime: RuntimeSpec, fn: (value?: R) => R): void;
  15269. keys(): RuntimeSpec[];
  15270. values(): IterableIterator<R>;
  15271. get size(): number;
  15272. }
  15273. declare class RuntimeSpecSet {
  15274. constructor(iterable?: Iterable<RuntimeSpec>);
  15275. add(runtime: RuntimeSpec): void;
  15276. has(runtime: RuntimeSpec): boolean;
  15277. get size(): number;
  15278. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  15279. }
  15280. declare abstract class RuntimeTemplate {
  15281. compilation: Compilation;
  15282. outputOptions: OutputNormalizedWithDefaults;
  15283. requestShortener: RequestShortener;
  15284. globalObject: string;
  15285. contentHashReplacement: string;
  15286. isIIFE(): boolean;
  15287. isModule(): boolean;
  15288. isNeutralPlatform(): boolean;
  15289. supportsConst(): boolean;
  15290. supportsMethodShorthand(): boolean;
  15291. supportsArrowFunction(): boolean;
  15292. supportsAsyncFunction(): boolean;
  15293. supportsOptionalChaining(): boolean;
  15294. supportsForOf(): boolean;
  15295. supportsDestructuring(): boolean;
  15296. supportsBigIntLiteral(): boolean;
  15297. supportsDynamicImport(): boolean;
  15298. supportsEcmaScriptModuleSyntax(): boolean;
  15299. supportTemplateLiteral(): boolean;
  15300. supportNodePrefixForCoreModules(): boolean;
  15301. renderNodePrefixForCoreModule(mod: string): string;
  15302. renderConst(): "var" | "const";
  15303. returningFunction(returnValue: string, args?: string): string;
  15304. basicFunction(args: string, body: string | string[]): string;
  15305. concatenation(...args: (string | { expr: string })[]): string;
  15306. expressionFunction(expression: string, args?: string): string;
  15307. emptyFunction(): string;
  15308. destructureArray(items: string[], value: string): string;
  15309. destructureObject(items: string[], value: string): string;
  15310. iife(args: string, body: string): string;
  15311. forEach(variable: string, array: string, body: string | string[]): string;
  15312. /**
  15313. * Add a comment
  15314. */
  15315. comment(__0: {
  15316. /**
  15317. * request string used originally
  15318. */
  15319. request?: string;
  15320. /**
  15321. * name of the chunk referenced
  15322. */
  15323. chunkName?: null | string;
  15324. /**
  15325. * reason information of the chunk
  15326. */
  15327. chunkReason?: string;
  15328. /**
  15329. * additional message
  15330. */
  15331. message?: string;
  15332. /**
  15333. * name of the export
  15334. */
  15335. exportName?: string;
  15336. }): string;
  15337. throwMissingModuleErrorBlock(__0: {
  15338. /**
  15339. * request string used originally
  15340. */
  15341. request?: string;
  15342. }): string;
  15343. throwMissingModuleErrorFunction(__0: {
  15344. /**
  15345. * request string used originally
  15346. */
  15347. request?: string;
  15348. }): string;
  15349. missingModule(__0: {
  15350. /**
  15351. * request string used originally
  15352. */
  15353. request?: string;
  15354. }): string;
  15355. missingModuleStatement(__0: {
  15356. /**
  15357. * request string used originally
  15358. */
  15359. request?: string;
  15360. }): string;
  15361. missingModulePromise(__0: {
  15362. /**
  15363. * request string used originally
  15364. */
  15365. request?: string;
  15366. }): string;
  15367. weakError(__0: {
  15368. /**
  15369. * the chunk graph
  15370. */
  15371. chunkGraph: ChunkGraph;
  15372. /**
  15373. * the module
  15374. */
  15375. module: Module;
  15376. /**
  15377. * the request that should be printed as comment
  15378. */
  15379. request?: string;
  15380. /**
  15381. * expression to use as id expression
  15382. */
  15383. idExpr?: string;
  15384. /**
  15385. * which kind of code should be returned
  15386. */
  15387. type: "promise" | "expression" | "statements";
  15388. }): string;
  15389. moduleId(__0: {
  15390. /**
  15391. * the module
  15392. */
  15393. module: Module;
  15394. /**
  15395. * the chunk graph
  15396. */
  15397. chunkGraph: ChunkGraph;
  15398. /**
  15399. * the request that should be printed as comment
  15400. */
  15401. request?: string;
  15402. /**
  15403. * if the dependency is weak (will create a nice error message)
  15404. */
  15405. weak?: boolean;
  15406. }): string;
  15407. moduleRaw(__0: {
  15408. /**
  15409. * the module
  15410. */
  15411. module: null | Module;
  15412. /**
  15413. * the chunk graph
  15414. */
  15415. chunkGraph: ChunkGraph;
  15416. /**
  15417. * the request that should be printed as comment
  15418. */
  15419. request?: string;
  15420. /**
  15421. * if the dependency is weak (will create a nice error message)
  15422. */
  15423. weak?: boolean;
  15424. /**
  15425. * if set, will be filled with runtime requirements
  15426. */
  15427. runtimeRequirements: Set<string>;
  15428. }): string;
  15429. moduleExports(__0: {
  15430. /**
  15431. * the module
  15432. */
  15433. module: null | Module;
  15434. /**
  15435. * the chunk graph
  15436. */
  15437. chunkGraph: ChunkGraph;
  15438. /**
  15439. * the request that should be printed as comment
  15440. */
  15441. request: string;
  15442. /**
  15443. * if the dependency is weak (will create a nice error message)
  15444. */
  15445. weak?: boolean;
  15446. /**
  15447. * if set, will be filled with runtime requirements
  15448. */
  15449. runtimeRequirements: Set<string>;
  15450. }): string;
  15451. moduleNamespace(__0: {
  15452. /**
  15453. * the module
  15454. */
  15455. module: Module;
  15456. /**
  15457. * the chunk graph
  15458. */
  15459. chunkGraph: ChunkGraph;
  15460. /**
  15461. * the request that should be printed as comment
  15462. */
  15463. request: string;
  15464. /**
  15465. * if the current module is in strict esm mode
  15466. */
  15467. strict?: boolean;
  15468. /**
  15469. * if the dependency is weak (will create a nice error message)
  15470. */
  15471. weak?: boolean;
  15472. /**
  15473. * if set, will be filled with runtime requirements
  15474. */
  15475. runtimeRequirements: Set<string>;
  15476. }): string;
  15477. moduleNamespacePromise(__0: {
  15478. /**
  15479. * the chunk graph
  15480. */
  15481. chunkGraph: ChunkGraph;
  15482. /**
  15483. * the current dependencies block
  15484. */
  15485. block?: AsyncDependenciesBlock;
  15486. /**
  15487. * the module
  15488. */
  15489. module: Module;
  15490. /**
  15491. * the request that should be printed as comment
  15492. */
  15493. request: string;
  15494. /**
  15495. * a message for the comment
  15496. */
  15497. message: string;
  15498. /**
  15499. * if the current module is in strict esm mode
  15500. */
  15501. strict?: boolean;
  15502. /**
  15503. * if the dependency is weak (will create a nice error message)
  15504. */
  15505. weak?: boolean;
  15506. /**
  15507. * dependency
  15508. */
  15509. dependency: Dependency;
  15510. /**
  15511. * if set, will be filled with runtime requirements
  15512. */
  15513. runtimeRequirements: Set<string>;
  15514. }): string;
  15515. runtimeConditionExpression(__0: {
  15516. /**
  15517. * the chunk graph
  15518. */
  15519. chunkGraph: ChunkGraph;
  15520. /**
  15521. * runtime for which this code will be generated
  15522. */
  15523. runtime?: RuntimeSpec;
  15524. /**
  15525. * only execute the statement in some runtimes
  15526. */
  15527. runtimeCondition?: string | boolean | SortableSet<string>;
  15528. /**
  15529. * if set, will be filled with runtime requirements
  15530. */
  15531. runtimeRequirements: Set<string>;
  15532. }): string;
  15533. importStatement(__0: {
  15534. /**
  15535. * whether a new variable should be created or the existing one updated
  15536. */
  15537. update?: boolean;
  15538. /**
  15539. * the module
  15540. */
  15541. module: Module;
  15542. /**
  15543. * module in which the statement is emitted
  15544. */
  15545. originModule: Module;
  15546. /**
  15547. * the module graph
  15548. */
  15549. moduleGraph: ModuleGraph;
  15550. /**
  15551. * the chunk graph
  15552. */
  15553. chunkGraph: ChunkGraph;
  15554. /**
  15555. * if set, will be filled with runtime requirements
  15556. */
  15557. runtimeRequirements: Set<string>;
  15558. /**
  15559. * name of the import variable
  15560. */
  15561. importVar: string;
  15562. /**
  15563. * the request that should be printed as comment
  15564. */
  15565. request?: string;
  15566. /**
  15567. * true, if this is a weak dependency
  15568. */
  15569. weak?: boolean;
  15570. /**
  15571. * module dependency
  15572. */
  15573. dependency?: ModuleDependency;
  15574. }): [string, string];
  15575. exportFromImport<GenerateContext>(__0: {
  15576. /**
  15577. * the module graph
  15578. */
  15579. moduleGraph: ModuleGraph;
  15580. /**
  15581. * the chunk graph
  15582. */
  15583. chunkGraph: ChunkGraph;
  15584. /**
  15585. * the module
  15586. */
  15587. module: Module;
  15588. /**
  15589. * the request
  15590. */
  15591. request: string;
  15592. /**
  15593. * the export name
  15594. */
  15595. exportName: string | string[];
  15596. /**
  15597. * the origin module
  15598. */
  15599. originModule: Module;
  15600. /**
  15601. * true, if location is safe for ASI, a bracket can be emitted
  15602. */
  15603. asiSafe?: boolean;
  15604. /**
  15605. * true, if expression will be called
  15606. */
  15607. isCall?: boolean;
  15608. /**
  15609. * when false, call context will not be preserved
  15610. */
  15611. callContext: null | boolean;
  15612. /**
  15613. * when true and accessing the default exports, interop code will be generated
  15614. */
  15615. defaultInterop: boolean;
  15616. /**
  15617. * the identifier name of the import variable
  15618. */
  15619. importVar: string;
  15620. /**
  15621. * init fragments will be added here
  15622. */
  15623. initFragments: InitFragment<GenerateContext>[];
  15624. /**
  15625. * runtime for which this code will be generated
  15626. */
  15627. runtime: RuntimeSpec;
  15628. /**
  15629. * if set, will be filled with runtime requirements
  15630. */
  15631. runtimeRequirements: Set<string>;
  15632. /**
  15633. * module dependency
  15634. */
  15635. dependency: ModuleDependency;
  15636. }): string;
  15637. blockPromise(__0: {
  15638. /**
  15639. * the async block
  15640. */
  15641. block?: AsyncDependenciesBlock;
  15642. /**
  15643. * the message
  15644. */
  15645. message: string;
  15646. /**
  15647. * the chunk graph
  15648. */
  15649. chunkGraph: ChunkGraph;
  15650. /**
  15651. * if set, will be filled with runtime requirements
  15652. */
  15653. runtimeRequirements: Set<string>;
  15654. }): string;
  15655. asyncModuleFactory(__0: {
  15656. /**
  15657. * the async block
  15658. */
  15659. block: AsyncDependenciesBlock;
  15660. /**
  15661. * the chunk graph
  15662. */
  15663. chunkGraph: ChunkGraph;
  15664. /**
  15665. * if set, will be filled with runtime requirements
  15666. */
  15667. runtimeRequirements: Set<string>;
  15668. /**
  15669. * request string used originally
  15670. */
  15671. request?: string;
  15672. }): string;
  15673. syncModuleFactory(__0: {
  15674. /**
  15675. * the dependency
  15676. */
  15677. dependency: Dependency;
  15678. /**
  15679. * the chunk graph
  15680. */
  15681. chunkGraph: ChunkGraph;
  15682. /**
  15683. * if set, will be filled with runtime requirements
  15684. */
  15685. runtimeRequirements: Set<string>;
  15686. /**
  15687. * request string used originally
  15688. */
  15689. request?: string;
  15690. }): string;
  15691. defineEsModuleFlagStatement(__0: {
  15692. /**
  15693. * the name of the exports object
  15694. */
  15695. exportsArgument: string;
  15696. /**
  15697. * if set, will be filled with runtime requirements
  15698. */
  15699. runtimeRequirements: Set<string>;
  15700. }): string;
  15701. }
  15702. declare abstract class RuntimeValue {
  15703. fn: (value: {
  15704. module: NormalModule;
  15705. key: string;
  15706. readonly version: ValueCacheVersion;
  15707. }) => CodeValuePrimitive;
  15708. options: true | RuntimeValueOptions;
  15709. get fileDependencies(): true | string[];
  15710. exec(
  15711. parser: JavascriptParser,
  15712. valueCacheVersions: Map<string, ValueCacheVersion>,
  15713. key: string
  15714. ): CodeValuePrimitive;
  15715. getCacheVersion(): undefined | string;
  15716. }
  15717. declare interface RuntimeValueOptions {
  15718. fileDependencies?: string[];
  15719. contextDependencies?: string[];
  15720. missingDependencies?: string[];
  15721. buildDependencies?: string[];
  15722. version?: string | (() => string);
  15723. }
  15724. /**
  15725. * Helper function for joining two ranges into a single range. This is useful
  15726. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  15727. * to create the range of the _parent node_.
  15728. */
  15729. declare interface ScopeInfo {
  15730. definitions: StackedMap<string, VariableInfo | ScopeInfo>;
  15731. topLevelScope: boolean | "arrow";
  15732. inShorthand: string | boolean;
  15733. inTaggedTemplateTag: boolean;
  15734. inTry: boolean;
  15735. isStrict: boolean;
  15736. isAsmJs: boolean;
  15737. terminated?: 1 | 2;
  15738. }
  15739. declare interface Selector<A, B> {
  15740. (input: A): undefined | null | B;
  15741. }
  15742. declare abstract class Serializer<DeserializedValue, SerializedValue, Context> {
  15743. serializeMiddlewares: SerializerMiddleware<any, any, any>[];
  15744. deserializeMiddlewares: SerializerMiddleware<any, any, any>[];
  15745. context?: Context;
  15746. serialize<ExtendedContext>(
  15747. obj: DeserializedValue | Promise<DeserializedValue>,
  15748. context: Context & ExtendedContext
  15749. ): Promise<SerializedValue>;
  15750. deserialize<ExtendedContext>(
  15751. value: SerializedValue | Promise<SerializedValue>,
  15752. context: Context & ExtendedContext
  15753. ): Promise<DeserializedValue>;
  15754. }
  15755. declare abstract class SerializerMiddleware<
  15756. DeserializedType,
  15757. SerializedType,
  15758. Context
  15759. > {
  15760. serialize(
  15761. data: DeserializedType,
  15762. context: Context
  15763. ): null | SerializedType | Promise<SerializedType>;
  15764. deserialize(
  15765. data: SerializedType,
  15766. context: Context
  15767. ): DeserializedType | Promise<DeserializedType>;
  15768. }
  15769. type ServerLazyCompilationBackend =
  15770. | ServerImportHttp<typeof IncomingMessage>
  15771. | ServerImportHttps<typeof IncomingMessage>;
  15772. declare interface SetIterator<T> extends IteratorObject<T, undefined> {
  15773. [Symbol.iterator](): SetIterator<T>;
  15774. [Symbol.dispose](): void;
  15775. }
  15776. declare class SharePlugin {
  15777. constructor(options: SharePluginOptions);
  15778. /**
  15779. * Apply the plugin
  15780. */
  15781. apply(compiler: Compiler): void;
  15782. }
  15783. /**
  15784. * Options for shared modules.
  15785. */
  15786. declare interface SharePluginOptions {
  15787. /**
  15788. * Share scope name used for all shared modules (defaults to 'default').
  15789. */
  15790. shareScope?: string;
  15791. /**
  15792. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  15793. */
  15794. shared: Shared;
  15795. }
  15796. type Shared = (string | SharedObject)[] | SharedObject;
  15797. /**
  15798. * Advanced configuration for modules that should be shared in the share scope.
  15799. */
  15800. declare interface SharedConfig {
  15801. /**
  15802. * 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.
  15803. */
  15804. eager?: boolean;
  15805. /**
  15806. * 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.
  15807. */
  15808. import?: string | false;
  15809. /**
  15810. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  15811. */
  15812. packageName?: string;
  15813. /**
  15814. * Version requirement from module in share scope.
  15815. */
  15816. requiredVersion?: string | false;
  15817. /**
  15818. * Module is looked up under this key from the share scope.
  15819. */
  15820. shareKey?: string;
  15821. /**
  15822. * Share scope name.
  15823. */
  15824. shareScope?: string;
  15825. /**
  15826. * Allow only a single version of the shared module in share scope (disabled by default).
  15827. */
  15828. singleton?: boolean;
  15829. /**
  15830. * 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).
  15831. */
  15832. strictVersion?: boolean;
  15833. /**
  15834. * Version of the provided module. Will replace lower matching versions, but not higher.
  15835. */
  15836. version?: string | false;
  15837. }
  15838. /**
  15839. * 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.
  15840. */
  15841. declare interface SharedObject {
  15842. [index: string]: string | SharedConfig;
  15843. }
  15844. declare class SideEffectsFlagPlugin {
  15845. constructor(analyseSource?: boolean);
  15846. /**
  15847. * Apply the plugin
  15848. */
  15849. apply(compiler: Compiler): void;
  15850. static moduleHasSideEffects(
  15851. moduleName: string,
  15852. flagValue: SideEffectsFlagValue,
  15853. cache: Map<string, RegExp>
  15854. ): undefined | boolean;
  15855. }
  15856. type SideEffectsFlagValue = undefined | string | boolean | string[];
  15857. type SimpleType = "string" | "number" | "boolean";
  15858. declare class SizeOnlySource extends Source {
  15859. constructor(size: number);
  15860. }
  15861. declare abstract class Snapshot {
  15862. startTime?: number;
  15863. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  15864. fileHashes?: Map<string, null | string>;
  15865. fileTshs?: Map<string, null | string | TimestampAndHash>;
  15866. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  15867. contextHashes?: Map<string, null | string>;
  15868. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  15869. missingExistence?: Map<string, boolean>;
  15870. managedItemInfo?: Map<string, string>;
  15871. managedFiles?: Set<string>;
  15872. managedContexts?: Set<string>;
  15873. managedMissing?: Set<string>;
  15874. children?: Set<Snapshot>;
  15875. hasStartTime(): boolean;
  15876. setStartTime(value: number): void;
  15877. setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
  15878. hasFileTimestamps(): boolean;
  15879. setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
  15880. hasFileHashes(): boolean;
  15881. setFileHashes(value: Map<string, null | string>): void;
  15882. hasFileTshs(): boolean;
  15883. setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
  15884. hasContextTimestamps(): boolean;
  15885. setContextTimestamps(
  15886. value: Map<string, null | ResolvedContextFileSystemInfoEntry>
  15887. ): void;
  15888. hasContextHashes(): boolean;
  15889. setContextHashes(value: Map<string, null | string>): void;
  15890. hasContextTshs(): boolean;
  15891. setContextTshs(
  15892. value: Map<string, null | ResolvedContextTimestampAndHash>
  15893. ): void;
  15894. hasMissingExistence(): boolean;
  15895. setMissingExistence(value: Map<string, boolean>): void;
  15896. hasManagedItemInfo(): boolean;
  15897. setManagedItemInfo(value: Map<string, string>): void;
  15898. hasManagedFiles(): boolean;
  15899. setManagedFiles(value: Set<string>): void;
  15900. hasManagedContexts(): boolean;
  15901. setManagedContexts(value: Set<string>): void;
  15902. hasManagedMissing(): boolean;
  15903. setManagedMissing(value: Set<string>): void;
  15904. hasChildren(): boolean;
  15905. setChildren(value: Set<Snapshot>): void;
  15906. addChild(child: Snapshot): void;
  15907. serialize(__0: ObjectSerializerContext): void;
  15908. deserialize(__0: ObjectDeserializerContext): void;
  15909. getFileIterable(): Iterable<string>;
  15910. getContextIterable(): Iterable<string>;
  15911. getMissingIterable(): Iterable<string>;
  15912. }
  15913. type SnapshotNormalizedWithDefaults = SnapshotOptionsWebpackOptions & {
  15914. managedPaths: (string | RegExp)[];
  15915. unmanagedPaths: (string | RegExp)[];
  15916. immutablePaths: (string | RegExp)[];
  15917. resolveBuildDependencies: {
  15918. /**
  15919. * Use hashes of the content of the files/directories to determine invalidation.
  15920. */
  15921. hash?: boolean;
  15922. /**
  15923. * Use timestamps of the files/directories to determine invalidation.
  15924. */
  15925. timestamp?: boolean;
  15926. };
  15927. buildDependencies: {
  15928. /**
  15929. * Use hashes of the content of the files/directories to determine invalidation.
  15930. */
  15931. hash?: boolean;
  15932. /**
  15933. * Use timestamps of the files/directories to determine invalidation.
  15934. */
  15935. timestamp?: boolean;
  15936. };
  15937. module: {
  15938. /**
  15939. * Use hashes of the content of the files/directories to determine invalidation.
  15940. */
  15941. hash?: boolean;
  15942. /**
  15943. * Use timestamps of the files/directories to determine invalidation.
  15944. */
  15945. timestamp?: boolean;
  15946. };
  15947. resolve: {
  15948. /**
  15949. * Use hashes of the content of the files/directories to determine invalidation.
  15950. */
  15951. hash?: boolean;
  15952. /**
  15953. * Use timestamps of the files/directories to determine invalidation.
  15954. */
  15955. timestamp?: boolean;
  15956. };
  15957. };
  15958. declare interface SnapshotOptionsFileSystemInfo {
  15959. /**
  15960. * should use hash to snapshot
  15961. */
  15962. hash?: boolean;
  15963. /**
  15964. * should use timestamp to snapshot
  15965. */
  15966. timestamp?: boolean;
  15967. }
  15968. /**
  15969. * Options affecting how file system snapshots are created and validated.
  15970. */
  15971. declare interface SnapshotOptionsWebpackOptions {
  15972. /**
  15973. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  15974. */
  15975. buildDependencies?: {
  15976. /**
  15977. * Use hashes of the content of the files/directories to determine invalidation.
  15978. */
  15979. hash?: boolean;
  15980. /**
  15981. * Use timestamps of the files/directories to determine invalidation.
  15982. */
  15983. timestamp?: boolean;
  15984. };
  15985. /**
  15986. * Options for snapshotting the context module to determine if it needs to be built again.
  15987. */
  15988. contextModule?: {
  15989. /**
  15990. * Use hashes of the content of the files/directories to determine invalidation.
  15991. */
  15992. hash?: boolean;
  15993. /**
  15994. * Use timestamps of the files/directories to determine invalidation.
  15995. */
  15996. timestamp?: boolean;
  15997. };
  15998. /**
  15999. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  16000. */
  16001. immutablePaths?: (string | RegExp)[];
  16002. /**
  16003. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  16004. */
  16005. managedPaths?: (string | RegExp)[];
  16006. /**
  16007. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  16008. */
  16009. module?: {
  16010. /**
  16011. * Use hashes of the content of the files/directories to determine invalidation.
  16012. */
  16013. hash?: boolean;
  16014. /**
  16015. * Use timestamps of the files/directories to determine invalidation.
  16016. */
  16017. timestamp?: boolean;
  16018. };
  16019. /**
  16020. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  16021. */
  16022. resolve?: {
  16023. /**
  16024. * Use hashes of the content of the files/directories to determine invalidation.
  16025. */
  16026. hash?: boolean;
  16027. /**
  16028. * Use timestamps of the files/directories to determine invalidation.
  16029. */
  16030. timestamp?: boolean;
  16031. };
  16032. /**
  16033. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  16034. */
  16035. resolveBuildDependencies?: {
  16036. /**
  16037. * Use hashes of the content of the files/directories to determine invalidation.
  16038. */
  16039. hash?: boolean;
  16040. /**
  16041. * Use timestamps of the files/directories to determine invalidation.
  16042. */
  16043. timestamp?: boolean;
  16044. };
  16045. /**
  16046. * List of paths that are not managed by a package manager and the contents are subject to change.
  16047. */
  16048. unmanagedPaths?: (string | RegExp)[];
  16049. }
  16050. declare interface SortFunction<T> {
  16051. (a: T, b: T): number;
  16052. }
  16053. declare abstract class SortableSet<T> extends Set<T> {
  16054. /**
  16055. * Sort with a comparer function
  16056. */
  16057. sortWith(sortFn?: SortFunction<T>): void;
  16058. sort(): SortableSet<T>;
  16059. /**
  16060. * Get data from cache
  16061. */
  16062. getFromCache<R extends unknown>(fn: (set: SortableSet<T>) => R): R;
  16063. /**
  16064. * Get data from cache (ignoring sorting)
  16065. */
  16066. getFromUnorderedCache<R>(fn: (set: SortableSet<T>) => R): R;
  16067. toJSON(): T[];
  16068. }
  16069. declare class Source {
  16070. constructor();
  16071. source(): SourceValue;
  16072. buffer(): Buffer;
  16073. size(): number;
  16074. map(options?: MapOptions): null | RawSourceMap;
  16075. sourceAndMap(options?: MapOptions): SourceAndMap;
  16076. updateHash(hash: HashLike): void;
  16077. }
  16078. declare interface SourceAndMap {
  16079. /**
  16080. * source
  16081. */
  16082. source: SourceValue;
  16083. /**
  16084. * map
  16085. */
  16086. map: null | RawSourceMap;
  16087. }
  16088. declare interface SourceLike {
  16089. /**
  16090. * source
  16091. */
  16092. source: () => SourceValue;
  16093. /**
  16094. * buffer
  16095. */
  16096. buffer?: () => Buffer;
  16097. /**
  16098. * size
  16099. */
  16100. size?: () => number;
  16101. /**
  16102. * map
  16103. */
  16104. map?: (options?: MapOptions) => null | RawSourceMap;
  16105. /**
  16106. * source and map
  16107. */
  16108. sourceAndMap?: (options?: MapOptions) => SourceAndMap;
  16109. /**
  16110. * hash updater
  16111. */
  16112. updateHash?: (hash: HashLike) => void;
  16113. }
  16114. declare class SourceMapDevToolPlugin {
  16115. constructor(options?: SourceMapDevToolPluginOptions);
  16116. sourceMapFilename?: null | string | false;
  16117. sourceMappingURLComment:
  16118. | string
  16119. | false
  16120. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  16121. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  16122. fallbackModuleFilenameTemplate: DevtoolFallbackModuleFilenameTemplate;
  16123. namespace: string;
  16124. options: SourceMapDevToolPluginOptions;
  16125. /**
  16126. * Apply the plugin
  16127. */
  16128. apply(compiler: Compiler): void;
  16129. }
  16130. declare interface SourceMapDevToolPluginOptions {
  16131. /**
  16132. * 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.
  16133. */
  16134. append?:
  16135. | null
  16136. | string
  16137. | false
  16138. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  16139. /**
  16140. * Indicates whether column mappings should be used (defaults to true).
  16141. */
  16142. columns?: boolean;
  16143. /**
  16144. * Emit debug IDs into source and SourceMap.
  16145. */
  16146. debugIds?: boolean;
  16147. /**
  16148. * Exclude modules that match the given value from source map generation.
  16149. */
  16150. exclude?: string | RegExp | ((str: string) => boolean) | Rule[];
  16151. /**
  16152. * 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.
  16153. */
  16154. fallbackModuleFilenameTemplate?:
  16155. | string
  16156. | ((context: ModuleFilenameTemplateContext) => string);
  16157. /**
  16158. * Path prefix to which the [file] placeholder is relative to.
  16159. */
  16160. fileContext?: string;
  16161. /**
  16162. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  16163. */
  16164. filename?: null | string | false;
  16165. /**
  16166. * Decide whether to ignore source files that match the specified value in the SourceMap.
  16167. */
  16168. ignoreList?: string | RegExp | ((str: string) => boolean) | Rule[];
  16169. /**
  16170. * Include source maps for module paths that match the given value.
  16171. */
  16172. include?: string | RegExp | ((str: string) => boolean) | Rule[];
  16173. /**
  16174. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  16175. */
  16176. module?: boolean;
  16177. /**
  16178. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  16179. */
  16180. moduleFilenameTemplate?:
  16181. | string
  16182. | ((context: ModuleFilenameTemplateContext) => string);
  16183. /**
  16184. * Namespace prefix to allow multiple webpack roots in the devtools.
  16185. */
  16186. namespace?: string;
  16187. /**
  16188. * Omit the 'sourceContents' array from the SourceMap.
  16189. */
  16190. noSources?: boolean;
  16191. /**
  16192. * Provide a custom public path for the SourceMapping comment.
  16193. */
  16194. publicPath?: string;
  16195. /**
  16196. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  16197. */
  16198. sourceRoot?: string;
  16199. /**
  16200. * Include source maps for modules based on their extension (defaults to .js and .css).
  16201. */
  16202. test?: string | RegExp | ((str: string) => boolean) | Rule[];
  16203. }
  16204. declare class SourceMapSource extends Source {
  16205. constructor(
  16206. value: string | Buffer,
  16207. name: string,
  16208. sourceMap?: string | Buffer | RawSourceMap,
  16209. originalSource?: string | Buffer,
  16210. innerSourceMap?: null | string | Buffer | RawSourceMap,
  16211. removeOriginalSource?: boolean
  16212. );
  16213. getArgsAsBuffers(): [
  16214. Buffer,
  16215. string,
  16216. Buffer,
  16217. undefined | Buffer,
  16218. undefined | Buffer,
  16219. undefined | boolean
  16220. ];
  16221. streamChunks(
  16222. options: StreamChunksOptions,
  16223. onChunk: (
  16224. chunk: undefined | string,
  16225. generatedLine: number,
  16226. generatedColumn: number,
  16227. sourceIndex: number,
  16228. originalLine: number,
  16229. originalColumn: number,
  16230. nameIndex: number
  16231. ) => void,
  16232. onSource: (
  16233. sourceIndex: number,
  16234. source: null | string,
  16235. sourceContent?: string
  16236. ) => void,
  16237. onName: (nameIndex: number, name: string) => void
  16238. ): GeneratedSourceInfo;
  16239. }
  16240. declare interface SourcePosition {
  16241. line: number;
  16242. column?: number;
  16243. }
  16244. type SourceValue = string | Buffer;
  16245. declare interface SplitChunksOptions {
  16246. chunksFilter: (chunk: Chunk) => undefined | boolean;
  16247. defaultSizeTypes: string[];
  16248. minSize: SplitChunksSizes;
  16249. minSizeReduction: SplitChunksSizes;
  16250. minRemainingSize: SplitChunksSizes;
  16251. enforceSizeThreshold: SplitChunksSizes;
  16252. maxInitialSize: SplitChunksSizes;
  16253. maxAsyncSize: SplitChunksSizes;
  16254. minChunks: number;
  16255. maxAsyncRequests: number;
  16256. maxInitialRequests: number;
  16257. hidePathInfo: boolean;
  16258. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  16259. automaticNameDelimiter: string;
  16260. getCacheGroups: (
  16261. module: Module,
  16262. context: CacheGroupsContext
  16263. ) => null | CacheGroupSource[];
  16264. getName: (module: Module, chunks: Chunk[], key: string) => undefined | string;
  16265. usedExports: boolean;
  16266. fallbackCacheGroup: FallbackCacheGroup;
  16267. }
  16268. declare class SplitChunksPlugin {
  16269. constructor(options?: OptimizationSplitChunksOptions);
  16270. options: SplitChunksOptions;
  16271. /**
  16272. * Apply the plugin
  16273. */
  16274. apply(compiler: Compiler): void;
  16275. }
  16276. declare interface SplitChunksSizes {
  16277. [index: string]: number;
  16278. }
  16279. declare interface SplitData {
  16280. id?: string | number;
  16281. hash?: string;
  16282. modules: string[];
  16283. size: number;
  16284. }
  16285. declare abstract class StackedMap<K, V> {
  16286. map: Map<K, InternalCell<V>>;
  16287. stack: Map<K, InternalCell<V>>[];
  16288. set(item: K, value: V): void;
  16289. delete(item: K): void;
  16290. has(item: K): boolean;
  16291. get(item: K): Cell<V>;
  16292. asArray(): K[];
  16293. asSet(): Set<K>;
  16294. asPairArray(): [K, Cell<V>][];
  16295. asMap(): Map<K, Cell<V>>;
  16296. get size(): number;
  16297. createChild(): StackedMap<K, V>;
  16298. }
  16299. declare interface StartupRenderContext {
  16300. /**
  16301. * the chunk
  16302. */
  16303. chunk: Chunk;
  16304. /**
  16305. * the dependency templates
  16306. */
  16307. dependencyTemplates: DependencyTemplates;
  16308. /**
  16309. * the runtime template
  16310. */
  16311. runtimeTemplate: RuntimeTemplate;
  16312. /**
  16313. * the module graph
  16314. */
  16315. moduleGraph: ModuleGraph;
  16316. /**
  16317. * the chunk graph
  16318. */
  16319. chunkGraph: ChunkGraph;
  16320. /**
  16321. * results of code generation
  16322. */
  16323. codeGenerationResults: CodeGenerationResults;
  16324. /**
  16325. * rendering in strict context
  16326. */
  16327. strictMode?: boolean;
  16328. /**
  16329. * inlined
  16330. */
  16331. inlined: boolean;
  16332. /**
  16333. * the inlined entry module is wrapped in an IIFE
  16334. */
  16335. inlinedInIIFE?: boolean;
  16336. }
  16337. declare interface StatFs {
  16338. (
  16339. path: PathLikeFs,
  16340. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16341. ): void;
  16342. (
  16343. path: PathLikeFs,
  16344. options: undefined | (StatOptions & { bigint?: false }),
  16345. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16346. ): void;
  16347. (
  16348. path: PathLikeFs,
  16349. options: StatOptions & { bigint: true },
  16350. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  16351. ): void;
  16352. (
  16353. path: PathLikeFs,
  16354. options: undefined | StatOptions,
  16355. callback: (
  16356. err: null | NodeJS.ErrnoException,
  16357. result?: IStats | IBigIntStats
  16358. ) => void
  16359. ): void;
  16360. }
  16361. declare interface StatOptions {
  16362. bigint?: boolean;
  16363. }
  16364. declare interface StatSync {
  16365. (path: PathLikeFs, options?: undefined): IStats;
  16366. (
  16367. path: PathLikeFs,
  16368. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  16369. ): undefined | IStats;
  16370. (
  16371. path: PathLikeFs,
  16372. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  16373. ): undefined | IBigIntStats;
  16374. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  16375. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  16376. (
  16377. path: PathLikeFs,
  16378. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  16379. ): IStats | IBigIntStats;
  16380. (
  16381. path: PathLikeFs,
  16382. options?: StatSyncOptions
  16383. ): undefined | IStats | IBigIntStats;
  16384. }
  16385. declare interface StatSyncOptions {
  16386. bigint?: boolean;
  16387. throwIfNoEntry?: boolean;
  16388. }
  16389. declare interface StatTypes {
  16390. (
  16391. path: PathLikeTypes,
  16392. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16393. ): void;
  16394. (
  16395. path: PathLikeTypes,
  16396. options: undefined | (StatOptions & { bigint?: false }),
  16397. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16398. ): void;
  16399. (
  16400. path: PathLikeTypes,
  16401. options: StatOptions & { bigint: true },
  16402. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  16403. ): void;
  16404. (
  16405. path: PathLikeTypes,
  16406. options: undefined | StatOptions,
  16407. callback: (
  16408. err: null | NodeJS.ErrnoException,
  16409. result?: IStats | IBigIntStats
  16410. ) => void
  16411. ): void;
  16412. }
  16413. type Statement =
  16414. | FunctionDeclaration
  16415. | VariableDeclaration
  16416. | ClassDeclaration
  16417. | ExpressionStatement
  16418. | BlockStatement
  16419. | StaticBlock
  16420. | EmptyStatement
  16421. | DebuggerStatement
  16422. | WithStatement
  16423. | ReturnStatement
  16424. | LabeledStatement
  16425. | BreakStatement
  16426. | ContinueStatement
  16427. | IfStatement
  16428. | SwitchStatement
  16429. | ThrowStatement
  16430. | TryStatement
  16431. | WhileStatement
  16432. | DoWhileStatement
  16433. | ForStatement
  16434. | ForInStatement
  16435. | ForOfStatement;
  16436. type StatementPathItem =
  16437. | ImportDeclaration
  16438. | ExportNamedDeclaration
  16439. | ExportAllDeclaration
  16440. | ImportExpressionImport
  16441. | UnaryExpression
  16442. | ArrayExpression
  16443. | ArrowFunctionExpression
  16444. | AssignmentExpression
  16445. | AwaitExpression
  16446. | BinaryExpression
  16447. | SimpleCallExpression
  16448. | NewExpression
  16449. | ChainExpression
  16450. | ClassExpression
  16451. | ConditionalExpression
  16452. | FunctionExpression
  16453. | Identifier
  16454. | SimpleLiteral
  16455. | RegExpLiteral
  16456. | BigIntLiteral
  16457. | LogicalExpression
  16458. | MemberExpression
  16459. | MetaProperty
  16460. | ObjectExpression
  16461. | SequenceExpression
  16462. | TaggedTemplateExpression
  16463. | TemplateLiteral
  16464. | ThisExpression
  16465. | UpdateExpression
  16466. | YieldExpression
  16467. | FunctionDeclaration
  16468. | MaybeNamedFunctionDeclaration
  16469. | VariableDeclaration
  16470. | ClassDeclaration
  16471. | MaybeNamedClassDeclaration
  16472. | ExpressionStatement
  16473. | BlockStatement
  16474. | StaticBlock
  16475. | EmptyStatement
  16476. | DebuggerStatement
  16477. | WithStatement
  16478. | ReturnStatement
  16479. | LabeledStatement
  16480. | BreakStatement
  16481. | ContinueStatement
  16482. | IfStatement
  16483. | SwitchStatement
  16484. | ThrowStatement
  16485. | TryStatement
  16486. | WhileStatement
  16487. | DoWhileStatement
  16488. | ForStatement
  16489. | ForInStatement
  16490. | ForOfStatement
  16491. | ExportDefaultDeclaration;
  16492. declare class Stats {
  16493. constructor(compilation: Compilation);
  16494. compilation: Compilation;
  16495. get hash(): string;
  16496. get startTime(): number;
  16497. get endTime(): number;
  16498. hasWarnings(): boolean;
  16499. hasErrors(): boolean;
  16500. toJson(
  16501. options?:
  16502. | boolean
  16503. | StatsOptions
  16504. | "none"
  16505. | "summary"
  16506. | "errors-only"
  16507. | "errors-warnings"
  16508. | "minimal"
  16509. | "normal"
  16510. | "detailed"
  16511. | "verbose"
  16512. ): StatsCompilation;
  16513. toString(
  16514. options?:
  16515. | boolean
  16516. | StatsOptions
  16517. | "none"
  16518. | "summary"
  16519. | "errors-only"
  16520. | "errors-warnings"
  16521. | "minimal"
  16522. | "normal"
  16523. | "detailed"
  16524. | "verbose"
  16525. ): string;
  16526. }
  16527. type StatsAsset = KnownStatsAsset & Record<string, any>;
  16528. type StatsChunk = KnownStatsChunk & Record<string, any>;
  16529. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  16530. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  16531. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  16532. type StatsError = KnownStatsError & Record<string, any>;
  16533. declare abstract class StatsFactory {
  16534. hooks: StatsFactoryHooks;
  16535. create<FactoryData, FallbackCreatedObject>(
  16536. type: string,
  16537. data: FactoryData,
  16538. baseContext: Omit<StatsFactoryContext, "type">
  16539. ): CreatedObject<FactoryData, FallbackCreatedObject>;
  16540. }
  16541. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  16542. declare interface StatsFactoryHooks {
  16543. extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
  16544. filter: HookMap<
  16545. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16546. >;
  16547. sort: HookMap<
  16548. SyncBailHook<
  16549. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  16550. void
  16551. >
  16552. >;
  16553. filterSorted: HookMap<
  16554. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16555. >;
  16556. groupResults: HookMap<
  16557. SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
  16558. >;
  16559. sortResults: HookMap<
  16560. SyncBailHook<
  16561. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  16562. void
  16563. >
  16564. >;
  16565. filterResults: HookMap<
  16566. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16567. >;
  16568. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  16569. result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  16570. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
  16571. getItemFactory: HookMap<
  16572. SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>
  16573. >;
  16574. }
  16575. type StatsLogging = KnownStatsLogging & Record<string, any>;
  16576. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  16577. type StatsModule = KnownStatsModule & Record<string, any>;
  16578. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  16579. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  16580. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  16581. Record<string, any>;
  16582. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  16583. type StatsObject<T, F> = T extends Compilation
  16584. ? StatsCompilation
  16585. : T extends ChunkGroupInfoWithName
  16586. ? StatsChunkGroup
  16587. : T extends Chunk
  16588. ? StatsChunk
  16589. : T extends OriginRecord
  16590. ? StatsChunkOrigin
  16591. : T extends Module
  16592. ? StatsModule
  16593. : T extends ModuleGraphConnection
  16594. ? StatsModuleReason
  16595. : T extends Asset
  16596. ? StatsAsset
  16597. : T extends ModuleTrace
  16598. ? StatsModuleTraceItem
  16599. : T extends Dependency
  16600. ? StatsModuleTraceDependency
  16601. : T extends Error
  16602. ? StatsError
  16603. : T extends ModuleProfile
  16604. ? StatsProfile
  16605. : F;
  16606. /**
  16607. * Stats options object.
  16608. */
  16609. declare interface StatsOptions {
  16610. /**
  16611. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  16612. */
  16613. all?: boolean;
  16614. /**
  16615. * Add assets information.
  16616. */
  16617. assets?: boolean;
  16618. /**
  16619. * Sort the assets by that field.
  16620. */
  16621. assetsSort?: string | false;
  16622. /**
  16623. * Space to display assets (groups will be collapsed to fit this space).
  16624. */
  16625. assetsSpace?: number;
  16626. /**
  16627. * Add built at time information.
  16628. */
  16629. builtAt?: boolean;
  16630. /**
  16631. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  16632. */
  16633. cached?: boolean;
  16634. /**
  16635. * Show cached assets (setting this to `false` only shows emitted files).
  16636. */
  16637. cachedAssets?: boolean;
  16638. /**
  16639. * Add information about cached (not built) modules.
  16640. */
  16641. cachedModules?: boolean;
  16642. /**
  16643. * Add children information.
  16644. */
  16645. children?:
  16646. | boolean
  16647. | StatsOptions
  16648. | "none"
  16649. | "summary"
  16650. | "errors-only"
  16651. | "errors-warnings"
  16652. | "minimal"
  16653. | "normal"
  16654. | "detailed"
  16655. | "verbose"
  16656. | StatsValue[];
  16657. /**
  16658. * Display auxiliary assets in chunk groups.
  16659. */
  16660. chunkGroupAuxiliary?: boolean;
  16661. /**
  16662. * Display children of chunk groups.
  16663. */
  16664. chunkGroupChildren?: boolean;
  16665. /**
  16666. * Limit of assets displayed in chunk groups.
  16667. */
  16668. chunkGroupMaxAssets?: number;
  16669. /**
  16670. * Display all chunk groups with the corresponding bundles.
  16671. */
  16672. chunkGroups?: boolean;
  16673. /**
  16674. * Add built modules information to chunk information.
  16675. */
  16676. chunkModules?: boolean;
  16677. /**
  16678. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  16679. */
  16680. chunkModulesSpace?: number;
  16681. /**
  16682. * Add the origins of chunks and chunk merging info.
  16683. */
  16684. chunkOrigins?: boolean;
  16685. /**
  16686. * Add information about parent, children and sibling chunks to chunk information.
  16687. */
  16688. chunkRelations?: boolean;
  16689. /**
  16690. * Add chunk information.
  16691. */
  16692. chunks?: boolean;
  16693. /**
  16694. * Sort the chunks by that field.
  16695. */
  16696. chunksSort?: string | false;
  16697. /**
  16698. * Enables/Disables colorful output.
  16699. */
  16700. colors?:
  16701. | boolean
  16702. | {
  16703. /**
  16704. * Custom color for bold text.
  16705. */
  16706. bold?: string;
  16707. /**
  16708. * Custom color for cyan text.
  16709. */
  16710. cyan?: string;
  16711. /**
  16712. * Custom color for green text.
  16713. */
  16714. green?: string;
  16715. /**
  16716. * Custom color for magenta text.
  16717. */
  16718. magenta?: string;
  16719. /**
  16720. * Custom color for red text.
  16721. */
  16722. red?: string;
  16723. /**
  16724. * Custom color for yellow text.
  16725. */
  16726. yellow?: string;
  16727. };
  16728. /**
  16729. * Context directory for request shortening.
  16730. */
  16731. context?: string;
  16732. /**
  16733. * Show chunk modules that are dependencies of other modules of the chunk.
  16734. */
  16735. dependentModules?: boolean;
  16736. /**
  16737. * Add module depth in module graph.
  16738. */
  16739. depth?: boolean;
  16740. /**
  16741. * Display the entry points with the corresponding bundles.
  16742. */
  16743. entrypoints?: boolean | "auto";
  16744. /**
  16745. * Add --env information.
  16746. */
  16747. env?: boolean;
  16748. /**
  16749. * Add cause to errors.
  16750. */
  16751. errorCause?: boolean | "auto";
  16752. /**
  16753. * Add details to errors (like resolving log).
  16754. */
  16755. errorDetails?: boolean | "auto";
  16756. /**
  16757. * Add nested errors to errors (like in AggregateError).
  16758. */
  16759. errorErrors?: boolean | "auto";
  16760. /**
  16761. * Add internal stack trace to errors.
  16762. */
  16763. errorStack?: boolean;
  16764. /**
  16765. * Add errors.
  16766. */
  16767. errors?: boolean;
  16768. /**
  16769. * Add errors count.
  16770. */
  16771. errorsCount?: boolean;
  16772. /**
  16773. * Space to display errors (value is in number of lines).
  16774. */
  16775. errorsSpace?: number;
  16776. /**
  16777. * Please use excludeModules instead.
  16778. */
  16779. exclude?:
  16780. | string
  16781. | boolean
  16782. | RegExp
  16783. | ModuleFilterItemTypes[]
  16784. | ((
  16785. name: string,
  16786. module: StatsModule,
  16787. type: "module" | "chunk" | "root-of-chunk" | "nested"
  16788. ) => boolean);
  16789. /**
  16790. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  16791. */
  16792. excludeAssets?:
  16793. | string
  16794. | RegExp
  16795. | AssetFilterItemTypes[]
  16796. | ((name: string, asset: StatsAsset) => boolean);
  16797. /**
  16798. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  16799. */
  16800. excludeModules?:
  16801. | string
  16802. | boolean
  16803. | RegExp
  16804. | ModuleFilterItemTypes[]
  16805. | ((
  16806. name: string,
  16807. module: StatsModule,
  16808. type: "module" | "chunk" | "root-of-chunk" | "nested"
  16809. ) => boolean);
  16810. /**
  16811. * Group assets by how their are related to chunks.
  16812. */
  16813. groupAssetsByChunk?: boolean;
  16814. /**
  16815. * Group assets by their status (emitted, compared for emit or cached).
  16816. */
  16817. groupAssetsByEmitStatus?: boolean;
  16818. /**
  16819. * Group assets by their extension.
  16820. */
  16821. groupAssetsByExtension?: boolean;
  16822. /**
  16823. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  16824. */
  16825. groupAssetsByInfo?: boolean;
  16826. /**
  16827. * Group assets by their path.
  16828. */
  16829. groupAssetsByPath?: boolean;
  16830. /**
  16831. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  16832. */
  16833. groupModulesByAttributes?: boolean;
  16834. /**
  16835. * Group modules by their status (cached or built and cacheable).
  16836. */
  16837. groupModulesByCacheStatus?: boolean;
  16838. /**
  16839. * Group modules by their extension.
  16840. */
  16841. groupModulesByExtension?: boolean;
  16842. /**
  16843. * Group modules by their layer.
  16844. */
  16845. groupModulesByLayer?: boolean;
  16846. /**
  16847. * Group modules by their path.
  16848. */
  16849. groupModulesByPath?: boolean;
  16850. /**
  16851. * Group modules by their type.
  16852. */
  16853. groupModulesByType?: boolean;
  16854. /**
  16855. * Group reasons by their origin module.
  16856. */
  16857. groupReasonsByOrigin?: boolean;
  16858. /**
  16859. * Add the hash of the compilation.
  16860. */
  16861. hash?: boolean;
  16862. /**
  16863. * Add ids.
  16864. */
  16865. ids?: boolean;
  16866. /**
  16867. * Add logging output.
  16868. */
  16869. logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
  16870. /**
  16871. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  16872. */
  16873. loggingDebug?:
  16874. | string
  16875. | boolean
  16876. | RegExp
  16877. | FilterItemTypes[]
  16878. | ((value: string) => boolean);
  16879. /**
  16880. * Add stack traces to logging output.
  16881. */
  16882. loggingTrace?: boolean;
  16883. /**
  16884. * Add information about assets inside modules.
  16885. */
  16886. moduleAssets?: boolean;
  16887. /**
  16888. * Add dependencies and origin of warnings/errors.
  16889. */
  16890. moduleTrace?: boolean;
  16891. /**
  16892. * Add built modules information.
  16893. */
  16894. modules?: boolean;
  16895. /**
  16896. * Sort the modules by that field.
  16897. */
  16898. modulesSort?: string | false;
  16899. /**
  16900. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  16901. */
  16902. modulesSpace?: number;
  16903. /**
  16904. * Add information about modules nested in other modules (like with module concatenation).
  16905. */
  16906. nestedModules?: boolean;
  16907. /**
  16908. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  16909. */
  16910. nestedModulesSpace?: number;
  16911. /**
  16912. * Show reasons why optimization bailed out for modules.
  16913. */
  16914. optimizationBailout?: boolean;
  16915. /**
  16916. * Add information about orphan modules.
  16917. */
  16918. orphanModules?: boolean;
  16919. /**
  16920. * Add output path information.
  16921. */
  16922. outputPath?: boolean;
  16923. /**
  16924. * Add performance hint flags.
  16925. */
  16926. performance?: boolean;
  16927. /**
  16928. * Preset for the default values.
  16929. */
  16930. preset?: string | boolean;
  16931. /**
  16932. * Show exports provided by modules.
  16933. */
  16934. providedExports?: boolean;
  16935. /**
  16936. * Add public path information.
  16937. */
  16938. publicPath?: boolean;
  16939. /**
  16940. * Add information about the reasons why modules are included.
  16941. */
  16942. reasons?: boolean;
  16943. /**
  16944. * Space to display reasons (groups will be collapsed to fit this space).
  16945. */
  16946. reasonsSpace?: number;
  16947. /**
  16948. * Add information about assets that are related to other assets (like SourceMaps for assets).
  16949. */
  16950. relatedAssets?: boolean;
  16951. /**
  16952. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  16953. */
  16954. runtime?: boolean;
  16955. /**
  16956. * Add information about runtime modules.
  16957. */
  16958. runtimeModules?: boolean;
  16959. /**
  16960. * Add the source code of modules.
  16961. */
  16962. source?: boolean;
  16963. /**
  16964. * Add timing information.
  16965. */
  16966. timings?: boolean;
  16967. /**
  16968. * Show exports used by modules.
  16969. */
  16970. usedExports?: boolean;
  16971. /**
  16972. * Add webpack version information.
  16973. */
  16974. version?: boolean;
  16975. /**
  16976. * Add warnings.
  16977. */
  16978. warnings?: boolean;
  16979. /**
  16980. * Add warnings count.
  16981. */
  16982. warningsCount?: boolean;
  16983. /**
  16984. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  16985. */
  16986. warningsFilter?:
  16987. | string
  16988. | RegExp
  16989. | WarningFilterItemTypes[]
  16990. | ((warning: StatsError, warningString: string) => boolean);
  16991. /**
  16992. * Space to display warnings (value is in number of lines).
  16993. */
  16994. warningsSpace?: number;
  16995. }
  16996. declare interface StatsPrintHooks {
  16997. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
  16998. printElements: HookMap<
  16999. SyncBailHook<
  17000. [PrintedElement[], StatsPrinterContext],
  17001. undefined | string | void
  17002. >
  17003. >;
  17004. sortItems: HookMap<
  17005. SyncBailHook<[any[], StatsPrinterContext], boolean | void>
  17006. >;
  17007. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  17008. printItems: HookMap<
  17009. SyncBailHook<[string[], StatsPrinterContext], undefined | string>
  17010. >;
  17011. print: HookMap<
  17012. SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
  17013. >;
  17014. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
  17015. }
  17016. declare abstract class StatsPrinter {
  17017. hooks: StatsPrintHooks;
  17018. print(
  17019. type: string,
  17020. object?: any,
  17021. baseContext?: StatsPrinterContext
  17022. ): undefined | string;
  17023. }
  17024. type StatsPrinterContext = KnownStatsPrinterColorFunctions &
  17025. KnownStatsPrinterFormatters &
  17026. KnownStatsPrinterContext &
  17027. Record<string, any>;
  17028. type StatsProfile = KnownStatsProfile & Record<string, any>;
  17029. type StatsValue =
  17030. | boolean
  17031. | StatsOptions
  17032. | "none"
  17033. | "summary"
  17034. | "errors-only"
  17035. | "errors-warnings"
  17036. | "minimal"
  17037. | "normal"
  17038. | "detailed"
  17039. | "verbose";
  17040. declare interface StreamChunksOptions {
  17041. source?: boolean;
  17042. finalSource?: boolean;
  17043. columns?: boolean;
  17044. }
  17045. declare interface StreamOptions {
  17046. flags?: string;
  17047. encoding?:
  17048. | "ascii"
  17049. | "utf8"
  17050. | "utf-8"
  17051. | "utf16le"
  17052. | "utf-16le"
  17053. | "ucs2"
  17054. | "ucs-2"
  17055. | "base64"
  17056. | "base64url"
  17057. | "latin1"
  17058. | "binary"
  17059. | "hex";
  17060. fd?: any;
  17061. mode?: number;
  17062. autoClose?: boolean;
  17063. emitClose?: boolean;
  17064. start?: number;
  17065. signal?: null | AbortSignal;
  17066. }
  17067. declare interface Stringable {
  17068. toString: () => string;
  17069. }
  17070. type Supports = undefined | string;
  17071. declare class SyncModuleIdsPlugin {
  17072. constructor(options: SyncModuleIdsPluginOptions);
  17073. options: SyncModuleIdsPluginOptions;
  17074. /**
  17075. * Apply the plugin
  17076. */
  17077. apply(compiler: Compiler): void;
  17078. }
  17079. declare interface SyncModuleIdsPluginOptions {
  17080. /**
  17081. * path to file
  17082. */
  17083. path: string;
  17084. /**
  17085. * context for module names
  17086. */
  17087. context?: string;
  17088. /**
  17089. * selector for modules
  17090. */
  17091. test?: (module: Module) => boolean;
  17092. /**
  17093. * operation mode (defaults to merge)
  17094. */
  17095. mode?: "read" | "create" | "merge" | "update";
  17096. }
  17097. declare interface SyntheticDependencyLocation {
  17098. name: string;
  17099. index?: number;
  17100. }
  17101. declare const TOMBSTONE: unique symbol;
  17102. declare const TRANSITIVE: unique symbol;
  17103. declare const TRANSITIVE_ONLY: unique symbol;
  17104. declare interface TagInfo {
  17105. tag: symbol;
  17106. data?:
  17107. | Record<string, any>
  17108. | TopLevelSymbol
  17109. | HarmonySettings
  17110. | ImportSettings
  17111. | CommonJsImportSettings
  17112. | CompatibilitySettings
  17113. | HarmonySpecifierGuards;
  17114. next?: TagInfo;
  17115. }
  17116. declare interface TargetItemWithConnection {
  17117. module: Module;
  17118. connection: ModuleGraphConnection;
  17119. export?: string[];
  17120. }
  17121. declare interface TargetItemWithoutConnection {
  17122. module: Module;
  17123. export: string[];
  17124. deferred: boolean;
  17125. }
  17126. declare class Template {
  17127. constructor();
  17128. static getFunctionContent(fn: Stringable): string;
  17129. static toIdentifier(str: string): string;
  17130. static toComment(str: string): string;
  17131. static toNormalComment(str: string): string;
  17132. static toPath(str: string): string;
  17133. static numberToIdentifier(n: number): string;
  17134. static numberToIdentifierContinuation(n: number): string;
  17135. static indent(s: string | string[]): string;
  17136. static prefix(s: string | string[], prefix: string): string;
  17137. static asString(str: string | string[]): string;
  17138. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  17139. static renderChunkModules(
  17140. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  17141. modules: Module[],
  17142. renderModule: (module: Module, renderInArray?: boolean) => null | Source,
  17143. prefix?: string
  17144. ): null | Source;
  17145. static renderRuntimeModules(
  17146. runtimeModules: RuntimeModule[],
  17147. renderContext: RenderContextJavascriptModulesPlugin & {
  17148. codeGenerationResults?: CodeGenerationResults;
  17149. }
  17150. ): Source;
  17151. static renderChunkRuntimeModules(
  17152. runtimeModules: RuntimeModule[],
  17153. renderContext: RenderContextJavascriptModulesPlugin
  17154. ): Source;
  17155. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  17156. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  17157. }
  17158. type TemplatePath =
  17159. | string
  17160. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  17161. declare interface TimestampAndHash {
  17162. safeTime: number;
  17163. timestamp?: number;
  17164. hash: string;
  17165. }
  17166. declare class TopLevelSymbol {
  17167. constructor(name: string);
  17168. name: string;
  17169. }
  17170. /**
  17171. * Use a Trusted Types policy to create urls for chunks.
  17172. */
  17173. declare interface TrustedTypes {
  17174. /**
  17175. * 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'.
  17176. */
  17177. onPolicyCreationFailure?: "continue" | "stop";
  17178. /**
  17179. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  17180. */
  17181. policyName?: string;
  17182. }
  17183. declare interface TsconfigOptions {
  17184. /**
  17185. * A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file
  17186. */
  17187. configFile?: string;
  17188. /**
  17189. * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths
  17190. */
  17191. references?: string[] | "auto";
  17192. /**
  17193. * Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file
  17194. */
  17195. baseUrl?: string;
  17196. }
  17197. declare interface TsconfigPathsData {
  17198. /**
  17199. * tsconfig file data
  17200. */
  17201. alias: AliasOption[];
  17202. /**
  17203. * tsconfig file data
  17204. */
  17205. modules: string[];
  17206. }
  17207. declare interface TsconfigPathsMap {
  17208. /**
  17209. * main tsconfig paths data
  17210. */
  17211. main: TsconfigPathsData;
  17212. /**
  17213. * main tsconfig base URL (absolute path)
  17214. */
  17215. mainContext: string;
  17216. /**
  17217. * referenced tsconfig paths data mapped by baseUrl
  17218. */
  17219. refs: { [index: string]: TsconfigPathsData };
  17220. /**
  17221. * file dependencies
  17222. */
  17223. fileDependencies: Set<string>;
  17224. }
  17225. declare const UNDEFINED_MARKER: unique symbol;
  17226. declare interface URL_url extends URL {}
  17227. type UnsafeCacheData = KnownUnsafeCacheData & Record<string, any>;
  17228. declare interface UpdateHashContextDependency {
  17229. chunkGraph: ChunkGraph;
  17230. runtime: RuntimeSpec;
  17231. runtimeTemplate?: RuntimeTemplate;
  17232. }
  17233. declare interface UpdateHashContextGenerator {
  17234. /**
  17235. * the module
  17236. */
  17237. module: NormalModule;
  17238. chunkGraph: ChunkGraph;
  17239. runtime: RuntimeSpec;
  17240. runtimeTemplate?: RuntimeTemplate;
  17241. }
  17242. type Usage = string | true | TopLevelSymbol;
  17243. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  17244. type UsedName = string | false | string[];
  17245. type Value = string | number | boolean | RegExp;
  17246. type ValueCacheVersion = string | Set<string>;
  17247. declare interface Values {
  17248. [index: string]: Value[];
  17249. }
  17250. declare class VariableInfo {
  17251. constructor(
  17252. declaredScope: ScopeInfo,
  17253. name: undefined | string,
  17254. flags: VariableInfoFlagsType,
  17255. tagInfo?: TagInfo
  17256. );
  17257. declaredScope: ScopeInfo;
  17258. name?: string;
  17259. flags: VariableInfoFlagsType;
  17260. tagInfo?: TagInfo;
  17261. isFree(): boolean;
  17262. isTagged(): boolean;
  17263. }
  17264. type VariableInfoFlagsType = 0 | 1 | 2 | 4;
  17265. declare interface VirtualModuleConfig {
  17266. /**
  17267. * the module type
  17268. */
  17269. type?: string;
  17270. /**
  17271. * the source function
  17272. */
  17273. source: (
  17274. loaderContext: LoaderContextVirtualUrlPlugin<any>
  17275. ) => string | Buffer | Promise<string | Buffer>;
  17276. /**
  17277. * optional version function or value
  17278. */
  17279. version?: string | true | (() => string);
  17280. }
  17281. type VirtualModuleInput =
  17282. | string
  17283. | ((
  17284. loaderContext: LoaderContextVirtualUrlPlugin<any>
  17285. ) => string | Buffer | Promise<string | Buffer>)
  17286. | VirtualModuleConfig;
  17287. declare interface VirtualModules {
  17288. [index: string]: VirtualModuleInput;
  17289. }
  17290. declare class VirtualUrlPlugin {
  17291. constructor(modules: VirtualModules, scheme?: string);
  17292. scheme: string;
  17293. modules: NormalizedModules;
  17294. /**
  17295. * Apply the plugin
  17296. */
  17297. apply(compiler: Compiler): void;
  17298. findVirtualModuleConfigById(id: string): VirtualModuleConfig;
  17299. /**
  17300. * Get the cache version for a given version value
  17301. */
  17302. getCacheVersion(version: string | true | (() => string)): undefined | string;
  17303. static DEFAULT_SCHEME: string;
  17304. }
  17305. type WarningFilterItemTypes =
  17306. | string
  17307. | RegExp
  17308. | ((warning: StatsError, warningString: string) => boolean);
  17309. declare interface WatchFileSystem {
  17310. watch: (
  17311. files: Iterable<string>,
  17312. directories: Iterable<string>,
  17313. missing: Iterable<string>,
  17314. startTime: number,
  17315. options: WatchOptions,
  17316. callback: (
  17317. err: null | Error,
  17318. timeInfoEntries1?: Map<
  17319. string,
  17320. | null
  17321. | EntryTypesIndex
  17322. | OnlySafeTimeEntry
  17323. | ExistenceOnlyTimeEntryTypesIndex
  17324. | "ignore"
  17325. >,
  17326. timeInfoEntries2?: Map<
  17327. string,
  17328. | null
  17329. | EntryTypesIndex
  17330. | OnlySafeTimeEntry
  17331. | ExistenceOnlyTimeEntryTypesIndex
  17332. | "ignore"
  17333. >,
  17334. changes?: Set<string>,
  17335. removals?: Set<string>
  17336. ) => void,
  17337. callbackUndelayed: (value: string, num: number) => void
  17338. ) => Watcher;
  17339. }
  17340. declare class WatchIgnorePlugin {
  17341. constructor(options: WatchIgnorePluginOptions);
  17342. paths: (string | RegExp)[];
  17343. /**
  17344. * Apply the plugin
  17345. */
  17346. apply(compiler: Compiler): void;
  17347. }
  17348. declare interface WatchIgnorePluginOptions {
  17349. /**
  17350. * A list of RegExps or absolute paths to directories or files that should be ignored.
  17351. */
  17352. paths: (string | RegExp)[];
  17353. }
  17354. /**
  17355. * Options for the watcher.
  17356. */
  17357. declare interface WatchOptions {
  17358. /**
  17359. * Delay the rebuilt after the first change. Value is a time in ms.
  17360. */
  17361. aggregateTimeout?: number;
  17362. /**
  17363. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  17364. */
  17365. followSymlinks?: boolean;
  17366. /**
  17367. * Ignore some files from watching (glob pattern or regexp).
  17368. */
  17369. ignored?: string | RegExp | string[];
  17370. /**
  17371. * Enable polling mode for watching.
  17372. */
  17373. poll?: number | boolean;
  17374. /**
  17375. * Stop watching when stdin stream has ended.
  17376. */
  17377. stdin?: boolean;
  17378. }
  17379. declare interface Watcher {
  17380. /**
  17381. * closes the watcher and all underlying file watchers
  17382. */
  17383. close: () => void;
  17384. /**
  17385. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  17386. */
  17387. pause: () => void;
  17388. /**
  17389. * get current aggregated changes that have not yet send to callback
  17390. */
  17391. getAggregatedChanges?: () => null | Set<string>;
  17392. /**
  17393. * get current aggregated removals that have not yet send to callback
  17394. */
  17395. getAggregatedRemovals?: () => null | Set<string>;
  17396. /**
  17397. * get info about files
  17398. */
  17399. getFileTimeInfoEntries: () => Map<
  17400. string,
  17401. | null
  17402. | EntryTypesIndex
  17403. | OnlySafeTimeEntry
  17404. | ExistenceOnlyTimeEntryTypesIndex
  17405. | "ignore"
  17406. >;
  17407. /**
  17408. * get info about directories
  17409. */
  17410. getContextTimeInfoEntries: () => Map<
  17411. string,
  17412. | null
  17413. | EntryTypesIndex
  17414. | OnlySafeTimeEntry
  17415. | ExistenceOnlyTimeEntryTypesIndex
  17416. | "ignore"
  17417. >;
  17418. /**
  17419. * get info about timestamps and changes
  17420. */
  17421. getInfo?: () => WatcherInfo;
  17422. }
  17423. declare interface WatcherInfo {
  17424. /**
  17425. * get current aggregated changes that have not yet send to callback
  17426. */
  17427. changes: null | Set<string>;
  17428. /**
  17429. * get current aggregated removals that have not yet send to callback
  17430. */
  17431. removals: null | Set<string>;
  17432. /**
  17433. * get info about files
  17434. */
  17435. fileTimeInfoEntries: Map<
  17436. string,
  17437. | null
  17438. | EntryTypesIndex
  17439. | OnlySafeTimeEntry
  17440. | ExistenceOnlyTimeEntryTypesIndex
  17441. | "ignore"
  17442. >;
  17443. /**
  17444. * get info about directories
  17445. */
  17446. contextTimeInfoEntries: Map<
  17447. string,
  17448. | null
  17449. | EntryTypesIndex
  17450. | OnlySafeTimeEntry
  17451. | ExistenceOnlyTimeEntryTypesIndex
  17452. | "ignore"
  17453. >;
  17454. }
  17455. declare abstract class Watching {
  17456. startTime: null | number;
  17457. invalid: boolean;
  17458. handler: CallbackWebpackFunction_2<Stats, void>;
  17459. callbacks: ((err: null | Error, result?: void) => void)[];
  17460. closed: boolean;
  17461. suspended: boolean;
  17462. blocked: boolean;
  17463. watchOptions: WatchOptions;
  17464. compiler: Compiler;
  17465. running: boolean;
  17466. watcher?: null | Watcher;
  17467. pausedWatcher?: null | Watcher;
  17468. lastWatcherStartTime?: number;
  17469. watch(
  17470. files: Iterable<string>,
  17471. dirs: Iterable<string>,
  17472. missing: Iterable<string>
  17473. ): void;
  17474. invalidate(callback?: (err: null | Error, result?: void) => void): void;
  17475. suspend(): void;
  17476. resume(): void;
  17477. close(callback: (err: null | Error, result?: void) => void): void;
  17478. }
  17479. declare abstract class WeakTupleMap<K extends any[], V> {
  17480. set(...args: [K, ...V[]]): void;
  17481. has(...args: K): boolean;
  17482. get(...args: K): undefined | V;
  17483. provide(...args: [K, ...((...args: K) => V)[]]): V;
  17484. delete(...args: K): void;
  17485. clear(): void;
  17486. }
  17487. declare abstract class WebAssemblyParser extends ParserClass {}
  17488. declare interface WebAssemblyRenderContext {
  17489. /**
  17490. * the chunk
  17491. */
  17492. chunk: Chunk;
  17493. /**
  17494. * the dependency templates
  17495. */
  17496. dependencyTemplates: DependencyTemplates;
  17497. /**
  17498. * the runtime template
  17499. */
  17500. runtimeTemplate: RuntimeTemplate;
  17501. /**
  17502. * the module graph
  17503. */
  17504. moduleGraph: ModuleGraph;
  17505. /**
  17506. * the chunk graph
  17507. */
  17508. chunkGraph: ChunkGraph;
  17509. /**
  17510. * results of code generation
  17511. */
  17512. codeGenerationResults: CodeGenerationResults;
  17513. }
  17514. declare class WebWorkerTemplatePlugin {
  17515. constructor();
  17516. /**
  17517. * Apply the plugin
  17518. */
  17519. apply(compiler: Compiler): void;
  17520. }
  17521. declare class WebpackError extends Error {
  17522. /**
  17523. * Creates an instance of WebpackError.
  17524. */
  17525. constructor(message?: string, options?: { cause?: unknown });
  17526. [index: number]: () => string;
  17527. details?: string;
  17528. module?: null | Module;
  17529. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  17530. hideStack?: boolean;
  17531. chunk?: Chunk;
  17532. file?: string;
  17533. serialize(__0: ObjectSerializerContext): void;
  17534. deserialize(__0: ObjectDeserializerContext): void;
  17535. /**
  17536. * Creates a `.stack` property on `targetObject`, which when accessed returns
  17537. * a string representing the location in the code at which
  17538. * `Error.captureStackTrace()` was called.
  17539. * ```js
  17540. * const myObject = {};
  17541. * Error.captureStackTrace(myObject);
  17542. * myObject.stack; // Similar to `new Error().stack`
  17543. * ```
  17544. * The first line of the trace will be prefixed with
  17545. * `${myObject.name}: ${myObject.message}`.
  17546. * The optional `constructorOpt` argument accepts a function. If given, all frames
  17547. * above `constructorOpt`, including `constructorOpt`, will be omitted from the
  17548. * generated stack trace.
  17549. * The `constructorOpt` argument is useful for hiding implementation
  17550. * details of error generation from the user. For instance:
  17551. * ```js
  17552. * function a() {
  17553. * b();
  17554. * }
  17555. * function b() {
  17556. * c();
  17557. * }
  17558. * function c() {
  17559. * // Create an error without stack trace to avoid calculating the stack trace twice.
  17560. * const { stackTraceLimit } = Error;
  17561. * Error.stackTraceLimit = 0;
  17562. * const error = new Error();
  17563. * Error.stackTraceLimit = stackTraceLimit;
  17564. * // Capture the stack trace above function b
  17565. * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  17566. * throw error;
  17567. * }
  17568. * a();
  17569. * ```
  17570. */
  17571. static captureStackTrace(
  17572. targetObject: object,
  17573. constructorOpt?: Function
  17574. ): void;
  17575. static prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
  17576. /**
  17577. * The `Error.stackTraceLimit` property specifies the number of stack frames
  17578. * collected by a stack trace (whether generated by `new Error().stack` or
  17579. * `Error.captureStackTrace(obj)`).
  17580. * The default value is `10` but may be set to any valid JavaScript number. Changes
  17581. * will affect any stack trace captured _after_ the value has been changed.
  17582. * If set to a non-number value, or set to a negative number, stack traces will
  17583. * not capture any frames.
  17584. */
  17585. static stackTraceLimit: number;
  17586. }
  17587. declare abstract class WebpackLogger {
  17588. getChildLogger: (name: string | (() => string)) => WebpackLogger;
  17589. error(...args: any[]): void;
  17590. warn(...args: any[]): void;
  17591. info(...args: any[]): void;
  17592. log(...args: any[]): void;
  17593. debug(...args: any[]): void;
  17594. assert(condition: undefined | boolean, ...args: any[]): void;
  17595. trace(): void;
  17596. clear(): void;
  17597. status(...args: any[]): void;
  17598. group(...args: any[]): void;
  17599. groupCollapsed(...args: any[]): void;
  17600. groupEnd(): void;
  17601. profile(label?: string): void;
  17602. profileEnd(label?: string): void;
  17603. time(label: string): void;
  17604. timeLog(label?: string): void;
  17605. timeEnd(label?: string): void;
  17606. timeAggregate(label?: string): void;
  17607. timeAggregateEnd(label?: string): void;
  17608. }
  17609. declare class WebpackOptionsApply extends OptionsApply {
  17610. constructor();
  17611. }
  17612. declare class WebpackOptionsDefaulter {
  17613. constructor();
  17614. process(options: Configuration): WebpackOptionsNormalized;
  17615. }
  17616. declare interface WebpackOptionsInterception {
  17617. devtool?:
  17618. | string
  17619. | false
  17620. | {
  17621. /**
  17622. * Which asset type should receive this devtool value.
  17623. */
  17624. type: "all" | "javascript" | "css";
  17625. /**
  17626. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  17627. */
  17628. use: RawDevTool;
  17629. }[];
  17630. }
  17631. /**
  17632. * Normalized webpack options object.
  17633. */
  17634. declare interface WebpackOptionsNormalized {
  17635. /**
  17636. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  17637. */
  17638. amd?: false | { [index: string]: any };
  17639. /**
  17640. * Report the first error as a hard error instead of tolerating it.
  17641. */
  17642. bail?: boolean;
  17643. /**
  17644. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  17645. */
  17646. cache: CacheOptionsNormalized;
  17647. /**
  17648. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  17649. */
  17650. context?: string;
  17651. /**
  17652. * References to other configurations to depend on.
  17653. */
  17654. dependencies?: string[];
  17655. /**
  17656. * Options for the webpack-dev-server.
  17657. */
  17658. devServer?: false | { [index: string]: any };
  17659. /**
  17660. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  17661. */
  17662. devtool?:
  17663. | string
  17664. | false
  17665. | {
  17666. /**
  17667. * Which asset type should receive this devtool value.
  17668. */
  17669. type: "all" | "javascript" | "css";
  17670. /**
  17671. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  17672. */
  17673. use: RawDevTool;
  17674. }[];
  17675. /**
  17676. * Enable and configure the Dotenv plugin to load environment variables from .env files.
  17677. */
  17678. dotenv?: boolean | DotenvPluginOptions;
  17679. /**
  17680. * The entry point(s) of the compilation.
  17681. */
  17682. entry: EntryNormalized;
  17683. /**
  17684. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  17685. */
  17686. experiments: ExperimentsNormalized;
  17687. /**
  17688. * 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`.
  17689. */
  17690. externals: Externals;
  17691. /**
  17692. * Enable presets of externals for specific targets.
  17693. */
  17694. externalsPresets: ExternalsPresets;
  17695. /**
  17696. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  17697. */
  17698. externalsType?:
  17699. | "import"
  17700. | "var"
  17701. | "module"
  17702. | "assign"
  17703. | "this"
  17704. | "window"
  17705. | "self"
  17706. | "global"
  17707. | "commonjs"
  17708. | "commonjs2"
  17709. | "commonjs-module"
  17710. | "commonjs-static"
  17711. | "amd"
  17712. | "amd-require"
  17713. | "umd"
  17714. | "umd2"
  17715. | "jsonp"
  17716. | "system"
  17717. | "promise"
  17718. | "module-import"
  17719. | "script"
  17720. | "node-commonjs"
  17721. | "asset"
  17722. | "css-import"
  17723. | "css-url";
  17724. /**
  17725. * Ignore specific warnings.
  17726. */
  17727. ignoreWarnings?: ((warning: Error, compilation: Compilation) => boolean)[];
  17728. /**
  17729. * Options for infrastructure level logging.
  17730. */
  17731. infrastructureLogging: InfrastructureLogging;
  17732. /**
  17733. * Custom values available in the loader context.
  17734. */
  17735. loader?: Loader;
  17736. /**
  17737. * Enable production optimizations or development hints.
  17738. */
  17739. mode?: "none" | "development" | "production";
  17740. /**
  17741. * Options affecting the normal modules (`NormalModuleFactory`).
  17742. */
  17743. module: ModuleOptionsNormalized;
  17744. /**
  17745. * Name of the configuration. Used when loading multiple configurations.
  17746. */
  17747. name?: string;
  17748. /**
  17749. * Include polyfills or mocks for various node stuff.
  17750. */
  17751. node: Node;
  17752. /**
  17753. * Enables/Disables integrated optimizations.
  17754. */
  17755. optimization: OptimizationNormalized;
  17756. /**
  17757. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  17758. */
  17759. output: OutputNormalized;
  17760. /**
  17761. * The number of parallel processed modules in the compilation.
  17762. */
  17763. parallelism?: number;
  17764. /**
  17765. * Configuration for web performance recommendations.
  17766. */
  17767. performance?: false | PerformanceOptions;
  17768. /**
  17769. * Add additional plugins to the compiler.
  17770. */
  17771. plugins: (
  17772. | ((this: Compiler, compiler: Compiler) => void)
  17773. | WebpackPluginInstance
  17774. )[];
  17775. /**
  17776. * Capture timing information for each module.
  17777. */
  17778. profile?: boolean;
  17779. /**
  17780. * Store compiler state to a json file.
  17781. */
  17782. recordsInputPath?: string | false;
  17783. /**
  17784. * Load compiler state from a json file.
  17785. */
  17786. recordsOutputPath?: string | false;
  17787. /**
  17788. * Options for the resolver.
  17789. */
  17790. resolve: ResolveOptions;
  17791. /**
  17792. * Options for the resolver when resolving loaders.
  17793. */
  17794. resolveLoader: ResolveOptions;
  17795. /**
  17796. * Options affecting how file system snapshots are created and validated.
  17797. */
  17798. snapshot: SnapshotOptionsWebpackOptions;
  17799. /**
  17800. * Stats options object or preset name.
  17801. */
  17802. stats: StatsValue;
  17803. /**
  17804. * Environment to build for. An array of environments to build for all of them when possible.
  17805. */
  17806. target?: string | false | string[];
  17807. /**
  17808. * Enter watch mode, which rebuilds on file change.
  17809. */
  17810. watch?: boolean;
  17811. /**
  17812. * Options for the watcher.
  17813. */
  17814. watchOptions: WatchOptions;
  17815. }
  17816. type WebpackOptionsNormalizedWithDefaults = WebpackOptionsNormalized & {
  17817. context: string;
  17818. } & { infrastructureLogging: InfrastructureLoggingNormalizedWithDefaults } & {
  17819. target: NonNullable<undefined | string | false | string[]>;
  17820. } & { output: OutputNormalizedWithDefaults } & {
  17821. optimization: OptimizationNormalizedWithDefaults;
  17822. } & {
  17823. devtool: NonNullable<
  17824. | undefined
  17825. | string
  17826. | false
  17827. | {
  17828. /**
  17829. * Which asset type should receive this devtool value.
  17830. */
  17831. type: "all" | "javascript" | "css";
  17832. /**
  17833. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  17834. */
  17835. use: RawDevTool;
  17836. }[]
  17837. >;
  17838. } & { stats: NonNullable<StatsValue> } & { node: NonNullable<Node> } & {
  17839. profile: NonNullable<undefined | boolean>;
  17840. } & { parallelism: number } & { snapshot: SnapshotNormalizedWithDefaults } & {
  17841. externalsPresets: ExternalsPresetsNormalizedWithDefaults;
  17842. } & {
  17843. externalsType: NonNullable<
  17844. | undefined
  17845. | "import"
  17846. | "var"
  17847. | "module"
  17848. | "assign"
  17849. | "this"
  17850. | "window"
  17851. | "self"
  17852. | "global"
  17853. | "commonjs"
  17854. | "commonjs2"
  17855. | "commonjs-module"
  17856. | "commonjs-static"
  17857. | "amd"
  17858. | "amd-require"
  17859. | "umd"
  17860. | "umd2"
  17861. | "jsonp"
  17862. | "system"
  17863. | "promise"
  17864. | "module-import"
  17865. | "script"
  17866. | "node-commonjs"
  17867. | "asset"
  17868. | "css-import"
  17869. | "css-url"
  17870. >;
  17871. } & { watch: NonNullable<undefined | boolean> } & {
  17872. performance: NonNullable<undefined | false | PerformanceOptions>;
  17873. } & { recordsInputPath: NonNullable<undefined | string | false> } & {
  17874. recordsOutputPath: NonNullable<undefined | string | false>;
  17875. } & { dotenv: NonNullable<undefined | boolean | DotenvPluginOptions> };
  17876. /**
  17877. * Plugin instance.
  17878. */
  17879. declare interface WebpackPluginInstance {
  17880. [index: string]: any;
  17881. /**
  17882. * The run point of the plugin, required method.
  17883. */
  17884. apply: (compiler: Compiler) => void;
  17885. }
  17886. declare interface WebpackRequire {
  17887. (id: string): any;
  17888. i?: ((options: ExecuteOptions) => void)[];
  17889. c?: Record<string, ExecuteModuleObject>;
  17890. }
  17891. declare interface WithId {
  17892. id: string | number;
  17893. }
  17894. declare interface WithOptions {
  17895. /**
  17896. * create a resolver with additional/different options
  17897. */
  17898. withOptions: (
  17899. options: Partial<ResolveOptionsWithDependencyType>
  17900. ) => ResolverWithOptions;
  17901. }
  17902. declare interface WriteFile {
  17903. (
  17904. file: PathOrFileDescriptorFs,
  17905. data: string | NodeJS.ArrayBufferView,
  17906. options: WriteFileOptions,
  17907. callback: (err: null | NodeJS.ErrnoException) => void
  17908. ): void;
  17909. (
  17910. file: PathOrFileDescriptorFs,
  17911. data: string | NodeJS.ArrayBufferView,
  17912. callback: (err: null | NodeJS.ErrnoException) => void
  17913. ): void;
  17914. }
  17915. type WriteFileOptions =
  17916. | null
  17917. | "ascii"
  17918. | "utf8"
  17919. | "utf-8"
  17920. | "utf16le"
  17921. | "utf-16le"
  17922. | "ucs2"
  17923. | "ucs-2"
  17924. | "base64"
  17925. | "base64url"
  17926. | "latin1"
  17927. | "binary"
  17928. | "hex"
  17929. | (ObjectEncodingOptions &
  17930. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  17931. declare interface WriteOnlySet<T> {
  17932. add: (item: T) => void;
  17933. }
  17934. type WriteStreamOptions = StreamOptions & {
  17935. fs?: null | CreateWriteStreamFSImplementation;
  17936. flush?: boolean;
  17937. };
  17938. declare interface _functionWebpack {
  17939. (
  17940. options: Configuration,
  17941. callback: CallbackWebpackFunction_2<Stats, void>
  17942. ): null | Compiler;
  17943. (options: Configuration): Compiler;
  17944. (
  17945. options: MultiConfiguration,
  17946. callback: CallbackWebpackFunction_2<MultiStats, void>
  17947. ): null | MultiCompiler;
  17948. (options: MultiConfiguration): MultiCompiler;
  17949. }
  17950. declare interface chunkModuleHashMap {
  17951. [index: number]: string;
  17952. [index: string]: string;
  17953. }
  17954. type ecmaVersion =
  17955. | 3
  17956. | 5
  17957. | 6
  17958. | 7
  17959. | 8
  17960. | 9
  17961. | 10
  17962. | 11
  17963. | 12
  17964. | 13
  17965. | 14
  17966. | 15
  17967. | 16
  17968. | 17
  17969. | 2015
  17970. | 2016
  17971. | 2017
  17972. | 2018
  17973. | 2019
  17974. | 2020
  17975. | 2021
  17976. | 2022
  17977. | 2023
  17978. | 2024
  17979. | 2025
  17980. | 2026
  17981. | "latest";
  17982. declare function exports(
  17983. options: Configuration,
  17984. callback: CallbackWebpackFunction_2<Stats, void>
  17985. ): null | Compiler;
  17986. declare function exports(options: Configuration): Compiler;
  17987. declare function exports(
  17988. options: MultiConfiguration,
  17989. callback: CallbackWebpackFunction_2<MultiStats, void>
  17990. ): null | MultiCompiler;
  17991. declare function exports(options: MultiConfiguration): MultiCompiler;
  17992. declare namespace exports {
  17993. export const webpack: _functionWebpack;
  17994. export const validate: (
  17995. configuration: Configuration | MultiConfiguration
  17996. ) => void;
  17997. export const validateSchema: (
  17998. schema: Parameters<typeof validateFunction>[0],
  17999. options: Parameters<typeof validateFunction>[1],
  18000. validationConfiguration?: ValidationErrorConfiguration
  18001. ) => void;
  18002. export const version: string;
  18003. export namespace cli {
  18004. export let createColors: (__0?: ColorsOptions) => Colors;
  18005. export let getArguments: (
  18006. schema?:
  18007. | (JSONSchema4 & {
  18008. absolutePath: boolean;
  18009. instanceof: string;
  18010. cli: {
  18011. helper?: boolean;
  18012. exclude?: boolean;
  18013. description?: string;
  18014. negatedDescription?: string;
  18015. resetDescription?: string;
  18016. };
  18017. })
  18018. | (JSONSchema6 & {
  18019. absolutePath: boolean;
  18020. instanceof: string;
  18021. cli: {
  18022. helper?: boolean;
  18023. exclude?: boolean;
  18024. description?: string;
  18025. negatedDescription?: string;
  18026. resetDescription?: string;
  18027. };
  18028. })
  18029. | (JSONSchema7 & {
  18030. absolutePath: boolean;
  18031. instanceof: string;
  18032. cli: {
  18033. helper?: boolean;
  18034. exclude?: boolean;
  18035. description?: string;
  18036. negatedDescription?: string;
  18037. resetDescription?: string;
  18038. };
  18039. })
  18040. ) => Flags;
  18041. export let isColorSupported: () => boolean;
  18042. export let processArguments: (
  18043. args: Flags,
  18044. config: ObjectConfiguration,
  18045. values: Values
  18046. ) => null | Problem[];
  18047. }
  18048. export namespace ModuleFilenameHelpers {
  18049. export let ALL_LOADERS_RESOURCE: string;
  18050. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  18051. export let LOADERS_RESOURCE: string;
  18052. export let REGEXP_LOADERS_RESOURCE: RegExp;
  18053. export let RESOURCE: string;
  18054. export let REGEXP_RESOURCE: RegExp;
  18055. export let ABSOLUTE_RESOURCE_PATH: string;
  18056. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  18057. export let RESOURCE_PATH: string;
  18058. export let REGEXP_RESOURCE_PATH: RegExp;
  18059. export let ALL_LOADERS: string;
  18060. export let REGEXP_ALL_LOADERS: RegExp;
  18061. export let LOADERS: string;
  18062. export let REGEXP_LOADERS: RegExp;
  18063. export let QUERY: string;
  18064. export let REGEXP_QUERY: RegExp;
  18065. export let ID: string;
  18066. export let REGEXP_ID: RegExp;
  18067. export let HASH: string;
  18068. export let REGEXP_HASH: RegExp;
  18069. export let NAMESPACE: string;
  18070. export let REGEXP_NAMESPACE: RegExp;
  18071. export let createFilename: (
  18072. module: string | Module,
  18073. options: {
  18074. namespace?: string;
  18075. moduleFilenameTemplate?:
  18076. | string
  18077. | ((context: ModuleFilenameTemplateContext) => string);
  18078. },
  18079. __2: {
  18080. requestShortener: RequestShortener;
  18081. chunkGraph: ChunkGraph;
  18082. hashFunction?: string | typeof Hash;
  18083. }
  18084. ) => string;
  18085. export let replaceDuplicates: <T>(
  18086. array: T[],
  18087. fn: (
  18088. duplicateItem: T,
  18089. duplicateItemIndex: number,
  18090. numberOfTimesReplaced: number
  18091. ) => T,
  18092. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  18093. ) => T[];
  18094. export let matchPart: (str: string, test: Matcher) => boolean;
  18095. export let matchObject: (obj: MatchObject, str: string) => boolean;
  18096. }
  18097. export namespace OptimizationStages {
  18098. export let STAGE_ADVANCED: 10;
  18099. export let STAGE_BASIC: -10;
  18100. export let STAGE_DEFAULT: 0;
  18101. }
  18102. export namespace RuntimeGlobals {
  18103. export let amdDefine: "__webpack_require__.amdD";
  18104. export let amdOptions: "__webpack_require__.amdO";
  18105. export let asyncModule: "__webpack_require__.a";
  18106. export let asyncModuleDoneSymbol: "__webpack_require__.aD";
  18107. export let asyncModuleExportSymbol: "__webpack_require__.aE";
  18108. export let baseURI: "__webpack_require__.b";
  18109. export let chunkCallback: "webpackChunk";
  18110. export let chunkName: "__webpack_require__.cn";
  18111. export let compatGetDefaultExport: "__webpack_require__.n";
  18112. export let createFakeNamespaceObject: "__webpack_require__.t";
  18113. export let createScript: "__webpack_require__.ts";
  18114. export let createScriptUrl: "__webpack_require__.tu";
  18115. export let cssMergeStyleSheets: "__webpack_require__.mcs";
  18116. export let currentRemoteGetScope: "__webpack_require__.R";
  18117. export let deferredModuleAsyncTransitiveDependencies: "__webpack_require__.zT";
  18118. export let deferredModuleAsyncTransitiveDependenciesSymbol: "__webpack_require__.zS";
  18119. export let definePropertyGetters: "__webpack_require__.d";
  18120. export let ensureChunk: "__webpack_require__.e";
  18121. export let ensureChunkHandlers: "__webpack_require__.f";
  18122. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  18123. export let entryModuleId: "__webpack_require__.s";
  18124. export let esmId: "__webpack_esm_id__";
  18125. export let esmIds: "__webpack_esm_ids__";
  18126. export let esmModules: "__webpack_esm_modules__";
  18127. export let esmRuntime: "__webpack_esm_runtime__";
  18128. export let exports: "__webpack_exports__";
  18129. export let externalInstallChunk: "__webpack_require__.C";
  18130. export let getChunkCssFilename: "__webpack_require__.k";
  18131. export let getChunkScriptFilename: "__webpack_require__.u";
  18132. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  18133. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  18134. export let getFullHash: "__webpack_require__.h";
  18135. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  18136. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  18137. export let global: "__webpack_require__.g";
  18138. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  18139. export let hasCssModules: "has css modules";
  18140. export let hasFetchPriority: "has fetch priority";
  18141. export let hasOwnProperty: "__webpack_require__.o";
  18142. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  18143. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  18144. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  18145. export let hmrModuleData: "__webpack_require__.hmrD";
  18146. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  18147. export let initializeSharing: "__webpack_require__.I";
  18148. export let instantiateWasm: "__webpack_require__.v";
  18149. export let interceptModuleExecution: "__webpack_require__.i";
  18150. export let loadScript: "__webpack_require__.l";
  18151. export let makeDeferredNamespaceObject: "__webpack_require__.z";
  18152. export let makeNamespaceObject: "__webpack_require__.r";
  18153. export let makeOptimizedDeferredNamespaceObject: "__webpack_require__.zO";
  18154. export let module: "module";
  18155. export let moduleCache: "__webpack_require__.c";
  18156. export let moduleFactories: "__webpack_require__.m";
  18157. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  18158. export let moduleId: "module.id";
  18159. export let moduleLoaded: "module.loaded";
  18160. export let nodeModuleDecorator: "__webpack_require__.nmd";
  18161. export let onChunksLoaded: "__webpack_require__.O";
  18162. export let prefetchChunk: "__webpack_require__.E";
  18163. export let prefetchChunkHandlers: "__webpack_require__.F";
  18164. export let preloadChunk: "__webpack_require__.G";
  18165. export let preloadChunkHandlers: "__webpack_require__.H";
  18166. export let publicPath: "__webpack_require__.p";
  18167. export let relativeUrl: "__webpack_require__.U";
  18168. export let require: "__webpack_require__";
  18169. export let requireScope: "__webpack_require__.*";
  18170. export let returnExportsFromRuntime: "return-exports-from-runtime";
  18171. export let runtimeId: "__webpack_require__.j";
  18172. export let scriptNonce: "__webpack_require__.nc";
  18173. export let shareScopeMap: "__webpack_require__.S";
  18174. export let startup: "__webpack_require__.x";
  18175. export let startupEntrypoint: "__webpack_require__.X";
  18176. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  18177. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  18178. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  18179. export let system: "__webpack_require__.System";
  18180. export let systemContext: "__webpack_require__.y";
  18181. export let thisAsExports: "top-level-this-exports";
  18182. export let toBinary: "__webpack_require__.tb";
  18183. export let uncaughtErrorHandler: "__webpack_require__.oe";
  18184. export let wasmInstances: "__webpack_require__.w";
  18185. }
  18186. export const UsageState: Readonly<{
  18187. Unused: 0;
  18188. OnlyPropertiesUsed: 1;
  18189. NoInfo: 2;
  18190. Unknown: 3;
  18191. Used: 4;
  18192. }>;
  18193. export namespace cache {
  18194. export { MemoryCachePlugin };
  18195. }
  18196. export namespace config {
  18197. export const getNormalizedWebpackOptions: (
  18198. config: Configuration
  18199. ) => WebpackOptionsNormalized;
  18200. export const applyWebpackOptionsDefaults: (
  18201. options: WebpackOptionsNormalized,
  18202. compilerIndex?: number
  18203. ) => ResolvedOptions;
  18204. }
  18205. export namespace dependencies {
  18206. export {
  18207. ModuleDependency,
  18208. HarmonyImportDependency,
  18209. ConstDependency,
  18210. NullDependency
  18211. };
  18212. }
  18213. export namespace ids {
  18214. export {
  18215. ChunkModuleIdRangePlugin,
  18216. NaturalModuleIdsPlugin,
  18217. OccurrenceModuleIdsPlugin,
  18218. NamedModuleIdsPlugin,
  18219. DeterministicChunkIdsPlugin,
  18220. DeterministicModuleIdsPlugin,
  18221. NamedChunkIdsPlugin,
  18222. OccurrenceChunkIdsPlugin,
  18223. HashedModuleIdsPlugin
  18224. };
  18225. }
  18226. export namespace javascript {
  18227. export {
  18228. EnableChunkLoadingPlugin,
  18229. JavascriptModulesPlugin,
  18230. JavascriptParser
  18231. };
  18232. }
  18233. export namespace optimize {
  18234. export namespace InnerGraph {
  18235. export let addUsage: (
  18236. state: ParserState,
  18237. symbol: null | TopLevelSymbol,
  18238. usage: Usage
  18239. ) => void;
  18240. export let addVariableUsage: (
  18241. parser: JavascriptParser,
  18242. name: string,
  18243. usage: Usage
  18244. ) => void;
  18245. export let bailout: (parserState: ParserState) => void;
  18246. export let enable: (parserState: ParserState) => void;
  18247. export let getDependencyUsedByExportsCondition: (
  18248. dependency: Dependency,
  18249. usedByExports: undefined | boolean | Set<string>,
  18250. moduleGraph: ModuleGraph
  18251. ) =>
  18252. | null
  18253. | false
  18254. | ((
  18255. moduleGraphConnection: ModuleGraphConnection,
  18256. runtime: RuntimeSpec
  18257. ) => ConnectionState);
  18258. export let getTopLevelSymbol: (
  18259. state: ParserState
  18260. ) => void | TopLevelSymbol;
  18261. export let inferDependencyUsage: (state: ParserState) => void;
  18262. export let isDependencyUsedByExports: (
  18263. dependency: Dependency,
  18264. usedByExports: undefined | boolean | Set<string>,
  18265. moduleGraph: ModuleGraph,
  18266. runtime: RuntimeSpec
  18267. ) => boolean;
  18268. export let isEnabled: (parserState: ParserState) => boolean;
  18269. export let onUsage: (
  18270. state: ParserState,
  18271. onUsageCallback: (value?: boolean | Set<string>) => void
  18272. ) => void;
  18273. export let setTopLevelSymbol: (
  18274. state: ParserState,
  18275. symbol?: TopLevelSymbol
  18276. ) => void;
  18277. export let tagTopLevelSymbol: (
  18278. parser: JavascriptParser,
  18279. name: string
  18280. ) => undefined | TopLevelSymbol;
  18281. export { TopLevelSymbol, topLevelSymbolTag };
  18282. }
  18283. export {
  18284. AggressiveMergingPlugin,
  18285. AggressiveSplittingPlugin,
  18286. LimitChunkCountPlugin,
  18287. MergeDuplicateChunksPlugin,
  18288. MinChunkSizePlugin,
  18289. ModuleConcatenationPlugin,
  18290. RealContentHashPlugin,
  18291. RuntimeChunkPlugin,
  18292. SideEffectsFlagPlugin,
  18293. SplitChunksPlugin
  18294. };
  18295. }
  18296. export namespace runtime {
  18297. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  18298. }
  18299. export namespace prefetch {
  18300. export { ChunkPrefetchPreloadPlugin };
  18301. }
  18302. export namespace web {
  18303. export {
  18304. FetchCompileWasmPlugin,
  18305. FetchCompileAsyncWasmPlugin,
  18306. JsonpChunkLoadingRuntimeModule,
  18307. JsonpTemplatePlugin,
  18308. CssLoadingRuntimeModule
  18309. };
  18310. }
  18311. export namespace esm {
  18312. export { ModuleChunkLoadingRuntimeModule };
  18313. }
  18314. export namespace webworker {
  18315. export { WebWorkerTemplatePlugin };
  18316. }
  18317. export namespace node {
  18318. export {
  18319. NodeEnvironmentPlugin,
  18320. NodeSourcePlugin,
  18321. NodeTargetPlugin,
  18322. NodeTemplatePlugin,
  18323. ReadFileCompileWasmPlugin,
  18324. ReadFileCompileAsyncWasmPlugin
  18325. };
  18326. }
  18327. export namespace electron {
  18328. export { ElectronTargetPlugin };
  18329. }
  18330. export namespace wasm {
  18331. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  18332. }
  18333. export namespace css {
  18334. export { CssModulesPlugin };
  18335. }
  18336. export namespace library {
  18337. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  18338. }
  18339. export namespace container {
  18340. export const scope: <T>(
  18341. scope: string,
  18342. options: ContainerOptionsFormat<T>
  18343. ) => Record<string, string | string[] | T>;
  18344. export {
  18345. ContainerPlugin,
  18346. ContainerReferencePlugin,
  18347. ModuleFederationPlugin
  18348. };
  18349. }
  18350. export namespace sharing {
  18351. export const scope: <T>(
  18352. scope: string,
  18353. options: ContainerOptionsFormat<T>
  18354. ) => Record<string, string | string[] | T>;
  18355. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  18356. }
  18357. export namespace debug {
  18358. export { ProfilingPlugin };
  18359. }
  18360. export namespace util {
  18361. export const createHash: (algorithm: HashFunction) => Hash;
  18362. export namespace comparators {
  18363. export let compareChunkGroupsByIndex: (
  18364. a: ChunkGroup,
  18365. b: ChunkGroup
  18366. ) => 0 | 1 | -1;
  18367. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  18368. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  18369. export let compareChunksNatural: (
  18370. chunkGraph: ChunkGraph
  18371. ) => Comparator<Chunk>;
  18372. export let compareIds: (
  18373. a: string | number,
  18374. b: string | number
  18375. ) => 0 | 1 | -1;
  18376. export let compareIterables: <T>(
  18377. elementComparator: Comparator<T>
  18378. ) => Comparator<Iterable<T>>;
  18379. export let compareLocations: (
  18380. a: DependencyLocation,
  18381. b: DependencyLocation
  18382. ) => 0 | 1 | -1;
  18383. export let compareModulesByFullName: ParameterizedComparator<
  18384. Compiler,
  18385. Module
  18386. >;
  18387. export let compareModulesById: ParameterizedComparator<
  18388. ChunkGraph,
  18389. Module
  18390. >;
  18391. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  18392. ChunkGraph,
  18393. Module
  18394. >;
  18395. export let compareModulesByIdentifier: (
  18396. a: Module,
  18397. b: Module
  18398. ) => 0 | 1 | -1;
  18399. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  18400. ModuleGraph,
  18401. Module
  18402. >;
  18403. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  18404. ModuleGraph,
  18405. Module
  18406. >;
  18407. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  18408. export let compareSelect: <T, R>(
  18409. getter: Selector<T, R>,
  18410. comparator: Comparator<R>
  18411. ) => Comparator<T>;
  18412. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  18413. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  18414. export let concatComparators: <T>(
  18415. c1: Comparator<T>,
  18416. c2: Comparator<T>,
  18417. ...cRest: Comparator<T>[]
  18418. ) => Comparator<T>;
  18419. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  18420. export let sortWithSourceOrder: (
  18421. dependencies: Dependency[],
  18422. dependencySourceOrderMap: WeakMap<Dependency, DependencySourceOrder>,
  18423. onDependencyReSort?: (dep: Dependency, index: number) => void
  18424. ) => void;
  18425. }
  18426. export namespace runtime {
  18427. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  18428. export let filterRuntime: (
  18429. runtime: RuntimeSpec,
  18430. filter: (runtime?: RuntimeSpec) => boolean
  18431. ) => undefined | string | boolean | SortableSet<string>;
  18432. export let forEachRuntime: (
  18433. runtime: RuntimeSpec,
  18434. fn: (runtime?: string) => void,
  18435. deterministicOrder?: boolean
  18436. ) => void;
  18437. export let getEntryRuntime: (
  18438. compilation: Compilation,
  18439. name: string,
  18440. options?: EntryOptions
  18441. ) => RuntimeSpec;
  18442. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  18443. export let intersectRuntime: (
  18444. a: RuntimeSpec,
  18445. b: RuntimeSpec
  18446. ) => RuntimeSpec;
  18447. export let keyToRuntime: (key: string) => RuntimeSpec;
  18448. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  18449. export let mergeRuntimeCondition: (
  18450. a: RuntimeCondition,
  18451. b: RuntimeCondition,
  18452. runtime: RuntimeSpec
  18453. ) => RuntimeCondition;
  18454. export let mergeRuntimeConditionNonFalse: (
  18455. a: undefined | string | true | SortableSet<string>,
  18456. b: undefined | string | true | SortableSet<string>,
  18457. runtime: RuntimeSpec
  18458. ) => undefined | string | true | SortableSet<string>;
  18459. export let mergeRuntimeOwned: (
  18460. a: RuntimeSpec,
  18461. b: RuntimeSpec
  18462. ) => RuntimeSpec;
  18463. export let runtimeConditionToString: (
  18464. runtimeCondition: RuntimeCondition
  18465. ) => string;
  18466. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  18467. export let runtimeToString: (runtime: RuntimeSpec) => string;
  18468. export let subtractRuntime: (
  18469. a: RuntimeSpec,
  18470. b: RuntimeSpec
  18471. ) => RuntimeSpec;
  18472. export let subtractRuntimeCondition: (
  18473. a: RuntimeCondition,
  18474. b: RuntimeCondition,
  18475. runtime: RuntimeSpec
  18476. ) => RuntimeCondition;
  18477. export { RuntimeSpecMap, RuntimeSpecSet };
  18478. }
  18479. export namespace serialization {
  18480. export const register: (
  18481. Constructor: Constructor,
  18482. request: string,
  18483. name: null | string,
  18484. serializer: ObjectSerializer
  18485. ) => void;
  18486. export const registerLoader: (
  18487. regExp: RegExp,
  18488. loader: (request: string) => boolean
  18489. ) => void;
  18490. export const registerNotSerializable: (Constructor: Constructor) => void;
  18491. export const NOT_SERIALIZABLE: object;
  18492. export const buffersSerializer: Serializer<any, any, any>;
  18493. export let createFileSerializer: <D, S, C>(
  18494. fs: IntermediateFileSystem,
  18495. hashFunction: HashFunction
  18496. ) => Serializer<D, S, C>;
  18497. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  18498. }
  18499. export const cleverMerge: <T, O>(
  18500. first?: null | T,
  18501. second?: null | O
  18502. ) => T | O | (T & O);
  18503. export function compileBooleanMatcher(
  18504. map: Record<string | number, boolean>
  18505. ): boolean | ((value: string) => string);
  18506. export namespace compileBooleanMatcher {
  18507. export let fromLists: (
  18508. positiveItems: string[],
  18509. negativeItems: string[]
  18510. ) => (value: string) => string;
  18511. export let itemsToRegexp: (itemsArr: string[]) => string;
  18512. }
  18513. export { LazySet };
  18514. }
  18515. export namespace sources {
  18516. export {
  18517. Source,
  18518. RawSource,
  18519. OriginalSource,
  18520. ReplaceSource,
  18521. SourceMapSource,
  18522. ConcatSource,
  18523. PrefixSource,
  18524. CachedSource,
  18525. SizeOnlySource,
  18526. CompatSource
  18527. };
  18528. }
  18529. export namespace experiments {
  18530. export namespace schemes {
  18531. export { HttpUriPlugin, VirtualUrlPlugin };
  18532. }
  18533. export namespace ids {
  18534. export { SyncModuleIdsPlugin };
  18535. }
  18536. }
  18537. export type RuleSetUseFunction = (data: EffectData) =>
  18538. | string
  18539. | RuleSetUseFunction
  18540. | {
  18541. /**
  18542. * Unique loader options identifier.
  18543. */
  18544. ident?: string;
  18545. /**
  18546. * Loader name.
  18547. */
  18548. loader?: string;
  18549. /**
  18550. * Loader options.
  18551. */
  18552. options?: string | { [index: string]: any };
  18553. }
  18554. | (
  18555. | undefined
  18556. | null
  18557. | string
  18558. | false
  18559. | 0
  18560. | RuleSetUseFunction
  18561. | {
  18562. /**
  18563. * Unique loader options identifier.
  18564. */
  18565. ident?: string;
  18566. /**
  18567. * Loader name.
  18568. */
  18569. loader?: string;
  18570. /**
  18571. * Loader options.
  18572. */
  18573. options?: string | { [index: string]: any };
  18574. }
  18575. )[];
  18576. export type WebpackPluginFunction = (
  18577. this: Compiler,
  18578. compiler: Compiler
  18579. ) => void;
  18580. export type ExternalItemFunctionCallback = (
  18581. data: ExternalItemFunctionData,
  18582. callback: (
  18583. err?: null | Error,
  18584. result?: string | boolean | string[] | { [index: string]: any }
  18585. ) => void
  18586. ) => void;
  18587. export type ExternalItemFunctionDataGetResolve = (
  18588. options?: ResolveOptions
  18589. ) =>
  18590. | ((
  18591. context: string,
  18592. request: string,
  18593. callback: (
  18594. err?: null | Error,
  18595. result?: string | false,
  18596. resolveRequest?: ResolveRequest
  18597. ) => void
  18598. ) => void)
  18599. | ((context: string, request: string) => Promise<string>);
  18600. export type ExternalItemFunctionDataGetResolveCallbackResult = (
  18601. context: string,
  18602. request: string,
  18603. callback: (
  18604. err?: null | Error,
  18605. result?: string | false,
  18606. resolveRequest?: ResolveRequest
  18607. ) => void
  18608. ) => void;
  18609. export type ExternalItemFunctionDataGetResolveResult = (
  18610. context: string,
  18611. request: string
  18612. ) => Promise<string>;
  18613. export type ExternalItemFunctionPromise = (
  18614. data: ExternalItemFunctionData
  18615. ) => Promise<ExternalItemValue>;
  18616. export {
  18617. AutomaticPrefetchPlugin,
  18618. AsyncDependenciesBlock,
  18619. BannerPlugin,
  18620. CacheClass as Cache,
  18621. Chunk,
  18622. ChunkGraph,
  18623. CleanPlugin,
  18624. Compilation,
  18625. Compiler,
  18626. ConcatenationScope,
  18627. ContextExclusionPlugin,
  18628. ContextReplacementPlugin,
  18629. DefinePlugin,
  18630. DelegatedPlugin,
  18631. Dependency,
  18632. DllPlugin,
  18633. DllReferencePlugin,
  18634. DynamicEntryPlugin,
  18635. DotenvPlugin,
  18636. EntryOptionPlugin,
  18637. EntryPlugin,
  18638. EnvironmentPlugin,
  18639. EvalDevToolModulePlugin,
  18640. EvalSourceMapDevToolPlugin,
  18641. ExternalModule,
  18642. ExternalsPlugin,
  18643. Generator,
  18644. HotUpdateChunk,
  18645. HotModuleReplacementPlugin,
  18646. InitFragment,
  18647. IgnorePlugin,
  18648. JavascriptModulesPlugin,
  18649. LibManifestPlugin,
  18650. LibraryTemplatePlugin,
  18651. LoaderOptionsPlugin,
  18652. LoaderTargetPlugin,
  18653. Module,
  18654. ModuleFactory,
  18655. ModuleGraph,
  18656. ModuleGraphConnection,
  18657. NoEmitOnErrorsPlugin,
  18658. NormalModule,
  18659. NormalModuleReplacementPlugin,
  18660. MultiCompiler,
  18661. ParserClass as Parser,
  18662. PlatformPlugin,
  18663. PrefetchPlugin,
  18664. ProgressPlugin,
  18665. ProvidePlugin,
  18666. RuntimeModule,
  18667. EntryPlugin as SingleEntryPlugin,
  18668. SourceMapDevToolPlugin,
  18669. Stats,
  18670. ManifestPlugin,
  18671. Template,
  18672. WatchIgnorePlugin,
  18673. WebpackError,
  18674. WebpackOptionsApply,
  18675. WebpackOptionsDefaulter,
  18676. ValidationError as WebpackOptionsValidationError,
  18677. ValidationError,
  18678. EntryLibIndex as Entry,
  18679. EntryNormalized,
  18680. EntryObject,
  18681. ExternalItem,
  18682. ExternalItemFunction,
  18683. ExternalItemObjectKnown,
  18684. ExternalItemObjectUnknown,
  18685. ExternalItemValue,
  18686. Externals,
  18687. FileCacheOptions,
  18688. GeneratorOptionsByModuleTypeKnown,
  18689. LibraryOptions,
  18690. MemoryCacheOptions,
  18691. ModuleOptions,
  18692. ParserOptionsByModuleTypeKnown,
  18693. ResolveOptions,
  18694. RuleSetCondition,
  18695. RuleSetConditionAbsolute,
  18696. RuleSetRule,
  18697. RuleSetUse,
  18698. RuleSetUseItem,
  18699. StatsOptions,
  18700. Configuration,
  18701. WebpackOptionsNormalized,
  18702. WebpackPluginInstance,
  18703. ChunkGroup,
  18704. AssetEmittedInfo,
  18705. Asset,
  18706. AssetInfo,
  18707. EntryOptions,
  18708. PathData,
  18709. CodeGenerationResults,
  18710. Entrypoint,
  18711. ExternalItemFunctionData,
  18712. MultiCompilerOptions,
  18713. MultiConfiguration,
  18714. MultiStats,
  18715. StatsOptions as MultiStatsOptions,
  18716. ResolveData,
  18717. ParserState,
  18718. ResolvePluginInstance,
  18719. Resolver,
  18720. RenderManifestEntry,
  18721. RenderManifestOptions,
  18722. TemplatePath,
  18723. Watching,
  18724. Argument,
  18725. Problem,
  18726. Colors,
  18727. ColorsOptions,
  18728. StatsAsset,
  18729. StatsChunk,
  18730. StatsChunkGroup,
  18731. StatsChunkOrigin,
  18732. StatsCompilation,
  18733. StatsError,
  18734. StatsLogging,
  18735. StatsLoggingEntry,
  18736. StatsModule,
  18737. StatsModuleIssuer,
  18738. StatsModuleReason,
  18739. StatsModuleTraceDependency,
  18740. StatsModuleTraceItem,
  18741. StatsProfile,
  18742. ObjectSerializerContext,
  18743. ObjectDeserializerContext,
  18744. InputFileSystem,
  18745. OutputFileSystem,
  18746. LoaderModule,
  18747. RawLoaderDefinition,
  18748. LoaderDefinition,
  18749. LoaderDefinitionFunction,
  18750. PitchLoaderDefinitionFunction,
  18751. RawLoaderDefinitionFunction,
  18752. LoaderContextDeclarationsIndex as LoaderContext
  18753. };
  18754. }
  18755. declare const idsSymbolCommonJsExportRequireDependency: unique symbol;
  18756. declare const idsSymbolHarmonyExportImportedSpecifierDependency: unique symbol;
  18757. declare const idsSymbolHarmonyImportSpecifierDependency: unique symbol;
  18758. declare const topLevelSymbolTag: unique symbol;
  18759. export = exports;