types.d.ts 414 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn special-lint-fix` to update
  5. */
  6. import { Buffer } from "buffer";
  7. import { Scope } from "eslint-scope";
  8. import {
  9. ArrayExpression,
  10. ArrayPattern,
  11. ArrowFunctionExpression,
  12. AssignmentExpression,
  13. AssignmentPattern,
  14. AssignmentProperty,
  15. AwaitExpression,
  16. BaseNode,
  17. BigIntLiteral,
  18. BinaryExpression,
  19. BlockStatement,
  20. BreakStatement,
  21. CatchClause,
  22. ChainExpression,
  23. ClassBody,
  24. ClassDeclaration,
  25. ClassExpression,
  26. Comment,
  27. ConditionalExpression,
  28. ContinueStatement,
  29. DebuggerStatement,
  30. Directive,
  31. DoWhileStatement,
  32. EmptyStatement,
  33. ExportAllDeclaration as ExportAllDeclarationImport,
  34. ExportDefaultDeclaration,
  35. ExportNamedDeclaration as ExportNamedDeclarationImport,
  36. ExportSpecifier,
  37. ExpressionStatement,
  38. ForInStatement,
  39. ForOfStatement,
  40. ForStatement,
  41. FunctionDeclaration,
  42. FunctionExpression,
  43. Identifier,
  44. IfStatement,
  45. ImportDeclaration as ImportDeclarationImport,
  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. SpreadElement,
  71. StaticBlock,
  72. Super,
  73. SwitchCase,
  74. SwitchStatement,
  75. TaggedTemplateExpression,
  76. TemplateElement,
  77. TemplateLiteral,
  78. ThisExpression,
  79. ThrowStatement,
  80. TryStatement,
  81. UnaryExpression,
  82. UpdateExpression,
  83. VariableDeclaration,
  84. VariableDeclarator,
  85. WhileStatement,
  86. WithStatement,
  87. YieldExpression
  88. } from "estree";
  89. import { IncomingMessage, ServerOptions } from "http";
  90. import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
  91. import { ListenOptions, Server } from "net";
  92. import { validate as validateFunction } from "schema-utils";
  93. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  94. import {
  95. Extend,
  96. ValidationErrorConfiguration
  97. } from "schema-utils/declarations/validate";
  98. import {
  99. AsArray,
  100. AsyncParallelHook,
  101. AsyncSeriesBailHook,
  102. AsyncSeriesHook,
  103. AsyncSeriesWaterfallHook,
  104. HookMap,
  105. IfSet,
  106. MultiHook,
  107. SyncBailHook,
  108. SyncHook,
  109. SyncWaterfallHook,
  110. TapOptions
  111. } from "tapable";
  112. import { SecureContextOptions, TlsOptions } from "tls";
  113. import { URL } from "url";
  114. import { Context } from "vm";
  115. declare interface Abortable {
  116. /**
  117. * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
  118. */
  119. signal?: AbortSignal;
  120. }
  121. declare class AbstractLibraryPlugin<T> {
  122. constructor(__0: AbstractLibraryPluginOptions);
  123. /**
  124. * Apply the plugin
  125. */
  126. apply(compiler: Compiler): void;
  127. parseOptions(library: LibraryOptions): false | T;
  128. finishEntryModule(
  129. module: Module,
  130. entryName: string,
  131. libraryContext: LibraryContext<T>
  132. ): void;
  133. embedInRuntimeBailout(
  134. module: Module,
  135. renderContext: RenderContextJavascriptModulesPlugin,
  136. libraryContext: LibraryContext<T>
  137. ): undefined | string;
  138. strictRuntimeBailout(
  139. renderContext: RenderContextJavascriptModulesPlugin,
  140. libraryContext: LibraryContext<T>
  141. ): undefined | string;
  142. runtimeRequirements(
  143. chunk: Chunk,
  144. set: Set<string>,
  145. libraryContext: LibraryContext<T>
  146. ): void;
  147. render(
  148. source: Source,
  149. renderContext: RenderContextJavascriptModulesPlugin,
  150. libraryContext: LibraryContext<T>
  151. ): Source;
  152. renderStartup(
  153. source: Source,
  154. module: Module,
  155. renderContext: StartupRenderContext,
  156. libraryContext: LibraryContext<T>
  157. ): Source;
  158. chunkHash(
  159. chunk: Chunk,
  160. hash: Hash,
  161. chunkHashContext: ChunkHashContext,
  162. libraryContext: LibraryContext<T>
  163. ): void;
  164. static COMMON_LIBRARY_NAME_MESSAGE: string;
  165. }
  166. declare interface AbstractLibraryPluginOptions {
  167. /**
  168. * name of the plugin
  169. */
  170. pluginName: string;
  171. /**
  172. * used library type
  173. */
  174. type: string;
  175. }
  176. declare interface AdditionalData {
  177. [index: string]: any;
  178. webpackAST: object;
  179. }
  180. declare class AggressiveMergingPlugin {
  181. constructor(options?: AggressiveMergingPluginOptions);
  182. options: AggressiveMergingPluginOptions;
  183. /**
  184. * Apply the plugin
  185. */
  186. apply(compiler: Compiler): void;
  187. }
  188. declare interface AggressiveMergingPluginOptions {
  189. /**
  190. * minimal size reduction to trigger merging
  191. */
  192. minSizeReduce?: number;
  193. }
  194. declare class AggressiveSplittingPlugin {
  195. constructor(options?: AggressiveSplittingPluginOptions);
  196. options: AggressiveSplittingPluginOptions;
  197. /**
  198. * Apply the plugin
  199. */
  200. apply(compiler: Compiler): void;
  201. static wasChunkRecorded(chunk: Chunk): boolean;
  202. }
  203. declare interface AggressiveSplittingPluginOptions {
  204. /**
  205. * Extra cost for each chunk (Default: 9.8kiB).
  206. */
  207. chunkOverhead?: number;
  208. /**
  209. * Extra cost multiplicator for entry chunks (Default: 10).
  210. */
  211. entryChunkMultiplicator?: number;
  212. /**
  213. * Byte, max size of per file (Default: 50kiB).
  214. */
  215. maxSize?: number;
  216. /**
  217. * Byte, split point. (Default: 30kiB).
  218. */
  219. minSize?: number;
  220. }
  221. type Algorithm = string | typeof Hash;
  222. type Alias = string | false | string[];
  223. declare interface AliasOption {
  224. alias: Alias;
  225. name: string;
  226. onlyModule?: boolean;
  227. }
  228. type AliasOptionNewRequest = string | false | string[];
  229. declare interface AliasOptions {
  230. [index: string]: AliasOptionNewRequest;
  231. }
  232. declare interface Argument {
  233. description?: string;
  234. simpleType: SimpleType;
  235. multiple: boolean;
  236. configs: ArgumentConfig[];
  237. }
  238. declare interface ArgumentConfig {
  239. description?: string;
  240. negatedDescription?: string;
  241. path: string;
  242. multiple: boolean;
  243. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  244. values?: EnumValue[];
  245. }
  246. type ArrayBufferLike = ArrayBuffer | SharedArrayBuffer;
  247. type ArrayBufferView<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> =
  248. | Uint8Array
  249. | Uint8ClampedArray
  250. | Uint16Array
  251. | Uint32Array
  252. | Int8Array
  253. | Int16Array
  254. | Int32Array
  255. | BigUint64Array
  256. | BigInt64Array
  257. | Float32Array
  258. | Float64Array
  259. | DataView;
  260. declare interface Asset {
  261. /**
  262. * the filename of the asset
  263. */
  264. name: string;
  265. /**
  266. * source of the asset
  267. */
  268. source: Source;
  269. /**
  270. * info about the asset
  271. */
  272. info: AssetInfo;
  273. }
  274. declare interface AssetDependencyMeta {
  275. sourceType: "css-url";
  276. }
  277. declare interface AssetEmittedInfo {
  278. content: Buffer;
  279. source: Source;
  280. compilation: Compilation;
  281. outputPath: string;
  282. targetPath: string;
  283. }
  284. type AssetFilterItemTypes =
  285. | string
  286. | RegExp
  287. | ((name: string, asset: StatsAsset) => boolean);
  288. /**
  289. * Options object for data url generation.
  290. */
  291. declare interface AssetGeneratorDataUrlOptions {
  292. /**
  293. * Asset encoding (defaults to base64).
  294. */
  295. encoding?: false | "base64";
  296. /**
  297. * Asset mimetype (getting from file extension by default).
  298. */
  299. mimetype?: string;
  300. }
  301. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  302. AssetResourceGeneratorOptions;
  303. type AssetInfo = KnownAssetInfo & Record<string, any>;
  304. /**
  305. * Generator options for asset/inline modules.
  306. */
  307. declare interface AssetInlineGeneratorOptions {
  308. /**
  309. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  310. */
  311. binary?: boolean;
  312. /**
  313. * The options for data url generator.
  314. */
  315. dataUrl?:
  316. | AssetGeneratorDataUrlOptions
  317. | ((
  318. source: string | Buffer,
  319. context: { filename: string; module: Module }
  320. ) => string);
  321. }
  322. /**
  323. * Options object for DataUrl condition.
  324. */
  325. declare interface AssetParserDataUrlOptions {
  326. /**
  327. * Maximum size of asset that should be inline as modules. Default: 8kb.
  328. */
  329. maxSize?: number;
  330. }
  331. /**
  332. * Parser options for asset modules.
  333. */
  334. declare interface AssetParserOptions {
  335. /**
  336. * The condition for inlining the asset as DataUrl.
  337. */
  338. dataUrlCondition?:
  339. | AssetParserDataUrlOptions
  340. | ((
  341. source: string | Buffer,
  342. context: { filename: string; module: Module }
  343. ) => boolean);
  344. }
  345. /**
  346. * Generator options for asset/resource modules.
  347. */
  348. declare interface AssetResourceGeneratorOptions {
  349. /**
  350. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  351. */
  352. binary?: boolean;
  353. /**
  354. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  355. */
  356. emit?: boolean;
  357. /**
  358. * 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.
  359. */
  360. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  361. /**
  362. * 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.
  363. */
  364. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  365. /**
  366. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  367. */
  368. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  369. }
  370. declare class AsyncDependenciesBlock extends DependenciesBlock {
  371. constructor(
  372. groupOptions:
  373. | null
  374. | string
  375. | (RawChunkGroupOptions & { name?: null | string } & {
  376. entryOptions?: EntryOptions;
  377. }),
  378. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  379. request?: null | string
  380. );
  381. groupOptions: RawChunkGroupOptions & { name?: null | string } & {
  382. entryOptions?: EntryOptions;
  383. };
  384. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  385. request?: null | string;
  386. chunkName?: null | string;
  387. module: any;
  388. }
  389. declare abstract class AsyncQueue<T, K, R> {
  390. hooks: {
  391. beforeAdd: AsyncSeriesHook<[T]>;
  392. added: SyncHook<[T]>;
  393. beforeStart: AsyncSeriesHook<[T]>;
  394. started: SyncHook<[T]>;
  395. result: SyncHook<
  396. [T, undefined | null | WebpackError, undefined | null | R]
  397. >;
  398. };
  399. getContext(): string;
  400. setContext(value: string): void;
  401. add(item: T, callback: CallbackAsyncQueue<R>): void;
  402. invalidate(item: T): void;
  403. /**
  404. * Waits for an already started item
  405. */
  406. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  407. stop(): void;
  408. increaseParallelism(): void;
  409. decreaseParallelism(): void;
  410. isProcessing(item: T): boolean;
  411. isQueued(item: T): boolean;
  412. isDone(item: T): boolean;
  413. clear(): void;
  414. }
  415. declare class AsyncWebAssemblyModulesPlugin {
  416. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  417. options: AsyncWebAssemblyModulesPluginOptions;
  418. /**
  419. * Apply the plugin
  420. */
  421. apply(compiler: Compiler): void;
  422. renderModule(
  423. module: Module,
  424. renderContext: WebAssemblyRenderContext,
  425. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  426. ): Source;
  427. static getCompilationHooks(
  428. compilation: Compilation
  429. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  430. }
  431. declare interface AsyncWebAssemblyModulesPluginOptions {
  432. /**
  433. * mangle imports
  434. */
  435. mangleImports?: boolean;
  436. }
  437. declare class AutomaticPrefetchPlugin {
  438. constructor();
  439. /**
  440. * Apply the plugin
  441. */
  442. apply(compiler: Compiler): void;
  443. }
  444. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  445. declare interface BackendApi {
  446. dispose: (callback: (err?: null | Error) => void) => void;
  447. module: (module: Module) => ModuleResult;
  448. }
  449. declare class BannerPlugin {
  450. constructor(options: BannerPluginArgument);
  451. options: BannerPluginOptions;
  452. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  453. /**
  454. * Apply the plugin
  455. */
  456. apply(compiler: Compiler): void;
  457. }
  458. type BannerPluginArgument =
  459. | string
  460. | BannerPluginOptions
  461. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  462. declare interface BannerPluginOptions {
  463. /**
  464. * Specifies the banner.
  465. */
  466. banner:
  467. | string
  468. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  469. /**
  470. * If true, the banner will only be added to the entry chunks.
  471. */
  472. entryOnly?: boolean;
  473. /**
  474. * Exclude all modules matching any of these conditions.
  475. */
  476. exclude?: string | RegExp | Rule[];
  477. /**
  478. * If true, banner will be placed at the end of the output.
  479. */
  480. footer?: boolean;
  481. /**
  482. * Include all modules matching any of these conditions.
  483. */
  484. include?: string | RegExp | Rule[];
  485. /**
  486. * If true, banner will not be wrapped in a comment.
  487. */
  488. raw?: boolean;
  489. /**
  490. * Specifies the stage when add a banner.
  491. */
  492. stage?: number;
  493. /**
  494. * Include all modules that pass test assertion.
  495. */
  496. test?: string | RegExp | Rule[];
  497. }
  498. declare interface BaseResolveRequest {
  499. path: string | false;
  500. context?: object;
  501. descriptionFilePath?: string;
  502. descriptionFileRoot?: string;
  503. descriptionFileData?: JsonObjectTypes;
  504. relativePath?: string;
  505. ignoreSymlinks?: boolean;
  506. fullySpecified?: boolean;
  507. __innerRequest?: string;
  508. __innerRequest_request?: string;
  509. __innerRequest_relativePath?: string;
  510. }
  511. declare abstract class BasicEvaluatedExpression {
  512. type: number;
  513. range?: [number, number];
  514. falsy: boolean;
  515. truthy: boolean;
  516. nullish?: boolean;
  517. sideEffects: boolean;
  518. bool?: boolean;
  519. number?: number;
  520. bigint?: bigint;
  521. regExp?: RegExp;
  522. string?: string;
  523. quasis?: BasicEvaluatedExpression[];
  524. parts?: BasicEvaluatedExpression[];
  525. array?: any[];
  526. items?: BasicEvaluatedExpression[];
  527. options?: BasicEvaluatedExpression[];
  528. prefix?: null | BasicEvaluatedExpression;
  529. postfix?: null | BasicEvaluatedExpression;
  530. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  531. identifier?: string | VariableInfo;
  532. rootInfo?: string | VariableInfo;
  533. getMembers?: () => string[];
  534. getMembersOptionals?: () => boolean[];
  535. getMemberRanges?: () => [number, number][];
  536. expression?:
  537. | Program
  538. | ImportDeclarationImport
  539. | ExportNamedDeclarationImport
  540. | ExportAllDeclarationImport
  541. | ImportExpressionImport
  542. | UnaryExpression
  543. | ArrayExpression
  544. | ArrowFunctionExpression
  545. | AssignmentExpression
  546. | AwaitExpression
  547. | BinaryExpression
  548. | SimpleCallExpression
  549. | NewExpression
  550. | ChainExpression
  551. | ClassExpression
  552. | ConditionalExpression
  553. | FunctionExpression
  554. | Identifier
  555. | SimpleLiteral
  556. | RegExpLiteral
  557. | BigIntLiteral
  558. | LogicalExpression
  559. | MemberExpression
  560. | MetaProperty
  561. | ObjectExpression
  562. | SequenceExpression
  563. | TaggedTemplateExpression
  564. | TemplateLiteral
  565. | ThisExpression
  566. | UpdateExpression
  567. | YieldExpression
  568. | SpreadElement
  569. | PrivateIdentifier
  570. | Super
  571. | FunctionDeclaration
  572. | VariableDeclaration
  573. | ClassDeclaration
  574. | ExpressionStatement
  575. | BlockStatement
  576. | StaticBlock
  577. | EmptyStatement
  578. | DebuggerStatement
  579. | WithStatement
  580. | ReturnStatement
  581. | LabeledStatement
  582. | BreakStatement
  583. | ContinueStatement
  584. | IfStatement
  585. | SwitchStatement
  586. | ThrowStatement
  587. | TryStatement
  588. | WhileStatement
  589. | DoWhileStatement
  590. | ForStatement
  591. | ForInStatement
  592. | ForOfStatement
  593. | ExportDefaultDeclaration
  594. | MethodDefinition
  595. | PropertyDefinition
  596. | VariableDeclarator
  597. | SwitchCase
  598. | CatchClause
  599. | ObjectPattern
  600. | ArrayPattern
  601. | RestElement
  602. | AssignmentPattern
  603. | Property
  604. | AssignmentProperty
  605. | ClassBody
  606. | ImportSpecifier
  607. | ImportDefaultSpecifier
  608. | ImportNamespaceSpecifier
  609. | ExportSpecifier
  610. | TemplateElement;
  611. isUnknown(): boolean;
  612. isNull(): boolean;
  613. isUndefined(): boolean;
  614. isString(): boolean;
  615. isNumber(): boolean;
  616. isBigInt(): boolean;
  617. isBoolean(): boolean;
  618. isRegExp(): boolean;
  619. isConditional(): boolean;
  620. isArray(): boolean;
  621. isConstArray(): boolean;
  622. isIdentifier(): boolean;
  623. isWrapped(): boolean;
  624. isTemplateString(): boolean;
  625. /**
  626. * Is expression a primitive or an object type value?
  627. */
  628. isPrimitiveType(): undefined | boolean;
  629. /**
  630. * Is expression a runtime or compile-time value?
  631. */
  632. isCompileTimeValue(): boolean;
  633. /**
  634. * Gets the compile-time value of the expression
  635. */
  636. asCompileTimeValue(): any;
  637. isTruthy(): boolean;
  638. isFalsy(): boolean;
  639. isNullish(): undefined | boolean;
  640. /**
  641. * Can this expression have side effects?
  642. */
  643. couldHaveSideEffects(): boolean;
  644. /**
  645. * Creates a boolean representation of this evaluated expression.
  646. */
  647. asBool(): undefined | boolean;
  648. /**
  649. * Creates a nullish coalescing representation of this evaluated expression.
  650. */
  651. asNullish(): undefined | boolean;
  652. /**
  653. * Creates a string representation of this evaluated expression.
  654. */
  655. asString(): undefined | string;
  656. setString(string: string): BasicEvaluatedExpression;
  657. setUndefined(): BasicEvaluatedExpression;
  658. setNull(): BasicEvaluatedExpression;
  659. /**
  660. * Set's the value of this expression to a number
  661. */
  662. setNumber(number: number): BasicEvaluatedExpression;
  663. /**
  664. * Set's the value of this expression to a BigInt
  665. */
  666. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  667. /**
  668. * Set's the value of this expression to a boolean
  669. */
  670. setBoolean(bool: boolean): BasicEvaluatedExpression;
  671. /**
  672. * Set's the value of this expression to a regular expression
  673. */
  674. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  675. /**
  676. * Set's the value of this expression to a particular identifier and its members.
  677. */
  678. setIdentifier(
  679. identifier: string | VariableInfo,
  680. rootInfo: string | VariableInfo,
  681. getMembers: () => string[],
  682. getMembersOptionals?: () => boolean[],
  683. getMemberRanges?: () => [number, number][]
  684. ): BasicEvaluatedExpression;
  685. /**
  686. * Wraps an array of expressions with a prefix and postfix expression.
  687. */
  688. setWrapped(
  689. prefix?: null | BasicEvaluatedExpression,
  690. postfix?: null | BasicEvaluatedExpression,
  691. innerExpressions?: BasicEvaluatedExpression[]
  692. ): BasicEvaluatedExpression;
  693. /**
  694. * Stores the options of a conditional expression.
  695. */
  696. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  697. /**
  698. * Adds options to a conditional expression.
  699. */
  700. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  701. /**
  702. * Set's the value of this expression to an array of expressions.
  703. */
  704. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  705. /**
  706. * Set's the value of this expression to an array of strings.
  707. */
  708. setArray(array: string[]): BasicEvaluatedExpression;
  709. /**
  710. * Set's the value of this expression to a processed/unprocessed template string. Used
  711. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  712. */
  713. setTemplateString(
  714. quasis: BasicEvaluatedExpression[],
  715. parts: BasicEvaluatedExpression[],
  716. kind: "raw" | "cooked"
  717. ): BasicEvaluatedExpression;
  718. templateStringKind?: "raw" | "cooked";
  719. setTruthy(): BasicEvaluatedExpression;
  720. setFalsy(): BasicEvaluatedExpression;
  721. /**
  722. * Set's the value of the expression to nullish.
  723. */
  724. setNullish(value: boolean): BasicEvaluatedExpression;
  725. /**
  726. * Set's the range for the expression.
  727. */
  728. setRange(range: [number, number]): BasicEvaluatedExpression;
  729. /**
  730. * Set whether or not the expression has side effects.
  731. */
  732. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  733. /**
  734. * Set the expression node for the expression.
  735. */
  736. setExpression(
  737. expression?:
  738. | Program
  739. | ImportDeclarationImport
  740. | ExportNamedDeclarationImport
  741. | ExportAllDeclarationImport
  742. | ImportExpressionImport
  743. | UnaryExpression
  744. | ArrayExpression
  745. | ArrowFunctionExpression
  746. | AssignmentExpression
  747. | AwaitExpression
  748. | BinaryExpression
  749. | SimpleCallExpression
  750. | NewExpression
  751. | ChainExpression
  752. | ClassExpression
  753. | ConditionalExpression
  754. | FunctionExpression
  755. | Identifier
  756. | SimpleLiteral
  757. | RegExpLiteral
  758. | BigIntLiteral
  759. | LogicalExpression
  760. | MemberExpression
  761. | MetaProperty
  762. | ObjectExpression
  763. | SequenceExpression
  764. | TaggedTemplateExpression
  765. | TemplateLiteral
  766. | ThisExpression
  767. | UpdateExpression
  768. | YieldExpression
  769. | SpreadElement
  770. | PrivateIdentifier
  771. | Super
  772. | FunctionDeclaration
  773. | VariableDeclaration
  774. | ClassDeclaration
  775. | ExpressionStatement
  776. | BlockStatement
  777. | StaticBlock
  778. | EmptyStatement
  779. | DebuggerStatement
  780. | WithStatement
  781. | ReturnStatement
  782. | LabeledStatement
  783. | BreakStatement
  784. | ContinueStatement
  785. | IfStatement
  786. | SwitchStatement
  787. | ThrowStatement
  788. | TryStatement
  789. | WhileStatement
  790. | DoWhileStatement
  791. | ForStatement
  792. | ForInStatement
  793. | ForOfStatement
  794. | ExportDefaultDeclaration
  795. | MethodDefinition
  796. | PropertyDefinition
  797. | VariableDeclarator
  798. | SwitchCase
  799. | CatchClause
  800. | ObjectPattern
  801. | ArrayPattern
  802. | RestElement
  803. | AssignmentPattern
  804. | Property
  805. | AssignmentProperty
  806. | ClassBody
  807. | ImportSpecifier
  808. | ImportDefaultSpecifier
  809. | ImportNamespaceSpecifier
  810. | ExportSpecifier
  811. | TemplateElement
  812. ): BasicEvaluatedExpression;
  813. }
  814. declare interface Bootstrap {
  815. header: string[];
  816. beforeStartup: string[];
  817. startup: string[];
  818. afterStartup: string[];
  819. allowInlineStartup: boolean;
  820. }
  821. type BufferEncoding =
  822. | "ascii"
  823. | "utf8"
  824. | "utf-8"
  825. | "utf16le"
  826. | "utf-16le"
  827. | "ucs2"
  828. | "ucs-2"
  829. | "base64"
  830. | "base64url"
  831. | "latin1"
  832. | "binary"
  833. | "hex";
  834. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  835. type BuildInfo = KnownBuildInfo & Record<string, any>;
  836. type BuildMeta = KnownBuildMeta & Record<string, any>;
  837. declare abstract class ByTypeGenerator extends Generator {
  838. map: Record<string, Generator>;
  839. generateError?: (
  840. error: Error,
  841. module: NormalModule,
  842. generateContext: GenerateContext
  843. ) => null | Source;
  844. }
  845. declare const CIRCULAR_CONNECTION: unique symbol;
  846. declare class Cache {
  847. constructor();
  848. hooks: {
  849. get: AsyncSeriesBailHook<
  850. [
  851. string,
  852. null | Etag,
  853. ((result: any, callback: (err?: Error) => void) => void)[]
  854. ],
  855. any
  856. >;
  857. store: AsyncParallelHook<[string, null | Etag, any]>;
  858. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  859. beginIdle: SyncHook<[]>;
  860. endIdle: AsyncParallelHook<[]>;
  861. shutdown: AsyncParallelHook<[]>;
  862. };
  863. get<T>(
  864. identifier: string,
  865. etag: null | Etag,
  866. callback: CallbackCacheCache<T>
  867. ): void;
  868. store<T>(
  869. identifier: string,
  870. etag: null | Etag,
  871. data: T,
  872. callback: CallbackCacheCache<void>
  873. ): void;
  874. /**
  875. * After this method has succeeded the cache can only be restored when build dependencies are
  876. */
  877. storeBuildDependencies(
  878. dependencies: Iterable<string>,
  879. callback: CallbackCacheCache<void>
  880. ): void;
  881. beginIdle(): void;
  882. endIdle(callback: CallbackCacheCache<void>): void;
  883. shutdown(callback: CallbackCacheCache<void>): void;
  884. static STAGE_MEMORY: number;
  885. static STAGE_DEFAULT: number;
  886. static STAGE_DISK: number;
  887. static STAGE_NETWORK: number;
  888. }
  889. declare abstract class CacheFacade {
  890. getChildCache(name: string): CacheFacade;
  891. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  892. getLazyHashedEtag(obj: HashableObject): Etag;
  893. mergeEtags(a: Etag, b: Etag): Etag;
  894. get<T>(
  895. identifier: string,
  896. etag: null | Etag,
  897. callback: CallbackCacheCacheFacade<T>
  898. ): void;
  899. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  900. store<T>(
  901. identifier: string,
  902. etag: null | Etag,
  903. data: T,
  904. callback: CallbackCacheCacheFacade<void>
  905. ): void;
  906. storePromise<T>(
  907. identifier: string,
  908. etag: null | Etag,
  909. data: T
  910. ): Promise<void>;
  911. provide<T>(
  912. identifier: string,
  913. etag: null | Etag,
  914. computer: (callback: CallbackNormalErrorCache<T>) => void,
  915. callback: CallbackNormalErrorCache<T>
  916. ): void;
  917. providePromise<T>(
  918. identifier: string,
  919. etag: null | Etag,
  920. computer: () => T | Promise<T>
  921. ): Promise<T>;
  922. }
  923. declare interface CacheGroupSource {
  924. key: string;
  925. priority?: number;
  926. getName?: (
  927. module: Module,
  928. chunks: Chunk[],
  929. key: string
  930. ) => undefined | string;
  931. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  932. enforce?: boolean;
  933. minSize: SplitChunksSizes;
  934. minSizeReduction: SplitChunksSizes;
  935. minRemainingSize: SplitChunksSizes;
  936. enforceSizeThreshold: SplitChunksSizes;
  937. maxAsyncSize: SplitChunksSizes;
  938. maxInitialSize: SplitChunksSizes;
  939. minChunks?: number;
  940. maxAsyncRequests?: number;
  941. maxInitialRequests?: number;
  942. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  943. idHint?: string;
  944. automaticNameDelimiter?: string;
  945. reuseExistingChunk?: boolean;
  946. usedExports?: boolean;
  947. }
  948. declare interface CacheGroupsContext {
  949. moduleGraph: ModuleGraph;
  950. chunkGraph: ChunkGraph;
  951. }
  952. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  953. declare class CachedSource extends Source {
  954. constructor(source: Source);
  955. constructor(source: Source | (() => Source), cachedData?: any);
  956. original(): Source;
  957. originalLazy(): Source | (() => Source);
  958. getCachedData(): any;
  959. }
  960. type CallExpression = SimpleCallExpression | NewExpression;
  961. declare interface CallExpressionInfo {
  962. type: "call";
  963. call: CallExpression;
  964. calleeName: string;
  965. rootInfo: string | VariableInfo;
  966. getCalleeMembers: () => string[];
  967. name: string;
  968. getMembers: () => string[];
  969. getMembersOptionals: () => boolean[];
  970. getMemberRanges: () => [number, number][];
  971. }
  972. declare interface CallbackAsyncQueue<T> {
  973. (err?: null | WebpackError, result?: null | T): any;
  974. }
  975. declare interface CallbackCacheCache<T> {
  976. (err: null | WebpackError, result?: T): void;
  977. }
  978. declare interface CallbackCacheCacheFacade<T> {
  979. (err?: null | Error, result?: null | T): void;
  980. }
  981. declare interface CallbackFunction_1<T> {
  982. (err: null | Error, result?: T): any;
  983. }
  984. declare interface CallbackFunction_2<T> {
  985. (err?: null | Error, result?: T): any;
  986. }
  987. declare interface CallbackNormalErrorCache<T> {
  988. (err?: null | Error, result?: T): void;
  989. }
  990. declare interface CallbackNormalModuleFactory<T> {
  991. (err?: null | Error, stats?: T): void;
  992. }
  993. declare interface CallbackWebpack<T> {
  994. (err: null | Error, stats?: T): void;
  995. }
  996. type Cell<T> = undefined | T;
  997. declare class Chunk {
  998. constructor(name?: null | string, backCompat?: boolean);
  999. id: null | string | number;
  1000. ids: null | ChunkId[];
  1001. debugId: number;
  1002. name?: null | string;
  1003. idNameHints: SortableSet<string>;
  1004. preventIntegration: boolean;
  1005. filenameTemplate?:
  1006. | string
  1007. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1008. cssFilenameTemplate?:
  1009. | string
  1010. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1011. runtime: RuntimeSpec;
  1012. files: Set<string>;
  1013. auxiliaryFiles: Set<string>;
  1014. rendered: boolean;
  1015. hash?: string;
  1016. contentHash: Record<string, string>;
  1017. renderedHash?: string;
  1018. chunkReason?: string;
  1019. extraAsync: boolean;
  1020. get entryModule(): Module;
  1021. hasEntryModule(): boolean;
  1022. addModule(module: Module): boolean;
  1023. removeModule(module: Module): void;
  1024. getNumberOfModules(): number;
  1025. get modulesIterable(): Iterable<Module>;
  1026. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  1027. containsModule(module: Module): boolean;
  1028. getModules(): Module[];
  1029. remove(): void;
  1030. moveModule(module: Module, otherChunk: Chunk): void;
  1031. integrate(otherChunk: Chunk): boolean;
  1032. canBeIntegrated(otherChunk: Chunk): boolean;
  1033. isEmpty(): boolean;
  1034. modulesSize(): number;
  1035. size(options?: ChunkSizeOptions): number;
  1036. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  1037. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  1038. hasModuleInGraph(
  1039. filterFn: (m: Module) => boolean,
  1040. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1041. ): boolean;
  1042. getChunkMaps(realHash: boolean): ChunkMaps;
  1043. hasRuntime(): boolean;
  1044. canBeInitial(): boolean;
  1045. isOnlyInitial(): boolean;
  1046. getEntryOptions(): undefined | EntryOptions;
  1047. addGroup(chunkGroup: ChunkGroup): void;
  1048. removeGroup(chunkGroup: ChunkGroup): void;
  1049. isInGroup(chunkGroup: ChunkGroup): boolean;
  1050. getNumberOfGroups(): number;
  1051. get groupsIterable(): SortableSet<ChunkGroup>;
  1052. disconnectFromGroups(): void;
  1053. split(newChunk: Chunk): void;
  1054. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1055. getAllAsyncChunks(): Set<Chunk>;
  1056. getAllInitialChunks(): Set<Chunk>;
  1057. getAllReferencedChunks(): Set<Chunk>;
  1058. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1059. hasAsyncChunks(): boolean;
  1060. getChildIdsByOrders(
  1061. chunkGraph: ChunkGraph,
  1062. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1063. ): Record<string, (string | number)[]>;
  1064. getChildrenOfTypeInOrder(
  1065. chunkGraph: ChunkGraph,
  1066. type: string
  1067. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  1068. getChildIdsByOrdersMap(
  1069. chunkGraph: ChunkGraph,
  1070. includeDirectChildren?: boolean,
  1071. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1072. ): Record<string | number, Record<string, (string | number)[]>>;
  1073. hasChildByOrder(
  1074. chunkGraph: ChunkGraph,
  1075. type: string,
  1076. includeDirectChildren?: boolean,
  1077. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1078. ): boolean;
  1079. }
  1080. declare class ChunkGraph {
  1081. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  1082. moduleGraph: ModuleGraph;
  1083. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1084. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1085. disconnectChunk(chunk: Chunk): void;
  1086. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1087. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1088. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1089. attachDependentHashModules(
  1090. chunk: Chunk,
  1091. modules: Iterable<RuntimeModule>
  1092. ): void;
  1093. replaceModule(oldModule: Module, newModule: Module): void;
  1094. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1095. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1096. isEntryModule(module: Module): boolean;
  1097. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1098. getOrderedModuleChunksIterable(
  1099. module: Module,
  1100. sortFn: (a: Chunk, b: Chunk) => 0 | 1 | -1
  1101. ): Iterable<Chunk>;
  1102. getModuleChunks(module: Module): Chunk[];
  1103. getNumberOfModuleChunks(module: Module): number;
  1104. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1105. getNumberOfChunkModules(chunk: Chunk): number;
  1106. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1107. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1108. getChunkModulesIterableBySourceType(
  1109. chunk: Chunk,
  1110. sourceType: string
  1111. ): undefined | Iterable<Module>;
  1112. setChunkModuleSourceTypes(
  1113. chunk: Chunk,
  1114. module: Module,
  1115. sourceTypes: Set<string>
  1116. ): void;
  1117. getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet<string>;
  1118. getModuleSourceTypes(module: Module): ReadonlySet<string>;
  1119. getOrderedChunkModulesIterable(
  1120. chunk: Chunk,
  1121. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1122. ): Iterable<Module>;
  1123. getOrderedChunkModulesIterableBySourceType(
  1124. chunk: Chunk,
  1125. sourceType: string,
  1126. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1127. ): undefined | Iterable<Module>;
  1128. getChunkModules(chunk: Chunk): Module[];
  1129. getOrderedChunkModules(
  1130. chunk: Chunk,
  1131. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1132. ): Module[];
  1133. getChunkModuleIdMap(
  1134. chunk: Chunk,
  1135. filterFn: (m: Module) => boolean,
  1136. includeAllChunks?: boolean
  1137. ): Record<string | number, (string | number)[]>;
  1138. getChunkModuleRenderedHashMap(
  1139. chunk: Chunk,
  1140. filterFn: (m: Module) => boolean,
  1141. hashLength?: number,
  1142. includeAllChunks?: boolean
  1143. ): Record<string | number, Record<string | number, string>>;
  1144. getChunkConditionMap(
  1145. chunk: Chunk,
  1146. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1147. ): Record<string | number, boolean>;
  1148. hasModuleInGraph(
  1149. chunk: Chunk,
  1150. filterFn: (m: Module) => boolean,
  1151. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1152. ): boolean;
  1153. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1154. getChunkModulesSize(chunk: Chunk): number;
  1155. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1156. getChunkRootModules(chunk: Chunk): Module[];
  1157. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1158. getIntegratedChunksSize(
  1159. chunkA: Chunk,
  1160. chunkB: Chunk,
  1161. options?: ChunkSizeOptions
  1162. ): number;
  1163. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1164. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1165. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1166. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1167. connectChunkAndEntryModule(
  1168. chunk: Chunk,
  1169. module: Module,
  1170. entrypoint: Entrypoint
  1171. ): void;
  1172. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1173. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1174. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1175. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1176. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1177. disconnectEntryModule(module: Module): void;
  1178. disconnectEntries(chunk: Chunk): void;
  1179. getNumberOfEntryModules(chunk: Chunk): number;
  1180. getNumberOfRuntimeModules(chunk: Chunk): number;
  1181. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1182. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1183. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1184. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1185. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1186. getChunkFullHashModulesIterable(
  1187. chunk: Chunk
  1188. ): undefined | Iterable<RuntimeModule>;
  1189. getChunkFullHashModulesSet(
  1190. chunk: Chunk
  1191. ): undefined | ReadonlySet<RuntimeModule>;
  1192. getChunkDependentHashModulesIterable(
  1193. chunk: Chunk
  1194. ): undefined | Iterable<RuntimeModule>;
  1195. getChunkEntryModulesWithChunkGroupIterable(
  1196. chunk: Chunk
  1197. ): Iterable<[Module, undefined | Entrypoint]>;
  1198. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1199. connectBlockAndChunkGroup(
  1200. depBlock: AsyncDependenciesBlock,
  1201. chunkGroup: ChunkGroup
  1202. ): void;
  1203. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1204. getModuleId(module: Module): null | string | number;
  1205. setModuleId(module: Module, id: ModuleId): void;
  1206. getRuntimeId(runtime: string): string | number;
  1207. setRuntimeId(runtime: string, id: string | number): void;
  1208. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1209. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1210. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1211. setModuleHashes(
  1212. module: Module,
  1213. runtime: RuntimeSpec,
  1214. hash: string,
  1215. renderedHash: string
  1216. ): void;
  1217. addModuleRuntimeRequirements(
  1218. module: Module,
  1219. runtime: RuntimeSpec,
  1220. items: Set<string>,
  1221. transferOwnership?: boolean
  1222. ): void;
  1223. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1224. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1225. getModuleRuntimeRequirements(
  1226. module: Module,
  1227. runtime: RuntimeSpec
  1228. ): ReadonlySet<string>;
  1229. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1230. getModuleGraphHash(
  1231. module: Module,
  1232. runtime: RuntimeSpec,
  1233. withConnections?: boolean
  1234. ): string;
  1235. getModuleGraphHashBigInt(
  1236. module: Module,
  1237. runtime: RuntimeSpec,
  1238. withConnections?: boolean
  1239. ): bigint;
  1240. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1241. static getChunkGraphForModule(
  1242. module: Module,
  1243. deprecateMessage: string,
  1244. deprecationCode: string
  1245. ): ChunkGraph;
  1246. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1247. static clearChunkGraphForModule(module: Module): void;
  1248. static getChunkGraphForChunk(
  1249. chunk: Chunk,
  1250. deprecateMessage: string,
  1251. deprecationCode: string
  1252. ): ChunkGraph;
  1253. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1254. static clearChunkGraphForChunk(chunk: Chunk): void;
  1255. }
  1256. declare abstract class ChunkGroup {
  1257. groupDebugId: number;
  1258. options: ChunkGroupOptions;
  1259. chunks: Chunk[];
  1260. origins: OriginRecord[];
  1261. index?: number;
  1262. /**
  1263. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1264. */
  1265. addOptions(options: ChunkGroupOptions): void;
  1266. /**
  1267. * returns the name of current ChunkGroup
  1268. * sets a new name for current ChunkGroup
  1269. */
  1270. name?: null | string;
  1271. /**
  1272. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1273. */
  1274. get debugId(): string;
  1275. /**
  1276. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1277. */
  1278. get id(): string;
  1279. /**
  1280. * Performs an unshift of a specific chunk
  1281. */
  1282. unshiftChunk(chunk: Chunk): boolean;
  1283. /**
  1284. * inserts a chunk before another existing chunk in group
  1285. */
  1286. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1287. /**
  1288. * add a chunk into ChunkGroup. Is pushed on or prepended
  1289. */
  1290. pushChunk(chunk: Chunk): boolean;
  1291. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1292. removeChunk(chunk: Chunk): boolean;
  1293. isInitial(): boolean;
  1294. addChild(group: ChunkGroup): boolean;
  1295. getChildren(): ChunkGroup[];
  1296. getNumberOfChildren(): number;
  1297. get childrenIterable(): SortableSet<ChunkGroup>;
  1298. removeChild(group: ChunkGroup): boolean;
  1299. addParent(parentChunk: ChunkGroup): boolean;
  1300. getParents(): ChunkGroup[];
  1301. getNumberOfParents(): number;
  1302. hasParent(parent: ChunkGroup): boolean;
  1303. get parentsIterable(): SortableSet<ChunkGroup>;
  1304. removeParent(chunkGroup: ChunkGroup): boolean;
  1305. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1306. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1307. getBlocks(): AsyncDependenciesBlock[];
  1308. getNumberOfBlocks(): number;
  1309. hasBlock(block: AsyncDependenciesBlock): boolean;
  1310. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1311. addBlock(block: AsyncDependenciesBlock): boolean;
  1312. addOrigin(
  1313. module: null | Module,
  1314. loc: DependencyLocation,
  1315. request: string
  1316. ): void;
  1317. getFiles(): string[];
  1318. remove(): void;
  1319. sortItems(): void;
  1320. /**
  1321. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1322. * Sorting values are based off of number of chunks in ChunkGroup.
  1323. */
  1324. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1325. getChildrenByOrders(
  1326. moduleGraph: ModuleGraph,
  1327. chunkGraph: ChunkGraph
  1328. ): Record<string, ChunkGroup[]>;
  1329. /**
  1330. * Sets the top-down index of a module in this ChunkGroup
  1331. */
  1332. setModulePreOrderIndex(module: Module, index: number): void;
  1333. /**
  1334. * Gets the top-down index of a module in this ChunkGroup
  1335. */
  1336. getModulePreOrderIndex(module: Module): undefined | number;
  1337. /**
  1338. * Sets the bottom-up index of a module in this ChunkGroup
  1339. */
  1340. setModulePostOrderIndex(module: Module, index: number): void;
  1341. /**
  1342. * Gets the bottom-up index of a module in this ChunkGroup
  1343. */
  1344. getModulePostOrderIndex(module: Module): undefined | number;
  1345. checkConstraints(): void;
  1346. getModuleIndex: (module: Module) => undefined | number;
  1347. getModuleIndex2: (module: Module) => undefined | number;
  1348. }
  1349. type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string };
  1350. declare interface ChunkHashContext {
  1351. /**
  1352. * results of code generation
  1353. */
  1354. codeGenerationResults: CodeGenerationResults;
  1355. /**
  1356. * the runtime template
  1357. */
  1358. runtimeTemplate: RuntimeTemplate;
  1359. /**
  1360. * the module graph
  1361. */
  1362. moduleGraph: ModuleGraph;
  1363. /**
  1364. * the chunk graph
  1365. */
  1366. chunkGraph: ChunkGraph;
  1367. }
  1368. type ChunkId = string | number;
  1369. declare interface ChunkMaps {
  1370. hash: Record<string | number, string>;
  1371. contentHash: Record<string | number, Record<string, string>>;
  1372. name: Record<string | number, string>;
  1373. }
  1374. declare class ChunkModuleIdRangePlugin {
  1375. constructor(options: ChunkModuleIdRangePluginOptions);
  1376. options: ChunkModuleIdRangePluginOptions;
  1377. /**
  1378. * Apply the plugin
  1379. */
  1380. apply(compiler: Compiler): void;
  1381. }
  1382. declare interface ChunkModuleIdRangePluginOptions {
  1383. /**
  1384. * the chunk name
  1385. */
  1386. name: string;
  1387. /**
  1388. * order
  1389. */
  1390. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1391. /**
  1392. * start id
  1393. */
  1394. start?: number;
  1395. /**
  1396. * end id
  1397. */
  1398. end?: number;
  1399. }
  1400. declare interface ChunkModuleMaps {
  1401. id: Record<string | number, (string | number)[]>;
  1402. hash: Record<string | number, string>;
  1403. }
  1404. declare interface ChunkPathData {
  1405. id: string | number;
  1406. name?: string;
  1407. hash: string;
  1408. hashWithLength?: (length: number) => string;
  1409. contentHash?: Record<string, string>;
  1410. contentHashWithLength?: Record<string, (length: number) => string>;
  1411. }
  1412. declare class ChunkPrefetchPreloadPlugin {
  1413. constructor();
  1414. apply(compiler: Compiler): void;
  1415. }
  1416. declare interface ChunkRenderContextCssModulesPlugin {
  1417. /**
  1418. * the chunk
  1419. */
  1420. chunk: Chunk;
  1421. /**
  1422. * the chunk graph
  1423. */
  1424. chunkGraph: ChunkGraph;
  1425. /**
  1426. * results of code generation
  1427. */
  1428. codeGenerationResults: CodeGenerationResults;
  1429. /**
  1430. * the runtime template
  1431. */
  1432. runtimeTemplate: RuntimeTemplate;
  1433. /**
  1434. * undo path to css file
  1435. */
  1436. undoPath: string;
  1437. }
  1438. declare interface ChunkRenderContextJavascriptModulesPlugin {
  1439. /**
  1440. * the chunk
  1441. */
  1442. chunk: Chunk;
  1443. /**
  1444. * the dependency templates
  1445. */
  1446. dependencyTemplates: DependencyTemplates;
  1447. /**
  1448. * the runtime template
  1449. */
  1450. runtimeTemplate: RuntimeTemplate;
  1451. /**
  1452. * the module graph
  1453. */
  1454. moduleGraph: ModuleGraph;
  1455. /**
  1456. * the chunk graph
  1457. */
  1458. chunkGraph: ChunkGraph;
  1459. /**
  1460. * results of code generation
  1461. */
  1462. codeGenerationResults: CodeGenerationResults;
  1463. /**
  1464. * init fragments for the chunk
  1465. */
  1466. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  1467. /**
  1468. * rendering in strict context
  1469. */
  1470. strictMode?: boolean;
  1471. }
  1472. declare interface ChunkSizeOptions {
  1473. /**
  1474. * constant overhead for a chunk
  1475. */
  1476. chunkOverhead?: number;
  1477. /**
  1478. * multiplicator for initial chunks
  1479. */
  1480. entryChunkMultiplicator?: number;
  1481. }
  1482. declare abstract class ChunkTemplate {
  1483. hooks: Readonly<{
  1484. renderManifest: {
  1485. tap: <AdditionalOptions>(
  1486. options:
  1487. | string
  1488. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1489. fn: (
  1490. renderManifestEntries: RenderManifestEntry[],
  1491. renderManifestOptions: RenderManifestOptions
  1492. ) => RenderManifestEntry[]
  1493. ) => void;
  1494. };
  1495. modules: {
  1496. tap: <AdditionalOptions>(
  1497. options:
  1498. | string
  1499. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1500. fn: (
  1501. source: Source,
  1502. moduleTemplate: ModuleTemplate,
  1503. renderContext: RenderContextJavascriptModulesPlugin
  1504. ) => Source
  1505. ) => void;
  1506. };
  1507. render: {
  1508. tap: <AdditionalOptions>(
  1509. options:
  1510. | string
  1511. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1512. fn: (
  1513. source: Source,
  1514. moduleTemplate: ModuleTemplate,
  1515. renderContext: RenderContextJavascriptModulesPlugin
  1516. ) => Source
  1517. ) => void;
  1518. };
  1519. renderWithEntry: {
  1520. tap: <AdditionalOptions>(
  1521. options:
  1522. | string
  1523. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1524. fn: (source: Source, chunk: Chunk) => Source
  1525. ) => void;
  1526. };
  1527. hash: {
  1528. tap: <AdditionalOptions>(
  1529. options:
  1530. | string
  1531. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1532. fn: (hash: Hash) => void
  1533. ) => void;
  1534. };
  1535. hashForChunk: {
  1536. tap: <AdditionalOptions>(
  1537. options:
  1538. | string
  1539. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1540. fn: (
  1541. hash: Hash,
  1542. chunk: Chunk,
  1543. chunkHashContext: ChunkHashContext
  1544. ) => void
  1545. ) => void;
  1546. };
  1547. }>;
  1548. get outputOptions(): Output;
  1549. }
  1550. /**
  1551. * Advanced options for cleaning assets.
  1552. */
  1553. declare interface CleanOptions {
  1554. /**
  1555. * Log the assets that should be removed instead of deleting them.
  1556. */
  1557. dry?: boolean;
  1558. /**
  1559. * Keep these assets.
  1560. */
  1561. keep?: string | RegExp | ((filename: string) => boolean);
  1562. }
  1563. declare class CleanPlugin {
  1564. constructor(options?: CleanOptions);
  1565. options: {
  1566. /**
  1567. * Log the assets that should be removed instead of deleting them.
  1568. */
  1569. dry: boolean;
  1570. /**
  1571. * Keep these assets.
  1572. */
  1573. keep?: string | RegExp | ((filename: string) => boolean);
  1574. };
  1575. /**
  1576. * Apply the plugin
  1577. */
  1578. apply(compiler: Compiler): void;
  1579. static getCompilationHooks(
  1580. compilation: Compilation
  1581. ): CleanPluginCompilationHooks;
  1582. }
  1583. declare interface CleanPluginCompilationHooks {
  1584. /**
  1585. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1586. */
  1587. keep: SyncBailHook<[string], boolean | void>;
  1588. }
  1589. declare interface CodeGenerationContext {
  1590. /**
  1591. * the dependency templates
  1592. */
  1593. dependencyTemplates: DependencyTemplates;
  1594. /**
  1595. * the runtime template
  1596. */
  1597. runtimeTemplate: RuntimeTemplate;
  1598. /**
  1599. * the module graph
  1600. */
  1601. moduleGraph: ModuleGraph;
  1602. /**
  1603. * the chunk graph
  1604. */
  1605. chunkGraph: ChunkGraph;
  1606. /**
  1607. * the runtimes code should be generated for
  1608. */
  1609. runtime: RuntimeSpec;
  1610. /**
  1611. * when in concatenated module, information about other concatenated modules
  1612. */
  1613. concatenationScope?: ConcatenationScope;
  1614. /**
  1615. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1616. */
  1617. codeGenerationResults?: CodeGenerationResults;
  1618. /**
  1619. * the compilation
  1620. */
  1621. compilation?: Compilation;
  1622. /**
  1623. * source types
  1624. */
  1625. sourceTypes?: ReadonlySet<string>;
  1626. }
  1627. declare interface CodeGenerationJob {
  1628. module: Module;
  1629. hash: string;
  1630. runtime: RuntimeSpec;
  1631. runtimes: RuntimeSpec[];
  1632. }
  1633. declare interface CodeGenerationResult {
  1634. /**
  1635. * the resulting sources for all source types
  1636. */
  1637. sources: Map<string, Source>;
  1638. /**
  1639. * the resulting data for all source types
  1640. */
  1641. data?: Map<string, any>;
  1642. /**
  1643. * the runtime requirements
  1644. */
  1645. runtimeRequirements: null | ReadonlySet<string>;
  1646. /**
  1647. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1648. */
  1649. hash?: string;
  1650. }
  1651. declare abstract class CodeGenerationResults {
  1652. map: Map<Module, RuntimeSpecMap<CodeGenerationResult, CodeGenerationResult>>;
  1653. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1654. has(module: Module, runtime: RuntimeSpec): boolean;
  1655. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1656. getRuntimeRequirements(
  1657. module: Module,
  1658. runtime: RuntimeSpec
  1659. ): null | ReadonlySet<string>;
  1660. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1661. getHash(module: Module, runtime: RuntimeSpec): string;
  1662. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1663. }
  1664. type CodeValue =
  1665. | undefined
  1666. | null
  1667. | string
  1668. | number
  1669. | bigint
  1670. | boolean
  1671. | Function
  1672. | RegExp
  1673. | RuntimeValue
  1674. | {
  1675. [index: string]: RecursiveArrayOrRecord<
  1676. | undefined
  1677. | null
  1678. | string
  1679. | number
  1680. | bigint
  1681. | boolean
  1682. | Function
  1683. | RegExp
  1684. | RuntimeValue
  1685. >;
  1686. }
  1687. | RecursiveArrayOrRecord<
  1688. | undefined
  1689. | null
  1690. | string
  1691. | number
  1692. | bigint
  1693. | boolean
  1694. | Function
  1695. | RegExp
  1696. | RuntimeValue
  1697. >[];
  1698. type CodeValuePrimitive =
  1699. | undefined
  1700. | null
  1701. | string
  1702. | number
  1703. | bigint
  1704. | boolean
  1705. | Function
  1706. | RegExp;
  1707. declare interface Comparator<T> {
  1708. (a: T, b: T): 0 | 1 | -1;
  1709. }
  1710. declare class CompatSource extends Source {
  1711. constructor(sourceLike: SourceLike);
  1712. static from(sourceLike: SourceLike): Source;
  1713. }
  1714. declare class Compilation {
  1715. /**
  1716. * Creates an instance of Compilation.
  1717. */
  1718. constructor(compiler: Compiler, params: CompilationParams);
  1719. hooks: Readonly<{
  1720. buildModule: SyncHook<[Module]>;
  1721. rebuildModule: SyncHook<[Module]>;
  1722. failedModule: SyncHook<[Module, WebpackError]>;
  1723. succeedModule: SyncHook<[Module]>;
  1724. stillValidModule: SyncHook<[Module]>;
  1725. addEntry: SyncHook<[Dependency, EntryOptions]>;
  1726. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  1727. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  1728. dependencyReferencedExports: SyncWaterfallHook<
  1729. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec]
  1730. >;
  1731. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  1732. prepareModuleExecution: AsyncParallelHook<
  1733. [ExecuteModuleArgument, ExecuteModuleContext]
  1734. >;
  1735. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  1736. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  1737. unseal: SyncHook<[]>;
  1738. seal: SyncHook<[]>;
  1739. beforeChunks: SyncHook<[]>;
  1740. /**
  1741. * The `afterChunks` hook is called directly after the chunks and module graph have
  1742. * been created and before the chunks and modules have been optimized. This hook is useful to
  1743. * inspect, analyze, and/or modify the chunk graph.
  1744. */
  1745. afterChunks: SyncHook<[Iterable<Chunk>]>;
  1746. optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
  1747. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  1748. optimize: SyncHook<[]>;
  1749. optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
  1750. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  1751. optimizeChunks: SyncBailHook<
  1752. [Iterable<Chunk>, ChunkGroup[]],
  1753. boolean | void
  1754. >;
  1755. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  1756. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  1757. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1758. optimizeChunkModules: AsyncSeriesBailHook<
  1759. [Iterable<Chunk>, Iterable<Module>],
  1760. void
  1761. >;
  1762. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  1763. shouldRecord: SyncBailHook<[], boolean | void>;
  1764. additionalChunkRuntimeRequirements: SyncHook<
  1765. [Chunk, Set<string>, RuntimeRequirementsContext]
  1766. >;
  1767. runtimeRequirementInChunk: HookMap<
  1768. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1769. >;
  1770. additionalModuleRuntimeRequirements: SyncHook<
  1771. [Module, Set<string>, RuntimeRequirementsContext]
  1772. >;
  1773. runtimeRequirementInModule: HookMap<
  1774. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
  1775. >;
  1776. additionalTreeRuntimeRequirements: SyncHook<
  1777. [Chunk, Set<string>, RuntimeRequirementsContext]
  1778. >;
  1779. runtimeRequirementInTree: HookMap<
  1780. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  1781. >;
  1782. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  1783. reviveModules: SyncHook<[Iterable<Module>, Records]>;
  1784. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  1785. moduleIds: SyncHook<[Iterable<Module>]>;
  1786. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1787. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  1788. reviveChunks: SyncHook<[Iterable<Chunk>, Records]>;
  1789. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1790. chunkIds: SyncHook<[Iterable<Chunk>]>;
  1791. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1792. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  1793. recordModules: SyncHook<[Iterable<Module>, Records]>;
  1794. recordChunks: SyncHook<[Iterable<Chunk>, Records]>;
  1795. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  1796. beforeModuleHash: SyncHook<[]>;
  1797. afterModuleHash: SyncHook<[]>;
  1798. beforeCodeGeneration: SyncHook<[]>;
  1799. afterCodeGeneration: SyncHook<[]>;
  1800. beforeRuntimeRequirements: SyncHook<[]>;
  1801. afterRuntimeRequirements: SyncHook<[]>;
  1802. beforeHash: SyncHook<[]>;
  1803. contentHash: SyncHook<[Chunk]>;
  1804. afterHash: SyncHook<[]>;
  1805. recordHash: SyncHook<[Records]>;
  1806. record: SyncHook<[Compilation, Records]>;
  1807. beforeModuleAssets: SyncHook<[]>;
  1808. shouldGenerateChunkAssets: SyncBailHook<[], boolean | void>;
  1809. beforeChunkAssets: SyncHook<[]>;
  1810. additionalChunkAssets: FakeHook<
  1811. Pick<
  1812. AsyncSeriesHook<[Set<Chunk>]>,
  1813. "name" | "tap" | "tapAsync" | "tapPromise"
  1814. >
  1815. >;
  1816. additionalAssets: FakeHook<
  1817. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  1818. >;
  1819. optimizeChunkAssets: FakeHook<
  1820. Pick<
  1821. AsyncSeriesHook<[Set<Chunk>]>,
  1822. "name" | "tap" | "tapAsync" | "tapPromise"
  1823. >
  1824. >;
  1825. afterOptimizeChunkAssets: FakeHook<
  1826. Pick<
  1827. AsyncSeriesHook<[Set<Chunk>]>,
  1828. "name" | "tap" | "tapAsync" | "tapPromise"
  1829. >
  1830. >;
  1831. optimizeAssets: AsyncSeriesHook<
  1832. [CompilationAssets],
  1833. ProcessAssetsAdditionalOptions
  1834. >;
  1835. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  1836. processAssets: AsyncSeriesHook<
  1837. [CompilationAssets],
  1838. ProcessAssetsAdditionalOptions
  1839. >;
  1840. afterProcessAssets: SyncHook<[CompilationAssets]>;
  1841. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  1842. needAdditionalSeal: SyncBailHook<[], boolean | void>;
  1843. afterSeal: AsyncSeriesHook<[]>;
  1844. renderManifest: SyncWaterfallHook<
  1845. [RenderManifestEntry[], RenderManifestOptions]
  1846. >;
  1847. fullHash: SyncHook<[Hash]>;
  1848. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  1849. moduleAsset: SyncHook<[Module, string]>;
  1850. chunkAsset: SyncHook<[Chunk, string]>;
  1851. assetPath: SyncWaterfallHook<[string, PathData, undefined | AssetInfo]>;
  1852. needAdditionalPass: SyncBailHook<[], boolean | void>;
  1853. childCompiler: SyncHook<[Compiler, string, number]>;
  1854. log: SyncBailHook<[string, LogEntry], boolean | void>;
  1855. processWarnings: SyncWaterfallHook<[WebpackError[]]>;
  1856. processErrors: SyncWaterfallHook<[WebpackError[]]>;
  1857. statsPreset: HookMap<
  1858. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  1859. >;
  1860. statsNormalize: SyncHook<
  1861. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  1862. >;
  1863. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  1864. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  1865. get normalModuleLoader(): SyncHook<
  1866. [LoaderContextNormalModule<any>, NormalModule]
  1867. >;
  1868. }>;
  1869. name?: string;
  1870. startTime?: number;
  1871. endTime?: number;
  1872. compiler: Compiler;
  1873. resolverFactory: ResolverFactory;
  1874. inputFileSystem: InputFileSystem;
  1875. fileSystemInfo: FileSystemInfo;
  1876. valueCacheVersions: Map<string, string | Set<string>>;
  1877. requestShortener: RequestShortener;
  1878. compilerPath: string;
  1879. logger: WebpackLogger;
  1880. options: WebpackOptionsNormalized;
  1881. outputOptions: OutputNormalized;
  1882. bail: boolean;
  1883. profile: boolean;
  1884. params: CompilationParams;
  1885. mainTemplate: MainTemplate;
  1886. chunkTemplate: ChunkTemplate;
  1887. runtimeTemplate: RuntimeTemplate;
  1888. moduleTemplates: ModuleTemplates;
  1889. moduleMemCaches?: Map<Module, WeakTupleMap<any, any>>;
  1890. moduleMemCaches2?: Map<Module, WeakTupleMap<any, any>>;
  1891. moduleGraph: ModuleGraph;
  1892. chunkGraph: ChunkGraph;
  1893. codeGenerationResults: CodeGenerationResults;
  1894. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  1895. addModuleQueue: AsyncQueue<Module, string, Module>;
  1896. factorizeQueue: AsyncQueue<
  1897. FactorizeModuleOptions,
  1898. string,
  1899. Module | ModuleFactoryResult
  1900. >;
  1901. buildQueue: AsyncQueue<Module, Module, Module>;
  1902. rebuildQueue: AsyncQueue<Module, Module, Module>;
  1903. /**
  1904. * Modules in value are building during the build of Module in key.
  1905. * Means value blocking key from finishing.
  1906. * Needed to detect build cycles.
  1907. */
  1908. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  1909. entries: Map<string, EntryData>;
  1910. globalEntry: EntryData;
  1911. entrypoints: Map<string, Entrypoint>;
  1912. asyncEntrypoints: Entrypoint[];
  1913. chunks: Set<Chunk>;
  1914. chunkGroups: ChunkGroup[];
  1915. namedChunkGroups: Map<string, ChunkGroup>;
  1916. namedChunks: Map<string, Chunk>;
  1917. modules: Set<Module>;
  1918. records: null | Records;
  1919. additionalChunkAssets: string[];
  1920. assets: CompilationAssets;
  1921. assetsInfo: Map<string, AssetInfo>;
  1922. errors: WebpackError[];
  1923. warnings: WebpackError[];
  1924. children: Compilation[];
  1925. logging: Map<string, LogEntry[]>;
  1926. dependencyFactories: Map<DepConstructor, ModuleFactory>;
  1927. dependencyTemplates: DependencyTemplates;
  1928. childrenCounters: Record<string, number>;
  1929. usedChunkIds: null | Set<string | number>;
  1930. usedModuleIds: null | Set<number>;
  1931. needAdditionalPass: boolean;
  1932. builtModules: WeakSet<Module>;
  1933. codeGeneratedModules: WeakSet<Module>;
  1934. buildTimeExecutedModules: WeakSet<Module>;
  1935. emittedAssets: Set<string>;
  1936. comparedForEmitAssets: Set<string>;
  1937. fileDependencies: LazySet<string>;
  1938. contextDependencies: LazySet<string>;
  1939. missingDependencies: LazySet<string>;
  1940. buildDependencies: LazySet<string>;
  1941. compilationDependencies: { add: (item: string) => LazySet<string> };
  1942. getStats(): Stats;
  1943. createStatsOptions(
  1944. optionsOrPreset?: string | boolean | StatsOptions,
  1945. context?: CreateStatsOptionsContext
  1946. ): NormalizedStatsOptions;
  1947. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  1948. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  1949. getCache(name: string): CacheFacade;
  1950. getLogger(name: string | (() => string)): WebpackLogger;
  1951. addModule(
  1952. module: Module,
  1953. callback: (err?: null | WebpackError, result?: null | Module) => void
  1954. ): void;
  1955. /**
  1956. * Fetches a module from a compilation by its identifier
  1957. */
  1958. getModule(module: Module): Module;
  1959. /**
  1960. * Attempts to search for a module by its identifier
  1961. */
  1962. findModule(identifier: string): undefined | Module;
  1963. /**
  1964. * Schedules a build of the module object
  1965. */
  1966. buildModule(
  1967. module: Module,
  1968. callback: (err?: null | WebpackError, result?: null | Module) => void
  1969. ): void;
  1970. processModuleDependencies(
  1971. module: Module,
  1972. callback: (err?: null | WebpackError, result?: null | Module) => void
  1973. ): void;
  1974. processModuleDependenciesNonRecursive(module: Module): void;
  1975. handleModuleCreation(
  1976. __0: HandleModuleCreationOptions,
  1977. callback: (err?: null | WebpackError, result?: null | Module) => void
  1978. ): void;
  1979. addModuleChain(
  1980. context: string,
  1981. dependency: Dependency,
  1982. callback: (err?: null | WebpackError, result?: null | Module) => void
  1983. ): void;
  1984. addModuleTree(
  1985. __0: {
  1986. /**
  1987. * context string path
  1988. */
  1989. context: string;
  1990. /**
  1991. * dependency used to create Module chain
  1992. */
  1993. dependency: Dependency;
  1994. /**
  1995. * additional context info for the root module
  1996. */
  1997. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  1998. },
  1999. callback: (err?: null | WebpackError, result?: null | Module) => void
  2000. ): void;
  2001. addEntry(
  2002. context: string,
  2003. entry: Dependency,
  2004. optionsOrName: string | EntryOptions,
  2005. callback: (err?: null | WebpackError, result?: null | Module) => void
  2006. ): void;
  2007. addInclude(
  2008. context: string,
  2009. dependency: Dependency,
  2010. options: EntryOptions,
  2011. callback: (err?: null | WebpackError, result?: null | Module) => void
  2012. ): void;
  2013. rebuildModule(
  2014. module: Module,
  2015. callback: (err?: null | WebpackError, result?: null | Module) => void
  2016. ): void;
  2017. finish(callback: (err?: null | WebpackError) => void): void;
  2018. unseal(): void;
  2019. seal(callback: (err?: null | WebpackError) => void): void;
  2020. reportDependencyErrorsAndWarnings(
  2021. module: Module,
  2022. blocks: DependenciesBlock[]
  2023. ): boolean;
  2024. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  2025. processRuntimeRequirements(__0?: {
  2026. /**
  2027. * the chunk graph
  2028. */
  2029. chunkGraph?: ChunkGraph;
  2030. /**
  2031. * modules
  2032. */
  2033. modules?: Iterable<Module>;
  2034. /**
  2035. * chunks
  2036. */
  2037. chunks?: Iterable<Chunk>;
  2038. /**
  2039. * codeGenerationResults
  2040. */
  2041. codeGenerationResults?: CodeGenerationResults;
  2042. /**
  2043. * chunkGraphEntries
  2044. */
  2045. chunkGraphEntries?: Iterable<Chunk>;
  2046. }): void;
  2047. addRuntimeModule(
  2048. chunk: Chunk,
  2049. module: RuntimeModule,
  2050. chunkGraph?: ChunkGraph
  2051. ): void;
  2052. /**
  2053. * If `module` is passed, `loc` and `request` must also be passed.
  2054. */
  2055. addChunkInGroup(
  2056. groupOptions: string | ChunkGroupOptions,
  2057. module?: Module,
  2058. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  2059. request?: string
  2060. ): ChunkGroup;
  2061. addAsyncEntrypoint(
  2062. options: EntryOptions,
  2063. module: Module,
  2064. loc: DependencyLocation,
  2065. request: string
  2066. ): Entrypoint;
  2067. /**
  2068. * This method first looks to see if a name is provided for a new chunk,
  2069. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  2070. */
  2071. addChunk(name?: null | string): Chunk;
  2072. assignDepth(module: Module): void;
  2073. assignDepths(modules: Set<Module>): void;
  2074. getDependencyReferencedExports(
  2075. dependency: Dependency,
  2076. runtime: RuntimeSpec
  2077. ): (string[] | ReferencedExport)[];
  2078. removeReasonsOfDependencyBlock(
  2079. module: Module,
  2080. block: DependenciesBlockLike
  2081. ): void;
  2082. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  2083. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  2084. assignRuntimeIds(): void;
  2085. sortItemsWithChunkIds(): void;
  2086. summarizeDependencies(): void;
  2087. createModuleHashes(): void;
  2088. createHash(): CodeGenerationJob[];
  2089. fullHash?: string;
  2090. hash?: string;
  2091. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  2092. updateAsset(
  2093. file: string,
  2094. newSourceOrFunction: Source | ((source: Source) => Source),
  2095. assetInfoUpdateOrFunction?:
  2096. | AssetInfo
  2097. | ((assetInfo?: AssetInfo) => undefined | AssetInfo)
  2098. ): void;
  2099. renameAsset(file: string, newFile: string): void;
  2100. deleteAsset(file: string): void;
  2101. getAssets(): Readonly<Asset>[];
  2102. getAsset(name: string): undefined | Readonly<Asset>;
  2103. clearAssets(): void;
  2104. createModuleAssets(): void;
  2105. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  2106. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  2107. getPath(filename: TemplatePath, data?: PathData): string;
  2108. getPathWithInfo(
  2109. filename: TemplatePath,
  2110. data?: PathData
  2111. ): InterpolatedPathAndAssetInfo;
  2112. getAssetPath(filename: TemplatePath, data: PathData): string;
  2113. getAssetPathWithInfo(
  2114. filename: TemplatePath,
  2115. data: PathData
  2116. ): InterpolatedPathAndAssetInfo;
  2117. getWarnings(): WebpackError[];
  2118. getErrors(): WebpackError[];
  2119. /**
  2120. * This function allows you to run another instance of webpack inside of webpack however as
  2121. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  2122. * from parent (or top level compiler) and creates a child Compilation
  2123. */
  2124. createChildCompiler(
  2125. name: string,
  2126. outputOptions?: Partial<OutputNormalized>,
  2127. plugins?: (
  2128. | ((this: Compiler, compiler: Compiler) => void)
  2129. | WebpackPluginInstance
  2130. )[]
  2131. ): Compiler;
  2132. executeModule(
  2133. module: Module,
  2134. options: ExecuteModuleOptions,
  2135. callback: (err: null | WebpackError, result?: ExecuteModuleResult) => void
  2136. ): void;
  2137. checkConstraints(): void;
  2138. factorizeModule: {
  2139. (
  2140. options: FactorizeModuleOptions & { factoryResult?: false },
  2141. callback: (err?: null | WebpackError, result?: null | Module) => void
  2142. ): void;
  2143. (
  2144. options: FactorizeModuleOptions & { factoryResult: true },
  2145. callback: (
  2146. err?: null | WebpackError,
  2147. result?: ModuleFactoryResult
  2148. ) => void
  2149. ): void;
  2150. };
  2151. /**
  2152. * Add additional assets to the compilation.
  2153. */
  2154. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2155. /**
  2156. * Basic preprocessing of assets.
  2157. */
  2158. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2159. /**
  2160. * Derive new assets from existing assets.
  2161. * Existing assets should not be treated as complete.
  2162. */
  2163. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2164. /**
  2165. * Add additional sections to existing assets, like a banner or initialization code.
  2166. */
  2167. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2168. /**
  2169. * Optimize existing assets in a general way.
  2170. */
  2171. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2172. /**
  2173. * Optimize the count of existing assets, e. g. by merging them.
  2174. * Only assets of the same type should be merged.
  2175. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2176. */
  2177. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2178. /**
  2179. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2180. */
  2181. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2182. /**
  2183. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2184. */
  2185. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2186. /**
  2187. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2188. */
  2189. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2190. /**
  2191. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2192. * Only assets of different types should be inlined.
  2193. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2194. */
  2195. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2196. /**
  2197. * Summarize the list of existing assets
  2198. * e. g. creating an assets manifest of Service Workers.
  2199. */
  2200. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2201. /**
  2202. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2203. */
  2204. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2205. /**
  2206. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2207. */
  2208. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2209. /**
  2210. * Analyse existing assets.
  2211. */
  2212. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2213. /**
  2214. * Creating assets for reporting purposes.
  2215. */
  2216. static PROCESS_ASSETS_STAGE_REPORT: number;
  2217. }
  2218. declare interface CompilationAssets {
  2219. [index: string]: Source;
  2220. }
  2221. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2222. renderModuleContent: SyncWaterfallHook<
  2223. [Source, Module, WebAssemblyRenderContext]
  2224. >;
  2225. }
  2226. declare interface CompilationHooksCssModulesPlugin {
  2227. renderModulePackage: SyncWaterfallHook<
  2228. [Source, Module, ChunkRenderContextCssModulesPlugin]
  2229. >;
  2230. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2231. }
  2232. declare interface CompilationHooksJavascriptModulesPlugin {
  2233. renderModuleContent: SyncWaterfallHook<
  2234. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2235. >;
  2236. renderModuleContainer: SyncWaterfallHook<
  2237. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2238. >;
  2239. renderModulePackage: SyncWaterfallHook<
  2240. [Source, Module, ChunkRenderContextJavascriptModulesPlugin]
  2241. >;
  2242. renderChunk: SyncWaterfallHook<
  2243. [Source, RenderContextJavascriptModulesPlugin]
  2244. >;
  2245. renderMain: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
  2246. renderContent: SyncWaterfallHook<
  2247. [Source, RenderContextJavascriptModulesPlugin]
  2248. >;
  2249. render: SyncWaterfallHook<[Source, RenderContextJavascriptModulesPlugin]>;
  2250. renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
  2251. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
  2252. inlineInRuntimeBailout: SyncBailHook<
  2253. [Module, RenderBootstrapContext],
  2254. string | void
  2255. >;
  2256. embedInRuntimeBailout: SyncBailHook<
  2257. [Module, RenderContextJavascriptModulesPlugin],
  2258. string | void
  2259. >;
  2260. strictRuntimeBailout: SyncBailHook<
  2261. [RenderContextJavascriptModulesPlugin],
  2262. string | void
  2263. >;
  2264. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2265. useSourceMap: SyncBailHook<
  2266. [Chunk, RenderContextJavascriptModulesPlugin],
  2267. boolean | void
  2268. >;
  2269. }
  2270. declare interface CompilationHooksModuleFederationPlugin {
  2271. addContainerEntryDependency: SyncHook<Dependency>;
  2272. addFederationRuntimeDependency: SyncHook<Dependency>;
  2273. }
  2274. declare interface CompilationHooksRealContentHashPlugin {
  2275. updateHash: SyncBailHook<[Buffer[], string], string | void>;
  2276. }
  2277. declare interface CompilationParams {
  2278. normalModuleFactory: NormalModuleFactory;
  2279. contextModuleFactory: ContextModuleFactory;
  2280. }
  2281. declare class Compiler {
  2282. constructor(context: string, options?: WebpackOptionsNormalized);
  2283. hooks: Readonly<{
  2284. initialize: SyncHook<[]>;
  2285. shouldEmit: SyncBailHook<[Compilation], boolean | void>;
  2286. done: AsyncSeriesHook<[Stats]>;
  2287. afterDone: SyncHook<[Stats]>;
  2288. additionalPass: AsyncSeriesHook<[]>;
  2289. beforeRun: AsyncSeriesHook<[Compiler]>;
  2290. run: AsyncSeriesHook<[Compiler]>;
  2291. emit: AsyncSeriesHook<[Compilation]>;
  2292. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2293. afterEmit: AsyncSeriesHook<[Compilation]>;
  2294. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2295. compilation: SyncHook<[Compilation, CompilationParams]>;
  2296. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2297. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2298. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2299. compile: SyncHook<[CompilationParams]>;
  2300. make: AsyncParallelHook<[Compilation]>;
  2301. finishMake: AsyncParallelHook<[Compilation]>;
  2302. afterCompile: AsyncSeriesHook<[Compilation]>;
  2303. readRecords: AsyncSeriesHook<[]>;
  2304. emitRecords: AsyncSeriesHook<[]>;
  2305. watchRun: AsyncSeriesHook<[Compiler]>;
  2306. failed: SyncHook<[Error]>;
  2307. invalid: SyncHook<[null | string, number]>;
  2308. watchClose: SyncHook<[]>;
  2309. shutdown: AsyncSeriesHook<[]>;
  2310. infrastructureLog: SyncBailHook<
  2311. [string, string, undefined | any[]],
  2312. true | void
  2313. >;
  2314. environment: SyncHook<[]>;
  2315. afterEnvironment: SyncHook<[]>;
  2316. afterPlugins: SyncHook<[Compiler]>;
  2317. afterResolvers: SyncHook<[Compiler]>;
  2318. entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>;
  2319. }>;
  2320. webpack: typeof exports;
  2321. name?: string;
  2322. parentCompilation?: Compilation;
  2323. root: Compiler;
  2324. outputPath: string;
  2325. watching?: Watching;
  2326. outputFileSystem: null | OutputFileSystem;
  2327. intermediateFileSystem: null | IntermediateFileSystem;
  2328. inputFileSystem: null | InputFileSystem;
  2329. watchFileSystem: null | WatchFileSystem;
  2330. recordsInputPath: null | string;
  2331. recordsOutputPath: null | string;
  2332. records: Record<string, any>;
  2333. managedPaths: Set<string | RegExp>;
  2334. unmanagedPaths: Set<string | RegExp>;
  2335. immutablePaths: Set<string | RegExp>;
  2336. modifiedFiles?: ReadonlySet<string>;
  2337. removedFiles?: ReadonlySet<string>;
  2338. fileTimestamps?: Map<string, FileSystemInfoEntry | "ignore">;
  2339. contextTimestamps?: Map<string, FileSystemInfoEntry | "ignore">;
  2340. fsStartTime?: number;
  2341. resolverFactory: ResolverFactory;
  2342. infrastructureLogger?: (
  2343. value: string,
  2344. type: LogTypeEnum,
  2345. args?: any[]
  2346. ) => void;
  2347. platform: Readonly<PlatformTargetProperties>;
  2348. options: WebpackOptionsNormalized;
  2349. context: string;
  2350. requestShortener: RequestShortener;
  2351. cache: Cache;
  2352. moduleMemCaches?: Map<Module, ModuleMemCachesItem>;
  2353. compilerPath: string;
  2354. running: boolean;
  2355. idle: boolean;
  2356. watchMode: boolean;
  2357. getCache(name: string): CacheFacade;
  2358. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2359. watch(watchOptions: WatchOptions, handler: RunCallback<Stats>): Watching;
  2360. run(callback: RunCallback<Stats>): void;
  2361. runAsChild(
  2362. callback: (
  2363. err: null | Error,
  2364. entries?: Chunk[],
  2365. compilation?: Compilation
  2366. ) => any
  2367. ): void;
  2368. purgeInputFileSystem(): void;
  2369. emitAssets(
  2370. compilation: Compilation,
  2371. callback: CallbackFunction_2<void>
  2372. ): void;
  2373. emitRecords(callback: CallbackFunction_2<void>): void;
  2374. readRecords(callback: CallbackFunction_2<void>): void;
  2375. createChildCompiler(
  2376. compilation: Compilation,
  2377. compilerName: string,
  2378. compilerIndex: number,
  2379. outputOptions?: Partial<OutputNormalized>,
  2380. plugins?: WebpackPluginInstance[]
  2381. ): Compiler;
  2382. isChild(): boolean;
  2383. createCompilation(params: CompilationParams): Compilation;
  2384. newCompilation(params: CompilationParams): Compilation;
  2385. createNormalModuleFactory(): NormalModuleFactory;
  2386. createContextModuleFactory(): ContextModuleFactory;
  2387. newCompilationParams(): {
  2388. normalModuleFactory: NormalModuleFactory;
  2389. contextModuleFactory: ContextModuleFactory;
  2390. };
  2391. compile(callback: RunCallback<Compilation>): void;
  2392. close(callback: RunCallback<void>): void;
  2393. }
  2394. declare class ConcatSource extends Source {
  2395. constructor(...args: (string | Source)[]);
  2396. getChildren(): Source[];
  2397. add(item: string | Source): void;
  2398. addAllSkipOptimizing(items: Source[]): void;
  2399. }
  2400. declare interface ConcatenatedModuleInfo {
  2401. type: "concatenated";
  2402. module: Module;
  2403. index: number;
  2404. ast?: Program;
  2405. internalSource?: Source;
  2406. source?: ReplaceSource;
  2407. chunkInitFragments?: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  2408. runtimeRequirements?: ReadonlySet<string>;
  2409. globalScope?: Scope;
  2410. moduleScope?: Scope;
  2411. internalNames: Map<string, string>;
  2412. exportMap?: Map<string, string>;
  2413. rawExportMap?: Map<string, string>;
  2414. namespaceExportSymbol?: string;
  2415. namespaceObjectName?: string;
  2416. interopNamespaceObjectUsed: boolean;
  2417. interopNamespaceObjectName?: string;
  2418. interopNamespaceObject2Used: boolean;
  2419. interopNamespaceObject2Name?: string;
  2420. interopDefaultAccessUsed: boolean;
  2421. interopDefaultAccessName?: string;
  2422. }
  2423. declare interface ConcatenationBailoutReasonContext {
  2424. /**
  2425. * the module graph
  2426. */
  2427. moduleGraph: ModuleGraph;
  2428. /**
  2429. * the chunk graph
  2430. */
  2431. chunkGraph: ChunkGraph;
  2432. }
  2433. declare class ConcatenationScope {
  2434. constructor(
  2435. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2436. currentModule: ConcatenatedModuleInfo
  2437. );
  2438. isModuleInScope(module: Module): boolean;
  2439. registerExport(exportName: string, symbol: string): void;
  2440. registerRawExport(exportName: string, expression: string): void;
  2441. registerNamespaceExport(symbol: string): void;
  2442. createModuleReference(
  2443. module: Module,
  2444. __1: Partial<ModuleReferenceOptions>
  2445. ): string;
  2446. static isModuleReference(name: string): boolean;
  2447. static matchModuleReference(
  2448. name: string
  2449. ): null | (ModuleReferenceOptions & { index: number });
  2450. static DEFAULT_EXPORT: string;
  2451. static NAMESPACE_OBJECT_EXPORT: string;
  2452. }
  2453. /**
  2454. * Options object as provided by the user.
  2455. */
  2456. declare interface Configuration {
  2457. /**
  2458. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2459. */
  2460. amd?: false | { [index: string]: any };
  2461. /**
  2462. * Report the first error as a hard error instead of tolerating it.
  2463. */
  2464. bail?: boolean;
  2465. /**
  2466. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2467. */
  2468. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2469. /**
  2470. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2471. */
  2472. context?: string;
  2473. /**
  2474. * References to other configurations to depend on.
  2475. */
  2476. dependencies?: string[];
  2477. /**
  2478. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2479. */
  2480. devtool?: string | false;
  2481. /**
  2482. * The entry point(s) of the compilation.
  2483. */
  2484. entry?:
  2485. | string
  2486. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2487. | EntryObject
  2488. | string[];
  2489. /**
  2490. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2491. */
  2492. experiments?: Experiments;
  2493. /**
  2494. * Extend configuration from another configuration (only works when using webpack-cli).
  2495. */
  2496. extends?: string | string[];
  2497. /**
  2498. * 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`.
  2499. */
  2500. externals?:
  2501. | string
  2502. | RegExp
  2503. | ExternalItem[]
  2504. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2505. | ((
  2506. data: ExternalItemFunctionData,
  2507. callback: (
  2508. err?: null | Error,
  2509. result?: string | boolean | string[] | { [index: string]: any }
  2510. ) => void
  2511. ) => void)
  2512. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  2513. /**
  2514. * Enable presets of externals for specific targets.
  2515. */
  2516. externalsPresets?: ExternalsPresets;
  2517. /**
  2518. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2519. */
  2520. externalsType?:
  2521. | "import"
  2522. | "var"
  2523. | "module"
  2524. | "assign"
  2525. | "this"
  2526. | "window"
  2527. | "self"
  2528. | "global"
  2529. | "commonjs"
  2530. | "commonjs2"
  2531. | "commonjs-module"
  2532. | "commonjs-static"
  2533. | "amd"
  2534. | "amd-require"
  2535. | "umd"
  2536. | "umd2"
  2537. | "jsonp"
  2538. | "system"
  2539. | "promise"
  2540. | "module-import"
  2541. | "script"
  2542. | "node-commonjs";
  2543. /**
  2544. * Ignore specific warnings.
  2545. */
  2546. ignoreWarnings?: (
  2547. | RegExp
  2548. | {
  2549. /**
  2550. * A RegExp to select the origin file for the warning.
  2551. */
  2552. file?: RegExp;
  2553. /**
  2554. * A RegExp to select the warning message.
  2555. */
  2556. message?: RegExp;
  2557. /**
  2558. * A RegExp to select the origin module for the warning.
  2559. */
  2560. module?: RegExp;
  2561. }
  2562. | ((warning: WebpackError, compilation: Compilation) => boolean)
  2563. )[];
  2564. /**
  2565. * Options for infrastructure level logging.
  2566. */
  2567. infrastructureLogging?: InfrastructureLogging;
  2568. /**
  2569. * Custom values available in the loader context.
  2570. */
  2571. loader?: Loader;
  2572. /**
  2573. * Enable production optimizations or development hints.
  2574. */
  2575. mode?: "none" | "development" | "production";
  2576. /**
  2577. * Options affecting the normal modules (`NormalModuleFactory`).
  2578. */
  2579. module?: ModuleOptions;
  2580. /**
  2581. * Name of the configuration. Used when loading multiple configurations.
  2582. */
  2583. name?: string;
  2584. /**
  2585. * Include polyfills or mocks for various node stuff.
  2586. */
  2587. node?: false | NodeOptions;
  2588. /**
  2589. * Enables/Disables integrated optimizations.
  2590. */
  2591. optimization?: Optimization;
  2592. /**
  2593. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2594. */
  2595. output?: Output;
  2596. /**
  2597. * The number of parallel processed modules in the compilation.
  2598. */
  2599. parallelism?: number;
  2600. /**
  2601. * Configuration for web performance recommendations.
  2602. */
  2603. performance?: false | PerformanceOptions;
  2604. /**
  2605. * Add additional plugins to the compiler.
  2606. */
  2607. plugins?: (
  2608. | undefined
  2609. | null
  2610. | false
  2611. | ""
  2612. | 0
  2613. | ((this: Compiler, compiler: Compiler) => void)
  2614. | WebpackPluginInstance
  2615. )[];
  2616. /**
  2617. * Capture timing information for each module.
  2618. */
  2619. profile?: boolean;
  2620. /**
  2621. * Store compiler state to a json file.
  2622. */
  2623. recordsInputPath?: string | false;
  2624. /**
  2625. * Load compiler state from a json file.
  2626. */
  2627. recordsOutputPath?: string | false;
  2628. /**
  2629. * 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.
  2630. */
  2631. recordsPath?: string | false;
  2632. /**
  2633. * Options for the resolver.
  2634. */
  2635. resolve?: ResolveOptions;
  2636. /**
  2637. * Options for the resolver when resolving loaders.
  2638. */
  2639. resolveLoader?: ResolveOptions;
  2640. /**
  2641. * Options affecting how file system snapshots are created and validated.
  2642. */
  2643. snapshot?: SnapshotOptionsWebpackOptions;
  2644. /**
  2645. * Stats options object or preset name.
  2646. */
  2647. stats?:
  2648. | boolean
  2649. | StatsOptions
  2650. | "none"
  2651. | "verbose"
  2652. | "summary"
  2653. | "errors-only"
  2654. | "errors-warnings"
  2655. | "minimal"
  2656. | "normal"
  2657. | "detailed";
  2658. /**
  2659. * Environment to build for. An array of environments to build for all of them when possible.
  2660. */
  2661. target?: string | false | string[];
  2662. /**
  2663. * Enter watch mode, which rebuilds on file change.
  2664. */
  2665. watch?: boolean;
  2666. /**
  2667. * Options for the watcher.
  2668. */
  2669. watchOptions?: WatchOptions;
  2670. }
  2671. type ConnectionState =
  2672. | boolean
  2673. | typeof TRANSITIVE_ONLY
  2674. | typeof CIRCULAR_CONNECTION;
  2675. declare class ConstDependency extends NullDependency {
  2676. constructor(
  2677. expression: string,
  2678. range: number | [number, number],
  2679. runtimeRequirements?: null | string[]
  2680. );
  2681. expression: string;
  2682. range: number | [number, number];
  2683. runtimeRequirements: null | Set<string>;
  2684. static Template: typeof ConstDependencyTemplate;
  2685. static NO_EXPORTS_REFERENCED: string[][];
  2686. static EXPORTS_OBJECT_REFERENCED: string[][];
  2687. static TRANSITIVE: typeof TRANSITIVE;
  2688. }
  2689. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  2690. constructor();
  2691. }
  2692. declare interface Constructor {
  2693. new (...params: any[]): any;
  2694. }
  2695. declare class ConsumeSharedPlugin {
  2696. constructor(options: ConsumeSharedPluginOptions);
  2697. /**
  2698. * Apply the plugin
  2699. */
  2700. apply(compiler: Compiler): void;
  2701. }
  2702. /**
  2703. * Options for consuming shared modules.
  2704. */
  2705. declare interface ConsumeSharedPluginOptions {
  2706. /**
  2707. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  2708. */
  2709. consumes: Consumes;
  2710. /**
  2711. * Share scope name used for all consumed modules (defaults to 'default').
  2712. */
  2713. shareScope?: string;
  2714. }
  2715. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  2716. /**
  2717. * Advanced configuration for modules that should be consumed from share scope.
  2718. */
  2719. declare interface ConsumesConfig {
  2720. /**
  2721. * 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.
  2722. */
  2723. eager?: boolean;
  2724. /**
  2725. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  2726. */
  2727. import?: string | false;
  2728. /**
  2729. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  2730. */
  2731. packageName?: string;
  2732. /**
  2733. * Version requirement from module in share scope.
  2734. */
  2735. requiredVersion?: string | false;
  2736. /**
  2737. * Module is looked up under this key from the share scope.
  2738. */
  2739. shareKey?: string;
  2740. /**
  2741. * Share scope name.
  2742. */
  2743. shareScope?: string;
  2744. /**
  2745. * Allow only a single version of the shared module in share scope (disabled by default).
  2746. */
  2747. singleton?: boolean;
  2748. /**
  2749. * 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).
  2750. */
  2751. strictVersion?: boolean;
  2752. }
  2753. /**
  2754. * 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.
  2755. */
  2756. declare interface ConsumesObject {
  2757. [index: string]: string | ConsumesConfig;
  2758. }
  2759. type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
  2760. declare class ContainerPlugin {
  2761. constructor(options: ContainerPluginOptions);
  2762. /**
  2763. * Apply the plugin
  2764. */
  2765. apply(compiler: Compiler): void;
  2766. }
  2767. declare interface ContainerPluginOptions {
  2768. /**
  2769. * 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.
  2770. */
  2771. exposes: Exposes;
  2772. /**
  2773. * The filename for this container relative path inside the `output.path` directory.
  2774. */
  2775. filename?: string;
  2776. /**
  2777. * Options for library.
  2778. */
  2779. library?: LibraryOptions;
  2780. /**
  2781. * The name for this container.
  2782. */
  2783. name: string;
  2784. /**
  2785. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  2786. */
  2787. runtime?: string | false;
  2788. /**
  2789. * The name of the share scope which is shared with the host (defaults to 'default').
  2790. */
  2791. shareScope?: string;
  2792. }
  2793. declare class ContainerReferencePlugin {
  2794. constructor(options: ContainerReferencePluginOptions);
  2795. /**
  2796. * Apply the plugin
  2797. */
  2798. apply(compiler: Compiler): void;
  2799. }
  2800. declare interface ContainerReferencePluginOptions {
  2801. /**
  2802. * The external type of the remote containers.
  2803. */
  2804. remoteType: ExternalsType;
  2805. /**
  2806. * 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.
  2807. */
  2808. remotes: Remotes;
  2809. /**
  2810. * The name of the share scope shared with all remotes (defaults to 'default').
  2811. */
  2812. shareScope?: string;
  2813. }
  2814. declare interface ContextAlternativeRequest {
  2815. context: string;
  2816. request: string;
  2817. }
  2818. declare abstract class ContextElementDependency extends ModuleDependency {
  2819. referencedExports?: null | string[][];
  2820. }
  2821. declare class ContextExclusionPlugin {
  2822. constructor(negativeMatcher: RegExp);
  2823. negativeMatcher: RegExp;
  2824. /**
  2825. * Apply the plugin
  2826. */
  2827. apply(compiler: Compiler): void;
  2828. }
  2829. declare interface ContextFileSystemInfoEntry {
  2830. safeTime: number;
  2831. timestampHash?: string;
  2832. resolved?: ResolvedContextFileSystemInfoEntry;
  2833. symlinks?: Set<string>;
  2834. }
  2835. declare interface ContextHash {
  2836. hash: string;
  2837. resolved?: string;
  2838. symlinks?: Set<string>;
  2839. }
  2840. type ContextMode =
  2841. | "weak"
  2842. | "eager"
  2843. | "lazy"
  2844. | "lazy-once"
  2845. | "sync"
  2846. | "async-weak";
  2847. declare abstract class ContextModuleFactory extends ModuleFactory {
  2848. hooks: Readonly<{
  2849. beforeResolve: AsyncSeriesWaterfallHook<[any]>;
  2850. afterResolve: AsyncSeriesWaterfallHook<[any]>;
  2851. contextModuleFiles: SyncWaterfallHook<[string[]]>;
  2852. alternatives: FakeHook<
  2853. Pick<
  2854. AsyncSeriesWaterfallHook<[ContextAlternativeRequest[]]>,
  2855. "name" | "tap" | "tapAsync" | "tapPromise"
  2856. >
  2857. >;
  2858. alternativeRequests: AsyncSeriesWaterfallHook<
  2859. [ContextAlternativeRequest[], ContextModuleOptions]
  2860. >;
  2861. }>;
  2862. resolverFactory: ResolverFactory;
  2863. resolveDependencies(
  2864. fs: InputFileSystem,
  2865. options: ContextModuleOptions,
  2866. callback: (
  2867. err: null | Error,
  2868. dependencies?: ContextElementDependency[]
  2869. ) => any
  2870. ): void;
  2871. }
  2872. declare interface ContextModuleOptions {
  2873. mode: ContextMode;
  2874. recursive: boolean;
  2875. regExp: RegExp;
  2876. namespaceObject?: boolean | "strict";
  2877. addon?: string;
  2878. chunkName?: null | string;
  2879. include?: null | RegExp;
  2880. exclude?: null | RegExp;
  2881. groupOptions?: RawChunkGroupOptions;
  2882. typePrefix?: string;
  2883. category?: string;
  2884. /**
  2885. * exports referenced from modules (won't be mangled)
  2886. */
  2887. referencedExports?: null | string[][];
  2888. layer?: string;
  2889. attributes?: ImportAttributes;
  2890. resource: string | false | string[];
  2891. resourceQuery?: string;
  2892. resourceFragment?: string;
  2893. resolveOptions: any;
  2894. }
  2895. declare class ContextReplacementPlugin {
  2896. constructor(
  2897. resourceRegExp: RegExp,
  2898. newContentResource?: string | boolean | RegExp | ((context?: any) => void),
  2899. newContentRecursive?: boolean | RegExp | NewContentCreateContextMap,
  2900. newContentRegExp?: RegExp
  2901. );
  2902. resourceRegExp: RegExp;
  2903. newContentCallback?: (context?: any) => void;
  2904. newContentResource?: string;
  2905. newContentCreateContextMap?: (
  2906. fs: InputFileSystem,
  2907. callback: (
  2908. err: null | Error,
  2909. newContentRecursive: NewContentCreateContextMap
  2910. ) => void
  2911. ) => void;
  2912. newContentRecursive?: boolean;
  2913. newContentRegExp?: RegExp;
  2914. /**
  2915. * Apply the plugin
  2916. */
  2917. apply(compiler: Compiler): void;
  2918. }
  2919. type ContextTimestamp = null | ContextFileSystemInfoEntry | "ignore";
  2920. declare interface ContextTimestampAndHash {
  2921. safeTime: number;
  2922. timestampHash?: string;
  2923. hash: string;
  2924. resolved?: ResolvedContextTimestampAndHash;
  2925. symlinks?: Set<string>;
  2926. }
  2927. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  2928. Record<string, any>;
  2929. type CreateWriteStreamFSImplementation = FSImplementation & {
  2930. write: (...args: any[]) => any;
  2931. close?: (...args: any[]) => any;
  2932. };
  2933. /**
  2934. * Generator options for css/auto modules.
  2935. */
  2936. declare interface CssAutoGeneratorOptions {
  2937. /**
  2938. * Configure the generated JS modules that use the ES modules syntax.
  2939. */
  2940. esModule?: boolean;
  2941. /**
  2942. * Specifies the convention of exported names.
  2943. */
  2944. exportsConvention?:
  2945. | "as-is"
  2946. | "camel-case"
  2947. | "camel-case-only"
  2948. | "dashes"
  2949. | "dashes-only"
  2950. | ((name: string) => string);
  2951. /**
  2952. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2953. */
  2954. exportsOnly?: boolean;
  2955. /**
  2956. * Configure the generated local ident name.
  2957. */
  2958. localIdentName?: string;
  2959. }
  2960. /**
  2961. * Parser options for css/auto modules.
  2962. */
  2963. declare interface CssAutoParserOptions {
  2964. /**
  2965. * Enable/disable `@import` at-rules handling.
  2966. */
  2967. import?: boolean;
  2968. /**
  2969. * Use ES modules named export for css exports.
  2970. */
  2971. namedExports?: boolean;
  2972. /**
  2973. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  2974. */
  2975. url?: boolean;
  2976. }
  2977. /**
  2978. * Generator options for css modules.
  2979. */
  2980. declare interface CssGeneratorOptions {
  2981. /**
  2982. * Configure the generated JS modules that use the ES modules syntax.
  2983. */
  2984. esModule?: boolean;
  2985. /**
  2986. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  2987. */
  2988. exportsOnly?: boolean;
  2989. }
  2990. /**
  2991. * Generator options for css/global modules.
  2992. */
  2993. declare interface CssGlobalGeneratorOptions {
  2994. /**
  2995. * Configure the generated JS modules that use the ES modules syntax.
  2996. */
  2997. esModule?: boolean;
  2998. /**
  2999. * Specifies the convention of exported names.
  3000. */
  3001. exportsConvention?:
  3002. | "as-is"
  3003. | "camel-case"
  3004. | "camel-case-only"
  3005. | "dashes"
  3006. | "dashes-only"
  3007. | ((name: string) => string);
  3008. /**
  3009. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3010. */
  3011. exportsOnly?: boolean;
  3012. /**
  3013. * Configure the generated local ident name.
  3014. */
  3015. localIdentName?: string;
  3016. }
  3017. /**
  3018. * Parser options for css/global modules.
  3019. */
  3020. declare interface CssGlobalParserOptions {
  3021. /**
  3022. * Enable/disable `@import` at-rules handling.
  3023. */
  3024. import?: boolean;
  3025. /**
  3026. * Use ES modules named export for css exports.
  3027. */
  3028. namedExports?: boolean;
  3029. /**
  3030. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3031. */
  3032. url?: boolean;
  3033. }
  3034. declare interface CssImportDependencyMeta {
  3035. layer?: string;
  3036. supports?: string;
  3037. media?: string;
  3038. }
  3039. type CssLayer = undefined | string;
  3040. declare class CssLoadingRuntimeModule extends RuntimeModule {
  3041. constructor(runtimeRequirements: ReadonlySet<string>);
  3042. static getCompilationHooks(
  3043. compilation: Compilation
  3044. ): CssLoadingRuntimeModulePluginHooks;
  3045. /**
  3046. * Runtime modules without any dependencies to other runtime modules
  3047. */
  3048. static STAGE_NORMAL: number;
  3049. /**
  3050. * Runtime modules with simple dependencies on other runtime modules
  3051. */
  3052. static STAGE_BASIC: number;
  3053. /**
  3054. * Runtime modules which attach to handlers of other runtime modules
  3055. */
  3056. static STAGE_ATTACH: number;
  3057. /**
  3058. * Runtime modules which trigger actions on bootstrap
  3059. */
  3060. static STAGE_TRIGGER: number;
  3061. }
  3062. declare interface CssLoadingRuntimeModulePluginHooks {
  3063. createStylesheet: SyncWaterfallHook<[string, Chunk]>;
  3064. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  3065. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  3066. }
  3067. declare abstract class CssModule extends NormalModule {
  3068. cssLayer: CssLayer;
  3069. supports: Supports;
  3070. media: Media;
  3071. inheritance: [CssLayer, Supports, Media][];
  3072. }
  3073. /**
  3074. * Generator options for css/module modules.
  3075. */
  3076. declare interface CssModuleGeneratorOptions {
  3077. /**
  3078. * Configure the generated JS modules that use the ES modules syntax.
  3079. */
  3080. esModule?: boolean;
  3081. /**
  3082. * Specifies the convention of exported names.
  3083. */
  3084. exportsConvention?:
  3085. | "as-is"
  3086. | "camel-case"
  3087. | "camel-case-only"
  3088. | "dashes"
  3089. | "dashes-only"
  3090. | ((name: string) => string);
  3091. /**
  3092. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3093. */
  3094. exportsOnly?: boolean;
  3095. /**
  3096. * Configure the generated local ident name.
  3097. */
  3098. localIdentName?: string;
  3099. }
  3100. /**
  3101. * Parser options for css/module modules.
  3102. */
  3103. declare interface CssModuleParserOptions {
  3104. /**
  3105. * Enable/disable `@import` at-rules handling.
  3106. */
  3107. import?: boolean;
  3108. /**
  3109. * Use ES modules named export for css exports.
  3110. */
  3111. namedExports?: boolean;
  3112. /**
  3113. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3114. */
  3115. url?: boolean;
  3116. }
  3117. declare class CssModulesPlugin {
  3118. constructor();
  3119. /**
  3120. * Apply the plugin
  3121. */
  3122. apply(compiler: Compiler): void;
  3123. getModulesInOrder(
  3124. chunk: Chunk,
  3125. modules: Iterable<Module>,
  3126. compilation: Compilation
  3127. ): Module[];
  3128. getOrderedChunkCssModules(
  3129. chunk: Chunk,
  3130. chunkGraph: ChunkGraph,
  3131. compilation: Compilation
  3132. ): Module[];
  3133. renderModule(
  3134. module: CssModule,
  3135. renderContext: ChunkRenderContextCssModulesPlugin,
  3136. hooks: CompilationHooksCssModulesPlugin
  3137. ): Source;
  3138. renderChunk(
  3139. __0: RenderContextCssModulesPlugin,
  3140. hooks: CompilationHooksCssModulesPlugin
  3141. ): Source;
  3142. static getCompilationHooks(
  3143. compilation: Compilation
  3144. ): CompilationHooksCssModulesPlugin;
  3145. static getChunkFilenameTemplate(
  3146. chunk: Chunk,
  3147. outputOptions: OutputNormalized
  3148. ): TemplatePath;
  3149. static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
  3150. }
  3151. /**
  3152. * Parser options for css modules.
  3153. */
  3154. declare interface CssParserOptions {
  3155. /**
  3156. * Enable/disable `@import` at-rules handling.
  3157. */
  3158. import?: boolean;
  3159. /**
  3160. * Use ES modules named export for css exports.
  3161. */
  3162. namedExports?: boolean;
  3163. /**
  3164. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3165. */
  3166. url?: boolean;
  3167. }
  3168. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  3169. declare class DefinePlugin {
  3170. /**
  3171. * Create a new define plugin
  3172. */
  3173. constructor(definitions: Record<string, CodeValue>);
  3174. definitions: Record<string, CodeValue>;
  3175. /**
  3176. * Apply the plugin
  3177. */
  3178. apply(compiler: Compiler): void;
  3179. static runtimeValue(
  3180. fn: (value: {
  3181. module: NormalModule;
  3182. key: string;
  3183. readonly version: ValueCacheVersion;
  3184. }) => CodeValuePrimitive,
  3185. options?: true | string[] | RuntimeValueOptions
  3186. ): RuntimeValue;
  3187. }
  3188. declare class DelegatedPlugin {
  3189. constructor(options: Options);
  3190. options: Options;
  3191. /**
  3192. * Apply the plugin
  3193. */
  3194. apply(compiler: Compiler): void;
  3195. }
  3196. declare interface DepConstructor {
  3197. new (...args: any[]): Dependency;
  3198. }
  3199. declare abstract class DependenciesBlock {
  3200. dependencies: Dependency[];
  3201. blocks: AsyncDependenciesBlock[];
  3202. parent?: DependenciesBlock;
  3203. getRootBlock(): DependenciesBlock;
  3204. /**
  3205. * Adds a DependencyBlock to DependencyBlock relationship.
  3206. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  3207. */
  3208. addBlock(block: AsyncDependenciesBlock): void;
  3209. addDependency(dependency: Dependency): void;
  3210. removeDependency(dependency: Dependency): void;
  3211. /**
  3212. * Removes all dependencies and blocks
  3213. */
  3214. clearDependenciesAndBlocks(): void;
  3215. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3216. serialize(__0: ObjectSerializerContext): void;
  3217. deserialize(__0: ObjectDeserializerContext): void;
  3218. }
  3219. declare interface DependenciesBlockLike {
  3220. dependencies: Dependency[];
  3221. blocks: AsyncDependenciesBlock[];
  3222. }
  3223. declare class Dependency {
  3224. constructor();
  3225. weak: boolean;
  3226. optional: boolean;
  3227. get type(): string;
  3228. get category(): string;
  3229. loc: DependencyLocation;
  3230. setLoc(
  3231. startLine: number,
  3232. startColumn: number,
  3233. endLine: number,
  3234. endColumn: number
  3235. ): void;
  3236. getContext(): undefined | string;
  3237. getResourceIdentifier(): null | string;
  3238. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  3239. /**
  3240. * Returns the referenced module and export
  3241. */
  3242. getReference(moduleGraph: ModuleGraph): never;
  3243. /**
  3244. * Returns list of exports referenced by this dependency
  3245. */
  3246. getReferencedExports(
  3247. moduleGraph: ModuleGraph,
  3248. runtime: RuntimeSpec
  3249. ): (string[] | ReferencedExport)[];
  3250. getCondition(
  3251. moduleGraph: ModuleGraph
  3252. ):
  3253. | null
  3254. | false
  3255. | ((
  3256. moduleGraphConnection: ModuleGraphConnection,
  3257. runtime: RuntimeSpec
  3258. ) => ConnectionState);
  3259. /**
  3260. * Returns the exported names
  3261. */
  3262. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  3263. /**
  3264. * Returns warnings
  3265. */
  3266. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3267. /**
  3268. * Returns errors
  3269. */
  3270. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3271. /**
  3272. * Update the hash
  3273. */
  3274. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3275. /**
  3276. * implement this method to allow the occurrence order plugin to count correctly
  3277. */
  3278. getNumberOfIdOccurrences(): number;
  3279. getModuleEvaluationSideEffectsState(
  3280. moduleGraph: ModuleGraph
  3281. ): ConnectionState;
  3282. createIgnoredModule(context: string): null | Module;
  3283. serialize(__0: ObjectSerializerContext): void;
  3284. deserialize(__0: ObjectDeserializerContext): void;
  3285. module: any;
  3286. get disconnect(): any;
  3287. static NO_EXPORTS_REFERENCED: string[][];
  3288. static EXPORTS_OBJECT_REFERENCED: string[][];
  3289. static TRANSITIVE: typeof TRANSITIVE;
  3290. }
  3291. declare interface DependencyConstructor {
  3292. new (...args: any[]): Dependency;
  3293. }
  3294. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3295. declare class DependencyTemplate {
  3296. constructor();
  3297. apply(
  3298. dependency: Dependency,
  3299. source: ReplaceSource,
  3300. templateContext: DependencyTemplateContext
  3301. ): void;
  3302. }
  3303. declare interface DependencyTemplateContext {
  3304. /**
  3305. * the runtime template
  3306. */
  3307. runtimeTemplate: RuntimeTemplate;
  3308. /**
  3309. * the dependency templates
  3310. */
  3311. dependencyTemplates: DependencyTemplates;
  3312. /**
  3313. * the module graph
  3314. */
  3315. moduleGraph: ModuleGraph;
  3316. /**
  3317. * the chunk graph
  3318. */
  3319. chunkGraph: ChunkGraph;
  3320. /**
  3321. * the requirements for runtime
  3322. */
  3323. runtimeRequirements: Set<string>;
  3324. /**
  3325. * current module
  3326. */
  3327. module: Module;
  3328. /**
  3329. * current runtimes, for which code is generated
  3330. */
  3331. runtime: RuntimeSpec;
  3332. /**
  3333. * mutable array of init fragments for the current module
  3334. */
  3335. initFragments: InitFragment<GenerateContext>[];
  3336. /**
  3337. * when in a concatenated module, information about other concatenated modules
  3338. */
  3339. concatenationScope?: ConcatenationScope;
  3340. /**
  3341. * the code generation results
  3342. */
  3343. codeGenerationResults: CodeGenerationResults;
  3344. /**
  3345. * chunkInitFragments
  3346. */
  3347. chunkInitFragments: InitFragment<GenerateContext>[];
  3348. }
  3349. declare abstract class DependencyTemplates {
  3350. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3351. set(
  3352. dependency: DependencyConstructor,
  3353. dependencyTemplate: DependencyTemplate
  3354. ): void;
  3355. updateHash(part: string): void;
  3356. getHash(): string;
  3357. clone(): DependencyTemplates;
  3358. }
  3359. /**
  3360. * Helper function for joining two ranges into a single range. This is useful
  3361. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3362. * to create the range of the _parent node_.
  3363. */
  3364. declare interface DestructuringAssignmentProperty {
  3365. id: string;
  3366. range?: [number, number];
  3367. shorthand: string | boolean;
  3368. }
  3369. declare class DeterministicChunkIdsPlugin {
  3370. constructor(options?: DeterministicChunkIdsPluginOptions);
  3371. options: DeterministicChunkIdsPluginOptions;
  3372. /**
  3373. * Apply the plugin
  3374. */
  3375. apply(compiler: Compiler): void;
  3376. }
  3377. declare interface DeterministicChunkIdsPluginOptions {
  3378. /**
  3379. * context for ids
  3380. */
  3381. context?: string;
  3382. /**
  3383. * maximum length of ids
  3384. */
  3385. maxLength?: number;
  3386. }
  3387. declare class DeterministicModuleIdsPlugin {
  3388. constructor(options?: DeterministicModuleIdsPluginOptions);
  3389. options: DeterministicModuleIdsPluginOptions;
  3390. /**
  3391. * Apply the plugin
  3392. */
  3393. apply(compiler: Compiler): void;
  3394. }
  3395. declare interface DeterministicModuleIdsPluginOptions {
  3396. /**
  3397. * context relative to which module identifiers are computed
  3398. */
  3399. context?: string;
  3400. /**
  3401. * selector function for modules
  3402. */
  3403. test?: (module: Module) => boolean;
  3404. /**
  3405. * maximum id length in digits (used as starting point)
  3406. */
  3407. maxLength?: number;
  3408. /**
  3409. * hash salt for ids
  3410. */
  3411. salt?: number;
  3412. /**
  3413. * do not increase the maxLength to find an optimal id space size
  3414. */
  3415. fixedLength?: boolean;
  3416. /**
  3417. * throw an error when id conflicts occur (instead of rehashing)
  3418. */
  3419. failOnConflict?: boolean;
  3420. }
  3421. type DevtoolModuleFilenameTemplate = string | ((context?: any) => string);
  3422. declare interface Dirent {
  3423. isFile: () => boolean;
  3424. isDirectory: () => boolean;
  3425. isBlockDevice: () => boolean;
  3426. isCharacterDevice: () => boolean;
  3427. isSymbolicLink: () => boolean;
  3428. isFIFO: () => boolean;
  3429. isSocket: () => boolean;
  3430. name: string;
  3431. path: string;
  3432. }
  3433. declare class DllPlugin {
  3434. constructor(options: DllPluginOptions);
  3435. options: {
  3436. entryOnly: boolean;
  3437. /**
  3438. * Context of requests in the manifest file (defaults to the webpack context).
  3439. */
  3440. context?: string;
  3441. /**
  3442. * If true, manifest json file (output) will be formatted.
  3443. */
  3444. format?: boolean;
  3445. /**
  3446. * Name of the exposed dll function (external name, use value of 'output.library').
  3447. */
  3448. name?: string;
  3449. /**
  3450. * Absolute path to the manifest json file (output).
  3451. */
  3452. path: string;
  3453. /**
  3454. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3455. */
  3456. type?: string;
  3457. };
  3458. /**
  3459. * Apply the plugin
  3460. */
  3461. apply(compiler: Compiler): void;
  3462. }
  3463. declare interface DllPluginOptions {
  3464. /**
  3465. * Context of requests in the manifest file (defaults to the webpack context).
  3466. */
  3467. context?: string;
  3468. /**
  3469. * If true, only entry points will be exposed (default: true).
  3470. */
  3471. entryOnly?: boolean;
  3472. /**
  3473. * If true, manifest json file (output) will be formatted.
  3474. */
  3475. format?: boolean;
  3476. /**
  3477. * Name of the exposed dll function (external name, use value of 'output.library').
  3478. */
  3479. name?: string;
  3480. /**
  3481. * Absolute path to the manifest json file (output).
  3482. */
  3483. path: string;
  3484. /**
  3485. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3486. */
  3487. type?: string;
  3488. }
  3489. declare class DllReferencePlugin {
  3490. constructor(options: DllReferencePluginOptions);
  3491. options: DllReferencePluginOptions;
  3492. /**
  3493. * Apply the plugin
  3494. */
  3495. apply(compiler: Compiler): void;
  3496. }
  3497. type DllReferencePluginOptions =
  3498. | {
  3499. /**
  3500. * Context of requests in the manifest (or content property) as absolute path.
  3501. */
  3502. context?: string;
  3503. /**
  3504. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3505. */
  3506. extensions?: string[];
  3507. /**
  3508. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  3509. */
  3510. manifest: string | DllReferencePluginOptionsManifest;
  3511. /**
  3512. * The name where the dll is exposed (external name, defaults to manifest.name).
  3513. */
  3514. name?: string;
  3515. /**
  3516. * Prefix which is used for accessing the content of the dll.
  3517. */
  3518. scope?: string;
  3519. /**
  3520. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  3521. */
  3522. sourceType?:
  3523. | "var"
  3524. | "assign"
  3525. | "this"
  3526. | "window"
  3527. | "global"
  3528. | "commonjs"
  3529. | "commonjs2"
  3530. | "commonjs-module"
  3531. | "amd"
  3532. | "amd-require"
  3533. | "umd"
  3534. | "umd2"
  3535. | "jsonp"
  3536. | "system";
  3537. /**
  3538. * The way how the export of the dll bundle is used.
  3539. */
  3540. type?: "object" | "require";
  3541. }
  3542. | {
  3543. /**
  3544. * The mappings from request to module info.
  3545. */
  3546. content: DllReferencePluginOptionsContent;
  3547. /**
  3548. * Context of requests in the manifest (or content property) as absolute path.
  3549. */
  3550. context?: string;
  3551. /**
  3552. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  3553. */
  3554. extensions?: string[];
  3555. /**
  3556. * The name where the dll is exposed (external name).
  3557. */
  3558. name: string;
  3559. /**
  3560. * Prefix which is used for accessing the content of the dll.
  3561. */
  3562. scope?: string;
  3563. /**
  3564. * How the dll is exposed (libraryTarget).
  3565. */
  3566. sourceType?:
  3567. | "var"
  3568. | "assign"
  3569. | "this"
  3570. | "window"
  3571. | "global"
  3572. | "commonjs"
  3573. | "commonjs2"
  3574. | "commonjs-module"
  3575. | "amd"
  3576. | "amd-require"
  3577. | "umd"
  3578. | "umd2"
  3579. | "jsonp"
  3580. | "system";
  3581. /**
  3582. * The way how the export of the dll bundle is used.
  3583. */
  3584. type?: "object" | "require";
  3585. };
  3586. /**
  3587. * The mappings from request to module info.
  3588. */
  3589. declare interface DllReferencePluginOptionsContent {
  3590. [index: string]: {
  3591. /**
  3592. * Meta information about the module.
  3593. */
  3594. buildMeta?: { [index: string]: any };
  3595. /**
  3596. * Information about the provided exports of the module.
  3597. */
  3598. exports?: true | string[];
  3599. /**
  3600. * Module ID.
  3601. */
  3602. id: string | number;
  3603. };
  3604. }
  3605. /**
  3606. * An object containing content, name and type.
  3607. */
  3608. declare interface DllReferencePluginOptionsManifest {
  3609. /**
  3610. * The mappings from request to module info.
  3611. */
  3612. content: DllReferencePluginOptionsContent;
  3613. /**
  3614. * The name where the dll is exposed (external name).
  3615. */
  3616. name?: string;
  3617. /**
  3618. * The type how the dll is exposed (external type).
  3619. */
  3620. type?:
  3621. | "var"
  3622. | "assign"
  3623. | "this"
  3624. | "window"
  3625. | "global"
  3626. | "commonjs"
  3627. | "commonjs2"
  3628. | "commonjs-module"
  3629. | "amd"
  3630. | "amd-require"
  3631. | "umd"
  3632. | "umd2"
  3633. | "jsonp"
  3634. | "system";
  3635. }
  3636. declare class DynamicEntryPlugin {
  3637. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  3638. context: string;
  3639. entry: () => Promise<EntryStaticNormalized>;
  3640. /**
  3641. * Apply the plugin
  3642. */
  3643. apply(compiler: Compiler): void;
  3644. }
  3645. declare interface Effect {
  3646. type: string;
  3647. value: any;
  3648. }
  3649. declare interface EffectData {
  3650. [index: string]: any;
  3651. }
  3652. declare class ElectronTargetPlugin {
  3653. constructor(context?: "main" | "preload" | "renderer");
  3654. /**
  3655. * Apply the plugin
  3656. */
  3657. apply(compiler: Compiler): void;
  3658. }
  3659. /**
  3660. * No generator options are supported for this module type.
  3661. */
  3662. declare interface EmptyGeneratorOptions {}
  3663. /**
  3664. * No parser options are supported for this module type.
  3665. */
  3666. declare interface EmptyParserOptions {}
  3667. declare class EnableChunkLoadingPlugin {
  3668. constructor(type: string);
  3669. type: string;
  3670. /**
  3671. * Apply the plugin
  3672. */
  3673. apply(compiler: Compiler): void;
  3674. static setEnabled(compiler: Compiler, type: string): void;
  3675. static checkEnabled(compiler: Compiler, type: string): void;
  3676. }
  3677. declare class EnableLibraryPlugin {
  3678. constructor(type: string);
  3679. type: string;
  3680. /**
  3681. * Apply the plugin
  3682. */
  3683. apply(compiler: Compiler): void;
  3684. static setEnabled(compiler: Compiler, type: string): void;
  3685. static checkEnabled(compiler: Compiler, type: string): void;
  3686. }
  3687. declare class EnableWasmLoadingPlugin {
  3688. constructor(type: string);
  3689. type: string;
  3690. /**
  3691. * Apply the plugin
  3692. */
  3693. apply(compiler: Compiler): void;
  3694. static setEnabled(compiler: Compiler, type: string): void;
  3695. static checkEnabled(compiler: Compiler, type: string): void;
  3696. }
  3697. type EncodingOption =
  3698. | undefined
  3699. | null
  3700. | "ascii"
  3701. | "utf8"
  3702. | "utf-8"
  3703. | "utf16le"
  3704. | "utf-16le"
  3705. | "ucs2"
  3706. | "ucs-2"
  3707. | "base64"
  3708. | "base64url"
  3709. | "latin1"
  3710. | "binary"
  3711. | "hex"
  3712. | ObjectEncodingOptions;
  3713. type Entry =
  3714. | string
  3715. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  3716. | EntryObject
  3717. | string[];
  3718. declare interface EntryData {
  3719. /**
  3720. * dependencies of the entrypoint that should be evaluated at startup
  3721. */
  3722. dependencies: Dependency[];
  3723. /**
  3724. * dependencies of the entrypoint that should be included but not evaluated
  3725. */
  3726. includeDependencies: Dependency[];
  3727. /**
  3728. * options of the entrypoint
  3729. */
  3730. options: EntryOptions;
  3731. }
  3732. declare abstract class EntryDependency extends ModuleDependency {}
  3733. /**
  3734. * An object with entry point description.
  3735. */
  3736. declare interface EntryDescription {
  3737. /**
  3738. * Enable/disable creating async chunks that are loaded on demand.
  3739. */
  3740. asyncChunks?: boolean;
  3741. /**
  3742. * Base uri for this entry.
  3743. */
  3744. baseUri?: string;
  3745. /**
  3746. * 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).
  3747. */
  3748. chunkLoading?: string | false;
  3749. /**
  3750. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3751. */
  3752. dependOn?: string | string[];
  3753. /**
  3754. * 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.
  3755. */
  3756. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3757. /**
  3758. * Module(s) that are loaded upon startup.
  3759. */
  3760. import: EntryItem;
  3761. /**
  3762. * Specifies the layer in which modules of this entrypoint are placed.
  3763. */
  3764. layer?: null | string;
  3765. /**
  3766. * Options for library.
  3767. */
  3768. library?: LibraryOptions;
  3769. /**
  3770. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3771. */
  3772. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3773. /**
  3774. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3775. */
  3776. runtime?: string | false;
  3777. /**
  3778. * 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).
  3779. */
  3780. wasmLoading?: string | false;
  3781. }
  3782. /**
  3783. * An object with entry point description.
  3784. */
  3785. declare interface EntryDescriptionNormalized {
  3786. /**
  3787. * Enable/disable creating async chunks that are loaded on demand.
  3788. */
  3789. asyncChunks?: boolean;
  3790. /**
  3791. * Base uri for this entry.
  3792. */
  3793. baseUri?: string;
  3794. /**
  3795. * 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).
  3796. */
  3797. chunkLoading?: string | false;
  3798. /**
  3799. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  3800. */
  3801. dependOn?: string[];
  3802. /**
  3803. * 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.
  3804. */
  3805. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3806. /**
  3807. * Module(s) that are loaded upon startup. The last one is exported.
  3808. */
  3809. import?: string[];
  3810. /**
  3811. * Specifies the layer in which modules of this entrypoint are placed.
  3812. */
  3813. layer?: null | string;
  3814. /**
  3815. * Options for library.
  3816. */
  3817. library?: LibraryOptions;
  3818. /**
  3819. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  3820. */
  3821. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  3822. /**
  3823. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3824. */
  3825. runtime?: string | false;
  3826. /**
  3827. * 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).
  3828. */
  3829. wasmLoading?: string | false;
  3830. }
  3831. type EntryItem = string | string[];
  3832. type EntryNormalized =
  3833. | (() => Promise<EntryStaticNormalized>)
  3834. | EntryStaticNormalized;
  3835. /**
  3836. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  3837. */
  3838. declare interface EntryObject {
  3839. [index: string]: string | string[] | EntryDescription;
  3840. }
  3841. declare class EntryOptionPlugin {
  3842. constructor();
  3843. apply(compiler: Compiler): void;
  3844. static applyEntryOption(
  3845. compiler: Compiler,
  3846. context: string,
  3847. entry: EntryNormalized
  3848. ): void;
  3849. static entryDescriptionToOptions(
  3850. compiler: Compiler,
  3851. name: string,
  3852. desc: EntryDescriptionNormalized
  3853. ): EntryOptions;
  3854. }
  3855. type EntryOptions = { name?: string } & Omit<
  3856. EntryDescriptionNormalized,
  3857. "import"
  3858. >;
  3859. declare class EntryPlugin {
  3860. /**
  3861. * An entry plugin which will handle creation of the EntryDependency
  3862. */
  3863. constructor(context: string, entry: string, options?: string | EntryOptions);
  3864. context: string;
  3865. entry: string;
  3866. options: string | EntryOptions;
  3867. /**
  3868. * Apply the plugin
  3869. */
  3870. apply(compiler: Compiler): void;
  3871. static createDependency(
  3872. entry: string,
  3873. options: string | EntryOptions
  3874. ): EntryDependency;
  3875. }
  3876. type EntryStatic = string | EntryObject | string[];
  3877. /**
  3878. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  3879. */
  3880. declare interface EntryStaticNormalized {
  3881. [index: string]: EntryDescriptionNormalized;
  3882. }
  3883. declare abstract class Entrypoint extends ChunkGroup {
  3884. /**
  3885. * Sets the runtimeChunk for an entrypoint.
  3886. */
  3887. setRuntimeChunk(chunk: Chunk): void;
  3888. /**
  3889. * Fetches the chunk reference containing the webpack bootstrap code
  3890. */
  3891. getRuntimeChunk(): null | Chunk;
  3892. /**
  3893. * Sets the chunk with the entrypoint modules for an entrypoint.
  3894. */
  3895. setEntrypointChunk(chunk: Chunk): void;
  3896. /**
  3897. * Returns the chunk which contains the entrypoint modules
  3898. * (or at least the execution of them)
  3899. */
  3900. getEntrypointChunk(): Chunk;
  3901. }
  3902. type EnumValue =
  3903. | null
  3904. | string
  3905. | number
  3906. | boolean
  3907. | EnumValueObject
  3908. | EnumValue[];
  3909. declare interface EnumValueObject {
  3910. [index: string]: EnumValue;
  3911. }
  3912. /**
  3913. * The abilities of the environment where the webpack generated code should run.
  3914. */
  3915. declare interface Environment {
  3916. /**
  3917. * The environment supports arrow functions ('() => { ... }').
  3918. */
  3919. arrowFunction?: boolean;
  3920. /**
  3921. * The environment supports async function and await ('async function () { await ... }').
  3922. */
  3923. asyncFunction?: boolean;
  3924. /**
  3925. * The environment supports BigInt as literal (123n).
  3926. */
  3927. bigIntLiteral?: boolean;
  3928. /**
  3929. * The environment supports const and let for variable declarations.
  3930. */
  3931. const?: boolean;
  3932. /**
  3933. * The environment supports destructuring ('{ a, b } = obj').
  3934. */
  3935. destructuring?: boolean;
  3936. /**
  3937. * The environment supports 'document'.
  3938. */
  3939. document?: boolean;
  3940. /**
  3941. * The environment supports an async import() function to import EcmaScript modules.
  3942. */
  3943. dynamicImport?: boolean;
  3944. /**
  3945. * The environment supports an async import() is available when creating a worker.
  3946. */
  3947. dynamicImportInWorker?: boolean;
  3948. /**
  3949. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  3950. */
  3951. forOf?: boolean;
  3952. /**
  3953. * The environment supports 'globalThis'.
  3954. */
  3955. globalThis?: boolean;
  3956. /**
  3957. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  3958. */
  3959. module?: boolean;
  3960. /**
  3961. * The environment supports `node:` prefix for Node.js core modules.
  3962. */
  3963. nodePrefixForCoreModules?: boolean;
  3964. /**
  3965. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  3966. */
  3967. optionalChaining?: boolean;
  3968. /**
  3969. * The environment supports template literals.
  3970. */
  3971. templateLiteral?: boolean;
  3972. }
  3973. declare class EnvironmentPlugin {
  3974. constructor(...keys: (string | string[] | Record<string, any>)[]);
  3975. keys: string[];
  3976. defaultValues: Record<string, any>;
  3977. /**
  3978. * Apply the plugin
  3979. */
  3980. apply(compiler: Compiler): void;
  3981. }
  3982. type ErrorWithDetail = Error & { details?: string };
  3983. declare interface Etag {
  3984. toString: () => string;
  3985. }
  3986. declare class EvalDevToolModulePlugin {
  3987. constructor(options?: EvalDevToolModulePluginOptions);
  3988. namespace: string;
  3989. sourceUrlComment: string;
  3990. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  3991. /**
  3992. * Apply the plugin
  3993. */
  3994. apply(compiler: Compiler): void;
  3995. }
  3996. declare interface EvalDevToolModulePluginOptions {
  3997. /**
  3998. * namespace
  3999. */
  4000. namespace?: string;
  4001. /**
  4002. * source url comment
  4003. */
  4004. sourceUrlComment?: string;
  4005. /**
  4006. * module filename template
  4007. */
  4008. moduleFilenameTemplate?: string | ((context?: any) => string);
  4009. }
  4010. declare class EvalSourceMapDevToolPlugin {
  4011. constructor(inputOptions: string | SourceMapDevToolPluginOptions);
  4012. sourceMapComment: string;
  4013. moduleFilenameTemplate: string | ((context?: any) => string);
  4014. namespace: string;
  4015. options: SourceMapDevToolPluginOptions;
  4016. /**
  4017. * Apply the plugin
  4018. */
  4019. apply(compiler: Compiler): void;
  4020. }
  4021. declare interface ExecuteModuleArgument {
  4022. module: Module;
  4023. moduleObject?: ExecuteModuleObject;
  4024. preparedInfo: any;
  4025. codeGenerationResult: CodeGenerationResult;
  4026. }
  4027. declare interface ExecuteModuleContext {
  4028. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4029. chunk: Chunk;
  4030. chunkGraph: ChunkGraph;
  4031. __webpack_require__?: WebpackRequire;
  4032. }
  4033. declare interface ExecuteModuleObject {
  4034. /**
  4035. * module id
  4036. */
  4037. id?: string;
  4038. /**
  4039. * exports
  4040. */
  4041. exports: any;
  4042. /**
  4043. * is loaded
  4044. */
  4045. loaded: boolean;
  4046. /**
  4047. * error
  4048. */
  4049. error?: Error;
  4050. }
  4051. declare interface ExecuteModuleOptions {
  4052. entryOptions?: EntryOptions;
  4053. }
  4054. declare interface ExecuteModuleResult {
  4055. exports: any;
  4056. cacheable: boolean;
  4057. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4058. fileDependencies: LazySet<string>;
  4059. contextDependencies: LazySet<string>;
  4060. missingDependencies: LazySet<string>;
  4061. buildDependencies: LazySet<string>;
  4062. }
  4063. declare interface ExecuteOptions {
  4064. /**
  4065. * module id
  4066. */
  4067. id?: string;
  4068. /**
  4069. * module
  4070. */
  4071. module: ExecuteModuleObject;
  4072. /**
  4073. * require function
  4074. */
  4075. require: WebpackRequire;
  4076. }
  4077. type Experiments = ExperimentsCommon & ExperimentsExtra;
  4078. /**
  4079. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4080. */
  4081. declare interface ExperimentsCommon {
  4082. /**
  4083. * Support WebAssembly as asynchronous EcmaScript Module.
  4084. */
  4085. asyncWebAssembly?: boolean;
  4086. /**
  4087. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  4088. */
  4089. backCompat?: boolean;
  4090. /**
  4091. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  4092. */
  4093. cacheUnaffected?: boolean;
  4094. /**
  4095. * Apply defaults of next major version.
  4096. */
  4097. futureDefaults?: boolean;
  4098. /**
  4099. * Enable module layers.
  4100. */
  4101. layers?: boolean;
  4102. /**
  4103. * Allow output javascript files as module source type.
  4104. */
  4105. outputModule?: boolean;
  4106. /**
  4107. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  4108. */
  4109. syncWebAssembly?: boolean;
  4110. /**
  4111. * Allow using top-level-await in EcmaScript Modules.
  4112. */
  4113. topLevelAwait?: boolean;
  4114. }
  4115. /**
  4116. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4117. */
  4118. declare interface ExperimentsExtra {
  4119. /**
  4120. * Build http(s): urls using a lockfile and resource content cache.
  4121. */
  4122. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  4123. /**
  4124. * Enable css support.
  4125. */
  4126. css?: boolean;
  4127. /**
  4128. * Compile entrypoints and import()s only when they are accessed.
  4129. */
  4130. lazyCompilation?: boolean | LazyCompilationOptions;
  4131. }
  4132. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  4133. /**
  4134. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4135. */
  4136. declare interface ExperimentsNormalizedExtra {
  4137. /**
  4138. * Build http(s): urls using a lockfile and resource content cache.
  4139. */
  4140. buildHttp?: HttpUriOptions;
  4141. /**
  4142. * Enable css support.
  4143. */
  4144. css?: boolean;
  4145. /**
  4146. * Compile entrypoints and import()s only when they are accessed.
  4147. */
  4148. lazyCompilation?: false | LazyCompilationOptions;
  4149. }
  4150. type ExportAllDeclarationJavascriptParser = ExportAllDeclarationImport & {
  4151. attributes?: ImportAttribute[];
  4152. };
  4153. declare abstract class ExportInfo {
  4154. name: string;
  4155. /**
  4156. * true: it is provided
  4157. * false: it is not provided
  4158. * null: only the runtime knows if it is provided
  4159. * undefined: it was not determined if it is provided
  4160. */
  4161. provided?: null | boolean;
  4162. /**
  4163. * is the export a terminal binding that should be checked for export star conflicts
  4164. */
  4165. terminalBinding: boolean;
  4166. /**
  4167. * true: it can be mangled
  4168. * false: is can not be mangled
  4169. * undefined: it was not determined if it can be mangled
  4170. */
  4171. canMangleProvide?: boolean;
  4172. /**
  4173. * true: it can be mangled
  4174. * false: is can not be mangled
  4175. * undefined: it was not determined if it can be mangled
  4176. */
  4177. canMangleUse?: boolean;
  4178. exportsInfoOwned: boolean;
  4179. exportsInfo?: ExportsInfo;
  4180. get canMangle(): boolean;
  4181. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4182. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4183. setHasUseInfo(): void;
  4184. setUsedConditionally(
  4185. condition: (condition: UsageStateType) => boolean,
  4186. newValue: UsageStateType,
  4187. runtime: RuntimeSpec
  4188. ): boolean;
  4189. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  4190. unsetTarget(key: Dependency): boolean;
  4191. setTarget(
  4192. key: Dependency,
  4193. connection: ModuleGraphConnection,
  4194. exportName?: null | string[],
  4195. priority?: number
  4196. ): boolean;
  4197. getUsed(runtime: RuntimeSpec): UsageStateType;
  4198. /**
  4199. * get used name
  4200. */
  4201. getUsedName(
  4202. fallbackName: undefined | string,
  4203. runtime: RuntimeSpec
  4204. ): string | false;
  4205. hasUsedName(): boolean;
  4206. /**
  4207. * Sets the mangled name of this export
  4208. */
  4209. setUsedName(name: string): void;
  4210. getTerminalBinding(
  4211. moduleGraph: ModuleGraph,
  4212. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4213. ): undefined | ExportsInfo | ExportInfo;
  4214. isReexport(): undefined | boolean;
  4215. findTarget(
  4216. moduleGraph: ModuleGraph,
  4217. validTargetModuleFilter: (module: Module) => boolean
  4218. ): undefined | null | false | TargetItemWithoutConnection;
  4219. getTarget(
  4220. moduleGraph: ModuleGraph,
  4221. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4222. ): undefined | TargetItemWithConnection;
  4223. /**
  4224. * Move the target forward as long resolveTargetFilter is fulfilled
  4225. */
  4226. moveTarget(
  4227. moduleGraph: ModuleGraph,
  4228. resolveTargetFilter: (target: TargetItemWithConnection) => boolean,
  4229. updateOriginalConnection?: (
  4230. target: TargetItemWithConnection
  4231. ) => ModuleGraphConnection
  4232. ): undefined | TargetItemWithConnection;
  4233. createNestedExportsInfo(): ExportsInfo;
  4234. getNestedExportsInfo(): undefined | ExportsInfo;
  4235. hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
  4236. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4237. getUsedInfo(): string;
  4238. getProvidedInfo():
  4239. | "no provided info"
  4240. | "maybe provided (runtime-defined)"
  4241. | "provided"
  4242. | "not provided";
  4243. getRenameInfo(): string;
  4244. }
  4245. type ExportNamedDeclarationJavascriptParser = ExportNamedDeclarationImport & {
  4246. attributes?: ImportAttribute[];
  4247. };
  4248. type ExportPresenceMode = false | 0 | 1 | 2 | 3;
  4249. declare interface ExportSpec {
  4250. /**
  4251. * the name of the export
  4252. */
  4253. name: string;
  4254. /**
  4255. * can the export be renamed (defaults to true)
  4256. */
  4257. canMangle?: boolean;
  4258. /**
  4259. * is the export a terminal binding that should be checked for export star conflicts
  4260. */
  4261. terminalBinding?: boolean;
  4262. /**
  4263. * nested exports
  4264. */
  4265. exports?: (string | ExportSpec)[];
  4266. /**
  4267. * when reexported: from which module
  4268. */
  4269. from?: ModuleGraphConnection;
  4270. /**
  4271. * when reexported: from which export
  4272. */
  4273. export?: null | string[];
  4274. /**
  4275. * when reexported: with which priority
  4276. */
  4277. priority?: number;
  4278. /**
  4279. * export is not visible, because another export blends over it
  4280. */
  4281. hidden?: boolean;
  4282. }
  4283. type ExportedVariableInfo = string | VariableInfo | ScopeInfo;
  4284. declare abstract class ExportsInfo {
  4285. get ownedExports(): Iterable<ExportInfo>;
  4286. get orderedOwnedExports(): Iterable<ExportInfo>;
  4287. get exports(): Iterable<ExportInfo>;
  4288. get orderedExports(): Iterable<ExportInfo>;
  4289. get otherExportsInfo(): ExportInfo;
  4290. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  4291. setHasProvideInfo(): void;
  4292. setHasUseInfo(): void;
  4293. getOwnExportInfo(name: string): ExportInfo;
  4294. getExportInfo(name: string): ExportInfo;
  4295. getReadOnlyExportInfo(name: string): ExportInfo;
  4296. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  4297. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  4298. setUnknownExportsProvided(
  4299. canMangle?: boolean,
  4300. excludeExports?: Set<string>,
  4301. targetKey?: Dependency,
  4302. targetModule?: ModuleGraphConnection,
  4303. priority?: number
  4304. ): boolean;
  4305. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4306. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4307. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  4308. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  4309. isUsed(runtime: RuntimeSpec): boolean;
  4310. isModuleUsed(runtime: RuntimeSpec): boolean;
  4311. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  4312. getProvidedExports(): null | true | string[];
  4313. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  4314. isExportProvided(name: string | string[]): undefined | null | boolean;
  4315. getUsageKey(runtime: RuntimeSpec): string;
  4316. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  4317. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  4318. getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
  4319. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4320. getRestoreProvidedData(): RestoreProvidedData;
  4321. restoreProvided(__0: RestoreProvidedData): void;
  4322. }
  4323. declare interface ExportsSpec {
  4324. /**
  4325. * exported names, true for unknown exports or null for no exports
  4326. */
  4327. exports: null | true | (string | ExportSpec)[];
  4328. /**
  4329. * when exports = true, list of unaffected exports
  4330. */
  4331. excludeExports?: Set<string>;
  4332. /**
  4333. * list of maybe prior exposed, but now hidden exports
  4334. */
  4335. hideExports?: null | Set<string>;
  4336. /**
  4337. * when reexported: from which module
  4338. */
  4339. from?: ModuleGraphConnection;
  4340. /**
  4341. * when reexported: with which priority
  4342. */
  4343. priority?: number;
  4344. /**
  4345. * can the export be renamed (defaults to true)
  4346. */
  4347. canMangle?: boolean;
  4348. /**
  4349. * are the exports terminal bindings that should be checked for export star conflicts
  4350. */
  4351. terminalBinding?: boolean;
  4352. /**
  4353. * module on which the result depends on
  4354. */
  4355. dependencies?: Module[];
  4356. }
  4357. type Exposes = (string | ExposesObject)[] | ExposesObject;
  4358. /**
  4359. * Advanced configuration for modules that should be exposed by this container.
  4360. */
  4361. declare interface ExposesConfig {
  4362. /**
  4363. * Request to a module that should be exposed by this container.
  4364. */
  4365. import: string | string[];
  4366. /**
  4367. * Custom chunk name for the exposed module.
  4368. */
  4369. name?: string;
  4370. }
  4371. /**
  4372. * Modules that should be exposed by this container. Property names are used as public paths.
  4373. */
  4374. declare interface ExposesObject {
  4375. [index: string]: string | ExposesConfig | string[];
  4376. }
  4377. type Expression =
  4378. | ImportExpressionImport
  4379. | UnaryExpression
  4380. | ArrayExpression
  4381. | ArrowFunctionExpression
  4382. | AssignmentExpression
  4383. | AwaitExpression
  4384. | BinaryExpression
  4385. | SimpleCallExpression
  4386. | NewExpression
  4387. | ChainExpression
  4388. | ClassExpression
  4389. | ConditionalExpression
  4390. | FunctionExpression
  4391. | Identifier
  4392. | SimpleLiteral
  4393. | RegExpLiteral
  4394. | BigIntLiteral
  4395. | LogicalExpression
  4396. | MemberExpression
  4397. | MetaProperty
  4398. | ObjectExpression
  4399. | SequenceExpression
  4400. | TaggedTemplateExpression
  4401. | TemplateLiteral
  4402. | ThisExpression
  4403. | UpdateExpression
  4404. | YieldExpression;
  4405. declare interface ExpressionExpressionInfo {
  4406. type: "expression";
  4407. rootInfo: string | VariableInfo;
  4408. name: string;
  4409. getMembers: () => string[];
  4410. getMembersOptionals: () => boolean[];
  4411. getMemberRanges: () => [number, number][];
  4412. }
  4413. declare interface ExtensionAliasOption {
  4414. alias: string | string[];
  4415. extension: string;
  4416. }
  4417. declare interface ExtensionAliasOptions {
  4418. [index: string]: string | string[];
  4419. }
  4420. type ExternalItem =
  4421. | string
  4422. | RegExp
  4423. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4424. | ((
  4425. data: ExternalItemFunctionData,
  4426. callback: (
  4427. err?: null | Error,
  4428. result?: string | boolean | string[] | { [index: string]: any }
  4429. ) => void
  4430. ) => void)
  4431. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4432. /**
  4433. * Data object passed as argument when a function is set for 'externals'.
  4434. */
  4435. declare interface ExternalItemFunctionData {
  4436. /**
  4437. * The directory in which the request is placed.
  4438. */
  4439. context?: string;
  4440. /**
  4441. * Contextual information.
  4442. */
  4443. contextInfo?: ModuleFactoryCreateDataContextInfo;
  4444. /**
  4445. * The category of the referencing dependencies.
  4446. */
  4447. dependencyType?: string;
  4448. /**
  4449. * Get a resolve function with the current resolver options.
  4450. */
  4451. getResolve?: (
  4452. options?: ResolveOptions
  4453. ) =>
  4454. | ((
  4455. context: string,
  4456. request: string,
  4457. callback: (
  4458. err?: null | Error,
  4459. result?: string | false,
  4460. resolveRequest?: ResolveRequest
  4461. ) => void
  4462. ) => void)
  4463. | ((context: string, request: string) => Promise<string>);
  4464. /**
  4465. * The request as written by the user in the require/import expression/statement.
  4466. */
  4467. request?: string;
  4468. }
  4469. /**
  4470. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4471. */
  4472. declare interface ExternalItemObjectKnown {
  4473. /**
  4474. * Specify externals depending on the layer.
  4475. */
  4476. byLayer?:
  4477. | { [index: string]: ExternalItem }
  4478. | ((layer: null | string) => ExternalItem);
  4479. }
  4480. /**
  4481. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  4482. */
  4483. declare interface ExternalItemObjectUnknown {
  4484. [index: string]: ExternalItemValue;
  4485. }
  4486. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  4487. declare class ExternalModule extends Module {
  4488. constructor(
  4489. request: string | string[] | RequestRecord,
  4490. type: string,
  4491. userRequest: string,
  4492. dependencyMeta?:
  4493. | ImportDependencyMeta
  4494. | CssImportDependencyMeta
  4495. | AssetDependencyMeta
  4496. );
  4497. request: string | string[] | Record<string, string | string[]>;
  4498. externalType: string;
  4499. userRequest: string;
  4500. dependencyMeta?:
  4501. | ImportDependencyMeta
  4502. | CssImportDependencyMeta
  4503. | AssetDependencyMeta;
  4504. /**
  4505. * restore unsafe cache data
  4506. */
  4507. restoreFromUnsafeCache(
  4508. unsafeCacheData: UnsafeCacheData,
  4509. normalModuleFactory: NormalModuleFactory
  4510. ): void;
  4511. }
  4512. declare interface ExternalModuleInfo {
  4513. type: "external";
  4514. module: Module;
  4515. runtimeCondition?: string | boolean | SortableSet<string>;
  4516. index: number;
  4517. name?: string;
  4518. interopNamespaceObjectUsed: boolean;
  4519. interopNamespaceObjectName?: string;
  4520. interopNamespaceObject2Used: boolean;
  4521. interopNamespaceObject2Name?: string;
  4522. interopDefaultAccessUsed: boolean;
  4523. interopDefaultAccessName?: string;
  4524. }
  4525. type Externals =
  4526. | string
  4527. | RegExp
  4528. | ExternalItem[]
  4529. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  4530. | ((
  4531. data: ExternalItemFunctionData,
  4532. callback: (
  4533. err?: null | Error,
  4534. result?: string | boolean | string[] | { [index: string]: any }
  4535. ) => void
  4536. ) => void)
  4537. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  4538. declare class ExternalsPlugin {
  4539. constructor(type: undefined | string, externals: Externals);
  4540. type?: string;
  4541. externals: Externals;
  4542. /**
  4543. * Apply the plugin
  4544. */
  4545. apply(compiler: Compiler): void;
  4546. }
  4547. /**
  4548. * Enable presets of externals for specific targets.
  4549. */
  4550. declare interface ExternalsPresets {
  4551. /**
  4552. * 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.
  4553. */
  4554. electron?: boolean;
  4555. /**
  4556. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  4557. */
  4558. electronMain?: boolean;
  4559. /**
  4560. * 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.
  4561. */
  4562. electronPreload?: boolean;
  4563. /**
  4564. * 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.
  4565. */
  4566. electronRenderer?: boolean;
  4567. /**
  4568. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  4569. */
  4570. node?: boolean;
  4571. /**
  4572. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  4573. */
  4574. nwjs?: boolean;
  4575. /**
  4576. * 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).
  4577. */
  4578. web?: boolean;
  4579. /**
  4580. * 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).
  4581. */
  4582. webAsync?: boolean;
  4583. }
  4584. type ExternalsType =
  4585. | "import"
  4586. | "var"
  4587. | "module"
  4588. | "assign"
  4589. | "this"
  4590. | "window"
  4591. | "self"
  4592. | "global"
  4593. | "commonjs"
  4594. | "commonjs2"
  4595. | "commonjs-module"
  4596. | "commonjs-static"
  4597. | "amd"
  4598. | "amd-require"
  4599. | "umd"
  4600. | "umd2"
  4601. | "jsonp"
  4602. | "system"
  4603. | "promise"
  4604. | "module-import"
  4605. | "script"
  4606. | "node-commonjs";
  4607. declare interface FSImplementation {
  4608. open?: (...args: any[]) => any;
  4609. close?: (...args: any[]) => any;
  4610. }
  4611. declare interface FactorizeModuleOptions {
  4612. currentProfile?: ModuleProfile;
  4613. factory: ModuleFactory;
  4614. dependencies: Dependency[];
  4615. /**
  4616. * return full ModuleFactoryResult instead of only module
  4617. */
  4618. factoryResult?: boolean;
  4619. originModule: null | Module;
  4620. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  4621. context?: string;
  4622. }
  4623. declare interface FactoryMeta {
  4624. sideEffectFree?: boolean;
  4625. }
  4626. type FakeHook<T> = T & FakeHookMarker;
  4627. declare interface FakeHookMarker {}
  4628. declare interface FallbackCacheGroup {
  4629. chunksFilter: (chunk: Chunk) => undefined | boolean;
  4630. minSize: SplitChunksSizes;
  4631. maxAsyncSize: SplitChunksSizes;
  4632. maxInitialSize: SplitChunksSizes;
  4633. automaticNameDelimiter: string;
  4634. }
  4635. declare class FetchCompileAsyncWasmPlugin {
  4636. constructor();
  4637. /**
  4638. * Apply the plugin
  4639. */
  4640. apply(compiler: Compiler): void;
  4641. }
  4642. declare class FetchCompileWasmPlugin {
  4643. constructor(options?: FetchCompileWasmPluginOptions);
  4644. options: FetchCompileWasmPluginOptions;
  4645. /**
  4646. * Apply the plugin
  4647. */
  4648. apply(compiler: Compiler): void;
  4649. }
  4650. declare interface FetchCompileWasmPluginOptions {
  4651. /**
  4652. * mangle imports
  4653. */
  4654. mangleImports?: boolean;
  4655. }
  4656. /**
  4657. * Options object for persistent file-based caching.
  4658. */
  4659. declare interface FileCacheOptions {
  4660. /**
  4661. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  4662. */
  4663. allowCollectingMemory?: boolean;
  4664. /**
  4665. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  4666. */
  4667. buildDependencies?: { [index: string]: string[] };
  4668. /**
  4669. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  4670. */
  4671. cacheDirectory?: string;
  4672. /**
  4673. * Locations for the cache (defaults to cacheDirectory / name).
  4674. */
  4675. cacheLocation?: string;
  4676. /**
  4677. * Compression type used for the cache files.
  4678. */
  4679. compression?: false | "gzip" | "brotli";
  4680. /**
  4681. * Algorithm used for generation the hash (see node.js crypto package).
  4682. */
  4683. hashAlgorithm?: string;
  4684. /**
  4685. * Time in ms after which idle period the cache storing should happen.
  4686. */
  4687. idleTimeout?: number;
  4688. /**
  4689. * 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).
  4690. */
  4691. idleTimeoutAfterLargeChanges?: number;
  4692. /**
  4693. * Time in ms after which idle period the initial cache storing should happen.
  4694. */
  4695. idleTimeoutForInitialStore?: number;
  4696. /**
  4697. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  4698. */
  4699. immutablePaths?: (string | RegExp)[];
  4700. /**
  4701. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  4702. */
  4703. managedPaths?: (string | RegExp)[];
  4704. /**
  4705. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  4706. */
  4707. maxAge?: number;
  4708. /**
  4709. * 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.
  4710. */
  4711. maxMemoryGenerations?: number;
  4712. /**
  4713. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  4714. */
  4715. memoryCacheUnaffected?: boolean;
  4716. /**
  4717. * Name for the cache. Different names will lead to different coexisting caches.
  4718. */
  4719. name?: string;
  4720. /**
  4721. * Track and log detailed timing information for individual cache items.
  4722. */
  4723. profile?: boolean;
  4724. /**
  4725. * Enable/disable readonly mode.
  4726. */
  4727. readonly?: boolean;
  4728. /**
  4729. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  4730. */
  4731. store?: "pack";
  4732. /**
  4733. * Filesystem caching.
  4734. */
  4735. type: "filesystem";
  4736. /**
  4737. * 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.
  4738. */
  4739. version?: string;
  4740. }
  4741. declare interface FileSystem {
  4742. readFile: ReadFileTypes;
  4743. readdir: ReaddirTypes;
  4744. readJson?: (
  4745. arg0: PathOrFileDescriptorTypes,
  4746. arg1: (
  4747. arg0: null | Error | NodeJS.ErrnoException,
  4748. arg1?: JsonObjectTypes
  4749. ) => void
  4750. ) => void;
  4751. readlink: ReadlinkTypes;
  4752. lstat?: LStatTypes;
  4753. stat: StatTypes;
  4754. realpath?: RealPathTypes;
  4755. }
  4756. declare abstract class FileSystemInfo {
  4757. fs: InputFileSystem;
  4758. logger?: WebpackLogger;
  4759. fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
  4760. fileHashQueue: AsyncQueue<string, string, string>;
  4761. contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
  4762. contextHashQueue: AsyncQueue<string, string, ContextHash>;
  4763. contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
  4764. managedItemQueue: AsyncQueue<string, string, string>;
  4765. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  4766. unmanagedPathsWithSlash: string[];
  4767. unmanagedPathsRegExps: RegExp[];
  4768. managedPaths: (string | RegExp)[];
  4769. managedPathsWithSlash: string[];
  4770. managedPathsRegExps: RegExp[];
  4771. immutablePaths: (string | RegExp)[];
  4772. immutablePathsWithSlash: string[];
  4773. immutablePathsRegExps: RegExp[];
  4774. logStatistics(): void;
  4775. clear(): void;
  4776. addFileTimestamps(
  4777. map: ReadonlyMap<string, FileTimestamp>,
  4778. immutable?: boolean
  4779. ): void;
  4780. addContextTimestamps(
  4781. map: ReadonlyMap<string, ContextTimestamp>,
  4782. immutable?: boolean
  4783. ): void;
  4784. getFileTimestamp(
  4785. path: string,
  4786. callback: (
  4787. err?: null | WebpackError,
  4788. fileTimestamp?: null | FileSystemInfoEntry | "ignore"
  4789. ) => void
  4790. ): void;
  4791. getContextTimestamp(
  4792. path: string,
  4793. callback: (
  4794. err?: null | WebpackError,
  4795. resolvedContextTimestamp?:
  4796. | null
  4797. | "ignore"
  4798. | ResolvedContextFileSystemInfoEntry
  4799. ) => void
  4800. ): void;
  4801. getFileHash(
  4802. path: string,
  4803. callback: (err?: null | WebpackError, hash?: null | string) => void
  4804. ): void;
  4805. getContextHash(
  4806. path: string,
  4807. callback: (err?: null | WebpackError, contextHash?: string) => void
  4808. ): void;
  4809. getContextTsh(
  4810. path: string,
  4811. callback: (
  4812. err?: null | WebpackError,
  4813. resolvedContextTimestampAndHash?: null | ResolvedContextTimestampAndHash
  4814. ) => void
  4815. ): void;
  4816. resolveBuildDependencies(
  4817. context: string,
  4818. deps: Iterable<string>,
  4819. callback: (
  4820. err?: null | Error,
  4821. resolveBuildDependenciesResult?: ResolveBuildDependenciesResult
  4822. ) => void
  4823. ): void;
  4824. checkResolveResultsValid(
  4825. resolveResults: Map<string, undefined | string | false>,
  4826. callback: (err?: null | Error, result?: boolean) => void
  4827. ): void;
  4828. createSnapshot(
  4829. startTime: undefined | null | number,
  4830. files: null | Iterable<string>,
  4831. directories: null | Iterable<string>,
  4832. missing: null | Iterable<string>,
  4833. options: undefined | null | SnapshotOptionsFileSystemInfo,
  4834. callback: (err: null | WebpackError, snapshot: null | Snapshot) => void
  4835. ): void;
  4836. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  4837. checkSnapshotValid(
  4838. snapshot: Snapshot,
  4839. callback: (err?: null | WebpackError, result?: boolean) => void
  4840. ): void;
  4841. getDeprecatedFileTimestamps(): Map<string, null | number>;
  4842. getDeprecatedContextTimestamps(): Map<string, null | number>;
  4843. }
  4844. declare interface FileSystemInfoEntry {
  4845. safeTime: number;
  4846. timestamp?: number;
  4847. }
  4848. type FileTimestamp = null | FileSystemInfoEntry | "ignore";
  4849. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  4850. declare interface Flags {
  4851. [index: string]: Argument;
  4852. }
  4853. declare interface GenerateContext {
  4854. /**
  4855. * mapping from dependencies to templates
  4856. */
  4857. dependencyTemplates: DependencyTemplates;
  4858. /**
  4859. * the runtime template
  4860. */
  4861. runtimeTemplate: RuntimeTemplate;
  4862. /**
  4863. * the module graph
  4864. */
  4865. moduleGraph: ModuleGraph;
  4866. /**
  4867. * the chunk graph
  4868. */
  4869. chunkGraph: ChunkGraph;
  4870. /**
  4871. * the requirements for runtime
  4872. */
  4873. runtimeRequirements: Set<string>;
  4874. /**
  4875. * the runtime
  4876. */
  4877. runtime: RuntimeSpec;
  4878. /**
  4879. * when in concatenated module, information about other concatenated modules
  4880. */
  4881. concatenationScope?: ConcatenationScope;
  4882. /**
  4883. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  4884. */
  4885. codeGenerationResults?: CodeGenerationResults;
  4886. /**
  4887. * which kind of code should be generated
  4888. */
  4889. type: string;
  4890. /**
  4891. * get access to the code generation data
  4892. */
  4893. getData?: () => Map<string, any>;
  4894. }
  4895. declare class Generator {
  4896. constructor();
  4897. getTypes(module: NormalModule): ReadonlySet<string>;
  4898. getSize(module: NormalModule, type?: string): number;
  4899. generate(module: NormalModule, __1: GenerateContext): null | Source;
  4900. getConcatenationBailoutReason(
  4901. module: NormalModule,
  4902. context: ConcatenationBailoutReasonContext
  4903. ): undefined | string;
  4904. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  4905. static byType(map: Record<string, Generator>): ByTypeGenerator;
  4906. }
  4907. declare interface GeneratorOptions {
  4908. [index: string]: any;
  4909. }
  4910. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  4911. GeneratorOptionsByModuleTypeUnknown;
  4912. /**
  4913. * Specify options for each generator.
  4914. */
  4915. declare interface GeneratorOptionsByModuleTypeKnown {
  4916. /**
  4917. * Generator options for asset modules.
  4918. */
  4919. asset?: AssetGeneratorOptions;
  4920. /**
  4921. * Generator options for asset/inline modules.
  4922. */
  4923. "asset/inline"?: AssetInlineGeneratorOptions;
  4924. /**
  4925. * Generator options for asset/resource modules.
  4926. */
  4927. "asset/resource"?: AssetResourceGeneratorOptions;
  4928. /**
  4929. * Generator options for css modules.
  4930. */
  4931. css?: CssGeneratorOptions;
  4932. /**
  4933. * Generator options for css/auto modules.
  4934. */
  4935. "css/auto"?: CssAutoGeneratorOptions;
  4936. /**
  4937. * Generator options for css/global modules.
  4938. */
  4939. "css/global"?: CssGlobalGeneratorOptions;
  4940. /**
  4941. * Generator options for css/module modules.
  4942. */
  4943. "css/module"?: CssModuleGeneratorOptions;
  4944. /**
  4945. * No generator options are supported for this module type.
  4946. */
  4947. javascript?: EmptyGeneratorOptions;
  4948. /**
  4949. * No generator options are supported for this module type.
  4950. */
  4951. "javascript/auto"?: EmptyGeneratorOptions;
  4952. /**
  4953. * No generator options are supported for this module type.
  4954. */
  4955. "javascript/dynamic"?: EmptyGeneratorOptions;
  4956. /**
  4957. * No generator options are supported for this module type.
  4958. */
  4959. "javascript/esm"?: EmptyGeneratorOptions;
  4960. /**
  4961. * Generator options for json modules.
  4962. */
  4963. json?: JsonGeneratorOptions;
  4964. }
  4965. /**
  4966. * Specify options for each generator.
  4967. */
  4968. declare interface GeneratorOptionsByModuleTypeUnknown {
  4969. [index: string]: { [index: string]: any };
  4970. }
  4971. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  4972. constructor(
  4973. contentType: string,
  4974. name: string,
  4975. global: string,
  4976. getFilenameForChunk: (
  4977. chunk: Chunk
  4978. ) =>
  4979. | string
  4980. | false
  4981. | ((pathData: PathData, assetInfo?: AssetInfo) => string),
  4982. allChunks: boolean
  4983. );
  4984. contentType: string;
  4985. global: string;
  4986. getFilenameForChunk: (
  4987. chunk: Chunk
  4988. ) => string | false | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4989. allChunks: boolean;
  4990. /**
  4991. * Runtime modules without any dependencies to other runtime modules
  4992. */
  4993. static STAGE_NORMAL: number;
  4994. /**
  4995. * Runtime modules with simple dependencies on other runtime modules
  4996. */
  4997. static STAGE_BASIC: number;
  4998. /**
  4999. * Runtime modules which attach to handlers of other runtime modules
  5000. */
  5001. static STAGE_ATTACH: number;
  5002. /**
  5003. * Runtime modules which trigger actions on bootstrap
  5004. */
  5005. static STAGE_TRIGGER: number;
  5006. }
  5007. declare interface GroupConfig {
  5008. getKeys: (item?: any) => undefined | string[];
  5009. createGroup: (key: string, children: any[], items: any[]) => object;
  5010. getOptions?: (name: string, items: any[]) => GroupOptions;
  5011. }
  5012. declare interface GroupOptions {
  5013. groupChildren?: boolean;
  5014. force?: boolean;
  5015. targetGroupCount?: number;
  5016. }
  5017. declare interface HMRJavascriptParserHooks {
  5018. hotAcceptCallback: SyncBailHook<
  5019. [
  5020. (
  5021. | ImportExpressionImport
  5022. | UnaryExpression
  5023. | ArrayExpression
  5024. | ArrowFunctionExpression
  5025. | AssignmentExpression
  5026. | AwaitExpression
  5027. | BinaryExpression
  5028. | SimpleCallExpression
  5029. | NewExpression
  5030. | ChainExpression
  5031. | ClassExpression
  5032. | ConditionalExpression
  5033. | FunctionExpression
  5034. | Identifier
  5035. | SimpleLiteral
  5036. | RegExpLiteral
  5037. | BigIntLiteral
  5038. | LogicalExpression
  5039. | MemberExpression
  5040. | MetaProperty
  5041. | ObjectExpression
  5042. | SequenceExpression
  5043. | TaggedTemplateExpression
  5044. | TemplateLiteral
  5045. | ThisExpression
  5046. | UpdateExpression
  5047. | YieldExpression
  5048. | SpreadElement
  5049. ),
  5050. string[]
  5051. ],
  5052. void
  5053. >;
  5054. hotAcceptWithoutCallback: SyncBailHook<[CallExpression, string[]], void>;
  5055. }
  5056. declare interface HandleModuleCreationOptions {
  5057. factory: ModuleFactory;
  5058. dependencies: Dependency[];
  5059. originModule: null | Module;
  5060. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  5061. context?: string;
  5062. /**
  5063. * recurse into dependencies of the created module
  5064. */
  5065. recursive?: boolean;
  5066. /**
  5067. * connect the resolved module with the origin module
  5068. */
  5069. connectOrigin?: boolean;
  5070. /**
  5071. * check the cycle dependencies of the created module
  5072. */
  5073. checkCycle?: boolean;
  5074. }
  5075. declare class HarmonyImportDependency extends ModuleDependency {
  5076. constructor(
  5077. request: string,
  5078. sourceOrder: number,
  5079. attributes?: ImportAttributes
  5080. );
  5081. sourceOrder: number;
  5082. getImportVar(moduleGraph: ModuleGraph): string;
  5083. getImportStatement(
  5084. update: boolean,
  5085. __1: DependencyTemplateContext
  5086. ): [string, string];
  5087. getLinkingErrors(
  5088. moduleGraph: ModuleGraph,
  5089. ids: string[],
  5090. additionalMessage: string
  5091. ): undefined | WebpackError[];
  5092. static Template: typeof HarmonyImportDependencyTemplate;
  5093. static ExportPresenceModes: {
  5094. NONE: ExportPresenceMode;
  5095. WARN: ExportPresenceMode;
  5096. AUTO: ExportPresenceMode;
  5097. ERROR: ExportPresenceMode;
  5098. fromUserOption(str: string | false): ExportPresenceMode;
  5099. };
  5100. static NO_EXPORTS_REFERENCED: string[][];
  5101. static EXPORTS_OBJECT_REFERENCED: string[][];
  5102. static TRANSITIVE: typeof TRANSITIVE;
  5103. }
  5104. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  5105. constructor();
  5106. static getImportEmittedRuntime(
  5107. module: Module,
  5108. referencedModule: Module
  5109. ): undefined | string | boolean | SortableSet<string>;
  5110. }
  5111. declare class Hash {
  5112. constructor();
  5113. /**
  5114. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  5115. */
  5116. update(data: string | Buffer, inputEncoding?: string): Hash;
  5117. /**
  5118. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  5119. */
  5120. digest(encoding?: string): string | Buffer;
  5121. }
  5122. type HashFunction = string | typeof Hash;
  5123. declare interface HashableObject {
  5124. updateHash: (hash: Hash) => void;
  5125. }
  5126. declare class HashedModuleIdsPlugin {
  5127. constructor(options?: HashedModuleIdsPluginOptions);
  5128. options: HashedModuleIdsPluginOptions;
  5129. /**
  5130. * Apply the plugin
  5131. */
  5132. apply(compiler: Compiler): void;
  5133. }
  5134. declare interface HashedModuleIdsPluginOptions {
  5135. /**
  5136. * The context directory for creating names.
  5137. */
  5138. context?: string;
  5139. /**
  5140. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  5141. */
  5142. hashDigest?: "base64" | "latin1" | "hex";
  5143. /**
  5144. * The prefix length of the hash digest to use, defaults to 4.
  5145. */
  5146. hashDigestLength?: number;
  5147. /**
  5148. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  5149. */
  5150. hashFunction?: string | typeof Hash;
  5151. }
  5152. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  5153. declare class HotModuleReplacementPlugin {
  5154. constructor();
  5155. /**
  5156. * Apply the plugin
  5157. */
  5158. apply(compiler: Compiler): void;
  5159. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  5160. }
  5161. /**
  5162. * These properties are added by the HotModuleReplacementPlugin
  5163. */
  5164. declare interface HotModuleReplacementPluginLoaderContext {
  5165. hot?: boolean;
  5166. }
  5167. declare class HotUpdateChunk extends Chunk {
  5168. constructor();
  5169. }
  5170. /**
  5171. * Options for building http resources.
  5172. */
  5173. declare interface HttpUriOptions {
  5174. /**
  5175. * List of allowed URIs (resp. the beginning of them).
  5176. */
  5177. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  5178. /**
  5179. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  5180. */
  5181. cacheLocation?: string | false;
  5182. /**
  5183. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  5184. */
  5185. frozen?: boolean;
  5186. /**
  5187. * Location of the lockfile.
  5188. */
  5189. lockfileLocation?: string;
  5190. /**
  5191. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  5192. */
  5193. proxy?: string;
  5194. /**
  5195. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  5196. */
  5197. upgrade?: boolean;
  5198. }
  5199. declare class HttpUriPlugin {
  5200. constructor(options: HttpUriOptions);
  5201. /**
  5202. * Apply the plugin
  5203. */
  5204. apply(compiler: Compiler): void;
  5205. }
  5206. type HttpsServerOptions = SecureContextOptions &
  5207. TlsOptions &
  5208. ServerOptions<typeof IncomingMessage>;
  5209. type IBigIntStats = IStatsBase<bigint> & {
  5210. atimeNs: bigint;
  5211. mtimeNs: bigint;
  5212. ctimeNs: bigint;
  5213. birthtimeNs: bigint;
  5214. };
  5215. declare interface IStats {
  5216. isFile: () => boolean;
  5217. isDirectory: () => boolean;
  5218. isBlockDevice: () => boolean;
  5219. isCharacterDevice: () => boolean;
  5220. isSymbolicLink: () => boolean;
  5221. isFIFO: () => boolean;
  5222. isSocket: () => boolean;
  5223. dev: number;
  5224. ino: number;
  5225. mode: number;
  5226. nlink: number;
  5227. uid: number;
  5228. gid: number;
  5229. rdev: number;
  5230. size: number;
  5231. blksize: number;
  5232. blocks: number;
  5233. atimeMs: number;
  5234. mtimeMs: number;
  5235. ctimeMs: number;
  5236. birthtimeMs: number;
  5237. atime: Date;
  5238. mtime: Date;
  5239. ctime: Date;
  5240. birthtime: Date;
  5241. }
  5242. declare interface IStatsBase<T> {
  5243. isFile: () => boolean;
  5244. isDirectory: () => boolean;
  5245. isBlockDevice: () => boolean;
  5246. isCharacterDevice: () => boolean;
  5247. isSymbolicLink: () => boolean;
  5248. isFIFO: () => boolean;
  5249. isSocket: () => boolean;
  5250. dev: T;
  5251. ino: T;
  5252. mode: T;
  5253. nlink: T;
  5254. uid: T;
  5255. gid: T;
  5256. rdev: T;
  5257. size: T;
  5258. blksize: T;
  5259. blocks: T;
  5260. atimeMs: T;
  5261. mtimeMs: T;
  5262. ctimeMs: T;
  5263. birthtimeMs: T;
  5264. atime: Date;
  5265. mtime: Date;
  5266. ctime: Date;
  5267. birthtime: Date;
  5268. }
  5269. declare class IgnorePlugin {
  5270. constructor(options: IgnorePluginOptions);
  5271. options: IgnorePluginOptions;
  5272. /**
  5273. * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
  5274. */
  5275. checkIgnore(resolveData: ResolveData): undefined | false;
  5276. /**
  5277. * Apply the plugin
  5278. */
  5279. apply(compiler: Compiler): void;
  5280. }
  5281. type IgnorePluginOptions =
  5282. | {
  5283. /**
  5284. * A RegExp to test the context (directory) against.
  5285. */
  5286. contextRegExp?: RegExp;
  5287. /**
  5288. * A RegExp to test the request against.
  5289. */
  5290. resourceRegExp: RegExp;
  5291. }
  5292. | {
  5293. /**
  5294. * A filter function for resource and context.
  5295. */
  5296. checkResource: (resource: string, context: string) => boolean;
  5297. };
  5298. type ImportAttribute = BaseNode & {
  5299. type: "ImportAttribute";
  5300. key: Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral;
  5301. value: Literal;
  5302. };
  5303. type ImportAttributes = Record<string, string> & {};
  5304. type ImportDeclarationJavascriptParser = ImportDeclarationImport & {
  5305. attributes?: ImportAttribute[];
  5306. };
  5307. declare interface ImportDependencyMeta {
  5308. attributes?: ImportAttributes;
  5309. externalType?: "import" | "module";
  5310. }
  5311. type ImportExpressionJavascriptParser = ImportExpressionImport & {
  5312. options?:
  5313. | null
  5314. | ImportExpressionImport
  5315. | UnaryExpression
  5316. | ArrayExpression
  5317. | ArrowFunctionExpression
  5318. | AssignmentExpression
  5319. | AwaitExpression
  5320. | BinaryExpression
  5321. | SimpleCallExpression
  5322. | NewExpression
  5323. | ChainExpression
  5324. | ClassExpression
  5325. | ConditionalExpression
  5326. | FunctionExpression
  5327. | Identifier
  5328. | SimpleLiteral
  5329. | RegExpLiteral
  5330. | BigIntLiteral
  5331. | LogicalExpression
  5332. | MemberExpression
  5333. | MetaProperty
  5334. | ObjectExpression
  5335. | SequenceExpression
  5336. | TaggedTemplateExpression
  5337. | TemplateLiteral
  5338. | ThisExpression
  5339. | UpdateExpression
  5340. | YieldExpression;
  5341. };
  5342. declare interface ImportModuleOptions {
  5343. /**
  5344. * the target layer
  5345. */
  5346. layer?: string;
  5347. /**
  5348. * the target public path
  5349. */
  5350. publicPath?: string;
  5351. /**
  5352. * target base uri
  5353. */
  5354. baseUri?: string;
  5355. }
  5356. type ImportSource =
  5357. | undefined
  5358. | null
  5359. | string
  5360. | SimpleLiteral
  5361. | RegExpLiteral
  5362. | BigIntLiteral;
  5363. /**
  5364. * Options for infrastructure level logging.
  5365. */
  5366. declare interface InfrastructureLogging {
  5367. /**
  5368. * 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.
  5369. */
  5370. appendOnly?: boolean;
  5371. /**
  5372. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  5373. */
  5374. colors?: boolean;
  5375. /**
  5376. * Custom console used for logging.
  5377. */
  5378. console?: Console;
  5379. /**
  5380. * Enable debug logging for specific loggers.
  5381. */
  5382. debug?:
  5383. | string
  5384. | boolean
  5385. | RegExp
  5386. | FilterItemTypes[]
  5387. | ((value: string) => boolean);
  5388. /**
  5389. * Log level.
  5390. */
  5391. level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
  5392. /**
  5393. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  5394. */
  5395. stream?: NodeJS.WritableStream;
  5396. }
  5397. declare class InitFragment<GenerateContext> {
  5398. constructor(
  5399. content: undefined | string | Source,
  5400. stage: number,
  5401. position: number,
  5402. key?: string,
  5403. endContent?: string | Source
  5404. );
  5405. content?: string | Source;
  5406. stage: number;
  5407. position: number;
  5408. key?: string;
  5409. endContent?: string | Source;
  5410. getContent(context: GenerateContext): undefined | string | Source;
  5411. getEndContent(context: GenerateContext): undefined | string | Source;
  5412. serialize(context: ObjectSerializerContext): void;
  5413. deserialize(context: ObjectDeserializerContext): void;
  5414. merge: any;
  5415. static addToSource<Context, T>(
  5416. source: Source,
  5417. initFragments: InitFragment<T>[],
  5418. context: Context
  5419. ): Source;
  5420. static STAGE_CONSTANTS: number;
  5421. static STAGE_ASYNC_BOUNDARY: number;
  5422. static STAGE_HARMONY_EXPORTS: number;
  5423. static STAGE_HARMONY_IMPORTS: number;
  5424. static STAGE_PROVIDES: number;
  5425. static STAGE_ASYNC_DEPENDENCIES: number;
  5426. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  5427. }
  5428. declare interface InputFileSystem {
  5429. readFile: ReadFileFs;
  5430. readFileSync?: ReadFileSync;
  5431. readlink: ReadlinkFs;
  5432. readlinkSync?: ReadlinkSync;
  5433. readdir: ReaddirFs;
  5434. readdirSync?: ReaddirSync;
  5435. stat: StatFs;
  5436. statSync?: StatSync;
  5437. lstat?: LStatFs;
  5438. lstatSync?: LStatSync;
  5439. realpath?: RealPathFs;
  5440. realpathSync?: RealPathSync;
  5441. readJson?: (
  5442. pathOrFileDescriptor: PathOrFileDescriptorFs,
  5443. callback: (
  5444. err: null | Error | NodeJS.ErrnoException,
  5445. result?: JsonObjectFs
  5446. ) => void
  5447. ) => void;
  5448. readJsonSync?: (pathOrFileDescriptor: PathOrFileDescriptorFs) => JsonObjectFs;
  5449. purge?: (value?: string | string[] | Set<string>) => void;
  5450. join?: (path1: string, path2: string) => string;
  5451. relative?: (from: string, to: string) => string;
  5452. dirname?: (dirname: string) => string;
  5453. }
  5454. type IntermediateFileSystem = InputFileSystem &
  5455. OutputFileSystem &
  5456. IntermediateFileSystemExtras;
  5457. declare interface IntermediateFileSystemExtras {
  5458. mkdirSync: MkdirSync;
  5459. createWriteStream: (
  5460. pathLike: PathLikeFs,
  5461. result?:
  5462. | "ascii"
  5463. | "utf8"
  5464. | "utf-8"
  5465. | "utf16le"
  5466. | "utf-16le"
  5467. | "ucs2"
  5468. | "ucs-2"
  5469. | "base64"
  5470. | "base64url"
  5471. | "latin1"
  5472. | "binary"
  5473. | "hex"
  5474. | WriteStreamOptions
  5475. ) => NodeJS.WritableStream;
  5476. open: Open;
  5477. read: Read<ArrayBufferView<ArrayBufferLike>>;
  5478. close: (
  5479. df: number,
  5480. callback: (err: null | NodeJS.ErrnoException) => void
  5481. ) => void;
  5482. rename: (
  5483. a: PathLikeFs,
  5484. b: PathLikeFs,
  5485. callback: (err: null | NodeJS.ErrnoException) => void
  5486. ) => void;
  5487. }
  5488. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  5489. declare interface InterpolatedPathAndAssetInfo {
  5490. path: string;
  5491. info: AssetInfo;
  5492. }
  5493. declare interface Item<T> {
  5494. [index: string]: string | string[] | T;
  5495. }
  5496. declare abstract class ItemCacheFacade {
  5497. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  5498. getPromise<T>(): Promise<T>;
  5499. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  5500. storePromise<T>(data: T): Promise<void>;
  5501. provide<T>(
  5502. computer: (callback: CallbackNormalErrorCache<T>) => void,
  5503. callback: CallbackNormalErrorCache<T>
  5504. ): void;
  5505. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  5506. }
  5507. declare class JavascriptModulesPlugin {
  5508. constructor(options?: object);
  5509. options: object;
  5510. /**
  5511. * Apply the plugin
  5512. */
  5513. apply(compiler: Compiler): void;
  5514. renderModule(
  5515. module: Module,
  5516. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  5517. hooks: CompilationHooksJavascriptModulesPlugin,
  5518. factory: boolean
  5519. ): null | Source;
  5520. renderChunk(
  5521. renderContext: RenderContextJavascriptModulesPlugin,
  5522. hooks: CompilationHooksJavascriptModulesPlugin
  5523. ): Source;
  5524. renderMain(
  5525. renderContext: MainRenderContext,
  5526. hooks: CompilationHooksJavascriptModulesPlugin,
  5527. compilation: Compilation
  5528. ): Source;
  5529. updateHashWithBootstrap(
  5530. hash: Hash,
  5531. renderContext: RenderBootstrapContext,
  5532. hooks: CompilationHooksJavascriptModulesPlugin
  5533. ): void;
  5534. renderBootstrap(
  5535. renderContext: RenderBootstrapContext,
  5536. hooks: CompilationHooksJavascriptModulesPlugin
  5537. ): Bootstrap;
  5538. renderRequire(
  5539. renderContext: RenderBootstrapContext,
  5540. hooks: CompilationHooksJavascriptModulesPlugin
  5541. ): string;
  5542. getRenamedInlineModule(
  5543. allModules: Module[],
  5544. renderContext: MainRenderContext,
  5545. inlinedModules: Set<Module>,
  5546. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  5547. hooks: CompilationHooksJavascriptModulesPlugin,
  5548. allStrict: undefined | boolean,
  5549. hasChunkModules: boolean
  5550. ): false | Map<Module, Source>;
  5551. static getCompilationHooks(
  5552. compilation: Compilation
  5553. ): CompilationHooksJavascriptModulesPlugin;
  5554. static getChunkFilenameTemplate(
  5555. chunk: Chunk,
  5556. outputOptions: Output
  5557. ): TemplatePath;
  5558. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  5559. }
  5560. declare class JavascriptParser extends Parser {
  5561. constructor(sourceType?: "module" | "auto" | "script");
  5562. hooks: Readonly<{
  5563. evaluateTypeof: HookMap<
  5564. SyncBailHook<
  5565. [UnaryExpression],
  5566. undefined | null | BasicEvaluatedExpression
  5567. >
  5568. >;
  5569. evaluate: HookMap<
  5570. SyncBailHook<
  5571. [
  5572. | ImportExpressionImport
  5573. | UnaryExpression
  5574. | ArrayExpression
  5575. | ArrowFunctionExpression
  5576. | AssignmentExpression
  5577. | AwaitExpression
  5578. | BinaryExpression
  5579. | SimpleCallExpression
  5580. | NewExpression
  5581. | ChainExpression
  5582. | ClassExpression
  5583. | ConditionalExpression
  5584. | FunctionExpression
  5585. | Identifier
  5586. | SimpleLiteral
  5587. | RegExpLiteral
  5588. | BigIntLiteral
  5589. | LogicalExpression
  5590. | MemberExpression
  5591. | MetaProperty
  5592. | ObjectExpression
  5593. | SequenceExpression
  5594. | TaggedTemplateExpression
  5595. | TemplateLiteral
  5596. | ThisExpression
  5597. | UpdateExpression
  5598. | YieldExpression
  5599. | SpreadElement
  5600. | PrivateIdentifier
  5601. | Super
  5602. ],
  5603. undefined | null | BasicEvaluatedExpression
  5604. >
  5605. >;
  5606. evaluateIdentifier: HookMap<
  5607. SyncBailHook<
  5608. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  5609. undefined | null | BasicEvaluatedExpression
  5610. >
  5611. >;
  5612. evaluateDefinedIdentifier: HookMap<
  5613. SyncBailHook<
  5614. [Identifier | MemberExpression | ThisExpression],
  5615. undefined | null | BasicEvaluatedExpression
  5616. >
  5617. >;
  5618. evaluateNewExpression: HookMap<
  5619. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  5620. >;
  5621. evaluateCallExpression: HookMap<
  5622. SyncBailHook<
  5623. [CallExpression],
  5624. undefined | null | BasicEvaluatedExpression
  5625. >
  5626. >;
  5627. evaluateCallExpressionMember: HookMap<
  5628. SyncBailHook<
  5629. [CallExpression, BasicEvaluatedExpression],
  5630. undefined | null | BasicEvaluatedExpression
  5631. >
  5632. >;
  5633. isPure: HookMap<
  5634. SyncBailHook<
  5635. [
  5636. (
  5637. | ImportExpressionImport
  5638. | UnaryExpression
  5639. | ArrayExpression
  5640. | ArrowFunctionExpression
  5641. | AssignmentExpression
  5642. | AwaitExpression
  5643. | BinaryExpression
  5644. | SimpleCallExpression
  5645. | NewExpression
  5646. | ChainExpression
  5647. | ClassExpression
  5648. | ConditionalExpression
  5649. | FunctionExpression
  5650. | Identifier
  5651. | SimpleLiteral
  5652. | RegExpLiteral
  5653. | BigIntLiteral
  5654. | LogicalExpression
  5655. | MemberExpression
  5656. | MetaProperty
  5657. | ObjectExpression
  5658. | SequenceExpression
  5659. | TaggedTemplateExpression
  5660. | TemplateLiteral
  5661. | ThisExpression
  5662. | UpdateExpression
  5663. | YieldExpression
  5664. | PrivateIdentifier
  5665. | FunctionDeclaration
  5666. | MaybeNamedFunctionDeclaration
  5667. | VariableDeclaration
  5668. | ClassDeclaration
  5669. | MaybeNamedClassDeclaration
  5670. ),
  5671. number
  5672. ],
  5673. boolean | void
  5674. >
  5675. >;
  5676. preStatement: SyncBailHook<
  5677. [
  5678. | ImportDeclarationJavascriptParser
  5679. | ExportNamedDeclarationJavascriptParser
  5680. | ExportAllDeclarationJavascriptParser
  5681. | FunctionDeclaration
  5682. | MaybeNamedFunctionDeclaration
  5683. | VariableDeclaration
  5684. | ClassDeclaration
  5685. | MaybeNamedClassDeclaration
  5686. | ExpressionStatement
  5687. | BlockStatement
  5688. | StaticBlock
  5689. | EmptyStatement
  5690. | DebuggerStatement
  5691. | WithStatement
  5692. | ReturnStatement
  5693. | LabeledStatement
  5694. | BreakStatement
  5695. | ContinueStatement
  5696. | IfStatement
  5697. | SwitchStatement
  5698. | ThrowStatement
  5699. | TryStatement
  5700. | WhileStatement
  5701. | DoWhileStatement
  5702. | ForStatement
  5703. | ForInStatement
  5704. | ForOfStatement
  5705. | ExportDefaultDeclaration
  5706. ],
  5707. boolean | void
  5708. >;
  5709. blockPreStatement: SyncBailHook<
  5710. [
  5711. | ImportDeclarationJavascriptParser
  5712. | ExportNamedDeclarationJavascriptParser
  5713. | ExportAllDeclarationJavascriptParser
  5714. | FunctionDeclaration
  5715. | MaybeNamedFunctionDeclaration
  5716. | VariableDeclaration
  5717. | ClassDeclaration
  5718. | MaybeNamedClassDeclaration
  5719. | ExpressionStatement
  5720. | BlockStatement
  5721. | StaticBlock
  5722. | EmptyStatement
  5723. | DebuggerStatement
  5724. | WithStatement
  5725. | ReturnStatement
  5726. | LabeledStatement
  5727. | BreakStatement
  5728. | ContinueStatement
  5729. | IfStatement
  5730. | SwitchStatement
  5731. | ThrowStatement
  5732. | TryStatement
  5733. | WhileStatement
  5734. | DoWhileStatement
  5735. | ForStatement
  5736. | ForInStatement
  5737. | ForOfStatement
  5738. | ExportDefaultDeclaration
  5739. ],
  5740. boolean | void
  5741. >;
  5742. statement: SyncBailHook<
  5743. [
  5744. | ImportDeclarationJavascriptParser
  5745. | ExportNamedDeclarationJavascriptParser
  5746. | ExportAllDeclarationJavascriptParser
  5747. | FunctionDeclaration
  5748. | MaybeNamedFunctionDeclaration
  5749. | VariableDeclaration
  5750. | ClassDeclaration
  5751. | MaybeNamedClassDeclaration
  5752. | ExpressionStatement
  5753. | BlockStatement
  5754. | StaticBlock
  5755. | EmptyStatement
  5756. | DebuggerStatement
  5757. | WithStatement
  5758. | ReturnStatement
  5759. | LabeledStatement
  5760. | BreakStatement
  5761. | ContinueStatement
  5762. | IfStatement
  5763. | SwitchStatement
  5764. | ThrowStatement
  5765. | TryStatement
  5766. | WhileStatement
  5767. | DoWhileStatement
  5768. | ForStatement
  5769. | ForInStatement
  5770. | ForOfStatement
  5771. | ExportDefaultDeclaration
  5772. ],
  5773. boolean | void
  5774. >;
  5775. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  5776. classExtendsExpression: SyncBailHook<
  5777. [
  5778. Expression,
  5779. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  5780. ],
  5781. boolean | void
  5782. >;
  5783. classBodyElement: SyncBailHook<
  5784. [
  5785. StaticBlock | MethodDefinition | PropertyDefinition,
  5786. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  5787. ],
  5788. boolean | void
  5789. >;
  5790. classBodyValue: SyncBailHook<
  5791. [
  5792. Expression,
  5793. MethodDefinition | PropertyDefinition,
  5794. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  5795. ],
  5796. boolean | void
  5797. >;
  5798. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  5799. import: SyncBailHook<
  5800. [ImportDeclarationJavascriptParser, ImportSource],
  5801. boolean | void
  5802. >;
  5803. importSpecifier: SyncBailHook<
  5804. [ImportDeclarationJavascriptParser, ImportSource, null | string, string],
  5805. boolean | void
  5806. >;
  5807. export: SyncBailHook<
  5808. [ExportNamedDeclarationJavascriptParser | ExportDefaultDeclaration],
  5809. boolean | void
  5810. >;
  5811. exportImport: SyncBailHook<
  5812. [
  5813. (
  5814. | ExportNamedDeclarationJavascriptParser
  5815. | ExportAllDeclarationJavascriptParser
  5816. ),
  5817. ImportSource
  5818. ],
  5819. boolean | void
  5820. >;
  5821. exportDeclaration: SyncBailHook<
  5822. [
  5823. (
  5824. | ExportNamedDeclarationJavascriptParser
  5825. | ExportAllDeclarationJavascriptParser
  5826. | ExportDefaultDeclaration
  5827. ),
  5828. Declaration
  5829. ],
  5830. boolean | void
  5831. >;
  5832. exportExpression: SyncBailHook<
  5833. [
  5834. ExportDefaultDeclaration,
  5835. (
  5836. | ImportExpressionImport
  5837. | UnaryExpression
  5838. | ArrayExpression
  5839. | ArrowFunctionExpression
  5840. | AssignmentExpression
  5841. | AwaitExpression
  5842. | BinaryExpression
  5843. | SimpleCallExpression
  5844. | NewExpression
  5845. | ChainExpression
  5846. | ClassExpression
  5847. | ConditionalExpression
  5848. | FunctionExpression
  5849. | Identifier
  5850. | SimpleLiteral
  5851. | RegExpLiteral
  5852. | BigIntLiteral
  5853. | LogicalExpression
  5854. | MemberExpression
  5855. | MetaProperty
  5856. | ObjectExpression
  5857. | SequenceExpression
  5858. | TaggedTemplateExpression
  5859. | TemplateLiteral
  5860. | ThisExpression
  5861. | UpdateExpression
  5862. | YieldExpression
  5863. | MaybeNamedFunctionDeclaration
  5864. | MaybeNamedClassDeclaration
  5865. )
  5866. ],
  5867. boolean | void
  5868. >;
  5869. exportSpecifier: SyncBailHook<
  5870. [
  5871. (
  5872. | ExportNamedDeclarationJavascriptParser
  5873. | ExportAllDeclarationJavascriptParser
  5874. | ExportDefaultDeclaration
  5875. ),
  5876. string,
  5877. string,
  5878. undefined | number
  5879. ],
  5880. boolean | void
  5881. >;
  5882. exportImportSpecifier: SyncBailHook<
  5883. [
  5884. (
  5885. | ExportNamedDeclarationJavascriptParser
  5886. | ExportAllDeclarationJavascriptParser
  5887. ),
  5888. ImportSource,
  5889. null | string,
  5890. null | string,
  5891. undefined | number
  5892. ],
  5893. boolean | void
  5894. >;
  5895. preDeclarator: SyncBailHook<
  5896. [VariableDeclarator, Statement],
  5897. boolean | void
  5898. >;
  5899. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  5900. varDeclaration: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5901. varDeclarationLet: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5902. varDeclarationConst: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5903. varDeclarationVar: HookMap<SyncBailHook<[Declaration], boolean | void>>;
  5904. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  5905. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5906. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5907. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  5908. assignMemberChain: HookMap<
  5909. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  5910. >;
  5911. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5912. importCall: SyncBailHook<
  5913. [ImportExpressionJavascriptParser],
  5914. boolean | void
  5915. >;
  5916. topLevelAwait: SyncBailHook<
  5917. [
  5918. | ImportExpressionImport
  5919. | UnaryExpression
  5920. | ArrayExpression
  5921. | ArrowFunctionExpression
  5922. | AssignmentExpression
  5923. | AwaitExpression
  5924. | BinaryExpression
  5925. | SimpleCallExpression
  5926. | NewExpression
  5927. | ChainExpression
  5928. | ClassExpression
  5929. | ConditionalExpression
  5930. | FunctionExpression
  5931. | Identifier
  5932. | SimpleLiteral
  5933. | RegExpLiteral
  5934. | BigIntLiteral
  5935. | LogicalExpression
  5936. | MemberExpression
  5937. | MetaProperty
  5938. | ObjectExpression
  5939. | SequenceExpression
  5940. | TaggedTemplateExpression
  5941. | TemplateLiteral
  5942. | ThisExpression
  5943. | UpdateExpression
  5944. | YieldExpression
  5945. | ForOfStatement
  5946. ],
  5947. boolean | void
  5948. >;
  5949. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  5950. callMemberChain: HookMap<
  5951. SyncBailHook<
  5952. [CallExpression, string[], boolean[], [number, number][]],
  5953. boolean | void
  5954. >
  5955. >;
  5956. memberChainOfCallMemberChain: HookMap<
  5957. SyncBailHook<
  5958. [Expression, string[], CallExpression, string[], [number, number][]],
  5959. boolean | void
  5960. >
  5961. >;
  5962. callMemberChainOfCallMemberChain: HookMap<
  5963. SyncBailHook<
  5964. [
  5965. CallExpression,
  5966. string[],
  5967. CallExpression,
  5968. string[],
  5969. [number, number][]
  5970. ],
  5971. boolean | void
  5972. >
  5973. >;
  5974. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  5975. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  5976. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  5977. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  5978. expressionMemberChain: HookMap<
  5979. SyncBailHook<
  5980. [MemberExpression, string[], boolean[], [number, number][]],
  5981. boolean | void
  5982. >
  5983. >;
  5984. unhandledExpressionMemberChain: HookMap<
  5985. SyncBailHook<[MemberExpression, string[]], boolean | void>
  5986. >;
  5987. expressionConditionalOperator: SyncBailHook<
  5988. [ConditionalExpression],
  5989. boolean | void
  5990. >;
  5991. expressionLogicalOperator: SyncBailHook<
  5992. [LogicalExpression],
  5993. boolean | void
  5994. >;
  5995. program: SyncBailHook<[Program, Comment[]], boolean | void>;
  5996. terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
  5997. finish: SyncBailHook<[Program, Comment[]], boolean | void>;
  5998. }>;
  5999. sourceType: "module" | "auto" | "script";
  6000. scope: ScopeInfo;
  6001. state: ParserState;
  6002. comments?: Comment[];
  6003. semicolons?: Set<number>;
  6004. statementPath?: StatementPathItem[];
  6005. prevStatement?:
  6006. | ImportDeclarationJavascriptParser
  6007. | ExportNamedDeclarationJavascriptParser
  6008. | ExportAllDeclarationJavascriptParser
  6009. | ImportExpressionImport
  6010. | UnaryExpression
  6011. | ArrayExpression
  6012. | ArrowFunctionExpression
  6013. | AssignmentExpression
  6014. | AwaitExpression
  6015. | BinaryExpression
  6016. | SimpleCallExpression
  6017. | NewExpression
  6018. | ChainExpression
  6019. | ClassExpression
  6020. | ConditionalExpression
  6021. | FunctionExpression
  6022. | Identifier
  6023. | SimpleLiteral
  6024. | RegExpLiteral
  6025. | BigIntLiteral
  6026. | LogicalExpression
  6027. | MemberExpression
  6028. | MetaProperty
  6029. | ObjectExpression
  6030. | SequenceExpression
  6031. | TaggedTemplateExpression
  6032. | TemplateLiteral
  6033. | ThisExpression
  6034. | UpdateExpression
  6035. | YieldExpression
  6036. | FunctionDeclaration
  6037. | MaybeNamedFunctionDeclaration
  6038. | VariableDeclaration
  6039. | ClassDeclaration
  6040. | MaybeNamedClassDeclaration
  6041. | ExpressionStatement
  6042. | BlockStatement
  6043. | StaticBlock
  6044. | EmptyStatement
  6045. | DebuggerStatement
  6046. | WithStatement
  6047. | ReturnStatement
  6048. | LabeledStatement
  6049. | BreakStatement
  6050. | ContinueStatement
  6051. | IfStatement
  6052. | SwitchStatement
  6053. | ThrowStatement
  6054. | TryStatement
  6055. | WhileStatement
  6056. | DoWhileStatement
  6057. | ForStatement
  6058. | ForInStatement
  6059. | ForOfStatement
  6060. | ExportDefaultDeclaration;
  6061. destructuringAssignmentProperties?: WeakMap<
  6062. Expression,
  6063. Set<DestructuringAssignmentProperty>
  6064. >;
  6065. currentTagData?: TagData;
  6066. magicCommentContext: Context;
  6067. destructuringAssignmentPropertiesFor(
  6068. node: Expression
  6069. ): undefined | Set<DestructuringAssignmentProperty>;
  6070. getRenameIdentifier(
  6071. expr:
  6072. | ImportExpressionImport
  6073. | UnaryExpression
  6074. | ArrayExpression
  6075. | ArrowFunctionExpression
  6076. | AssignmentExpression
  6077. | AwaitExpression
  6078. | BinaryExpression
  6079. | SimpleCallExpression
  6080. | NewExpression
  6081. | ChainExpression
  6082. | ClassExpression
  6083. | ConditionalExpression
  6084. | FunctionExpression
  6085. | Identifier
  6086. | SimpleLiteral
  6087. | RegExpLiteral
  6088. | BigIntLiteral
  6089. | LogicalExpression
  6090. | MemberExpression
  6091. | MetaProperty
  6092. | ObjectExpression
  6093. | SequenceExpression
  6094. | TaggedTemplateExpression
  6095. | TemplateLiteral
  6096. | ThisExpression
  6097. | UpdateExpression
  6098. | YieldExpression
  6099. | SpreadElement
  6100. ): undefined | string | VariableInfo;
  6101. walkClass(
  6102. classy: ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6103. ): void;
  6104. /**
  6105. * Pre walking iterates the scope for variable declarations
  6106. */
  6107. preWalkStatements(
  6108. statements: (
  6109. | ImportDeclarationJavascriptParser
  6110. | ExportNamedDeclarationJavascriptParser
  6111. | ExportAllDeclarationJavascriptParser
  6112. | FunctionDeclaration
  6113. | VariableDeclaration
  6114. | ClassDeclaration
  6115. | ExpressionStatement
  6116. | BlockStatement
  6117. | StaticBlock
  6118. | EmptyStatement
  6119. | DebuggerStatement
  6120. | WithStatement
  6121. | ReturnStatement
  6122. | LabeledStatement
  6123. | BreakStatement
  6124. | ContinueStatement
  6125. | IfStatement
  6126. | SwitchStatement
  6127. | ThrowStatement
  6128. | TryStatement
  6129. | WhileStatement
  6130. | DoWhileStatement
  6131. | ForStatement
  6132. | ForInStatement
  6133. | ForOfStatement
  6134. | ExportDefaultDeclaration
  6135. )[]
  6136. ): void;
  6137. /**
  6138. * Block pre walking iterates the scope for block variable declarations
  6139. */
  6140. blockPreWalkStatements(
  6141. statements: (
  6142. | ImportDeclarationJavascriptParser
  6143. | ExportNamedDeclarationJavascriptParser
  6144. | ExportAllDeclarationJavascriptParser
  6145. | FunctionDeclaration
  6146. | VariableDeclaration
  6147. | ClassDeclaration
  6148. | ExpressionStatement
  6149. | BlockStatement
  6150. | StaticBlock
  6151. | EmptyStatement
  6152. | DebuggerStatement
  6153. | WithStatement
  6154. | ReturnStatement
  6155. | LabeledStatement
  6156. | BreakStatement
  6157. | ContinueStatement
  6158. | IfStatement
  6159. | SwitchStatement
  6160. | ThrowStatement
  6161. | TryStatement
  6162. | WhileStatement
  6163. | DoWhileStatement
  6164. | ForStatement
  6165. | ForInStatement
  6166. | ForOfStatement
  6167. | ExportDefaultDeclaration
  6168. )[]
  6169. ): void;
  6170. /**
  6171. * Walking iterates the statements and expressions and processes them
  6172. */
  6173. walkStatements(
  6174. statements: (
  6175. | ImportDeclarationJavascriptParser
  6176. | ExportNamedDeclarationJavascriptParser
  6177. | ExportAllDeclarationJavascriptParser
  6178. | FunctionDeclaration
  6179. | VariableDeclaration
  6180. | ClassDeclaration
  6181. | ExpressionStatement
  6182. | BlockStatement
  6183. | StaticBlock
  6184. | EmptyStatement
  6185. | DebuggerStatement
  6186. | WithStatement
  6187. | ReturnStatement
  6188. | LabeledStatement
  6189. | BreakStatement
  6190. | ContinueStatement
  6191. | IfStatement
  6192. | SwitchStatement
  6193. | ThrowStatement
  6194. | TryStatement
  6195. | WhileStatement
  6196. | DoWhileStatement
  6197. | ForStatement
  6198. | ForInStatement
  6199. | ForOfStatement
  6200. | ExportDefaultDeclaration
  6201. )[]
  6202. ): void;
  6203. /**
  6204. * Walking iterates the statements and expressions and processes them
  6205. */
  6206. preWalkStatement(
  6207. statement:
  6208. | ImportDeclarationJavascriptParser
  6209. | ExportNamedDeclarationJavascriptParser
  6210. | ExportAllDeclarationJavascriptParser
  6211. | FunctionDeclaration
  6212. | MaybeNamedFunctionDeclaration
  6213. | VariableDeclaration
  6214. | ClassDeclaration
  6215. | MaybeNamedClassDeclaration
  6216. | ExpressionStatement
  6217. | BlockStatement
  6218. | StaticBlock
  6219. | EmptyStatement
  6220. | DebuggerStatement
  6221. | WithStatement
  6222. | ReturnStatement
  6223. | LabeledStatement
  6224. | BreakStatement
  6225. | ContinueStatement
  6226. | IfStatement
  6227. | SwitchStatement
  6228. | ThrowStatement
  6229. | TryStatement
  6230. | WhileStatement
  6231. | DoWhileStatement
  6232. | ForStatement
  6233. | ForInStatement
  6234. | ForOfStatement
  6235. | ExportDefaultDeclaration
  6236. ): void;
  6237. blockPreWalkStatement(
  6238. statement:
  6239. | ImportDeclarationJavascriptParser
  6240. | ExportNamedDeclarationJavascriptParser
  6241. | ExportAllDeclarationJavascriptParser
  6242. | FunctionDeclaration
  6243. | MaybeNamedFunctionDeclaration
  6244. | VariableDeclaration
  6245. | ClassDeclaration
  6246. | MaybeNamedClassDeclaration
  6247. | ExpressionStatement
  6248. | BlockStatement
  6249. | StaticBlock
  6250. | EmptyStatement
  6251. | DebuggerStatement
  6252. | WithStatement
  6253. | ReturnStatement
  6254. | LabeledStatement
  6255. | BreakStatement
  6256. | ContinueStatement
  6257. | IfStatement
  6258. | SwitchStatement
  6259. | ThrowStatement
  6260. | TryStatement
  6261. | WhileStatement
  6262. | DoWhileStatement
  6263. | ForStatement
  6264. | ForInStatement
  6265. | ForOfStatement
  6266. | ExportDefaultDeclaration
  6267. ): void;
  6268. walkStatement(
  6269. statement:
  6270. | ImportDeclarationJavascriptParser
  6271. | ExportNamedDeclarationJavascriptParser
  6272. | ExportAllDeclarationJavascriptParser
  6273. | FunctionDeclaration
  6274. | MaybeNamedFunctionDeclaration
  6275. | VariableDeclaration
  6276. | ClassDeclaration
  6277. | MaybeNamedClassDeclaration
  6278. | ExpressionStatement
  6279. | BlockStatement
  6280. | StaticBlock
  6281. | EmptyStatement
  6282. | DebuggerStatement
  6283. | WithStatement
  6284. | ReturnStatement
  6285. | LabeledStatement
  6286. | BreakStatement
  6287. | ContinueStatement
  6288. | IfStatement
  6289. | SwitchStatement
  6290. | ThrowStatement
  6291. | TryStatement
  6292. | WhileStatement
  6293. | DoWhileStatement
  6294. | ForStatement
  6295. | ForInStatement
  6296. | ForOfStatement
  6297. | ExportDefaultDeclaration
  6298. ): void;
  6299. /**
  6300. * Walks a statements that is nested within a parent statement
  6301. * and can potentially be a non-block statement.
  6302. * This enforces the nested statement to never be in ASI position.
  6303. */
  6304. walkNestedStatement(statement: Statement): void;
  6305. preWalkBlockStatement(statement: BlockStatement): void;
  6306. walkBlockStatement(statement: BlockStatement): void;
  6307. walkExpressionStatement(statement: ExpressionStatement): void;
  6308. preWalkIfStatement(statement: IfStatement): void;
  6309. walkIfStatement(statement: IfStatement): void;
  6310. preWalkLabeledStatement(statement: LabeledStatement): void;
  6311. walkLabeledStatement(statement: LabeledStatement): void;
  6312. preWalkWithStatement(statement: WithStatement): void;
  6313. walkWithStatement(statement: WithStatement): void;
  6314. preWalkSwitchStatement(statement: SwitchStatement): void;
  6315. walkSwitchStatement(statement: SwitchStatement): void;
  6316. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  6317. walkReturnStatement(statement: ReturnStatement): void;
  6318. walkThrowStatement(statement: ThrowStatement): void;
  6319. preWalkTryStatement(statement: TryStatement): void;
  6320. walkTryStatement(statement: TryStatement): void;
  6321. preWalkWhileStatement(statement: WhileStatement): void;
  6322. walkWhileStatement(statement: WhileStatement): void;
  6323. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  6324. walkDoWhileStatement(statement: DoWhileStatement): void;
  6325. preWalkForStatement(statement: ForStatement): void;
  6326. walkForStatement(statement: ForStatement): void;
  6327. preWalkForInStatement(statement: ForInStatement): void;
  6328. walkForInStatement(statement: ForInStatement): void;
  6329. preWalkForOfStatement(statement: ForOfStatement): void;
  6330. walkForOfStatement(statement: ForOfStatement): void;
  6331. preWalkFunctionDeclaration(
  6332. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  6333. ): void;
  6334. walkFunctionDeclaration(
  6335. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  6336. ): void;
  6337. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  6338. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  6339. blockPreWalkImportDeclaration(
  6340. statement: ImportDeclarationJavascriptParser
  6341. ): void;
  6342. enterDeclaration(
  6343. declaration: Declaration,
  6344. onIdent: (ident: string, identifier: Identifier) => void
  6345. ): void;
  6346. blockPreWalkExportNamedDeclaration(
  6347. statement: ExportNamedDeclarationJavascriptParser
  6348. ): void;
  6349. walkExportNamedDeclaration(
  6350. statement: ExportNamedDeclarationJavascriptParser
  6351. ): void;
  6352. blockPreWalkExportDefaultDeclaration(
  6353. statement: ExportDefaultDeclaration
  6354. ): void;
  6355. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  6356. blockPreWalkExportAllDeclaration(
  6357. statement: ExportAllDeclarationJavascriptParser
  6358. ): void;
  6359. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  6360. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  6361. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  6362. walkVariableDeclaration(statement: VariableDeclaration): void;
  6363. blockPreWalkClassDeclaration(
  6364. statement: ClassDeclaration | MaybeNamedClassDeclaration
  6365. ): void;
  6366. walkClassDeclaration(
  6367. statement: ClassDeclaration | MaybeNamedClassDeclaration
  6368. ): void;
  6369. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  6370. walkSwitchCases(switchCases: SwitchCase[]): void;
  6371. preWalkCatchClause(catchClause: CatchClause): void;
  6372. walkCatchClause(catchClause: CatchClause): void;
  6373. walkPattern(pattern: Pattern): void;
  6374. walkAssignmentPattern(pattern: AssignmentPattern): void;
  6375. walkObjectPattern(pattern: ObjectPattern): void;
  6376. walkArrayPattern(pattern: ArrayPattern): void;
  6377. walkRestElement(pattern: RestElement): void;
  6378. walkExpressions(
  6379. expressions: (
  6380. | null
  6381. | ImportExpressionImport
  6382. | UnaryExpression
  6383. | ArrayExpression
  6384. | ArrowFunctionExpression
  6385. | AssignmentExpression
  6386. | AwaitExpression
  6387. | BinaryExpression
  6388. | SimpleCallExpression
  6389. | NewExpression
  6390. | ChainExpression
  6391. | ClassExpression
  6392. | ConditionalExpression
  6393. | FunctionExpression
  6394. | Identifier
  6395. | SimpleLiteral
  6396. | RegExpLiteral
  6397. | BigIntLiteral
  6398. | LogicalExpression
  6399. | MemberExpression
  6400. | MetaProperty
  6401. | ObjectExpression
  6402. | SequenceExpression
  6403. | TaggedTemplateExpression
  6404. | TemplateLiteral
  6405. | ThisExpression
  6406. | UpdateExpression
  6407. | YieldExpression
  6408. | SpreadElement
  6409. )[]
  6410. ): void;
  6411. walkExpression(
  6412. expression:
  6413. | ImportExpressionImport
  6414. | UnaryExpression
  6415. | ArrayExpression
  6416. | ArrowFunctionExpression
  6417. | AssignmentExpression
  6418. | AwaitExpression
  6419. | BinaryExpression
  6420. | SimpleCallExpression
  6421. | NewExpression
  6422. | ChainExpression
  6423. | ClassExpression
  6424. | ConditionalExpression
  6425. | FunctionExpression
  6426. | Identifier
  6427. | SimpleLiteral
  6428. | RegExpLiteral
  6429. | BigIntLiteral
  6430. | LogicalExpression
  6431. | MemberExpression
  6432. | MetaProperty
  6433. | ObjectExpression
  6434. | SequenceExpression
  6435. | TaggedTemplateExpression
  6436. | TemplateLiteral
  6437. | ThisExpression
  6438. | UpdateExpression
  6439. | YieldExpression
  6440. | SpreadElement
  6441. | PrivateIdentifier
  6442. | Super
  6443. ): void;
  6444. walkAwaitExpression(expression: AwaitExpression): void;
  6445. walkArrayExpression(expression: ArrayExpression): void;
  6446. walkSpreadElement(expression: SpreadElement): void;
  6447. walkObjectExpression(expression: ObjectExpression): void;
  6448. walkProperty(prop: SpreadElement | Property): void;
  6449. walkFunctionExpression(expression: FunctionExpression): void;
  6450. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  6451. walkSequenceExpression(expression: SequenceExpression): void;
  6452. walkUpdateExpression(expression: UpdateExpression): void;
  6453. walkUnaryExpression(expression: UnaryExpression): void;
  6454. walkLeftRightExpression(
  6455. expression: BinaryExpression | LogicalExpression
  6456. ): void;
  6457. walkBinaryExpression(expression: BinaryExpression): void;
  6458. walkLogicalExpression(expression: LogicalExpression): void;
  6459. walkAssignmentExpression(expression: AssignmentExpression): void;
  6460. walkConditionalExpression(expression: ConditionalExpression): void;
  6461. walkNewExpression(expression: NewExpression): void;
  6462. walkYieldExpression(expression: YieldExpression): void;
  6463. walkTemplateLiteral(expression: TemplateLiteral): void;
  6464. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  6465. walkClassExpression(expression: ClassExpression): void;
  6466. walkChainExpression(expression: ChainExpression): void;
  6467. walkImportExpression(expression: ImportExpressionJavascriptParser): void;
  6468. walkCallExpression(expression: CallExpression): void;
  6469. walkMemberExpression(expression: MemberExpression): void;
  6470. walkMemberExpressionWithExpressionName<R>(
  6471. expression: MemberExpression,
  6472. name: string,
  6473. rootInfo: string | VariableInfo,
  6474. members: string[],
  6475. onUnhandled: () => undefined | R
  6476. ): void;
  6477. walkThisExpression(expression: ThisExpression): void;
  6478. walkIdentifier(expression: Identifier): void;
  6479. walkMetaProperty(metaProperty: MetaProperty): void;
  6480. callHooksForExpression<T, R>(
  6481. hookMap: HookMap<SyncBailHook<T, R>>,
  6482. expr:
  6483. | ImportExpressionImport
  6484. | UnaryExpression
  6485. | ArrayExpression
  6486. | ArrowFunctionExpression
  6487. | AssignmentExpression
  6488. | AwaitExpression
  6489. | BinaryExpression
  6490. | SimpleCallExpression
  6491. | NewExpression
  6492. | ChainExpression
  6493. | ClassExpression
  6494. | ConditionalExpression
  6495. | FunctionExpression
  6496. | Identifier
  6497. | SimpleLiteral
  6498. | RegExpLiteral
  6499. | BigIntLiteral
  6500. | LogicalExpression
  6501. | MemberExpression
  6502. | MetaProperty
  6503. | ObjectExpression
  6504. | SequenceExpression
  6505. | TaggedTemplateExpression
  6506. | TemplateLiteral
  6507. | ThisExpression
  6508. | UpdateExpression
  6509. | YieldExpression
  6510. | Super,
  6511. ...args: AsArray<T>
  6512. ): undefined | R;
  6513. callHooksForExpressionWithFallback<T, R>(
  6514. hookMap: HookMap<SyncBailHook<T, R>>,
  6515. expr:
  6516. | ImportExpressionImport
  6517. | UnaryExpression
  6518. | ArrayExpression
  6519. | ArrowFunctionExpression
  6520. | AssignmentExpression
  6521. | AwaitExpression
  6522. | BinaryExpression
  6523. | SimpleCallExpression
  6524. | NewExpression
  6525. | ChainExpression
  6526. | ClassExpression
  6527. | ConditionalExpression
  6528. | FunctionExpression
  6529. | Identifier
  6530. | SimpleLiteral
  6531. | RegExpLiteral
  6532. | BigIntLiteral
  6533. | LogicalExpression
  6534. | MemberExpression
  6535. | MetaProperty
  6536. | ObjectExpression
  6537. | SequenceExpression
  6538. | TaggedTemplateExpression
  6539. | TemplateLiteral
  6540. | ThisExpression
  6541. | UpdateExpression
  6542. | YieldExpression
  6543. | Super,
  6544. fallback:
  6545. | undefined
  6546. | ((
  6547. name: string,
  6548. rootInfo: string | VariableInfo | ScopeInfo,
  6549. getMembers: () => string[]
  6550. ) => any),
  6551. defined: undefined | ((result?: string) => undefined | R),
  6552. ...args: AsArray<T>
  6553. ): undefined | R;
  6554. callHooksForName<T, R>(
  6555. hookMap: HookMap<SyncBailHook<T, R>>,
  6556. name: string,
  6557. ...args: AsArray<T>
  6558. ): undefined | R;
  6559. callHooksForInfo<T, R>(
  6560. hookMap: HookMap<SyncBailHook<T, R>>,
  6561. info: ExportedVariableInfo,
  6562. ...args: AsArray<T>
  6563. ): undefined | R;
  6564. callHooksForInfoWithFallback<T, R>(
  6565. hookMap: HookMap<SyncBailHook<T, R>>,
  6566. info: ExportedVariableInfo,
  6567. fallback: undefined | ((name: string) => any),
  6568. defined: undefined | ((result?: string) => any),
  6569. ...args: AsArray<T>
  6570. ): undefined | R;
  6571. callHooksForNameWithFallback<T, R>(
  6572. hookMap: HookMap<SyncBailHook<T, R>>,
  6573. name: string,
  6574. fallback: undefined | ((value: string) => undefined | R),
  6575. defined: undefined | (() => R),
  6576. ...args: AsArray<T>
  6577. ): undefined | R;
  6578. inScope(
  6579. params: (
  6580. | string
  6581. | Identifier
  6582. | MemberExpression
  6583. | ObjectPattern
  6584. | ArrayPattern
  6585. | RestElement
  6586. | AssignmentPattern
  6587. | Property
  6588. )[],
  6589. fn: () => void
  6590. ): void;
  6591. inClassScope(hasThis: boolean, params: Identifier[], fn: () => void): void;
  6592. inFunctionScope(
  6593. hasThis: boolean,
  6594. params: (
  6595. | string
  6596. | Identifier
  6597. | MemberExpression
  6598. | ObjectPattern
  6599. | ArrayPattern
  6600. | RestElement
  6601. | AssignmentPattern
  6602. )[],
  6603. fn: () => void
  6604. ): void;
  6605. inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
  6606. detectMode(
  6607. statements: (
  6608. | ImportDeclarationJavascriptParser
  6609. | ExportNamedDeclarationJavascriptParser
  6610. | ExportAllDeclarationJavascriptParser
  6611. | FunctionDeclaration
  6612. | VariableDeclaration
  6613. | ClassDeclaration
  6614. | ExpressionStatement
  6615. | BlockStatement
  6616. | StaticBlock
  6617. | EmptyStatement
  6618. | DebuggerStatement
  6619. | WithStatement
  6620. | ReturnStatement
  6621. | LabeledStatement
  6622. | BreakStatement
  6623. | ContinueStatement
  6624. | IfStatement
  6625. | SwitchStatement
  6626. | ThrowStatement
  6627. | TryStatement
  6628. | WhileStatement
  6629. | DoWhileStatement
  6630. | ForStatement
  6631. | ForInStatement
  6632. | ForOfStatement
  6633. | ExportDefaultDeclaration
  6634. | Directive
  6635. )[]
  6636. ): void;
  6637. enterPatterns(
  6638. patterns: (
  6639. | string
  6640. | Identifier
  6641. | MemberExpression
  6642. | ObjectPattern
  6643. | ArrayPattern
  6644. | RestElement
  6645. | AssignmentPattern
  6646. | Property
  6647. )[],
  6648. onIdent: (ident: string) => void
  6649. ): void;
  6650. enterPattern(
  6651. pattern:
  6652. | Identifier
  6653. | MemberExpression
  6654. | ObjectPattern
  6655. | ArrayPattern
  6656. | RestElement
  6657. | AssignmentPattern
  6658. | Property,
  6659. onIdent: (ident: string, identifier: Identifier) => void
  6660. ): void;
  6661. enterIdentifier(
  6662. pattern: Identifier,
  6663. onIdent: (ident: string, identifier: Identifier) => void
  6664. ): void;
  6665. enterObjectPattern(
  6666. pattern: ObjectPattern,
  6667. onIdent: (ident: string, identifier: Identifier) => void
  6668. ): void;
  6669. enterArrayPattern(
  6670. pattern: ArrayPattern,
  6671. onIdent: (ident: string, identifier: Identifier) => void
  6672. ): void;
  6673. enterRestElement(
  6674. pattern: RestElement,
  6675. onIdent: (ident: string, identifier: Identifier) => void
  6676. ): void;
  6677. enterAssignmentPattern(
  6678. pattern: AssignmentPattern,
  6679. onIdent: (ident: string, identifier: Identifier) => void
  6680. ): void;
  6681. evaluateExpression(
  6682. expression:
  6683. | ImportExpressionImport
  6684. | UnaryExpression
  6685. | ArrayExpression
  6686. | ArrowFunctionExpression
  6687. | AssignmentExpression
  6688. | AwaitExpression
  6689. | BinaryExpression
  6690. | SimpleCallExpression
  6691. | NewExpression
  6692. | ChainExpression
  6693. | ClassExpression
  6694. | ConditionalExpression
  6695. | FunctionExpression
  6696. | Identifier
  6697. | SimpleLiteral
  6698. | RegExpLiteral
  6699. | BigIntLiteral
  6700. | LogicalExpression
  6701. | MemberExpression
  6702. | MetaProperty
  6703. | ObjectExpression
  6704. | SequenceExpression
  6705. | TaggedTemplateExpression
  6706. | TemplateLiteral
  6707. | ThisExpression
  6708. | UpdateExpression
  6709. | YieldExpression
  6710. | SpreadElement
  6711. | PrivateIdentifier
  6712. | Super
  6713. ): BasicEvaluatedExpression;
  6714. parseString(expression: Expression): string;
  6715. parseCalculatedString(expression: Expression): {
  6716. range?: [number, number];
  6717. value: string;
  6718. code: boolean;
  6719. conditional: any;
  6720. };
  6721. evaluate(source: string): BasicEvaluatedExpression;
  6722. isPure(
  6723. expr:
  6724. | undefined
  6725. | null
  6726. | ImportExpressionImport
  6727. | UnaryExpression
  6728. | ArrayExpression
  6729. | ArrowFunctionExpression
  6730. | AssignmentExpression
  6731. | AwaitExpression
  6732. | BinaryExpression
  6733. | SimpleCallExpression
  6734. | NewExpression
  6735. | ChainExpression
  6736. | ClassExpression
  6737. | ConditionalExpression
  6738. | FunctionExpression
  6739. | Identifier
  6740. | SimpleLiteral
  6741. | RegExpLiteral
  6742. | BigIntLiteral
  6743. | LogicalExpression
  6744. | MemberExpression
  6745. | MetaProperty
  6746. | ObjectExpression
  6747. | SequenceExpression
  6748. | TaggedTemplateExpression
  6749. | TemplateLiteral
  6750. | ThisExpression
  6751. | UpdateExpression
  6752. | YieldExpression
  6753. | PrivateIdentifier
  6754. | FunctionDeclaration
  6755. | MaybeNamedFunctionDeclaration
  6756. | VariableDeclaration
  6757. | ClassDeclaration
  6758. | MaybeNamedClassDeclaration,
  6759. commentsStartPos: number
  6760. ): boolean;
  6761. getComments(range: [number, number]): Comment[];
  6762. isAsiPosition(pos: number): boolean;
  6763. setAsiPosition(pos: number): void;
  6764. unsetAsiPosition(pos: number): void;
  6765. isStatementLevelExpression(expr: Expression): boolean;
  6766. getTagData(name: string, tag: symbol): undefined | TagData;
  6767. tagVariable(name: string, tag: symbol, data?: TagData): void;
  6768. defineVariable(name: string): void;
  6769. undefineVariable(name: string): void;
  6770. isVariableDefined(name: string): boolean;
  6771. getVariableInfo(name: string): ExportedVariableInfo;
  6772. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  6773. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  6774. parseCommentOptions(range: [number, number]): {
  6775. options: null | Record<string, any>;
  6776. errors: null | (Error & { comment: Comment })[];
  6777. };
  6778. extractMemberExpressionChain(
  6779. expression:
  6780. | ImportExpressionImport
  6781. | UnaryExpression
  6782. | ArrayExpression
  6783. | ArrowFunctionExpression
  6784. | AssignmentExpression
  6785. | AwaitExpression
  6786. | BinaryExpression
  6787. | SimpleCallExpression
  6788. | NewExpression
  6789. | ChainExpression
  6790. | ClassExpression
  6791. | ConditionalExpression
  6792. | FunctionExpression
  6793. | Identifier
  6794. | SimpleLiteral
  6795. | RegExpLiteral
  6796. | BigIntLiteral
  6797. | LogicalExpression
  6798. | MemberExpression
  6799. | MetaProperty
  6800. | ObjectExpression
  6801. | SequenceExpression
  6802. | TaggedTemplateExpression
  6803. | TemplateLiteral
  6804. | ThisExpression
  6805. | UpdateExpression
  6806. | YieldExpression
  6807. | Super
  6808. ): {
  6809. members: string[];
  6810. object:
  6811. | ImportExpressionImport
  6812. | UnaryExpression
  6813. | ArrayExpression
  6814. | ArrowFunctionExpression
  6815. | AssignmentExpression
  6816. | AwaitExpression
  6817. | BinaryExpression
  6818. | SimpleCallExpression
  6819. | NewExpression
  6820. | ChainExpression
  6821. | ClassExpression
  6822. | ConditionalExpression
  6823. | FunctionExpression
  6824. | Identifier
  6825. | SimpleLiteral
  6826. | RegExpLiteral
  6827. | BigIntLiteral
  6828. | LogicalExpression
  6829. | MemberExpression
  6830. | MetaProperty
  6831. | ObjectExpression
  6832. | SequenceExpression
  6833. | TaggedTemplateExpression
  6834. | TemplateLiteral
  6835. | ThisExpression
  6836. | UpdateExpression
  6837. | YieldExpression
  6838. | Super;
  6839. membersOptionals: boolean[];
  6840. memberRanges: [number, number][];
  6841. };
  6842. getFreeInfoFromVariable(
  6843. varName: string
  6844. ): undefined | { name: string; info: string | VariableInfo };
  6845. getMemberExpressionInfo(
  6846. expression:
  6847. | ImportExpressionImport
  6848. | UnaryExpression
  6849. | ArrayExpression
  6850. | ArrowFunctionExpression
  6851. | AssignmentExpression
  6852. | AwaitExpression
  6853. | BinaryExpression
  6854. | SimpleCallExpression
  6855. | NewExpression
  6856. | ChainExpression
  6857. | ClassExpression
  6858. | ConditionalExpression
  6859. | FunctionExpression
  6860. | Identifier
  6861. | SimpleLiteral
  6862. | RegExpLiteral
  6863. | BigIntLiteral
  6864. | LogicalExpression
  6865. | MemberExpression
  6866. | MetaProperty
  6867. | ObjectExpression
  6868. | SequenceExpression
  6869. | TaggedTemplateExpression
  6870. | TemplateLiteral
  6871. | ThisExpression
  6872. | UpdateExpression
  6873. | YieldExpression
  6874. | Super,
  6875. allowedTypes: number
  6876. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  6877. getNameForExpression(
  6878. expression: MemberExpression
  6879. ):
  6880. | undefined
  6881. | {
  6882. name: string;
  6883. rootInfo: ExportedVariableInfo;
  6884. getMembers: () => string[];
  6885. };
  6886. static ALLOWED_MEMBER_TYPES_ALL: 3;
  6887. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  6888. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  6889. static getImportAttributes: (
  6890. node:
  6891. | ImportDeclarationJavascriptParser
  6892. | ExportNamedDeclarationJavascriptParser
  6893. | ExportAllDeclarationJavascriptParser
  6894. | ImportExpressionJavascriptParser
  6895. ) => undefined | ImportAttributes;
  6896. static VariableInfo: typeof VariableInfo;
  6897. }
  6898. /**
  6899. * Parser options for javascript modules.
  6900. */
  6901. declare interface JavascriptParserOptions {
  6902. [index: string]: any;
  6903. /**
  6904. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  6905. */
  6906. amd?: false | { [index: string]: any };
  6907. /**
  6908. * Enable/disable special handling for browserify bundles.
  6909. */
  6910. browserify?: boolean;
  6911. /**
  6912. * Enable/disable parsing of CommonJs syntax.
  6913. */
  6914. commonjs?: boolean;
  6915. /**
  6916. * Enable/disable parsing of magic comments in CommonJs syntax.
  6917. */
  6918. commonjsMagicComments?: boolean;
  6919. /**
  6920. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  6921. */
  6922. createRequire?: string | boolean;
  6923. /**
  6924. * Specifies global fetchPriority for dynamic import.
  6925. */
  6926. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  6927. /**
  6928. * Specifies global mode for dynamic import.
  6929. */
  6930. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  6931. /**
  6932. * Specifies global prefetch for dynamic import.
  6933. */
  6934. dynamicImportPrefetch?: number | boolean;
  6935. /**
  6936. * Specifies global preload for dynamic import.
  6937. */
  6938. dynamicImportPreload?: number | boolean;
  6939. /**
  6940. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  6941. */
  6942. exportsPresence?: false | "auto" | "error" | "warn";
  6943. /**
  6944. * Enable warnings for full dynamic dependencies.
  6945. */
  6946. exprContextCritical?: boolean;
  6947. /**
  6948. * Enable recursive directory lookup for full dynamic dependencies.
  6949. */
  6950. exprContextRecursive?: boolean;
  6951. /**
  6952. * Sets the default regular expression for full dynamic dependencies.
  6953. */
  6954. exprContextRegExp?: boolean | RegExp;
  6955. /**
  6956. * Set the default request for full dynamic dependencies.
  6957. */
  6958. exprContextRequest?: string;
  6959. /**
  6960. * Enable/disable parsing of EcmaScript Modules syntax.
  6961. */
  6962. harmony?: boolean;
  6963. /**
  6964. * Enable/disable parsing of import() syntax.
  6965. */
  6966. import?: boolean;
  6967. /**
  6968. * Specifies the behavior of invalid export names in "import ... from ...".
  6969. */
  6970. importExportsPresence?: false | "auto" | "error" | "warn";
  6971. /**
  6972. * Enable/disable evaluating import.meta.
  6973. */
  6974. importMeta?: boolean;
  6975. /**
  6976. * Enable/disable evaluating import.meta.webpackContext.
  6977. */
  6978. importMetaContext?: boolean;
  6979. /**
  6980. * Include polyfills or mocks for various node stuff.
  6981. */
  6982. node?: false | NodeOptions;
  6983. /**
  6984. * 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.
  6985. */
  6986. overrideStrict?: "strict" | "non-strict";
  6987. /**
  6988. * 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.
  6989. */
  6990. reexportExportsPresence?: false | "auto" | "error" | "warn";
  6991. /**
  6992. * Enable/disable parsing of require.context syntax.
  6993. */
  6994. requireContext?: boolean;
  6995. /**
  6996. * Enable/disable parsing of require.ensure syntax.
  6997. */
  6998. requireEnsure?: boolean;
  6999. /**
  7000. * Enable/disable parsing of require.include syntax.
  7001. */
  7002. requireInclude?: boolean;
  7003. /**
  7004. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  7005. */
  7006. requireJs?: boolean;
  7007. /**
  7008. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  7009. */
  7010. strictExportPresence?: boolean;
  7011. /**
  7012. * Handle the this context correctly according to the spec for namespace objects.
  7013. */
  7014. strictThisContextOnImports?: boolean;
  7015. /**
  7016. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  7017. */
  7018. system?: boolean;
  7019. /**
  7020. * Enable warnings when using the require function in a not statically analyse-able way.
  7021. */
  7022. unknownContextCritical?: boolean;
  7023. /**
  7024. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  7025. */
  7026. unknownContextRecursive?: boolean;
  7027. /**
  7028. * Sets the regular expression when using the require function in a not statically analyse-able way.
  7029. */
  7030. unknownContextRegExp?: boolean | RegExp;
  7031. /**
  7032. * Sets the request when using the require function in a not statically analyse-able way.
  7033. */
  7034. unknownContextRequest?: string;
  7035. /**
  7036. * Enable/disable parsing of new URL() syntax.
  7037. */
  7038. url?: boolean | "relative";
  7039. /**
  7040. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  7041. */
  7042. worker?: boolean | string[];
  7043. /**
  7044. * Enable warnings for partial dynamic dependencies.
  7045. */
  7046. wrappedContextCritical?: boolean;
  7047. /**
  7048. * Enable recursive directory lookup for partial dynamic dependencies.
  7049. */
  7050. wrappedContextRecursive?: boolean;
  7051. /**
  7052. * Set the inner regular expression for partial dynamic dependencies.
  7053. */
  7054. wrappedContextRegExp?: RegExp;
  7055. }
  7056. /**
  7057. * Generator options for json modules.
  7058. */
  7059. declare interface JsonGeneratorOptions {
  7060. /**
  7061. * Use `JSON.parse` when the JSON string is longer than 20 characters.
  7062. */
  7063. JSONParse?: boolean;
  7064. }
  7065. type JsonObjectFs = { [index: string]: JsonValueFs } & {
  7066. [index: string]:
  7067. | undefined
  7068. | null
  7069. | string
  7070. | number
  7071. | boolean
  7072. | JsonObjectFs
  7073. | JsonValueFs[];
  7074. };
  7075. type JsonObjectTypes = { [index: string]: JsonValueTypes } & {
  7076. [index: string]:
  7077. | undefined
  7078. | null
  7079. | string
  7080. | number
  7081. | boolean
  7082. | JsonObjectTypes
  7083. | JsonValueTypes[];
  7084. };
  7085. type JsonValueFs =
  7086. | null
  7087. | string
  7088. | number
  7089. | boolean
  7090. | JsonObjectFs
  7091. | JsonValueFs[];
  7092. type JsonValueTypes =
  7093. | null
  7094. | string
  7095. | number
  7096. | boolean
  7097. | JsonObjectTypes
  7098. | JsonValueTypes[];
  7099. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  7100. constructor(runtimeRequirements: ReadonlySet<string>);
  7101. static getCompilationHooks(
  7102. compilation: Compilation
  7103. ): JsonpCompilationPluginHooks;
  7104. /**
  7105. * Runtime modules without any dependencies to other runtime modules
  7106. */
  7107. static STAGE_NORMAL: number;
  7108. /**
  7109. * Runtime modules with simple dependencies on other runtime modules
  7110. */
  7111. static STAGE_BASIC: number;
  7112. /**
  7113. * Runtime modules which attach to handlers of other runtime modules
  7114. */
  7115. static STAGE_ATTACH: number;
  7116. /**
  7117. * Runtime modules which trigger actions on bootstrap
  7118. */
  7119. static STAGE_TRIGGER: number;
  7120. }
  7121. declare interface JsonpCompilationPluginHooks {
  7122. linkPreload: SyncWaterfallHook<[string, Chunk]>;
  7123. linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
  7124. }
  7125. declare class JsonpTemplatePlugin {
  7126. constructor();
  7127. /**
  7128. * Apply the plugin
  7129. */
  7130. apply(compiler: Compiler): void;
  7131. static getCompilationHooks(
  7132. compilation: Compilation
  7133. ): JsonpCompilationPluginHooks;
  7134. }
  7135. declare interface KnownAssetInfo {
  7136. /**
  7137. * true, if the asset can be long term cached forever (contains a hash)
  7138. */
  7139. immutable?: boolean;
  7140. /**
  7141. * whether the asset is minimized
  7142. */
  7143. minimized?: boolean;
  7144. /**
  7145. * the value(s) of the full hash used for this asset
  7146. */
  7147. fullhash?: string | string[];
  7148. /**
  7149. * the value(s) of the chunk hash used for this asset
  7150. */
  7151. chunkhash?: string | string[];
  7152. /**
  7153. * the value(s) of the module hash used for this asset
  7154. */
  7155. modulehash?: string | string[];
  7156. /**
  7157. * the value(s) of the content hash used for this asset
  7158. */
  7159. contenthash?: string | string[];
  7160. /**
  7161. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  7162. */
  7163. sourceFilename?: string;
  7164. /**
  7165. * size in bytes, only set after asset has been emitted
  7166. */
  7167. size?: number;
  7168. /**
  7169. * true, when asset is only used for development and doesn't count towards user-facing assets
  7170. */
  7171. development?: boolean;
  7172. /**
  7173. * true, when asset ships data for updating an existing application (HMR)
  7174. */
  7175. hotModuleReplacement?: boolean;
  7176. /**
  7177. * true, when asset is javascript and an ESM
  7178. */
  7179. javascriptModule?: boolean;
  7180. /**
  7181. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  7182. */
  7183. related?: Record<string, string | string[]>;
  7184. }
  7185. declare interface KnownBuildInfo {
  7186. cacheable?: boolean;
  7187. parsed?: boolean;
  7188. moduleArgument?: string;
  7189. exportsArgument?: string;
  7190. strict?: boolean;
  7191. moduleConcatenationBailout?: string;
  7192. fileDependencies?: LazySet<string>;
  7193. contextDependencies?: LazySet<string>;
  7194. missingDependencies?: LazySet<string>;
  7195. buildDependencies?: LazySet<string>;
  7196. valueDependencies?: Map<string, string | Set<string>>;
  7197. hash?: any;
  7198. assets?: Record<string, Source>;
  7199. assetsInfo?: Map<string, undefined | AssetInfo>;
  7200. snapshot?: null | Snapshot;
  7201. }
  7202. declare interface KnownBuildMeta {
  7203. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  7204. defaultObject?: false | "redirect" | "redirect-warn";
  7205. strictHarmonyModule?: boolean;
  7206. async?: boolean;
  7207. sideEffectFree?: boolean;
  7208. exportsFinalName?: Record<string, string>;
  7209. isCSSModule?: boolean;
  7210. }
  7211. declare interface KnownCreateStatsOptionsContext {
  7212. forToString?: boolean;
  7213. }
  7214. declare interface KnownHooks {
  7215. resolveStep: SyncHook<
  7216. [
  7217. AsyncSeriesBailHook<
  7218. [ResolveRequest, ResolveContext],
  7219. null | ResolveRequest
  7220. >,
  7221. ResolveRequest
  7222. ]
  7223. >;
  7224. noResolve: SyncHook<[ResolveRequest, Error]>;
  7225. resolve: AsyncSeriesBailHook<
  7226. [ResolveRequest, ResolveContext],
  7227. null | ResolveRequest
  7228. >;
  7229. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  7230. }
  7231. declare interface KnownNormalizedStatsOptions {
  7232. context: string;
  7233. requestShortener: RequestShortener;
  7234. chunksSort: string | false;
  7235. modulesSort: string | false;
  7236. chunkModulesSort: string | false;
  7237. nestedModulesSort: string | false;
  7238. assetsSort: string | false;
  7239. ids: boolean;
  7240. cachedAssets: boolean;
  7241. groupAssetsByEmitStatus: boolean;
  7242. groupAssetsByPath: boolean;
  7243. groupAssetsByExtension: boolean;
  7244. assetsSpace: number;
  7245. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  7246. excludeModules: ((
  7247. name: string,
  7248. module: StatsModule,
  7249. type: "module" | "chunk" | "root-of-chunk" | "nested"
  7250. ) => boolean)[];
  7251. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  7252. cachedModules: boolean;
  7253. orphanModules: boolean;
  7254. dependentModules: boolean;
  7255. runtimeModules: boolean;
  7256. groupModulesByCacheStatus: boolean;
  7257. groupModulesByLayer: boolean;
  7258. groupModulesByAttributes: boolean;
  7259. groupModulesByPath: boolean;
  7260. groupModulesByExtension: boolean;
  7261. groupModulesByType: boolean;
  7262. entrypoints: boolean | "auto";
  7263. chunkGroups: boolean;
  7264. chunkGroupAuxiliary: boolean;
  7265. chunkGroupChildren: boolean;
  7266. chunkGroupMaxAssets: number;
  7267. modulesSpace: number;
  7268. chunkModulesSpace: number;
  7269. nestedModulesSpace: number;
  7270. logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
  7271. loggingDebug: ((value: string) => boolean)[];
  7272. loggingTrace: boolean;
  7273. }
  7274. declare interface KnownStatsAsset {
  7275. type: string;
  7276. name: string;
  7277. info: AssetInfo;
  7278. size: number;
  7279. emitted: boolean;
  7280. comparedForEmit: boolean;
  7281. cached: boolean;
  7282. related?: StatsAsset[];
  7283. chunkNames?: (string | number)[];
  7284. chunkIdHints?: (string | number)[];
  7285. chunks?: (string | number)[];
  7286. auxiliaryChunkNames?: (string | number)[];
  7287. auxiliaryChunks?: (string | number)[];
  7288. auxiliaryChunkIdHints?: (string | number)[];
  7289. filteredRelated?: number;
  7290. isOverSizeLimit?: boolean;
  7291. }
  7292. declare interface KnownStatsChunk {
  7293. rendered: boolean;
  7294. initial: boolean;
  7295. entry: boolean;
  7296. recorded: boolean;
  7297. reason?: string;
  7298. size: number;
  7299. sizes: Record<string, number>;
  7300. names: string[];
  7301. idHints: string[];
  7302. runtime?: string[];
  7303. files: string[];
  7304. auxiliaryFiles: string[];
  7305. hash: string;
  7306. childrenByOrder: Record<string, (string | number)[]>;
  7307. id?: string | number;
  7308. siblings?: (string | number)[];
  7309. parents?: (string | number)[];
  7310. children?: (string | number)[];
  7311. modules?: StatsModule[];
  7312. filteredModules?: number;
  7313. origins?: StatsChunkOrigin[];
  7314. }
  7315. declare interface KnownStatsChunkGroup {
  7316. name?: null | string;
  7317. chunks?: (string | number)[];
  7318. assets?: { name: string; size?: number }[];
  7319. filteredAssets?: number;
  7320. assetsSize?: number;
  7321. auxiliaryAssets?: { name: string; size?: number }[];
  7322. filteredAuxiliaryAssets?: number;
  7323. auxiliaryAssetsSize?: number;
  7324. children?: { [index: string]: StatsChunkGroup[] };
  7325. childAssets?: { [index: string]: string[] };
  7326. isOverSizeLimit?: boolean;
  7327. }
  7328. declare interface KnownStatsChunkOrigin {
  7329. module: string;
  7330. moduleIdentifier: string;
  7331. moduleName: string;
  7332. loc: string;
  7333. request: string;
  7334. moduleId?: string | number;
  7335. }
  7336. declare interface KnownStatsCompilation {
  7337. env?: any;
  7338. name?: string;
  7339. hash?: string;
  7340. version?: string;
  7341. time?: number;
  7342. builtAt?: number;
  7343. needAdditionalPass?: boolean;
  7344. publicPath?: string;
  7345. outputPath?: string;
  7346. assetsByChunkName?: Record<string, string[]>;
  7347. assets?: StatsAsset[];
  7348. filteredAssets?: number;
  7349. chunks?: StatsChunk[];
  7350. modules?: StatsModule[];
  7351. filteredModules?: number;
  7352. entrypoints?: Record<string, StatsChunkGroup>;
  7353. namedChunkGroups?: Record<string, StatsChunkGroup>;
  7354. errors?: StatsError[];
  7355. errorsCount?: number;
  7356. warnings?: StatsError[];
  7357. warningsCount?: number;
  7358. children?: StatsCompilation[];
  7359. logging?: Record<string, StatsLogging>;
  7360. }
  7361. declare interface KnownStatsError {
  7362. message: string;
  7363. chunkName?: string;
  7364. chunkEntry?: boolean;
  7365. chunkInitial?: boolean;
  7366. file?: string;
  7367. moduleIdentifier?: string;
  7368. moduleName?: string;
  7369. loc?: string;
  7370. chunkId?: string | number;
  7371. moduleId?: string | number;
  7372. moduleTrace?: StatsModuleTraceItem[];
  7373. details?: string;
  7374. stack?: string;
  7375. compilerPath?: string;
  7376. }
  7377. declare interface KnownStatsFactoryContext {
  7378. type: string;
  7379. makePathsRelative: (path: string) => string;
  7380. compilation: Compilation;
  7381. rootModules: Set<Module>;
  7382. compilationFileToChunks: Map<string, Chunk[]>;
  7383. compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
  7384. runtime: RuntimeSpec;
  7385. cachedGetErrors: (compilation: Compilation) => WebpackError[];
  7386. cachedGetWarnings: (compilation: Compilation) => WebpackError[];
  7387. }
  7388. declare interface KnownStatsLogging {
  7389. entries: StatsLoggingEntry[];
  7390. filteredEntries: number;
  7391. debug: boolean;
  7392. }
  7393. declare interface KnownStatsLoggingEntry {
  7394. type: string;
  7395. message?: string;
  7396. trace?: string[];
  7397. children?: StatsLoggingEntry[];
  7398. args?: any[];
  7399. time?: number;
  7400. }
  7401. declare interface KnownStatsModule {
  7402. type?: string;
  7403. moduleType?: string;
  7404. layer?: null | string;
  7405. identifier?: string;
  7406. name?: string;
  7407. nameForCondition?: null | string;
  7408. index?: number;
  7409. preOrderIndex?: number;
  7410. index2?: number;
  7411. postOrderIndex?: number;
  7412. size?: number;
  7413. sizes?: { [index: string]: number };
  7414. cacheable?: boolean;
  7415. built?: boolean;
  7416. codeGenerated?: boolean;
  7417. buildTimeExecuted?: boolean;
  7418. cached?: boolean;
  7419. optional?: boolean;
  7420. orphan?: boolean;
  7421. id?: string | number;
  7422. issuerId?: null | string | number;
  7423. chunks?: (string | number)[];
  7424. assets?: (string | number)[];
  7425. dependent?: boolean;
  7426. issuer?: null | string;
  7427. issuerName?: null | string;
  7428. issuerPath?: StatsModuleIssuer[];
  7429. failed?: boolean;
  7430. errors?: number;
  7431. warnings?: number;
  7432. profile?: StatsProfile;
  7433. reasons?: StatsModuleReason[];
  7434. usedExports?: null | boolean | string[];
  7435. providedExports?: null | string[];
  7436. optimizationBailout?: string[];
  7437. depth?: null | number;
  7438. modules?: StatsModule[];
  7439. filteredModules?: number;
  7440. source?: string | Buffer;
  7441. }
  7442. declare interface KnownStatsModuleIssuer {
  7443. identifier: string;
  7444. name: string;
  7445. id?: string | number;
  7446. profile: StatsProfile;
  7447. }
  7448. declare interface KnownStatsModuleReason {
  7449. moduleIdentifier: null | string;
  7450. module: null | string;
  7451. moduleName: null | string;
  7452. resolvedModuleIdentifier: null | string;
  7453. resolvedModule: null | string;
  7454. type: null | string;
  7455. active: boolean;
  7456. explanation: null | string;
  7457. userRequest: null | string;
  7458. loc?: null | string;
  7459. moduleId?: null | string | number;
  7460. resolvedModuleId?: null | string | number;
  7461. }
  7462. declare interface KnownStatsModuleTraceDependency {
  7463. loc?: string;
  7464. }
  7465. declare interface KnownStatsModuleTraceItem {
  7466. originIdentifier?: string;
  7467. originName?: string;
  7468. moduleIdentifier?: string;
  7469. moduleName?: string;
  7470. dependencies?: StatsModuleTraceDependency[];
  7471. originId?: string | number;
  7472. moduleId?: string | number;
  7473. }
  7474. declare interface KnownStatsPrinterColorFn {
  7475. bold?: (str: string) => string;
  7476. yellow?: (str: string) => string;
  7477. red?: (str: string) => string;
  7478. green?: (str: string) => string;
  7479. magenta?: (str: string) => string;
  7480. cyan?: (str: string) => string;
  7481. }
  7482. declare interface KnownStatsPrinterContext {
  7483. type?: string;
  7484. compilation?: StatsCompilation;
  7485. chunkGroup?: StatsChunkGroup;
  7486. chunkGroupKind?: string;
  7487. asset?: StatsAsset;
  7488. module?: StatsModule;
  7489. chunk?: StatsChunk;
  7490. moduleReason?: StatsModuleReason;
  7491. moduleIssuer?: StatsModuleIssuer;
  7492. error?: StatsError;
  7493. profile?: StatsProfile;
  7494. logging?: StatsLogging;
  7495. moduleTraceItem?: StatsModuleTraceItem;
  7496. moduleTraceDependency?: StatsModuleTraceDependency;
  7497. }
  7498. declare interface KnownStatsPrinterFormatters {
  7499. formatFilename?: (file: string, oversize?: boolean) => string;
  7500. formatModuleId?: (id: string | number) => string;
  7501. formatChunkId?: (
  7502. id: string | number,
  7503. direction?: "parent" | "child" | "sibling"
  7504. ) => string;
  7505. formatSize?: (size: number) => string;
  7506. formatLayer?: (size: string) => string;
  7507. formatDateTime?: (dateTime: number) => string;
  7508. formatFlag?: (flag: string) => string;
  7509. formatTime?: (time: number, boldQuantity?: boolean) => string;
  7510. formatError?: (message: string) => string;
  7511. }
  7512. declare interface KnownStatsProfile {
  7513. total: number;
  7514. resolving: number;
  7515. restoring: number;
  7516. building: number;
  7517. integration: number;
  7518. storing: number;
  7519. additionalResolving: number;
  7520. additionalIntegration: number;
  7521. factory: number;
  7522. dependencies: number;
  7523. }
  7524. declare interface KnownUnsafeCacheData {
  7525. /**
  7526. * factory meta
  7527. */
  7528. factoryMeta?: FactoryMeta;
  7529. /**
  7530. * resolve options
  7531. */
  7532. resolveOptions?: ResolveOptions;
  7533. parserOptions?: ParserOptions;
  7534. generatorOptions?: GeneratorOptions;
  7535. }
  7536. declare interface LStatFs {
  7537. (
  7538. path: PathLikeFs,
  7539. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  7540. ): void;
  7541. (
  7542. path: PathLikeFs,
  7543. options: undefined | (StatOptions & { bigint?: false }),
  7544. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  7545. ): void;
  7546. (
  7547. path: PathLikeFs,
  7548. options: StatOptions & { bigint: true },
  7549. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  7550. ): void;
  7551. (
  7552. path: PathLikeFs,
  7553. options: undefined | StatOptions,
  7554. callback: (
  7555. err: null | NodeJS.ErrnoException,
  7556. result?: IStats | IBigIntStats
  7557. ) => void
  7558. ): void;
  7559. }
  7560. declare interface LStatSync {
  7561. (path: PathLikeFs, options?: undefined): IStats;
  7562. (
  7563. path: PathLikeFs,
  7564. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  7565. ): undefined | IStats;
  7566. (
  7567. path: PathLikeFs,
  7568. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  7569. ): undefined | IBigIntStats;
  7570. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  7571. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  7572. (
  7573. path: PathLikeFs,
  7574. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  7575. ): IStats | IBigIntStats;
  7576. (
  7577. path: PathLikeFs,
  7578. options?: StatSyncOptions
  7579. ): undefined | IStats | IBigIntStats;
  7580. }
  7581. declare interface LStatTypes {
  7582. (
  7583. path: PathLikeTypes,
  7584. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7585. ): void;
  7586. (
  7587. path: PathLikeTypes,
  7588. options: undefined | (StatOptions & { bigint?: false }),
  7589. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  7590. ): void;
  7591. (
  7592. path: PathLikeTypes,
  7593. options: StatOptions & { bigint: true },
  7594. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  7595. ): void;
  7596. (
  7597. path: PathLikeTypes,
  7598. options: undefined | StatOptions,
  7599. callback: (
  7600. arg0: null | NodeJS.ErrnoException,
  7601. arg1?: IStats | IBigIntStats
  7602. ) => void
  7603. ): void;
  7604. }
  7605. /**
  7606. * Options for the default backend.
  7607. */
  7608. declare interface LazyCompilationDefaultBackendOptions {
  7609. /**
  7610. * A custom client.
  7611. */
  7612. client?: string;
  7613. /**
  7614. * Specifies where to listen to from the server.
  7615. */
  7616. listen?: number | ListenOptions | ((server: Server) => void);
  7617. /**
  7618. * Specifies the protocol the client should use to connect to the server.
  7619. */
  7620. protocol?: "http" | "https";
  7621. /**
  7622. * Specifies how to create the server handling the EventSource requests.
  7623. */
  7624. server?:
  7625. | ServerOptions<typeof IncomingMessage>
  7626. | HttpsServerOptions
  7627. | (() => Server);
  7628. }
  7629. /**
  7630. * Options for compiling entrypoints and import()s only when they are accessed.
  7631. */
  7632. declare interface LazyCompilationOptions {
  7633. /**
  7634. * Specifies the backend that should be used for handling client keep alive.
  7635. */
  7636. backend?:
  7637. | ((
  7638. compiler: Compiler,
  7639. callback: (err: null | Error, api?: BackendApi) => void
  7640. ) => void)
  7641. | ((compiler: Compiler) => Promise<BackendApi>)
  7642. | LazyCompilationDefaultBackendOptions;
  7643. /**
  7644. * Enable/disable lazy compilation for entries.
  7645. */
  7646. entries?: boolean;
  7647. /**
  7648. * Enable/disable lazy compilation for import() modules.
  7649. */
  7650. imports?: boolean;
  7651. /**
  7652. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  7653. */
  7654. test?: string | RegExp | ((module: Module) => boolean);
  7655. }
  7656. declare class LazySet<T> {
  7657. constructor(iterable?: Iterable<T>);
  7658. get size(): number;
  7659. add(item: T): LazySet<T>;
  7660. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  7661. clear(): void;
  7662. delete(value: T): boolean;
  7663. entries(): IterableIterator<[T, T]>;
  7664. forEach<K>(
  7665. callbackFn: (value: T, value2: T, set: Set<T>) => void,
  7666. thisArg: K
  7667. ): void;
  7668. has(item: T): boolean;
  7669. keys(): IterableIterator<T>;
  7670. values(): IterableIterator<T>;
  7671. serialize(__0: ObjectSerializerContext): void;
  7672. [Symbol.iterator](): IterableIterator<T>;
  7673. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  7674. }
  7675. declare interface LibIdentOptions {
  7676. /**
  7677. * absolute context path to which lib ident is relative to
  7678. */
  7679. context: string;
  7680. /**
  7681. * object for caching
  7682. */
  7683. associatedObjectForCache?: object;
  7684. }
  7685. declare class LibManifestPlugin {
  7686. constructor(options: LibManifestPluginOptions);
  7687. options: LibManifestPluginOptions;
  7688. /**
  7689. * Apply the plugin
  7690. */
  7691. apply(compiler: Compiler): void;
  7692. }
  7693. declare interface LibManifestPluginOptions {
  7694. /**
  7695. * Context of requests in the manifest file (defaults to the webpack context).
  7696. */
  7697. context?: string;
  7698. /**
  7699. * If true, only entry points will be exposed (default: true).
  7700. */
  7701. entryOnly?: boolean;
  7702. /**
  7703. * If true, manifest json file (output) will be formatted.
  7704. */
  7705. format?: boolean;
  7706. /**
  7707. * Name of the exposed dll function (external name, use value of 'output.library').
  7708. */
  7709. name?: string;
  7710. /**
  7711. * Absolute path to the manifest json file (output).
  7712. */
  7713. path: string;
  7714. /**
  7715. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  7716. */
  7717. type?: string;
  7718. }
  7719. declare interface LibraryContext<T> {
  7720. compilation: Compilation;
  7721. chunkGraph: ChunkGraph;
  7722. options: T;
  7723. }
  7724. /**
  7725. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  7726. */
  7727. declare interface LibraryCustomUmdCommentObject {
  7728. /**
  7729. * Set comment for `amd` section in UMD.
  7730. */
  7731. amd?: string;
  7732. /**
  7733. * Set comment for `commonjs` (exports) section in UMD.
  7734. */
  7735. commonjs?: string;
  7736. /**
  7737. * Set comment for `commonjs2` (module.exports) section in UMD.
  7738. */
  7739. commonjs2?: string;
  7740. /**
  7741. * Set comment for `root` (global variable) section in UMD.
  7742. */
  7743. root?: string;
  7744. }
  7745. /**
  7746. * Description object for all UMD variants of the library name.
  7747. */
  7748. declare interface LibraryCustomUmdObject {
  7749. /**
  7750. * Name of the exposed AMD library in the UMD.
  7751. */
  7752. amd?: string;
  7753. /**
  7754. * Name of the exposed commonjs export in the UMD.
  7755. */
  7756. commonjs?: string;
  7757. /**
  7758. * Name of the property exposed globally by a UMD library.
  7759. */
  7760. root?: string | string[];
  7761. }
  7762. type LibraryExport = string | string[];
  7763. type LibraryName = string | string[] | LibraryCustomUmdObject;
  7764. /**
  7765. * Options for library.
  7766. */
  7767. declare interface LibraryOptions {
  7768. /**
  7769. * Add a container for define/require functions in the AMD module.
  7770. */
  7771. amdContainer?: string;
  7772. /**
  7773. * Add a comment in the UMD wrapper.
  7774. */
  7775. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  7776. /**
  7777. * Specify which export should be exposed as library.
  7778. */
  7779. export?: string | string[];
  7780. /**
  7781. * The name of the library (some types allow unnamed libraries too).
  7782. */
  7783. name?: string | string[] | LibraryCustomUmdObject;
  7784. /**
  7785. * 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).
  7786. */
  7787. type: string;
  7788. /**
  7789. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  7790. */
  7791. umdNamedDefine?: boolean;
  7792. }
  7793. declare class LibraryTemplatePlugin {
  7794. constructor(
  7795. name: LibraryName,
  7796. target: string,
  7797. umdNamedDefine: boolean,
  7798. auxiliaryComment: AuxiliaryComment,
  7799. exportProperty: LibraryExport
  7800. );
  7801. library: {
  7802. type: string;
  7803. name: LibraryName;
  7804. umdNamedDefine: boolean;
  7805. auxiliaryComment: AuxiliaryComment;
  7806. export: LibraryExport;
  7807. };
  7808. /**
  7809. * Apply the plugin
  7810. */
  7811. apply(compiler: Compiler): void;
  7812. }
  7813. declare class LimitChunkCountPlugin {
  7814. constructor(options?: LimitChunkCountPluginOptions);
  7815. options: LimitChunkCountPluginOptions;
  7816. apply(compiler: Compiler): void;
  7817. }
  7818. declare interface LimitChunkCountPluginOptions {
  7819. /**
  7820. * Constant overhead for a chunk.
  7821. */
  7822. chunkOverhead?: number;
  7823. /**
  7824. * Multiplicator for initial chunks.
  7825. */
  7826. entryChunkMultiplicator?: number;
  7827. /**
  7828. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  7829. */
  7830. maxChunks: number;
  7831. }
  7832. type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
  7833. declare interface LoadScriptCompilationHooks {
  7834. createScript: SyncWaterfallHook<[string, Chunk]>;
  7835. }
  7836. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  7837. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  7838. static getCompilationHooks(
  7839. compilation: Compilation
  7840. ): LoadScriptCompilationHooks;
  7841. /**
  7842. * Runtime modules without any dependencies to other runtime modules
  7843. */
  7844. static STAGE_NORMAL: number;
  7845. /**
  7846. * Runtime modules with simple dependencies on other runtime modules
  7847. */
  7848. static STAGE_BASIC: number;
  7849. /**
  7850. * Runtime modules which attach to handlers of other runtime modules
  7851. */
  7852. static STAGE_ATTACH: number;
  7853. /**
  7854. * Runtime modules which trigger actions on bootstrap
  7855. */
  7856. static STAGE_TRIGGER: number;
  7857. }
  7858. /**
  7859. * Custom values available in the loader context.
  7860. */
  7861. declare interface Loader {
  7862. [index: string]: any;
  7863. }
  7864. type LoaderContextDeclarationsIndex<OptionsType> =
  7865. NormalModuleLoaderContext<OptionsType> &
  7866. LoaderRunnerLoaderContext<OptionsType> &
  7867. LoaderPluginLoaderContext &
  7868. HotModuleReplacementPluginLoaderContext;
  7869. type LoaderContextNormalModule<T> = NormalModuleLoaderContext<T> &
  7870. LoaderRunnerLoaderContext<T> &
  7871. LoaderPluginLoaderContext &
  7872. HotModuleReplacementPluginLoaderContext;
  7873. type LoaderDefinition<
  7874. OptionsType = {},
  7875. ContextAdditions = {}
  7876. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  7877. raw?: false;
  7878. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7879. };
  7880. declare interface LoaderDefinitionFunction<
  7881. OptionsType = {},
  7882. ContextAdditions = {}
  7883. > {
  7884. (
  7885. this: NormalModuleLoaderContext<OptionsType> &
  7886. LoaderRunnerLoaderContext<OptionsType> &
  7887. LoaderPluginLoaderContext &
  7888. HotModuleReplacementPluginLoaderContext &
  7889. ContextAdditions,
  7890. content: string,
  7891. sourceMap?: string | SourceMap,
  7892. additionalData?: AdditionalData
  7893. ): string | void | Buffer | Promise<string | Buffer>;
  7894. }
  7895. declare interface LoaderItem {
  7896. loader: string;
  7897. options?: null | string | Record<string, any>;
  7898. ident: null | string;
  7899. type: null | string;
  7900. }
  7901. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  7902. default?:
  7903. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  7904. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7905. raw?: false;
  7906. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  7907. }
  7908. declare class LoaderOptionsPlugin {
  7909. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  7910. options: LoaderOptionsPluginOptions & MatchObject;
  7911. /**
  7912. * Apply the plugin
  7913. */
  7914. apply(compiler: Compiler): void;
  7915. }
  7916. declare interface LoaderOptionsPluginOptions {
  7917. [index: string]: any;
  7918. /**
  7919. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  7920. */
  7921. debug?: boolean;
  7922. /**
  7923. * Where loaders can be switched to minimize mode.
  7924. */
  7925. minimize?: boolean;
  7926. /**
  7927. * A configuration object that can be used to configure older loaders.
  7928. */
  7929. options?: {
  7930. [index: string]: any;
  7931. /**
  7932. * The context that can be used to configure older loaders.
  7933. */
  7934. context?: string;
  7935. };
  7936. }
  7937. /**
  7938. * These properties are added by the LoaderPlugin
  7939. */
  7940. declare interface LoaderPluginLoaderContext {
  7941. /**
  7942. * Resolves the given request to a module, applies all configured loaders and calls
  7943. * back with the generated source, the sourceMap and the module instance (usually an
  7944. * instance of NormalModule). Use this function if you need to know the source code
  7945. * of another module to generate the result.
  7946. */
  7947. loadModule(
  7948. request: string,
  7949. callback: (
  7950. err: null | Error,
  7951. source?: string | Buffer,
  7952. sourceMap?: null | object,
  7953. module?: Module
  7954. ) => void
  7955. ): void;
  7956. importModule(
  7957. request: string,
  7958. options: undefined | ImportModuleOptions,
  7959. callback: (err?: null | Error, exports?: any) => any
  7960. ): void;
  7961. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  7962. }
  7963. /**
  7964. * The properties are added by https://github.com/webpack/loader-runner
  7965. */
  7966. declare interface LoaderRunnerLoaderContext<OptionsType> {
  7967. /**
  7968. * Add a directory as dependency of the loader result.
  7969. */
  7970. addContextDependency(context: string): void;
  7971. /**
  7972. * Adds a file as dependency of the loader result in order to make them watchable.
  7973. * For example, html-loader uses this technique as it finds src and src-set attributes.
  7974. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  7975. */
  7976. addDependency(file: string): void;
  7977. addMissingDependency(context: string): void;
  7978. /**
  7979. * Make this loader async.
  7980. */
  7981. async(): (
  7982. err?: null | Error,
  7983. content?: string | Buffer,
  7984. sourceMap?: string | SourceMap,
  7985. additionalData?: AdditionalData
  7986. ) => void;
  7987. /**
  7988. * Make this loader result cacheable. By default it's cacheable.
  7989. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  7990. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  7991. * Most loaders are deterministic and cacheable.
  7992. */
  7993. cacheable(flag?: boolean): void;
  7994. callback: (
  7995. err?: null | Error,
  7996. content?: string | Buffer,
  7997. sourceMap?: string | SourceMap,
  7998. additionalData?: AdditionalData
  7999. ) => void;
  8000. /**
  8001. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  8002. */
  8003. clearDependencies(): void;
  8004. /**
  8005. * The directory of the module. Can be used as context for resolving other stuff.
  8006. * eg '/workspaces/ts-loader/examples/vanilla/src'
  8007. */
  8008. context: string;
  8009. readonly currentRequest: string;
  8010. readonly data: any;
  8011. /**
  8012. * alias of addDependency
  8013. * Adds a file as dependency of the loader result in order to make them watchable.
  8014. * For example, html-loader uses this technique as it finds src and src-set attributes.
  8015. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  8016. */
  8017. dependency(file: string): void;
  8018. getContextDependencies(): string[];
  8019. getDependencies(): string[];
  8020. getMissingDependencies(): string[];
  8021. /**
  8022. * The index in the loaders array of the current loader.
  8023. * In the example: in loader1: 0, in loader2: 1
  8024. */
  8025. loaderIndex: number;
  8026. readonly previousRequest: string;
  8027. readonly query: string | OptionsType;
  8028. readonly remainingRequest: string;
  8029. readonly request: string;
  8030. /**
  8031. * An array of all the loaders. It is writeable in the pitch phase.
  8032. * loaders = [{request: string, path: string, query: string, module: function}]
  8033. * In the example:
  8034. * [
  8035. * { request: "/abc/loader1.js?xyz",
  8036. * path: "/abc/loader1.js",
  8037. * query: "?xyz",
  8038. * module: [Function]
  8039. * },
  8040. * { request: "/abc/node_modules/loader2/index.js",
  8041. * path: "/abc/node_modules/loader2/index.js",
  8042. * query: "",
  8043. * module: [Function]
  8044. * }
  8045. * ]
  8046. */
  8047. loaders: {
  8048. request: string;
  8049. path: string;
  8050. query: string;
  8051. fragment: string;
  8052. options?: string | object;
  8053. ident: string;
  8054. normal?: Function;
  8055. pitch?: Function;
  8056. raw?: boolean;
  8057. data?: object;
  8058. pitchExecuted: boolean;
  8059. normalExecuted: boolean;
  8060. type?: "module" | "commonjs";
  8061. }[];
  8062. /**
  8063. * The resource path.
  8064. * In the example: "/abc/resource.js"
  8065. */
  8066. resourcePath: string;
  8067. /**
  8068. * The resource query string.
  8069. * Example: "?query"
  8070. */
  8071. resourceQuery: string;
  8072. /**
  8073. * The resource fragment.
  8074. * Example: "#frag"
  8075. */
  8076. resourceFragment: string;
  8077. /**
  8078. * The resource inclusive query and fragment.
  8079. * Example: "/abc/resource.js?query#frag"
  8080. */
  8081. resource: string;
  8082. /**
  8083. * Target of compilation.
  8084. * Example: "web"
  8085. */
  8086. target: string;
  8087. /**
  8088. * Tell what kind of ES-features may be used in the generated runtime-code.
  8089. * Example: { arrowFunction: true }
  8090. */
  8091. environment: Environment;
  8092. }
  8093. declare class LoaderTargetPlugin {
  8094. constructor(target: string);
  8095. target: string;
  8096. /**
  8097. * Apply the plugin
  8098. */
  8099. apply(compiler: Compiler): void;
  8100. }
  8101. declare interface LogEntry {
  8102. type: string;
  8103. args?: any[];
  8104. time: number;
  8105. trace?: string[];
  8106. }
  8107. type LogTypeEnum =
  8108. | "error"
  8109. | "warn"
  8110. | "info"
  8111. | "log"
  8112. | "debug"
  8113. | "profile"
  8114. | "trace"
  8115. | "group"
  8116. | "groupCollapsed"
  8117. | "groupEnd"
  8118. | "profileEnd"
  8119. | "time"
  8120. | "clear"
  8121. | "status";
  8122. declare const MEASURE_END_OPERATION: unique symbol;
  8123. declare const MEASURE_START_OPERATION: unique symbol;
  8124. declare interface MainRenderContext {
  8125. /**
  8126. * the chunk
  8127. */
  8128. chunk: Chunk;
  8129. /**
  8130. * the dependency templates
  8131. */
  8132. dependencyTemplates: DependencyTemplates;
  8133. /**
  8134. * the runtime template
  8135. */
  8136. runtimeTemplate: RuntimeTemplate;
  8137. /**
  8138. * the module graph
  8139. */
  8140. moduleGraph: ModuleGraph;
  8141. /**
  8142. * the chunk graph
  8143. */
  8144. chunkGraph: ChunkGraph;
  8145. /**
  8146. * results of code generation
  8147. */
  8148. codeGenerationResults: CodeGenerationResults;
  8149. /**
  8150. * hash to be used for render call
  8151. */
  8152. hash: string;
  8153. /**
  8154. * rendering in strict context
  8155. */
  8156. strictMode?: boolean;
  8157. }
  8158. declare abstract class MainTemplate {
  8159. hooks: Readonly<{
  8160. renderManifest: {
  8161. tap: <AdditionalOptions>(
  8162. options:
  8163. | string
  8164. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8165. fn: (
  8166. renderManifestEntries: RenderManifestEntry[],
  8167. renderManifestOptions: RenderManifestOptions
  8168. ) => RenderManifestEntry[]
  8169. ) => void;
  8170. };
  8171. modules: { tap: () => never };
  8172. moduleObj: { tap: () => never };
  8173. require: {
  8174. tap: <AdditionalOptions>(
  8175. options:
  8176. | string
  8177. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8178. fn: (
  8179. value: string,
  8180. renderBootstrapContext: RenderBootstrapContext
  8181. ) => string
  8182. ) => void;
  8183. };
  8184. beforeStartup: { tap: () => never };
  8185. startup: { tap: () => never };
  8186. afterStartup: { tap: () => never };
  8187. render: {
  8188. tap: <AdditionalOptions>(
  8189. options:
  8190. | string
  8191. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8192. fn: (
  8193. source: Source,
  8194. chunk: Chunk,
  8195. hash: undefined | string,
  8196. moduleTemplate: ModuleTemplate,
  8197. dependencyTemplates: DependencyTemplates
  8198. ) => Source
  8199. ) => void;
  8200. };
  8201. renderWithEntry: {
  8202. tap: <AdditionalOptions>(
  8203. options:
  8204. | string
  8205. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8206. fn: (source: Source, chunk: Chunk, hash?: string) => Source
  8207. ) => void;
  8208. };
  8209. assetPath: {
  8210. tap: <AdditionalOptions>(
  8211. options:
  8212. | string
  8213. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8214. fn: (value: string, path: PathData, assetInfo?: AssetInfo) => string
  8215. ) => void;
  8216. call: (filename: TemplatePath, options: PathData) => string;
  8217. };
  8218. hash: {
  8219. tap: <AdditionalOptions>(
  8220. options:
  8221. | string
  8222. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8223. fn: (hash: Hash) => void
  8224. ) => void;
  8225. };
  8226. hashForChunk: {
  8227. tap: <AdditionalOptions>(
  8228. options:
  8229. | string
  8230. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  8231. fn: (hash: Hash, chunk: Chunk) => void
  8232. ) => void;
  8233. };
  8234. globalHashPaths: { tap: () => void };
  8235. globalHash: { tap: () => void };
  8236. hotBootstrap: { tap: () => never };
  8237. bootstrap: SyncWaterfallHook<
  8238. [string, Chunk, string, ModuleTemplate, DependencyTemplates]
  8239. >;
  8240. localVars: SyncWaterfallHook<[string, Chunk, string]>;
  8241. requireExtensions: SyncWaterfallHook<[string, Chunk, string]>;
  8242. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string]>;
  8243. get jsonpScript(): SyncWaterfallHook<[string, Chunk]>;
  8244. get linkPrefetch(): SyncWaterfallHook<[string, Chunk]>;
  8245. get linkPreload(): SyncWaterfallHook<[string, Chunk]>;
  8246. }>;
  8247. renderCurrentHashCode: (hash: string, length?: number) => string;
  8248. getPublicPath: (options: PathData) => string;
  8249. getAssetPath: (path: TemplatePath, options: PathData) => string;
  8250. getAssetPathWithInfo: (
  8251. path: TemplatePath,
  8252. options: PathData
  8253. ) => InterpolatedPathAndAssetInfo;
  8254. get requireFn(): "__webpack_require__";
  8255. get outputOptions(): Output;
  8256. }
  8257. declare interface MakeDirectoryOptions {
  8258. recursive?: boolean;
  8259. mode?: string | number;
  8260. }
  8261. declare interface MapOptions {
  8262. columns?: boolean;
  8263. module?: boolean;
  8264. }
  8265. declare interface MatchObject {
  8266. test?: string | RegExp | (string | RegExp)[];
  8267. include?: string | RegExp | (string | RegExp)[];
  8268. exclude?: string | RegExp | (string | RegExp)[];
  8269. }
  8270. type Matcher = string | RegExp | (string | RegExp)[];
  8271. type Media = undefined | string;
  8272. /**
  8273. * Options object for in-memory caching.
  8274. */
  8275. declare interface MemoryCacheOptions {
  8276. /**
  8277. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  8278. */
  8279. cacheUnaffected?: boolean;
  8280. /**
  8281. * 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).
  8282. */
  8283. maxGenerations?: number;
  8284. /**
  8285. * In memory caching.
  8286. */
  8287. type: "memory";
  8288. }
  8289. declare class MemoryCachePlugin {
  8290. constructor();
  8291. /**
  8292. * Apply the plugin
  8293. */
  8294. apply(compiler: Compiler): void;
  8295. }
  8296. declare class MergeDuplicateChunksPlugin {
  8297. constructor(options?: MergeDuplicateChunksPluginOptions);
  8298. options: MergeDuplicateChunksPluginOptions;
  8299. apply(compiler: Compiler): void;
  8300. }
  8301. declare interface MergeDuplicateChunksPluginOptions {
  8302. /**
  8303. * Specifies the stage for merging duplicate chunks.
  8304. */
  8305. stage?: number;
  8306. }
  8307. declare class MinChunkSizePlugin {
  8308. constructor(options: MinChunkSizePluginOptions);
  8309. options: MinChunkSizePluginOptions;
  8310. /**
  8311. * Apply the plugin
  8312. */
  8313. apply(compiler: Compiler): void;
  8314. }
  8315. declare interface MinChunkSizePluginOptions {
  8316. /**
  8317. * Constant overhead for a chunk.
  8318. */
  8319. chunkOverhead?: number;
  8320. /**
  8321. * Multiplicator for initial chunks.
  8322. */
  8323. entryChunkMultiplicator?: number;
  8324. /**
  8325. * Minimum number of characters.
  8326. */
  8327. minChunkSize: number;
  8328. }
  8329. declare interface Mkdir {
  8330. (
  8331. file: PathLikeFs,
  8332. options: MakeDirectoryOptions & { recursive: true },
  8333. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  8334. ): void;
  8335. (
  8336. file: PathLikeFs,
  8337. options:
  8338. | undefined
  8339. | null
  8340. | string
  8341. | number
  8342. | (MakeDirectoryOptions & { recursive?: false }),
  8343. callback: (err: null | NodeJS.ErrnoException) => void
  8344. ): void;
  8345. (
  8346. file: PathLikeFs,
  8347. options: undefined | null | string | number | MakeDirectoryOptions,
  8348. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  8349. ): void;
  8350. (
  8351. file: PathLikeFs,
  8352. callback: (err: null | NodeJS.ErrnoException) => void
  8353. ): void;
  8354. }
  8355. declare interface MkdirSync {
  8356. (
  8357. path: PathLikeFs,
  8358. options: MakeDirectoryOptions & { recursive: true }
  8359. ): undefined | string;
  8360. (
  8361. path: PathLikeFs,
  8362. options?:
  8363. | null
  8364. | string
  8365. | number
  8366. | (MakeDirectoryOptions & { recursive?: false })
  8367. ): void;
  8368. (
  8369. path: PathLikeFs,
  8370. options?: null | string | number | MakeDirectoryOptions
  8371. ): undefined | string;
  8372. }
  8373. declare class Module extends DependenciesBlock {
  8374. constructor(type: string, context?: null | string, layer?: null | string);
  8375. type: string;
  8376. context: null | string;
  8377. layer: null | string;
  8378. needId: boolean;
  8379. debugId: number;
  8380. resolveOptions?: ResolveOptions;
  8381. factoryMeta?: FactoryMeta;
  8382. useSourceMap: boolean;
  8383. useSimpleSourceMap: boolean;
  8384. hot: boolean;
  8385. buildMeta?: BuildMeta;
  8386. buildInfo?: BuildInfo;
  8387. presentationalDependencies?: Dependency[];
  8388. codeGenerationDependencies?: Dependency[];
  8389. id: null | string | number;
  8390. get hash(): string;
  8391. get renderedHash(): string;
  8392. profile?: ModuleProfile;
  8393. index: null | number;
  8394. index2: null | number;
  8395. depth: null | number;
  8396. issuer?: null | Module;
  8397. get usedExports(): null | boolean | SortableSet<string>;
  8398. get optimizationBailout(): (
  8399. | string
  8400. | ((requestShortener: RequestShortener) => string)
  8401. )[];
  8402. get optional(): boolean;
  8403. addChunk(chunk: Chunk): boolean;
  8404. removeChunk(chunk: Chunk): void;
  8405. isInChunk(chunk: Chunk): boolean;
  8406. isEntryModule(): boolean;
  8407. getChunks(): Chunk[];
  8408. getNumberOfChunks(): number;
  8409. get chunksIterable(): Iterable<Chunk>;
  8410. isProvided(exportName: string): null | boolean;
  8411. get exportsArgument(): string;
  8412. get moduleArgument(): string;
  8413. getExportsType(
  8414. moduleGraph: ModuleGraph,
  8415. strict?: boolean
  8416. ): "namespace" | "default-only" | "default-with-named" | "dynamic";
  8417. addPresentationalDependency(presentationalDependency: Dependency): void;
  8418. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  8419. addWarning(warning: WebpackError): void;
  8420. getWarnings(): undefined | Iterable<WebpackError>;
  8421. getNumberOfWarnings(): number;
  8422. addError(error: WebpackError): void;
  8423. getErrors(): undefined | Iterable<WebpackError>;
  8424. getNumberOfErrors(): number;
  8425. /**
  8426. * removes all warnings and errors
  8427. */
  8428. clearWarningsAndErrors(): void;
  8429. isOptional(moduleGraph: ModuleGraph): boolean;
  8430. isAccessibleInChunk(
  8431. chunkGraph: ChunkGraph,
  8432. chunk: Chunk,
  8433. ignoreChunk?: Chunk
  8434. ): boolean;
  8435. isAccessibleInChunkGroup(
  8436. chunkGraph: ChunkGraph,
  8437. chunkGroup: ChunkGroup,
  8438. ignoreChunk?: Chunk
  8439. ): boolean;
  8440. hasReasonForChunk(
  8441. chunk: Chunk,
  8442. moduleGraph: ModuleGraph,
  8443. chunkGraph: ChunkGraph
  8444. ): boolean;
  8445. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  8446. needBuild(
  8447. context: NeedBuildContext,
  8448. callback: (err?: null | WebpackError, needBuild?: boolean) => void
  8449. ): void;
  8450. needRebuild(
  8451. fileTimestamps: Map<string, null | number>,
  8452. contextTimestamps: Map<string, null | number>
  8453. ): boolean;
  8454. invalidateBuild(): void;
  8455. identifier(): string;
  8456. readableIdentifier(requestShortener: RequestShortener): string;
  8457. build(
  8458. options: WebpackOptionsNormalized,
  8459. compilation: Compilation,
  8460. resolver: ResolverWithOptions,
  8461. fs: InputFileSystem,
  8462. callback: (err?: WebpackError) => void
  8463. ): void;
  8464. getSourceTypes(): ReadonlySet<string>;
  8465. source(
  8466. dependencyTemplates: DependencyTemplates,
  8467. runtimeTemplate: RuntimeTemplate,
  8468. type?: string
  8469. ): Source;
  8470. size(type?: string): number;
  8471. libIdent(options: LibIdentOptions): null | string;
  8472. nameForCondition(): null | string;
  8473. getConcatenationBailoutReason(
  8474. context: ConcatenationBailoutReasonContext
  8475. ): undefined | string;
  8476. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  8477. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  8478. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  8479. hasChunkCondition(): boolean;
  8480. /**
  8481. * Assuming this module is in the cache. Update the (cached) module with
  8482. * the fresh module from the factory. Usually updates internal references
  8483. * and properties.
  8484. */
  8485. updateCacheModule(module: Module): void;
  8486. /**
  8487. * Module should be unsafe cached. Get data that's needed for that.
  8488. * This data will be passed to restoreFromUnsafeCache later.
  8489. */
  8490. getUnsafeCacheData(): UnsafeCacheData;
  8491. /**
  8492. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  8493. */
  8494. cleanupForCache(): void;
  8495. originalSource(): null | Source;
  8496. addCacheDependencies(
  8497. fileDependencies: LazySet<string>,
  8498. contextDependencies: LazySet<string>,
  8499. missingDependencies: LazySet<string>,
  8500. buildDependencies: LazySet<string>
  8501. ): void;
  8502. get hasEqualsChunks(): any;
  8503. get isUsed(): any;
  8504. get errors(): any;
  8505. get warnings(): any;
  8506. used: any;
  8507. }
  8508. declare class ModuleChunkLoadingRuntimeModule extends RuntimeModule {
  8509. constructor(runtimeRequirements: ReadonlySet<string>);
  8510. static getCompilationHooks(
  8511. compilation: Compilation
  8512. ): JsonpCompilationPluginHooks;
  8513. /**
  8514. * Runtime modules without any dependencies to other runtime modules
  8515. */
  8516. static STAGE_NORMAL: number;
  8517. /**
  8518. * Runtime modules with simple dependencies on other runtime modules
  8519. */
  8520. static STAGE_BASIC: number;
  8521. /**
  8522. * Runtime modules which attach to handlers of other runtime modules
  8523. */
  8524. static STAGE_ATTACH: number;
  8525. /**
  8526. * Runtime modules which trigger actions on bootstrap
  8527. */
  8528. static STAGE_TRIGGER: number;
  8529. }
  8530. declare class ModuleConcatenationPlugin {
  8531. constructor();
  8532. /**
  8533. * Apply the plugin
  8534. */
  8535. apply(compiler: Compiler): void;
  8536. }
  8537. declare class ModuleDependency extends Dependency {
  8538. constructor(request: string);
  8539. request: string;
  8540. userRequest: string;
  8541. range: any;
  8542. assertions?: ImportAttributes;
  8543. static Template: typeof DependencyTemplate;
  8544. static NO_EXPORTS_REFERENCED: string[][];
  8545. static EXPORTS_OBJECT_REFERENCED: string[][];
  8546. static TRANSITIVE: typeof TRANSITIVE;
  8547. }
  8548. declare abstract class ModuleFactory {
  8549. create(
  8550. data: ModuleFactoryCreateData,
  8551. callback: (err?: null | Error, result?: ModuleFactoryResult) => void
  8552. ): void;
  8553. }
  8554. declare interface ModuleFactoryCreateData {
  8555. contextInfo: ModuleFactoryCreateDataContextInfo;
  8556. resolveOptions?: ResolveOptions;
  8557. context: string;
  8558. dependencies: Dependency[];
  8559. }
  8560. declare interface ModuleFactoryCreateDataContextInfo {
  8561. issuer: string;
  8562. issuerLayer?: null | string;
  8563. compiler?: string;
  8564. }
  8565. declare interface ModuleFactoryResult {
  8566. /**
  8567. * the created module or unset if no module was created
  8568. */
  8569. module?: Module;
  8570. fileDependencies?: Set<string>;
  8571. contextDependencies?: Set<string>;
  8572. missingDependencies?: Set<string>;
  8573. /**
  8574. * allow to use the unsafe cache
  8575. */
  8576. cacheable?: boolean;
  8577. }
  8578. declare class ModuleFederationPlugin {
  8579. constructor(options: ModuleFederationPluginOptions);
  8580. /**
  8581. * Apply the plugin
  8582. */
  8583. apply(compiler: Compiler): void;
  8584. /**
  8585. * Get the compilation hooks associated with this plugin.
  8586. */
  8587. static getCompilationHooks(
  8588. compilation: Compilation
  8589. ): CompilationHooksModuleFederationPlugin;
  8590. }
  8591. declare interface ModuleFederationPluginOptions {
  8592. /**
  8593. * 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.
  8594. */
  8595. exposes?: (string | ExposesObject)[] | ExposesObject;
  8596. /**
  8597. * The filename of the container as relative path inside the `output.path` directory.
  8598. */
  8599. filename?: string;
  8600. /**
  8601. * Options for library.
  8602. */
  8603. library?: LibraryOptions;
  8604. /**
  8605. * The name of the container.
  8606. */
  8607. name?: string;
  8608. /**
  8609. * The external type of the remote containers.
  8610. */
  8611. remoteType?:
  8612. | "import"
  8613. | "var"
  8614. | "module"
  8615. | "assign"
  8616. | "this"
  8617. | "window"
  8618. | "self"
  8619. | "global"
  8620. | "commonjs"
  8621. | "commonjs2"
  8622. | "commonjs-module"
  8623. | "commonjs-static"
  8624. | "amd"
  8625. | "amd-require"
  8626. | "umd"
  8627. | "umd2"
  8628. | "jsonp"
  8629. | "system"
  8630. | "promise"
  8631. | "module-import"
  8632. | "script"
  8633. | "node-commonjs";
  8634. /**
  8635. * 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.
  8636. */
  8637. remotes?: (string | RemotesObject)[] | RemotesObject;
  8638. /**
  8639. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  8640. */
  8641. runtime?: string | false;
  8642. /**
  8643. * Share scope name used for all shared modules (defaults to 'default').
  8644. */
  8645. shareScope?: string;
  8646. /**
  8647. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  8648. */
  8649. shared?: (string | SharedObject)[] | SharedObject;
  8650. }
  8651. type ModuleFilterItemTypes =
  8652. | string
  8653. | RegExp
  8654. | ((
  8655. name: string,
  8656. module: StatsModule,
  8657. type: "module" | "chunk" | "root-of-chunk" | "nested"
  8658. ) => boolean);
  8659. declare class ModuleGraph {
  8660. constructor();
  8661. setParents(
  8662. dependency: Dependency,
  8663. block: DependenciesBlock,
  8664. module: Module,
  8665. indexInBlock?: number
  8666. ): void;
  8667. getParentModule(dependency: Dependency): undefined | Module;
  8668. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  8669. getParentBlockIndex(dependency: Dependency): number;
  8670. setResolvedModule(
  8671. originModule: null | Module,
  8672. dependency: Dependency,
  8673. module: Module
  8674. ): void;
  8675. updateModule(dependency: Dependency, module: Module): void;
  8676. removeConnection(dependency: Dependency): void;
  8677. addExplanation(dependency: Dependency, explanation: string): void;
  8678. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  8679. removeModuleAttributes(module: Module): void;
  8680. removeAllModuleAttributes(): void;
  8681. moveModuleConnections(
  8682. oldModule: Module,
  8683. newModule: Module,
  8684. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  8685. ): void;
  8686. copyOutgoingModuleConnections(
  8687. oldModule: Module,
  8688. newModule: Module,
  8689. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  8690. ): void;
  8691. addExtraReason(module: Module, explanation: string): void;
  8692. getResolvedModule(dependency: Dependency): null | Module;
  8693. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  8694. getModule(dependency: Dependency): null | Module;
  8695. getOrigin(dependency: Dependency): null | Module;
  8696. getResolvedOrigin(dependency: Dependency): null | Module;
  8697. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  8698. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  8699. getIncomingConnectionsByOriginModule(
  8700. module: Module
  8701. ): Map<undefined | null | Module, ReadonlyArray<ModuleGraphConnection>>;
  8702. getOutgoingConnectionsByModule(
  8703. module: Module
  8704. ): undefined | Map<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  8705. getProfile(module: Module): undefined | ModuleProfile;
  8706. setProfile(module: Module, profile?: ModuleProfile): void;
  8707. getIssuer(module: Module): undefined | null | Module;
  8708. setIssuer(module: Module, issuer: null | Module): void;
  8709. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  8710. getOptimizationBailout(
  8711. module: Module
  8712. ): (string | ((requestShortener: RequestShortener) => string))[];
  8713. getProvidedExports(module: Module): null | true | string[];
  8714. isExportProvided(
  8715. module: Module,
  8716. exportName: string | string[]
  8717. ): null | boolean;
  8718. getExportsInfo(module: Module): ExportsInfo;
  8719. getExportInfo(module: Module, exportName: string): ExportInfo;
  8720. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  8721. getUsedExports(
  8722. module: Module,
  8723. runtime: RuntimeSpec
  8724. ): null | boolean | SortableSet<string>;
  8725. getPreOrderIndex(module: Module): null | number;
  8726. getPostOrderIndex(module: Module): null | number;
  8727. setPreOrderIndex(module: Module, index: number): void;
  8728. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  8729. setPostOrderIndex(module: Module, index: number): void;
  8730. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  8731. getDepth(module: Module): null | number;
  8732. setDepth(module: Module, depth: number): void;
  8733. setDepthIfLower(module: Module, depth: number): boolean;
  8734. isAsync(module: Module): boolean;
  8735. setAsync(module: Module): void;
  8736. getMeta(thing: object): any;
  8737. getMetaIfExisting(thing: object): any;
  8738. freeze(cacheStage?: string): void;
  8739. unfreeze(): void;
  8740. cached<T, V>(
  8741. fn: (moduleGraph: ModuleGraph, ...args: T[]) => V,
  8742. ...args: T[]
  8743. ): V;
  8744. setModuleMemCaches(
  8745. moduleMemCaches: Map<Module, WeakTupleMap<any, any>>
  8746. ): void;
  8747. dependencyCacheProvide(dependency: Dependency, ...args: any[]): any;
  8748. static getModuleGraphForModule(
  8749. module: Module,
  8750. deprecateMessage: string,
  8751. deprecationCode: string
  8752. ): ModuleGraph;
  8753. static setModuleGraphForModule(
  8754. module: Module,
  8755. moduleGraph: ModuleGraph
  8756. ): void;
  8757. static clearModuleGraphForModule(module: Module): void;
  8758. static ModuleGraphConnection: typeof ModuleGraphConnection;
  8759. }
  8760. declare class ModuleGraphConnection {
  8761. constructor(
  8762. originModule: null | Module,
  8763. dependency: null | Dependency,
  8764. module: Module,
  8765. explanation?: string,
  8766. weak?: boolean,
  8767. condition?:
  8768. | null
  8769. | false
  8770. | ((
  8771. moduleGraphConnection: ModuleGraphConnection,
  8772. runtime: RuntimeSpec
  8773. ) => ConnectionState)
  8774. );
  8775. originModule: null | Module;
  8776. resolvedOriginModule: null | Module;
  8777. dependency: null | Dependency;
  8778. resolvedModule: Module;
  8779. module: Module;
  8780. weak: boolean;
  8781. conditional: boolean;
  8782. condition?: (
  8783. moduleGraphConnection: ModuleGraphConnection,
  8784. runtime: RuntimeSpec
  8785. ) => ConnectionState;
  8786. explanations?: Set<string>;
  8787. clone(): ModuleGraphConnection;
  8788. addCondition(
  8789. condition: (
  8790. moduleGraphConnection: ModuleGraphConnection,
  8791. runtime: RuntimeSpec
  8792. ) => ConnectionState
  8793. ): void;
  8794. addExplanation(explanation: string): void;
  8795. get explanation(): string;
  8796. isActive(runtime: RuntimeSpec): boolean;
  8797. isTargetActive(runtime: RuntimeSpec): boolean;
  8798. getActiveState(runtime: RuntimeSpec): ConnectionState;
  8799. setActive(value: boolean): void;
  8800. active: void;
  8801. static addConnectionStates: (
  8802. a: ConnectionState,
  8803. b: ConnectionState
  8804. ) => ConnectionState;
  8805. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  8806. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  8807. }
  8808. type ModuleId = string | number;
  8809. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  8810. declare interface ModuleMemCachesItem {
  8811. buildInfo: BuildInfo;
  8812. references?: WeakMap<Dependency, Module>;
  8813. memCache: WeakTupleMap<Module[], string>;
  8814. }
  8815. /**
  8816. * Options affecting the normal modules (`NormalModuleFactory`).
  8817. */
  8818. declare interface ModuleOptions {
  8819. /**
  8820. * An array of rules applied by default for modules.
  8821. */
  8822. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8823. /**
  8824. * Enable warnings for full dynamic dependencies.
  8825. */
  8826. exprContextCritical?: boolean;
  8827. /**
  8828. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  8829. */
  8830. exprContextRecursive?: boolean;
  8831. /**
  8832. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  8833. */
  8834. exprContextRegExp?: boolean | RegExp;
  8835. /**
  8836. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  8837. */
  8838. exprContextRequest?: string;
  8839. /**
  8840. * Specify options for each generator.
  8841. */
  8842. generator?: GeneratorOptionsByModuleType;
  8843. /**
  8844. * Don't parse files matching. It's matched against the full resolved request.
  8845. */
  8846. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  8847. /**
  8848. * Specify options for each parser.
  8849. */
  8850. parser?: ParserOptionsByModuleType;
  8851. /**
  8852. * An array of rules applied for modules.
  8853. */
  8854. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8855. /**
  8856. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  8857. */
  8858. strictExportPresence?: boolean;
  8859. /**
  8860. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  8861. */
  8862. strictThisContextOnImports?: boolean;
  8863. /**
  8864. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  8865. */
  8866. unknownContextCritical?: boolean;
  8867. /**
  8868. * 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'.
  8869. */
  8870. unknownContextRecursive?: boolean;
  8871. /**
  8872. * 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'.
  8873. */
  8874. unknownContextRegExp?: boolean | RegExp;
  8875. /**
  8876. * 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'.
  8877. */
  8878. unknownContextRequest?: string;
  8879. /**
  8880. * Cache the resolving of module requests.
  8881. */
  8882. unsafeCache?: boolean | Function;
  8883. /**
  8884. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  8885. */
  8886. wrappedContextCritical?: boolean;
  8887. /**
  8888. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  8889. */
  8890. wrappedContextRecursive?: boolean;
  8891. /**
  8892. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  8893. */
  8894. wrappedContextRegExp?: RegExp;
  8895. }
  8896. /**
  8897. * Options affecting the normal modules (`NormalModuleFactory`).
  8898. */
  8899. declare interface ModuleOptionsNormalized {
  8900. /**
  8901. * An array of rules applied by default for modules.
  8902. */
  8903. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8904. /**
  8905. * Specify options for each generator.
  8906. */
  8907. generator: GeneratorOptionsByModuleType;
  8908. /**
  8909. * Don't parse files matching. It's matched against the full resolved request.
  8910. */
  8911. noParse?: string | Function | RegExp | (string | Function | RegExp)[];
  8912. /**
  8913. * Specify options for each parser.
  8914. */
  8915. parser: ParserOptionsByModuleType;
  8916. /**
  8917. * An array of rules applied for modules.
  8918. */
  8919. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  8920. /**
  8921. * Cache the resolving of module requests.
  8922. */
  8923. unsafeCache?: boolean | Function;
  8924. }
  8925. declare interface ModulePathData {
  8926. id: string | number;
  8927. hash: string;
  8928. hashWithLength?: (length: number) => string;
  8929. }
  8930. declare abstract class ModuleProfile {
  8931. startTime: number;
  8932. factoryStartTime: number;
  8933. factoryEndTime: number;
  8934. factory: number;
  8935. factoryParallelismFactor: number;
  8936. restoringStartTime: number;
  8937. restoringEndTime: number;
  8938. restoring: number;
  8939. restoringParallelismFactor: number;
  8940. integrationStartTime: number;
  8941. integrationEndTime: number;
  8942. integration: number;
  8943. integrationParallelismFactor: number;
  8944. buildingStartTime: number;
  8945. buildingEndTime: number;
  8946. building: number;
  8947. buildingParallelismFactor: number;
  8948. storingStartTime: number;
  8949. storingEndTime: number;
  8950. storing: number;
  8951. storingParallelismFactor: number;
  8952. additionalFactoryTimes?: { start: number; end: number }[];
  8953. additionalFactories: number;
  8954. additionalFactoriesParallelismFactor: number;
  8955. additionalIntegration: number;
  8956. markFactoryStart(): void;
  8957. markFactoryEnd(): void;
  8958. markRestoringStart(): void;
  8959. markRestoringEnd(): void;
  8960. markIntegrationStart(): void;
  8961. markIntegrationEnd(): void;
  8962. markBuildingStart(): void;
  8963. markBuildingEnd(): void;
  8964. markStoringStart(): void;
  8965. markStoringEnd(): void;
  8966. /**
  8967. * Merge this profile into another one
  8968. */
  8969. mergeInto(realProfile: ModuleProfile): void;
  8970. }
  8971. declare interface ModuleReferenceOptions {
  8972. /**
  8973. * the properties/exports of the module
  8974. */
  8975. ids: string[];
  8976. /**
  8977. * true, when this referenced export is called
  8978. */
  8979. call: boolean;
  8980. /**
  8981. * true, when this referenced export is directly imported (not via property access)
  8982. */
  8983. directImport: boolean;
  8984. /**
  8985. * if the position is ASI safe or unknown
  8986. */
  8987. asiSafe?: boolean;
  8988. }
  8989. declare interface ModuleResult {
  8990. client: string;
  8991. data: string;
  8992. active: boolean;
  8993. }
  8994. declare interface ModuleSettings {
  8995. /**
  8996. * Specifies the layer in which the module should be placed in.
  8997. */
  8998. layer?: string;
  8999. /**
  9000. * Module type to use for the module.
  9001. */
  9002. type?: string;
  9003. /**
  9004. * Options for the resolver.
  9005. */
  9006. resolve?: ResolveOptions;
  9007. /**
  9008. * Options for parsing.
  9009. */
  9010. parser?: { [index: string]: any };
  9011. /**
  9012. * The options for the module generator.
  9013. */
  9014. generator?: { [index: string]: any };
  9015. /**
  9016. * Flags a module as with or without side effects.
  9017. */
  9018. sideEffects?: boolean;
  9019. }
  9020. declare abstract class ModuleTemplate {
  9021. type: string;
  9022. hooks: Readonly<{
  9023. content: {
  9024. tap: <AdditionalOptions>(
  9025. options:
  9026. | string
  9027. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9028. fn: (
  9029. source: Source,
  9030. module: Module,
  9031. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  9032. dependencyTemplates: DependencyTemplates
  9033. ) => Source
  9034. ) => void;
  9035. };
  9036. module: {
  9037. tap: <AdditionalOptions>(
  9038. options:
  9039. | string
  9040. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9041. fn: (
  9042. source: Source,
  9043. module: Module,
  9044. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  9045. dependencyTemplates: DependencyTemplates
  9046. ) => Source
  9047. ) => void;
  9048. };
  9049. render: {
  9050. tap: <AdditionalOptions>(
  9051. options:
  9052. | string
  9053. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9054. fn: (
  9055. source: Source,
  9056. module: Module,
  9057. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  9058. dependencyTemplates: DependencyTemplates
  9059. ) => Source
  9060. ) => void;
  9061. };
  9062. package: {
  9063. tap: <AdditionalOptions>(
  9064. options:
  9065. | string
  9066. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9067. fn: (
  9068. source: Source,
  9069. module: Module,
  9070. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  9071. dependencyTemplates: DependencyTemplates
  9072. ) => Source
  9073. ) => void;
  9074. };
  9075. hash: {
  9076. tap: <AdditionalOptions>(
  9077. options:
  9078. | string
  9079. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9080. fn: (hash: Hash) => void
  9081. ) => void;
  9082. };
  9083. }>;
  9084. get runtimeTemplate(): RuntimeTemplate;
  9085. }
  9086. declare interface ModuleTemplates {
  9087. javascript: ModuleTemplate;
  9088. }
  9089. declare class MultiCompiler {
  9090. constructor(
  9091. compilers: Compiler[] | Record<string, Compiler>,
  9092. options: MultiCompilerOptions
  9093. );
  9094. hooks: Readonly<{
  9095. done: SyncHook<[MultiStats]>;
  9096. invalid: MultiHook<SyncHook<[null | string, number]>>;
  9097. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  9098. watchClose: SyncHook<[]>;
  9099. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  9100. infrastructureLog: MultiHook<
  9101. SyncBailHook<[string, string, undefined | any[]], true | void>
  9102. >;
  9103. }>;
  9104. compilers: Compiler[];
  9105. dependencies: WeakMap<Compiler, string[]>;
  9106. running: boolean;
  9107. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  9108. get outputPath(): string;
  9109. inputFileSystem: InputFileSystem;
  9110. outputFileSystem: OutputFileSystem;
  9111. watchFileSystem: WatchFileSystem;
  9112. intermediateFileSystem: IntermediateFileSystem;
  9113. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  9114. setDependencies(compiler: Compiler, dependencies: string[]): void;
  9115. validateDependencies(callback: CallbackFunction_1<MultiStats>): boolean;
  9116. runWithDependencies(
  9117. compilers: Compiler[],
  9118. fn: (compiler: Compiler, callback: CallbackFunction_1<MultiStats>) => any,
  9119. callback: CallbackFunction_1<MultiStats>
  9120. ): void;
  9121. watch(
  9122. watchOptions: WatchOptions | WatchOptions[],
  9123. handler: CallbackFunction_1<MultiStats>
  9124. ): MultiWatching;
  9125. run(callback: CallbackFunction_1<MultiStats>): void;
  9126. purgeInputFileSystem(): void;
  9127. close(callback: CallbackFunction_1<void>): void;
  9128. }
  9129. declare interface MultiCompilerOptions {
  9130. /**
  9131. * how many Compilers are allows to run at the same time in parallel
  9132. */
  9133. parallelism?: number;
  9134. }
  9135. declare abstract class MultiStats {
  9136. stats: Stats[];
  9137. get hash(): string;
  9138. hasErrors(): boolean;
  9139. hasWarnings(): boolean;
  9140. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  9141. toString(options?: string | boolean | StatsOptions): string;
  9142. }
  9143. declare abstract class MultiWatching {
  9144. watchings: Watching[];
  9145. compiler: MultiCompiler;
  9146. invalidate(callback?: CallbackFunction_2<void>): void;
  9147. suspend(): void;
  9148. resume(): void;
  9149. close(callback: CallbackFunction_2<void>): void;
  9150. }
  9151. declare class NamedChunkIdsPlugin {
  9152. constructor(options?: NamedChunkIdsPluginOptions);
  9153. delimiter: string;
  9154. context?: string;
  9155. /**
  9156. * Apply the plugin
  9157. */
  9158. apply(compiler: Compiler): void;
  9159. }
  9160. declare interface NamedChunkIdsPluginOptions {
  9161. /**
  9162. * context
  9163. */
  9164. context?: string;
  9165. /**
  9166. * delimiter
  9167. */
  9168. delimiter?: string;
  9169. }
  9170. declare class NamedModuleIdsPlugin {
  9171. constructor(options?: NamedModuleIdsPluginOptions);
  9172. options: NamedModuleIdsPluginOptions;
  9173. /**
  9174. * Apply the plugin
  9175. */
  9176. apply(compiler: Compiler): void;
  9177. }
  9178. declare interface NamedModuleIdsPluginOptions {
  9179. /**
  9180. * context
  9181. */
  9182. context?: string;
  9183. }
  9184. declare class NaturalModuleIdsPlugin {
  9185. constructor();
  9186. /**
  9187. * Apply the plugin
  9188. */
  9189. apply(compiler: Compiler): void;
  9190. }
  9191. declare interface NeedBuildContext {
  9192. compilation: Compilation;
  9193. fileSystemInfo: FileSystemInfo;
  9194. valueCacheVersions: Map<string, string | Set<string>>;
  9195. }
  9196. declare interface NewContentCreateContextMap {
  9197. [index: string]: string;
  9198. }
  9199. declare class NoEmitOnErrorsPlugin {
  9200. constructor();
  9201. /**
  9202. * Apply the plugin
  9203. */
  9204. apply(compiler: Compiler): void;
  9205. }
  9206. type Node = false | NodeOptions;
  9207. declare class NodeEnvironmentPlugin {
  9208. constructor(options: NodeEnvironmentPluginOptions);
  9209. options: NodeEnvironmentPluginOptions;
  9210. /**
  9211. * Apply the plugin
  9212. */
  9213. apply(compiler: Compiler): void;
  9214. }
  9215. declare interface NodeEnvironmentPluginOptions {
  9216. /**
  9217. * infrastructure logging options
  9218. */
  9219. infrastructureLogging: InfrastructureLogging;
  9220. }
  9221. /**
  9222. * Options object for node compatibility features.
  9223. */
  9224. declare interface NodeOptions {
  9225. /**
  9226. * Include a polyfill for the '__dirname' variable.
  9227. */
  9228. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  9229. /**
  9230. * Include a polyfill for the '__filename' variable.
  9231. */
  9232. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  9233. /**
  9234. * Include a polyfill for the 'global' variable.
  9235. */
  9236. global?: boolean | "warn";
  9237. }
  9238. declare class NodeSourcePlugin {
  9239. constructor();
  9240. /**
  9241. * Apply the plugin
  9242. */
  9243. apply(compiler: Compiler): void;
  9244. }
  9245. declare class NodeTargetPlugin {
  9246. constructor();
  9247. /**
  9248. * Apply the plugin
  9249. */
  9250. apply(compiler: Compiler): void;
  9251. }
  9252. declare class NodeTemplatePlugin {
  9253. constructor(options?: NodeTemplatePluginOptions);
  9254. /**
  9255. * Apply the plugin
  9256. */
  9257. apply(compiler: Compiler): void;
  9258. }
  9259. declare interface NodeTemplatePluginOptions {
  9260. /**
  9261. * enable async chunk loading
  9262. */
  9263. asyncChunkLoading?: boolean;
  9264. }
  9265. declare class NormalModule extends Module {
  9266. constructor(__0: NormalModuleCreateData);
  9267. request: string;
  9268. userRequest: string;
  9269. rawRequest: string;
  9270. binary: boolean;
  9271. parser?: Parser;
  9272. parserOptions?: ParserOptions;
  9273. generator?: Generator;
  9274. generatorOptions?: GeneratorOptions;
  9275. resource: string;
  9276. resourceResolveData: any;
  9277. matchResource?: string;
  9278. loaders: LoaderItem[];
  9279. error: null | WebpackError;
  9280. /**
  9281. * restore unsafe cache data
  9282. */
  9283. restoreFromUnsafeCache(
  9284. unsafeCacheData: UnsafeCacheData,
  9285. normalModuleFactory: NormalModuleFactory
  9286. ): void;
  9287. createSourceForAsset(
  9288. context: string,
  9289. name: string,
  9290. content: string | Buffer,
  9291. sourceMap?: string | SourceMap,
  9292. associatedObjectForCache?: object
  9293. ): Source;
  9294. getCurrentLoader(loaderContext?: any, index?: number): null | LoaderItem;
  9295. createSource(
  9296. context: string,
  9297. content: string | Buffer,
  9298. sourceMap?: null | string | SourceMapSource,
  9299. associatedObjectForCache?: object
  9300. ): Source;
  9301. markModuleAsErrored(error: WebpackError): void;
  9302. applyNoParseRule(rule: any, content: string): boolean;
  9303. shouldPreventParsing(noParseRule: any, request: string): boolean;
  9304. static getCompilationHooks(
  9305. compilation: Compilation
  9306. ): NormalModuleCompilationHooks;
  9307. static deserialize(context: ObjectDeserializerContext): any;
  9308. }
  9309. declare interface NormalModuleCompilationHooks {
  9310. loader: SyncHook<[LoaderContextNormalModule<any>, NormalModule]>;
  9311. beforeLoaders: SyncHook<
  9312. [LoaderItem[], NormalModule, LoaderContextNormalModule<any>]
  9313. >;
  9314. beforeParse: SyncHook<[NormalModule]>;
  9315. beforeSnapshot: SyncHook<[NormalModule]>;
  9316. readResourceForScheme: HookMap<
  9317. FakeHook<
  9318. AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
  9319. >
  9320. >;
  9321. readResource: HookMap<
  9322. AsyncSeriesBailHook<
  9323. [LoaderContextNormalModule<any>],
  9324. null | string | Buffer
  9325. >
  9326. >;
  9327. processResult: SyncWaterfallHook<
  9328. [[string | Buffer, string | SourceMapSource, PreparsedAst], NormalModule]
  9329. >;
  9330. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  9331. }
  9332. declare interface NormalModuleCreateData {
  9333. /**
  9334. * an optional layer in which the module is
  9335. */
  9336. layer?: string;
  9337. /**
  9338. * module type. When deserializing, this is set to an empty string "".
  9339. */
  9340. type: "" | "javascript/auto" | "javascript/dynamic" | "javascript/esm";
  9341. /**
  9342. * request string
  9343. */
  9344. request: string;
  9345. /**
  9346. * request intended by user (without loaders from config)
  9347. */
  9348. userRequest: string;
  9349. /**
  9350. * request without resolving
  9351. */
  9352. rawRequest: string;
  9353. /**
  9354. * list of loaders
  9355. */
  9356. loaders: LoaderItem[];
  9357. /**
  9358. * path + query of the real resource
  9359. */
  9360. resource: string;
  9361. /**
  9362. * resource resolve data
  9363. */
  9364. resourceResolveData?: any;
  9365. /**
  9366. * context directory for resolving
  9367. */
  9368. context: string;
  9369. /**
  9370. * path + query of the matched resource (virtual)
  9371. */
  9372. matchResource?: string;
  9373. /**
  9374. * the parser used
  9375. */
  9376. parser: Parser;
  9377. /**
  9378. * the options of the parser used
  9379. */
  9380. parserOptions?: ParserOptions;
  9381. /**
  9382. * the generator used
  9383. */
  9384. generator: Generator;
  9385. /**
  9386. * the options of the generator used
  9387. */
  9388. generatorOptions?: GeneratorOptions;
  9389. /**
  9390. * options used for resolving requests from this module
  9391. */
  9392. resolveOptions?: ResolveOptions;
  9393. }
  9394. declare abstract class NormalModuleFactory extends ModuleFactory {
  9395. hooks: Readonly<{
  9396. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  9397. resolveForScheme: HookMap<
  9398. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  9399. >;
  9400. resolveInScheme: HookMap<
  9401. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  9402. >;
  9403. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  9404. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  9405. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  9406. createModule: AsyncSeriesBailHook<
  9407. [
  9408. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  9409. ResolveData
  9410. ],
  9411. void | Module
  9412. >;
  9413. module: SyncWaterfallHook<
  9414. [
  9415. Module,
  9416. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  9417. ResolveData
  9418. ]
  9419. >;
  9420. createParser: HookMap<SyncBailHook<[ParserOptions], void | Parser>>;
  9421. parser: HookMap<SyncBailHook<[any, ParserOptions], void>>;
  9422. createGenerator: HookMap<
  9423. SyncBailHook<[GeneratorOptions], void | Generator>
  9424. >;
  9425. generator: HookMap<SyncBailHook<[any, GeneratorOptions], void>>;
  9426. createModuleClass: HookMap<SyncBailHook<[any, ResolveData], void | Module>>;
  9427. }>;
  9428. resolverFactory: ResolverFactory;
  9429. ruleSet: RuleSet;
  9430. context: string;
  9431. fs: InputFileSystem;
  9432. parserCache: Map<string, WeakMap<ParserOptions, Parser>>;
  9433. generatorCache: Map<string, WeakMap<GeneratorOptions, Generator>>;
  9434. cleanupForCache(): void;
  9435. resolveResource(
  9436. contextInfo: ModuleFactoryCreateDataContextInfo,
  9437. context: string,
  9438. unresolvedResource: string,
  9439. resolver: ResolverWithOptions,
  9440. resolveContext: ResolveContext,
  9441. callback: (
  9442. err: null | Error,
  9443. res?: string | false,
  9444. req?: ResolveRequest
  9445. ) => void
  9446. ): void;
  9447. resolveRequestArray(
  9448. contextInfo: ModuleFactoryCreateDataContextInfo,
  9449. context: string,
  9450. array: LoaderItem[],
  9451. resolver: ResolverWithOptions,
  9452. resolveContext: ResolveContext,
  9453. callback: CallbackNormalModuleFactory<LoaderItem[]>
  9454. ): void;
  9455. getParser(type: string, parserOptions?: ParserOptions): Parser;
  9456. createParser(type: string, parserOptions?: ParserOptions): Parser;
  9457. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  9458. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  9459. getResolver(
  9460. type: string,
  9461. resolveOptions?: ResolveOptionsWithDependencyType
  9462. ): ResolverWithOptions;
  9463. }
  9464. /**
  9465. * These properties are added by the NormalModule
  9466. */
  9467. declare interface NormalModuleLoaderContext<OptionsType> {
  9468. version: number;
  9469. getOptions(): OptionsType;
  9470. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  9471. emitWarning(warning: Error): void;
  9472. emitError(error: Error): void;
  9473. getLogger(name?: string): WebpackLogger;
  9474. resolve(
  9475. context: string,
  9476. request: string,
  9477. callback: (
  9478. err: null | ErrorWithDetail,
  9479. res?: string | false,
  9480. req?: ResolveRequest
  9481. ) => void
  9482. ): any;
  9483. getResolve(options?: ResolveOptionsWithDependencyType): {
  9484. (
  9485. context: string,
  9486. request: string,
  9487. callback: (
  9488. err: null | ErrorWithDetail,
  9489. res?: string | false,
  9490. req?: ResolveRequest
  9491. ) => void
  9492. ): void;
  9493. (context: string, request: string): Promise<string>;
  9494. };
  9495. emitFile(
  9496. name: string,
  9497. content: string | Buffer,
  9498. sourceMap?: string,
  9499. assetInfo?: AssetInfo
  9500. ): void;
  9501. addBuildDependency(dep: string): void;
  9502. utils: {
  9503. absolutify: (context: string, request: string) => string;
  9504. contextify: (context: string, request: string) => string;
  9505. createHash: (algorithm?: string | typeof Hash) => Hash;
  9506. };
  9507. rootContext: string;
  9508. fs: InputFileSystem;
  9509. sourceMap?: boolean;
  9510. mode: "none" | "development" | "production";
  9511. webpack?: boolean;
  9512. hashFunction: HashFunction;
  9513. hashDigest: string;
  9514. hashDigestLength: number;
  9515. hashSalt: string;
  9516. _module?: NormalModule;
  9517. _compilation?: Compilation;
  9518. _compiler?: Compiler;
  9519. }
  9520. declare class NormalModuleReplacementPlugin {
  9521. /**
  9522. * Create an instance of the plugin
  9523. */
  9524. constructor(
  9525. resourceRegExp: RegExp,
  9526. newResource: string | ((resolveData: ResolveData) => void)
  9527. );
  9528. resourceRegExp: RegExp;
  9529. newResource: string | ((resolveData: ResolveData) => void);
  9530. /**
  9531. * Apply the plugin
  9532. */
  9533. apply(compiler: Compiler): void;
  9534. }
  9535. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  9536. Omit<
  9537. StatsOptions,
  9538. | "context"
  9539. | "chunkGroups"
  9540. | "requestShortener"
  9541. | "chunksSort"
  9542. | "modulesSort"
  9543. | "chunkModulesSort"
  9544. | "nestedModulesSort"
  9545. | "assetsSort"
  9546. | "ids"
  9547. | "cachedAssets"
  9548. | "groupAssetsByEmitStatus"
  9549. | "groupAssetsByPath"
  9550. | "groupAssetsByExtension"
  9551. | "assetsSpace"
  9552. | "excludeAssets"
  9553. | "excludeModules"
  9554. | "warningsFilter"
  9555. | "cachedModules"
  9556. | "orphanModules"
  9557. | "dependentModules"
  9558. | "runtimeModules"
  9559. | "groupModulesByCacheStatus"
  9560. | "groupModulesByLayer"
  9561. | "groupModulesByAttributes"
  9562. | "groupModulesByPath"
  9563. | "groupModulesByExtension"
  9564. | "groupModulesByType"
  9565. | "entrypoints"
  9566. | "chunkGroupAuxiliary"
  9567. | "chunkGroupChildren"
  9568. | "chunkGroupMaxAssets"
  9569. | "modulesSpace"
  9570. | "chunkModulesSpace"
  9571. | "nestedModulesSpace"
  9572. | "logging"
  9573. | "loggingDebug"
  9574. | "loggingTrace"
  9575. | "_env"
  9576. > &
  9577. Record<string, any>;
  9578. declare class NullDependency extends Dependency {
  9579. constructor();
  9580. static Template: typeof NullDependencyTemplate;
  9581. static NO_EXPORTS_REFERENCED: string[][];
  9582. static EXPORTS_OBJECT_REFERENCED: string[][];
  9583. static TRANSITIVE: typeof TRANSITIVE;
  9584. }
  9585. declare class NullDependencyTemplate extends DependencyTemplate {
  9586. constructor();
  9587. }
  9588. declare interface ObjectDeserializerContext {
  9589. read: () => any;
  9590. setCircularReference: (value?: any) => void;
  9591. }
  9592. declare interface ObjectEncodingOptions {
  9593. encoding?:
  9594. | null
  9595. | "ascii"
  9596. | "utf8"
  9597. | "utf-8"
  9598. | "utf16le"
  9599. | "utf-16le"
  9600. | "ucs2"
  9601. | "ucs-2"
  9602. | "base64"
  9603. | "base64url"
  9604. | "latin1"
  9605. | "binary"
  9606. | "hex";
  9607. }
  9608. declare interface ObjectForExtract {
  9609. [index: string]: any;
  9610. }
  9611. declare interface ObjectSerializer {
  9612. serialize: (value: any, context: ObjectSerializerContext) => void;
  9613. deserialize: (context: ObjectDeserializerContext) => any;
  9614. }
  9615. declare interface ObjectSerializerContext {
  9616. write: (value?: any) => void;
  9617. setCircularReference: (value?: any) => void;
  9618. snapshot: () => ObjectSerializerSnapshot;
  9619. rollback: (snapshot: ObjectSerializerSnapshot) => void;
  9620. writeLazy?: (item?: any) => void;
  9621. writeSeparate?: (item?: any, obj?: any) => () => any;
  9622. }
  9623. declare interface ObjectSerializerSnapshot {
  9624. length: number;
  9625. cycleStackSize: number;
  9626. referenceableSize: number;
  9627. currentPos: number;
  9628. objectTypeLookupSize: number;
  9629. currentPosTypeLookup: number;
  9630. }
  9631. declare class OccurrenceChunkIdsPlugin {
  9632. constructor(options?: OccurrenceChunkIdsPluginOptions);
  9633. options: OccurrenceChunkIdsPluginOptions;
  9634. /**
  9635. * Apply the plugin
  9636. */
  9637. apply(compiler: Compiler): void;
  9638. }
  9639. declare interface OccurrenceChunkIdsPluginOptions {
  9640. /**
  9641. * Prioritise initial size over total size.
  9642. */
  9643. prioritiseInitial?: boolean;
  9644. }
  9645. declare class OccurrenceModuleIdsPlugin {
  9646. constructor(options?: OccurrenceModuleIdsPluginOptions);
  9647. options: OccurrenceModuleIdsPluginOptions;
  9648. /**
  9649. * Apply the plugin
  9650. */
  9651. apply(compiler: Compiler): void;
  9652. }
  9653. declare interface OccurrenceModuleIdsPluginOptions {
  9654. /**
  9655. * Prioritise initial size over total size.
  9656. */
  9657. prioritiseInitial?: boolean;
  9658. }
  9659. declare interface Open {
  9660. (
  9661. file: PathLikeFs,
  9662. flags: undefined | string | number,
  9663. mode: undefined | null | string | number,
  9664. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  9665. ): void;
  9666. (
  9667. file: PathLikeFs,
  9668. flags: undefined | string | number,
  9669. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  9670. ): void;
  9671. (
  9672. file: PathLikeFs,
  9673. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  9674. ): void;
  9675. }
  9676. /**
  9677. * Enables/Disables integrated optimizations.
  9678. */
  9679. declare interface Optimization {
  9680. /**
  9681. * Avoid wrapping the entry module in an IIFE.
  9682. */
  9683. avoidEntryIife?: boolean;
  9684. /**
  9685. * Check for incompatible wasm types when importing/exporting from/to ESM.
  9686. */
  9687. checkWasmTypes?: boolean;
  9688. /**
  9689. * 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).
  9690. */
  9691. chunkIds?:
  9692. | false
  9693. | "natural"
  9694. | "named"
  9695. | "deterministic"
  9696. | "size"
  9697. | "total-size";
  9698. /**
  9699. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  9700. */
  9701. concatenateModules?: boolean;
  9702. /**
  9703. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  9704. */
  9705. emitOnErrors?: boolean;
  9706. /**
  9707. * Also flag chunks as loaded which contain a subset of the modules.
  9708. */
  9709. flagIncludedChunks?: boolean;
  9710. /**
  9711. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  9712. */
  9713. innerGraph?: boolean;
  9714. /**
  9715. * 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).
  9716. */
  9717. mangleExports?: boolean | "deterministic" | "size";
  9718. /**
  9719. * Reduce size of WASM by changing imports to shorter strings.
  9720. */
  9721. mangleWasmImports?: boolean;
  9722. /**
  9723. * Merge chunks which contain the same modules.
  9724. */
  9725. mergeDuplicateChunks?: boolean;
  9726. /**
  9727. * Enable minimizing the output. Uses optimization.minimizer.
  9728. */
  9729. minimize?: boolean;
  9730. /**
  9731. * Minimizer(s) to use for minimizing the output.
  9732. */
  9733. minimizer?: (
  9734. | undefined
  9735. | null
  9736. | false
  9737. | ""
  9738. | 0
  9739. | ((this: Compiler, compiler: Compiler) => void)
  9740. | WebpackPluginInstance
  9741. | "..."
  9742. )[];
  9743. /**
  9744. * 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).
  9745. */
  9746. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  9747. /**
  9748. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  9749. */
  9750. noEmitOnErrors?: boolean;
  9751. /**
  9752. * Set process.env.NODE_ENV to a specific value.
  9753. */
  9754. nodeEnv?: string | false;
  9755. /**
  9756. * Generate records with relative paths to be able to move the context folder.
  9757. */
  9758. portableRecords?: boolean;
  9759. /**
  9760. * Figure out which exports are provided by modules to generate more efficient code.
  9761. */
  9762. providedExports?: boolean;
  9763. /**
  9764. * Use real [contenthash] based on final content of the assets.
  9765. */
  9766. realContentHash?: boolean;
  9767. /**
  9768. * Removes modules from chunks when these modules are already included in all parents.
  9769. */
  9770. removeAvailableModules?: boolean;
  9771. /**
  9772. * Remove chunks which are empty.
  9773. */
  9774. removeEmptyChunks?: boolean;
  9775. /**
  9776. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  9777. */
  9778. runtimeChunk?:
  9779. | boolean
  9780. | "single"
  9781. | "multiple"
  9782. | {
  9783. /**
  9784. * The name or name factory for the runtime chunks.
  9785. */
  9786. name?: string | Function;
  9787. };
  9788. /**
  9789. * 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).
  9790. */
  9791. sideEffects?: boolean | "flag";
  9792. /**
  9793. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  9794. */
  9795. splitChunks?: false | OptimizationSplitChunksOptions;
  9796. /**
  9797. * 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).
  9798. */
  9799. usedExports?: boolean | "global";
  9800. }
  9801. /**
  9802. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  9803. */
  9804. declare interface OptimizationSplitChunksCacheGroup {
  9805. /**
  9806. * Sets the name delimiter for created chunks.
  9807. */
  9808. automaticNameDelimiter?: string;
  9809. /**
  9810. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  9811. */
  9812. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9813. /**
  9814. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  9815. */
  9816. enforce?: boolean;
  9817. /**
  9818. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  9819. */
  9820. enforceSizeThreshold?: number | { [index: string]: number };
  9821. /**
  9822. * Sets the template for the filename for created chunks.
  9823. */
  9824. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9825. /**
  9826. * Sets the hint for chunk id.
  9827. */
  9828. idHint?: string;
  9829. /**
  9830. * Assign modules to a cache group by module layer.
  9831. */
  9832. layer?: string | RegExp | ((layer: null | string) => boolean);
  9833. /**
  9834. * Maximum number of requests which are accepted for on-demand loading.
  9835. */
  9836. maxAsyncRequests?: number;
  9837. /**
  9838. * Maximal size hint for the on-demand chunks.
  9839. */
  9840. maxAsyncSize?: number | { [index: string]: number };
  9841. /**
  9842. * Maximum number of initial chunks which are accepted for an entry point.
  9843. */
  9844. maxInitialRequests?: number;
  9845. /**
  9846. * Maximal size hint for the initial chunks.
  9847. */
  9848. maxInitialSize?: number | { [index: string]: number };
  9849. /**
  9850. * Maximal size hint for the created chunks.
  9851. */
  9852. maxSize?: number | { [index: string]: number };
  9853. /**
  9854. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  9855. */
  9856. minChunks?: number;
  9857. /**
  9858. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  9859. */
  9860. minRemainingSize?: number | { [index: string]: number };
  9861. /**
  9862. * Minimal size for the created chunk.
  9863. */
  9864. minSize?: number | { [index: string]: number };
  9865. /**
  9866. * Minimum size reduction due to the created chunk.
  9867. */
  9868. minSizeReduction?: number | { [index: string]: number };
  9869. /**
  9870. * Give chunks for this cache group a name (chunks with equal name are merged).
  9871. */
  9872. name?:
  9873. | string
  9874. | false
  9875. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  9876. /**
  9877. * Priority of this cache group.
  9878. */
  9879. priority?: number;
  9880. /**
  9881. * Try to reuse existing chunk (with name) when it has matching modules.
  9882. */
  9883. reuseExistingChunk?: boolean;
  9884. /**
  9885. * Assign modules to a cache group by module name.
  9886. */
  9887. test?:
  9888. | string
  9889. | RegExp
  9890. | ((module: Module, context: CacheGroupsContext) => boolean);
  9891. /**
  9892. * Assign modules to a cache group by module type.
  9893. */
  9894. type?: string | RegExp | ((type: string) => boolean);
  9895. /**
  9896. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  9897. */
  9898. usedExports?: boolean;
  9899. }
  9900. /**
  9901. * Options object for splitting chunks into smaller chunks.
  9902. */
  9903. declare interface OptimizationSplitChunksOptions {
  9904. /**
  9905. * Sets the name delimiter for created chunks.
  9906. */
  9907. automaticNameDelimiter?: string;
  9908. /**
  9909. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  9910. */
  9911. cacheGroups?: {
  9912. [index: string]:
  9913. | string
  9914. | false
  9915. | Function
  9916. | RegExp
  9917. | OptimizationSplitChunksCacheGroup;
  9918. };
  9919. /**
  9920. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  9921. */
  9922. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9923. /**
  9924. * Sets the size types which are used when a number is used for sizes.
  9925. */
  9926. defaultSizeTypes?: string[];
  9927. /**
  9928. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  9929. */
  9930. enforceSizeThreshold?: number | { [index: string]: number };
  9931. /**
  9932. * Options for modules not selected by any other cache group.
  9933. */
  9934. fallbackCacheGroup?: {
  9935. /**
  9936. * Sets the name delimiter for created chunks.
  9937. */
  9938. automaticNameDelimiter?: string;
  9939. /**
  9940. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  9941. */
  9942. chunks?: RegExp | "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
  9943. /**
  9944. * Maximal size hint for the on-demand chunks.
  9945. */
  9946. maxAsyncSize?: number | { [index: string]: number };
  9947. /**
  9948. * Maximal size hint for the initial chunks.
  9949. */
  9950. maxInitialSize?: number | { [index: string]: number };
  9951. /**
  9952. * Maximal size hint for the created chunks.
  9953. */
  9954. maxSize?: number | { [index: string]: number };
  9955. /**
  9956. * Minimal size for the created chunk.
  9957. */
  9958. minSize?: number | { [index: string]: number };
  9959. /**
  9960. * Minimum size reduction due to the created chunk.
  9961. */
  9962. minSizeReduction?: number | { [index: string]: number };
  9963. };
  9964. /**
  9965. * Sets the template for the filename for created chunks.
  9966. */
  9967. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  9968. /**
  9969. * Prevents exposing path info when creating names for parts splitted by maxSize.
  9970. */
  9971. hidePathInfo?: boolean;
  9972. /**
  9973. * Maximum number of requests which are accepted for on-demand loading.
  9974. */
  9975. maxAsyncRequests?: number;
  9976. /**
  9977. * Maximal size hint for the on-demand chunks.
  9978. */
  9979. maxAsyncSize?: number | { [index: string]: number };
  9980. /**
  9981. * Maximum number of initial chunks which are accepted for an entry point.
  9982. */
  9983. maxInitialRequests?: number;
  9984. /**
  9985. * Maximal size hint for the initial chunks.
  9986. */
  9987. maxInitialSize?: number | { [index: string]: number };
  9988. /**
  9989. * Maximal size hint for the created chunks.
  9990. */
  9991. maxSize?: number | { [index: string]: number };
  9992. /**
  9993. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  9994. */
  9995. minChunks?: number;
  9996. /**
  9997. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  9998. */
  9999. minRemainingSize?: number | { [index: string]: number };
  10000. /**
  10001. * Minimal size for the created chunks.
  10002. */
  10003. minSize?: number | { [index: string]: number };
  10004. /**
  10005. * Minimum size reduction due to the created chunk.
  10006. */
  10007. minSizeReduction?: number | { [index: string]: number };
  10008. /**
  10009. * Give chunks created a name (chunks with equal name are merged).
  10010. */
  10011. name?:
  10012. | string
  10013. | false
  10014. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  10015. /**
  10016. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  10017. */
  10018. usedExports?: boolean;
  10019. }
  10020. declare interface Options {
  10021. /**
  10022. * source
  10023. */
  10024. source: string;
  10025. /**
  10026. * absolute context path to which lib ident is relative to
  10027. */
  10028. context: string;
  10029. /**
  10030. * content
  10031. */
  10032. content: DllReferencePluginOptionsContent;
  10033. /**
  10034. * type
  10035. */
  10036. type?: "object" | "require";
  10037. /**
  10038. * extensions
  10039. */
  10040. extensions?: string[];
  10041. /**
  10042. * scope
  10043. */
  10044. scope?: string;
  10045. /**
  10046. * object for caching
  10047. */
  10048. associatedObjectForCache?: object;
  10049. }
  10050. declare abstract class OptionsApply {
  10051. process(
  10052. options: WebpackOptionsNormalized,
  10053. compiler: Compiler
  10054. ): WebpackOptionsNormalized;
  10055. }
  10056. declare interface OriginRecord {
  10057. module: null | Module;
  10058. loc: DependencyLocation;
  10059. request: string;
  10060. }
  10061. declare class OriginalSource extends Source {
  10062. constructor(source: string | Buffer, name: string);
  10063. getName(): string;
  10064. }
  10065. /**
  10066. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  10067. */
  10068. declare interface Output {
  10069. /**
  10070. * Add a container for define/require functions in the AMD module.
  10071. */
  10072. amdContainer?: string;
  10073. /**
  10074. * The filename of asset modules as relative path inside the 'output.path' directory.
  10075. */
  10076. assetModuleFilename?:
  10077. | string
  10078. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10079. /**
  10080. * Enable/disable creating async chunks that are loaded on demand.
  10081. */
  10082. asyncChunks?: boolean;
  10083. /**
  10084. * Add a comment in the UMD wrapper.
  10085. */
  10086. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  10087. /**
  10088. * Add charset attribute for script tag.
  10089. */
  10090. charset?: boolean;
  10091. /**
  10092. * 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.
  10093. */
  10094. chunkFilename?:
  10095. | string
  10096. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10097. /**
  10098. * 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).
  10099. */
  10100. chunkFormat?: string | false;
  10101. /**
  10102. * Number of milliseconds before chunk request expires.
  10103. */
  10104. chunkLoadTimeout?: number;
  10105. /**
  10106. * 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).
  10107. */
  10108. chunkLoading?: string | false;
  10109. /**
  10110. * The global variable used by webpack for loading of chunks.
  10111. */
  10112. chunkLoadingGlobal?: string;
  10113. /**
  10114. * Clean the output directory before emit.
  10115. */
  10116. clean?: boolean | CleanOptions;
  10117. /**
  10118. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  10119. */
  10120. compareBeforeEmit?: boolean;
  10121. /**
  10122. * This option enables cross-origin loading of chunks.
  10123. */
  10124. crossOriginLoading?: false | "anonymous" | "use-credentials";
  10125. /**
  10126. * 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.
  10127. */
  10128. cssChunkFilename?:
  10129. | string
  10130. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10131. /**
  10132. * 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.
  10133. */
  10134. cssFilename?:
  10135. | string
  10136. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10137. /**
  10138. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  10139. */
  10140. devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
  10141. /**
  10142. * Filename template string of function for the sources array in a generated SourceMap.
  10143. */
  10144. devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
  10145. /**
  10146. * 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.
  10147. */
  10148. devtoolNamespace?: string;
  10149. /**
  10150. * List of chunk loading types enabled for use by entry points.
  10151. */
  10152. enabledChunkLoadingTypes?: string[];
  10153. /**
  10154. * List of library types enabled for use by entry points.
  10155. */
  10156. enabledLibraryTypes?: string[];
  10157. /**
  10158. * List of wasm loading types enabled for use by entry points.
  10159. */
  10160. enabledWasmLoadingTypes?: string[];
  10161. /**
  10162. * The abilities of the environment where the webpack generated code should run.
  10163. */
  10164. environment?: Environment;
  10165. /**
  10166. * 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.
  10167. */
  10168. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10169. /**
  10170. * An expression which is used to address the global object/scope in runtime code.
  10171. */
  10172. globalObject?: string;
  10173. /**
  10174. * Digest type used for the hash.
  10175. */
  10176. hashDigest?: string;
  10177. /**
  10178. * Number of chars which are used for the hash.
  10179. */
  10180. hashDigestLength?: number;
  10181. /**
  10182. * Algorithm used for generation the hash (see node.js crypto package).
  10183. */
  10184. hashFunction?: string | typeof Hash;
  10185. /**
  10186. * Any string which is added to the hash to salt it.
  10187. */
  10188. hashSalt?: string;
  10189. /**
  10190. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  10191. */
  10192. hotUpdateChunkFilename?: string;
  10193. /**
  10194. * The global variable used by webpack for loading of hot update chunks.
  10195. */
  10196. hotUpdateGlobal?: string;
  10197. /**
  10198. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  10199. */
  10200. hotUpdateMainFilename?: string;
  10201. /**
  10202. * Ignore warnings in the browser.
  10203. */
  10204. ignoreBrowserWarnings?: boolean;
  10205. /**
  10206. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  10207. */
  10208. iife?: boolean;
  10209. /**
  10210. * The name of the native import() function (can be exchanged for a polyfill).
  10211. */
  10212. importFunctionName?: string;
  10213. /**
  10214. * The name of the native import.meta object (can be exchanged for a polyfill).
  10215. */
  10216. importMetaName?: string;
  10217. /**
  10218. * Make the output files a library, exporting the exports of the entry point.
  10219. */
  10220. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  10221. /**
  10222. * Specify which export should be exposed as library.
  10223. */
  10224. libraryExport?: string | string[];
  10225. /**
  10226. * 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).
  10227. */
  10228. libraryTarget?: string;
  10229. /**
  10230. * Output javascript files as module source type.
  10231. */
  10232. module?: boolean;
  10233. /**
  10234. * The output directory as **absolute path** (required).
  10235. */
  10236. path?: string;
  10237. /**
  10238. * Include comments with information about the modules.
  10239. */
  10240. pathinfo?: boolean | "verbose";
  10241. /**
  10242. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  10243. */
  10244. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10245. /**
  10246. * This option enables loading async chunks via a custom script type, such as script type="module".
  10247. */
  10248. scriptType?: false | "module" | "text/javascript";
  10249. /**
  10250. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  10251. */
  10252. sourceMapFilename?: string;
  10253. /**
  10254. * Prefixes every line of the source in the bundle with this string.
  10255. */
  10256. sourcePrefix?: string;
  10257. /**
  10258. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  10259. */
  10260. strictModuleErrorHandling?: boolean;
  10261. /**
  10262. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  10263. */
  10264. strictModuleExceptionHandling?: boolean;
  10265. /**
  10266. * 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.
  10267. */
  10268. trustedTypes?: string | true | TrustedTypes;
  10269. /**
  10270. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  10271. */
  10272. umdNamedDefine?: boolean;
  10273. /**
  10274. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  10275. */
  10276. uniqueName?: string;
  10277. /**
  10278. * 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).
  10279. */
  10280. wasmLoading?: string | false;
  10281. /**
  10282. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  10283. */
  10284. webassemblyModuleFilename?: string;
  10285. /**
  10286. * 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).
  10287. */
  10288. workerChunkLoading?: string | false;
  10289. /**
  10290. * 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.
  10291. */
  10292. workerPublicPath?: string;
  10293. /**
  10294. * 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).
  10295. */
  10296. workerWasmLoading?: string | false;
  10297. }
  10298. declare interface OutputFileSystem {
  10299. writeFile: WriteFile;
  10300. mkdir: Mkdir;
  10301. readdir?: ReaddirFs;
  10302. rmdir?: Rmdir;
  10303. unlink?: (
  10304. pathLike: PathLikeFs,
  10305. callback: (err: null | NodeJS.ErrnoException) => void
  10306. ) => void;
  10307. stat: StatFs;
  10308. lstat?: LStatFs;
  10309. readFile: ReadFileFs;
  10310. join?: (path1: string, path2: string) => string;
  10311. relative?: (from: string, to: string) => string;
  10312. dirname?: (dirname: string) => string;
  10313. }
  10314. /**
  10315. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  10316. */
  10317. declare interface OutputNormalized {
  10318. /**
  10319. * The filename of asset modules as relative path inside the 'output.path' directory.
  10320. */
  10321. assetModuleFilename?:
  10322. | string
  10323. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10324. /**
  10325. * Enable/disable creating async chunks that are loaded on demand.
  10326. */
  10327. asyncChunks?: boolean;
  10328. /**
  10329. * Add charset attribute for script tag.
  10330. */
  10331. charset?: boolean;
  10332. /**
  10333. * 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.
  10334. */
  10335. chunkFilename?:
  10336. | string
  10337. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10338. /**
  10339. * 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).
  10340. */
  10341. chunkFormat?: string | false;
  10342. /**
  10343. * Number of milliseconds before chunk request expires.
  10344. */
  10345. chunkLoadTimeout?: number;
  10346. /**
  10347. * 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).
  10348. */
  10349. chunkLoading?: string | false;
  10350. /**
  10351. * The global variable used by webpack for loading of chunks.
  10352. */
  10353. chunkLoadingGlobal?: string;
  10354. /**
  10355. * Clean the output directory before emit.
  10356. */
  10357. clean?: boolean | CleanOptions;
  10358. /**
  10359. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  10360. */
  10361. compareBeforeEmit?: boolean;
  10362. /**
  10363. * This option enables cross-origin loading of chunks.
  10364. */
  10365. crossOriginLoading?: false | "anonymous" | "use-credentials";
  10366. /**
  10367. * 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.
  10368. */
  10369. cssChunkFilename?:
  10370. | string
  10371. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10372. /**
  10373. * 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.
  10374. */
  10375. cssFilename?:
  10376. | string
  10377. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10378. /**
  10379. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  10380. */
  10381. devtoolFallbackModuleFilenameTemplate?: string | ((context?: any) => string);
  10382. /**
  10383. * Filename template string of function for the sources array in a generated SourceMap.
  10384. */
  10385. devtoolModuleFilenameTemplate?: string | ((context?: any) => string);
  10386. /**
  10387. * 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.
  10388. */
  10389. devtoolNamespace?: string;
  10390. /**
  10391. * List of chunk loading types enabled for use by entry points.
  10392. */
  10393. enabledChunkLoadingTypes: string[];
  10394. /**
  10395. * List of library types enabled for use by entry points.
  10396. */
  10397. enabledLibraryTypes: string[];
  10398. /**
  10399. * List of wasm loading types enabled for use by entry points.
  10400. */
  10401. enabledWasmLoadingTypes: string[];
  10402. /**
  10403. * The abilities of the environment where the webpack generated code should run.
  10404. */
  10405. environment: Environment;
  10406. /**
  10407. * 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.
  10408. */
  10409. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10410. /**
  10411. * An expression which is used to address the global object/scope in runtime code.
  10412. */
  10413. globalObject?: string;
  10414. /**
  10415. * Digest type used for the hash.
  10416. */
  10417. hashDigest?: string;
  10418. /**
  10419. * Number of chars which are used for the hash.
  10420. */
  10421. hashDigestLength?: number;
  10422. /**
  10423. * Algorithm used for generation the hash (see node.js crypto package).
  10424. */
  10425. hashFunction?: string | typeof Hash;
  10426. /**
  10427. * Any string which is added to the hash to salt it.
  10428. */
  10429. hashSalt?: string;
  10430. /**
  10431. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  10432. */
  10433. hotUpdateChunkFilename?: string;
  10434. /**
  10435. * The global variable used by webpack for loading of hot update chunks.
  10436. */
  10437. hotUpdateGlobal?: string;
  10438. /**
  10439. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  10440. */
  10441. hotUpdateMainFilename?: string;
  10442. /**
  10443. * Ignore warnings in the browser.
  10444. */
  10445. ignoreBrowserWarnings?: boolean;
  10446. /**
  10447. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  10448. */
  10449. iife?: boolean;
  10450. /**
  10451. * The name of the native import() function (can be exchanged for a polyfill).
  10452. */
  10453. importFunctionName?: string;
  10454. /**
  10455. * The name of the native import.meta object (can be exchanged for a polyfill).
  10456. */
  10457. importMetaName?: string;
  10458. /**
  10459. * Options for library.
  10460. */
  10461. library?: LibraryOptions;
  10462. /**
  10463. * Output javascript files as module source type.
  10464. */
  10465. module?: boolean;
  10466. /**
  10467. * The output directory as **absolute path** (required).
  10468. */
  10469. path?: string;
  10470. /**
  10471. * Include comments with information about the modules.
  10472. */
  10473. pathinfo?: boolean | "verbose";
  10474. /**
  10475. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  10476. */
  10477. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  10478. /**
  10479. * This option enables loading async chunks via a custom script type, such as script type="module".
  10480. */
  10481. scriptType?: false | "module" | "text/javascript";
  10482. /**
  10483. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  10484. */
  10485. sourceMapFilename?: string;
  10486. /**
  10487. * Prefixes every line of the source in the bundle with this string.
  10488. */
  10489. sourcePrefix?: string;
  10490. /**
  10491. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  10492. */
  10493. strictModuleErrorHandling?: boolean;
  10494. /**
  10495. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  10496. */
  10497. strictModuleExceptionHandling?: boolean;
  10498. /**
  10499. * Use a Trusted Types policy to create urls for chunks.
  10500. */
  10501. trustedTypes?: TrustedTypes;
  10502. /**
  10503. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  10504. */
  10505. uniqueName?: string;
  10506. /**
  10507. * 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).
  10508. */
  10509. wasmLoading?: string | false;
  10510. /**
  10511. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  10512. */
  10513. webassemblyModuleFilename?: string;
  10514. /**
  10515. * 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).
  10516. */
  10517. workerChunkLoading?: string | false;
  10518. /**
  10519. * 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.
  10520. */
  10521. workerPublicPath?: string;
  10522. /**
  10523. * 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).
  10524. */
  10525. workerWasmLoading?: string | false;
  10526. }
  10527. declare interface ParameterizedComparator<TArg extends object, T> {
  10528. (tArg: TArg): Comparator<T>;
  10529. }
  10530. declare interface ParsedIdentifier {
  10531. request: string;
  10532. query: string;
  10533. fragment: string;
  10534. directory: boolean;
  10535. module: boolean;
  10536. file: boolean;
  10537. internal: boolean;
  10538. }
  10539. declare class Parser {
  10540. constructor();
  10541. parse(
  10542. source: string | Buffer | PreparsedAst,
  10543. state: ParserState
  10544. ): ParserState;
  10545. }
  10546. declare interface ParserOptions {
  10547. [index: string]: any;
  10548. }
  10549. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  10550. ParserOptionsByModuleTypeUnknown;
  10551. /**
  10552. * Specify options for each parser.
  10553. */
  10554. declare interface ParserOptionsByModuleTypeKnown {
  10555. /**
  10556. * Parser options for asset modules.
  10557. */
  10558. asset?: AssetParserOptions;
  10559. /**
  10560. * No parser options are supported for this module type.
  10561. */
  10562. "asset/inline"?: EmptyParserOptions;
  10563. /**
  10564. * No parser options are supported for this module type.
  10565. */
  10566. "asset/resource"?: EmptyParserOptions;
  10567. /**
  10568. * No parser options are supported for this module type.
  10569. */
  10570. "asset/source"?: EmptyParserOptions;
  10571. /**
  10572. * Parser options for css modules.
  10573. */
  10574. css?: CssParserOptions;
  10575. /**
  10576. * Parser options for css/auto modules.
  10577. */
  10578. "css/auto"?: CssAutoParserOptions;
  10579. /**
  10580. * Parser options for css/global modules.
  10581. */
  10582. "css/global"?: CssGlobalParserOptions;
  10583. /**
  10584. * Parser options for css/module modules.
  10585. */
  10586. "css/module"?: CssModuleParserOptions;
  10587. /**
  10588. * Parser options for javascript modules.
  10589. */
  10590. javascript?: JavascriptParserOptions;
  10591. /**
  10592. * Parser options for javascript modules.
  10593. */
  10594. "javascript/auto"?: JavascriptParserOptions;
  10595. /**
  10596. * Parser options for javascript modules.
  10597. */
  10598. "javascript/dynamic"?: JavascriptParserOptions;
  10599. /**
  10600. * Parser options for javascript modules.
  10601. */
  10602. "javascript/esm"?: JavascriptParserOptions;
  10603. }
  10604. /**
  10605. * Specify options for each parser.
  10606. */
  10607. declare interface ParserOptionsByModuleTypeUnknown {
  10608. [index: string]: { [index: string]: any };
  10609. }
  10610. type ParserState = Record<string, any> & ParserStateBase;
  10611. declare interface ParserStateBase {
  10612. source: string | Buffer;
  10613. current: NormalModule;
  10614. module: NormalModule;
  10615. compilation: Compilation;
  10616. options: WebpackOptionsNormalized;
  10617. }
  10618. declare interface PathData {
  10619. chunkGraph?: ChunkGraph;
  10620. hash?: string;
  10621. hashWithLength?: (length: number) => string;
  10622. chunk?: Chunk | ChunkPathData;
  10623. module?: Module | ModulePathData;
  10624. runtime?: RuntimeSpec;
  10625. filename?: string;
  10626. basename?: string;
  10627. query?: string;
  10628. contentHashType?: string;
  10629. contentHash?: string;
  10630. contentHashWithLength?: (length: number) => string;
  10631. noChunkHash?: boolean;
  10632. url?: string;
  10633. }
  10634. type PathLikeFs = string | Buffer | URL;
  10635. type PathLikeTypes = string | URL_url | Buffer;
  10636. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  10637. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  10638. type Pattern =
  10639. | Identifier
  10640. | MemberExpression
  10641. | ObjectPattern
  10642. | ArrayPattern
  10643. | RestElement
  10644. | AssignmentPattern;
  10645. /**
  10646. * Configuration object for web performance recommendations.
  10647. */
  10648. declare interface PerformanceOptions {
  10649. /**
  10650. * Filter function to select assets that are checked.
  10651. */
  10652. assetFilter?: Function;
  10653. /**
  10654. * Sets the format of the hints: warnings, errors or nothing at all.
  10655. */
  10656. hints?: false | "error" | "warning";
  10657. /**
  10658. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  10659. */
  10660. maxAssetSize?: number;
  10661. /**
  10662. * Total size of an entry point (in bytes).
  10663. */
  10664. maxEntrypointSize?: number;
  10665. }
  10666. declare interface PitchLoaderDefinitionFunction<
  10667. OptionsType = {},
  10668. ContextAdditions = {}
  10669. > {
  10670. (
  10671. this: NormalModuleLoaderContext<OptionsType> &
  10672. LoaderRunnerLoaderContext<OptionsType> &
  10673. LoaderPluginLoaderContext &
  10674. HotModuleReplacementPluginLoaderContext &
  10675. ContextAdditions,
  10676. remainingRequest: string,
  10677. previousRequest: string,
  10678. data: object
  10679. ): string | void | Buffer | Promise<string | Buffer>;
  10680. }
  10681. declare class PlatformPlugin {
  10682. constructor(platform: Partial<PlatformTargetProperties>);
  10683. platform: Partial<PlatformTargetProperties>;
  10684. /**
  10685. * Apply the plugin
  10686. */
  10687. apply(compiler: Compiler): void;
  10688. }
  10689. declare interface PlatformTargetProperties {
  10690. /**
  10691. * web platform, importing of http(s) and std: is available
  10692. */
  10693. web?: null | boolean;
  10694. /**
  10695. * browser platform, running in a normal web browser
  10696. */
  10697. browser?: null | boolean;
  10698. /**
  10699. * (Web)Worker platform, running in a web/shared/service worker
  10700. */
  10701. webworker?: null | boolean;
  10702. /**
  10703. * node platform, require of node built-in modules is available
  10704. */
  10705. node?: null | boolean;
  10706. /**
  10707. * nwjs platform, require of legacy nw.gui is available
  10708. */
  10709. nwjs?: null | boolean;
  10710. /**
  10711. * electron platform, require of some electron built-in modules is available
  10712. */
  10713. electron?: null | boolean;
  10714. }
  10715. type Plugin =
  10716. | undefined
  10717. | null
  10718. | false
  10719. | ""
  10720. | 0
  10721. | { apply: (arg0: Resolver) => void }
  10722. | ((this: Resolver, arg1: Resolver) => void);
  10723. declare interface PnpApi {
  10724. resolveToUnqualified: (
  10725. arg0: string,
  10726. arg1: string,
  10727. arg2: object
  10728. ) => null | string;
  10729. }
  10730. declare class PrefetchPlugin {
  10731. constructor(context: string, request?: string);
  10732. context: null | string;
  10733. request: string;
  10734. /**
  10735. * Apply the plugin
  10736. */
  10737. apply(compiler: Compiler): void;
  10738. }
  10739. declare class PrefixSource extends Source {
  10740. constructor(prefix: string, source: string | Source);
  10741. original(): Source;
  10742. getPrefix(): string;
  10743. }
  10744. declare interface PreparsedAst {
  10745. [index: string]: any;
  10746. }
  10747. declare interface PrintedElement {
  10748. element: string;
  10749. content: string;
  10750. }
  10751. declare interface Problem {
  10752. type: ProblemType;
  10753. path: string;
  10754. argument: string;
  10755. value?: string | number | boolean | RegExp;
  10756. index?: number;
  10757. expected?: string;
  10758. }
  10759. type ProblemType =
  10760. | "unknown-argument"
  10761. | "unexpected-non-array-in-path"
  10762. | "unexpected-non-object-in-path"
  10763. | "multiple-values-unexpected"
  10764. | "invalid-value";
  10765. declare interface ProcessAssetsAdditionalOptions {
  10766. additionalAssets?: any;
  10767. }
  10768. declare class Profiler {
  10769. constructor(inspector?: any);
  10770. session: any;
  10771. inspector: any;
  10772. hasSession(): boolean;
  10773. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  10774. sendCommand(method: string, params: Record<string, any>): Promise<any>;
  10775. destroy(): Promise<void>;
  10776. stopProfiling(): Promise<{ profile: any }>;
  10777. }
  10778. declare class ProfilingPlugin {
  10779. constructor(options?: ProfilingPluginOptions);
  10780. outputPath: string;
  10781. /**
  10782. * Apply the plugin
  10783. */
  10784. apply(compiler: Compiler): void;
  10785. static Profiler: typeof Profiler;
  10786. }
  10787. declare interface ProfilingPluginOptions {
  10788. /**
  10789. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  10790. */
  10791. outputPath?: string;
  10792. }
  10793. declare class ProgressPlugin {
  10794. constructor(options?: ProgressPluginArgument);
  10795. profile?: null | boolean;
  10796. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  10797. modulesCount?: number;
  10798. dependenciesCount?: number;
  10799. showEntries?: boolean;
  10800. showModules?: boolean;
  10801. showDependencies?: boolean;
  10802. showActiveModules?: boolean;
  10803. percentBy?: null | "entries" | "modules" | "dependencies";
  10804. apply(compiler: Compiler | MultiCompiler): void;
  10805. static getReporter(
  10806. compiler: Compiler
  10807. ): undefined | ((p: number, ...args: string[]) => void);
  10808. static defaultOptions: {
  10809. profile: boolean;
  10810. modulesCount: number;
  10811. dependenciesCount: number;
  10812. modules: boolean;
  10813. dependencies: boolean;
  10814. activeModules: boolean;
  10815. entries: boolean;
  10816. };
  10817. static createDefaultHandler: (
  10818. profile: undefined | null | boolean,
  10819. logger: WebpackLogger
  10820. ) => (percentage: number, msg: string, ...args: string[]) => void;
  10821. }
  10822. type ProgressPluginArgument =
  10823. | ProgressPluginOptions
  10824. | ((percentage: number, msg: string, ...args: string[]) => void);
  10825. /**
  10826. * Options object for the ProgressPlugin.
  10827. */
  10828. declare interface ProgressPluginOptions {
  10829. /**
  10830. * Show active modules count and one active module in progress message.
  10831. */
  10832. activeModules?: boolean;
  10833. /**
  10834. * Show dependencies count in progress message.
  10835. */
  10836. dependencies?: boolean;
  10837. /**
  10838. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  10839. */
  10840. dependenciesCount?: number;
  10841. /**
  10842. * Show entries count in progress message.
  10843. */
  10844. entries?: boolean;
  10845. /**
  10846. * Function that executes for every progress step.
  10847. */
  10848. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  10849. /**
  10850. * Show modules count in progress message.
  10851. */
  10852. modules?: boolean;
  10853. /**
  10854. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  10855. */
  10856. modulesCount?: number;
  10857. /**
  10858. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  10859. */
  10860. percentBy?: null | "entries" | "modules" | "dependencies";
  10861. /**
  10862. * Collect profile data for progress steps. Default: false.
  10863. */
  10864. profile?: null | boolean;
  10865. }
  10866. declare class ProvidePlugin {
  10867. constructor(definitions: Record<string, string | string[]>);
  10868. definitions: Record<string, string | string[]>;
  10869. /**
  10870. * Apply the plugin
  10871. */
  10872. apply(compiler: Compiler): void;
  10873. }
  10874. declare class ProvideSharedPlugin {
  10875. constructor(options: ProvideSharedPluginOptions);
  10876. /**
  10877. * Apply the plugin
  10878. */
  10879. apply(compiler: Compiler): void;
  10880. }
  10881. declare interface ProvideSharedPluginOptions {
  10882. /**
  10883. * 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.
  10884. */
  10885. provides: Provides;
  10886. /**
  10887. * Share scope name used for all provided modules (defaults to 'default').
  10888. */
  10889. shareScope?: string;
  10890. }
  10891. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  10892. /**
  10893. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  10894. */
  10895. declare interface ProvidesConfig {
  10896. /**
  10897. * 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.
  10898. */
  10899. eager?: boolean;
  10900. /**
  10901. * Key in the share scope under which the shared modules should be stored.
  10902. */
  10903. shareKey?: string;
  10904. /**
  10905. * Share scope name.
  10906. */
  10907. shareScope?: string;
  10908. /**
  10909. * Version of the provided module. Will replace lower matching versions, but not higher.
  10910. */
  10911. version?: string | false;
  10912. }
  10913. /**
  10914. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  10915. */
  10916. declare interface ProvidesObject {
  10917. [index: string]: string | ProvidesConfig;
  10918. }
  10919. declare interface RawChunkGroupOptions {
  10920. preloadOrder?: number;
  10921. prefetchOrder?: number;
  10922. fetchPriority?: "auto" | "low" | "high";
  10923. }
  10924. type RawLoaderDefinition<
  10925. OptionsType = {},
  10926. ContextAdditions = {}
  10927. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  10928. raw: true;
  10929. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  10930. };
  10931. declare interface RawLoaderDefinitionFunction<
  10932. OptionsType = {},
  10933. ContextAdditions = {}
  10934. > {
  10935. (
  10936. this: NormalModuleLoaderContext<OptionsType> &
  10937. LoaderRunnerLoaderContext<OptionsType> &
  10938. LoaderPluginLoaderContext &
  10939. HotModuleReplacementPluginLoaderContext &
  10940. ContextAdditions,
  10941. content: Buffer,
  10942. sourceMap?: string | SourceMap,
  10943. additionalData?: AdditionalData
  10944. ): string | void | Buffer | Promise<string | Buffer>;
  10945. }
  10946. declare class RawSource extends Source {
  10947. constructor(source: string | Buffer, convertToString?: boolean);
  10948. isBuffer(): boolean;
  10949. }
  10950. declare interface RawSourceMap {
  10951. version: number;
  10952. sources: string[];
  10953. names: string[];
  10954. sourceRoot?: string;
  10955. sourcesContent?: string[];
  10956. mappings: string;
  10957. file: string;
  10958. }
  10959. declare interface Read<
  10960. TBuffer extends
  10961. ArrayBufferView<ArrayBufferLike> = ArrayBufferView<ArrayBufferLike>
  10962. > {
  10963. (
  10964. fd: number,
  10965. buffer: TBuffer,
  10966. offset: number,
  10967. length: number,
  10968. position: null | number | bigint,
  10969. callback: (
  10970. err: null | NodeJS.ErrnoException,
  10971. bytesRead: number,
  10972. buffer: TBuffer
  10973. ) => void
  10974. ): void;
  10975. (
  10976. fd: number,
  10977. options: ReadAsyncOptions<TBuffer>,
  10978. callback: (
  10979. err: null | NodeJS.ErrnoException,
  10980. bytesRead: number,
  10981. buffer: TBuffer
  10982. ) => void
  10983. ): void;
  10984. (
  10985. fd: number,
  10986. callback: (
  10987. err: null | NodeJS.ErrnoException,
  10988. bytesRead: number,
  10989. buffer: ArrayBufferView<ArrayBufferLike>
  10990. ) => void
  10991. ): void;
  10992. }
  10993. declare interface ReadAsyncOptions<
  10994. TBuffer extends ArrayBufferView<ArrayBufferLike>
  10995. > {
  10996. offset?: number;
  10997. length?: number;
  10998. position?: null | number | bigint;
  10999. buffer?: TBuffer;
  11000. }
  11001. declare class ReadFileCompileAsyncWasmPlugin {
  11002. constructor(__0?: ReadFileCompileAsyncWasmPluginOptions);
  11003. /**
  11004. * Apply the plugin
  11005. */
  11006. apply(compiler: Compiler): void;
  11007. }
  11008. declare interface ReadFileCompileAsyncWasmPluginOptions {
  11009. /**
  11010. * use import?
  11011. */
  11012. import?: boolean;
  11013. }
  11014. declare class ReadFileCompileWasmPlugin {
  11015. constructor(options?: ReadFileCompileWasmPluginOptions);
  11016. options: ReadFileCompileWasmPluginOptions;
  11017. /**
  11018. * Apply the plugin
  11019. */
  11020. apply(compiler: Compiler): void;
  11021. }
  11022. declare interface ReadFileCompileWasmPluginOptions {
  11023. /**
  11024. * mangle imports
  11025. */
  11026. mangleImports?: boolean;
  11027. /**
  11028. * use import?
  11029. */
  11030. import?: boolean;
  11031. }
  11032. declare interface ReadFileFs {
  11033. (
  11034. path: PathOrFileDescriptorFs,
  11035. options:
  11036. | undefined
  11037. | null
  11038. | ({ encoding?: null; flag?: string } & Abortable),
  11039. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  11040. ): void;
  11041. (
  11042. path: PathOrFileDescriptorFs,
  11043. options:
  11044. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  11045. | "ascii"
  11046. | "utf8"
  11047. | "utf-8"
  11048. | "utf16le"
  11049. | "utf-16le"
  11050. | "ucs2"
  11051. | "ucs-2"
  11052. | "base64"
  11053. | "base64url"
  11054. | "latin1"
  11055. | "binary"
  11056. | "hex",
  11057. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  11058. ): void;
  11059. (
  11060. path: PathOrFileDescriptorFs,
  11061. options:
  11062. | undefined
  11063. | null
  11064. | "ascii"
  11065. | "utf8"
  11066. | "utf-8"
  11067. | "utf16le"
  11068. | "utf-16le"
  11069. | "ucs2"
  11070. | "ucs-2"
  11071. | "base64"
  11072. | "base64url"
  11073. | "latin1"
  11074. | "binary"
  11075. | "hex"
  11076. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  11077. callback: (
  11078. err: null | NodeJS.ErrnoException,
  11079. result?: string | Buffer
  11080. ) => void
  11081. ): void;
  11082. (
  11083. path: PathOrFileDescriptorFs,
  11084. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  11085. ): void;
  11086. }
  11087. declare interface ReadFileSync {
  11088. (
  11089. path: PathOrFileDescriptorFs,
  11090. options?: null | { encoding?: null; flag?: string }
  11091. ): Buffer;
  11092. (
  11093. path: PathOrFileDescriptorFs,
  11094. options:
  11095. | "ascii"
  11096. | "utf8"
  11097. | "utf-8"
  11098. | "utf16le"
  11099. | "utf-16le"
  11100. | "ucs2"
  11101. | "ucs-2"
  11102. | "base64"
  11103. | "base64url"
  11104. | "latin1"
  11105. | "binary"
  11106. | "hex"
  11107. | { encoding: BufferEncoding; flag?: string }
  11108. ): string;
  11109. (
  11110. path: PathOrFileDescriptorFs,
  11111. options?:
  11112. | null
  11113. | "ascii"
  11114. | "utf8"
  11115. | "utf-8"
  11116. | "utf16le"
  11117. | "utf-16le"
  11118. | "ucs2"
  11119. | "ucs-2"
  11120. | "base64"
  11121. | "base64url"
  11122. | "latin1"
  11123. | "binary"
  11124. | "hex"
  11125. | (ObjectEncodingOptions & { flag?: string })
  11126. ): string | Buffer;
  11127. }
  11128. declare interface ReadFileTypes {
  11129. (
  11130. path: PathOrFileDescriptorTypes,
  11131. options:
  11132. | undefined
  11133. | null
  11134. | ({ encoding?: null; flag?: string } & Abortable),
  11135. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11136. ): void;
  11137. (
  11138. path: PathOrFileDescriptorTypes,
  11139. options:
  11140. | "ascii"
  11141. | "utf8"
  11142. | "utf-8"
  11143. | "utf16le"
  11144. | "utf-16le"
  11145. | "ucs2"
  11146. | "ucs-2"
  11147. | "base64"
  11148. | "base64url"
  11149. | "latin1"
  11150. | "binary"
  11151. | "hex"
  11152. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  11153. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11154. ): void;
  11155. (
  11156. path: PathOrFileDescriptorTypes,
  11157. options:
  11158. | undefined
  11159. | null
  11160. | "ascii"
  11161. | "utf8"
  11162. | "utf-8"
  11163. | "utf16le"
  11164. | "utf-16le"
  11165. | "ucs2"
  11166. | "ucs-2"
  11167. | "base64"
  11168. | "base64url"
  11169. | "latin1"
  11170. | "binary"
  11171. | "hex"
  11172. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  11173. callback: (
  11174. arg0: null | NodeJS.ErrnoException,
  11175. arg1?: string | Buffer
  11176. ) => void
  11177. ): void;
  11178. (
  11179. path: PathOrFileDescriptorTypes,
  11180. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11181. ): void;
  11182. }
  11183. declare interface ReaddirFs {
  11184. (
  11185. path: PathLikeFs,
  11186. options:
  11187. | undefined
  11188. | null
  11189. | "ascii"
  11190. | "utf8"
  11191. | "utf-8"
  11192. | "utf16le"
  11193. | "utf-16le"
  11194. | "ucs2"
  11195. | "ucs-2"
  11196. | "base64"
  11197. | "base64url"
  11198. | "latin1"
  11199. | "binary"
  11200. | "hex"
  11201. | {
  11202. encoding:
  11203. | null
  11204. | "ascii"
  11205. | "utf8"
  11206. | "utf-8"
  11207. | "utf16le"
  11208. | "utf-16le"
  11209. | "ucs2"
  11210. | "ucs-2"
  11211. | "base64"
  11212. | "base64url"
  11213. | "latin1"
  11214. | "binary"
  11215. | "hex";
  11216. withFileTypes?: false;
  11217. recursive?: boolean;
  11218. },
  11219. callback: (err: null | NodeJS.ErrnoException, result?: string[]) => void
  11220. ): void;
  11221. (
  11222. path: PathLikeFs,
  11223. options:
  11224. | "buffer"
  11225. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  11226. callback: (err: null | NodeJS.ErrnoException, result?: Buffer[]) => void
  11227. ): void;
  11228. (
  11229. path: PathLikeFs,
  11230. callback: (err: null | NodeJS.ErrnoException, result?: string[]) => void
  11231. ): void;
  11232. (
  11233. path: PathLikeFs,
  11234. options:
  11235. | undefined
  11236. | null
  11237. | "ascii"
  11238. | "utf8"
  11239. | "utf-8"
  11240. | "utf16le"
  11241. | "utf-16le"
  11242. | "ucs2"
  11243. | "ucs-2"
  11244. | "base64"
  11245. | "base64url"
  11246. | "latin1"
  11247. | "binary"
  11248. | "hex"
  11249. | (ObjectEncodingOptions & {
  11250. withFileTypes?: false;
  11251. recursive?: boolean;
  11252. }),
  11253. callback: (
  11254. err: null | NodeJS.ErrnoException,
  11255. result?: string[] | Buffer[]
  11256. ) => void
  11257. ): void;
  11258. (
  11259. path: PathLikeFs,
  11260. options: ObjectEncodingOptions & {
  11261. withFileTypes: true;
  11262. recursive?: boolean;
  11263. },
  11264. callback: (err: null | NodeJS.ErrnoException, result?: Dirent[]) => void
  11265. ): void;
  11266. }
  11267. declare interface ReaddirSync {
  11268. (
  11269. path: PathLikeFs,
  11270. options?:
  11271. | null
  11272. | "ascii"
  11273. | "utf8"
  11274. | "utf-8"
  11275. | "utf16le"
  11276. | "utf-16le"
  11277. | "ucs2"
  11278. | "ucs-2"
  11279. | "base64"
  11280. | "base64url"
  11281. | "latin1"
  11282. | "binary"
  11283. | "hex"
  11284. | {
  11285. encoding:
  11286. | null
  11287. | "ascii"
  11288. | "utf8"
  11289. | "utf-8"
  11290. | "utf16le"
  11291. | "utf-16le"
  11292. | "ucs2"
  11293. | "ucs-2"
  11294. | "base64"
  11295. | "base64url"
  11296. | "latin1"
  11297. | "binary"
  11298. | "hex";
  11299. withFileTypes?: false;
  11300. recursive?: boolean;
  11301. }
  11302. ): string[];
  11303. (
  11304. path: PathLikeFs,
  11305. options:
  11306. | "buffer"
  11307. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  11308. ): Buffer[];
  11309. (
  11310. path: PathLikeFs,
  11311. options?:
  11312. | null
  11313. | "ascii"
  11314. | "utf8"
  11315. | "utf-8"
  11316. | "utf16le"
  11317. | "utf-16le"
  11318. | "ucs2"
  11319. | "ucs-2"
  11320. | "base64"
  11321. | "base64url"
  11322. | "latin1"
  11323. | "binary"
  11324. | "hex"
  11325. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  11326. ): string[] | Buffer[];
  11327. (
  11328. path: PathLikeFs,
  11329. options: ObjectEncodingOptions & {
  11330. withFileTypes: true;
  11331. recursive?: boolean;
  11332. }
  11333. ): Dirent[];
  11334. }
  11335. declare interface ReaddirTypes {
  11336. (
  11337. path: PathLikeTypes,
  11338. options:
  11339. | undefined
  11340. | null
  11341. | "ascii"
  11342. | "utf8"
  11343. | "utf-8"
  11344. | "utf16le"
  11345. | "utf-16le"
  11346. | "ucs2"
  11347. | "ucs-2"
  11348. | "base64"
  11349. | "base64url"
  11350. | "latin1"
  11351. | "binary"
  11352. | "hex"
  11353. | {
  11354. encoding:
  11355. | null
  11356. | "ascii"
  11357. | "utf8"
  11358. | "utf-8"
  11359. | "utf16le"
  11360. | "utf-16le"
  11361. | "ucs2"
  11362. | "ucs-2"
  11363. | "base64"
  11364. | "base64url"
  11365. | "latin1"
  11366. | "binary"
  11367. | "hex";
  11368. withFileTypes?: false;
  11369. recursive?: boolean;
  11370. },
  11371. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  11372. ): void;
  11373. (
  11374. path: PathLikeTypes,
  11375. options:
  11376. | "buffer"
  11377. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  11378. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer[]) => void
  11379. ): void;
  11380. (
  11381. path: PathLikeTypes,
  11382. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string[]) => void
  11383. ): void;
  11384. (
  11385. path: PathLikeTypes,
  11386. options:
  11387. | undefined
  11388. | null
  11389. | "ascii"
  11390. | "utf8"
  11391. | "utf-8"
  11392. | "utf16le"
  11393. | "utf-16le"
  11394. | "ucs2"
  11395. | "ucs-2"
  11396. | "base64"
  11397. | "base64url"
  11398. | "latin1"
  11399. | "binary"
  11400. | "hex"
  11401. | (ObjectEncodingOptions & {
  11402. withFileTypes?: false;
  11403. recursive?: boolean;
  11404. }),
  11405. callback: (
  11406. arg0: null | NodeJS.ErrnoException,
  11407. arg1?: string[] | Buffer[]
  11408. ) => void
  11409. ): void;
  11410. (
  11411. path: PathLikeTypes,
  11412. options: ObjectEncodingOptions & {
  11413. withFileTypes: true;
  11414. recursive?: boolean;
  11415. },
  11416. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Dirent[]) => void
  11417. ): void;
  11418. }
  11419. declare interface ReadlinkFs {
  11420. (
  11421. path: PathLikeFs,
  11422. options: EncodingOption,
  11423. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  11424. ): void;
  11425. (
  11426. path: PathLikeFs,
  11427. options: BufferEncodingOption,
  11428. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  11429. ): void;
  11430. (
  11431. path: PathLikeFs,
  11432. options: EncodingOption,
  11433. callback: (
  11434. err: null | NodeJS.ErrnoException,
  11435. result?: string | Buffer
  11436. ) => void
  11437. ): void;
  11438. (
  11439. path: PathLikeFs,
  11440. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  11441. ): void;
  11442. }
  11443. declare interface ReadlinkSync {
  11444. (path: PathLikeFs, options?: EncodingOption): string;
  11445. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  11446. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  11447. }
  11448. declare interface ReadlinkTypes {
  11449. (
  11450. path: PathLikeTypes,
  11451. options: EncodingOption,
  11452. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11453. ): void;
  11454. (
  11455. path: PathLikeTypes,
  11456. options: BufferEncodingOption,
  11457. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11458. ): void;
  11459. (
  11460. path: PathLikeTypes,
  11461. options: EncodingOption,
  11462. callback: (
  11463. arg0: null | NodeJS.ErrnoException,
  11464. arg1?: string | Buffer
  11465. ) => void
  11466. ): void;
  11467. (
  11468. path: PathLikeTypes,
  11469. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11470. ): void;
  11471. }
  11472. declare class RealContentHashPlugin {
  11473. constructor(__0: RealContentHashPluginOptions);
  11474. /**
  11475. * Apply the plugin
  11476. */
  11477. apply(compiler: Compiler): void;
  11478. static getCompilationHooks(
  11479. compilation: Compilation
  11480. ): CompilationHooksRealContentHashPlugin;
  11481. }
  11482. declare interface RealContentHashPluginOptions {
  11483. /**
  11484. * the hash function to use
  11485. */
  11486. hashFunction: string | typeof Hash;
  11487. /**
  11488. * the hash digest to use
  11489. */
  11490. hashDigest?: string;
  11491. }
  11492. declare interface RealDependencyLocation {
  11493. start: SourcePosition;
  11494. end?: SourcePosition;
  11495. index?: number;
  11496. }
  11497. declare interface RealPathFs {
  11498. (
  11499. path: PathLikeFs,
  11500. options: EncodingOption,
  11501. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  11502. ): void;
  11503. (
  11504. path: PathLikeFs,
  11505. options: BufferEncodingOption,
  11506. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  11507. ): void;
  11508. (
  11509. path: PathLikeFs,
  11510. options: EncodingOption,
  11511. callback: (
  11512. err: null | NodeJS.ErrnoException,
  11513. result?: string | Buffer
  11514. ) => void
  11515. ): void;
  11516. (
  11517. path: PathLikeFs,
  11518. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  11519. ): void;
  11520. }
  11521. declare interface RealPathSync {
  11522. (path: PathLikeFs, options?: EncodingOption): string;
  11523. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  11524. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  11525. }
  11526. declare interface RealPathTypes {
  11527. (
  11528. path: PathLikeTypes,
  11529. options: EncodingOption,
  11530. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11531. ): void;
  11532. (
  11533. path: PathLikeTypes,
  11534. options: BufferEncodingOption,
  11535. callback: (arg0: null | NodeJS.ErrnoException, arg1?: Buffer) => void
  11536. ): void;
  11537. (
  11538. path: PathLikeTypes,
  11539. options: EncodingOption,
  11540. callback: (
  11541. arg0: null | NodeJS.ErrnoException,
  11542. arg1?: string | Buffer
  11543. ) => void
  11544. ): void;
  11545. (
  11546. path: PathLikeTypes,
  11547. callback: (arg0: null | NodeJS.ErrnoException, arg1?: string) => void
  11548. ): void;
  11549. }
  11550. declare interface Records {
  11551. [index: string]: any;
  11552. }
  11553. type RecursiveArrayOrRecord<T> =
  11554. | { [index: string]: RecursiveArrayOrRecord<T> }
  11555. | RecursiveArrayOrRecord<T>[]
  11556. | T;
  11557. declare interface ReferencedExport {
  11558. /**
  11559. * name of the referenced export
  11560. */
  11561. name: string[];
  11562. /**
  11563. * when false, referenced export can not be mangled, defaults to true
  11564. */
  11565. canMangle?: boolean;
  11566. }
  11567. type Remotes = (string | RemotesObject)[] | RemotesObject;
  11568. /**
  11569. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  11570. */
  11571. declare interface RemotesConfig {
  11572. /**
  11573. * Container locations from which modules should be resolved and loaded at runtime.
  11574. */
  11575. external: string | string[];
  11576. /**
  11577. * The name of the share scope shared with this remote.
  11578. */
  11579. shareScope?: string;
  11580. }
  11581. /**
  11582. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  11583. */
  11584. declare interface RemotesObject {
  11585. [index: string]: string | RemotesConfig | string[];
  11586. }
  11587. declare interface RenderBootstrapContext {
  11588. /**
  11589. * the chunk
  11590. */
  11591. chunk: Chunk;
  11592. /**
  11593. * results of code generation
  11594. */
  11595. codeGenerationResults: CodeGenerationResults;
  11596. /**
  11597. * the runtime template
  11598. */
  11599. runtimeTemplate: RuntimeTemplate;
  11600. /**
  11601. * the module graph
  11602. */
  11603. moduleGraph: ModuleGraph;
  11604. /**
  11605. * the chunk graph
  11606. */
  11607. chunkGraph: ChunkGraph;
  11608. /**
  11609. * hash to be used for render call
  11610. */
  11611. hash: string;
  11612. }
  11613. declare interface RenderContextCssModulesPlugin {
  11614. /**
  11615. * the chunk
  11616. */
  11617. chunk: Chunk;
  11618. /**
  11619. * the chunk graph
  11620. */
  11621. chunkGraph: ChunkGraph;
  11622. /**
  11623. * results of code generation
  11624. */
  11625. codeGenerationResults: CodeGenerationResults;
  11626. /**
  11627. * the runtime template
  11628. */
  11629. runtimeTemplate: RuntimeTemplate;
  11630. /**
  11631. * the unique name
  11632. */
  11633. uniqueName: string;
  11634. /**
  11635. * undo path to css file
  11636. */
  11637. undoPath: string;
  11638. /**
  11639. * modules
  11640. */
  11641. modules: CssModule[];
  11642. }
  11643. declare interface RenderContextJavascriptModulesPlugin {
  11644. /**
  11645. * the chunk
  11646. */
  11647. chunk: Chunk;
  11648. /**
  11649. * the dependency templates
  11650. */
  11651. dependencyTemplates: DependencyTemplates;
  11652. /**
  11653. * the runtime template
  11654. */
  11655. runtimeTemplate: RuntimeTemplate;
  11656. /**
  11657. * the module graph
  11658. */
  11659. moduleGraph: ModuleGraph;
  11660. /**
  11661. * the chunk graph
  11662. */
  11663. chunkGraph: ChunkGraph;
  11664. /**
  11665. * results of code generation
  11666. */
  11667. codeGenerationResults: CodeGenerationResults;
  11668. /**
  11669. * rendering in strict context
  11670. */
  11671. strictMode?: boolean;
  11672. }
  11673. type RenderManifestEntry =
  11674. | RenderManifestEntryTemplated
  11675. | RenderManifestEntryStatic;
  11676. declare interface RenderManifestEntryStatic {
  11677. render: () => Source;
  11678. filename: string;
  11679. info: AssetInfo;
  11680. identifier: string;
  11681. hash?: string;
  11682. auxiliary?: boolean;
  11683. }
  11684. declare interface RenderManifestEntryTemplated {
  11685. render: () => Source;
  11686. filenameTemplate: TemplatePath;
  11687. pathOptions?: PathData;
  11688. info?: AssetInfo;
  11689. identifier: string;
  11690. hash?: string;
  11691. auxiliary?: boolean;
  11692. }
  11693. declare interface RenderManifestOptions {
  11694. /**
  11695. * the chunk used to render
  11696. */
  11697. chunk: Chunk;
  11698. hash: string;
  11699. fullHash: string;
  11700. outputOptions: Output;
  11701. codeGenerationResults: CodeGenerationResults;
  11702. moduleTemplates: { javascript: ModuleTemplate };
  11703. dependencyTemplates: DependencyTemplates;
  11704. runtimeTemplate: RuntimeTemplate;
  11705. moduleGraph: ModuleGraph;
  11706. chunkGraph: ChunkGraph;
  11707. }
  11708. declare class ReplaceSource extends Source {
  11709. constructor(source: Source, name?: string);
  11710. replace(start: number, end: number, newValue: string, name?: string): void;
  11711. insert(pos: number, newValue: string, name?: string): void;
  11712. getName(): string;
  11713. original(): string;
  11714. getReplacements(): {
  11715. start: number;
  11716. end: number;
  11717. content: string;
  11718. insertIndex: number;
  11719. name: string;
  11720. }[];
  11721. }
  11722. declare interface RequestRecord {
  11723. [index: string]: string | string[];
  11724. }
  11725. declare abstract class RequestShortener {
  11726. contextify: (value: string) => string;
  11727. shorten(request?: null | string): undefined | null | string;
  11728. }
  11729. declare interface ResolveBuildDependenciesResult {
  11730. /**
  11731. * list of files
  11732. */
  11733. files: Set<string>;
  11734. /**
  11735. * list of directories
  11736. */
  11737. directories: Set<string>;
  11738. /**
  11739. * list of missing entries
  11740. */
  11741. missing: Set<string>;
  11742. /**
  11743. * stored resolve results
  11744. */
  11745. resolveResults: Map<string, undefined | string | false>;
  11746. /**
  11747. * dependencies of the resolving
  11748. */
  11749. resolveDependencies: ResolveDependencies;
  11750. }
  11751. declare interface ResolveContext {
  11752. contextDependencies?: WriteOnlySet<string>;
  11753. /**
  11754. * files that was found on file system
  11755. */
  11756. fileDependencies?: WriteOnlySet<string>;
  11757. /**
  11758. * dependencies that was not found on file system
  11759. */
  11760. missingDependencies?: WriteOnlySet<string>;
  11761. /**
  11762. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  11763. */
  11764. stack?: Set<string>;
  11765. /**
  11766. * log function
  11767. */
  11768. log?: (arg0: string) => void;
  11769. /**
  11770. * yield result, if provided plugins can return several results
  11771. */
  11772. yield?: (arg0: ResolveRequest) => void;
  11773. }
  11774. declare interface ResolveData {
  11775. contextInfo: ModuleFactoryCreateDataContextInfo;
  11776. resolveOptions?: ResolveOptions;
  11777. context: string;
  11778. request: string;
  11779. assertions?: ImportAttributes;
  11780. dependencies: ModuleDependency[];
  11781. dependencyType: string;
  11782. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  11783. fileDependencies: LazySet<string>;
  11784. missingDependencies: LazySet<string>;
  11785. contextDependencies: LazySet<string>;
  11786. ignoredModule?: Module;
  11787. /**
  11788. * allow to use the unsafe cache
  11789. */
  11790. cacheable: boolean;
  11791. }
  11792. declare interface ResolveDependencies {
  11793. /**
  11794. * list of files
  11795. */
  11796. files: Set<string>;
  11797. /**
  11798. * list of directories
  11799. */
  11800. directories: Set<string>;
  11801. /**
  11802. * list of missing entries
  11803. */
  11804. missing: Set<string>;
  11805. }
  11806. /**
  11807. * Options object for resolving requests.
  11808. */
  11809. declare interface ResolveOptions {
  11810. /**
  11811. * Redirect module requests.
  11812. */
  11813. alias?:
  11814. | {
  11815. /**
  11816. * New request.
  11817. */
  11818. alias: string | false | string[];
  11819. /**
  11820. * Request to be redirected.
  11821. */
  11822. name: string;
  11823. /**
  11824. * Redirect only exact matching request.
  11825. */
  11826. onlyModule?: boolean;
  11827. }[]
  11828. | { [index: string]: string | false | string[] };
  11829. /**
  11830. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  11831. */
  11832. aliasFields?: (string | string[])[];
  11833. /**
  11834. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  11835. */
  11836. byDependency?: { [index: string]: ResolveOptions };
  11837. /**
  11838. * Enable caching of successfully resolved requests (cache entries are revalidated).
  11839. */
  11840. cache?: boolean;
  11841. /**
  11842. * Predicate function to decide which requests should be cached.
  11843. */
  11844. cachePredicate?: (request: ResolveRequest) => boolean;
  11845. /**
  11846. * Include the context information in the cache identifier when caching.
  11847. */
  11848. cacheWithContext?: boolean;
  11849. /**
  11850. * Condition names for exports field entry point.
  11851. */
  11852. conditionNames?: string[];
  11853. /**
  11854. * Filenames used to find a description file (like a package.json).
  11855. */
  11856. descriptionFiles?: string[];
  11857. /**
  11858. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  11859. */
  11860. enforceExtension?: boolean;
  11861. /**
  11862. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  11863. */
  11864. exportsFields?: string[];
  11865. /**
  11866. * An object which maps extension to extension aliases.
  11867. */
  11868. extensionAlias?: { [index: string]: string | string[] };
  11869. /**
  11870. * Extensions added to the request when trying to find the file.
  11871. */
  11872. extensions?: string[];
  11873. /**
  11874. * Redirect module requests when normal resolving fails.
  11875. */
  11876. fallback?:
  11877. | {
  11878. /**
  11879. * New request.
  11880. */
  11881. alias: string | false | string[];
  11882. /**
  11883. * Request to be redirected.
  11884. */
  11885. name: string;
  11886. /**
  11887. * Redirect only exact matching request.
  11888. */
  11889. onlyModule?: boolean;
  11890. }[]
  11891. | { [index: string]: string | false | string[] };
  11892. /**
  11893. * Filesystem for the resolver.
  11894. */
  11895. fileSystem?: InputFileSystem;
  11896. /**
  11897. * 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).
  11898. */
  11899. fullySpecified?: boolean;
  11900. /**
  11901. * 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).
  11902. */
  11903. importsFields?: string[];
  11904. /**
  11905. * Field names from the description file (package.json) which are used to find the default entry point.
  11906. */
  11907. mainFields?: (string | string[])[];
  11908. /**
  11909. * Filenames used to find the default entry point if there is no description file or main field.
  11910. */
  11911. mainFiles?: string[];
  11912. /**
  11913. * Folder names or directory paths where to find modules.
  11914. */
  11915. modules?: string[];
  11916. /**
  11917. * Plugins for the resolver.
  11918. */
  11919. plugins?: (
  11920. | undefined
  11921. | null
  11922. | false
  11923. | ""
  11924. | 0
  11925. | {
  11926. [index: string]: any;
  11927. /**
  11928. * The run point of the plugin, required method.
  11929. */
  11930. apply: (arg0: Resolver) => void;
  11931. }
  11932. | ((this: Resolver, arg1: Resolver) => void)
  11933. | "..."
  11934. )[];
  11935. /**
  11936. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  11937. */
  11938. preferAbsolute?: boolean;
  11939. /**
  11940. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  11941. */
  11942. preferRelative?: boolean;
  11943. /**
  11944. * Custom resolver.
  11945. */
  11946. resolver?: Resolver;
  11947. /**
  11948. * 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.
  11949. */
  11950. restrictions?: (string | RegExp)[];
  11951. /**
  11952. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  11953. */
  11954. roots?: string[];
  11955. /**
  11956. * Enable resolving symlinks to the original location.
  11957. */
  11958. symlinks?: boolean;
  11959. /**
  11960. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  11961. */
  11962. unsafeCache?: boolean | { [index: string]: any };
  11963. /**
  11964. * Use synchronous filesystem calls for the resolver.
  11965. */
  11966. useSyncFileSystemCalls?: boolean;
  11967. }
  11968. declare interface ResolveOptionsResolverFactoryObject1 {
  11969. alias: AliasOption[];
  11970. fallback: AliasOption[];
  11971. aliasFields: Set<string | string[]>;
  11972. extensionAlias: ExtensionAliasOption[];
  11973. cachePredicate: (arg0: ResolveRequest) => boolean;
  11974. cacheWithContext: boolean;
  11975. /**
  11976. * A list of exports field condition names.
  11977. */
  11978. conditionNames: Set<string>;
  11979. descriptionFiles: string[];
  11980. enforceExtension: boolean;
  11981. exportsFields: Set<string | string[]>;
  11982. importsFields: Set<string | string[]>;
  11983. extensions: Set<string>;
  11984. fileSystem: FileSystem;
  11985. unsafeCache: false | object;
  11986. symlinks: boolean;
  11987. resolver?: Resolver;
  11988. modules: (string | string[])[];
  11989. mainFields: { name: string[]; forceRelative: boolean }[];
  11990. mainFiles: Set<string>;
  11991. plugins: Plugin[];
  11992. pnpApi: null | PnpApi;
  11993. roots: Set<string>;
  11994. fullySpecified: boolean;
  11995. resolveToContext: boolean;
  11996. restrictions: Set<string | RegExp>;
  11997. preferRelative: boolean;
  11998. preferAbsolute: boolean;
  11999. }
  12000. declare interface ResolveOptionsResolverFactoryObject2 {
  12001. /**
  12002. * A list of module alias configurations or an object which maps key to value
  12003. */
  12004. alias?: AliasOption[] | AliasOptions;
  12005. /**
  12006. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  12007. */
  12008. fallback?: AliasOption[] | AliasOptions;
  12009. /**
  12010. * An object which maps extension to extension aliases
  12011. */
  12012. extensionAlias?: ExtensionAliasOptions;
  12013. /**
  12014. * A list of alias fields in description files
  12015. */
  12016. aliasFields?: (string | string[])[];
  12017. /**
  12018. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  12019. */
  12020. cachePredicate?: (arg0: ResolveRequest) => boolean;
  12021. /**
  12022. * Whether or not the unsafeCache should include request context as part of the cache key.
  12023. */
  12024. cacheWithContext?: boolean;
  12025. /**
  12026. * A list of description files to read from
  12027. */
  12028. descriptionFiles?: string[];
  12029. /**
  12030. * A list of exports field condition names.
  12031. */
  12032. conditionNames?: string[];
  12033. /**
  12034. * Enforce that a extension from extensions must be used
  12035. */
  12036. enforceExtension?: boolean;
  12037. /**
  12038. * A list of exports fields in description files
  12039. */
  12040. exportsFields?: (string | string[])[];
  12041. /**
  12042. * A list of imports fields in description files
  12043. */
  12044. importsFields?: (string | string[])[];
  12045. /**
  12046. * A list of extensions which should be tried for files
  12047. */
  12048. extensions?: string[];
  12049. /**
  12050. * The file system which should be used
  12051. */
  12052. fileSystem: FileSystem;
  12053. /**
  12054. * Use this cache object to unsafely cache the successful requests
  12055. */
  12056. unsafeCache?: boolean | object;
  12057. /**
  12058. * Resolve symlinks to their symlinked location
  12059. */
  12060. symlinks?: boolean;
  12061. /**
  12062. * A prepared Resolver to which the plugins are attached
  12063. */
  12064. resolver?: Resolver;
  12065. /**
  12066. * A list of directories to resolve modules from, can be absolute path or folder name
  12067. */
  12068. modules?: string | string[];
  12069. /**
  12070. * A list of main fields in description files
  12071. */
  12072. mainFields?: (
  12073. | string
  12074. | string[]
  12075. | { name: string | string[]; forceRelative: boolean }
  12076. )[];
  12077. /**
  12078. * A list of main files in directories
  12079. */
  12080. mainFiles?: string[];
  12081. /**
  12082. * A list of additional resolve plugins which should be applied
  12083. */
  12084. plugins?: Plugin[];
  12085. /**
  12086. * A PnP API that should be used - null is "never", undefined is "auto"
  12087. */
  12088. pnpApi?: null | PnpApi;
  12089. /**
  12090. * A list of root paths
  12091. */
  12092. roots?: string[];
  12093. /**
  12094. * The request is already fully specified and no extensions or directories are resolved for it
  12095. */
  12096. fullySpecified?: boolean;
  12097. /**
  12098. * Resolve to a context instead of a file
  12099. */
  12100. resolveToContext?: boolean;
  12101. /**
  12102. * A list of resolve restrictions
  12103. */
  12104. restrictions?: (string | RegExp)[];
  12105. /**
  12106. * Use only the sync constraints of the file system calls
  12107. */
  12108. useSyncFileSystemCalls?: boolean;
  12109. /**
  12110. * Prefer to resolve module requests as relative requests before falling back to modules
  12111. */
  12112. preferRelative?: boolean;
  12113. /**
  12114. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  12115. */
  12116. preferAbsolute?: boolean;
  12117. }
  12118. type ResolveOptionsWithDependencyType = ResolveOptions & {
  12119. dependencyType?: string;
  12120. resolveToContext?: boolean;
  12121. };
  12122. type ResolvePluginInstance =
  12123. | {
  12124. [index: string]: any;
  12125. /**
  12126. * The run point of the plugin, required method.
  12127. */
  12128. apply: (arg0: Resolver) => void;
  12129. }
  12130. | ((this: Resolver, arg1: Resolver) => void);
  12131. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  12132. declare interface ResolvedContextFileSystemInfoEntry {
  12133. safeTime: number;
  12134. timestampHash?: string;
  12135. }
  12136. declare interface ResolvedContextTimestampAndHash {
  12137. safeTime: number;
  12138. timestampHash?: string;
  12139. hash: string;
  12140. }
  12141. declare interface ResolvedOptions {
  12142. /**
  12143. * - platform target properties
  12144. */
  12145. platform: false | PlatformTargetProperties;
  12146. }
  12147. declare abstract class Resolver {
  12148. fileSystem: FileSystem;
  12149. options: ResolveOptionsResolverFactoryObject1;
  12150. hooks: KnownHooks;
  12151. ensureHook(
  12152. name:
  12153. | string
  12154. | AsyncSeriesBailHook<
  12155. [ResolveRequest, ResolveContext],
  12156. null | ResolveRequest
  12157. >
  12158. ): AsyncSeriesBailHook<
  12159. [ResolveRequest, ResolveContext],
  12160. null | ResolveRequest
  12161. >;
  12162. getHook(
  12163. name:
  12164. | string
  12165. | AsyncSeriesBailHook<
  12166. [ResolveRequest, ResolveContext],
  12167. null | ResolveRequest
  12168. >
  12169. ): AsyncSeriesBailHook<
  12170. [ResolveRequest, ResolveContext],
  12171. null | ResolveRequest
  12172. >;
  12173. resolveSync(context: object, path: string, request: string): string | false;
  12174. resolve(
  12175. context: object,
  12176. path: string,
  12177. request: string,
  12178. resolveContext: ResolveContext,
  12179. callback: (
  12180. err: null | ErrorWithDetail,
  12181. res?: string | false,
  12182. req?: ResolveRequest
  12183. ) => void
  12184. ): void;
  12185. doResolve(
  12186. hook: AsyncSeriesBailHook<
  12187. [ResolveRequest, ResolveContext],
  12188. null | ResolveRequest
  12189. >,
  12190. request: ResolveRequest,
  12191. message: null | string,
  12192. resolveContext: ResolveContext,
  12193. callback: (err?: null | Error, result?: ResolveRequest) => void
  12194. ): void;
  12195. parse(identifier: string): ParsedIdentifier;
  12196. isModule(path: string): boolean;
  12197. isPrivate(path: string): boolean;
  12198. isDirectory(path: string): boolean;
  12199. join(path: string, request: string): string;
  12200. normalize(path: string): string;
  12201. }
  12202. declare interface ResolverCache {
  12203. direct: WeakMap<ResolveOptionsWithDependencyType, ResolverWithOptions>;
  12204. stringified: Map<string, ResolverWithOptions>;
  12205. }
  12206. declare abstract class ResolverFactory {
  12207. hooks: Readonly<{
  12208. resolveOptions: HookMap<
  12209. SyncWaterfallHook<[ResolveOptionsWithDependencyType]>
  12210. >;
  12211. resolver: HookMap<
  12212. SyncHook<
  12213. [
  12214. Resolver,
  12215. ResolveOptionsResolverFactoryObject2,
  12216. ResolveOptionsWithDependencyType
  12217. ]
  12218. >
  12219. >;
  12220. }>;
  12221. cache: Map<string, ResolverCache>;
  12222. get(
  12223. type: string,
  12224. resolveOptions?: ResolveOptionsWithDependencyType
  12225. ): ResolverWithOptions;
  12226. }
  12227. type ResolverWithOptions = Resolver & WithOptions;
  12228. declare interface ResourceDataWithData {
  12229. resource: string;
  12230. path?: string;
  12231. query?: string;
  12232. fragment?: string;
  12233. context?: string;
  12234. data: Record<string, any>;
  12235. }
  12236. declare abstract class RestoreProvidedData {
  12237. exports: any[];
  12238. otherProvided?: null | boolean;
  12239. otherCanMangleProvide?: boolean;
  12240. otherTerminalBinding: boolean;
  12241. serialize(__0: ObjectSerializerContext): void;
  12242. }
  12243. declare interface RmDirOptions {
  12244. maxRetries?: number;
  12245. recursive?: boolean;
  12246. retryDelay?: number;
  12247. }
  12248. declare interface Rmdir {
  12249. (
  12250. file: PathLikeFs,
  12251. callback: (err: null | NodeJS.ErrnoException) => void
  12252. ): void;
  12253. (
  12254. file: PathLikeFs,
  12255. options: RmDirOptions,
  12256. callback: (err: null | NodeJS.ErrnoException) => void
  12257. ): void;
  12258. }
  12259. type Rule = string | RegExp;
  12260. declare interface RuleSet {
  12261. /**
  12262. * map of references in the rule set (may grow over time)
  12263. */
  12264. references: Map<string, RuleSetLoaderOptions>;
  12265. /**
  12266. * execute the rule set
  12267. */
  12268. exec: (effectData: EffectData) => Effect[];
  12269. }
  12270. type RuleSetCondition =
  12271. | string
  12272. | RegExp
  12273. | ((value: string) => boolean)
  12274. | RuleSetLogicalConditions
  12275. | RuleSetCondition[];
  12276. type RuleSetConditionAbsolute =
  12277. | string
  12278. | RegExp
  12279. | ((value: string) => boolean)
  12280. | RuleSetLogicalConditionsAbsolute
  12281. | RuleSetConditionAbsolute[];
  12282. type RuleSetConditionOrConditions =
  12283. | string
  12284. | RegExp
  12285. | ((value: string) => boolean)
  12286. | RuleSetLogicalConditions
  12287. | RuleSetCondition[];
  12288. type RuleSetLoaderOptions = string | { [index: string]: any };
  12289. /**
  12290. * Logic operators used in a condition matcher.
  12291. */
  12292. declare interface RuleSetLogicalConditions {
  12293. /**
  12294. * Logical AND.
  12295. */
  12296. and?: RuleSetCondition[];
  12297. /**
  12298. * Logical NOT.
  12299. */
  12300. not?:
  12301. | string
  12302. | RegExp
  12303. | ((value: string) => boolean)
  12304. | RuleSetLogicalConditions
  12305. | RuleSetCondition[];
  12306. /**
  12307. * Logical OR.
  12308. */
  12309. or?: RuleSetCondition[];
  12310. }
  12311. /**
  12312. * Logic operators used in a condition matcher.
  12313. */
  12314. declare interface RuleSetLogicalConditionsAbsolute {
  12315. /**
  12316. * Logical AND.
  12317. */
  12318. and?: RuleSetConditionAbsolute[];
  12319. /**
  12320. * Logical NOT.
  12321. */
  12322. not?:
  12323. | string
  12324. | RegExp
  12325. | ((value: string) => boolean)
  12326. | RuleSetLogicalConditionsAbsolute
  12327. | RuleSetConditionAbsolute[];
  12328. /**
  12329. * Logical OR.
  12330. */
  12331. or?: RuleSetConditionAbsolute[];
  12332. }
  12333. /**
  12334. * A rule description with conditions and effects for modules.
  12335. */
  12336. declare interface RuleSetRule {
  12337. /**
  12338. * Match on import assertions of the dependency.
  12339. */
  12340. assert?: { [index: string]: RuleSetConditionOrConditions };
  12341. /**
  12342. * Match the child compiler name.
  12343. */
  12344. compiler?:
  12345. | string
  12346. | RegExp
  12347. | ((value: string) => boolean)
  12348. | RuleSetLogicalConditions
  12349. | RuleSetCondition[];
  12350. /**
  12351. * Match dependency type.
  12352. */
  12353. dependency?:
  12354. | string
  12355. | RegExp
  12356. | ((value: string) => boolean)
  12357. | RuleSetLogicalConditions
  12358. | RuleSetCondition[];
  12359. /**
  12360. * Match values of properties in the description file (usually package.json).
  12361. */
  12362. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  12363. /**
  12364. * Enforce this rule as pre or post step.
  12365. */
  12366. enforce?: "pre" | "post";
  12367. /**
  12368. * Shortcut for resource.exclude.
  12369. */
  12370. exclude?:
  12371. | string
  12372. | RegExp
  12373. | ((value: string) => boolean)
  12374. | RuleSetLogicalConditionsAbsolute
  12375. | RuleSetConditionAbsolute[];
  12376. /**
  12377. * The options for the module generator.
  12378. */
  12379. generator?: { [index: string]: any };
  12380. /**
  12381. * Shortcut for resource.include.
  12382. */
  12383. include?:
  12384. | string
  12385. | RegExp
  12386. | ((value: string) => boolean)
  12387. | RuleSetLogicalConditionsAbsolute
  12388. | RuleSetConditionAbsolute[];
  12389. /**
  12390. * Match the issuer of the module (The module pointing to this module).
  12391. */
  12392. issuer?:
  12393. | string
  12394. | RegExp
  12395. | ((value: string) => boolean)
  12396. | RuleSetLogicalConditionsAbsolute
  12397. | RuleSetConditionAbsolute[];
  12398. /**
  12399. * Match layer of the issuer of this module (The module pointing to this module).
  12400. */
  12401. issuerLayer?:
  12402. | string
  12403. | RegExp
  12404. | ((value: string) => boolean)
  12405. | RuleSetLogicalConditions
  12406. | RuleSetCondition[];
  12407. /**
  12408. * Specifies the layer in which the module should be placed in.
  12409. */
  12410. layer?: string;
  12411. /**
  12412. * Shortcut for use.loader.
  12413. */
  12414. loader?: string;
  12415. /**
  12416. * Match module mimetype when load from Data URI.
  12417. */
  12418. mimetype?:
  12419. | string
  12420. | RegExp
  12421. | ((value: string) => boolean)
  12422. | RuleSetLogicalConditions
  12423. | RuleSetCondition[];
  12424. /**
  12425. * Only execute the first matching rule in this array.
  12426. */
  12427. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  12428. /**
  12429. * Shortcut for use.options.
  12430. */
  12431. options?: string | { [index: string]: any };
  12432. /**
  12433. * Options for parsing.
  12434. */
  12435. parser?: { [index: string]: any };
  12436. /**
  12437. * Match the real resource path of the module.
  12438. */
  12439. realResource?:
  12440. | string
  12441. | RegExp
  12442. | ((value: string) => boolean)
  12443. | RuleSetLogicalConditionsAbsolute
  12444. | RuleSetConditionAbsolute[];
  12445. /**
  12446. * Options for the resolver.
  12447. */
  12448. resolve?: ResolveOptions;
  12449. /**
  12450. * Match the resource path of the module.
  12451. */
  12452. resource?:
  12453. | string
  12454. | RegExp
  12455. | ((value: string) => boolean)
  12456. | RuleSetLogicalConditionsAbsolute
  12457. | RuleSetConditionAbsolute[];
  12458. /**
  12459. * Match the resource fragment of the module.
  12460. */
  12461. resourceFragment?:
  12462. | string
  12463. | RegExp
  12464. | ((value: string) => boolean)
  12465. | RuleSetLogicalConditions
  12466. | RuleSetCondition[];
  12467. /**
  12468. * Match the resource query of the module.
  12469. */
  12470. resourceQuery?:
  12471. | string
  12472. | RegExp
  12473. | ((value: string) => boolean)
  12474. | RuleSetLogicalConditions
  12475. | RuleSetCondition[];
  12476. /**
  12477. * Match and execute these rules when this rule is matched.
  12478. */
  12479. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  12480. /**
  12481. * Match module scheme.
  12482. */
  12483. scheme?:
  12484. | string
  12485. | RegExp
  12486. | ((value: string) => boolean)
  12487. | RuleSetLogicalConditions
  12488. | RuleSetCondition[];
  12489. /**
  12490. * Flags a module as with or without side effects.
  12491. */
  12492. sideEffects?: boolean;
  12493. /**
  12494. * Shortcut for resource.test.
  12495. */
  12496. test?:
  12497. | string
  12498. | RegExp
  12499. | ((value: string) => boolean)
  12500. | RuleSetLogicalConditionsAbsolute
  12501. | RuleSetConditionAbsolute[];
  12502. /**
  12503. * Module type to use for the module.
  12504. */
  12505. type?: string;
  12506. /**
  12507. * Modifiers applied to the module when rule is matched.
  12508. */
  12509. use?:
  12510. | string
  12511. | (
  12512. | undefined
  12513. | null
  12514. | string
  12515. | false
  12516. | 0
  12517. | {
  12518. /**
  12519. * Unique loader options identifier.
  12520. */
  12521. ident?: string;
  12522. /**
  12523. * Loader name.
  12524. */
  12525. loader?: string;
  12526. /**
  12527. * Loader options.
  12528. */
  12529. options?: string | { [index: string]: any };
  12530. }
  12531. | ((data: object) =>
  12532. | string
  12533. | {
  12534. /**
  12535. * Unique loader options identifier.
  12536. */
  12537. ident?: string;
  12538. /**
  12539. * Loader name.
  12540. */
  12541. loader?: string;
  12542. /**
  12543. * Loader options.
  12544. */
  12545. options?: string | { [index: string]: any };
  12546. }
  12547. | __TypeWebpackOptions
  12548. | __Type_2[])
  12549. )[]
  12550. | ((data: {
  12551. resource: string;
  12552. realResource: string;
  12553. resourceQuery: string;
  12554. issuer: string;
  12555. compiler: string;
  12556. }) => __Type_2[])
  12557. | {
  12558. /**
  12559. * Unique loader options identifier.
  12560. */
  12561. ident?: string;
  12562. /**
  12563. * Loader name.
  12564. */
  12565. loader?: string;
  12566. /**
  12567. * Loader options.
  12568. */
  12569. options?: string | { [index: string]: any };
  12570. }
  12571. | __TypeWebpackOptions;
  12572. /**
  12573. * Match on import attributes of the dependency.
  12574. */
  12575. with?: { [index: string]: RuleSetConditionOrConditions };
  12576. }
  12577. type RuleSetUse =
  12578. | string
  12579. | (
  12580. | undefined
  12581. | null
  12582. | string
  12583. | false
  12584. | 0
  12585. | {
  12586. /**
  12587. * Unique loader options identifier.
  12588. */
  12589. ident?: string;
  12590. /**
  12591. * Loader name.
  12592. */
  12593. loader?: string;
  12594. /**
  12595. * Loader options.
  12596. */
  12597. options?: string | { [index: string]: any };
  12598. }
  12599. | ((data: object) =>
  12600. | string
  12601. | {
  12602. /**
  12603. * Unique loader options identifier.
  12604. */
  12605. ident?: string;
  12606. /**
  12607. * Loader name.
  12608. */
  12609. loader?: string;
  12610. /**
  12611. * Loader options.
  12612. */
  12613. options?: string | { [index: string]: any };
  12614. }
  12615. | __TypeWebpackOptions
  12616. | __Type_2[])
  12617. )[]
  12618. | ((data: {
  12619. resource: string;
  12620. realResource: string;
  12621. resourceQuery: string;
  12622. issuer: string;
  12623. compiler: string;
  12624. }) => __Type_2[])
  12625. | {
  12626. /**
  12627. * Unique loader options identifier.
  12628. */
  12629. ident?: string;
  12630. /**
  12631. * Loader name.
  12632. */
  12633. loader?: string;
  12634. /**
  12635. * Loader options.
  12636. */
  12637. options?: string | { [index: string]: any };
  12638. }
  12639. | __TypeWebpackOptions;
  12640. type RuleSetUseItem =
  12641. | string
  12642. | {
  12643. /**
  12644. * Unique loader options identifier.
  12645. */
  12646. ident?: string;
  12647. /**
  12648. * Loader name.
  12649. */
  12650. loader?: string;
  12651. /**
  12652. * Loader options.
  12653. */
  12654. options?: string | { [index: string]: any };
  12655. }
  12656. | __TypeWebpackOptions;
  12657. declare interface RunCallback<T> {
  12658. (err: null | Error, result?: T): any;
  12659. }
  12660. declare class RuntimeChunkPlugin {
  12661. constructor(options: { name?: (entrypoint: { name: string }) => string });
  12662. options: {
  12663. name:
  12664. | ((entrypoint: { name: string }) => string)
  12665. | ((entrypoint: Entrypoint) => string);
  12666. };
  12667. /**
  12668. * Apply the plugin
  12669. */
  12670. apply(compiler: Compiler): void;
  12671. }
  12672. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  12673. declare class RuntimeModule extends Module {
  12674. constructor(name: string, stage?: number);
  12675. name: string;
  12676. stage: number;
  12677. compilation?: Compilation;
  12678. chunk?: Chunk;
  12679. chunkGraph?: ChunkGraph;
  12680. fullHash: boolean;
  12681. dependentHash: boolean;
  12682. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  12683. generate(): null | string;
  12684. getGeneratedCode(): null | string;
  12685. shouldIsolate(): boolean;
  12686. /**
  12687. * Runtime modules without any dependencies to other runtime modules
  12688. */
  12689. static STAGE_NORMAL: number;
  12690. /**
  12691. * Runtime modules with simple dependencies on other runtime modules
  12692. */
  12693. static STAGE_BASIC: number;
  12694. /**
  12695. * Runtime modules which attach to handlers of other runtime modules
  12696. */
  12697. static STAGE_ATTACH: number;
  12698. /**
  12699. * Runtime modules which trigger actions on bootstrap
  12700. */
  12701. static STAGE_TRIGGER: number;
  12702. }
  12703. declare interface RuntimeRequirementsContext {
  12704. /**
  12705. * the chunk graph
  12706. */
  12707. chunkGraph: ChunkGraph;
  12708. /**
  12709. * the code generation results
  12710. */
  12711. codeGenerationResults: CodeGenerationResults;
  12712. }
  12713. type RuntimeSpec = undefined | string | SortableSet<string>;
  12714. declare class RuntimeSpecMap<T, R = T> {
  12715. constructor(clone?: RuntimeSpecMap<T, R>);
  12716. get(runtime: RuntimeSpec): undefined | R;
  12717. has(runtime: RuntimeSpec): boolean;
  12718. set(runtime: RuntimeSpec, value: R): void;
  12719. provide(runtime: RuntimeSpec, computer: () => R): R;
  12720. delete(runtime: RuntimeSpec): void;
  12721. update(runtime: RuntimeSpec, fn: (value?: R) => R): void;
  12722. keys(): RuntimeSpec[];
  12723. values(): IterableIterator<R>;
  12724. get size(): number;
  12725. }
  12726. declare class RuntimeSpecSet {
  12727. constructor(iterable?: Iterable<RuntimeSpec>);
  12728. add(runtime: RuntimeSpec): void;
  12729. has(runtime: RuntimeSpec): boolean;
  12730. get size(): number;
  12731. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  12732. }
  12733. declare abstract class RuntimeTemplate {
  12734. compilation: Compilation;
  12735. outputOptions: OutputNormalized;
  12736. requestShortener: RequestShortener;
  12737. globalObject: string;
  12738. contentHashReplacement: string;
  12739. isIIFE(): undefined | boolean;
  12740. isModule(): undefined | boolean;
  12741. isNeutralPlatform(): boolean;
  12742. supportsConst(): undefined | boolean;
  12743. supportsArrowFunction(): undefined | boolean;
  12744. supportsAsyncFunction(): undefined | boolean;
  12745. supportsOptionalChaining(): undefined | boolean;
  12746. supportsForOf(): undefined | boolean;
  12747. supportsDestructuring(): undefined | boolean;
  12748. supportsBigIntLiteral(): undefined | boolean;
  12749. supportsDynamicImport(): undefined | boolean;
  12750. supportsEcmaScriptModuleSyntax(): undefined | boolean;
  12751. supportTemplateLiteral(): undefined | boolean;
  12752. supportNodePrefixForCoreModules(): undefined | boolean;
  12753. returningFunction(returnValue: string, args?: string): string;
  12754. basicFunction(args: string, body: string | string[]): string;
  12755. concatenation(...args: (string | { expr: string })[]): string;
  12756. expressionFunction(expression: string, args?: string): string;
  12757. emptyFunction(): string;
  12758. destructureArray(items: string[], value: string): string;
  12759. destructureObject(items: string[], value: string): string;
  12760. iife(args: string, body: string): string;
  12761. forEach(variable: string, array: string, body: string | string[]): string;
  12762. /**
  12763. * Add a comment
  12764. */
  12765. comment(__0: {
  12766. /**
  12767. * request string used originally
  12768. */
  12769. request?: string;
  12770. /**
  12771. * name of the chunk referenced
  12772. */
  12773. chunkName?: null | string;
  12774. /**
  12775. * reason information of the chunk
  12776. */
  12777. chunkReason?: string;
  12778. /**
  12779. * additional message
  12780. */
  12781. message?: string;
  12782. /**
  12783. * name of the export
  12784. */
  12785. exportName?: string;
  12786. }): string;
  12787. throwMissingModuleErrorBlock(__0: {
  12788. /**
  12789. * request string used originally
  12790. */
  12791. request?: string;
  12792. }): string;
  12793. throwMissingModuleErrorFunction(__0: {
  12794. /**
  12795. * request string used originally
  12796. */
  12797. request?: string;
  12798. }): string;
  12799. missingModule(__0: {
  12800. /**
  12801. * request string used originally
  12802. */
  12803. request?: string;
  12804. }): string;
  12805. missingModuleStatement(__0: {
  12806. /**
  12807. * request string used originally
  12808. */
  12809. request?: string;
  12810. }): string;
  12811. missingModulePromise(__0: {
  12812. /**
  12813. * request string used originally
  12814. */
  12815. request?: string;
  12816. }): string;
  12817. weakError(__0: {
  12818. /**
  12819. * the chunk graph
  12820. */
  12821. chunkGraph: ChunkGraph;
  12822. /**
  12823. * the module
  12824. */
  12825. module: Module;
  12826. /**
  12827. * the request that should be printed as comment
  12828. */
  12829. request?: string;
  12830. /**
  12831. * expression to use as id expression
  12832. */
  12833. idExpr?: string;
  12834. /**
  12835. * which kind of code should be returned
  12836. */
  12837. type: "promise" | "expression" | "statements";
  12838. }): string;
  12839. moduleId(__0: {
  12840. /**
  12841. * the module
  12842. */
  12843. module: Module;
  12844. /**
  12845. * the chunk graph
  12846. */
  12847. chunkGraph: ChunkGraph;
  12848. /**
  12849. * the request that should be printed as comment
  12850. */
  12851. request?: string;
  12852. /**
  12853. * if the dependency is weak (will create a nice error message)
  12854. */
  12855. weak?: boolean;
  12856. }): string;
  12857. moduleRaw(__0: {
  12858. /**
  12859. * the module
  12860. */
  12861. module: null | Module;
  12862. /**
  12863. * the chunk graph
  12864. */
  12865. chunkGraph: ChunkGraph;
  12866. /**
  12867. * the request that should be printed as comment
  12868. */
  12869. request?: string;
  12870. /**
  12871. * if the dependency is weak (will create a nice error message)
  12872. */
  12873. weak?: boolean;
  12874. /**
  12875. * if set, will be filled with runtime requirements
  12876. */
  12877. runtimeRequirements: Set<string>;
  12878. }): string;
  12879. moduleExports(__0: {
  12880. /**
  12881. * the module
  12882. */
  12883. module: null | Module;
  12884. /**
  12885. * the chunk graph
  12886. */
  12887. chunkGraph: ChunkGraph;
  12888. /**
  12889. * the request that should be printed as comment
  12890. */
  12891. request: string;
  12892. /**
  12893. * if the dependency is weak (will create a nice error message)
  12894. */
  12895. weak?: boolean;
  12896. /**
  12897. * if set, will be filled with runtime requirements
  12898. */
  12899. runtimeRequirements: Set<string>;
  12900. }): string;
  12901. moduleNamespace(__0: {
  12902. /**
  12903. * the module
  12904. */
  12905. module: Module;
  12906. /**
  12907. * the chunk graph
  12908. */
  12909. chunkGraph: ChunkGraph;
  12910. /**
  12911. * the request that should be printed as comment
  12912. */
  12913. request: string;
  12914. /**
  12915. * if the current module is in strict esm mode
  12916. */
  12917. strict?: boolean;
  12918. /**
  12919. * if the dependency is weak (will create a nice error message)
  12920. */
  12921. weak?: boolean;
  12922. /**
  12923. * if set, will be filled with runtime requirements
  12924. */
  12925. runtimeRequirements: Set<string>;
  12926. }): string;
  12927. moduleNamespacePromise(__0: {
  12928. /**
  12929. * the chunk graph
  12930. */
  12931. chunkGraph: ChunkGraph;
  12932. /**
  12933. * the current dependencies block
  12934. */
  12935. block?: AsyncDependenciesBlock;
  12936. /**
  12937. * the module
  12938. */
  12939. module: Module;
  12940. /**
  12941. * the request that should be printed as comment
  12942. */
  12943. request: string;
  12944. /**
  12945. * a message for the comment
  12946. */
  12947. message: string;
  12948. /**
  12949. * if the current module is in strict esm mode
  12950. */
  12951. strict?: boolean;
  12952. /**
  12953. * if the dependency is weak (will create a nice error message)
  12954. */
  12955. weak?: boolean;
  12956. /**
  12957. * if set, will be filled with runtime requirements
  12958. */
  12959. runtimeRequirements: Set<string>;
  12960. }): string;
  12961. runtimeConditionExpression(__0: {
  12962. /**
  12963. * the chunk graph
  12964. */
  12965. chunkGraph: ChunkGraph;
  12966. /**
  12967. * runtime for which this code will be generated
  12968. */
  12969. runtime?: RuntimeSpec;
  12970. /**
  12971. * only execute the statement in some runtimes
  12972. */
  12973. runtimeCondition?: string | boolean | SortableSet<string>;
  12974. /**
  12975. * if set, will be filled with runtime requirements
  12976. */
  12977. runtimeRequirements: Set<string>;
  12978. }): string;
  12979. importStatement(__0: {
  12980. /**
  12981. * whether a new variable should be created or the existing one updated
  12982. */
  12983. update?: boolean;
  12984. /**
  12985. * the module
  12986. */
  12987. module: Module;
  12988. /**
  12989. * the chunk graph
  12990. */
  12991. chunkGraph: ChunkGraph;
  12992. /**
  12993. * the request that should be printed as comment
  12994. */
  12995. request: string;
  12996. /**
  12997. * name of the import variable
  12998. */
  12999. importVar: string;
  13000. /**
  13001. * module in which the statement is emitted
  13002. */
  13003. originModule: Module;
  13004. /**
  13005. * true, if this is a weak dependency
  13006. */
  13007. weak?: boolean;
  13008. /**
  13009. * if set, will be filled with runtime requirements
  13010. */
  13011. runtimeRequirements: Set<string>;
  13012. }): [string, string];
  13013. exportFromImport<GenerateContext>(__0: {
  13014. /**
  13015. * the module graph
  13016. */
  13017. moduleGraph: ModuleGraph;
  13018. /**
  13019. * the module
  13020. */
  13021. module: Module;
  13022. /**
  13023. * the request
  13024. */
  13025. request: string;
  13026. /**
  13027. * the export name
  13028. */
  13029. exportName: string | string[];
  13030. /**
  13031. * the origin module
  13032. */
  13033. originModule: Module;
  13034. /**
  13035. * true, if location is safe for ASI, a bracket can be emitted
  13036. */
  13037. asiSafe?: boolean;
  13038. /**
  13039. * true, if expression will be called
  13040. */
  13041. isCall: boolean;
  13042. /**
  13043. * when false, call context will not be preserved
  13044. */
  13045. callContext: null | boolean;
  13046. /**
  13047. * when true and accessing the default exports, interop code will be generated
  13048. */
  13049. defaultInterop: boolean;
  13050. /**
  13051. * the identifier name of the import variable
  13052. */
  13053. importVar: string;
  13054. /**
  13055. * init fragments will be added here
  13056. */
  13057. initFragments: InitFragment<GenerateContext>[];
  13058. /**
  13059. * runtime for which this code will be generated
  13060. */
  13061. runtime: RuntimeSpec;
  13062. /**
  13063. * if set, will be filled with runtime requirements
  13064. */
  13065. runtimeRequirements: Set<string>;
  13066. }): string;
  13067. blockPromise(__0: {
  13068. /**
  13069. * the async block
  13070. */
  13071. block?: AsyncDependenciesBlock;
  13072. /**
  13073. * the message
  13074. */
  13075. message: string;
  13076. /**
  13077. * the chunk graph
  13078. */
  13079. chunkGraph: ChunkGraph;
  13080. /**
  13081. * if set, will be filled with runtime requirements
  13082. */
  13083. runtimeRequirements: Set<string>;
  13084. }): string;
  13085. asyncModuleFactory(__0: {
  13086. /**
  13087. * the async block
  13088. */
  13089. block: AsyncDependenciesBlock;
  13090. /**
  13091. * the chunk graph
  13092. */
  13093. chunkGraph: ChunkGraph;
  13094. /**
  13095. * if set, will be filled with runtime requirements
  13096. */
  13097. runtimeRequirements: Set<string>;
  13098. /**
  13099. * request string used originally
  13100. */
  13101. request?: string;
  13102. }): string;
  13103. syncModuleFactory(__0: {
  13104. /**
  13105. * the dependency
  13106. */
  13107. dependency: Dependency;
  13108. /**
  13109. * the chunk graph
  13110. */
  13111. chunkGraph: ChunkGraph;
  13112. /**
  13113. * if set, will be filled with runtime requirements
  13114. */
  13115. runtimeRequirements: Set<string>;
  13116. /**
  13117. * request string used originally
  13118. */
  13119. request?: string;
  13120. }): string;
  13121. defineEsModuleFlagStatement(__0: {
  13122. /**
  13123. * the name of the exports object
  13124. */
  13125. exportsArgument: string;
  13126. /**
  13127. * if set, will be filled with runtime requirements
  13128. */
  13129. runtimeRequirements: Set<string>;
  13130. }): string;
  13131. }
  13132. declare abstract class RuntimeValue {
  13133. fn: (value: {
  13134. module: NormalModule;
  13135. key: string;
  13136. readonly version: ValueCacheVersion;
  13137. }) => CodeValuePrimitive;
  13138. options: true | RuntimeValueOptions;
  13139. get fileDependencies(): true | string[];
  13140. exec(
  13141. parser: JavascriptParser,
  13142. valueCacheVersions: Map<string, string | Set<string>>,
  13143. key: string
  13144. ): CodeValuePrimitive;
  13145. getCacheVersion(): undefined | string;
  13146. }
  13147. declare interface RuntimeValueOptions {
  13148. fileDependencies?: string[];
  13149. contextDependencies?: string[];
  13150. missingDependencies?: string[];
  13151. buildDependencies?: string[];
  13152. version?: string | (() => string);
  13153. }
  13154. /**
  13155. * Helper function for joining two ranges into a single range. This is useful
  13156. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  13157. * to create the range of the _parent node_.
  13158. */
  13159. declare interface ScopeInfo {
  13160. definitions: StackedMap<string, VariableInfo | ScopeInfo>;
  13161. topLevelScope: boolean | "arrow";
  13162. inShorthand: string | boolean;
  13163. inTaggedTemplateTag: boolean;
  13164. inTry: boolean;
  13165. isStrict: boolean;
  13166. isAsmJs: boolean;
  13167. /**
  13168. * false for unknown state
  13169. */
  13170. inExecutedPath: boolean;
  13171. terminated?: "return" | "throw";
  13172. }
  13173. declare interface Selector<A, B> {
  13174. (input: A): undefined | null | B;
  13175. }
  13176. declare abstract class Serializer {
  13177. serializeMiddlewares: SerializerMiddleware<any, any>[];
  13178. deserializeMiddlewares: SerializerMiddleware<any, any>[];
  13179. context: any;
  13180. serialize(obj?: any, context?: any): Promise<any>;
  13181. deserialize(value?: any, context?: any): Promise<any>;
  13182. }
  13183. declare abstract class SerializerMiddleware<DeserializedType, SerializedType> {
  13184. serialize(
  13185. data: DeserializedType,
  13186. context?: any
  13187. ): null | SerializedType | Promise<SerializedType>;
  13188. deserialize(
  13189. data: SerializedType,
  13190. context?: any
  13191. ): DeserializedType | Promise<DeserializedType>;
  13192. }
  13193. declare class SharePlugin {
  13194. constructor(options: SharePluginOptions);
  13195. /**
  13196. * Apply the plugin
  13197. */
  13198. apply(compiler: Compiler): void;
  13199. }
  13200. /**
  13201. * Options for shared modules.
  13202. */
  13203. declare interface SharePluginOptions {
  13204. /**
  13205. * Share scope name used for all shared modules (defaults to 'default').
  13206. */
  13207. shareScope?: string;
  13208. /**
  13209. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  13210. */
  13211. shared: Shared;
  13212. }
  13213. type Shared = (string | SharedObject)[] | SharedObject;
  13214. /**
  13215. * Advanced configuration for modules that should be shared in the share scope.
  13216. */
  13217. declare interface SharedConfig {
  13218. /**
  13219. * 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.
  13220. */
  13221. eager?: boolean;
  13222. /**
  13223. * 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.
  13224. */
  13225. import?: string | false;
  13226. /**
  13227. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  13228. */
  13229. packageName?: string;
  13230. /**
  13231. * Version requirement from module in share scope.
  13232. */
  13233. requiredVersion?: string | false;
  13234. /**
  13235. * Module is looked up under this key from the share scope.
  13236. */
  13237. shareKey?: string;
  13238. /**
  13239. * Share scope name.
  13240. */
  13241. shareScope?: string;
  13242. /**
  13243. * Allow only a single version of the shared module in share scope (disabled by default).
  13244. */
  13245. singleton?: boolean;
  13246. /**
  13247. * 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).
  13248. */
  13249. strictVersion?: boolean;
  13250. /**
  13251. * Version of the provided module. Will replace lower matching versions, but not higher.
  13252. */
  13253. version?: string | false;
  13254. }
  13255. /**
  13256. * 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.
  13257. */
  13258. declare interface SharedObject {
  13259. [index: string]: string | SharedConfig;
  13260. }
  13261. declare class SideEffectsFlagPlugin {
  13262. constructor(analyseSource?: boolean);
  13263. /**
  13264. * Apply the plugin
  13265. */
  13266. apply(compiler: Compiler): void;
  13267. static moduleHasSideEffects(
  13268. moduleName: string,
  13269. flagValue: undefined | string | boolean | string[],
  13270. cache: Map<string, RegExp>
  13271. ): undefined | boolean;
  13272. }
  13273. type SimpleType = "string" | "number" | "boolean";
  13274. declare class SizeOnlySource extends Source {
  13275. constructor(size: number);
  13276. }
  13277. declare abstract class Snapshot {
  13278. startTime?: number;
  13279. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  13280. fileHashes?: Map<string, null | string>;
  13281. fileTshs?: Map<string, null | string | TimestampAndHash>;
  13282. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  13283. contextHashes?: Map<string, null | string>;
  13284. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  13285. missingExistence?: Map<string, boolean>;
  13286. managedItemInfo?: Map<string, string>;
  13287. managedFiles?: Set<string>;
  13288. managedContexts?: Set<string>;
  13289. managedMissing?: Set<string>;
  13290. children?: Set<Snapshot>;
  13291. hasStartTime(): boolean;
  13292. setStartTime(value: number): void;
  13293. setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
  13294. hasFileTimestamps(): boolean;
  13295. setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
  13296. hasFileHashes(): boolean;
  13297. setFileHashes(value: Map<string, null | string>): void;
  13298. hasFileTshs(): boolean;
  13299. setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
  13300. hasContextTimestamps(): boolean;
  13301. setContextTimestamps(
  13302. value: Map<string, null | ResolvedContextFileSystemInfoEntry>
  13303. ): void;
  13304. hasContextHashes(): boolean;
  13305. setContextHashes(value: Map<string, null | string>): void;
  13306. hasContextTshs(): boolean;
  13307. setContextTshs(
  13308. value: Map<string, null | ResolvedContextTimestampAndHash>
  13309. ): void;
  13310. hasMissingExistence(): boolean;
  13311. setMissingExistence(value: Map<string, boolean>): void;
  13312. hasManagedItemInfo(): boolean;
  13313. setManagedItemInfo(value: Map<string, string>): void;
  13314. hasManagedFiles(): boolean;
  13315. setManagedFiles(value: Set<string>): void;
  13316. hasManagedContexts(): boolean;
  13317. setManagedContexts(value: Set<string>): void;
  13318. hasManagedMissing(): boolean;
  13319. setManagedMissing(value: Set<string>): void;
  13320. hasChildren(): boolean;
  13321. setChildren(value: Set<Snapshot>): void;
  13322. addChild(child: Snapshot): void;
  13323. serialize(__0: ObjectSerializerContext): void;
  13324. deserialize(__0: ObjectDeserializerContext): void;
  13325. getFileIterable(): Iterable<string>;
  13326. getContextIterable(): Iterable<string>;
  13327. getMissingIterable(): Iterable<string>;
  13328. }
  13329. declare interface SnapshotOptionsFileSystemInfo {
  13330. /**
  13331. * should use hash to snapshot
  13332. */
  13333. hash?: boolean;
  13334. /**
  13335. * should use timestamp to snapshot
  13336. */
  13337. timestamp?: boolean;
  13338. }
  13339. /**
  13340. * Options affecting how file system snapshots are created and validated.
  13341. */
  13342. declare interface SnapshotOptionsWebpackOptions {
  13343. /**
  13344. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  13345. */
  13346. buildDependencies?: {
  13347. /**
  13348. * Use hashes of the content of the files/directories to determine invalidation.
  13349. */
  13350. hash?: boolean;
  13351. /**
  13352. * Use timestamps of the files/directories to determine invalidation.
  13353. */
  13354. timestamp?: boolean;
  13355. };
  13356. /**
  13357. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  13358. */
  13359. immutablePaths?: (string | RegExp)[];
  13360. /**
  13361. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  13362. */
  13363. managedPaths?: (string | RegExp)[];
  13364. /**
  13365. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  13366. */
  13367. module?: {
  13368. /**
  13369. * Use hashes of the content of the files/directories to determine invalidation.
  13370. */
  13371. hash?: boolean;
  13372. /**
  13373. * Use timestamps of the files/directories to determine invalidation.
  13374. */
  13375. timestamp?: boolean;
  13376. };
  13377. /**
  13378. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  13379. */
  13380. resolve?: {
  13381. /**
  13382. * Use hashes of the content of the files/directories to determine invalidation.
  13383. */
  13384. hash?: boolean;
  13385. /**
  13386. * Use timestamps of the files/directories to determine invalidation.
  13387. */
  13388. timestamp?: boolean;
  13389. };
  13390. /**
  13391. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  13392. */
  13393. resolveBuildDependencies?: {
  13394. /**
  13395. * Use hashes of the content of the files/directories to determine invalidation.
  13396. */
  13397. hash?: boolean;
  13398. /**
  13399. * Use timestamps of the files/directories to determine invalidation.
  13400. */
  13401. timestamp?: boolean;
  13402. };
  13403. /**
  13404. * List of paths that are not managed by a package manager and the contents are subject to change.
  13405. */
  13406. unmanagedPaths?: (string | RegExp)[];
  13407. }
  13408. declare interface SortFunction<T> {
  13409. (a: T, b: T): number;
  13410. }
  13411. declare abstract class SortableSet<T> extends Set<T> {
  13412. /**
  13413. * Sort with a comparer function
  13414. */
  13415. sortWith(sortFn?: SortFunction<T>): void;
  13416. sort(): SortableSet<T>;
  13417. /**
  13418. * Get data from cache
  13419. */
  13420. getFromCache<R extends unknown>(fn: (set: SortableSet<T>) => R): R;
  13421. /**
  13422. * Get data from cache (ignoring sorting)
  13423. */
  13424. getFromUnorderedCache<R>(fn: (set: SortableSet<T>) => R): R;
  13425. toJSON(): T[];
  13426. }
  13427. declare class Source {
  13428. constructor();
  13429. size(): number;
  13430. map(options?: MapOptions): null | RawSourceMap;
  13431. sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
  13432. updateHash(hash: Hash): void;
  13433. source(): string | Buffer;
  13434. buffer(): Buffer;
  13435. }
  13436. declare interface SourceLike {
  13437. source(): string | Buffer;
  13438. }
  13439. declare interface SourceMap {
  13440. version: number;
  13441. sources: string[];
  13442. mappings: string;
  13443. file?: string;
  13444. sourceRoot?: string;
  13445. sourcesContent?: string[];
  13446. names?: string[];
  13447. debugId?: string;
  13448. }
  13449. declare class SourceMapDevToolPlugin {
  13450. constructor(options?: SourceMapDevToolPluginOptions);
  13451. sourceMapFilename: string | false;
  13452. sourceMappingURLComment:
  13453. | string
  13454. | false
  13455. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  13456. moduleFilenameTemplate: string | ((context?: any) => string);
  13457. fallbackModuleFilenameTemplate: string | ((context?: any) => string);
  13458. namespace: string;
  13459. options: SourceMapDevToolPluginOptions;
  13460. /**
  13461. * Apply the plugin
  13462. */
  13463. apply(compiler: Compiler): void;
  13464. }
  13465. declare interface SourceMapDevToolPluginOptions {
  13466. /**
  13467. * 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.
  13468. */
  13469. append?:
  13470. | null
  13471. | string
  13472. | false
  13473. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  13474. /**
  13475. * Indicates whether column mappings should be used (defaults to true).
  13476. */
  13477. columns?: boolean;
  13478. /**
  13479. * Emit debug IDs into source and SourceMap.
  13480. */
  13481. debugIds?: boolean;
  13482. /**
  13483. * Exclude modules that match the given value from source map generation.
  13484. */
  13485. exclude?: string | RegExp | Rule[];
  13486. /**
  13487. * 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.
  13488. */
  13489. fallbackModuleFilenameTemplate?: string | ((context?: any) => string);
  13490. /**
  13491. * Path prefix to which the [file] placeholder is relative to.
  13492. */
  13493. fileContext?: string;
  13494. /**
  13495. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  13496. */
  13497. filename?: null | string | false;
  13498. /**
  13499. * Include source maps for module paths that match the given value.
  13500. */
  13501. include?: string | RegExp | Rule[];
  13502. /**
  13503. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  13504. */
  13505. module?: boolean;
  13506. /**
  13507. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  13508. */
  13509. moduleFilenameTemplate?: string | ((context?: any) => string);
  13510. /**
  13511. * Namespace prefix to allow multiple webpack roots in the devtools.
  13512. */
  13513. namespace?: string;
  13514. /**
  13515. * Omit the 'sourceContents' array from the SourceMap.
  13516. */
  13517. noSources?: boolean;
  13518. /**
  13519. * Provide a custom public path for the SourceMapping comment.
  13520. */
  13521. publicPath?: string;
  13522. /**
  13523. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  13524. */
  13525. sourceRoot?: string;
  13526. /**
  13527. * Include source maps for modules based on their extension (defaults to .js and .css).
  13528. */
  13529. test?: string | RegExp | Rule[];
  13530. }
  13531. declare class SourceMapSource extends Source {
  13532. constructor(
  13533. source: string | Buffer,
  13534. name: string,
  13535. sourceMap: string | Object | Buffer,
  13536. originalSource?: string | Buffer,
  13537. innerSourceMap?: string | Object | Buffer,
  13538. removeOriginalSource?: boolean
  13539. );
  13540. getArgsAsBuffers(): [
  13541. Buffer,
  13542. string,
  13543. Buffer,
  13544. undefined | Buffer,
  13545. undefined | Buffer,
  13546. boolean
  13547. ];
  13548. }
  13549. declare interface SourcePosition {
  13550. line: number;
  13551. column?: number;
  13552. }
  13553. declare interface SplitChunksOptions {
  13554. chunksFilter: (chunk: Chunk) => undefined | boolean;
  13555. defaultSizeTypes: string[];
  13556. minSize: SplitChunksSizes;
  13557. minSizeReduction: SplitChunksSizes;
  13558. minRemainingSize: SplitChunksSizes;
  13559. enforceSizeThreshold: SplitChunksSizes;
  13560. maxInitialSize: SplitChunksSizes;
  13561. maxAsyncSize: SplitChunksSizes;
  13562. minChunks: number;
  13563. maxAsyncRequests: number;
  13564. maxInitialRequests: number;
  13565. hidePathInfo: boolean;
  13566. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  13567. automaticNameDelimiter: string;
  13568. getCacheGroups: (
  13569. module: Module,
  13570. context: CacheGroupsContext
  13571. ) => null | CacheGroupSource[];
  13572. getName: (module: Module, chunks: Chunk[], key: string) => undefined | string;
  13573. usedExports: boolean;
  13574. fallbackCacheGroup: FallbackCacheGroup;
  13575. }
  13576. declare class SplitChunksPlugin {
  13577. constructor(options?: OptimizationSplitChunksOptions);
  13578. options: SplitChunksOptions;
  13579. /**
  13580. * Apply the plugin
  13581. */
  13582. apply(compiler: Compiler): void;
  13583. }
  13584. declare interface SplitChunksSizes {
  13585. [index: string]: number;
  13586. }
  13587. declare abstract class StackedMap<K, V> {
  13588. map: Map<K, InternalCell<V>>;
  13589. stack: Map<K, InternalCell<V>>[];
  13590. set(item: K, value: V): void;
  13591. delete(item: K): void;
  13592. has(item: K): boolean;
  13593. get(item: K): Cell<V>;
  13594. asArray(): K[];
  13595. asSet(): Set<K>;
  13596. asPairArray(): [K, Cell<V>][];
  13597. asMap(): Map<K, Cell<V>>;
  13598. get size(): number;
  13599. createChild(): StackedMap<K, V>;
  13600. }
  13601. type StartupRenderContext = RenderContextJavascriptModulesPlugin & {
  13602. inlined: boolean;
  13603. };
  13604. declare interface StatFs {
  13605. (
  13606. path: PathLikeFs,
  13607. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  13608. ): void;
  13609. (
  13610. path: PathLikeFs,
  13611. options: undefined | (StatOptions & { bigint?: false }),
  13612. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  13613. ): void;
  13614. (
  13615. path: PathLikeFs,
  13616. options: StatOptions & { bigint: true },
  13617. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  13618. ): void;
  13619. (
  13620. path: PathLikeFs,
  13621. options: undefined | StatOptions,
  13622. callback: (
  13623. err: null | NodeJS.ErrnoException,
  13624. result?: IStats | IBigIntStats
  13625. ) => void
  13626. ): void;
  13627. }
  13628. declare interface StatOptions {
  13629. bigint?: boolean;
  13630. }
  13631. declare interface StatSync {
  13632. (path: PathLikeFs, options?: undefined): IStats;
  13633. (
  13634. path: PathLikeFs,
  13635. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  13636. ): undefined | IStats;
  13637. (
  13638. path: PathLikeFs,
  13639. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  13640. ): undefined | IBigIntStats;
  13641. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  13642. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  13643. (
  13644. path: PathLikeFs,
  13645. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  13646. ): IStats | IBigIntStats;
  13647. (
  13648. path: PathLikeFs,
  13649. options?: StatSyncOptions
  13650. ): undefined | IStats | IBigIntStats;
  13651. }
  13652. declare interface StatSyncOptions {
  13653. bigint?: boolean;
  13654. throwIfNoEntry?: boolean;
  13655. }
  13656. declare interface StatTypes {
  13657. (
  13658. path: PathLikeTypes,
  13659. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13660. ): void;
  13661. (
  13662. path: PathLikeTypes,
  13663. options: undefined | (StatOptions & { bigint?: false }),
  13664. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IStats) => void
  13665. ): void;
  13666. (
  13667. path: PathLikeTypes,
  13668. options: StatOptions & { bigint: true },
  13669. callback: (arg0: null | NodeJS.ErrnoException, arg1?: IBigIntStats) => void
  13670. ): void;
  13671. (
  13672. path: PathLikeTypes,
  13673. options: undefined | StatOptions,
  13674. callback: (
  13675. arg0: null | NodeJS.ErrnoException,
  13676. arg1?: IStats | IBigIntStats
  13677. ) => void
  13678. ): void;
  13679. }
  13680. type Statement =
  13681. | FunctionDeclaration
  13682. | VariableDeclaration
  13683. | ClassDeclaration
  13684. | ExpressionStatement
  13685. | BlockStatement
  13686. | StaticBlock
  13687. | EmptyStatement
  13688. | DebuggerStatement
  13689. | WithStatement
  13690. | ReturnStatement
  13691. | LabeledStatement
  13692. | BreakStatement
  13693. | ContinueStatement
  13694. | IfStatement
  13695. | SwitchStatement
  13696. | ThrowStatement
  13697. | TryStatement
  13698. | WhileStatement
  13699. | DoWhileStatement
  13700. | ForStatement
  13701. | ForInStatement
  13702. | ForOfStatement;
  13703. type StatementPathItem =
  13704. | ImportDeclarationJavascriptParser
  13705. | ExportNamedDeclarationJavascriptParser
  13706. | ExportAllDeclarationJavascriptParser
  13707. | ImportExpressionImport
  13708. | UnaryExpression
  13709. | ArrayExpression
  13710. | ArrowFunctionExpression
  13711. | AssignmentExpression
  13712. | AwaitExpression
  13713. | BinaryExpression
  13714. | SimpleCallExpression
  13715. | NewExpression
  13716. | ChainExpression
  13717. | ClassExpression
  13718. | ConditionalExpression
  13719. | FunctionExpression
  13720. | Identifier
  13721. | SimpleLiteral
  13722. | RegExpLiteral
  13723. | BigIntLiteral
  13724. | LogicalExpression
  13725. | MemberExpression
  13726. | MetaProperty
  13727. | ObjectExpression
  13728. | SequenceExpression
  13729. | TaggedTemplateExpression
  13730. | TemplateLiteral
  13731. | ThisExpression
  13732. | UpdateExpression
  13733. | YieldExpression
  13734. | FunctionDeclaration
  13735. | MaybeNamedFunctionDeclaration
  13736. | VariableDeclaration
  13737. | ClassDeclaration
  13738. | MaybeNamedClassDeclaration
  13739. | ExpressionStatement
  13740. | BlockStatement
  13741. | StaticBlock
  13742. | EmptyStatement
  13743. | DebuggerStatement
  13744. | WithStatement
  13745. | ReturnStatement
  13746. | LabeledStatement
  13747. | BreakStatement
  13748. | ContinueStatement
  13749. | IfStatement
  13750. | SwitchStatement
  13751. | ThrowStatement
  13752. | TryStatement
  13753. | WhileStatement
  13754. | DoWhileStatement
  13755. | ForStatement
  13756. | ForInStatement
  13757. | ForOfStatement
  13758. | ExportDefaultDeclaration;
  13759. declare class Stats {
  13760. constructor(compilation: Compilation);
  13761. compilation: Compilation;
  13762. get hash(): string;
  13763. get startTime(): number;
  13764. get endTime(): number;
  13765. hasWarnings(): boolean;
  13766. hasErrors(): boolean;
  13767. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  13768. toString(options?: string | boolean | StatsOptions): string;
  13769. }
  13770. type StatsAsset = KnownStatsAsset & Record<string, any>;
  13771. type StatsChunk = KnownStatsChunk & Record<string, any>;
  13772. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  13773. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  13774. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  13775. type StatsError = KnownStatsError & Record<string, any>;
  13776. declare abstract class StatsFactory {
  13777. hooks: StatsFactoryHooks;
  13778. create(
  13779. type: string,
  13780. data: any,
  13781. baseContext: Omit<StatsFactoryContext, "type">
  13782. ): any;
  13783. }
  13784. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  13785. declare interface StatsFactoryHooks {
  13786. extract: HookMap<
  13787. SyncBailHook<[ObjectForExtract, any, StatsFactoryContext], void>
  13788. >;
  13789. filter: HookMap<
  13790. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13791. >;
  13792. sort: HookMap<
  13793. SyncBailHook<
  13794. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  13795. void
  13796. >
  13797. >;
  13798. filterSorted: HookMap<
  13799. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13800. >;
  13801. groupResults: HookMap<
  13802. SyncBailHook<[GroupConfig[], StatsFactoryContext], void>
  13803. >;
  13804. sortResults: HookMap<
  13805. SyncBailHook<
  13806. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  13807. void
  13808. >
  13809. >;
  13810. filterResults: HookMap<
  13811. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  13812. >;
  13813. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  13814. result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  13815. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
  13816. getItemFactory: HookMap<
  13817. SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>
  13818. >;
  13819. }
  13820. type StatsLogging = KnownStatsLogging & Record<string, any>;
  13821. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  13822. type StatsModule = KnownStatsModule & Record<string, any>;
  13823. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  13824. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  13825. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  13826. Record<string, any>;
  13827. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  13828. /**
  13829. * Stats options object.
  13830. */
  13831. declare interface StatsOptions {
  13832. /**
  13833. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  13834. */
  13835. all?: boolean;
  13836. /**
  13837. * Add assets information.
  13838. */
  13839. assets?: boolean;
  13840. /**
  13841. * Sort the assets by that field.
  13842. */
  13843. assetsSort?: string | false;
  13844. /**
  13845. * Space to display assets (groups will be collapsed to fit this space).
  13846. */
  13847. assetsSpace?: number;
  13848. /**
  13849. * Add built at time information.
  13850. */
  13851. builtAt?: boolean;
  13852. /**
  13853. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  13854. */
  13855. cached?: boolean;
  13856. /**
  13857. * Show cached assets (setting this to `false` only shows emitted files).
  13858. */
  13859. cachedAssets?: boolean;
  13860. /**
  13861. * Add information about cached (not built) modules.
  13862. */
  13863. cachedModules?: boolean;
  13864. /**
  13865. * Add children information.
  13866. */
  13867. children?: boolean;
  13868. /**
  13869. * Display auxiliary assets in chunk groups.
  13870. */
  13871. chunkGroupAuxiliary?: boolean;
  13872. /**
  13873. * Display children of chunk groups.
  13874. */
  13875. chunkGroupChildren?: boolean;
  13876. /**
  13877. * Limit of assets displayed in chunk groups.
  13878. */
  13879. chunkGroupMaxAssets?: number;
  13880. /**
  13881. * Display all chunk groups with the corresponding bundles.
  13882. */
  13883. chunkGroups?: boolean;
  13884. /**
  13885. * Add built modules information to chunk information.
  13886. */
  13887. chunkModules?: boolean;
  13888. /**
  13889. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  13890. */
  13891. chunkModulesSpace?: number;
  13892. /**
  13893. * Add the origins of chunks and chunk merging info.
  13894. */
  13895. chunkOrigins?: boolean;
  13896. /**
  13897. * Add information about parent, children and sibling chunks to chunk information.
  13898. */
  13899. chunkRelations?: boolean;
  13900. /**
  13901. * Add chunk information.
  13902. */
  13903. chunks?: boolean;
  13904. /**
  13905. * Sort the chunks by that field.
  13906. */
  13907. chunksSort?: string | false;
  13908. /**
  13909. * Enables/Disables colorful output.
  13910. */
  13911. colors?:
  13912. | boolean
  13913. | {
  13914. /**
  13915. * Custom color for bold text.
  13916. */
  13917. bold?: string;
  13918. /**
  13919. * Custom color for cyan text.
  13920. */
  13921. cyan?: string;
  13922. /**
  13923. * Custom color for green text.
  13924. */
  13925. green?: string;
  13926. /**
  13927. * Custom color for magenta text.
  13928. */
  13929. magenta?: string;
  13930. /**
  13931. * Custom color for red text.
  13932. */
  13933. red?: string;
  13934. /**
  13935. * Custom color for yellow text.
  13936. */
  13937. yellow?: string;
  13938. };
  13939. /**
  13940. * Context directory for request shortening.
  13941. */
  13942. context?: string;
  13943. /**
  13944. * Show chunk modules that are dependencies of other modules of the chunk.
  13945. */
  13946. dependentModules?: boolean;
  13947. /**
  13948. * Add module depth in module graph.
  13949. */
  13950. depth?: boolean;
  13951. /**
  13952. * Display the entry points with the corresponding bundles.
  13953. */
  13954. entrypoints?: boolean | "auto";
  13955. /**
  13956. * Add --env information.
  13957. */
  13958. env?: boolean;
  13959. /**
  13960. * Add details to errors (like resolving log).
  13961. */
  13962. errorDetails?: boolean | "auto";
  13963. /**
  13964. * Add internal stack trace to errors.
  13965. */
  13966. errorStack?: boolean;
  13967. /**
  13968. * Add errors.
  13969. */
  13970. errors?: boolean;
  13971. /**
  13972. * Add errors count.
  13973. */
  13974. errorsCount?: boolean;
  13975. /**
  13976. * Space to display errors (value is in number of lines).
  13977. */
  13978. errorsSpace?: number;
  13979. /**
  13980. * Please use excludeModules instead.
  13981. */
  13982. exclude?:
  13983. | string
  13984. | boolean
  13985. | RegExp
  13986. | ModuleFilterItemTypes[]
  13987. | ((
  13988. name: string,
  13989. module: StatsModule,
  13990. type: "module" | "chunk" | "root-of-chunk" | "nested"
  13991. ) => boolean);
  13992. /**
  13993. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  13994. */
  13995. excludeAssets?:
  13996. | string
  13997. | RegExp
  13998. | AssetFilterItemTypes[]
  13999. | ((name: string, asset: StatsAsset) => boolean);
  14000. /**
  14001. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  14002. */
  14003. excludeModules?:
  14004. | string
  14005. | boolean
  14006. | RegExp
  14007. | ModuleFilterItemTypes[]
  14008. | ((
  14009. name: string,
  14010. module: StatsModule,
  14011. type: "module" | "chunk" | "root-of-chunk" | "nested"
  14012. ) => boolean);
  14013. /**
  14014. * Group assets by how their are related to chunks.
  14015. */
  14016. groupAssetsByChunk?: boolean;
  14017. /**
  14018. * Group assets by their status (emitted, compared for emit or cached).
  14019. */
  14020. groupAssetsByEmitStatus?: boolean;
  14021. /**
  14022. * Group assets by their extension.
  14023. */
  14024. groupAssetsByExtension?: boolean;
  14025. /**
  14026. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  14027. */
  14028. groupAssetsByInfo?: boolean;
  14029. /**
  14030. * Group assets by their path.
  14031. */
  14032. groupAssetsByPath?: boolean;
  14033. /**
  14034. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  14035. */
  14036. groupModulesByAttributes?: boolean;
  14037. /**
  14038. * Group modules by their status (cached or built and cacheable).
  14039. */
  14040. groupModulesByCacheStatus?: boolean;
  14041. /**
  14042. * Group modules by their extension.
  14043. */
  14044. groupModulesByExtension?: boolean;
  14045. /**
  14046. * Group modules by their layer.
  14047. */
  14048. groupModulesByLayer?: boolean;
  14049. /**
  14050. * Group modules by their path.
  14051. */
  14052. groupModulesByPath?: boolean;
  14053. /**
  14054. * Group modules by their type.
  14055. */
  14056. groupModulesByType?: boolean;
  14057. /**
  14058. * Group reasons by their origin module.
  14059. */
  14060. groupReasonsByOrigin?: boolean;
  14061. /**
  14062. * Add the hash of the compilation.
  14063. */
  14064. hash?: boolean;
  14065. /**
  14066. * Add ids.
  14067. */
  14068. ids?: boolean;
  14069. /**
  14070. * Add logging output.
  14071. */
  14072. logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
  14073. /**
  14074. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  14075. */
  14076. loggingDebug?:
  14077. | string
  14078. | boolean
  14079. | RegExp
  14080. | FilterItemTypes[]
  14081. | ((value: string) => boolean);
  14082. /**
  14083. * Add stack traces to logging output.
  14084. */
  14085. loggingTrace?: boolean;
  14086. /**
  14087. * Add information about assets inside modules.
  14088. */
  14089. moduleAssets?: boolean;
  14090. /**
  14091. * Add dependencies and origin of warnings/errors.
  14092. */
  14093. moduleTrace?: boolean;
  14094. /**
  14095. * Add built modules information.
  14096. */
  14097. modules?: boolean;
  14098. /**
  14099. * Sort the modules by that field.
  14100. */
  14101. modulesSort?: string | false;
  14102. /**
  14103. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  14104. */
  14105. modulesSpace?: number;
  14106. /**
  14107. * Add information about modules nested in other modules (like with module concatenation).
  14108. */
  14109. nestedModules?: boolean;
  14110. /**
  14111. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  14112. */
  14113. nestedModulesSpace?: number;
  14114. /**
  14115. * Show reasons why optimization bailed out for modules.
  14116. */
  14117. optimizationBailout?: boolean;
  14118. /**
  14119. * Add information about orphan modules.
  14120. */
  14121. orphanModules?: boolean;
  14122. /**
  14123. * Add output path information.
  14124. */
  14125. outputPath?: boolean;
  14126. /**
  14127. * Add performance hint flags.
  14128. */
  14129. performance?: boolean;
  14130. /**
  14131. * Preset for the default values.
  14132. */
  14133. preset?: string | boolean;
  14134. /**
  14135. * Show exports provided by modules.
  14136. */
  14137. providedExports?: boolean;
  14138. /**
  14139. * Add public path information.
  14140. */
  14141. publicPath?: boolean;
  14142. /**
  14143. * Add information about the reasons why modules are included.
  14144. */
  14145. reasons?: boolean;
  14146. /**
  14147. * Space to display reasons (groups will be collapsed to fit this space).
  14148. */
  14149. reasonsSpace?: number;
  14150. /**
  14151. * Add information about assets that are related to other assets (like SourceMaps for assets).
  14152. */
  14153. relatedAssets?: boolean;
  14154. /**
  14155. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  14156. */
  14157. runtime?: boolean;
  14158. /**
  14159. * Add information about runtime modules.
  14160. */
  14161. runtimeModules?: boolean;
  14162. /**
  14163. * Add the source code of modules.
  14164. */
  14165. source?: boolean;
  14166. /**
  14167. * Add timing information.
  14168. */
  14169. timings?: boolean;
  14170. /**
  14171. * Show exports used by modules.
  14172. */
  14173. usedExports?: boolean;
  14174. /**
  14175. * Add webpack version information.
  14176. */
  14177. version?: boolean;
  14178. /**
  14179. * Add warnings.
  14180. */
  14181. warnings?: boolean;
  14182. /**
  14183. * Add warnings count.
  14184. */
  14185. warningsCount?: boolean;
  14186. /**
  14187. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  14188. */
  14189. warningsFilter?:
  14190. | string
  14191. | RegExp
  14192. | WarningFilterItemTypes[]
  14193. | ((warning: StatsError, value: string) => boolean);
  14194. /**
  14195. * Space to display warnings (value is in number of lines).
  14196. */
  14197. warningsSpace?: number;
  14198. }
  14199. declare interface StatsPrintHooks {
  14200. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
  14201. printElements: HookMap<
  14202. SyncBailHook<[PrintedElement[], StatsPrinterContext], string | void>
  14203. >;
  14204. sortItems: HookMap<
  14205. SyncBailHook<[any[], StatsPrinterContext], boolean | void>
  14206. >;
  14207. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  14208. printItems: HookMap<
  14209. SyncBailHook<[string[], StatsPrinterContext], string | void>
  14210. >;
  14211. print: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  14212. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext]>>;
  14213. }
  14214. declare abstract class StatsPrinter {
  14215. hooks: StatsPrintHooks;
  14216. print(type: string, object?: any, baseContext?: StatsPrinterContext): string;
  14217. }
  14218. type StatsPrinterContext = KnownStatsPrinterColorFn &
  14219. KnownStatsPrinterFormatters &
  14220. KnownStatsPrinterContext &
  14221. Record<string, any>;
  14222. type StatsProfile = KnownStatsProfile & Record<string, any>;
  14223. type StatsValue =
  14224. | boolean
  14225. | StatsOptions
  14226. | "none"
  14227. | "verbose"
  14228. | "summary"
  14229. | "errors-only"
  14230. | "errors-warnings"
  14231. | "minimal"
  14232. | "normal"
  14233. | "detailed";
  14234. type Supports = undefined | string;
  14235. declare class SyncModuleIdsPlugin {
  14236. constructor(__0: SyncModuleIdsPluginOptions);
  14237. /**
  14238. * Apply the plugin
  14239. */
  14240. apply(compiler: Compiler): void;
  14241. }
  14242. declare interface SyncModuleIdsPluginOptions {
  14243. /**
  14244. * path to file
  14245. */
  14246. path: string;
  14247. /**
  14248. * context for module names
  14249. */
  14250. context?: string;
  14251. /**
  14252. * selector for modules
  14253. */
  14254. test?: (module: Module) => boolean;
  14255. /**
  14256. * operation mode (defaults to merge)
  14257. */
  14258. mode?: "read" | "create" | "merge" | "update";
  14259. }
  14260. declare interface SyntheticDependencyLocation {
  14261. name: string;
  14262. index?: number;
  14263. }
  14264. declare const TOMBSTONE: unique symbol;
  14265. declare const TRANSITIVE: unique symbol;
  14266. declare const TRANSITIVE_ONLY: unique symbol;
  14267. declare interface TagData {
  14268. [index: string]: any;
  14269. }
  14270. /**
  14271. * Helper function for joining two ranges into a single range. This is useful
  14272. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  14273. * to create the range of the _parent node_.
  14274. */
  14275. declare interface TagInfo {
  14276. tag: symbol;
  14277. data?: TagData;
  14278. next?: TagInfo;
  14279. }
  14280. declare interface TargetItemWithConnection {
  14281. module: Module;
  14282. connection: ModuleGraphConnection;
  14283. export?: string[];
  14284. }
  14285. declare interface TargetItemWithoutConnection {
  14286. module: Module;
  14287. export: string[];
  14288. }
  14289. declare class Template {
  14290. constructor();
  14291. static getFunctionContent<T extends Function>(fn: T): string;
  14292. static toIdentifier(str: string): string;
  14293. static toComment(str: string): string;
  14294. static toNormalComment(str: string): string;
  14295. static toPath(str: string): string;
  14296. static numberToIdentifier(n: number): string;
  14297. static numberToIdentifierContinuation(n: number): string;
  14298. static indent(s: string | string[]): string;
  14299. static prefix(s: string | string[], prefix: string): string;
  14300. static asString(str: string | string[]): string;
  14301. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  14302. static renderChunkModules(
  14303. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  14304. modules: Module[],
  14305. renderModule: (module: Module) => null | Source,
  14306. prefix?: string
  14307. ): null | Source;
  14308. static renderRuntimeModules(
  14309. runtimeModules: RuntimeModule[],
  14310. renderContext: RenderContextJavascriptModulesPlugin & {
  14311. codeGenerationResults?: CodeGenerationResults;
  14312. }
  14313. ): Source;
  14314. static renderChunkRuntimeModules(
  14315. runtimeModules: RuntimeModule[],
  14316. renderContext: RenderContextJavascriptModulesPlugin
  14317. ): Source;
  14318. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  14319. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  14320. }
  14321. type TemplatePath =
  14322. | string
  14323. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  14324. declare interface TimestampAndHash {
  14325. safeTime: number;
  14326. timestamp?: number;
  14327. hash: string;
  14328. }
  14329. declare class TopLevelSymbol {
  14330. constructor(name: string);
  14331. name: string;
  14332. }
  14333. /**
  14334. * Use a Trusted Types policy to create urls for chunks.
  14335. */
  14336. declare interface TrustedTypes {
  14337. /**
  14338. * 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'.
  14339. */
  14340. onPolicyCreationFailure?: "continue" | "stop";
  14341. /**
  14342. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  14343. */
  14344. policyName?: string;
  14345. }
  14346. declare const UNDEFINED_MARKER: unique symbol;
  14347. /**
  14348. * `URL` class is a global reference for `require('url').URL`
  14349. * https://nodejs.org/api/url.html#the-whatwg-url-api
  14350. */
  14351. declare interface URL_url extends URL {}
  14352. type UnsafeCacheData = KnownUnsafeCacheData & Record<string, any>;
  14353. declare interface UpdateHashContextDependency {
  14354. chunkGraph: ChunkGraph;
  14355. runtime: RuntimeSpec;
  14356. runtimeTemplate?: RuntimeTemplate;
  14357. }
  14358. declare interface UpdateHashContextGenerator {
  14359. /**
  14360. * the module
  14361. */
  14362. module: NormalModule;
  14363. chunkGraph: ChunkGraph;
  14364. runtime: RuntimeSpec;
  14365. runtimeTemplate?: RuntimeTemplate;
  14366. }
  14367. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  14368. type UsedName = string | false | string[];
  14369. type Value = string | number | boolean | RegExp;
  14370. type ValueCacheVersion = string | Set<string>;
  14371. declare class VariableInfo {
  14372. constructor(
  14373. declaredScope: ScopeInfo,
  14374. freeName?: string | true,
  14375. tagInfo?: TagInfo
  14376. );
  14377. declaredScope: ScopeInfo;
  14378. freeName?: string | true;
  14379. tagInfo?: TagInfo;
  14380. }
  14381. type WarningFilterItemTypes =
  14382. | string
  14383. | RegExp
  14384. | ((warning: StatsError, value: string) => boolean);
  14385. declare interface WatchFileSystem {
  14386. watch: (
  14387. files: Iterable<string>,
  14388. directories: Iterable<string>,
  14389. missing: Iterable<string>,
  14390. startTime: number,
  14391. options: WatchOptions,
  14392. callback: (
  14393. err: null | Error,
  14394. timeInfoEntries1?: Map<string, FileSystemInfoEntry | "ignore">,
  14395. timeInfoEntries2?: Map<string, FileSystemInfoEntry | "ignore">,
  14396. changes?: Set<string>,
  14397. removals?: Set<string>
  14398. ) => void,
  14399. callbackUndelayed: (value: string, num: number) => void
  14400. ) => Watcher;
  14401. }
  14402. declare class WatchIgnorePlugin {
  14403. constructor(options: WatchIgnorePluginOptions);
  14404. paths: (string | RegExp)[];
  14405. /**
  14406. * Apply the plugin
  14407. */
  14408. apply(compiler: Compiler): void;
  14409. }
  14410. declare interface WatchIgnorePluginOptions {
  14411. /**
  14412. * A list of RegExps or absolute paths to directories or files that should be ignored.
  14413. */
  14414. paths: (string | RegExp)[];
  14415. }
  14416. /**
  14417. * Options for the watcher.
  14418. */
  14419. declare interface WatchOptions {
  14420. /**
  14421. * Delay the rebuilt after the first change. Value is a time in ms.
  14422. */
  14423. aggregateTimeout?: number;
  14424. /**
  14425. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  14426. */
  14427. followSymlinks?: boolean;
  14428. /**
  14429. * Ignore some files from watching (glob pattern or regexp).
  14430. */
  14431. ignored?: string | RegExp | string[];
  14432. /**
  14433. * Enable polling mode for watching.
  14434. */
  14435. poll?: number | boolean;
  14436. /**
  14437. * Stop watching when stdin stream has ended.
  14438. */
  14439. stdin?: boolean;
  14440. }
  14441. declare interface Watcher {
  14442. /**
  14443. * closes the watcher and all underlying file watchers
  14444. */
  14445. close: () => void;
  14446. /**
  14447. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  14448. */
  14449. pause: () => void;
  14450. /**
  14451. * get current aggregated changes that have not yet send to callback
  14452. */
  14453. getAggregatedChanges?: () => null | Set<string>;
  14454. /**
  14455. * get current aggregated removals that have not yet send to callback
  14456. */
  14457. getAggregatedRemovals?: () => null | Set<string>;
  14458. /**
  14459. * get info about files
  14460. */
  14461. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  14462. /**
  14463. * get info about directories
  14464. */
  14465. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  14466. /**
  14467. * get info about timestamps and changes
  14468. */
  14469. getInfo?: () => WatcherInfo;
  14470. }
  14471. declare interface WatcherInfo {
  14472. /**
  14473. * get current aggregated changes that have not yet send to callback
  14474. */
  14475. changes: null | Set<string>;
  14476. /**
  14477. * get current aggregated removals that have not yet send to callback
  14478. */
  14479. removals: null | Set<string>;
  14480. /**
  14481. * get info about files
  14482. */
  14483. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  14484. /**
  14485. * get info about directories
  14486. */
  14487. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  14488. }
  14489. declare abstract class Watching {
  14490. startTime: null | number;
  14491. invalid: boolean;
  14492. handler: CallbackFunction_1<Stats>;
  14493. callbacks: CallbackFunction_1<void>[];
  14494. closed: boolean;
  14495. suspended: boolean;
  14496. blocked: boolean;
  14497. watchOptions: WatchOptions;
  14498. compiler: Compiler;
  14499. running: boolean;
  14500. watcher?: null | Watcher;
  14501. pausedWatcher?: null | Watcher;
  14502. lastWatcherStartTime?: number;
  14503. watch(
  14504. files: Iterable<string>,
  14505. dirs: Iterable<string>,
  14506. missing: Iterable<string>
  14507. ): void;
  14508. invalidate(callback?: CallbackFunction_1<void>): void;
  14509. suspend(): void;
  14510. resume(): void;
  14511. close(callback: CallbackFunction_1<void>): void;
  14512. }
  14513. declare abstract class WeakTupleMap<T extends any[], V> {
  14514. set(...args: [T, ...V[]]): void;
  14515. has(...args: T): boolean;
  14516. get(...args: T): undefined | V;
  14517. provide(...args: [T, ...(() => V)[]]): V;
  14518. delete(...args: T): void;
  14519. clear(): void;
  14520. }
  14521. declare interface WebAssemblyRenderContext {
  14522. /**
  14523. * the chunk
  14524. */
  14525. chunk: Chunk;
  14526. /**
  14527. * the dependency templates
  14528. */
  14529. dependencyTemplates: DependencyTemplates;
  14530. /**
  14531. * the runtime template
  14532. */
  14533. runtimeTemplate: RuntimeTemplate;
  14534. /**
  14535. * the module graph
  14536. */
  14537. moduleGraph: ModuleGraph;
  14538. /**
  14539. * the chunk graph
  14540. */
  14541. chunkGraph: ChunkGraph;
  14542. /**
  14543. * results of code generation
  14544. */
  14545. codeGenerationResults: CodeGenerationResults;
  14546. }
  14547. declare class WebWorkerTemplatePlugin {
  14548. constructor();
  14549. /**
  14550. * Apply the plugin
  14551. */
  14552. apply(compiler: Compiler): void;
  14553. }
  14554. declare class WebpackError extends Error {
  14555. /**
  14556. * Creates an instance of WebpackError.
  14557. */
  14558. constructor(message?: string);
  14559. [index: number]: () => string;
  14560. details?: string;
  14561. module?: null | Module;
  14562. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  14563. hideStack?: boolean;
  14564. chunk?: Chunk;
  14565. file?: string;
  14566. serialize(__0: ObjectSerializerContext): void;
  14567. deserialize(__0: ObjectDeserializerContext): void;
  14568. /**
  14569. * Create .stack property on a target object
  14570. */
  14571. static captureStackTrace(
  14572. targetObject: object,
  14573. constructorOpt?: Function
  14574. ): void;
  14575. /**
  14576. * Optional override for formatting stack traces
  14577. */
  14578. static prepareStackTrace?: (
  14579. err: Error,
  14580. stackTraces: NodeJS.CallSite[]
  14581. ) => any;
  14582. static stackTraceLimit: number;
  14583. }
  14584. declare abstract class WebpackLogger {
  14585. getChildLogger: (name: string | (() => string)) => WebpackLogger;
  14586. error(...args: any[]): void;
  14587. warn(...args: any[]): void;
  14588. info(...args: any[]): void;
  14589. log(...args: any[]): void;
  14590. debug(...args: any[]): void;
  14591. assert(assertion: any, ...args: any[]): void;
  14592. trace(): void;
  14593. clear(): void;
  14594. status(...args: any[]): void;
  14595. group(...args: any[]): void;
  14596. groupCollapsed(...args: any[]): void;
  14597. groupEnd(): void;
  14598. profile(label?: string): void;
  14599. profileEnd(label?: string): void;
  14600. time(label: string): void;
  14601. timeLog(label?: string): void;
  14602. timeEnd(label?: string): void;
  14603. timeAggregate(label?: string): void;
  14604. timeAggregateEnd(label?: string): void;
  14605. }
  14606. declare class WebpackOptionsApply extends OptionsApply {
  14607. constructor();
  14608. }
  14609. declare class WebpackOptionsDefaulter {
  14610. constructor();
  14611. process(options: Configuration): WebpackOptionsNormalized;
  14612. }
  14613. /**
  14614. * Normalized webpack options object.
  14615. */
  14616. declare interface WebpackOptionsNormalized {
  14617. /**
  14618. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  14619. */
  14620. amd?: false | { [index: string]: any };
  14621. /**
  14622. * Report the first error as a hard error instead of tolerating it.
  14623. */
  14624. bail?: boolean;
  14625. /**
  14626. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  14627. */
  14628. cache: CacheOptionsNormalized;
  14629. /**
  14630. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  14631. */
  14632. context?: string;
  14633. /**
  14634. * References to other configurations to depend on.
  14635. */
  14636. dependencies?: string[];
  14637. /**
  14638. * Options for the webpack-dev-server.
  14639. */
  14640. devServer?: false | { [index: string]: any };
  14641. /**
  14642. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  14643. */
  14644. devtool?: string | false;
  14645. /**
  14646. * The entry point(s) of the compilation.
  14647. */
  14648. entry: EntryNormalized;
  14649. /**
  14650. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  14651. */
  14652. experiments: ExperimentsNormalized;
  14653. /**
  14654. * 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`.
  14655. */
  14656. externals: Externals;
  14657. /**
  14658. * Enable presets of externals for specific targets.
  14659. */
  14660. externalsPresets: ExternalsPresets;
  14661. /**
  14662. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  14663. */
  14664. externalsType?:
  14665. | "import"
  14666. | "var"
  14667. | "module"
  14668. | "assign"
  14669. | "this"
  14670. | "window"
  14671. | "self"
  14672. | "global"
  14673. | "commonjs"
  14674. | "commonjs2"
  14675. | "commonjs-module"
  14676. | "commonjs-static"
  14677. | "amd"
  14678. | "amd-require"
  14679. | "umd"
  14680. | "umd2"
  14681. | "jsonp"
  14682. | "system"
  14683. | "promise"
  14684. | "module-import"
  14685. | "script"
  14686. | "node-commonjs";
  14687. /**
  14688. * Ignore specific warnings.
  14689. */
  14690. ignoreWarnings?: ((
  14691. warning: WebpackError,
  14692. compilation: Compilation
  14693. ) => boolean)[];
  14694. /**
  14695. * Options for infrastructure level logging.
  14696. */
  14697. infrastructureLogging: InfrastructureLogging;
  14698. /**
  14699. * Custom values available in the loader context.
  14700. */
  14701. loader?: Loader;
  14702. /**
  14703. * Enable production optimizations or development hints.
  14704. */
  14705. mode?: "none" | "development" | "production";
  14706. /**
  14707. * Options affecting the normal modules (`NormalModuleFactory`).
  14708. */
  14709. module: ModuleOptionsNormalized;
  14710. /**
  14711. * Name of the configuration. Used when loading multiple configurations.
  14712. */
  14713. name?: string;
  14714. /**
  14715. * Include polyfills or mocks for various node stuff.
  14716. */
  14717. node: Node;
  14718. /**
  14719. * Enables/Disables integrated optimizations.
  14720. */
  14721. optimization: Optimization;
  14722. /**
  14723. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  14724. */
  14725. output: OutputNormalized;
  14726. /**
  14727. * The number of parallel processed modules in the compilation.
  14728. */
  14729. parallelism?: number;
  14730. /**
  14731. * Configuration for web performance recommendations.
  14732. */
  14733. performance?: false | PerformanceOptions;
  14734. /**
  14735. * Add additional plugins to the compiler.
  14736. */
  14737. plugins: (
  14738. | undefined
  14739. | null
  14740. | false
  14741. | ""
  14742. | 0
  14743. | ((this: Compiler, compiler: Compiler) => void)
  14744. | WebpackPluginInstance
  14745. )[];
  14746. /**
  14747. * Capture timing information for each module.
  14748. */
  14749. profile?: boolean;
  14750. /**
  14751. * Store compiler state to a json file.
  14752. */
  14753. recordsInputPath?: string | false;
  14754. /**
  14755. * Load compiler state from a json file.
  14756. */
  14757. recordsOutputPath?: string | false;
  14758. /**
  14759. * Options for the resolver.
  14760. */
  14761. resolve: ResolveOptions;
  14762. /**
  14763. * Options for the resolver when resolving loaders.
  14764. */
  14765. resolveLoader: ResolveOptions;
  14766. /**
  14767. * Options affecting how file system snapshots are created and validated.
  14768. */
  14769. snapshot: SnapshotOptionsWebpackOptions;
  14770. /**
  14771. * Stats options object or preset name.
  14772. */
  14773. stats: StatsValue;
  14774. /**
  14775. * Environment to build for. An array of environments to build for all of them when possible.
  14776. */
  14777. target?: string | false | string[];
  14778. /**
  14779. * Enter watch mode, which rebuilds on file change.
  14780. */
  14781. watch?: boolean;
  14782. /**
  14783. * Options for the watcher.
  14784. */
  14785. watchOptions: WatchOptions;
  14786. }
  14787. /**
  14788. * Plugin instance.
  14789. */
  14790. declare interface WebpackPluginInstance {
  14791. [index: string]: any;
  14792. /**
  14793. * The run point of the plugin, required method.
  14794. */
  14795. apply: (compiler: Compiler) => void;
  14796. }
  14797. declare interface WebpackRequire {
  14798. (id: string): any;
  14799. i?: ((options: ExecuteOptions) => void)[];
  14800. c?: Record<string, ExecuteModuleObject>;
  14801. }
  14802. declare interface WithId {
  14803. id: string | number;
  14804. }
  14805. declare interface WithOptions {
  14806. /**
  14807. * create a resolver with additional/different options
  14808. */
  14809. withOptions: (
  14810. options: Partial<ResolveOptionsWithDependencyType>
  14811. ) => ResolverWithOptions;
  14812. }
  14813. declare interface WriteFile {
  14814. (
  14815. file: PathOrFileDescriptorFs,
  14816. data:
  14817. | string
  14818. | Uint8Array
  14819. | Uint8ClampedArray
  14820. | Uint16Array
  14821. | Uint32Array
  14822. | Int8Array
  14823. | Int16Array
  14824. | Int32Array
  14825. | BigUint64Array
  14826. | BigInt64Array
  14827. | Float32Array
  14828. | Float64Array
  14829. | DataView,
  14830. options: WriteFileOptions,
  14831. callback: (err: null | NodeJS.ErrnoException) => void
  14832. ): void;
  14833. (
  14834. file: PathOrFileDescriptorFs,
  14835. data:
  14836. | string
  14837. | Uint8Array
  14838. | Uint8ClampedArray
  14839. | Uint16Array
  14840. | Uint32Array
  14841. | Int8Array
  14842. | Int16Array
  14843. | Int32Array
  14844. | BigUint64Array
  14845. | BigInt64Array
  14846. | Float32Array
  14847. | Float64Array
  14848. | DataView,
  14849. callback: (err: null | NodeJS.ErrnoException) => void
  14850. ): void;
  14851. }
  14852. type WriteFileOptions =
  14853. | null
  14854. | "ascii"
  14855. | "utf8"
  14856. | "utf-8"
  14857. | "utf16le"
  14858. | "utf-16le"
  14859. | "ucs2"
  14860. | "ucs-2"
  14861. | "base64"
  14862. | "base64url"
  14863. | "latin1"
  14864. | "binary"
  14865. | "hex"
  14866. | (ObjectEncodingOptions &
  14867. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  14868. declare interface WriteOnlySet<T> {
  14869. add: (item: T) => void;
  14870. }
  14871. declare interface WriteStreamOptions {
  14872. flags?: string;
  14873. encoding?:
  14874. | "ascii"
  14875. | "utf8"
  14876. | "utf-8"
  14877. | "utf16le"
  14878. | "utf-16le"
  14879. | "ucs2"
  14880. | "ucs-2"
  14881. | "base64"
  14882. | "base64url"
  14883. | "latin1"
  14884. | "binary"
  14885. | "hex";
  14886. fd?: any;
  14887. mode?: number;
  14888. autoClose?: boolean;
  14889. emitClose?: boolean;
  14890. start?: number;
  14891. signal?: null | AbortSignal;
  14892. fs?: null | CreateWriteStreamFSImplementation;
  14893. }
  14894. type __TypeWebpackOptions = (data: object) =>
  14895. | string
  14896. | {
  14897. /**
  14898. * Unique loader options identifier.
  14899. */
  14900. ident?: string;
  14901. /**
  14902. * Loader name.
  14903. */
  14904. loader?: string;
  14905. /**
  14906. * Loader options.
  14907. */
  14908. options?: string | { [index: string]: any };
  14909. }
  14910. | __TypeWebpackOptions
  14911. | __Type_2[];
  14912. type __Type_2 =
  14913. | undefined
  14914. | null
  14915. | string
  14916. | false
  14917. | 0
  14918. | {
  14919. /**
  14920. * Unique loader options identifier.
  14921. */
  14922. ident?: string;
  14923. /**
  14924. * Loader name.
  14925. */
  14926. loader?: string;
  14927. /**
  14928. * Loader options.
  14929. */
  14930. options?: string | { [index: string]: any };
  14931. }
  14932. | ((data: object) =>
  14933. | string
  14934. | {
  14935. /**
  14936. * Unique loader options identifier.
  14937. */
  14938. ident?: string;
  14939. /**
  14940. * Loader name.
  14941. */
  14942. loader?: string;
  14943. /**
  14944. * Loader options.
  14945. */
  14946. options?: string | { [index: string]: any };
  14947. }
  14948. | __TypeWebpackOptions
  14949. | __Type_2[]);
  14950. declare function exports(
  14951. options: Configuration,
  14952. callback?: CallbackWebpack<Stats>
  14953. ): Compiler;
  14954. declare function exports(
  14955. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  14956. callback?: CallbackWebpack<MultiStats>
  14957. ): MultiCompiler;
  14958. declare namespace exports {
  14959. export const webpack: {
  14960. (options: Configuration, callback?: CallbackWebpack<Stats>): Compiler;
  14961. (
  14962. options: ReadonlyArray<Configuration> & MultiCompilerOptions,
  14963. callback?: CallbackWebpack<MultiStats>
  14964. ): MultiCompiler;
  14965. };
  14966. export const validate: (
  14967. configuration: Configuration | Configuration[]
  14968. ) => void;
  14969. export const validateSchema: (
  14970. schema: Parameters<typeof validateFunction>[0],
  14971. options: Parameters<typeof validateFunction>[1],
  14972. validationConfiguration?: ValidationErrorConfiguration
  14973. ) => void;
  14974. export const version: string;
  14975. export namespace cli {
  14976. export let getArguments: (
  14977. schema?:
  14978. | (JSONSchema4 &
  14979. Extend & {
  14980. absolutePath: boolean;
  14981. instanceof: string;
  14982. cli: {
  14983. helper?: boolean;
  14984. exclude?: boolean;
  14985. description?: string;
  14986. negatedDescription?: string;
  14987. resetDescription?: string;
  14988. };
  14989. })
  14990. | (JSONSchema6 &
  14991. Extend & {
  14992. absolutePath: boolean;
  14993. instanceof: string;
  14994. cli: {
  14995. helper?: boolean;
  14996. exclude?: boolean;
  14997. description?: string;
  14998. negatedDescription?: string;
  14999. resetDescription?: string;
  15000. };
  15001. })
  15002. | (JSONSchema7 &
  15003. Extend & {
  15004. absolutePath: boolean;
  15005. instanceof: string;
  15006. cli: {
  15007. helper?: boolean;
  15008. exclude?: boolean;
  15009. description?: string;
  15010. negatedDescription?: string;
  15011. resetDescription?: string;
  15012. };
  15013. })
  15014. ) => Flags;
  15015. export let processArguments: (
  15016. args: Flags,
  15017. config: any,
  15018. values: Record<string, Value[]>
  15019. ) => null | Problem[];
  15020. }
  15021. export namespace ModuleFilenameHelpers {
  15022. export let ALL_LOADERS_RESOURCE: string;
  15023. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  15024. export let LOADERS_RESOURCE: string;
  15025. export let REGEXP_LOADERS_RESOURCE: RegExp;
  15026. export let RESOURCE: string;
  15027. export let REGEXP_RESOURCE: RegExp;
  15028. export let ABSOLUTE_RESOURCE_PATH: string;
  15029. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  15030. export let RESOURCE_PATH: string;
  15031. export let REGEXP_RESOURCE_PATH: RegExp;
  15032. export let ALL_LOADERS: string;
  15033. export let REGEXP_ALL_LOADERS: RegExp;
  15034. export let LOADERS: string;
  15035. export let REGEXP_LOADERS: RegExp;
  15036. export let QUERY: string;
  15037. export let REGEXP_QUERY: RegExp;
  15038. export let ID: string;
  15039. export let REGEXP_ID: RegExp;
  15040. export let HASH: string;
  15041. export let REGEXP_HASH: RegExp;
  15042. export let NAMESPACE: string;
  15043. export let REGEXP_NAMESPACE: RegExp;
  15044. export let createFilename: (
  15045. module: string | Module,
  15046. options: { namespace?: string; moduleFilenameTemplate?: any },
  15047. __2: {
  15048. requestShortener: RequestShortener;
  15049. chunkGraph: ChunkGraph;
  15050. hashFunction?: string | typeof Hash;
  15051. }
  15052. ) => string;
  15053. export let replaceDuplicates: <T>(
  15054. array: T[],
  15055. fn: (
  15056. duplicateItem: T,
  15057. duplicateItemIndex: number,
  15058. numberOfTimesReplaced: number
  15059. ) => T,
  15060. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  15061. ) => T[];
  15062. export let matchPart: (str: string, test: Matcher) => boolean;
  15063. export let matchObject: (obj: MatchObject, str: string) => boolean;
  15064. }
  15065. export namespace OptimizationStages {
  15066. export let STAGE_BASIC: -10;
  15067. export let STAGE_DEFAULT: 0;
  15068. export let STAGE_ADVANCED: 10;
  15069. }
  15070. export namespace RuntimeGlobals {
  15071. export let require: "__webpack_require__";
  15072. export let requireScope: "__webpack_require__.*";
  15073. export let exports: "__webpack_exports__";
  15074. export let thisAsExports: "top-level-this-exports";
  15075. export let returnExportsFromRuntime: "return-exports-from-runtime";
  15076. export let module: "module";
  15077. export let moduleId: "module.id";
  15078. export let moduleLoaded: "module.loaded";
  15079. export let publicPath: "__webpack_require__.p";
  15080. export let entryModuleId: "__webpack_require__.s";
  15081. export let moduleCache: "__webpack_require__.c";
  15082. export let moduleFactories: "__webpack_require__.m";
  15083. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  15084. export let ensureChunk: "__webpack_require__.e";
  15085. export let ensureChunkHandlers: "__webpack_require__.f";
  15086. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  15087. export let prefetchChunk: "__webpack_require__.E";
  15088. export let prefetchChunkHandlers: "__webpack_require__.F";
  15089. export let preloadChunk: "__webpack_require__.G";
  15090. export let preloadChunkHandlers: "__webpack_require__.H";
  15091. export let definePropertyGetters: "__webpack_require__.d";
  15092. export let makeNamespaceObject: "__webpack_require__.r";
  15093. export let createFakeNamespaceObject: "__webpack_require__.t";
  15094. export let compatGetDefaultExport: "__webpack_require__.n";
  15095. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  15096. export let nodeModuleDecorator: "__webpack_require__.nmd";
  15097. export let getFullHash: "__webpack_require__.h";
  15098. export let wasmInstances: "__webpack_require__.w";
  15099. export let instantiateWasm: "__webpack_require__.v";
  15100. export let uncaughtErrorHandler: "__webpack_require__.oe";
  15101. export let scriptNonce: "__webpack_require__.nc";
  15102. export let loadScript: "__webpack_require__.l";
  15103. export let createScript: "__webpack_require__.ts";
  15104. export let createScriptUrl: "__webpack_require__.tu";
  15105. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  15106. export let hasFetchPriority: "has fetch priority";
  15107. export let chunkName: "__webpack_require__.cn";
  15108. export let runtimeId: "__webpack_require__.j";
  15109. export let getChunkScriptFilename: "__webpack_require__.u";
  15110. export let getChunkCssFilename: "__webpack_require__.k";
  15111. export let hasCssModules: "has css modules";
  15112. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  15113. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  15114. export let startup: "__webpack_require__.x";
  15115. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  15116. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  15117. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  15118. export let chunkCallback: "webpackChunk";
  15119. export let startupEntrypoint: "__webpack_require__.X";
  15120. export let onChunksLoaded: "__webpack_require__.O";
  15121. export let externalInstallChunk: "__webpack_require__.C";
  15122. export let interceptModuleExecution: "__webpack_require__.i";
  15123. export let global: "__webpack_require__.g";
  15124. export let shareScopeMap: "__webpack_require__.S";
  15125. export let initializeSharing: "__webpack_require__.I";
  15126. export let currentRemoteGetScope: "__webpack_require__.R";
  15127. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  15128. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  15129. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  15130. export let hmrModuleData: "__webpack_require__.hmrD";
  15131. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  15132. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  15133. export let amdDefine: "__webpack_require__.amdD";
  15134. export let amdOptions: "__webpack_require__.amdO";
  15135. export let system: "__webpack_require__.System";
  15136. export let hasOwnProperty: "__webpack_require__.o";
  15137. export let systemContext: "__webpack_require__.y";
  15138. export let baseURI: "__webpack_require__.b";
  15139. export let relativeUrl: "__webpack_require__.U";
  15140. export let asyncModule: "__webpack_require__.a";
  15141. }
  15142. export const UsageState: Readonly<{
  15143. Unused: 0;
  15144. OnlyPropertiesUsed: 1;
  15145. NoInfo: 2;
  15146. Unknown: 3;
  15147. Used: 4;
  15148. }>;
  15149. export namespace cache {
  15150. export { MemoryCachePlugin };
  15151. }
  15152. export namespace config {
  15153. export const getNormalizedWebpackOptions: (
  15154. config: Configuration
  15155. ) => WebpackOptionsNormalized;
  15156. export const applyWebpackOptionsDefaults: (
  15157. options: WebpackOptionsNormalized,
  15158. compilerIndex?: number
  15159. ) => ResolvedOptions;
  15160. }
  15161. export namespace dependencies {
  15162. export {
  15163. ModuleDependency,
  15164. HarmonyImportDependency,
  15165. ConstDependency,
  15166. NullDependency
  15167. };
  15168. }
  15169. export namespace ids {
  15170. export {
  15171. ChunkModuleIdRangePlugin,
  15172. NaturalModuleIdsPlugin,
  15173. OccurrenceModuleIdsPlugin,
  15174. NamedModuleIdsPlugin,
  15175. DeterministicChunkIdsPlugin,
  15176. DeterministicModuleIdsPlugin,
  15177. NamedChunkIdsPlugin,
  15178. OccurrenceChunkIdsPlugin,
  15179. HashedModuleIdsPlugin
  15180. };
  15181. }
  15182. export namespace javascript {
  15183. export {
  15184. EnableChunkLoadingPlugin,
  15185. JavascriptModulesPlugin,
  15186. JavascriptParser
  15187. };
  15188. }
  15189. export namespace optimize {
  15190. export namespace InnerGraph {
  15191. export let bailout: (parserState: ParserState) => void;
  15192. export let enable: (parserState: ParserState) => void;
  15193. export let isEnabled: (parserState: ParserState) => boolean;
  15194. export let addUsage: (
  15195. state: ParserState,
  15196. symbol: null | TopLevelSymbol,
  15197. usage: string | true | TopLevelSymbol
  15198. ) => void;
  15199. export let addVariableUsage: (
  15200. parser: JavascriptParser,
  15201. name: string,
  15202. usage: string | true | TopLevelSymbol
  15203. ) => void;
  15204. export let inferDependencyUsage: (state: ParserState) => void;
  15205. export let onUsage: (
  15206. state: ParserState,
  15207. onUsageCallback: (value?: boolean | Set<string>) => void
  15208. ) => void;
  15209. export let setTopLevelSymbol: (
  15210. state: ParserState,
  15211. symbol?: TopLevelSymbol
  15212. ) => void;
  15213. export let getTopLevelSymbol: (
  15214. state: ParserState
  15215. ) => void | TopLevelSymbol;
  15216. export let tagTopLevelSymbol: (
  15217. parser: JavascriptParser,
  15218. name: string
  15219. ) => undefined | TopLevelSymbol;
  15220. export let isDependencyUsedByExports: (
  15221. dependency: Dependency,
  15222. usedByExports: boolean | Set<string>,
  15223. moduleGraph: ModuleGraph,
  15224. runtime: RuntimeSpec
  15225. ) => boolean;
  15226. export let getDependencyUsedByExportsCondition: (
  15227. dependency: Dependency,
  15228. usedByExports: undefined | boolean | Set<string>,
  15229. moduleGraph: ModuleGraph
  15230. ) =>
  15231. | null
  15232. | false
  15233. | ((
  15234. moduleGraphConnection: ModuleGraphConnection,
  15235. runtime: RuntimeSpec
  15236. ) => ConnectionState);
  15237. export { TopLevelSymbol, topLevelSymbolTag };
  15238. }
  15239. export {
  15240. AggressiveMergingPlugin,
  15241. AggressiveSplittingPlugin,
  15242. LimitChunkCountPlugin,
  15243. MergeDuplicateChunksPlugin,
  15244. MinChunkSizePlugin,
  15245. ModuleConcatenationPlugin,
  15246. RealContentHashPlugin,
  15247. RuntimeChunkPlugin,
  15248. SideEffectsFlagPlugin,
  15249. SplitChunksPlugin
  15250. };
  15251. }
  15252. export namespace runtime {
  15253. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  15254. }
  15255. export namespace prefetch {
  15256. export { ChunkPrefetchPreloadPlugin };
  15257. }
  15258. export namespace web {
  15259. export {
  15260. FetchCompileWasmPlugin,
  15261. FetchCompileAsyncWasmPlugin,
  15262. JsonpChunkLoadingRuntimeModule,
  15263. JsonpTemplatePlugin,
  15264. CssLoadingRuntimeModule
  15265. };
  15266. }
  15267. export namespace esm {
  15268. export { ModuleChunkLoadingRuntimeModule };
  15269. }
  15270. export namespace webworker {
  15271. export { WebWorkerTemplatePlugin };
  15272. }
  15273. export namespace node {
  15274. export {
  15275. NodeEnvironmentPlugin,
  15276. NodeSourcePlugin,
  15277. NodeTargetPlugin,
  15278. NodeTemplatePlugin,
  15279. ReadFileCompileWasmPlugin,
  15280. ReadFileCompileAsyncWasmPlugin
  15281. };
  15282. }
  15283. export namespace electron {
  15284. export { ElectronTargetPlugin };
  15285. }
  15286. export namespace wasm {
  15287. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  15288. }
  15289. export namespace css {
  15290. export { CssModulesPlugin };
  15291. }
  15292. export namespace library {
  15293. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  15294. }
  15295. export namespace container {
  15296. export const scope: <T>(
  15297. scope: string,
  15298. options: ContainerOptionsFormat<T>
  15299. ) => Record<string, string | string[] | T>;
  15300. export {
  15301. ContainerPlugin,
  15302. ContainerReferencePlugin,
  15303. ModuleFederationPlugin
  15304. };
  15305. }
  15306. export namespace sharing {
  15307. export const scope: <T>(
  15308. scope: string,
  15309. options: ContainerOptionsFormat<T>
  15310. ) => Record<string, string | string[] | T>;
  15311. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  15312. }
  15313. export namespace debug {
  15314. export { ProfilingPlugin };
  15315. }
  15316. export namespace util {
  15317. export const createHash: (algorithm: Algorithm) => Hash;
  15318. export namespace comparators {
  15319. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  15320. export let compareModulesByIdentifier: (
  15321. a: Module,
  15322. b: Module
  15323. ) => 0 | 1 | -1;
  15324. export let compareModulesById: ParameterizedComparator<
  15325. ChunkGraph,
  15326. Module
  15327. >;
  15328. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  15329. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  15330. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  15331. ModuleGraph,
  15332. Module
  15333. >;
  15334. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  15335. ModuleGraph,
  15336. Module
  15337. >;
  15338. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  15339. ChunkGraph,
  15340. Module
  15341. >;
  15342. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  15343. export let compareIds: (
  15344. a: string | number,
  15345. b: string | number
  15346. ) => 0 | 1 | -1;
  15347. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  15348. export let compareChunkGroupsByIndex: (
  15349. a: ChunkGroup,
  15350. b: ChunkGroup
  15351. ) => 0 | 1 | -1;
  15352. export let concatComparators: <T>(
  15353. c1: Comparator<T>,
  15354. c2: Comparator<T>,
  15355. ...cRest: Comparator<T>[]
  15356. ) => Comparator<T>;
  15357. export let compareSelect: <T, R>(
  15358. getter: Selector<T, R>,
  15359. comparator: Comparator<R>
  15360. ) => Comparator<T>;
  15361. export let compareIterables: <T>(
  15362. elementComparator: Comparator<T>
  15363. ) => Comparator<Iterable<T>>;
  15364. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  15365. export let compareChunksNatural: (
  15366. chunkGraph: ChunkGraph
  15367. ) => Comparator<Chunk>;
  15368. export let compareLocations: (
  15369. a: DependencyLocation,
  15370. b: DependencyLocation
  15371. ) => 0 | 1 | -1;
  15372. }
  15373. export namespace runtime {
  15374. export let getEntryRuntime: (
  15375. compilation: Compilation,
  15376. name: string,
  15377. options?: EntryOptions
  15378. ) => RuntimeSpec;
  15379. export let forEachRuntime: (
  15380. runtime: RuntimeSpec,
  15381. fn: (runtime?: string) => void,
  15382. deterministicOrder?: boolean
  15383. ) => void;
  15384. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  15385. export let keyToRuntime: (key: string) => RuntimeSpec;
  15386. export let runtimeToString: (runtime: RuntimeSpec) => string;
  15387. export let runtimeConditionToString: (
  15388. runtimeCondition: RuntimeCondition
  15389. ) => string;
  15390. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  15391. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  15392. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  15393. export let mergeRuntimeCondition: (
  15394. a: RuntimeCondition,
  15395. b: RuntimeCondition,
  15396. runtime: RuntimeSpec
  15397. ) => RuntimeCondition;
  15398. export let mergeRuntimeConditionNonFalse: (
  15399. a: undefined | string | true | SortableSet<string>,
  15400. b: undefined | string | true | SortableSet<string>,
  15401. runtime: RuntimeSpec
  15402. ) => undefined | string | true | SortableSet<string>;
  15403. export let mergeRuntimeOwned: (
  15404. a: RuntimeSpec,
  15405. b: RuntimeSpec
  15406. ) => RuntimeSpec;
  15407. export let intersectRuntime: (
  15408. a: RuntimeSpec,
  15409. b: RuntimeSpec
  15410. ) => RuntimeSpec;
  15411. export let subtractRuntime: (
  15412. a: RuntimeSpec,
  15413. b: RuntimeSpec
  15414. ) => RuntimeSpec;
  15415. export let subtractRuntimeCondition: (
  15416. a: RuntimeCondition,
  15417. b: RuntimeCondition,
  15418. runtime: RuntimeSpec
  15419. ) => RuntimeCondition;
  15420. export let filterRuntime: (
  15421. runtime: RuntimeSpec,
  15422. filter: (runtime?: RuntimeSpec) => boolean
  15423. ) => undefined | string | boolean | SortableSet<string>;
  15424. export { RuntimeSpecMap, RuntimeSpecSet };
  15425. }
  15426. export namespace serialization {
  15427. export const register: (
  15428. Constructor: Constructor,
  15429. request: string,
  15430. name: null | string,
  15431. serializer: ObjectSerializer
  15432. ) => void;
  15433. export const registerLoader: (
  15434. regExp: RegExp,
  15435. loader: (request: string) => boolean
  15436. ) => void;
  15437. export const registerNotSerializable: (Constructor: Constructor) => void;
  15438. export const NOT_SERIALIZABLE: object;
  15439. export const buffersSerializer: Serializer;
  15440. export let createFileSerializer: (
  15441. fs: IntermediateFileSystem,
  15442. hashFunction: string | typeof Hash
  15443. ) => Serializer;
  15444. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  15445. }
  15446. export const cleverMerge: <T, O>(
  15447. first?: null | T,
  15448. second?: null | O
  15449. ) => T | O | (T & O);
  15450. export function compileBooleanMatcher(
  15451. map: Record<string | number, boolean>
  15452. ): boolean | ((value: string) => string);
  15453. export namespace compileBooleanMatcher {
  15454. export let fromLists: (
  15455. positiveItems: string[],
  15456. negativeItems: string[]
  15457. ) => (value: string) => string;
  15458. export let itemsToRegexp: (itemsArr: string[]) => string;
  15459. }
  15460. export { LazySet };
  15461. }
  15462. export namespace sources {
  15463. export {
  15464. Source,
  15465. RawSource,
  15466. OriginalSource,
  15467. ReplaceSource,
  15468. SourceMapSource,
  15469. ConcatSource,
  15470. PrefixSource,
  15471. CachedSource,
  15472. SizeOnlySource,
  15473. CompatSource
  15474. };
  15475. }
  15476. export namespace experiments {
  15477. export namespace schemes {
  15478. export { HttpUriPlugin };
  15479. }
  15480. export namespace ids {
  15481. export { SyncModuleIdsPlugin };
  15482. }
  15483. }
  15484. export type WebpackPluginFunction = (
  15485. this: Compiler,
  15486. compiler: Compiler
  15487. ) => void;
  15488. export {
  15489. AutomaticPrefetchPlugin,
  15490. AsyncDependenciesBlock,
  15491. BannerPlugin,
  15492. Cache,
  15493. Chunk,
  15494. ChunkGraph,
  15495. CleanPlugin,
  15496. Compilation,
  15497. Compiler,
  15498. ConcatenationScope,
  15499. ContextExclusionPlugin,
  15500. ContextReplacementPlugin,
  15501. DefinePlugin,
  15502. DelegatedPlugin,
  15503. Dependency,
  15504. DllPlugin,
  15505. DllReferencePlugin,
  15506. DynamicEntryPlugin,
  15507. EntryOptionPlugin,
  15508. EntryPlugin,
  15509. EnvironmentPlugin,
  15510. EvalDevToolModulePlugin,
  15511. EvalSourceMapDevToolPlugin,
  15512. ExternalModule,
  15513. ExternalsPlugin,
  15514. Generator,
  15515. HotUpdateChunk,
  15516. HotModuleReplacementPlugin,
  15517. InitFragment,
  15518. IgnorePlugin,
  15519. JavascriptModulesPlugin,
  15520. LibManifestPlugin,
  15521. LibraryTemplatePlugin,
  15522. LoaderOptionsPlugin,
  15523. LoaderTargetPlugin,
  15524. Module,
  15525. ModuleGraph,
  15526. ModuleGraphConnection,
  15527. NoEmitOnErrorsPlugin,
  15528. NormalModule,
  15529. NormalModuleReplacementPlugin,
  15530. MultiCompiler,
  15531. Parser,
  15532. PlatformPlugin,
  15533. PrefetchPlugin,
  15534. ProgressPlugin,
  15535. ProvidePlugin,
  15536. RuntimeModule,
  15537. EntryPlugin as SingleEntryPlugin,
  15538. SourceMapDevToolPlugin,
  15539. Stats,
  15540. Template,
  15541. WatchIgnorePlugin,
  15542. WebpackError,
  15543. WebpackOptionsApply,
  15544. WebpackOptionsDefaulter,
  15545. ValidationError as WebpackOptionsValidationError,
  15546. ValidationError,
  15547. Entry,
  15548. EntryNormalized,
  15549. EntryObject,
  15550. ExternalItemFunctionData,
  15551. ExternalItemObjectKnown,
  15552. ExternalItemObjectUnknown,
  15553. ExternalItemValue,
  15554. Externals,
  15555. FileCacheOptions,
  15556. LibraryOptions,
  15557. MemoryCacheOptions,
  15558. ModuleOptions,
  15559. ResolveOptions,
  15560. RuleSetCondition,
  15561. RuleSetConditionAbsolute,
  15562. RuleSetRule,
  15563. RuleSetUse,
  15564. RuleSetUseItem,
  15565. StatsOptions,
  15566. Configuration,
  15567. WebpackOptionsNormalized,
  15568. WebpackPluginInstance,
  15569. ChunkGroup,
  15570. Asset,
  15571. AssetInfo,
  15572. EntryOptions,
  15573. PathData,
  15574. AssetEmittedInfo,
  15575. MultiCompilerOptions,
  15576. MultiStats,
  15577. ResolveData,
  15578. ParserState,
  15579. ResolvePluginInstance,
  15580. Resolver,
  15581. Watching,
  15582. Argument,
  15583. Problem,
  15584. StatsAsset,
  15585. StatsChunk,
  15586. StatsChunkGroup,
  15587. StatsChunkOrigin,
  15588. StatsCompilation,
  15589. StatsError,
  15590. StatsLogging,
  15591. StatsLoggingEntry,
  15592. StatsModule,
  15593. StatsModuleIssuer,
  15594. StatsModuleReason,
  15595. StatsModuleTraceDependency,
  15596. StatsModuleTraceItem,
  15597. StatsProfile,
  15598. InputFileSystem,
  15599. OutputFileSystem,
  15600. LoaderModule,
  15601. RawLoaderDefinition,
  15602. LoaderDefinition,
  15603. LoaderDefinitionFunction,
  15604. PitchLoaderDefinitionFunction,
  15605. RawLoaderDefinitionFunction,
  15606. LoaderContextDeclarationsIndex as LoaderContext
  15607. };
  15608. }
  15609. declare const topLevelSymbolTag: unique symbol;
  15610. export = exports;