types.d.ts 480 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771
  1. /*
  2. * This file was automatically generated.
  3. * DO NOT MODIFY BY HAND.
  4. * Run `yarn fix:special` to update
  5. */
  6. import { Parser as ParserImport } from "acorn";
  7. import { Buffer } from "buffer";
  8. import { Scope } from "eslint-scope";
  9. import {
  10. ArrayExpression,
  11. ArrayPattern,
  12. ArrowFunctionExpression,
  13. AssignmentExpression,
  14. AssignmentPattern,
  15. AssignmentProperty,
  16. AwaitExpression,
  17. BigIntLiteral,
  18. BinaryExpression,
  19. BlockStatement,
  20. BreakStatement,
  21. CatchClause,
  22. ChainExpression,
  23. ClassBody,
  24. ClassDeclaration,
  25. ClassExpression,
  26. Comment as CommentImport,
  27. ConditionalExpression,
  28. ContinueStatement,
  29. DebuggerStatement,
  30. Directive,
  31. DoWhileStatement,
  32. EmptyStatement,
  33. ExportAllDeclaration,
  34. ExportDefaultDeclaration,
  35. ExportNamedDeclaration,
  36. ExportSpecifier,
  37. ExpressionStatement,
  38. ForInStatement,
  39. ForOfStatement,
  40. ForStatement,
  41. FunctionDeclaration,
  42. FunctionExpression,
  43. Identifier,
  44. IfStatement,
  45. ImportDeclaration,
  46. ImportDefaultSpecifier,
  47. ImportExpression as ImportExpressionImport,
  48. ImportNamespaceSpecifier,
  49. ImportSpecifier,
  50. LabeledStatement,
  51. LogicalExpression,
  52. MaybeNamedClassDeclaration,
  53. MaybeNamedFunctionDeclaration,
  54. MemberExpression,
  55. MetaProperty,
  56. MethodDefinition,
  57. NewExpression,
  58. ObjectExpression,
  59. ObjectPattern,
  60. PrivateIdentifier,
  61. Program,
  62. Property,
  63. PropertyDefinition,
  64. RegExpLiteral,
  65. RestElement,
  66. ReturnStatement,
  67. SequenceExpression,
  68. SimpleCallExpression,
  69. SimpleLiteral,
  70. SourceLocation,
  71. SpreadElement,
  72. StaticBlock,
  73. Super,
  74. SwitchCase,
  75. SwitchStatement,
  76. TaggedTemplateExpression,
  77. TemplateElement,
  78. TemplateLiteral,
  79. ThisExpression,
  80. ThrowStatement,
  81. TryStatement,
  82. UnaryExpression,
  83. UpdateExpression,
  84. VariableDeclaration,
  85. VariableDeclarator,
  86. WhileStatement,
  87. WithStatement,
  88. YieldExpression
  89. } from "estree";
  90. import {
  91. IncomingMessage,
  92. Server as ServerImportHttp,
  93. ServerOptions as ServerOptionsImportHttp
  94. } from "http";
  95. import {
  96. Server as ServerImportHttps,
  97. ServerOptions as ServerOptionsImportHttps
  98. } from "https";
  99. import {
  100. Session as SessionImportInspectorClass_1,
  101. Session as SessionImportInspectorClass_2
  102. } from "inspector";
  103. import { JSONSchema4, JSONSchema6, JSONSchema7 } from "json-schema";
  104. import { ListenOptions } from "net";
  105. import {
  106. ValidationErrorConfiguration,
  107. validate as validateFunction
  108. } from "schema-utils";
  109. import { default as ValidationError } from "schema-utils/declarations/ValidationError";
  110. import {
  111. AsArray,
  112. AsyncParallelHook,
  113. AsyncSeriesBailHook,
  114. AsyncSeriesHook,
  115. AsyncSeriesWaterfallHook,
  116. HookMap,
  117. IfSet,
  118. MultiHook,
  119. SyncBailHook,
  120. SyncHook,
  121. SyncWaterfallHook,
  122. TapOptions,
  123. TypedHookMap
  124. } from "tapable";
  125. import { URL } from "url";
  126. import { Context } from "vm";
  127. declare interface Abortable {
  128. /**
  129. * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
  130. */
  131. signal?: AbortSignal;
  132. }
  133. declare class AbstractLibraryPlugin<T> {
  134. constructor(__0: AbstractLibraryPluginOptions);
  135. /**
  136. * Apply the plugin
  137. */
  138. apply(compiler: Compiler): void;
  139. parseOptions(library: LibraryOptions): false | T;
  140. finishEntryModule(
  141. module: Module,
  142. entryName: string,
  143. libraryContext: LibraryContext<T>
  144. ): void;
  145. embedInRuntimeBailout(
  146. module: Module,
  147. renderContext: RenderContextJavascriptModulesPlugin,
  148. libraryContext: LibraryContext<T>
  149. ): undefined | string;
  150. strictRuntimeBailout(
  151. renderContext: RenderContextJavascriptModulesPlugin,
  152. libraryContext: LibraryContext<T>
  153. ): undefined | string;
  154. runtimeRequirements(
  155. chunk: Chunk,
  156. set: Set<string>,
  157. libraryContext: LibraryContext<T>
  158. ): void;
  159. render(
  160. source: Source,
  161. renderContext: RenderContextJavascriptModulesPlugin,
  162. libraryContext: LibraryContext<T>
  163. ): Source;
  164. renderStartup(
  165. source: Source,
  166. module: Module,
  167. renderContext: StartupRenderContext,
  168. libraryContext: LibraryContext<T>
  169. ): Source;
  170. renderModuleContent(
  171. source: Source,
  172. module: Module,
  173. renderContext: ModuleRenderContext,
  174. libraryContext: Omit<LibraryContext<T>, "options">
  175. ): Source;
  176. chunkHash(
  177. chunk: Chunk,
  178. hash: Hash,
  179. chunkHashContext: ChunkHashContext,
  180. libraryContext: LibraryContext<T>
  181. ): void;
  182. static COMMON_LIBRARY_NAME_MESSAGE: string;
  183. }
  184. declare interface AbstractLibraryPluginOptions {
  185. /**
  186. * name of the plugin
  187. */
  188. pluginName: string;
  189. /**
  190. * used library type
  191. */
  192. type: string;
  193. }
  194. declare interface AdditionalData {
  195. [index: string]: any;
  196. webpackAST: object;
  197. }
  198. type AfterContextResolveData = ContextResolveData &
  199. ContextOptions & {
  200. resource: string | string[];
  201. resourceQuery?: string;
  202. resourceFragment?: string;
  203. resolveDependencies: (
  204. fs: InputFileSystem,
  205. options: ContextModuleOptions,
  206. callback: (
  207. err: null | Error,
  208. dependencies?: ContextElementDependency[]
  209. ) => void
  210. ) => void;
  211. };
  212. declare class AggressiveMergingPlugin {
  213. constructor(options?: AggressiveMergingPluginOptions);
  214. options: AggressiveMergingPluginOptions;
  215. /**
  216. * Apply the plugin
  217. */
  218. apply(compiler: Compiler): void;
  219. }
  220. declare interface AggressiveMergingPluginOptions {
  221. /**
  222. * minimal size reduction to trigger merging
  223. */
  224. minSizeReduce?: number;
  225. }
  226. declare class AggressiveSplittingPlugin {
  227. constructor(options?: AggressiveSplittingPluginOptions);
  228. options: AggressiveSplittingPluginOptions;
  229. /**
  230. * Apply the plugin
  231. */
  232. apply(compiler: Compiler): void;
  233. static wasChunkRecorded(chunk: Chunk): boolean;
  234. }
  235. declare interface AggressiveSplittingPluginOptions {
  236. /**
  237. * Extra cost for each chunk (Default: 9.8kiB).
  238. */
  239. chunkOverhead?: number;
  240. /**
  241. * Extra cost multiplicator for entry chunks (Default: 10).
  242. */
  243. entryChunkMultiplicator?: number;
  244. /**
  245. * Byte, max size of per file (Default: 50kiB).
  246. */
  247. maxSize?: number;
  248. /**
  249. * Byte, split point. (Default: 30kiB).
  250. */
  251. minSize?: number;
  252. }
  253. type Alias = string | false | string[];
  254. declare interface AliasOption {
  255. alias: Alias;
  256. name: string;
  257. onlyModule?: boolean;
  258. }
  259. type AliasOptionNewRequest = string | false | string[];
  260. declare interface AliasOptions {
  261. [index: string]: AliasOptionNewRequest;
  262. }
  263. type AnyLoaderContext = NormalModuleLoaderContext<any> &
  264. LoaderRunnerLoaderContext<any> &
  265. LoaderPluginLoaderContext &
  266. HotModuleReplacementPluginLoaderContext;
  267. declare interface Argument {
  268. description?: string;
  269. simpleType: SimpleType;
  270. multiple: boolean;
  271. configs: ArgumentConfig[];
  272. }
  273. declare interface ArgumentConfig {
  274. description?: string;
  275. negatedDescription?: string;
  276. path: string;
  277. multiple: boolean;
  278. type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
  279. values?: EnumValue[];
  280. }
  281. declare interface Asset {
  282. /**
  283. * the filename of the asset
  284. */
  285. name: string;
  286. /**
  287. * source of the asset
  288. */
  289. source: Source;
  290. /**
  291. * info about the asset
  292. */
  293. info: AssetInfo;
  294. }
  295. declare abstract class AssetBytesGenerator extends Generator {
  296. generateError(
  297. error: Error,
  298. module: NormalModule,
  299. generateContext: GenerateContext
  300. ): null | Source;
  301. }
  302. declare abstract class AssetBytesParser extends ParserClass {}
  303. declare interface AssetDependencyMeta {
  304. sourceType: "css-url";
  305. }
  306. declare interface AssetEmittedInfo {
  307. content: Buffer;
  308. source: Source;
  309. compilation: Compilation;
  310. outputPath: string;
  311. targetPath: string;
  312. }
  313. type AssetFilterItemTypes =
  314. | string
  315. | RegExp
  316. | ((name: string, asset: StatsAsset) => boolean);
  317. declare abstract class AssetGenerator extends Generator {
  318. dataUrlOptions?:
  319. | AssetGeneratorDataUrlOptions
  320. | ((
  321. source: string | Buffer,
  322. context: { filename: string; module: Module }
  323. ) => string);
  324. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  325. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  326. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  327. emit?: boolean;
  328. getMimeType(module: NormalModule): string;
  329. generateDataUri(module: NormalModule): string;
  330. generateError(
  331. error: Error,
  332. module: NormalModule,
  333. generateContext: GenerateContext
  334. ): null | Source;
  335. }
  336. /**
  337. * Options object for data url generation.
  338. */
  339. declare interface AssetGeneratorDataUrlOptions {
  340. /**
  341. * Asset encoding (defaults to base64).
  342. */
  343. encoding?: false | "base64";
  344. /**
  345. * Asset mimetype (getting from file extension by default).
  346. */
  347. mimetype?: string;
  348. }
  349. type AssetGeneratorOptions = AssetInlineGeneratorOptions &
  350. AssetResourceGeneratorOptions;
  351. type AssetInfo = KnownAssetInfo & Record<string, any>;
  352. /**
  353. * Generator options for asset/inline modules.
  354. */
  355. declare interface AssetInlineGeneratorOptions {
  356. /**
  357. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  358. */
  359. binary?: boolean;
  360. /**
  361. * The options for data url generator.
  362. */
  363. dataUrl?:
  364. | AssetGeneratorDataUrlOptions
  365. | ((
  366. source: string | Buffer,
  367. context: { filename: string; module: Module }
  368. ) => string);
  369. }
  370. declare abstract class AssetParser extends ParserClass {
  371. dataUrlCondition?:
  372. | boolean
  373. | AssetParserDataUrlOptions
  374. | ((
  375. source: string | Buffer,
  376. context: { filename: string; module: Module }
  377. ) => boolean);
  378. }
  379. /**
  380. * Options object for DataUrl condition.
  381. */
  382. declare interface AssetParserDataUrlOptions {
  383. /**
  384. * Maximum size of asset that should be inline as modules. Default: 8kb.
  385. */
  386. maxSize?: number;
  387. }
  388. /**
  389. * Parser options for asset modules.
  390. */
  391. declare interface AssetParserOptions {
  392. /**
  393. * The condition for inlining the asset as DataUrl.
  394. */
  395. dataUrlCondition?:
  396. | AssetParserDataUrlOptions
  397. | ((
  398. source: string | Buffer,
  399. context: { filename: string; module: Module }
  400. ) => boolean);
  401. }
  402. /**
  403. * Generator options for asset/resource modules.
  404. */
  405. declare interface AssetResourceGeneratorOptions {
  406. /**
  407. * Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
  408. */
  409. binary?: boolean;
  410. /**
  411. * Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
  412. */
  413. emit?: boolean;
  414. /**
  415. * 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.
  416. */
  417. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  418. /**
  419. * 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.
  420. */
  421. outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  422. /**
  423. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  424. */
  425. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  426. }
  427. declare abstract class AssetSourceGenerator extends Generator {
  428. generateError(
  429. error: Error,
  430. module: NormalModule,
  431. generateContext: GenerateContext
  432. ): null | Source;
  433. }
  434. declare abstract class AssetSourceParser extends ParserClass {}
  435. declare class AsyncDependenciesBlock extends DependenciesBlock {
  436. constructor(
  437. groupOptions:
  438. | null
  439. | string
  440. | (RawChunkGroupOptions & { name?: null | string } & {
  441. entryOptions?: EntryOptions;
  442. }),
  443. loc?: null | SyntheticDependencyLocation | RealDependencyLocation,
  444. request?: null | string
  445. );
  446. groupOptions: RawChunkGroupOptions & { name?: null | string } & {
  447. entryOptions?: EntryOptions;
  448. };
  449. loc?: null | SyntheticDependencyLocation | RealDependencyLocation;
  450. request?: null | string;
  451. chunkName?: null | string;
  452. module: any;
  453. }
  454. declare abstract class AsyncQueue<T, K, R> {
  455. hooks: {
  456. beforeAdd: AsyncSeriesHook<[T]>;
  457. added: SyncHook<[T]>;
  458. beforeStart: AsyncSeriesHook<[T]>;
  459. started: SyncHook<[T]>;
  460. result: SyncHook<
  461. [T, undefined | null | WebpackError, undefined | null | R]
  462. >;
  463. };
  464. getContext(): string;
  465. setContext(value: string): void;
  466. add(item: T, callback: CallbackAsyncQueue<R>): void;
  467. invalidate(item: T): void;
  468. /**
  469. * Waits for an already started item
  470. */
  471. waitFor(item: T, callback: CallbackAsyncQueue<R>): void;
  472. stop(): void;
  473. increaseParallelism(): void;
  474. decreaseParallelism(): void;
  475. isProcessing(item: T): boolean;
  476. isQueued(item: T): boolean;
  477. isDone(item: T): boolean;
  478. clear(): void;
  479. }
  480. declare class AsyncWebAssemblyModulesPlugin {
  481. constructor(options: AsyncWebAssemblyModulesPluginOptions);
  482. options: AsyncWebAssemblyModulesPluginOptions;
  483. /**
  484. * Apply the plugin
  485. */
  486. apply(compiler: Compiler): void;
  487. renderModule(
  488. module: Module,
  489. renderContext: WebAssemblyRenderContext,
  490. hooks: CompilationHooksAsyncWebAssemblyModulesPlugin
  491. ): Source;
  492. static getCompilationHooks(
  493. compilation: Compilation
  494. ): CompilationHooksAsyncWebAssemblyModulesPlugin;
  495. }
  496. declare interface AsyncWebAssemblyModulesPluginOptions {
  497. /**
  498. * mangle imports
  499. */
  500. mangleImports?: boolean;
  501. }
  502. declare abstract class AsyncWebAssemblyParser extends ParserClass {}
  503. declare class AutomaticPrefetchPlugin {
  504. constructor();
  505. /**
  506. * Apply the plugin
  507. */
  508. apply(compiler: Compiler): void;
  509. }
  510. type AuxiliaryComment = string | LibraryCustomUmdCommentObject;
  511. declare interface BackendApi {
  512. dispose: (callback: (err?: null | Error) => void) => void;
  513. module: (module: Module) => ModuleResult;
  514. }
  515. declare class BannerPlugin {
  516. constructor(options: BannerPluginArgument);
  517. options: BannerPluginOptions;
  518. banner: (data: { hash?: string; chunk: Chunk; filename: string }) => string;
  519. /**
  520. * Apply the plugin
  521. */
  522. apply(compiler: Compiler): void;
  523. }
  524. type BannerPluginArgument =
  525. | string
  526. | BannerPluginOptions
  527. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  528. declare interface BannerPluginOptions {
  529. /**
  530. * Specifies the banner.
  531. */
  532. banner:
  533. | string
  534. | ((data: { hash?: string; chunk: Chunk; filename: string }) => string);
  535. /**
  536. * If true, the banner will only be added to the entry chunks.
  537. */
  538. entryOnly?: boolean;
  539. /**
  540. * Exclude all modules matching any of these conditions.
  541. */
  542. exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
  543. /**
  544. * If true, banner will be placed at the end of the output.
  545. */
  546. footer?: boolean;
  547. /**
  548. * Include all modules matching any of these conditions.
  549. */
  550. include?: string | RegExp | Rule[] | ((str: string) => boolean);
  551. /**
  552. * If true, banner will not be wrapped in a comment.
  553. */
  554. raw?: boolean;
  555. /**
  556. * Specifies the stage when add a banner.
  557. */
  558. stage?: number;
  559. /**
  560. * Include all modules that pass test assertion.
  561. */
  562. test?: string | RegExp | Rule[] | ((str: string) => boolean);
  563. }
  564. declare interface BaseResolveRequest {
  565. /**
  566. * path
  567. */
  568. path: string | false;
  569. /**
  570. * content
  571. */
  572. context?: object;
  573. /**
  574. * description file path
  575. */
  576. descriptionFilePath?: string;
  577. /**
  578. * description file root
  579. */
  580. descriptionFileRoot?: string;
  581. /**
  582. * description file data
  583. */
  584. descriptionFileData?: JsonObjectTypes;
  585. /**
  586. * relative path
  587. */
  588. relativePath?: string;
  589. /**
  590. * true when need to ignore symlinks, otherwise false
  591. */
  592. ignoreSymlinks?: boolean;
  593. /**
  594. * true when full specified, otherwise false
  595. */
  596. fullySpecified?: boolean;
  597. /**
  598. * inner request for internal usage
  599. */
  600. __innerRequest?: string;
  601. /**
  602. * inner request for internal usage
  603. */
  604. __innerRequest_request?: string;
  605. /**
  606. * inner relative path for internal usage
  607. */
  608. __innerRequest_relativePath?: string;
  609. }
  610. declare abstract class BasicEvaluatedExpression {
  611. type: number;
  612. range?: [number, number];
  613. falsy: boolean;
  614. truthy: boolean;
  615. nullish?: boolean;
  616. sideEffects: boolean;
  617. bool?: boolean;
  618. number?: number;
  619. bigint?: bigint;
  620. regExp?: RegExp;
  621. string?: string;
  622. quasis?: BasicEvaluatedExpression[];
  623. parts?: BasicEvaluatedExpression[];
  624. array?: any[];
  625. items?: BasicEvaluatedExpression[];
  626. options?: BasicEvaluatedExpression[];
  627. prefix?: null | BasicEvaluatedExpression;
  628. postfix?: null | BasicEvaluatedExpression;
  629. wrappedInnerExpressions?: BasicEvaluatedExpression[];
  630. identifier?: string | VariableInfo;
  631. rootInfo?: string | VariableInfo;
  632. getMembers?: () => string[];
  633. getMembersOptionals?: () => boolean[];
  634. getMemberRanges?: () => [number, number][];
  635. expression?:
  636. | Program
  637. | ImportDeclaration
  638. | ExportNamedDeclaration
  639. | ExportAllDeclaration
  640. | ImportExpressionImport
  641. | UnaryExpression
  642. | ArrayExpression
  643. | ArrowFunctionExpression
  644. | AssignmentExpression
  645. | AwaitExpression
  646. | BinaryExpression
  647. | SimpleCallExpression
  648. | NewExpression
  649. | ChainExpression
  650. | ClassExpression
  651. | ConditionalExpression
  652. | FunctionExpression
  653. | Identifier
  654. | SimpleLiteral
  655. | RegExpLiteral
  656. | BigIntLiteral
  657. | LogicalExpression
  658. | MemberExpression
  659. | MetaProperty
  660. | ObjectExpression
  661. | SequenceExpression
  662. | TaggedTemplateExpression
  663. | TemplateLiteral
  664. | ThisExpression
  665. | UpdateExpression
  666. | YieldExpression
  667. | SpreadElement
  668. | PrivateIdentifier
  669. | Super
  670. | FunctionDeclaration
  671. | VariableDeclaration
  672. | ClassDeclaration
  673. | ExpressionStatement
  674. | BlockStatement
  675. | StaticBlock
  676. | EmptyStatement
  677. | DebuggerStatement
  678. | WithStatement
  679. | ReturnStatement
  680. | LabeledStatement
  681. | BreakStatement
  682. | ContinueStatement
  683. | IfStatement
  684. | SwitchStatement
  685. | ThrowStatement
  686. | TryStatement
  687. | WhileStatement
  688. | DoWhileStatement
  689. | ForStatement
  690. | ForInStatement
  691. | ForOfStatement
  692. | ExportDefaultDeclaration
  693. | MethodDefinition
  694. | PropertyDefinition
  695. | VariableDeclarator
  696. | ObjectPattern
  697. | ArrayPattern
  698. | RestElement
  699. | AssignmentPattern
  700. | SwitchCase
  701. | CatchClause
  702. | Property
  703. | AssignmentProperty
  704. | ClassBody
  705. | ImportSpecifier
  706. | ImportDefaultSpecifier
  707. | ImportNamespaceSpecifier
  708. | ExportSpecifier
  709. | TemplateElement;
  710. isUnknown(): boolean;
  711. isNull(): boolean;
  712. isUndefined(): boolean;
  713. isString(): boolean;
  714. isNumber(): boolean;
  715. isBigInt(): boolean;
  716. isBoolean(): boolean;
  717. isRegExp(): boolean;
  718. isConditional(): boolean;
  719. isArray(): boolean;
  720. isConstArray(): boolean;
  721. isIdentifier(): boolean;
  722. isWrapped(): boolean;
  723. isTemplateString(): boolean;
  724. /**
  725. * Is expression a primitive or an object type value?
  726. */
  727. isPrimitiveType(): undefined | boolean;
  728. /**
  729. * Is expression a runtime or compile-time value?
  730. */
  731. isCompileTimeValue(): boolean;
  732. /**
  733. * Gets the compile-time value of the expression
  734. */
  735. asCompileTimeValue():
  736. | undefined
  737. | null
  738. | string
  739. | number
  740. | bigint
  741. | boolean
  742. | RegExp
  743. | any[];
  744. isTruthy(): boolean;
  745. isFalsy(): boolean;
  746. isNullish(): undefined | boolean;
  747. /**
  748. * Can this expression have side effects?
  749. */
  750. couldHaveSideEffects(): boolean;
  751. /**
  752. * Creates a boolean representation of this evaluated expression.
  753. */
  754. asBool(): undefined | boolean;
  755. /**
  756. * Creates a nullish coalescing representation of this evaluated expression.
  757. */
  758. asNullish(): undefined | boolean;
  759. /**
  760. * Creates a string representation of this evaluated expression.
  761. */
  762. asString(): undefined | string;
  763. setString(string: string): BasicEvaluatedExpression;
  764. setUndefined(): BasicEvaluatedExpression;
  765. setNull(): BasicEvaluatedExpression;
  766. /**
  767. * Set's the value of this expression to a number
  768. */
  769. setNumber(number: number): BasicEvaluatedExpression;
  770. /**
  771. * Set's the value of this expression to a BigInt
  772. */
  773. setBigInt(bigint: bigint): BasicEvaluatedExpression;
  774. /**
  775. * Set's the value of this expression to a boolean
  776. */
  777. setBoolean(bool: boolean): BasicEvaluatedExpression;
  778. /**
  779. * Set's the value of this expression to a regular expression
  780. */
  781. setRegExp(regExp: RegExp): BasicEvaluatedExpression;
  782. /**
  783. * Set's the value of this expression to a particular identifier and its members.
  784. */
  785. setIdentifier(
  786. identifier: string | VariableInfo,
  787. rootInfo: string | VariableInfo,
  788. getMembers: () => string[],
  789. getMembersOptionals?: () => boolean[],
  790. getMemberRanges?: () => [number, number][]
  791. ): BasicEvaluatedExpression;
  792. /**
  793. * Wraps an array of expressions with a prefix and postfix expression.
  794. */
  795. setWrapped(
  796. prefix?: null | BasicEvaluatedExpression,
  797. postfix?: null | BasicEvaluatedExpression,
  798. innerExpressions?: BasicEvaluatedExpression[]
  799. ): BasicEvaluatedExpression;
  800. /**
  801. * Stores the options of a conditional expression.
  802. */
  803. setOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  804. /**
  805. * Adds options to a conditional expression.
  806. */
  807. addOptions(options: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  808. /**
  809. * Set's the value of this expression to an array of expressions.
  810. */
  811. setItems(items: BasicEvaluatedExpression[]): BasicEvaluatedExpression;
  812. /**
  813. * Set's the value of this expression to an array of strings.
  814. */
  815. setArray(array: string[]): BasicEvaluatedExpression;
  816. /**
  817. * Set's the value of this expression to a processed/unprocessed template string. Used
  818. * for evaluating TemplateLiteral expressions in the JavaScript Parser.
  819. */
  820. setTemplateString(
  821. quasis: BasicEvaluatedExpression[],
  822. parts: BasicEvaluatedExpression[],
  823. kind: "raw" | "cooked"
  824. ): BasicEvaluatedExpression;
  825. templateStringKind?: "raw" | "cooked";
  826. setTruthy(): BasicEvaluatedExpression;
  827. setFalsy(): BasicEvaluatedExpression;
  828. /**
  829. * Set's the value of the expression to nullish.
  830. */
  831. setNullish(value: boolean): BasicEvaluatedExpression;
  832. /**
  833. * Set's the range for the expression.
  834. */
  835. setRange(range: [number, number]): BasicEvaluatedExpression;
  836. /**
  837. * Set whether or not the expression has side effects.
  838. */
  839. setSideEffects(sideEffects?: boolean): BasicEvaluatedExpression;
  840. /**
  841. * Set the expression node for the expression.
  842. */
  843. setExpression(
  844. expression?:
  845. | Program
  846. | ImportDeclaration
  847. | ExportNamedDeclaration
  848. | ExportAllDeclaration
  849. | ImportExpressionImport
  850. | UnaryExpression
  851. | ArrayExpression
  852. | ArrowFunctionExpression
  853. | AssignmentExpression
  854. | AwaitExpression
  855. | BinaryExpression
  856. | SimpleCallExpression
  857. | NewExpression
  858. | ChainExpression
  859. | ClassExpression
  860. | ConditionalExpression
  861. | FunctionExpression
  862. | Identifier
  863. | SimpleLiteral
  864. | RegExpLiteral
  865. | BigIntLiteral
  866. | LogicalExpression
  867. | MemberExpression
  868. | MetaProperty
  869. | ObjectExpression
  870. | SequenceExpression
  871. | TaggedTemplateExpression
  872. | TemplateLiteral
  873. | ThisExpression
  874. | UpdateExpression
  875. | YieldExpression
  876. | SpreadElement
  877. | PrivateIdentifier
  878. | Super
  879. | FunctionDeclaration
  880. | VariableDeclaration
  881. | ClassDeclaration
  882. | ExpressionStatement
  883. | BlockStatement
  884. | StaticBlock
  885. | EmptyStatement
  886. | DebuggerStatement
  887. | WithStatement
  888. | ReturnStatement
  889. | LabeledStatement
  890. | BreakStatement
  891. | ContinueStatement
  892. | IfStatement
  893. | SwitchStatement
  894. | ThrowStatement
  895. | TryStatement
  896. | WhileStatement
  897. | DoWhileStatement
  898. | ForStatement
  899. | ForInStatement
  900. | ForOfStatement
  901. | ExportDefaultDeclaration
  902. | MethodDefinition
  903. | PropertyDefinition
  904. | VariableDeclarator
  905. | ObjectPattern
  906. | ArrayPattern
  907. | RestElement
  908. | AssignmentPattern
  909. | SwitchCase
  910. | CatchClause
  911. | Property
  912. | AssignmentProperty
  913. | ClassBody
  914. | ImportSpecifier
  915. | ImportDefaultSpecifier
  916. | ImportNamespaceSpecifier
  917. | ExportSpecifier
  918. | TemplateElement
  919. ): BasicEvaluatedExpression;
  920. }
  921. type BeforeContextResolveData = ContextResolveData & ContextOptions;
  922. declare interface Bootstrap {
  923. header: string[];
  924. beforeStartup: string[];
  925. startup: string[];
  926. afterStartup: string[];
  927. allowInlineStartup: boolean;
  928. }
  929. type BufferEncoding =
  930. | "ascii"
  931. | "utf8"
  932. | "utf-8"
  933. | "utf16le"
  934. | "utf-16le"
  935. | "ucs2"
  936. | "ucs-2"
  937. | "base64"
  938. | "base64url"
  939. | "latin1"
  940. | "binary"
  941. | "hex";
  942. type BufferEncodingOption = "buffer" | { encoding: "buffer" };
  943. declare interface BufferEntry {
  944. map?: null | RawSourceMap;
  945. bufferedMap?: null | BufferedMap;
  946. }
  947. declare interface BufferedMap {
  948. /**
  949. * version
  950. */
  951. version: number;
  952. /**
  953. * sources
  954. */
  955. sources: string[];
  956. /**
  957. * name
  958. */
  959. names: string[];
  960. /**
  961. * source root
  962. */
  963. sourceRoot?: string;
  964. /**
  965. * sources content
  966. */
  967. sourcesContent?: ("" | Buffer)[];
  968. /**
  969. * mappings
  970. */
  971. mappings?: Buffer;
  972. /**
  973. * file
  974. */
  975. file: string;
  976. }
  977. type BuildInfo = KnownBuildInfo & Record<string, any>;
  978. type BuildMeta = KnownBuildMeta & Record<string, any>;
  979. declare abstract class ByTypeGenerator extends Generator {
  980. map: { [index: string]: undefined | Generator };
  981. generateError?: (
  982. error: Error,
  983. module: NormalModule,
  984. generateContext: GenerateContext
  985. ) => null | Source;
  986. }
  987. declare const CIRCULAR_CONNECTION: unique symbol;
  988. declare class CacheClass {
  989. constructor();
  990. hooks: {
  991. get: AsyncSeriesBailHook<[string, null | Etag, GotHandler<any>[]], any>;
  992. store: AsyncParallelHook<[string, null | Etag, any]>;
  993. storeBuildDependencies: AsyncParallelHook<[Iterable<string>]>;
  994. beginIdle: SyncHook<[]>;
  995. endIdle: AsyncParallelHook<[]>;
  996. shutdown: AsyncParallelHook<[]>;
  997. };
  998. get<T>(
  999. identifier: string,
  1000. etag: null | Etag,
  1001. callback: CallbackCacheCache<T>
  1002. ): void;
  1003. store<T>(
  1004. identifier: string,
  1005. etag: null | Etag,
  1006. data: T,
  1007. callback: CallbackCacheCache<void>
  1008. ): void;
  1009. /**
  1010. * After this method has succeeded the cache can only be restored when build dependencies are
  1011. */
  1012. storeBuildDependencies(
  1013. dependencies: Iterable<string>,
  1014. callback: CallbackCacheCache<void>
  1015. ): void;
  1016. beginIdle(): void;
  1017. endIdle(callback: CallbackCacheCache<void>): void;
  1018. shutdown(callback: CallbackCacheCache<void>): void;
  1019. static STAGE_MEMORY: number;
  1020. static STAGE_DEFAULT: number;
  1021. static STAGE_DISK: number;
  1022. static STAGE_NETWORK: number;
  1023. }
  1024. declare abstract class CacheFacade {
  1025. getChildCache(name: string): CacheFacade;
  1026. getItemCache(identifier: string, etag: null | Etag): ItemCacheFacade;
  1027. getLazyHashedEtag(obj: HashableObject): Etag;
  1028. mergeEtags(a: Etag, b: Etag): Etag;
  1029. get<T>(
  1030. identifier: string,
  1031. etag: null | Etag,
  1032. callback: CallbackCacheCacheFacade<T>
  1033. ): void;
  1034. getPromise<T>(identifier: string, etag: null | Etag): Promise<T>;
  1035. store<T>(
  1036. identifier: string,
  1037. etag: null | Etag,
  1038. data: T,
  1039. callback: CallbackCacheCacheFacade<void>
  1040. ): void;
  1041. storePromise<T>(
  1042. identifier: string,
  1043. etag: null | Etag,
  1044. data: T
  1045. ): Promise<void>;
  1046. provide<T>(
  1047. identifier: string,
  1048. etag: null | Etag,
  1049. computer: (callback: CallbackNormalErrorCache<T>) => void,
  1050. callback: CallbackNormalErrorCache<T>
  1051. ): void;
  1052. providePromise<T>(
  1053. identifier: string,
  1054. etag: null | Etag,
  1055. computer: () => T | Promise<T>
  1056. ): Promise<T>;
  1057. }
  1058. declare interface CacheGroupSource {
  1059. key: string;
  1060. priority?: number;
  1061. getName?: (
  1062. module: Module,
  1063. chunks: Chunk[],
  1064. key: string
  1065. ) => undefined | string;
  1066. chunksFilter?: (chunk: Chunk) => undefined | boolean;
  1067. enforce?: boolean;
  1068. minSize: SplitChunksSizes;
  1069. minSizeReduction: SplitChunksSizes;
  1070. minRemainingSize: SplitChunksSizes;
  1071. enforceSizeThreshold: SplitChunksSizes;
  1072. maxAsyncSize: SplitChunksSizes;
  1073. maxInitialSize: SplitChunksSizes;
  1074. minChunks?: number;
  1075. maxAsyncRequests?: number;
  1076. maxInitialRequests?: number;
  1077. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1078. idHint?: string;
  1079. automaticNameDelimiter?: string;
  1080. reuseExistingChunk?: boolean;
  1081. usedExports?: boolean;
  1082. }
  1083. declare interface CacheGroupsContext {
  1084. moduleGraph: ModuleGraph;
  1085. chunkGraph: ChunkGraph;
  1086. }
  1087. type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
  1088. declare interface CacheTypes {
  1089. [index: string]: undefined | ResolveRequest | ResolveRequest[];
  1090. }
  1091. declare interface CachedData {
  1092. /**
  1093. * source
  1094. */
  1095. source?: boolean;
  1096. /**
  1097. * buffer
  1098. */
  1099. buffer: Buffer;
  1100. /**
  1101. * size
  1102. */
  1103. size?: number;
  1104. /**
  1105. * maps
  1106. */
  1107. maps: Map<string, BufferEntry>;
  1108. /**
  1109. * hash
  1110. */
  1111. hash?: (string | Buffer)[];
  1112. }
  1113. declare class CachedSource extends Source {
  1114. constructor(source: Source | (() => Source), cachedData?: CachedData);
  1115. getCachedData(): CachedData;
  1116. originalLazy(): Source | (() => Source);
  1117. original(): Source;
  1118. streamChunks(
  1119. options: StreamChunksOptions,
  1120. onChunk: (
  1121. chunk: undefined | string,
  1122. generatedLine: number,
  1123. generatedColumn: number,
  1124. sourceIndex: number,
  1125. originalLine: number,
  1126. originalColumn: number,
  1127. nameIndex: number
  1128. ) => void,
  1129. onSource: (
  1130. sourceIndex: number,
  1131. source: null | string,
  1132. sourceContent?: string
  1133. ) => void,
  1134. onName: (nameIndex: number, name: string) => void
  1135. ): GeneratedSourceInfo;
  1136. }
  1137. declare interface CalculatedStringResult {
  1138. range?: [number, number];
  1139. value: string;
  1140. code: boolean;
  1141. conditional: false | CalculatedStringResult[];
  1142. }
  1143. type CallExpression = SimpleCallExpression | NewExpression;
  1144. declare interface CallExpressionInfo {
  1145. type: "call";
  1146. call: CallExpression;
  1147. calleeName: string;
  1148. rootInfo: string | VariableInfo;
  1149. getCalleeMembers: () => string[];
  1150. name: string;
  1151. getMembers: () => string[];
  1152. getMembersOptionals: () => boolean[];
  1153. getMemberRanges: () => [number, number][];
  1154. }
  1155. declare interface CallbackAsyncQueue<T> {
  1156. (err?: null | WebpackError, result?: null | T): void;
  1157. }
  1158. declare interface CallbackCacheCache<T> {
  1159. (err: null | WebpackError, result?: T): void;
  1160. }
  1161. declare interface CallbackCacheCacheFacade<T> {
  1162. (err?: null | Error, result?: null | T): void;
  1163. }
  1164. declare interface CallbackNormalErrorCache<T> {
  1165. (err?: null | Error, result?: T): void;
  1166. }
  1167. declare interface CallbackWebpackFunction_1<T> {
  1168. (err: null | Error, result?: T): void;
  1169. }
  1170. declare interface CallbackWebpackFunction_2<T, R = void> {
  1171. (err: null | Error, result?: T): R;
  1172. }
  1173. type Cell<T> = undefined | T;
  1174. type ChildrenStatsOptions = undefined | string | boolean | StatsOptions;
  1175. declare class Chunk {
  1176. constructor(name?: null | string, backCompat?: boolean);
  1177. id: null | string | number;
  1178. ids: null | ChunkId[];
  1179. debugId: number;
  1180. name?: null | string;
  1181. idNameHints: SortableSet<string>;
  1182. preventIntegration: boolean;
  1183. filenameTemplate?:
  1184. | string
  1185. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1186. cssFilenameTemplate?:
  1187. | string
  1188. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  1189. runtime: RuntimeSpec;
  1190. files: Set<string>;
  1191. auxiliaryFiles: Set<string>;
  1192. rendered: boolean;
  1193. hash?: string;
  1194. contentHash: Record<string, string>;
  1195. renderedHash?: string;
  1196. chunkReason?: string;
  1197. extraAsync: boolean;
  1198. get entryModule(): Module;
  1199. hasEntryModule(): boolean;
  1200. addModule(module: Module): boolean;
  1201. removeModule(module: Module): void;
  1202. getNumberOfModules(): number;
  1203. get modulesIterable(): Iterable<Module>;
  1204. compareTo(otherChunk: Chunk): 0 | 1 | -1;
  1205. containsModule(module: Module): boolean;
  1206. getModules(): Module[];
  1207. remove(): void;
  1208. moveModule(module: Module, otherChunk: Chunk): void;
  1209. integrate(otherChunk: Chunk): boolean;
  1210. canBeIntegrated(otherChunk: Chunk): boolean;
  1211. isEmpty(): boolean;
  1212. modulesSize(): number;
  1213. size(options?: ChunkSizeOptions): number;
  1214. integratedSize(otherChunk: Chunk, options: ChunkSizeOptions): number;
  1215. getChunkModuleMaps(filterFn: (m: Module) => boolean): ChunkModuleMaps;
  1216. hasModuleInGraph(
  1217. filterFn: (m: Module) => boolean,
  1218. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1219. ): boolean;
  1220. getChunkMaps(realHash: boolean): ChunkMaps;
  1221. hasRuntime(): boolean;
  1222. canBeInitial(): boolean;
  1223. isOnlyInitial(): boolean;
  1224. getEntryOptions(): undefined | EntryOptions;
  1225. addGroup(chunkGroup: ChunkGroup): void;
  1226. removeGroup(chunkGroup: ChunkGroup): void;
  1227. isInGroup(chunkGroup: ChunkGroup): boolean;
  1228. getNumberOfGroups(): number;
  1229. get groupsIterable(): SortableSet<ChunkGroup>;
  1230. disconnectFromGroups(): void;
  1231. split(newChunk: Chunk): void;
  1232. updateHash(hash: Hash, chunkGraph: ChunkGraph): void;
  1233. getAllAsyncChunks(): Set<Chunk>;
  1234. getAllInitialChunks(): Set<Chunk>;
  1235. getAllReferencedChunks(): Set<Chunk>;
  1236. getAllReferencedAsyncEntrypoints(): Set<Entrypoint>;
  1237. hasAsyncChunks(): boolean;
  1238. getChildIdsByOrders(
  1239. chunkGraph: ChunkGraph,
  1240. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1241. ): Record<string, ChunkId[]>;
  1242. getChildrenOfTypeInOrder(
  1243. chunkGraph: ChunkGraph,
  1244. type: string
  1245. ): undefined | { onChunks: Chunk[]; chunks: Set<Chunk> }[];
  1246. getChildIdsByOrdersMap(
  1247. chunkGraph: ChunkGraph,
  1248. includeDirectChildren?: boolean,
  1249. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1250. ): ChunkChildIdsByOrdersMapByData;
  1251. hasChildByOrder(
  1252. chunkGraph: ChunkGraph,
  1253. type: string,
  1254. includeDirectChildren?: boolean,
  1255. filterFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1256. ): boolean;
  1257. }
  1258. declare interface ChunkChildIdsByOrdersMap {
  1259. [index: string]: ChunkId[];
  1260. }
  1261. declare interface ChunkChildIdsByOrdersMapByData {
  1262. [index: string]: ChunkChildIdsByOrdersMap;
  1263. }
  1264. declare class ChunkGraph {
  1265. constructor(moduleGraph: ModuleGraph, hashFunction?: string | typeof Hash);
  1266. moduleGraph: ModuleGraph;
  1267. connectChunkAndModule(chunk: Chunk, module: Module): void;
  1268. disconnectChunkAndModule(chunk: Chunk, module: Module): void;
  1269. disconnectChunk(chunk: Chunk): void;
  1270. attachModules(chunk: Chunk, modules: Iterable<Module>): void;
  1271. attachRuntimeModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1272. attachFullHashModules(chunk: Chunk, modules: Iterable<RuntimeModule>): void;
  1273. attachDependentHashModules(
  1274. chunk: Chunk,
  1275. modules: Iterable<RuntimeModule>
  1276. ): void;
  1277. replaceModule(oldModule: Module, newModule: Module): void;
  1278. isModuleInChunk(module: Module, chunk: Chunk): boolean;
  1279. isModuleInChunkGroup(module: Module, chunkGroup: ChunkGroup): boolean;
  1280. isEntryModule(module: Module): boolean;
  1281. getModuleChunksIterable(module: Module): Iterable<Chunk>;
  1282. getOrderedModuleChunksIterable(
  1283. module: Module,
  1284. sortFn: (a: Chunk, b: Chunk) => 0 | 1 | -1
  1285. ): Iterable<Chunk>;
  1286. getModuleChunks(module: Module): Chunk[];
  1287. getNumberOfModuleChunks(module: Module): number;
  1288. getModuleRuntimes(module: Module): RuntimeSpecSet;
  1289. getNumberOfChunkModules(chunk: Chunk): number;
  1290. getNumberOfChunkFullHashModules(chunk: Chunk): number;
  1291. getChunkModulesIterable(chunk: Chunk): Iterable<Module>;
  1292. getChunkModulesIterableBySourceType(
  1293. chunk: Chunk,
  1294. sourceType: string
  1295. ): undefined | Iterable<Module>;
  1296. setChunkModuleSourceTypes(
  1297. chunk: Chunk,
  1298. module: Module,
  1299. sourceTypes: ReadonlySet<string>
  1300. ): void;
  1301. getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet<string>;
  1302. getModuleSourceTypes(module: Module): ReadonlySet<string>;
  1303. getOrderedChunkModulesIterable(
  1304. chunk: Chunk,
  1305. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1306. ): Iterable<Module>;
  1307. getOrderedChunkModulesIterableBySourceType(
  1308. chunk: Chunk,
  1309. sourceType: string,
  1310. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1311. ): undefined | Iterable<Module>;
  1312. getChunkModules(chunk: Chunk): Module[];
  1313. getOrderedChunkModules(
  1314. chunk: Chunk,
  1315. comparator: (a: Module, b: Module) => 0 | 1 | -1
  1316. ): Module[];
  1317. getChunkModuleIdMap(
  1318. chunk: Chunk,
  1319. filterFn: (m: Module) => boolean,
  1320. includeAllChunks?: boolean
  1321. ): ChunkModuleIdMapEs5Alias_2;
  1322. getChunkModuleRenderedHashMap(
  1323. chunk: Chunk,
  1324. filterFn: (m: Module) => boolean,
  1325. hashLength?: number,
  1326. includeAllChunks?: boolean
  1327. ): ChunkModuleHashMap;
  1328. getChunkConditionMap(
  1329. chunk: Chunk,
  1330. filterFn: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1331. ): Record<ChunkId, boolean>;
  1332. hasModuleInGraph(
  1333. chunk: Chunk,
  1334. filterFn: (m: Module) => boolean,
  1335. filterChunkFn?: (c: Chunk, chunkGraph: ChunkGraph) => boolean
  1336. ): boolean;
  1337. compareChunks(chunkA: Chunk, chunkB: Chunk): 0 | 1 | -1;
  1338. getChunkModulesSize(chunk: Chunk): number;
  1339. getChunkModulesSizes(chunk: Chunk): Record<string, number>;
  1340. getChunkRootModules(chunk: Chunk): Module[];
  1341. getChunkSize(chunk: Chunk, options?: ChunkSizeOptions): number;
  1342. getIntegratedChunksSize(
  1343. chunkA: Chunk,
  1344. chunkB: Chunk,
  1345. options?: ChunkSizeOptions
  1346. ): number;
  1347. canChunksBeIntegrated(chunkA: Chunk, chunkB: Chunk): boolean;
  1348. integrateChunks(chunkA: Chunk, chunkB: Chunk): void;
  1349. upgradeDependentToFullHashModules(chunk: Chunk): void;
  1350. isEntryModuleInChunk(module: Module, chunk: Chunk): boolean;
  1351. connectChunkAndEntryModule(
  1352. chunk: Chunk,
  1353. module: Module,
  1354. entrypoint: Entrypoint
  1355. ): void;
  1356. connectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1357. addFullHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1358. addDependentHashModuleToChunk(chunk: Chunk, module: RuntimeModule): void;
  1359. disconnectChunkAndEntryModule(chunk: Chunk, module: Module): void;
  1360. disconnectChunkAndRuntimeModule(chunk: Chunk, module: RuntimeModule): void;
  1361. disconnectEntryModule(module: Module): void;
  1362. disconnectEntries(chunk: Chunk): void;
  1363. getNumberOfEntryModules(chunk: Chunk): number;
  1364. getNumberOfRuntimeModules(chunk: Chunk): number;
  1365. getChunkEntryModulesIterable(chunk: Chunk): Iterable<Module>;
  1366. getChunkEntryDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1367. getRuntimeChunkDependentChunksIterable(chunk: Chunk): Iterable<Chunk>;
  1368. hasChunkEntryDependentChunks(chunk: Chunk): boolean;
  1369. getChunkRuntimeModulesIterable(chunk: Chunk): Iterable<RuntimeModule>;
  1370. getChunkRuntimeModulesInOrder(chunk: Chunk): RuntimeModule[];
  1371. getChunkFullHashModulesIterable(
  1372. chunk: Chunk
  1373. ): undefined | Iterable<RuntimeModule>;
  1374. getChunkFullHashModulesSet(
  1375. chunk: Chunk
  1376. ): undefined | ReadonlySet<RuntimeModule>;
  1377. getChunkDependentHashModulesIterable(
  1378. chunk: Chunk
  1379. ): undefined | Iterable<RuntimeModule>;
  1380. getChunkEntryModulesWithChunkGroupIterable(
  1381. chunk: Chunk
  1382. ): Iterable<[Module, undefined | Entrypoint]>;
  1383. getBlockChunkGroup(depBlock: AsyncDependenciesBlock): undefined | ChunkGroup;
  1384. connectBlockAndChunkGroup(
  1385. depBlock: AsyncDependenciesBlock,
  1386. chunkGroup: ChunkGroup
  1387. ): void;
  1388. disconnectChunkGroup(chunkGroup: ChunkGroup): void;
  1389. getModuleId(module: Module): null | string | number;
  1390. setModuleId(module: Module, id: ModuleId): void;
  1391. getRuntimeId(runtime: string): RuntimeId;
  1392. setRuntimeId(runtime: string, id: RuntimeId): void;
  1393. hasModuleHashes(module: Module, runtime: RuntimeSpec): boolean;
  1394. getModuleHash(module: Module, runtime: RuntimeSpec): string;
  1395. getRenderedModuleHash(module: Module, runtime: RuntimeSpec): string;
  1396. setModuleHashes(
  1397. module: Module,
  1398. runtime: RuntimeSpec,
  1399. hash: string,
  1400. renderedHash: string
  1401. ): void;
  1402. addModuleRuntimeRequirements(
  1403. module: Module,
  1404. runtime: RuntimeSpec,
  1405. items: Set<string>,
  1406. transferOwnership?: boolean
  1407. ): void;
  1408. addChunkRuntimeRequirements(chunk: Chunk, items: Set<string>): void;
  1409. addTreeRuntimeRequirements(chunk: Chunk, items: Iterable<string>): void;
  1410. getModuleRuntimeRequirements(
  1411. module: Module,
  1412. runtime: RuntimeSpec
  1413. ): ReadonlySet<string>;
  1414. getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1415. getModuleGraphHash(
  1416. module: Module,
  1417. runtime: RuntimeSpec,
  1418. withConnections?: boolean
  1419. ): string;
  1420. getModuleGraphHashBigInt(
  1421. module: Module,
  1422. runtime: RuntimeSpec,
  1423. withConnections?: boolean
  1424. ): bigint;
  1425. getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
  1426. static getChunkGraphForModule(
  1427. module: Module,
  1428. deprecateMessage: string,
  1429. deprecationCode: string
  1430. ): ChunkGraph;
  1431. static setChunkGraphForModule(module: Module, chunkGraph: ChunkGraph): void;
  1432. static clearChunkGraphForModule(module: Module): void;
  1433. static getChunkGraphForChunk(
  1434. chunk: Chunk,
  1435. deprecateMessage: string,
  1436. deprecationCode: string
  1437. ): ChunkGraph;
  1438. static setChunkGraphForChunk(chunk: Chunk, chunkGraph: ChunkGraph): void;
  1439. static clearChunkGraphForChunk(chunk: Chunk): void;
  1440. }
  1441. declare abstract class ChunkGroup {
  1442. groupDebugId: number;
  1443. options: ChunkGroupOptions;
  1444. chunks: Chunk[];
  1445. origins: OriginRecord[];
  1446. index?: number;
  1447. /**
  1448. * when a new chunk is added to a chunkGroup, addingOptions will occur.
  1449. */
  1450. addOptions(options: ChunkGroupOptions): void;
  1451. /**
  1452. * returns the name of current ChunkGroup
  1453. * sets a new name for current ChunkGroup
  1454. */
  1455. name?: null | string;
  1456. /**
  1457. * get a uniqueId for ChunkGroup, made up of its member Chunk debugId's
  1458. */
  1459. get debugId(): string;
  1460. /**
  1461. * get a unique id for ChunkGroup, made up of its member Chunk id's
  1462. */
  1463. get id(): string;
  1464. /**
  1465. * Performs an unshift of a specific chunk
  1466. */
  1467. unshiftChunk(chunk: Chunk): boolean;
  1468. /**
  1469. * inserts a chunk before another existing chunk in group
  1470. */
  1471. insertChunk(chunk: Chunk, before: Chunk): boolean;
  1472. /**
  1473. * add a chunk into ChunkGroup. Is pushed on or prepended
  1474. */
  1475. pushChunk(chunk: Chunk): boolean;
  1476. replaceChunk(oldChunk: Chunk, newChunk: Chunk): undefined | boolean;
  1477. removeChunk(chunk: Chunk): boolean;
  1478. isInitial(): boolean;
  1479. addChild(group: ChunkGroup): boolean;
  1480. getChildren(): ChunkGroup[];
  1481. getNumberOfChildren(): number;
  1482. get childrenIterable(): SortableSet<ChunkGroup>;
  1483. removeChild(group: ChunkGroup): boolean;
  1484. addParent(parentChunk: ChunkGroup): boolean;
  1485. getParents(): ChunkGroup[];
  1486. getNumberOfParents(): number;
  1487. hasParent(parent: ChunkGroup): boolean;
  1488. get parentsIterable(): SortableSet<ChunkGroup>;
  1489. removeParent(chunkGroup: ChunkGroup): boolean;
  1490. addAsyncEntrypoint(entrypoint: Entrypoint): boolean;
  1491. get asyncEntrypointsIterable(): SortableSet<ChunkGroup>;
  1492. getBlocks(): AsyncDependenciesBlock[];
  1493. getNumberOfBlocks(): number;
  1494. hasBlock(block: AsyncDependenciesBlock): boolean;
  1495. get blocksIterable(): Iterable<AsyncDependenciesBlock>;
  1496. addBlock(block: AsyncDependenciesBlock): boolean;
  1497. addOrigin(
  1498. module: null | Module,
  1499. loc: DependencyLocation,
  1500. request: string
  1501. ): void;
  1502. getFiles(): string[];
  1503. remove(): void;
  1504. sortItems(): void;
  1505. /**
  1506. * Sorting predicate which allows current ChunkGroup to be compared against another.
  1507. * Sorting values are based off of number of chunks in ChunkGroup.
  1508. */
  1509. compareTo(chunkGraph: ChunkGraph, otherGroup: ChunkGroup): 0 | 1 | -1;
  1510. getChildrenByOrders(
  1511. moduleGraph: ModuleGraph,
  1512. chunkGraph: ChunkGraph
  1513. ): Record<string, ChunkGroup[]>;
  1514. /**
  1515. * Sets the top-down index of a module in this ChunkGroup
  1516. */
  1517. setModulePreOrderIndex(module: Module, index: number): void;
  1518. /**
  1519. * Gets the top-down index of a module in this ChunkGroup
  1520. */
  1521. getModulePreOrderIndex(module: Module): undefined | number;
  1522. /**
  1523. * Sets the bottom-up index of a module in this ChunkGroup
  1524. */
  1525. setModulePostOrderIndex(module: Module, index: number): void;
  1526. /**
  1527. * Gets the bottom-up index of a module in this ChunkGroup
  1528. */
  1529. getModulePostOrderIndex(module: Module): undefined | number;
  1530. checkConstraints(): void;
  1531. getModuleIndex: (module: Module) => undefined | number;
  1532. getModuleIndex2: (module: Module) => undefined | number;
  1533. }
  1534. type ChunkGroupOptions = RawChunkGroupOptions & { name?: null | string };
  1535. declare interface ChunkHashContext {
  1536. /**
  1537. * results of code generation
  1538. */
  1539. codeGenerationResults: CodeGenerationResults;
  1540. /**
  1541. * the runtime template
  1542. */
  1543. runtimeTemplate: RuntimeTemplate;
  1544. /**
  1545. * the module graph
  1546. */
  1547. moduleGraph: ModuleGraph;
  1548. /**
  1549. * the chunk graph
  1550. */
  1551. chunkGraph: ChunkGraph;
  1552. }
  1553. declare interface ChunkHashes {
  1554. [index: number]: string;
  1555. [index: string]: string;
  1556. }
  1557. type ChunkId = string | number;
  1558. declare interface ChunkMaps {
  1559. hash: Record<ChunkId, string>;
  1560. contentHash: Record<ChunkId, Record<string, string>>;
  1561. name: Record<ChunkId, string>;
  1562. }
  1563. declare interface ChunkModuleHashMap {
  1564. [index: number]: IdToHashMap;
  1565. [index: string]: IdToHashMap;
  1566. }
  1567. declare interface ChunkModuleHashes {
  1568. [index: string]: string;
  1569. }
  1570. declare interface ChunkModuleIdMapEs5Alias_1 {
  1571. [index: number]: ChunkId[];
  1572. [index: string]: ChunkId[];
  1573. }
  1574. declare interface ChunkModuleIdMapEs5Alias_2 {
  1575. [index: number]: ModuleId[];
  1576. [index: string]: ModuleId[];
  1577. }
  1578. declare class ChunkModuleIdRangePlugin {
  1579. constructor(options: ChunkModuleIdRangePluginOptions);
  1580. options: ChunkModuleIdRangePluginOptions;
  1581. /**
  1582. * Apply the plugin
  1583. */
  1584. apply(compiler: Compiler): void;
  1585. }
  1586. declare interface ChunkModuleIdRangePluginOptions {
  1587. /**
  1588. * the chunk name
  1589. */
  1590. name: string;
  1591. /**
  1592. * order
  1593. */
  1594. order?: "index" | "index2" | "preOrderIndex" | "postOrderIndex";
  1595. /**
  1596. * start id
  1597. */
  1598. start?: number;
  1599. /**
  1600. * end id
  1601. */
  1602. end?: number;
  1603. }
  1604. declare interface ChunkModuleIds {
  1605. [index: number]: ModuleId[];
  1606. [index: string]: ModuleId[];
  1607. }
  1608. declare interface ChunkModuleMaps {
  1609. id: ChunkModuleIdMapEs5Alias_1;
  1610. hash: chunkModuleHashMap;
  1611. }
  1612. type ChunkName = null | string;
  1613. declare interface ChunkPathData {
  1614. id: string | number;
  1615. name?: string;
  1616. hash: string;
  1617. hashWithLength?: (length: number) => string;
  1618. contentHash?: Record<string, string>;
  1619. contentHashWithLength?: Record<string, (length: number) => string>;
  1620. }
  1621. declare class ChunkPrefetchPreloadPlugin {
  1622. constructor();
  1623. apply(compiler: Compiler): void;
  1624. }
  1625. declare interface ChunkRenderContextCssModulesPlugin {
  1626. /**
  1627. * the chunk
  1628. */
  1629. chunk?: Chunk;
  1630. /**
  1631. * the chunk graph
  1632. */
  1633. chunkGraph?: ChunkGraph;
  1634. /**
  1635. * results of code generation
  1636. */
  1637. codeGenerationResults?: CodeGenerationResults;
  1638. /**
  1639. * the runtime template
  1640. */
  1641. runtimeTemplate: RuntimeTemplate;
  1642. /**
  1643. * undo path to css file
  1644. */
  1645. undoPath: string;
  1646. /**
  1647. * moduleFactoryCache
  1648. */
  1649. moduleFactoryCache: WeakMap<Source, ModuleFactoryCacheEntry>;
  1650. /**
  1651. * content
  1652. */
  1653. moduleSourceContent: Source;
  1654. }
  1655. declare interface ChunkRenderContextJavascriptModulesPlugin {
  1656. /**
  1657. * the chunk
  1658. */
  1659. chunk: Chunk;
  1660. /**
  1661. * the dependency templates
  1662. */
  1663. dependencyTemplates: DependencyTemplates;
  1664. /**
  1665. * the runtime template
  1666. */
  1667. runtimeTemplate: RuntimeTemplate;
  1668. /**
  1669. * the module graph
  1670. */
  1671. moduleGraph: ModuleGraph;
  1672. /**
  1673. * the chunk graph
  1674. */
  1675. chunkGraph: ChunkGraph;
  1676. /**
  1677. * results of code generation
  1678. */
  1679. codeGenerationResults: CodeGenerationResults;
  1680. /**
  1681. * init fragments for the chunk
  1682. */
  1683. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  1684. /**
  1685. * rendering in strict context
  1686. */
  1687. strictMode?: boolean;
  1688. }
  1689. declare interface ChunkRuntime {
  1690. [index: number]: string;
  1691. [index: string]: string;
  1692. }
  1693. declare interface ChunkSizeOptions {
  1694. /**
  1695. * constant overhead for a chunk
  1696. */
  1697. chunkOverhead?: number;
  1698. /**
  1699. * multiplicator for initial chunks
  1700. */
  1701. entryChunkMultiplicator?: number;
  1702. }
  1703. declare abstract class ChunkTemplate {
  1704. hooks: Readonly<{
  1705. renderManifest: {
  1706. tap: <AdditionalOptions>(
  1707. options:
  1708. | string
  1709. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1710. fn: (
  1711. renderManifestEntries: RenderManifestEntry[],
  1712. renderManifestOptions: RenderManifestOptions
  1713. ) => RenderManifestEntry[]
  1714. ) => void;
  1715. };
  1716. modules: {
  1717. tap: <AdditionalOptions>(
  1718. options:
  1719. | string
  1720. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1721. fn: (
  1722. source: Source,
  1723. moduleTemplate: ModuleTemplate,
  1724. renderContext: RenderContextJavascriptModulesPlugin
  1725. ) => Source
  1726. ) => void;
  1727. };
  1728. render: {
  1729. tap: <AdditionalOptions>(
  1730. options:
  1731. | string
  1732. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1733. fn: (
  1734. source: Source,
  1735. moduleTemplate: ModuleTemplate,
  1736. renderContext: RenderContextJavascriptModulesPlugin
  1737. ) => Source
  1738. ) => void;
  1739. };
  1740. renderWithEntry: {
  1741. tap: <AdditionalOptions>(
  1742. options:
  1743. | string
  1744. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1745. fn: (source: Source, chunk: Chunk) => Source
  1746. ) => void;
  1747. };
  1748. hash: {
  1749. tap: <AdditionalOptions>(
  1750. options:
  1751. | string
  1752. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1753. fn: (hash: Hash) => void
  1754. ) => void;
  1755. };
  1756. hashForChunk: {
  1757. tap: <AdditionalOptions>(
  1758. options:
  1759. | string
  1760. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  1761. fn: (
  1762. hash: Hash,
  1763. chunk: Chunk,
  1764. chunkHashContext: ChunkHashContext
  1765. ) => void
  1766. ) => void;
  1767. };
  1768. }>;
  1769. get outputOptions(): OutputNormalizedWithDefaults;
  1770. }
  1771. /**
  1772. * Advanced options for cleaning assets.
  1773. */
  1774. declare interface CleanOptions {
  1775. /**
  1776. * Log the assets that should be removed instead of deleting them.
  1777. */
  1778. dry?: boolean;
  1779. /**
  1780. * Keep these assets.
  1781. */
  1782. keep?: string | RegExp | ((path: string) => undefined | boolean);
  1783. }
  1784. declare class CleanPlugin {
  1785. constructor(options?: CleanOptions);
  1786. options: {
  1787. /**
  1788. * Log the assets that should be removed instead of deleting them.
  1789. */
  1790. dry: boolean;
  1791. /**
  1792. * Keep these assets.
  1793. */
  1794. keep?: string | RegExp | ((path: string) => undefined | boolean);
  1795. };
  1796. /**
  1797. * Apply the plugin
  1798. */
  1799. apply(compiler: Compiler): void;
  1800. static getCompilationHooks(
  1801. compilation: Compilation
  1802. ): CleanPluginCompilationHooks;
  1803. }
  1804. declare interface CleanPluginCompilationHooks {
  1805. /**
  1806. * when returning true the file/directory will be kept during cleaning, returning false will clean it and ignore the following plugins and config
  1807. */
  1808. keep: SyncBailHook<[string], boolean | void>;
  1809. }
  1810. declare interface CodeGenerationContext {
  1811. /**
  1812. * the dependency templates
  1813. */
  1814. dependencyTemplates: DependencyTemplates;
  1815. /**
  1816. * the runtime template
  1817. */
  1818. runtimeTemplate: RuntimeTemplate;
  1819. /**
  1820. * the module graph
  1821. */
  1822. moduleGraph: ModuleGraph;
  1823. /**
  1824. * the chunk graph
  1825. */
  1826. chunkGraph: ChunkGraph;
  1827. /**
  1828. * the runtimes code should be generated for
  1829. */
  1830. runtime: RuntimeSpec;
  1831. /**
  1832. * all runtimes code should be generated for
  1833. */
  1834. runtimes: RuntimeSpec[];
  1835. /**
  1836. * when in concatenated module, information about other concatenated modules
  1837. */
  1838. concatenationScope?: ConcatenationScope;
  1839. /**
  1840. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  1841. */
  1842. codeGenerationResults?: CodeGenerationResults;
  1843. /**
  1844. * the compilation
  1845. */
  1846. compilation?: Compilation;
  1847. /**
  1848. * source types
  1849. */
  1850. sourceTypes?: ReadonlySet<string>;
  1851. }
  1852. declare interface CodeGenerationJob {
  1853. module: Module;
  1854. hash: string;
  1855. runtime: RuntimeSpec;
  1856. runtimes: RuntimeSpec[];
  1857. }
  1858. declare interface CodeGenerationResult {
  1859. /**
  1860. * the resulting sources for all source types
  1861. */
  1862. sources: Map<string, Source>;
  1863. /**
  1864. * the resulting data for all source types
  1865. */
  1866. data?: CodeGenerationResultData;
  1867. /**
  1868. * the runtime requirements
  1869. */
  1870. runtimeRequirements: null | ReadonlySet<string>;
  1871. /**
  1872. * a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided)
  1873. */
  1874. hash?: string;
  1875. }
  1876. type CodeGenerationResultData = Map<"topLevelDeclarations", Set<string>> &
  1877. Map<"chunkInitFragments", InitFragment<any>[]> &
  1878. Map<"url", { "css-url": string }> &
  1879. Map<"filename", string> &
  1880. Map<"assetInfo", AssetInfo> &
  1881. Map<"fullContentHash", string> &
  1882. Map<"share-init", [{ shareScope: string; initStage: number; init: string }]> &
  1883. Map<string, any>;
  1884. declare abstract class CodeGenerationResults {
  1885. map: Map<Module, RuntimeSpecMap<CodeGenerationResult, CodeGenerationResult>>;
  1886. get(module: Module, runtime: RuntimeSpec): CodeGenerationResult;
  1887. has(module: Module, runtime: RuntimeSpec): boolean;
  1888. getSource(module: Module, runtime: RuntimeSpec, sourceType: string): Source;
  1889. getRuntimeRequirements(
  1890. module: Module,
  1891. runtime: RuntimeSpec
  1892. ): null | ReadonlySet<string>;
  1893. getData(module: Module, runtime: RuntimeSpec, key: string): any;
  1894. getHash(module: Module, runtime: RuntimeSpec): string;
  1895. add(module: Module, runtime: RuntimeSpec, result: CodeGenerationResult): void;
  1896. }
  1897. type CodeValue =
  1898. | undefined
  1899. | null
  1900. | string
  1901. | number
  1902. | bigint
  1903. | boolean
  1904. | Function
  1905. | RegExp
  1906. | RuntimeValue
  1907. | {
  1908. [index: string]: RecursiveArrayOrRecord<
  1909. | undefined
  1910. | null
  1911. | string
  1912. | number
  1913. | bigint
  1914. | boolean
  1915. | Function
  1916. | RegExp
  1917. | RuntimeValue
  1918. >;
  1919. }
  1920. | RecursiveArrayOrRecord<
  1921. | undefined
  1922. | null
  1923. | string
  1924. | number
  1925. | bigint
  1926. | boolean
  1927. | Function
  1928. | RegExp
  1929. | RuntimeValue
  1930. >[];
  1931. type CodeValuePrimitive =
  1932. | undefined
  1933. | null
  1934. | string
  1935. | number
  1936. | bigint
  1937. | boolean
  1938. | Function
  1939. | RegExp;
  1940. declare interface Colors {
  1941. reset: (value?: any) => string;
  1942. bold: (value?: any) => string;
  1943. dim: (value?: any) => string;
  1944. italic: (value?: any) => string;
  1945. underline: (value?: any) => string;
  1946. inverse: (value?: any) => string;
  1947. hidden: (value?: any) => string;
  1948. strikethrough: (value?: any) => string;
  1949. black: (value?: any) => string;
  1950. red: (value?: any) => string;
  1951. green: (value?: any) => string;
  1952. yellow: (value?: any) => string;
  1953. blue: (value?: any) => string;
  1954. magenta: (value?: any) => string;
  1955. cyan: (value?: any) => string;
  1956. white: (value?: any) => string;
  1957. gray: (value?: any) => string;
  1958. bgBlack: (value?: any) => string;
  1959. bgRed: (value?: any) => string;
  1960. bgGreen: (value?: any) => string;
  1961. bgYellow: (value?: any) => string;
  1962. bgBlue: (value?: any) => string;
  1963. bgMagenta: (value?: any) => string;
  1964. bgCyan: (value?: any) => string;
  1965. bgWhite: (value?: any) => string;
  1966. blackBright: (value?: any) => string;
  1967. redBright: (value?: any) => string;
  1968. greenBright: (value?: any) => string;
  1969. yellowBright: (value?: any) => string;
  1970. blueBright: (value?: any) => string;
  1971. magentaBright: (value?: any) => string;
  1972. cyanBright: (value?: any) => string;
  1973. whiteBright: (value?: any) => string;
  1974. bgBlackBright: (value?: any) => string;
  1975. bgRedBright: (value?: any) => string;
  1976. bgGreenBright: (value?: any) => string;
  1977. bgYellowBright: (value?: any) => string;
  1978. bgBlueBright: (value?: any) => string;
  1979. bgMagentaBright: (value?: any) => string;
  1980. bgCyanBright: (value?: any) => string;
  1981. bgWhiteBright: (value?: any) => string;
  1982. }
  1983. declare interface ColorsOptions {
  1984. /**
  1985. * force use colors
  1986. */
  1987. useColor?: boolean;
  1988. }
  1989. declare interface CommentCssParser {
  1990. value: string;
  1991. range: [number, number];
  1992. loc: { start: Position; end: Position };
  1993. }
  1994. type CommentJavascriptParser = CommentImport & {
  1995. start: number;
  1996. end: number;
  1997. loc: SourceLocation;
  1998. };
  1999. declare interface CommonJsImportSettings {
  2000. name?: string;
  2001. context: string;
  2002. }
  2003. declare interface Comparator<T> {
  2004. (a: T, b: T): 0 | 1 | -1;
  2005. }
  2006. declare class CompatSource extends Source {
  2007. constructor(sourceLike: SourceLike);
  2008. static from(sourceLike: SourceLike): Source;
  2009. }
  2010. declare interface CompatibilitySettings {
  2011. name: string;
  2012. declaration: CompatibilitySettingsDeclaration;
  2013. }
  2014. declare interface CompatibilitySettingsDeclaration {
  2015. updated: boolean;
  2016. loc: DependencyLocation;
  2017. range: [number, number];
  2018. }
  2019. declare class Compilation {
  2020. /**
  2021. * Creates an instance of Compilation.
  2022. */
  2023. constructor(compiler: Compiler, params: CompilationParams);
  2024. hooks: Readonly<{
  2025. buildModule: SyncHook<[Module]>;
  2026. rebuildModule: SyncHook<[Module]>;
  2027. failedModule: SyncHook<[Module, WebpackError]>;
  2028. succeedModule: SyncHook<[Module]>;
  2029. stillValidModule: SyncHook<[Module]>;
  2030. addEntry: SyncHook<[Dependency, EntryOptions]>;
  2031. failedEntry: SyncHook<[Dependency, EntryOptions, Error]>;
  2032. succeedEntry: SyncHook<[Dependency, EntryOptions, Module]>;
  2033. dependencyReferencedExports: SyncWaterfallHook<
  2034. [(string[] | ReferencedExport)[], Dependency, RuntimeSpec],
  2035. (string[] | ReferencedExport)[]
  2036. >;
  2037. executeModule: SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>;
  2038. prepareModuleExecution: AsyncParallelHook<
  2039. [ExecuteModuleArgument, ExecuteModuleContext]
  2040. >;
  2041. finishModules: AsyncSeriesHook<[Iterable<Module>]>;
  2042. finishRebuildingModule: AsyncSeriesHook<[Module]>;
  2043. unseal: SyncHook<[]>;
  2044. seal: SyncHook<[]>;
  2045. beforeChunks: SyncHook<[]>;
  2046. /**
  2047. * The `afterChunks` hook is called directly after the chunks and module graph have
  2048. * been created and before the chunks and modules have been optimized. This hook is useful to
  2049. * inspect, analyze, and/or modify the chunk graph.
  2050. */
  2051. afterChunks: SyncHook<[Iterable<Chunk>]>;
  2052. optimizeDependencies: SyncBailHook<[Iterable<Module>], boolean | void>;
  2053. afterOptimizeDependencies: SyncHook<[Iterable<Module>]>;
  2054. optimize: SyncHook<[]>;
  2055. optimizeModules: SyncBailHook<[Iterable<Module>], boolean | void>;
  2056. afterOptimizeModules: SyncHook<[Iterable<Module>]>;
  2057. optimizeChunks: SyncBailHook<
  2058. [Iterable<Chunk>, ChunkGroup[]],
  2059. boolean | void
  2060. >;
  2061. afterOptimizeChunks: SyncHook<[Iterable<Chunk>, ChunkGroup[]]>;
  2062. optimizeTree: AsyncSeriesHook<[Iterable<Chunk>, Iterable<Module>]>;
  2063. afterOptimizeTree: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  2064. optimizeChunkModules: AsyncSeriesBailHook<
  2065. [Iterable<Chunk>, Iterable<Module>],
  2066. void
  2067. >;
  2068. afterOptimizeChunkModules: SyncHook<[Iterable<Chunk>, Iterable<Module>]>;
  2069. shouldRecord: SyncBailHook<[], boolean | void>;
  2070. additionalChunkRuntimeRequirements: SyncHook<
  2071. [Chunk, Set<string>, RuntimeRequirementsContext]
  2072. >;
  2073. runtimeRequirementInChunk: HookMap<
  2074. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  2075. >;
  2076. additionalModuleRuntimeRequirements: SyncHook<
  2077. [Module, Set<string>, RuntimeRequirementsContext]
  2078. >;
  2079. runtimeRequirementInModule: HookMap<
  2080. SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>
  2081. >;
  2082. additionalTreeRuntimeRequirements: SyncHook<
  2083. [Chunk, Set<string>, RuntimeRequirementsContext]
  2084. >;
  2085. runtimeRequirementInTree: HookMap<
  2086. SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>
  2087. >;
  2088. runtimeModule: SyncHook<[RuntimeModule, Chunk]>;
  2089. reviveModules: SyncHook<[Iterable<Module>, Records]>;
  2090. beforeModuleIds: SyncHook<[Iterable<Module>]>;
  2091. moduleIds: SyncHook<[Iterable<Module>]>;
  2092. optimizeModuleIds: SyncHook<[Iterable<Module>]>;
  2093. afterOptimizeModuleIds: SyncHook<[Iterable<Module>]>;
  2094. reviveChunks: SyncHook<[Iterable<Chunk>, Records]>;
  2095. beforeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2096. chunkIds: SyncHook<[Iterable<Chunk>]>;
  2097. optimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2098. afterOptimizeChunkIds: SyncHook<[Iterable<Chunk>]>;
  2099. recordModules: SyncHook<[Iterable<Module>, Records]>;
  2100. recordChunks: SyncHook<[Iterable<Chunk>, Records]>;
  2101. optimizeCodeGeneration: SyncHook<[Iterable<Module>]>;
  2102. beforeModuleHash: SyncHook<[]>;
  2103. afterModuleHash: SyncHook<[]>;
  2104. beforeCodeGeneration: SyncHook<[]>;
  2105. afterCodeGeneration: SyncHook<[]>;
  2106. beforeRuntimeRequirements: SyncHook<[]>;
  2107. afterRuntimeRequirements: SyncHook<[]>;
  2108. beforeHash: SyncHook<[]>;
  2109. contentHash: SyncHook<[Chunk]>;
  2110. afterHash: SyncHook<[]>;
  2111. recordHash: SyncHook<[Records]>;
  2112. record: SyncHook<[Compilation, Records]>;
  2113. beforeModuleAssets: SyncHook<[]>;
  2114. shouldGenerateChunkAssets: SyncBailHook<[], boolean | void>;
  2115. beforeChunkAssets: SyncHook<[]>;
  2116. additionalChunkAssets: FakeHook<
  2117. Pick<
  2118. AsyncSeriesHook<[Set<Chunk>]>,
  2119. "name" | "tap" | "tapAsync" | "tapPromise"
  2120. >
  2121. >;
  2122. additionalAssets: FakeHook<
  2123. Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
  2124. >;
  2125. optimizeChunkAssets: FakeHook<
  2126. Pick<
  2127. AsyncSeriesHook<[Set<Chunk>]>,
  2128. "name" | "tap" | "tapAsync" | "tapPromise"
  2129. >
  2130. >;
  2131. afterOptimizeChunkAssets: FakeHook<
  2132. Pick<
  2133. AsyncSeriesHook<[Set<Chunk>]>,
  2134. "name" | "tap" | "tapAsync" | "tapPromise"
  2135. >
  2136. >;
  2137. optimizeAssets: AsyncSeriesHook<
  2138. [CompilationAssets],
  2139. ProcessAssetsAdditionalOptions
  2140. >;
  2141. afterOptimizeAssets: SyncHook<[CompilationAssets]>;
  2142. processAssets: AsyncSeriesHook<
  2143. [CompilationAssets],
  2144. ProcessAssetsAdditionalOptions
  2145. >;
  2146. afterProcessAssets: SyncHook<[CompilationAssets]>;
  2147. processAdditionalAssets: AsyncSeriesHook<[CompilationAssets]>;
  2148. needAdditionalSeal: SyncBailHook<[], boolean | void>;
  2149. afterSeal: AsyncSeriesHook<[]>;
  2150. renderManifest: SyncWaterfallHook<
  2151. [RenderManifestEntry[], RenderManifestOptions],
  2152. RenderManifestEntry[]
  2153. >;
  2154. fullHash: SyncHook<[Hash]>;
  2155. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2156. moduleAsset: SyncHook<[Module, string]>;
  2157. chunkAsset: SyncHook<[Chunk, string]>;
  2158. assetPath: SyncWaterfallHook<
  2159. [string, PathData, undefined | AssetInfo],
  2160. string
  2161. >;
  2162. needAdditionalPass: SyncBailHook<[], boolean | void>;
  2163. childCompiler: SyncHook<[Compiler, string, number]>;
  2164. log: SyncBailHook<[string, LogEntry], boolean | void>;
  2165. processWarnings: SyncWaterfallHook<[Error[]], Error[]>;
  2166. processErrors: SyncWaterfallHook<[Error[]], Error[]>;
  2167. statsPreset: HookMap<
  2168. SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>
  2169. >;
  2170. statsNormalize: SyncHook<
  2171. [Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]
  2172. >;
  2173. statsFactory: SyncHook<[StatsFactory, NormalizedStatsOptions]>;
  2174. statsPrinter: SyncHook<[StatsPrinter, NormalizedStatsOptions]>;
  2175. get normalModuleLoader(): SyncHook<[AnyLoaderContext, NormalModule]>;
  2176. }>;
  2177. name?: string;
  2178. startTime?: number;
  2179. endTime?: number;
  2180. compiler: Compiler;
  2181. resolverFactory: ResolverFactory;
  2182. inputFileSystem: InputFileSystem;
  2183. fileSystemInfo: FileSystemInfo;
  2184. valueCacheVersions: Map<string, ValueCacheVersion>;
  2185. requestShortener: RequestShortener;
  2186. compilerPath: string;
  2187. logger: WebpackLogger;
  2188. options: WebpackOptionsNormalizedWithDefaults;
  2189. outputOptions: OutputNormalizedWithDefaults;
  2190. bail: boolean;
  2191. profile: boolean;
  2192. params: CompilationParams;
  2193. mainTemplate: MainTemplate;
  2194. chunkTemplate: ChunkTemplate;
  2195. runtimeTemplate: RuntimeTemplate;
  2196. moduleTemplates: ModuleTemplates;
  2197. moduleMemCaches?: Map<Module, WeakTupleMap<any[], any>>;
  2198. moduleMemCaches2?: Map<Module, WeakTupleMap<any[], any>>;
  2199. moduleGraph: ModuleGraph;
  2200. chunkGraph: ChunkGraph;
  2201. codeGenerationResults?: CodeGenerationResults;
  2202. processDependenciesQueue: AsyncQueue<Module, Module, Module>;
  2203. addModuleQueue: AsyncQueue<Module, string, Module>;
  2204. factorizeQueue: AsyncQueue<
  2205. FactorizeModuleOptions,
  2206. string,
  2207. Module | ModuleFactoryResult
  2208. >;
  2209. buildQueue: AsyncQueue<Module, Module, Module>;
  2210. rebuildQueue: AsyncQueue<Module, Module, Module>;
  2211. /**
  2212. * Modules in value are building during the build of Module in key.
  2213. * Means value blocking key from finishing.
  2214. * Needed to detect build cycles.
  2215. */
  2216. creatingModuleDuringBuild: WeakMap<Module, Set<Module>>;
  2217. entries: Map<string, EntryData>;
  2218. globalEntry: EntryData;
  2219. entrypoints: Map<string, Entrypoint>;
  2220. asyncEntrypoints: Entrypoint[];
  2221. chunks: Set<Chunk>;
  2222. chunkGroups: ChunkGroup[];
  2223. namedChunkGroups: Map<string, ChunkGroup>;
  2224. namedChunks: Map<string, Chunk>;
  2225. modules: Set<Module>;
  2226. records: null | Records;
  2227. additionalChunkAssets: string[];
  2228. assets: CompilationAssets;
  2229. assetsInfo: Map<string, AssetInfo>;
  2230. errors: Error[];
  2231. warnings: Error[];
  2232. children: Compilation[];
  2233. logging: Map<string, LogEntry[]>;
  2234. dependencyFactories: Map<DependencyConstructor, ModuleFactory>;
  2235. dependencyTemplates: DependencyTemplates;
  2236. childrenCounters: Record<string, number>;
  2237. usedChunkIds: null | Set<number>;
  2238. usedModuleIds: null | Set<number>;
  2239. needAdditionalPass: boolean;
  2240. builtModules: WeakSet<Module>;
  2241. codeGeneratedModules: WeakSet<Module>;
  2242. buildTimeExecutedModules: WeakSet<Module>;
  2243. emittedAssets: Set<string>;
  2244. comparedForEmitAssets: Set<string>;
  2245. fileDependencies: LazySet<string>;
  2246. contextDependencies: LazySet<string>;
  2247. missingDependencies: LazySet<string>;
  2248. buildDependencies: LazySet<string>;
  2249. compilationDependencies: { add: (item: string) => LazySet<string> };
  2250. getStats(): Stats;
  2251. createStatsOptions(
  2252. optionsOrPreset?: string | boolean | StatsOptions,
  2253. context?: CreateStatsOptionsContext
  2254. ): NormalizedStatsOptions;
  2255. createStatsFactory(options: NormalizedStatsOptions): StatsFactory;
  2256. createStatsPrinter(options: NormalizedStatsOptions): StatsPrinter;
  2257. getCache(name: string): CacheFacade;
  2258. getLogger(name: string | (() => string)): WebpackLogger;
  2259. addModule(
  2260. module: Module,
  2261. callback: (err?: null | WebpackError, result?: null | Module) => void
  2262. ): void;
  2263. /**
  2264. * Fetches a module from a compilation by its identifier
  2265. */
  2266. getModule(module: Module): Module;
  2267. /**
  2268. * Attempts to search for a module by its identifier
  2269. */
  2270. findModule(identifier: string): undefined | Module;
  2271. /**
  2272. * Schedules a build of the module object
  2273. */
  2274. buildModule(
  2275. module: Module,
  2276. callback: (err?: null | WebpackError, result?: null | Module) => void
  2277. ): void;
  2278. processModuleDependencies(
  2279. module: Module,
  2280. callback: (err?: null | WebpackError, result?: null | Module) => void
  2281. ): void;
  2282. processModuleDependenciesNonRecursive(module: Module): void;
  2283. factorizeModule(
  2284. options: FactorizeModuleOptions & { factoryResult?: false },
  2285. callback: (err?: null | WebpackError, result?: null | Module) => void
  2286. ): void;
  2287. factorizeModule(
  2288. options: FactorizeModuleOptions & { factoryResult: true },
  2289. callback: (
  2290. err?: null | WebpackError,
  2291. result?: null | ModuleFactoryResult
  2292. ) => void
  2293. ): void;
  2294. handleModuleCreation(
  2295. __0: HandleModuleCreationOptions,
  2296. callback: (err?: null | WebpackError, result?: null | Module) => void
  2297. ): void;
  2298. addModuleChain(
  2299. context: string,
  2300. dependency: Dependency,
  2301. callback: (err?: null | WebpackError, result?: null | Module) => void
  2302. ): void;
  2303. addModuleTree(
  2304. __0: {
  2305. /**
  2306. * context string path
  2307. */
  2308. context: string;
  2309. /**
  2310. * dependency used to create Module chain
  2311. */
  2312. dependency: Dependency;
  2313. /**
  2314. * additional context info for the root module
  2315. */
  2316. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  2317. },
  2318. callback: (err?: null | WebpackError, result?: null | Module) => void
  2319. ): void;
  2320. addEntry(
  2321. context: string,
  2322. entry: Dependency,
  2323. optionsOrName: string | EntryOptions,
  2324. callback: (err?: null | WebpackError, result?: null | Module) => void
  2325. ): void;
  2326. addInclude(
  2327. context: string,
  2328. dependency: Dependency,
  2329. options: EntryOptions,
  2330. callback: (err?: null | WebpackError, result?: null | Module) => void
  2331. ): void;
  2332. rebuildModule(
  2333. module: Module,
  2334. callback: (err?: null | WebpackError, result?: null | Module) => void
  2335. ): void;
  2336. finish(callback: (err?: null | WebpackError) => void): void;
  2337. unseal(): void;
  2338. seal(callback: (err?: null | WebpackError) => void): void;
  2339. reportDependencyErrorsAndWarnings(
  2340. module: Module,
  2341. blocks: DependenciesBlock[]
  2342. ): boolean;
  2343. codeGeneration(callback: (err?: null | WebpackError) => void): void;
  2344. processRuntimeRequirements(__0?: {
  2345. /**
  2346. * the chunk graph
  2347. */
  2348. chunkGraph?: ChunkGraph;
  2349. /**
  2350. * modules
  2351. */
  2352. modules?: Iterable<Module>;
  2353. /**
  2354. * chunks
  2355. */
  2356. chunks?: Iterable<Chunk>;
  2357. /**
  2358. * codeGenerationResults
  2359. */
  2360. codeGenerationResults?: CodeGenerationResults;
  2361. /**
  2362. * chunkGraphEntries
  2363. */
  2364. chunkGraphEntries?: Iterable<Chunk>;
  2365. }): void;
  2366. addRuntimeModule(
  2367. chunk: Chunk,
  2368. module: RuntimeModule,
  2369. chunkGraph?: ChunkGraph
  2370. ): void;
  2371. /**
  2372. * If `module` is passed, `loc` and `request` must also be passed.
  2373. */
  2374. addChunkInGroup(
  2375. groupOptions: string | ChunkGroupOptions,
  2376. module?: Module,
  2377. loc?: SyntheticDependencyLocation | RealDependencyLocation,
  2378. request?: string
  2379. ): ChunkGroup;
  2380. addAsyncEntrypoint(
  2381. options: EntryOptions,
  2382. module: Module,
  2383. loc: DependencyLocation,
  2384. request: string
  2385. ): Entrypoint;
  2386. /**
  2387. * This method first looks to see if a name is provided for a new chunk,
  2388. * and first looks to see if any named chunks already exist and reuse that chunk instead.
  2389. */
  2390. addChunk(name?: null | string): Chunk;
  2391. assignDepth(module: Module): void;
  2392. assignDepths(modules: Set<Module>): void;
  2393. getDependencyReferencedExports(
  2394. dependency: Dependency,
  2395. runtime: RuntimeSpec
  2396. ): (string[] | ReferencedExport)[];
  2397. removeReasonsOfDependencyBlock(
  2398. module: Module,
  2399. block: DependenciesBlockLike
  2400. ): void;
  2401. patchChunksAfterReasonRemoval(module: Module, chunk: Chunk): void;
  2402. removeChunkFromDependencies(block: DependenciesBlock, chunk: Chunk): void;
  2403. assignRuntimeIds(): void;
  2404. sortItemsWithChunkIds(): void;
  2405. summarizeDependencies(): void;
  2406. createModuleHashes(): void;
  2407. createHash(): CodeGenerationJob[];
  2408. fullHash?: string;
  2409. hash?: string;
  2410. emitAsset(file: string, source: Source, assetInfo?: AssetInfo): void;
  2411. updateAsset(
  2412. file: string,
  2413. newSourceOrFunction: Source | ((source: Source) => Source),
  2414. assetInfoUpdateOrFunction?:
  2415. | AssetInfo
  2416. | ((assetInfo?: AssetInfo) => undefined | AssetInfo)
  2417. ): void;
  2418. renameAsset(file: string, newFile: string): void;
  2419. deleteAsset(file: string): void;
  2420. getAssets(): Readonly<Asset>[];
  2421. getAsset(name: string): undefined | Readonly<Asset>;
  2422. clearAssets(): void;
  2423. createModuleAssets(): void;
  2424. getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
  2425. createChunkAssets(callback: (err?: null | WebpackError) => void): void;
  2426. getPath(filename: TemplatePath, data?: PathData): string;
  2427. getPathWithInfo(
  2428. filename: TemplatePath,
  2429. data?: PathData
  2430. ): InterpolatedPathAndAssetInfo;
  2431. getAssetPath(filename: TemplatePath, data: PathData): string;
  2432. getAssetPathWithInfo(
  2433. filename: TemplatePath,
  2434. data: PathData
  2435. ): InterpolatedPathAndAssetInfo;
  2436. getWarnings(): Error[];
  2437. getErrors(): Error[];
  2438. /**
  2439. * This function allows you to run another instance of webpack inside of webpack however as
  2440. * a child with different settings and configurations (if desired) applied. It copies all hooks, plugins
  2441. * from parent (or top level compiler) and creates a child Compilation
  2442. */
  2443. createChildCompiler(
  2444. name: string,
  2445. outputOptions?: Partial<OutputNormalized>,
  2446. plugins?: (
  2447. | undefined
  2448. | null
  2449. | false
  2450. | ""
  2451. | 0
  2452. | ((this: Compiler, compiler: Compiler) => void)
  2453. | WebpackPluginInstance
  2454. )[]
  2455. ): Compiler;
  2456. executeModule(
  2457. module: Module,
  2458. options: ExecuteModuleOptions,
  2459. callback: (
  2460. err?: null | WebpackError,
  2461. result?: null | ExecuteModuleResult
  2462. ) => void
  2463. ): void;
  2464. checkConstraints(): void;
  2465. /**
  2466. * Add additional assets to the compilation.
  2467. */
  2468. static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
  2469. /**
  2470. * Basic preprocessing of assets.
  2471. */
  2472. static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
  2473. /**
  2474. * Derive new assets from existing assets.
  2475. * Existing assets should not be treated as complete.
  2476. */
  2477. static PROCESS_ASSETS_STAGE_DERIVED: number;
  2478. /**
  2479. * Add additional sections to existing assets, like a banner or initialization code.
  2480. */
  2481. static PROCESS_ASSETS_STAGE_ADDITIONS: number;
  2482. /**
  2483. * Optimize existing assets in a general way.
  2484. */
  2485. static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
  2486. /**
  2487. * Optimize the count of existing assets, e. g. by merging them.
  2488. * Only assets of the same type should be merged.
  2489. * For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
  2490. */
  2491. static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
  2492. /**
  2493. * Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
  2494. */
  2495. static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
  2496. /**
  2497. * Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
  2498. */
  2499. static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
  2500. /**
  2501. * Add development tooling to assets, e. g. by extracting a SourceMap.
  2502. */
  2503. static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
  2504. /**
  2505. * Optimize the count of existing assets, e. g. by inlining assets of into other assets.
  2506. * Only assets of different types should be inlined.
  2507. * For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
  2508. */
  2509. static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
  2510. /**
  2511. * Summarize the list of existing assets
  2512. * e. g. creating an assets manifest of Service Workers.
  2513. */
  2514. static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
  2515. /**
  2516. * Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
  2517. */
  2518. static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
  2519. /**
  2520. * Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
  2521. */
  2522. static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
  2523. /**
  2524. * Analyse existing assets.
  2525. */
  2526. static PROCESS_ASSETS_STAGE_ANALYSE: number;
  2527. /**
  2528. * Creating assets for reporting purposes.
  2529. */
  2530. static PROCESS_ASSETS_STAGE_REPORT: number;
  2531. }
  2532. declare interface CompilationAssets {
  2533. [index: string]: Source;
  2534. }
  2535. declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
  2536. renderModuleContent: SyncWaterfallHook<
  2537. [Source, Module, WebAssemblyRenderContext],
  2538. Source
  2539. >;
  2540. }
  2541. declare interface CompilationHooksCssModulesPlugin {
  2542. renderModulePackage: SyncWaterfallHook<
  2543. [Source, Module, ChunkRenderContextCssModulesPlugin],
  2544. Source
  2545. >;
  2546. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2547. }
  2548. declare interface CompilationHooksJavascriptModulesPlugin {
  2549. renderModuleContent: SyncWaterfallHook<
  2550. [Source, Module, ModuleRenderContext],
  2551. Source
  2552. >;
  2553. renderModuleContainer: SyncWaterfallHook<
  2554. [Source, Module, ModuleRenderContext],
  2555. Source
  2556. >;
  2557. renderModulePackage: SyncWaterfallHook<
  2558. [Source, Module, ModuleRenderContext],
  2559. Source
  2560. >;
  2561. renderChunk: SyncWaterfallHook<
  2562. [Source, RenderContextJavascriptModulesPlugin],
  2563. Source
  2564. >;
  2565. renderMain: SyncWaterfallHook<
  2566. [Source, RenderContextJavascriptModulesPlugin],
  2567. Source
  2568. >;
  2569. renderContent: SyncWaterfallHook<
  2570. [Source, RenderContextJavascriptModulesPlugin],
  2571. Source
  2572. >;
  2573. render: SyncWaterfallHook<
  2574. [Source, RenderContextJavascriptModulesPlugin],
  2575. Source
  2576. >;
  2577. renderStartup: SyncWaterfallHook<
  2578. [Source, Module, StartupRenderContext],
  2579. Source
  2580. >;
  2581. renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext], string>;
  2582. inlineInRuntimeBailout: SyncBailHook<
  2583. [Module, Partial<RenderBootstrapContext>],
  2584. string | void
  2585. >;
  2586. embedInRuntimeBailout: SyncBailHook<
  2587. [Module, RenderContextJavascriptModulesPlugin],
  2588. string | void
  2589. >;
  2590. strictRuntimeBailout: SyncBailHook<
  2591. [RenderContextJavascriptModulesPlugin],
  2592. string | void
  2593. >;
  2594. chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
  2595. useSourceMap: SyncBailHook<
  2596. [Chunk, RenderContextJavascriptModulesPlugin],
  2597. boolean | void
  2598. >;
  2599. }
  2600. declare interface CompilationHooksModuleFederationPlugin {
  2601. addContainerEntryDependency: SyncHook<Dependency>;
  2602. addFederationRuntimeDependency: SyncHook<Dependency>;
  2603. }
  2604. declare interface CompilationHooksRealContentHashPlugin {
  2605. updateHash: SyncBailHook<[Buffer[], string], string | void>;
  2606. }
  2607. declare interface CompilationParams {
  2608. normalModuleFactory: NormalModuleFactory;
  2609. contextModuleFactory: ContextModuleFactory;
  2610. }
  2611. declare class Compiler {
  2612. constructor(context: string, options?: WebpackOptionsNormalized);
  2613. hooks: Readonly<{
  2614. initialize: SyncHook<[]>;
  2615. shouldEmit: SyncBailHook<[Compilation], boolean | void>;
  2616. done: AsyncSeriesHook<[Stats]>;
  2617. afterDone: SyncHook<[Stats]>;
  2618. additionalPass: AsyncSeriesHook<[]>;
  2619. beforeRun: AsyncSeriesHook<[Compiler]>;
  2620. run: AsyncSeriesHook<[Compiler]>;
  2621. emit: AsyncSeriesHook<[Compilation]>;
  2622. assetEmitted: AsyncSeriesHook<[string, AssetEmittedInfo]>;
  2623. afterEmit: AsyncSeriesHook<[Compilation]>;
  2624. thisCompilation: SyncHook<[Compilation, CompilationParams]>;
  2625. compilation: SyncHook<[Compilation, CompilationParams]>;
  2626. normalModuleFactory: SyncHook<[NormalModuleFactory]>;
  2627. contextModuleFactory: SyncHook<[ContextModuleFactory]>;
  2628. beforeCompile: AsyncSeriesHook<[CompilationParams]>;
  2629. compile: SyncHook<[CompilationParams]>;
  2630. make: AsyncParallelHook<[Compilation]>;
  2631. finishMake: AsyncParallelHook<[Compilation]>;
  2632. afterCompile: AsyncSeriesHook<[Compilation]>;
  2633. readRecords: AsyncSeriesHook<[]>;
  2634. emitRecords: AsyncSeriesHook<[]>;
  2635. watchRun: AsyncSeriesHook<[Compiler]>;
  2636. failed: SyncHook<[Error]>;
  2637. invalid: SyncHook<[null | string, number]>;
  2638. watchClose: SyncHook<[]>;
  2639. shutdown: AsyncSeriesHook<[]>;
  2640. infrastructureLog: SyncBailHook<
  2641. [string, string, undefined | any[]],
  2642. true | void
  2643. >;
  2644. environment: SyncHook<[]>;
  2645. afterEnvironment: SyncHook<[]>;
  2646. afterPlugins: SyncHook<[Compiler]>;
  2647. afterResolvers: SyncHook<[Compiler]>;
  2648. entryOption: SyncBailHook<[string, EntryNormalized], boolean | void>;
  2649. }>;
  2650. webpack: typeof exports;
  2651. name?: string;
  2652. parentCompilation?: Compilation;
  2653. root: Compiler;
  2654. outputPath: string;
  2655. watching?: Watching;
  2656. outputFileSystem: null | OutputFileSystem;
  2657. intermediateFileSystem: null | IntermediateFileSystem;
  2658. inputFileSystem: null | InputFileSystem;
  2659. watchFileSystem: null | WatchFileSystem;
  2660. recordsInputPath: null | string;
  2661. recordsOutputPath: null | string;
  2662. records: Records;
  2663. managedPaths: Set<string | RegExp>;
  2664. unmanagedPaths: Set<string | RegExp>;
  2665. immutablePaths: Set<string | RegExp>;
  2666. modifiedFiles?: ReadonlySet<string>;
  2667. removedFiles?: ReadonlySet<string>;
  2668. fileTimestamps?: Map<string, FileSystemInfoEntry | "ignore">;
  2669. contextTimestamps?: Map<string, FileSystemInfoEntry | "ignore">;
  2670. fsStartTime?: number;
  2671. resolverFactory: ResolverFactory;
  2672. infrastructureLogger?: (
  2673. value: string,
  2674. type: LogTypeEnum,
  2675. args?: any[]
  2676. ) => void;
  2677. platform: Readonly<PlatformTargetProperties>;
  2678. options: WebpackOptionsNormalized;
  2679. context: string;
  2680. requestShortener: RequestShortener;
  2681. cache: CacheClass;
  2682. moduleMemCaches?: Map<Module, ModuleMemCachesItem>;
  2683. compilerPath: string;
  2684. running: boolean;
  2685. idle: boolean;
  2686. watchMode: boolean;
  2687. getCache(name: string): CacheFacade;
  2688. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  2689. watch(
  2690. watchOptions: WatchOptions,
  2691. handler: CallbackWebpackFunction_2<Stats, void>
  2692. ): undefined | Watching;
  2693. run(callback: CallbackWebpackFunction_2<Stats, void>): void;
  2694. runAsChild(
  2695. callback: (
  2696. err: null | Error,
  2697. entries?: Chunk[],
  2698. compilation?: Compilation
  2699. ) => void
  2700. ): void;
  2701. purgeInputFileSystem(): void;
  2702. emitAssets(
  2703. compilation: Compilation,
  2704. callback: (err: null | Error, result?: void) => void
  2705. ): void;
  2706. emitRecords(callback: (err: null | Error, result?: void) => void): void;
  2707. readRecords(callback: (err: null | Error, result?: void) => void): void;
  2708. createChildCompiler(
  2709. compilation: Compilation,
  2710. compilerName: string,
  2711. compilerIndex: number,
  2712. outputOptions?: Partial<OutputNormalized>,
  2713. plugins?: (
  2714. | undefined
  2715. | null
  2716. | false
  2717. | ""
  2718. | 0
  2719. | ((this: Compiler, compiler: Compiler) => void)
  2720. | WebpackPluginInstance
  2721. )[]
  2722. ): Compiler;
  2723. isChild(): boolean;
  2724. createCompilation(params: CompilationParams): Compilation;
  2725. newCompilation(params: CompilationParams): Compilation;
  2726. createNormalModuleFactory(): NormalModuleFactory;
  2727. createContextModuleFactory(): ContextModuleFactory;
  2728. newCompilationParams(): {
  2729. normalModuleFactory: NormalModuleFactory;
  2730. contextModuleFactory: ContextModuleFactory;
  2731. };
  2732. compile(callback: CallbackWebpackFunction_2<Compilation, void>): void;
  2733. close(callback: (err: null | Error, result?: void) => void): void;
  2734. }
  2735. declare class ConcatSource extends Source {
  2736. constructor(...args: ConcatSourceChild[]);
  2737. getChildren(): Source[];
  2738. add(item: ConcatSourceChild): void;
  2739. addAllSkipOptimizing(items: ConcatSourceChild[]): void;
  2740. streamChunks(
  2741. options: StreamChunksOptions,
  2742. onChunk: (
  2743. chunk: undefined | string,
  2744. generatedLine: number,
  2745. generatedColumn: number,
  2746. sourceIndex: number,
  2747. originalLine: number,
  2748. originalColumn: number,
  2749. nameIndex: number
  2750. ) => void,
  2751. onSource: (
  2752. sourceIndex: number,
  2753. source: null | string,
  2754. sourceContent?: string
  2755. ) => void,
  2756. onName: (nameIndex: number, name: string) => void
  2757. ): GeneratedSourceInfo;
  2758. }
  2759. type ConcatSourceChild = string | Source | SourceLike;
  2760. declare interface ConcatenatedModuleInfo {
  2761. type: "concatenated";
  2762. module: Module;
  2763. index: number;
  2764. ast?: Program;
  2765. internalSource?: Source;
  2766. source?: ReplaceSource;
  2767. chunkInitFragments?: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  2768. runtimeRequirements?: ReadonlySet<string>;
  2769. globalScope?: Scope;
  2770. moduleScope?: Scope;
  2771. internalNames: Map<string, string>;
  2772. exportMap?: Map<string, string>;
  2773. rawExportMap?: Map<string, string>;
  2774. namespaceExportSymbol?: string;
  2775. namespaceObjectName?: string;
  2776. concatenationScope?: ConcatenationScope;
  2777. /**
  2778. * "default-with-named" namespace
  2779. */
  2780. interopNamespaceObjectUsed: boolean;
  2781. /**
  2782. * "default-with-named" namespace
  2783. */
  2784. interopNamespaceObjectName?: string;
  2785. /**
  2786. * "default-only" namespace
  2787. */
  2788. interopNamespaceObject2Used: boolean;
  2789. /**
  2790. * "default-only" namespace
  2791. */
  2792. interopNamespaceObject2Name?: string;
  2793. /**
  2794. * runtime namespace object that detects "__esModule"
  2795. */
  2796. interopDefaultAccessUsed: boolean;
  2797. /**
  2798. * runtime namespace object that detects "__esModule"
  2799. */
  2800. interopDefaultAccessName?: string;
  2801. }
  2802. declare interface ConcatenationBailoutReasonContext {
  2803. /**
  2804. * the module graph
  2805. */
  2806. moduleGraph: ModuleGraph;
  2807. /**
  2808. * the chunk graph
  2809. */
  2810. chunkGraph: ChunkGraph;
  2811. }
  2812. declare class ConcatenationScope {
  2813. constructor(
  2814. modulesMap: ModuleInfo[] | Map<Module, ModuleInfo>,
  2815. currentModule: ConcatenatedModuleInfo,
  2816. usedNames: Set<string>
  2817. );
  2818. usedNames: Set<string>;
  2819. isModuleInScope(module: Module): boolean;
  2820. registerExport(exportName: string, symbol: string): void;
  2821. registerRawExport(exportName: string, expression: string): void;
  2822. getRawExport(exportName: string): undefined | string;
  2823. setRawExportMap(exportName: string, expression: string): void;
  2824. registerNamespaceExport(symbol: string): void;
  2825. createModuleReference(
  2826. module: Module,
  2827. __1: Partial<ModuleReferenceOptions>
  2828. ): string;
  2829. static isModuleReference(name: string): boolean;
  2830. static matchModuleReference(
  2831. name: string
  2832. ): null | (ModuleReferenceOptions & { index: number });
  2833. static DEFAULT_EXPORT: string;
  2834. static NAMESPACE_OBJECT_EXPORT: string;
  2835. }
  2836. /**
  2837. * Options object as provided by the user.
  2838. */
  2839. declare interface Configuration {
  2840. /**
  2841. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  2842. */
  2843. amd?: false | { [index: string]: any };
  2844. /**
  2845. * Report the first error as a hard error instead of tolerating it.
  2846. */
  2847. bail?: boolean;
  2848. /**
  2849. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  2850. */
  2851. cache?: boolean | FileCacheOptions | MemoryCacheOptions;
  2852. /**
  2853. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  2854. */
  2855. context?: string;
  2856. /**
  2857. * References to other configurations to depend on.
  2858. */
  2859. dependencies?: string[];
  2860. /**
  2861. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  2862. */
  2863. devtool?: string | false;
  2864. /**
  2865. * Enable and configure the Dotenv plugin to load environment variables from .env files.
  2866. */
  2867. dotenv?: boolean | DotenvPluginOptions;
  2868. /**
  2869. * The entry point(s) of the compilation.
  2870. */
  2871. entry?:
  2872. | string
  2873. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  2874. | EntryObject
  2875. | string[];
  2876. /**
  2877. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  2878. */
  2879. experiments?: Experiments;
  2880. /**
  2881. * Extend configuration from another configuration (only works when using webpack-cli).
  2882. */
  2883. extends?: string | string[];
  2884. /**
  2885. * 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`.
  2886. */
  2887. externals?:
  2888. | string
  2889. | RegExp
  2890. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  2891. | ((
  2892. data: ExternalItemFunctionData,
  2893. callback: (
  2894. err?: null | Error,
  2895. result?: string | boolean | string[] | { [index: string]: any }
  2896. ) => void
  2897. ) => void)
  2898. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
  2899. | ExternalItem[];
  2900. /**
  2901. * Enable presets of externals for specific targets.
  2902. */
  2903. externalsPresets?: ExternalsPresets;
  2904. /**
  2905. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  2906. */
  2907. externalsType?:
  2908. | "import"
  2909. | "var"
  2910. | "module"
  2911. | "assign"
  2912. | "this"
  2913. | "window"
  2914. | "self"
  2915. | "global"
  2916. | "commonjs"
  2917. | "commonjs2"
  2918. | "commonjs-module"
  2919. | "commonjs-static"
  2920. | "amd"
  2921. | "amd-require"
  2922. | "umd"
  2923. | "umd2"
  2924. | "jsonp"
  2925. | "system"
  2926. | "promise"
  2927. | "module-import"
  2928. | "script"
  2929. | "node-commonjs"
  2930. | "asset"
  2931. | "css-import"
  2932. | "css-url";
  2933. /**
  2934. * Ignore specific warnings.
  2935. */
  2936. ignoreWarnings?: (
  2937. | RegExp
  2938. | {
  2939. /**
  2940. * A RegExp to select the origin file for the warning.
  2941. */
  2942. file?: RegExp;
  2943. /**
  2944. * A RegExp to select the warning message.
  2945. */
  2946. message?: RegExp;
  2947. /**
  2948. * A RegExp to select the origin module for the warning.
  2949. */
  2950. module?: RegExp;
  2951. }
  2952. | ((warning: Error, compilation: Compilation) => boolean)
  2953. )[];
  2954. /**
  2955. * Options for infrastructure level logging.
  2956. */
  2957. infrastructureLogging?: InfrastructureLogging;
  2958. /**
  2959. * Custom values available in the loader context.
  2960. */
  2961. loader?: Loader;
  2962. /**
  2963. * Enable production optimizations or development hints.
  2964. */
  2965. mode?: "none" | "development" | "production";
  2966. /**
  2967. * Options affecting the normal modules (`NormalModuleFactory`).
  2968. */
  2969. module?: ModuleOptions;
  2970. /**
  2971. * Name of the configuration. Used when loading multiple configurations.
  2972. */
  2973. name?: string;
  2974. /**
  2975. * Include polyfills or mocks for various node stuff.
  2976. */
  2977. node?: false | NodeOptions;
  2978. /**
  2979. * Enables/Disables integrated optimizations.
  2980. */
  2981. optimization?: Optimization;
  2982. /**
  2983. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  2984. */
  2985. output?: Output;
  2986. /**
  2987. * The number of parallel processed modules in the compilation.
  2988. */
  2989. parallelism?: number;
  2990. /**
  2991. * Configuration for web performance recommendations.
  2992. */
  2993. performance?: false | PerformanceOptions;
  2994. /**
  2995. * Add additional plugins to the compiler.
  2996. */
  2997. plugins?: (
  2998. | undefined
  2999. | null
  3000. | false
  3001. | ""
  3002. | 0
  3003. | ((this: Compiler, compiler: Compiler) => void)
  3004. | WebpackPluginInstance
  3005. )[];
  3006. /**
  3007. * Capture timing information for each module.
  3008. */
  3009. profile?: boolean;
  3010. /**
  3011. * Store compiler state to a json file.
  3012. */
  3013. recordsInputPath?: string | false;
  3014. /**
  3015. * Load compiler state from a json file.
  3016. */
  3017. recordsOutputPath?: string | false;
  3018. /**
  3019. * 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.
  3020. */
  3021. recordsPath?: string | false;
  3022. /**
  3023. * Options for the resolver.
  3024. */
  3025. resolve?: ResolveOptions;
  3026. /**
  3027. * Options for the resolver when resolving loaders.
  3028. */
  3029. resolveLoader?: ResolveOptions;
  3030. /**
  3031. * Options affecting how file system snapshots are created and validated.
  3032. */
  3033. snapshot?: SnapshotOptionsWebpackOptions;
  3034. /**
  3035. * Stats options object or preset name.
  3036. */
  3037. stats?:
  3038. | boolean
  3039. | StatsOptions
  3040. | "none"
  3041. | "summary"
  3042. | "errors-only"
  3043. | "errors-warnings"
  3044. | "minimal"
  3045. | "normal"
  3046. | "detailed"
  3047. | "verbose";
  3048. /**
  3049. * Environment to build for. An array of environments to build for all of them when possible.
  3050. */
  3051. target?: string | false | string[];
  3052. /**
  3053. * Enter watch mode, which rebuilds on file change.
  3054. */
  3055. watch?: boolean;
  3056. /**
  3057. * Options for the watcher.
  3058. */
  3059. watchOptions?: WatchOptions;
  3060. }
  3061. type ConnectionState =
  3062. | boolean
  3063. | typeof CIRCULAR_CONNECTION
  3064. | typeof TRANSITIVE_ONLY;
  3065. declare class ConstDependency extends NullDependency {
  3066. constructor(
  3067. expression: string,
  3068. range: number | [number, number],
  3069. runtimeRequirements?: null | string[]
  3070. );
  3071. expression: string;
  3072. range: number | [number, number];
  3073. runtimeRequirements: null | Set<string>;
  3074. static Template: typeof ConstDependencyTemplate;
  3075. static NO_EXPORTS_REFERENCED: string[][];
  3076. static EXPORTS_OBJECT_REFERENCED: string[][];
  3077. static isLowPriorityDependency(dependency: Dependency): boolean;
  3078. static TRANSITIVE: typeof TRANSITIVE;
  3079. }
  3080. declare class ConstDependencyTemplate extends NullDependencyTemplate {
  3081. constructor();
  3082. }
  3083. declare interface Constructor {
  3084. new (...params: any[]): any;
  3085. }
  3086. declare class ConsumeSharedPlugin {
  3087. constructor(options: ConsumeSharedPluginOptions);
  3088. /**
  3089. * Apply the plugin
  3090. */
  3091. apply(compiler: Compiler): void;
  3092. }
  3093. /**
  3094. * Options for consuming shared modules.
  3095. */
  3096. declare interface ConsumeSharedPluginOptions {
  3097. /**
  3098. * Modules that should be consumed from share scope. When provided, property names are used to match requested modules in this compilation.
  3099. */
  3100. consumes: Consumes;
  3101. /**
  3102. * Share scope name used for all consumed modules (defaults to 'default').
  3103. */
  3104. shareScope?: string;
  3105. }
  3106. type Consumes = (string | ConsumesObject)[] | ConsumesObject;
  3107. /**
  3108. * Advanced configuration for modules that should be consumed from share scope.
  3109. */
  3110. declare interface ConsumesConfig {
  3111. /**
  3112. * 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.
  3113. */
  3114. eager?: boolean;
  3115. /**
  3116. * Fallback module if no shared module is found in share scope. Defaults to the property name.
  3117. */
  3118. import?: string | false;
  3119. /**
  3120. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  3121. */
  3122. packageName?: string;
  3123. /**
  3124. * Version requirement from module in share scope.
  3125. */
  3126. requiredVersion?: string | false;
  3127. /**
  3128. * Module is looked up under this key from the share scope.
  3129. */
  3130. shareKey?: string;
  3131. /**
  3132. * Share scope name.
  3133. */
  3134. shareScope?: string;
  3135. /**
  3136. * Allow only a single version of the shared module in share scope (disabled by default).
  3137. */
  3138. singleton?: boolean;
  3139. /**
  3140. * 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).
  3141. */
  3142. strictVersion?: boolean;
  3143. }
  3144. /**
  3145. * 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.
  3146. */
  3147. declare interface ConsumesObject {
  3148. [index: string]: string | ConsumesConfig;
  3149. }
  3150. type ContainerOptionsFormat<T> = Item<T> | (string | Item<T>)[];
  3151. declare class ContainerPlugin {
  3152. constructor(options: ContainerPluginOptions);
  3153. /**
  3154. * Apply the plugin
  3155. */
  3156. apply(compiler: Compiler): void;
  3157. }
  3158. declare interface ContainerPluginOptions {
  3159. /**
  3160. * 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.
  3161. */
  3162. exposes: Exposes;
  3163. /**
  3164. * The filename for this container relative path inside the `output.path` directory.
  3165. */
  3166. filename?: string;
  3167. /**
  3168. * Options for library.
  3169. */
  3170. library?: LibraryOptions;
  3171. /**
  3172. * The name for this container.
  3173. */
  3174. name: string;
  3175. /**
  3176. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  3177. */
  3178. runtime?: string | false;
  3179. /**
  3180. * The name of the share scope which is shared with the host (defaults to 'default').
  3181. */
  3182. shareScope?: string;
  3183. }
  3184. declare class ContainerReferencePlugin {
  3185. constructor(options: ContainerReferencePluginOptions);
  3186. /**
  3187. * Apply the plugin
  3188. */
  3189. apply(compiler: Compiler): void;
  3190. }
  3191. declare interface ContainerReferencePluginOptions {
  3192. /**
  3193. * The external type of the remote containers.
  3194. */
  3195. remoteType: ExternalsType;
  3196. /**
  3197. * 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.
  3198. */
  3199. remotes: Remotes;
  3200. /**
  3201. * The name of the share scope shared with all remotes (defaults to 'default').
  3202. */
  3203. shareScope?: string;
  3204. }
  3205. declare interface ContextAlternativeRequest {
  3206. context: string;
  3207. request: string;
  3208. }
  3209. declare abstract class ContextDependency extends Dependency {
  3210. options: ContextDependencyOptions;
  3211. userRequest: string;
  3212. critical?: string | false;
  3213. hadGlobalOrStickyRegExp: boolean;
  3214. request?: string;
  3215. range?: [number, number];
  3216. valueRange?: [number, number];
  3217. inShorthand?: string | boolean;
  3218. replaces?: { value: string; range: [number, number] }[];
  3219. }
  3220. type ContextDependencyOptions = ContextOptions & { request: string };
  3221. declare abstract class ContextElementDependency extends ModuleDependency {
  3222. referencedExports?: null | string[][];
  3223. attributes?: ImportAttributes;
  3224. }
  3225. declare class ContextExclusionPlugin {
  3226. constructor(negativeMatcher: RegExp);
  3227. negativeMatcher: RegExp;
  3228. /**
  3229. * Apply the plugin
  3230. */
  3231. apply(compiler: Compiler): void;
  3232. }
  3233. declare interface ContextFileSystemInfoEntry {
  3234. safeTime: number;
  3235. timestampHash?: string;
  3236. resolved?: ResolvedContextFileSystemInfoEntry;
  3237. symlinks?: Set<string>;
  3238. }
  3239. declare interface ContextHash {
  3240. hash: string;
  3241. resolved?: string;
  3242. symlinks?: Set<string>;
  3243. }
  3244. type ContextMode =
  3245. | "weak"
  3246. | "eager"
  3247. | "lazy"
  3248. | "lazy-once"
  3249. | "sync"
  3250. | "async-weak";
  3251. declare abstract class ContextModuleFactory extends ModuleFactory {
  3252. hooks: Readonly<{
  3253. beforeResolve: AsyncSeriesWaterfallHook<
  3254. [BeforeContextResolveData],
  3255. false | void | BeforeContextResolveData
  3256. >;
  3257. afterResolve: AsyncSeriesWaterfallHook<
  3258. [AfterContextResolveData],
  3259. false | void | AfterContextResolveData
  3260. >;
  3261. contextModuleFiles: SyncWaterfallHook<[string[]], string[]>;
  3262. alternatives: FakeHook<
  3263. Pick<
  3264. AsyncSeriesWaterfallHook<
  3265. [ContextAlternativeRequest[]],
  3266. ContextAlternativeRequest[]
  3267. >,
  3268. "name" | "tap" | "tapAsync" | "tapPromise"
  3269. >
  3270. >;
  3271. alternativeRequests: AsyncSeriesWaterfallHook<
  3272. [ContextAlternativeRequest[], ContextModuleOptions],
  3273. ContextAlternativeRequest[]
  3274. >;
  3275. }>;
  3276. resolverFactory: ResolverFactory;
  3277. resolveDependencies(
  3278. fs: InputFileSystem,
  3279. options: ContextModuleOptions,
  3280. callback: (
  3281. err: null | Error,
  3282. dependencies?: ContextElementDependency[]
  3283. ) => void
  3284. ): void;
  3285. }
  3286. type ContextModuleOptions = ContextOptions & ContextModuleOptionsExtras;
  3287. declare interface ContextModuleOptionsExtras {
  3288. resource: string | false | string[];
  3289. resourceQuery?: string;
  3290. resourceFragment?: string;
  3291. resolveOptions?: ResolveOptions;
  3292. }
  3293. declare interface ContextOptions {
  3294. mode: ContextMode;
  3295. recursive: boolean;
  3296. regExp: null | false | RegExp;
  3297. namespaceObject?: boolean | "strict";
  3298. addon?: string;
  3299. chunkName?: null | string;
  3300. include?: null | RegExp;
  3301. exclude?: null | RegExp;
  3302. groupOptions?: RawChunkGroupOptions;
  3303. typePrefix?: string;
  3304. category?: string;
  3305. /**
  3306. * exports referenced from modules (won't be mangled)
  3307. */
  3308. referencedExports?: null | string[][];
  3309. layer?: null | string;
  3310. attributes?: ImportAttributes;
  3311. }
  3312. declare class ContextReplacementPlugin {
  3313. constructor(
  3314. resourceRegExp: RegExp,
  3315. newContentResource?:
  3316. | string
  3317. | boolean
  3318. | RegExp
  3319. | ((context: BeforeContextResolveData | AfterContextResolveData) => void),
  3320. newContentRecursive?: boolean | RegExp | NewContentCreateContextMap,
  3321. newContentRegExp?: RegExp
  3322. );
  3323. resourceRegExp: RegExp;
  3324. newContentCallback?: (
  3325. context: BeforeContextResolveData | AfterContextResolveData
  3326. ) => void;
  3327. newContentResource?: string;
  3328. newContentCreateContextMap?: (
  3329. fs: InputFileSystem,
  3330. callback: (
  3331. err: null | Error,
  3332. newContentRecursive: NewContentCreateContextMap
  3333. ) => void
  3334. ) => void;
  3335. newContentRecursive?: boolean;
  3336. newContentRegExp?: RegExp;
  3337. /**
  3338. * Apply the plugin
  3339. */
  3340. apply(compiler: Compiler): void;
  3341. }
  3342. declare interface ContextResolveData {
  3343. context: string;
  3344. request: string;
  3345. resolveOptions?: ResolveOptions;
  3346. fileDependencies: LazySet<string>;
  3347. missingDependencies: LazySet<string>;
  3348. contextDependencies: LazySet<string>;
  3349. dependencies: ContextDependency[];
  3350. }
  3351. type ContextTimestamp = null | ContextFileSystemInfoEntry | "ignore";
  3352. declare interface ContextTimestampAndHash {
  3353. safeTime: number;
  3354. timestampHash?: string;
  3355. hash: string;
  3356. resolved?: ResolvedContextTimestampAndHash;
  3357. symlinks?: Set<string>;
  3358. }
  3359. type CreateReadStreamFSImplementation = FSImplementation & {
  3360. read: (...args: any[]) => any;
  3361. };
  3362. type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
  3363. Record<string, any>;
  3364. type CreateWriteStreamFSImplementation = FSImplementation & {
  3365. write: (...args: any[]) => any;
  3366. close?: (...args: any[]) => any;
  3367. };
  3368. declare interface CreatedObject<T, F> {}
  3369. declare interface CssData {
  3370. /**
  3371. * whether export __esModule
  3372. */
  3373. esModule: boolean;
  3374. /**
  3375. * the css exports
  3376. */
  3377. exports: Map<string, string>;
  3378. }
  3379. declare abstract class CssGenerator extends Generator {
  3380. options: CssModuleGeneratorOptions;
  3381. sourceDependency(
  3382. module: NormalModule,
  3383. dependency: Dependency,
  3384. initFragments: InitFragment<GenerateContext>[],
  3385. source: ReplaceSource,
  3386. generateContext: GenerateContext & { cssData: CssData }
  3387. ): void;
  3388. sourceModule(
  3389. module: NormalModule,
  3390. initFragments: InitFragment<GenerateContext>[],
  3391. source: ReplaceSource,
  3392. generateContext: GenerateContext & { cssData: CssData }
  3393. ): void;
  3394. generateError(
  3395. error: Error,
  3396. module: NormalModule,
  3397. generateContext: GenerateContext
  3398. ): null | Source;
  3399. }
  3400. /**
  3401. * Generator options for css modules.
  3402. */
  3403. declare interface CssGeneratorOptions {
  3404. /**
  3405. * Configure the generated JS modules that use the ES modules syntax.
  3406. */
  3407. esModule?: boolean;
  3408. /**
  3409. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3410. */
  3411. exportsOnly?: boolean;
  3412. }
  3413. declare interface CssImportDependencyMeta {
  3414. layer?: string;
  3415. supports?: string;
  3416. media?: string;
  3417. }
  3418. type CssLayer = undefined | string;
  3419. declare class CssLoadingRuntimeModule extends RuntimeModule {
  3420. constructor(runtimeRequirements: ReadonlySet<string>);
  3421. static getCompilationHooks(
  3422. compilation: Compilation
  3423. ): CssLoadingRuntimeModulePluginHooks;
  3424. /**
  3425. * Runtime modules without any dependencies to other runtime modules
  3426. */
  3427. static STAGE_NORMAL: number;
  3428. /**
  3429. * Runtime modules with simple dependencies on other runtime modules
  3430. */
  3431. static STAGE_BASIC: number;
  3432. /**
  3433. * Runtime modules which attach to handlers of other runtime modules
  3434. */
  3435. static STAGE_ATTACH: number;
  3436. /**
  3437. * Runtime modules which trigger actions on bootstrap
  3438. */
  3439. static STAGE_TRIGGER: number;
  3440. }
  3441. declare interface CssLoadingRuntimeModulePluginHooks {
  3442. createStylesheet: SyncWaterfallHook<[string, Chunk], string>;
  3443. linkPreload: SyncWaterfallHook<[string, Chunk], string>;
  3444. linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
  3445. }
  3446. declare abstract class CssModule extends NormalModule {
  3447. cssLayer: CssLayer;
  3448. supports: Supports;
  3449. media: Media;
  3450. inheritance?: [CssLayer, Supports, Media][];
  3451. }
  3452. /**
  3453. * Generator options for css/module modules.
  3454. */
  3455. declare interface CssModuleGeneratorOptions {
  3456. /**
  3457. * Configure the generated JS modules that use the ES modules syntax.
  3458. */
  3459. esModule?: boolean;
  3460. /**
  3461. * Configure how CSS content is exported as default.
  3462. */
  3463. exportType?: "link" | "text" | "css-style-sheet";
  3464. /**
  3465. * Specifies the convention of exported names.
  3466. */
  3467. exportsConvention?:
  3468. | "as-is"
  3469. | "camel-case"
  3470. | "camel-case-only"
  3471. | "dashes"
  3472. | "dashes-only"
  3473. | ((name: string) => string);
  3474. /**
  3475. * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
  3476. */
  3477. exportsOnly?: boolean;
  3478. /**
  3479. * Digest types used for the hash.
  3480. */
  3481. localIdentHashDigest?: string;
  3482. /**
  3483. * Number of chars which are used for the hash.
  3484. */
  3485. localIdentHashDigestLength?: number;
  3486. /**
  3487. * Any string which is added to the hash to salt it.
  3488. */
  3489. localIdentHashSalt?: string;
  3490. /**
  3491. * Configure the generated local ident name.
  3492. */
  3493. localIdentName?: string;
  3494. }
  3495. /**
  3496. * Parser options for css/module modules.
  3497. */
  3498. declare interface CssModuleParserOptions {
  3499. /**
  3500. * Enable/disable renaming of `@keyframes`.
  3501. */
  3502. animation?: boolean;
  3503. /**
  3504. * Enable/disable renaming of `@container` names.
  3505. */
  3506. container?: boolean;
  3507. /**
  3508. * Enable/disable renaming of custom identifiers.
  3509. */
  3510. customIdents?: boolean;
  3511. /**
  3512. * Enable/disable renaming of dashed identifiers, e. g. custom properties.
  3513. */
  3514. dashedIdents?: boolean;
  3515. /**
  3516. * Configure how CSS content is exported as default.
  3517. */
  3518. exportType?: "link" | "text" | "css-style-sheet";
  3519. /**
  3520. * Enable/disable renaming of `@function` names.
  3521. */
  3522. function?: boolean;
  3523. /**
  3524. * Enable/disable renaming of grid identifiers.
  3525. */
  3526. grid?: boolean;
  3527. /**
  3528. * Enable/disable `@import` at-rules handling.
  3529. */
  3530. import?: boolean;
  3531. /**
  3532. * Use ES modules named export for css exports.
  3533. */
  3534. namedExports?: boolean;
  3535. /**
  3536. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3537. */
  3538. url?: boolean;
  3539. }
  3540. declare class CssModulesPlugin {
  3541. constructor();
  3542. /**
  3543. * Apply the plugin
  3544. */
  3545. apply(compiler: Compiler): void;
  3546. getModulesInOrder(
  3547. chunk: Chunk,
  3548. modules: Iterable<Module>,
  3549. compilation: Compilation
  3550. ): Module[];
  3551. getOrderedChunkCssModules(
  3552. chunk: Chunk,
  3553. chunkGraph: ChunkGraph,
  3554. compilation: Compilation
  3555. ): Module[];
  3556. renderChunk(
  3557. __0: RenderContextCssModulesPlugin,
  3558. hooks: CompilationHooksCssModulesPlugin
  3559. ): Source;
  3560. static getCompilationHooks(
  3561. compilation: Compilation
  3562. ): CompilationHooksCssModulesPlugin;
  3563. static renderModule(
  3564. module: CssModule,
  3565. renderContext: ChunkRenderContextCssModulesPlugin,
  3566. hooks: CompilationHooksCssModulesPlugin
  3567. ): null | Source;
  3568. static getChunkFilenameTemplate(
  3569. chunk: Chunk,
  3570. outputOptions: OutputNormalizedWithDefaults
  3571. ): TemplatePath;
  3572. static chunkHasCss(chunk: Chunk, chunkGraph: ChunkGraph): boolean;
  3573. }
  3574. declare abstract class CssParser extends ParserClass {
  3575. defaultMode: "global" | "auto" | "pure" | "local";
  3576. options: {
  3577. /**
  3578. * Enable/disable renaming of `@keyframes`.
  3579. */
  3580. animation: boolean;
  3581. /**
  3582. * Enable/disable renaming of `@container` names.
  3583. */
  3584. container: boolean;
  3585. /**
  3586. * Enable/disable renaming of custom identifiers.
  3587. */
  3588. customIdents: boolean;
  3589. /**
  3590. * Enable/disable renaming of dashed identifiers, e. g. custom properties.
  3591. */
  3592. dashedIdents: boolean;
  3593. /**
  3594. * Configure how CSS content is exported as default.
  3595. */
  3596. exportType?: "link" | "text" | "css-style-sheet";
  3597. /**
  3598. * Enable/disable renaming of `@function` names.
  3599. */
  3600. function: boolean;
  3601. /**
  3602. * Enable/disable renaming of grid identifiers.
  3603. */
  3604. grid: boolean;
  3605. /**
  3606. * Enable/disable `@import` at-rules handling.
  3607. */
  3608. import: boolean;
  3609. /**
  3610. * Use ES modules named export for css exports.
  3611. */
  3612. namedExports: boolean;
  3613. /**
  3614. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3615. */
  3616. url: boolean;
  3617. /**
  3618. * default mode
  3619. */
  3620. defaultMode?: "global" | "auto" | "pure" | "local";
  3621. };
  3622. comments?: CommentCssParser[];
  3623. magicCommentContext: Context;
  3624. getComments(range: [number, number]): CommentCssParser[];
  3625. parseCommentOptions(range: [number, number]): {
  3626. options: null | Record<string, any>;
  3627. errors: null | (Error & { comment: CommentCssParser })[];
  3628. };
  3629. }
  3630. /**
  3631. * Parser options for css modules.
  3632. */
  3633. declare interface CssParserOptions {
  3634. /**
  3635. * Configure how CSS content is exported as default.
  3636. */
  3637. exportType?: "link" | "text" | "css-style-sheet";
  3638. /**
  3639. * Enable/disable `@import` at-rules handling.
  3640. */
  3641. import?: boolean;
  3642. /**
  3643. * Use ES modules named export for css exports.
  3644. */
  3645. namedExports?: boolean;
  3646. /**
  3647. * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
  3648. */
  3649. url?: boolean;
  3650. }
  3651. type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
  3652. declare class DefinePlugin {
  3653. /**
  3654. * Create a new define plugin
  3655. */
  3656. constructor(definitions: Record<string, CodeValue>);
  3657. definitions: Record<string, CodeValue>;
  3658. /**
  3659. * Apply the plugin
  3660. */
  3661. apply(compiler: Compiler): void;
  3662. static getCompilationHooks(compilation: Compilation): DefinePluginHooks;
  3663. static runtimeValue(
  3664. fn: (value: {
  3665. module: NormalModule;
  3666. key: string;
  3667. readonly version: ValueCacheVersion;
  3668. }) => CodeValuePrimitive,
  3669. options?: true | string[] | RuntimeValueOptions
  3670. ): RuntimeValue;
  3671. }
  3672. declare interface DefinePluginHooks {
  3673. definitions: SyncWaterfallHook<
  3674. [Record<string, CodeValue>],
  3675. Record<string, CodeValue>
  3676. >;
  3677. }
  3678. declare class DelegatedPlugin {
  3679. constructor(options: Options);
  3680. options: Options;
  3681. /**
  3682. * Apply the plugin
  3683. */
  3684. apply(compiler: Compiler): void;
  3685. }
  3686. declare abstract class DependenciesBlock {
  3687. dependencies: Dependency[];
  3688. blocks: AsyncDependenciesBlock[];
  3689. parent?: DependenciesBlock;
  3690. getRootBlock(): DependenciesBlock;
  3691. /**
  3692. * Adds a DependencyBlock to DependencyBlock relationship.
  3693. * This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
  3694. */
  3695. addBlock(block: AsyncDependenciesBlock): void;
  3696. addDependency(dependency: Dependency): void;
  3697. removeDependency(dependency: Dependency): void;
  3698. /**
  3699. * Removes all dependencies and blocks
  3700. */
  3701. clearDependenciesAndBlocks(): void;
  3702. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3703. serialize(__0: ObjectSerializerContext): void;
  3704. deserialize(__0: ObjectDeserializerContext): void;
  3705. }
  3706. declare interface DependenciesBlockLike {
  3707. dependencies: Dependency[];
  3708. blocks: AsyncDependenciesBlock[];
  3709. }
  3710. declare class Dependency {
  3711. constructor();
  3712. weak: boolean;
  3713. optional?: boolean;
  3714. get type(): string;
  3715. get category(): string;
  3716. loc: DependencyLocation;
  3717. setLoc(
  3718. startLine: number,
  3719. startColumn: number,
  3720. endLine: number,
  3721. endColumn: number
  3722. ): void;
  3723. getContext(): undefined | string;
  3724. getResourceIdentifier(): null | string;
  3725. couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
  3726. /**
  3727. * Returns the referenced module and export
  3728. */
  3729. getReference(moduleGraph: ModuleGraph): never;
  3730. /**
  3731. * Returns list of exports referenced by this dependency
  3732. */
  3733. getReferencedExports(
  3734. moduleGraph: ModuleGraph,
  3735. runtime: RuntimeSpec
  3736. ): (string[] | ReferencedExport)[];
  3737. getCondition(
  3738. moduleGraph: ModuleGraph
  3739. ):
  3740. | null
  3741. | false
  3742. | ((
  3743. moduleGraphConnection: ModuleGraphConnection,
  3744. runtime: RuntimeSpec
  3745. ) => ConnectionState);
  3746. /**
  3747. * Returns the exported names
  3748. */
  3749. getExports(moduleGraph: ModuleGraph): undefined | ExportsSpec;
  3750. /**
  3751. * Returns warnings
  3752. */
  3753. getWarnings(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3754. /**
  3755. * Returns errors
  3756. */
  3757. getErrors(moduleGraph: ModuleGraph): undefined | null | WebpackError[];
  3758. /**
  3759. * Update the hash
  3760. */
  3761. updateHash(hash: Hash, context: UpdateHashContextDependency): void;
  3762. /**
  3763. * implement this method to allow the occurrence order plugin to count correctly
  3764. */
  3765. getNumberOfIdOccurrences(): number;
  3766. getModuleEvaluationSideEffectsState(
  3767. moduleGraph: ModuleGraph
  3768. ): ConnectionState;
  3769. createIgnoredModule(context: string): Module;
  3770. serialize(__0: ObjectSerializerContext): void;
  3771. deserialize(__0: ObjectDeserializerContext): void;
  3772. module: any;
  3773. get disconnect(): any;
  3774. static NO_EXPORTS_REFERENCED: string[][];
  3775. static EXPORTS_OBJECT_REFERENCED: string[][];
  3776. static isLowPriorityDependency(dependency: Dependency): boolean;
  3777. static TRANSITIVE: typeof TRANSITIVE;
  3778. }
  3779. declare interface DependencyConstructor {
  3780. new (...args: any[]): Dependency;
  3781. }
  3782. type DependencyLocation = SyntheticDependencyLocation | RealDependencyLocation;
  3783. declare interface DependencySourceOrder {
  3784. /**
  3785. * the main source order
  3786. */
  3787. main: number;
  3788. /**
  3789. * the sub source order
  3790. */
  3791. sub: number;
  3792. }
  3793. declare class DependencyTemplate {
  3794. constructor();
  3795. apply(
  3796. dependency: Dependency,
  3797. source: ReplaceSource,
  3798. templateContext: DependencyTemplateContext
  3799. ): void;
  3800. }
  3801. declare interface DependencyTemplateContext {
  3802. /**
  3803. * the runtime template
  3804. */
  3805. runtimeTemplate: RuntimeTemplate;
  3806. /**
  3807. * the dependency templates
  3808. */
  3809. dependencyTemplates: DependencyTemplates;
  3810. /**
  3811. * the module graph
  3812. */
  3813. moduleGraph: ModuleGraph;
  3814. /**
  3815. * the chunk graph
  3816. */
  3817. chunkGraph: ChunkGraph;
  3818. /**
  3819. * the requirements for runtime
  3820. */
  3821. runtimeRequirements: Set<string>;
  3822. /**
  3823. * current module
  3824. */
  3825. module: Module;
  3826. /**
  3827. * current runtimes, for which code is generated
  3828. */
  3829. runtime: RuntimeSpec;
  3830. /**
  3831. * mutable array of init fragments for the current module
  3832. */
  3833. initFragments: InitFragment<GenerateContext>[];
  3834. /**
  3835. * when in a concatenated module, information about other concatenated modules
  3836. */
  3837. concatenationScope?: ConcatenationScope;
  3838. /**
  3839. * the code generation results
  3840. */
  3841. codeGenerationResults: CodeGenerationResults;
  3842. /**
  3843. * chunkInitFragments
  3844. */
  3845. chunkInitFragments: InitFragment<GenerateContext>[];
  3846. }
  3847. declare abstract class DependencyTemplates {
  3848. get(dependency: DependencyConstructor): undefined | DependencyTemplate;
  3849. set(
  3850. dependency: DependencyConstructor,
  3851. dependencyTemplate: DependencyTemplate
  3852. ): void;
  3853. updateHash(part: string): void;
  3854. getHash(): string;
  3855. clone(): DependencyTemplates;
  3856. }
  3857. /**
  3858. * Helper function for joining two ranges into a single range. This is useful
  3859. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  3860. * to create the range of the _parent node_.
  3861. */
  3862. declare interface DestructuringAssignmentProperty {
  3863. id: string;
  3864. range: [number, number];
  3865. loc: SourceLocation;
  3866. pattern?: Set<DestructuringAssignmentProperty>;
  3867. shorthand: string | boolean;
  3868. }
  3869. declare class DeterministicChunkIdsPlugin {
  3870. constructor(options?: DeterministicChunkIdsPluginOptions);
  3871. options: DeterministicChunkIdsPluginOptions;
  3872. /**
  3873. * Apply the plugin
  3874. */
  3875. apply(compiler: Compiler): void;
  3876. }
  3877. declare interface DeterministicChunkIdsPluginOptions {
  3878. /**
  3879. * context for ids
  3880. */
  3881. context?: string;
  3882. /**
  3883. * maximum length of ids
  3884. */
  3885. maxLength?: number;
  3886. }
  3887. declare class DeterministicModuleIdsPlugin {
  3888. constructor(options?: DeterministicModuleIdsPluginOptions);
  3889. options: DeterministicModuleIdsPluginOptions;
  3890. /**
  3891. * Apply the plugin
  3892. */
  3893. apply(compiler: Compiler): void;
  3894. }
  3895. declare interface DeterministicModuleIdsPluginOptions {
  3896. /**
  3897. * context relative to which module identifiers are computed
  3898. */
  3899. context?: string;
  3900. /**
  3901. * selector function for modules
  3902. */
  3903. test?: (module: Module) => boolean;
  3904. /**
  3905. * maximum id length in digits (used as starting point)
  3906. */
  3907. maxLength?: number;
  3908. /**
  3909. * hash salt for ids
  3910. */
  3911. salt?: number;
  3912. /**
  3913. * do not increase the maxLength to find an optimal id space size
  3914. */
  3915. fixedLength?: boolean;
  3916. /**
  3917. * throw an error when id conflicts occur (instead of rehashing)
  3918. */
  3919. failOnConflict?: boolean;
  3920. }
  3921. type DevtoolModuleFilenameTemplate =
  3922. | string
  3923. | ((context: ModuleFilenameTemplateContext) => string);
  3924. declare interface Dirent<T extends string | Buffer = string> {
  3925. /**
  3926. * true when is file, otherwise false
  3927. */
  3928. isFile: () => boolean;
  3929. /**
  3930. * true when is directory, otherwise false
  3931. */
  3932. isDirectory: () => boolean;
  3933. /**
  3934. * true when is block device, otherwise false
  3935. */
  3936. isBlockDevice: () => boolean;
  3937. /**
  3938. * true when is character device, otherwise false
  3939. */
  3940. isCharacterDevice: () => boolean;
  3941. /**
  3942. * true when is symbolic link, otherwise false
  3943. */
  3944. isSymbolicLink: () => boolean;
  3945. /**
  3946. * true when is FIFO, otherwise false
  3947. */
  3948. isFIFO: () => boolean;
  3949. /**
  3950. * true when is socket, otherwise false
  3951. */
  3952. isSocket: () => boolean;
  3953. /**
  3954. * name
  3955. */
  3956. name: T;
  3957. /**
  3958. * path
  3959. */
  3960. parentPath: string;
  3961. /**
  3962. * path
  3963. */
  3964. path?: string;
  3965. }
  3966. declare interface Disposable {
  3967. [Symbol.dispose](): void;
  3968. }
  3969. declare class DllPlugin {
  3970. constructor(options: DllPluginOptions);
  3971. options: {
  3972. entryOnly: boolean;
  3973. /**
  3974. * Context of requests in the manifest file (defaults to the webpack context).
  3975. */
  3976. context?: string;
  3977. /**
  3978. * If true, manifest json file (output) will be formatted.
  3979. */
  3980. format?: boolean;
  3981. /**
  3982. * Name of the exposed dll function (external name, use value of 'output.library').
  3983. */
  3984. name?: string;
  3985. /**
  3986. * Absolute path to the manifest json file (output).
  3987. */
  3988. path: string;
  3989. /**
  3990. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  3991. */
  3992. type?: string;
  3993. };
  3994. /**
  3995. * Apply the plugin
  3996. */
  3997. apply(compiler: Compiler): void;
  3998. }
  3999. declare interface DllPluginOptions {
  4000. /**
  4001. * Context of requests in the manifest file (defaults to the webpack context).
  4002. */
  4003. context?: string;
  4004. /**
  4005. * If true, only entry points will be exposed (default: true).
  4006. */
  4007. entryOnly?: boolean;
  4008. /**
  4009. * If true, manifest json file (output) will be formatted.
  4010. */
  4011. format?: boolean;
  4012. /**
  4013. * Name of the exposed dll function (external name, use value of 'output.library').
  4014. */
  4015. name?: string;
  4016. /**
  4017. * Absolute path to the manifest json file (output).
  4018. */
  4019. path: string;
  4020. /**
  4021. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  4022. */
  4023. type?: string;
  4024. }
  4025. declare class DllReferencePlugin {
  4026. constructor(options: DllReferencePluginOptions);
  4027. options: DllReferencePluginOptions;
  4028. /**
  4029. * Apply the plugin
  4030. */
  4031. apply(compiler: Compiler): void;
  4032. }
  4033. type DllReferencePluginOptions =
  4034. | {
  4035. /**
  4036. * Context of requests in the manifest (or content property) as absolute path.
  4037. */
  4038. context?: string;
  4039. /**
  4040. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  4041. */
  4042. extensions?: string[];
  4043. /**
  4044. * An object containing content and name or a string to the absolute path of the JSON manifest to be loaded upon compilation.
  4045. */
  4046. manifest: string | DllReferencePluginOptionsManifest;
  4047. /**
  4048. * The name where the dll is exposed (external name, defaults to manifest.name).
  4049. */
  4050. name?: string;
  4051. /**
  4052. * Prefix which is used for accessing the content of the dll.
  4053. */
  4054. scope?: string;
  4055. /**
  4056. * How the dll is exposed (libraryTarget, defaults to manifest.type).
  4057. */
  4058. sourceType?:
  4059. | "var"
  4060. | "assign"
  4061. | "this"
  4062. | "window"
  4063. | "global"
  4064. | "commonjs"
  4065. | "commonjs2"
  4066. | "commonjs-module"
  4067. | "amd"
  4068. | "amd-require"
  4069. | "umd"
  4070. | "umd2"
  4071. | "jsonp"
  4072. | "system";
  4073. /**
  4074. * The way how the export of the dll bundle is used.
  4075. */
  4076. type?: "object" | "require";
  4077. }
  4078. | {
  4079. /**
  4080. * The mappings from request to module info.
  4081. */
  4082. content: DllReferencePluginOptionsContent;
  4083. /**
  4084. * Context of requests in the manifest (or content property) as absolute path.
  4085. */
  4086. context?: string;
  4087. /**
  4088. * Extensions used to resolve modules in the dll bundle (only used when using 'scope').
  4089. */
  4090. extensions?: string[];
  4091. /**
  4092. * The name where the dll is exposed (external name).
  4093. */
  4094. name: string;
  4095. /**
  4096. * Prefix which is used for accessing the content of the dll.
  4097. */
  4098. scope?: string;
  4099. /**
  4100. * How the dll is exposed (libraryTarget).
  4101. */
  4102. sourceType?:
  4103. | "var"
  4104. | "assign"
  4105. | "this"
  4106. | "window"
  4107. | "global"
  4108. | "commonjs"
  4109. | "commonjs2"
  4110. | "commonjs-module"
  4111. | "amd"
  4112. | "amd-require"
  4113. | "umd"
  4114. | "umd2"
  4115. | "jsonp"
  4116. | "system";
  4117. /**
  4118. * The way how the export of the dll bundle is used.
  4119. */
  4120. type?: "object" | "require";
  4121. };
  4122. /**
  4123. * The mappings from request to module info.
  4124. */
  4125. declare interface DllReferencePluginOptionsContent {
  4126. [index: string]: {
  4127. /**
  4128. * Meta information about the module.
  4129. */
  4130. buildMeta?: { [index: string]: any };
  4131. /**
  4132. * Information about the provided exports of the module.
  4133. */
  4134. exports?: true | string[];
  4135. /**
  4136. * Module ID.
  4137. */
  4138. id: string | number;
  4139. };
  4140. }
  4141. /**
  4142. * An object containing content, name and type.
  4143. */
  4144. declare interface DllReferencePluginOptionsManifest {
  4145. /**
  4146. * The mappings from request to module info.
  4147. */
  4148. content: DllReferencePluginOptionsContent;
  4149. /**
  4150. * The name where the dll is exposed (external name).
  4151. */
  4152. name?: string;
  4153. /**
  4154. * The type how the dll is exposed (external type).
  4155. */
  4156. type?:
  4157. | "var"
  4158. | "assign"
  4159. | "this"
  4160. | "window"
  4161. | "global"
  4162. | "commonjs"
  4163. | "commonjs2"
  4164. | "commonjs-module"
  4165. | "amd"
  4166. | "amd-require"
  4167. | "umd"
  4168. | "umd2"
  4169. | "jsonp"
  4170. | "system";
  4171. }
  4172. declare class DotenvPlugin {
  4173. constructor(options?: DotenvPluginOptions);
  4174. options: {
  4175. /**
  4176. * The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.
  4177. */
  4178. dir?: string | false;
  4179. /**
  4180. * Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.
  4181. */
  4182. prefix?: string | string[];
  4183. /**
  4184. * Template patterns for .env file names. Use [mode] as placeholder for the webpack mode. Defaults to ['.env', '.env.local', '.env.[mode]', '.env.[mode].local'].
  4185. */
  4186. template?: string[];
  4187. };
  4188. apply(compiler: Compiler): void;
  4189. }
  4190. /**
  4191. * Options for Dotenv plugin.
  4192. */
  4193. declare interface DotenvPluginOptions {
  4194. /**
  4195. * The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.
  4196. */
  4197. dir?: string | false;
  4198. /**
  4199. * Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.
  4200. */
  4201. prefix?: string | string[];
  4202. /**
  4203. * Template patterns for .env file names. Use [mode] as placeholder for the webpack mode. Defaults to ['.env', '.env.local', '.env.[mode]', '.env.[mode].local'].
  4204. */
  4205. template?: string[];
  4206. }
  4207. declare class DynamicEntryPlugin {
  4208. constructor(context: string, entry: () => Promise<EntryStaticNormalized>);
  4209. context: string;
  4210. entry: () => Promise<EntryStaticNormalized>;
  4211. /**
  4212. * Apply the plugin
  4213. */
  4214. apply(compiler: Compiler): void;
  4215. }
  4216. type Effect = EffectUse | EffectBasic;
  4217. declare interface EffectBasic {
  4218. type: string;
  4219. value: any;
  4220. }
  4221. declare interface EffectData {
  4222. resource?: string;
  4223. realResource?: string;
  4224. resourceQuery?: string;
  4225. resourceFragment?: string;
  4226. scheme?: string;
  4227. attributes?: ImportAttributes;
  4228. mimetype?: string;
  4229. dependency: string;
  4230. descriptionData?: JsonObjectTypes;
  4231. compiler?: string;
  4232. issuer: string;
  4233. issuerLayer: string;
  4234. }
  4235. declare interface EffectUse {
  4236. type: EffectUseType;
  4237. value: {
  4238. loader: string;
  4239. options?: null | string | Record<string, any>;
  4240. ident?: string;
  4241. };
  4242. }
  4243. type EffectUseType = "use" | "use-pre" | "use-post";
  4244. declare class ElectronTargetPlugin {
  4245. constructor(context?: "main" | "preload" | "renderer");
  4246. /**
  4247. * Apply the plugin
  4248. */
  4249. apply(compiler: Compiler): void;
  4250. }
  4251. /**
  4252. * No generator options are supported for this module type.
  4253. */
  4254. declare interface EmptyGeneratorOptions {}
  4255. /**
  4256. * No parser options are supported for this module type.
  4257. */
  4258. declare interface EmptyParserOptions {}
  4259. declare class EnableChunkLoadingPlugin {
  4260. constructor(type: string);
  4261. type: string;
  4262. /**
  4263. * Apply the plugin
  4264. */
  4265. apply(compiler: Compiler): void;
  4266. static setEnabled(compiler: Compiler, type: string): void;
  4267. static checkEnabled(compiler: Compiler, type: string): void;
  4268. }
  4269. declare class EnableLibraryPlugin {
  4270. constructor(type: string, options?: EnableLibraryPluginOptions);
  4271. type: string;
  4272. options: EnableLibraryPluginOptions;
  4273. /**
  4274. * Apply the plugin
  4275. */
  4276. apply(compiler: Compiler): void;
  4277. static setEnabled(compiler: Compiler, type: string): void;
  4278. static checkEnabled(compiler: Compiler, type: string): void;
  4279. }
  4280. declare interface EnableLibraryPluginOptions {
  4281. /**
  4282. * function that runs when applying the current plugin.
  4283. */
  4284. additionalApply?: () => void;
  4285. }
  4286. declare class EnableWasmLoadingPlugin {
  4287. constructor(type: string);
  4288. type: string;
  4289. /**
  4290. * Apply the plugin
  4291. */
  4292. apply(compiler: Compiler): void;
  4293. static setEnabled(compiler: Compiler, type: string): void;
  4294. static checkEnabled(compiler: Compiler, type: string): void;
  4295. }
  4296. type EncodingOption =
  4297. | undefined
  4298. | null
  4299. | "ascii"
  4300. | "utf8"
  4301. | "utf-8"
  4302. | "utf16le"
  4303. | "utf-16le"
  4304. | "ucs2"
  4305. | "ucs-2"
  4306. | "base64"
  4307. | "base64url"
  4308. | "latin1"
  4309. | "binary"
  4310. | "hex"
  4311. | ObjectEncodingOptions;
  4312. type Entry =
  4313. | string
  4314. | (() => string | EntryObject | string[] | Promise<EntryStatic>)
  4315. | EntryObject
  4316. | string[];
  4317. declare interface EntryData {
  4318. /**
  4319. * dependencies of the entrypoint that should be evaluated at startup
  4320. */
  4321. dependencies: Dependency[];
  4322. /**
  4323. * dependencies of the entrypoint that should be included but not evaluated
  4324. */
  4325. includeDependencies: Dependency[];
  4326. /**
  4327. * options of the entrypoint
  4328. */
  4329. options: EntryOptions;
  4330. }
  4331. declare abstract class EntryDependency extends ModuleDependency {}
  4332. /**
  4333. * An object with entry point description.
  4334. */
  4335. declare interface EntryDescription {
  4336. /**
  4337. * Enable/disable creating async chunks that are loaded on demand.
  4338. */
  4339. asyncChunks?: boolean;
  4340. /**
  4341. * Base uri for this entry.
  4342. */
  4343. baseUri?: string;
  4344. /**
  4345. * 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).
  4346. */
  4347. chunkLoading?: string | false;
  4348. /**
  4349. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  4350. */
  4351. dependOn?: string | string[];
  4352. /**
  4353. * 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.
  4354. */
  4355. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4356. /**
  4357. * Module(s) that are loaded upon startup.
  4358. */
  4359. import: EntryItem;
  4360. /**
  4361. * Specifies the layer in which modules of this entrypoint are placed.
  4362. */
  4363. layer?: null | string;
  4364. /**
  4365. * Options for library.
  4366. */
  4367. library?: LibraryOptions;
  4368. /**
  4369. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  4370. */
  4371. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4372. /**
  4373. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  4374. */
  4375. runtime?: string | false;
  4376. /**
  4377. * 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).
  4378. */
  4379. wasmLoading?: string | false;
  4380. }
  4381. /**
  4382. * An object with entry point description.
  4383. */
  4384. declare interface EntryDescriptionNormalized {
  4385. /**
  4386. * Enable/disable creating async chunks that are loaded on demand.
  4387. */
  4388. asyncChunks?: boolean;
  4389. /**
  4390. * Base uri for this entry.
  4391. */
  4392. baseUri?: string;
  4393. /**
  4394. * 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).
  4395. */
  4396. chunkLoading?: string | false;
  4397. /**
  4398. * The entrypoints that the current entrypoint depend on. They must be loaded when this entrypoint is loaded.
  4399. */
  4400. dependOn?: string[];
  4401. /**
  4402. * 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.
  4403. */
  4404. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4405. /**
  4406. * Module(s) that are loaded upon startup. The last one is exported.
  4407. */
  4408. import?: string[];
  4409. /**
  4410. * Specifies the layer in which modules of this entrypoint are placed.
  4411. */
  4412. layer?: null | string;
  4413. /**
  4414. * Options for library.
  4415. */
  4416. library?: LibraryOptions;
  4417. /**
  4418. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  4419. */
  4420. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  4421. /**
  4422. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  4423. */
  4424. runtime?: string | false;
  4425. /**
  4426. * 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).
  4427. */
  4428. wasmLoading?: string | false;
  4429. }
  4430. type EntryItem = string | string[];
  4431. type EntryNormalized =
  4432. | (() => Promise<EntryStaticNormalized>)
  4433. | EntryStaticNormalized;
  4434. /**
  4435. * Multiple entry bundles are created. The key is the entry name. The value can be a string, an array or an entry description object.
  4436. */
  4437. declare interface EntryObject {
  4438. [index: string]: string | string[] | EntryDescription;
  4439. }
  4440. declare class EntryOptionPlugin {
  4441. constructor();
  4442. apply(compiler: Compiler): void;
  4443. static applyEntryOption(
  4444. compiler: Compiler,
  4445. context: string,
  4446. entry: EntryNormalized
  4447. ): void;
  4448. static entryDescriptionToOptions(
  4449. compiler: Compiler,
  4450. name: string,
  4451. desc: EntryDescriptionNormalized
  4452. ): EntryOptions;
  4453. }
  4454. type EntryOptions = { name?: string } & Omit<
  4455. EntryDescriptionNormalized,
  4456. "import"
  4457. >;
  4458. declare class EntryPlugin {
  4459. /**
  4460. * An entry plugin which will handle creation of the EntryDependency
  4461. */
  4462. constructor(context: string, entry: string, options?: string | EntryOptions);
  4463. context: string;
  4464. entry: string;
  4465. options: string | EntryOptions;
  4466. /**
  4467. * Apply the plugin
  4468. */
  4469. apply(compiler: Compiler): void;
  4470. static createDependency(
  4471. entry: string,
  4472. options: string | EntryOptions
  4473. ): EntryDependency;
  4474. }
  4475. type EntryStatic = string | EntryObject | string[];
  4476. /**
  4477. * Multiple entry bundles are created. The key is the entry name. The value is an entry description object.
  4478. */
  4479. declare interface EntryStaticNormalized {
  4480. [index: string]: EntryDescriptionNormalized;
  4481. }
  4482. declare abstract class Entrypoint extends ChunkGroup {
  4483. /**
  4484. * Sets the runtimeChunk for an entrypoint.
  4485. */
  4486. setRuntimeChunk(chunk: Chunk): void;
  4487. /**
  4488. * Fetches the chunk reference containing the webpack bootstrap code
  4489. */
  4490. getRuntimeChunk(): null | Chunk;
  4491. /**
  4492. * Sets the chunk with the entrypoint modules for an entrypoint.
  4493. */
  4494. setEntrypointChunk(chunk: Chunk): void;
  4495. /**
  4496. * Returns the chunk which contains the entrypoint modules
  4497. * (or at least the execution of them)
  4498. */
  4499. getEntrypointChunk(): Chunk;
  4500. addDependOn(entrypoint: Entrypoint): void;
  4501. dependOn(entrypoint: Entrypoint): boolean;
  4502. }
  4503. type EnumValue =
  4504. | null
  4505. | string
  4506. | number
  4507. | boolean
  4508. | EnumValueObject
  4509. | EnumValue[];
  4510. declare interface EnumValueObject {
  4511. [index: string]: EnumValue;
  4512. }
  4513. /**
  4514. * The abilities of the environment where the webpack generated code should run.
  4515. */
  4516. declare interface Environment {
  4517. /**
  4518. * The environment supports arrow functions ('() => { ... }').
  4519. */
  4520. arrowFunction?: boolean;
  4521. /**
  4522. * The environment supports async function and await ('async function () { await ... }').
  4523. */
  4524. asyncFunction?: boolean;
  4525. /**
  4526. * The environment supports BigInt as literal (123n).
  4527. */
  4528. bigIntLiteral?: boolean;
  4529. /**
  4530. * The environment supports const and let for variable declarations.
  4531. */
  4532. const?: boolean;
  4533. /**
  4534. * The environment supports destructuring ('{ a, b } = obj').
  4535. */
  4536. destructuring?: boolean;
  4537. /**
  4538. * The environment supports 'document'.
  4539. */
  4540. document?: boolean;
  4541. /**
  4542. * The environment supports an async import() function to import EcmaScript modules.
  4543. */
  4544. dynamicImport?: boolean;
  4545. /**
  4546. * The environment supports an async import() is available when creating a worker.
  4547. */
  4548. dynamicImportInWorker?: boolean;
  4549. /**
  4550. * The environment supports 'for of' iteration ('for (const x of array) { ... }').
  4551. */
  4552. forOf?: boolean;
  4553. /**
  4554. * The environment supports 'globalThis'.
  4555. */
  4556. globalThis?: boolean;
  4557. /**
  4558. * The environment supports `import.meta.dirname` and `import.meta.filename`.
  4559. */
  4560. importMetaDirnameAndFilename?: boolean;
  4561. /**
  4562. * The environment supports object method shorthand ('{ module() {} }').
  4563. */
  4564. methodShorthand?: boolean;
  4565. /**
  4566. * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
  4567. */
  4568. module?: boolean;
  4569. /**
  4570. * The environment supports `node:` prefix for Node.js core modules.
  4571. */
  4572. nodePrefixForCoreModules?: boolean;
  4573. /**
  4574. * The environment supports optional chaining ('obj?.a' or 'obj?.()').
  4575. */
  4576. optionalChaining?: boolean;
  4577. /**
  4578. * The environment supports template literals.
  4579. */
  4580. templateLiteral?: boolean;
  4581. }
  4582. declare class EnvironmentPlugin {
  4583. constructor(...keys: (string | string[] | Record<string, any>)[]);
  4584. keys: string[];
  4585. defaultValues: Record<string, any>;
  4586. /**
  4587. * Apply the plugin
  4588. */
  4589. apply(compiler: Compiler): void;
  4590. }
  4591. type ErrorWithDetail = Error & { details?: string };
  4592. declare interface Etag {
  4593. toString: () => string;
  4594. }
  4595. declare class EvalDevToolModulePlugin {
  4596. constructor(options?: EvalDevToolModulePluginOptions);
  4597. namespace: string;
  4598. sourceUrlComment: string;
  4599. moduleFilenameTemplate: DevtoolModuleFilenameTemplate;
  4600. /**
  4601. * Apply the plugin
  4602. */
  4603. apply(compiler: Compiler): void;
  4604. }
  4605. declare interface EvalDevToolModulePluginOptions {
  4606. /**
  4607. * namespace
  4608. */
  4609. namespace?: string;
  4610. /**
  4611. * source url comment
  4612. */
  4613. sourceUrlComment?: string;
  4614. /**
  4615. * module filename template
  4616. */
  4617. moduleFilenameTemplate?:
  4618. | string
  4619. | ((context: ModuleFilenameTemplateContext) => string);
  4620. }
  4621. declare class EvalSourceMapDevToolPlugin {
  4622. constructor(inputOptions?: string | SourceMapDevToolPluginOptions);
  4623. sourceMapComment: string;
  4624. moduleFilenameTemplate:
  4625. | string
  4626. | ((context: ModuleFilenameTemplateContext) => string);
  4627. namespace: string;
  4628. options: SourceMapDevToolPluginOptions;
  4629. /**
  4630. * Apply the plugin
  4631. */
  4632. apply(compiler: Compiler): void;
  4633. }
  4634. type ExcludeModulesType = "module" | "chunk" | "root-of-chunk" | "nested";
  4635. declare interface ExecuteModuleArgument {
  4636. module: Module;
  4637. moduleObject?: ExecuteModuleObject;
  4638. codeGenerationResult: CodeGenerationResult;
  4639. }
  4640. declare interface ExecuteModuleContext {
  4641. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4642. chunk: Chunk;
  4643. chunkGraph: ChunkGraph;
  4644. __webpack_require__?: WebpackRequire;
  4645. }
  4646. declare interface ExecuteModuleObject {
  4647. /**
  4648. * module id
  4649. */
  4650. id?: string;
  4651. /**
  4652. * exports
  4653. */
  4654. exports: any;
  4655. /**
  4656. * is loaded
  4657. */
  4658. loaded: boolean;
  4659. /**
  4660. * error
  4661. */
  4662. error?: Error;
  4663. }
  4664. declare interface ExecuteModuleOptions {
  4665. entryOptions?: EntryOptions;
  4666. }
  4667. declare interface ExecuteModuleResult {
  4668. exports: any;
  4669. cacheable: boolean;
  4670. assets: Map<string, { source: Source; info?: AssetInfo }>;
  4671. fileDependencies: LazySet<string>;
  4672. contextDependencies: LazySet<string>;
  4673. missingDependencies: LazySet<string>;
  4674. buildDependencies: LazySet<string>;
  4675. }
  4676. declare interface ExecuteOptions {
  4677. /**
  4678. * module id
  4679. */
  4680. id?: string;
  4681. /**
  4682. * module
  4683. */
  4684. module: ExecuteModuleObject;
  4685. /**
  4686. * require function
  4687. */
  4688. require: WebpackRequire;
  4689. }
  4690. type Experiments = ExperimentsCommon & ExperimentsExtra;
  4691. /**
  4692. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4693. */
  4694. declare interface ExperimentsCommon {
  4695. /**
  4696. * Support WebAssembly as asynchronous EcmaScript Module.
  4697. */
  4698. asyncWebAssembly?: boolean;
  4699. /**
  4700. * Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
  4701. */
  4702. backCompat?: boolean;
  4703. /**
  4704. * Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
  4705. */
  4706. cacheUnaffected?: boolean;
  4707. /**
  4708. * Apply defaults of next major version.
  4709. */
  4710. futureDefaults?: boolean;
  4711. /**
  4712. * Allow output javascript files as module source type.
  4713. */
  4714. outputModule?: boolean;
  4715. /**
  4716. * Support WebAssembly as synchronous EcmaScript Module (outdated).
  4717. */
  4718. syncWebAssembly?: boolean;
  4719. }
  4720. /**
  4721. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4722. */
  4723. declare interface ExperimentsExtra {
  4724. [index: string]: any;
  4725. /**
  4726. * Build http(s): urls using a lockfile and resource content cache.
  4727. */
  4728. buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
  4729. /**
  4730. * Enable css support.
  4731. */
  4732. css?: boolean;
  4733. /**
  4734. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  4735. */
  4736. deferImport?: boolean;
  4737. /**
  4738. * Compile entrypoints and import()s only when they are accessed.
  4739. */
  4740. lazyCompilation?: boolean | LazyCompilationOptions;
  4741. }
  4742. type ExperimentsNormalized = ExperimentsCommon & ExperimentsNormalizedExtra;
  4743. /**
  4744. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  4745. */
  4746. declare interface ExperimentsNormalizedExtra {
  4747. /**
  4748. * Build http(s): urls using a lockfile and resource content cache.
  4749. */
  4750. buildHttp?: HttpUriOptions;
  4751. /**
  4752. * Enable css support.
  4753. */
  4754. css?: boolean;
  4755. /**
  4756. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  4757. */
  4758. deferImport?: boolean;
  4759. /**
  4760. * Compile entrypoints and import()s only when they are accessed.
  4761. */
  4762. lazyCompilation?: false | LazyCompilationOptions;
  4763. }
  4764. declare abstract class ExportInfo {
  4765. name: string;
  4766. /**
  4767. * true: it is provided
  4768. * false: it is not provided
  4769. * null: only the runtime knows if it is provided
  4770. * undefined: it was not determined if it is provided
  4771. */
  4772. provided?: null | boolean;
  4773. /**
  4774. * is the export a terminal binding that should be checked for export star conflicts
  4775. */
  4776. terminalBinding: boolean;
  4777. /**
  4778. * true: it can be mangled
  4779. * false: is can not be mangled
  4780. * undefined: it was not determined if it can be mangled
  4781. */
  4782. canMangleProvide?: boolean;
  4783. /**
  4784. * true: it can be mangled
  4785. * false: is can not be mangled
  4786. * undefined: it was not determined if it can be mangled
  4787. */
  4788. canMangleUse?: boolean;
  4789. exportsInfoOwned: boolean;
  4790. exportsInfo?: ExportsInfo;
  4791. get canMangle(): boolean;
  4792. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4793. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4794. setHasUseInfo(): void;
  4795. setUsedConditionally(
  4796. condition: (condition: UsageStateType) => boolean,
  4797. newValue: UsageStateType,
  4798. runtime: RuntimeSpec
  4799. ): boolean;
  4800. setUsed(newValue: UsageStateType, runtime: RuntimeSpec): boolean;
  4801. unsetTarget(key: Dependency): boolean;
  4802. setTarget(
  4803. key: Dependency,
  4804. connection: ModuleGraphConnection,
  4805. exportName?: null | string[],
  4806. priority?: number
  4807. ): boolean;
  4808. getUsed(runtime: RuntimeSpec): UsageStateType;
  4809. /**
  4810. * get used name
  4811. */
  4812. getUsedName(
  4813. fallbackName: undefined | string,
  4814. runtime: RuntimeSpec
  4815. ): string | false;
  4816. hasUsedName(): boolean;
  4817. /**
  4818. * Sets the mangled name of this export
  4819. */
  4820. setUsedName(name: string): void;
  4821. getTerminalBinding(
  4822. moduleGraph: ModuleGraph,
  4823. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4824. ): undefined | ExportsInfo | ExportInfo;
  4825. isReexport(): undefined | boolean;
  4826. findTarget(
  4827. moduleGraph: ModuleGraph,
  4828. validTargetModuleFilter: (module: Module) => boolean
  4829. ): undefined | null | false | TargetItemWithoutConnection;
  4830. getTarget(
  4831. moduleGraph: ModuleGraph,
  4832. resolveTargetFilter?: (target: TargetItemWithConnection) => boolean
  4833. ): undefined | TargetItemWithConnection;
  4834. /**
  4835. * Move the target forward as long resolveTargetFilter is fulfilled
  4836. */
  4837. moveTarget(
  4838. moduleGraph: ModuleGraph,
  4839. resolveTargetFilter: (target: TargetItemWithConnection) => boolean,
  4840. updateOriginalConnection?: (
  4841. target: TargetItemWithConnection
  4842. ) => ModuleGraphConnection
  4843. ): undefined | TargetItemWithConnection;
  4844. createNestedExportsInfo(): ExportsInfo;
  4845. getNestedExportsInfo(): undefined | ExportsInfo;
  4846. hasInfo(baseInfo: ExportInfo, runtime: RuntimeSpec): boolean;
  4847. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4848. getUsedInfo(): string;
  4849. getProvidedInfo():
  4850. | "no provided info"
  4851. | "maybe provided (runtime-defined)"
  4852. | "provided"
  4853. | "not provided";
  4854. getRenameInfo(): string;
  4855. }
  4856. declare abstract class ExportMode {
  4857. type: ExportModeType;
  4858. items: null | NormalReexportItem[];
  4859. name: null | string;
  4860. partialNamespaceExportInfo: null | ExportInfo;
  4861. ignored: null | Set<string>;
  4862. hidden?: null | Set<string>;
  4863. userRequest: null | string;
  4864. fakeType: number;
  4865. }
  4866. type ExportModeType =
  4867. | "unused"
  4868. | "missing"
  4869. | "empty-star"
  4870. | "reexport-dynamic-default"
  4871. | "reexport-named-default"
  4872. | "reexport-namespace-object"
  4873. | "reexport-fake-namespace-object"
  4874. | "reexport-undefined"
  4875. | "normal-reexport"
  4876. | "dynamic-reexport";
  4877. type ExportPresenceMode = false | 0 | 1 | 2 | 3;
  4878. declare interface ExportSpec {
  4879. /**
  4880. * the name of the export
  4881. */
  4882. name: string;
  4883. /**
  4884. * can the export be renamed (defaults to true)
  4885. */
  4886. canMangle?: boolean;
  4887. /**
  4888. * is the export a terminal binding that should be checked for export star conflicts
  4889. */
  4890. terminalBinding?: boolean;
  4891. /**
  4892. * nested exports
  4893. */
  4894. exports?: (string | ExportSpec)[];
  4895. /**
  4896. * when reexported: from which module
  4897. */
  4898. from?: ModuleGraphConnection;
  4899. /**
  4900. * when reexported: from which export
  4901. */
  4902. export?: null | string[];
  4903. /**
  4904. * when reexported: with which priority
  4905. */
  4906. priority?: number;
  4907. /**
  4908. * export is not visible, because another export blends over it
  4909. */
  4910. hidden?: boolean;
  4911. }
  4912. type ExportedVariableInfo = string | VariableInfo | ScopeInfo;
  4913. declare abstract class ExportsInfo {
  4914. get ownedExports(): Iterable<ExportInfo>;
  4915. get orderedOwnedExports(): Iterable<ExportInfo>;
  4916. get exports(): Iterable<ExportInfo>;
  4917. get orderedExports(): Iterable<ExportInfo>;
  4918. get otherExportsInfo(): ExportInfo;
  4919. setRedirectNamedTo(exportsInfo?: ExportsInfo): boolean;
  4920. setHasProvideInfo(): void;
  4921. setHasUseInfo(): void;
  4922. getOwnExportInfo(name: string): ExportInfo;
  4923. getExportInfo(name: string): ExportInfo;
  4924. getReadOnlyExportInfo(name: string): ExportInfo;
  4925. getReadOnlyExportInfoRecursive(name: string[]): undefined | ExportInfo;
  4926. getNestedExportsInfo(name?: string[]): undefined | ExportsInfo;
  4927. setUnknownExportsProvided(
  4928. canMangle?: boolean,
  4929. excludeExports?: Set<string>,
  4930. targetKey?: Dependency,
  4931. targetModule?: ModuleGraphConnection,
  4932. priority?: number
  4933. ): boolean;
  4934. setUsedInUnknownWay(runtime: RuntimeSpec): boolean;
  4935. setUsedWithoutInfo(runtime: RuntimeSpec): boolean;
  4936. setAllKnownExportsUsed(runtime: RuntimeSpec): boolean;
  4937. setUsedForSideEffectsOnly(runtime: RuntimeSpec): boolean;
  4938. isUsed(runtime: RuntimeSpec): boolean;
  4939. isModuleUsed(runtime: RuntimeSpec): boolean;
  4940. getUsedExports(runtime: RuntimeSpec): null | boolean | SortableSet<string>;
  4941. getProvidedExports(): null | true | string[];
  4942. getRelevantExports(runtime: RuntimeSpec): ExportInfo[];
  4943. isExportProvided(name: string | string[]): undefined | null | boolean;
  4944. getUsageKey(runtime: RuntimeSpec): string;
  4945. isEquallyUsed(runtimeA: RuntimeSpec, runtimeB: RuntimeSpec): boolean;
  4946. getUsed(name: string | string[], runtime: RuntimeSpec): UsageStateType;
  4947. getUsedName(name: string | string[], runtime: RuntimeSpec): UsedName;
  4948. updateHash(hash: Hash, runtime: RuntimeSpec): void;
  4949. getRestoreProvidedData(): RestoreProvidedData;
  4950. restoreProvided(__0: RestoreProvidedData): void;
  4951. }
  4952. declare interface ExportsSpec {
  4953. /**
  4954. * exported names, true for unknown exports or null for no exports
  4955. */
  4956. exports: null | true | (string | ExportSpec)[];
  4957. /**
  4958. * when exports = true, list of unaffected exports
  4959. */
  4960. excludeExports?: Set<string>;
  4961. /**
  4962. * list of maybe prior exposed, but now hidden exports
  4963. */
  4964. hideExports?: null | Set<string>;
  4965. /**
  4966. * when reexported: from which module
  4967. */
  4968. from?: ModuleGraphConnection;
  4969. /**
  4970. * when reexported: with which priority
  4971. */
  4972. priority?: number;
  4973. /**
  4974. * can the export be renamed (defaults to true)
  4975. */
  4976. canMangle?: boolean;
  4977. /**
  4978. * are the exports terminal bindings that should be checked for export star conflicts
  4979. */
  4980. terminalBinding?: boolean;
  4981. /**
  4982. * module on which the result depends on
  4983. */
  4984. dependencies?: Module[];
  4985. }
  4986. type ExportsType =
  4987. | "namespace"
  4988. | "default-only"
  4989. | "default-with-named"
  4990. | "dynamic";
  4991. type Exposes = (string | ExposesObject)[] | ExposesObject;
  4992. /**
  4993. * Advanced configuration for modules that should be exposed by this container.
  4994. */
  4995. declare interface ExposesConfig {
  4996. /**
  4997. * Request to a module that should be exposed by this container.
  4998. */
  4999. import: string | string[];
  5000. /**
  5001. * Custom chunk name for the exposed module.
  5002. */
  5003. name?: string;
  5004. }
  5005. /**
  5006. * Modules that should be exposed by this container. Property names are used as public paths.
  5007. */
  5008. declare interface ExposesObject {
  5009. [index: string]: string | ExposesConfig | string[];
  5010. }
  5011. type Expression =
  5012. | ImportExpressionImport
  5013. | UnaryExpression
  5014. | ArrayExpression
  5015. | ArrowFunctionExpression
  5016. | AssignmentExpression
  5017. | AwaitExpression
  5018. | BinaryExpression
  5019. | SimpleCallExpression
  5020. | NewExpression
  5021. | ChainExpression
  5022. | ClassExpression
  5023. | ConditionalExpression
  5024. | FunctionExpression
  5025. | Identifier
  5026. | SimpleLiteral
  5027. | RegExpLiteral
  5028. | BigIntLiteral
  5029. | LogicalExpression
  5030. | MemberExpression
  5031. | MetaProperty
  5032. | ObjectExpression
  5033. | SequenceExpression
  5034. | TaggedTemplateExpression
  5035. | TemplateLiteral
  5036. | ThisExpression
  5037. | UpdateExpression
  5038. | YieldExpression;
  5039. declare interface ExpressionExpressionInfo {
  5040. type: "expression";
  5041. rootInfo: string | VariableInfo;
  5042. name: string;
  5043. getMembers: () => string[];
  5044. getMembersOptionals: () => boolean[];
  5045. getMemberRanges: () => [number, number][];
  5046. }
  5047. declare interface ExtensionAliasOption {
  5048. alias: string | string[];
  5049. extension: string;
  5050. }
  5051. declare interface ExtensionAliasOptions {
  5052. [index: string]: string | string[];
  5053. }
  5054. type ExternalItem =
  5055. | string
  5056. | RegExp
  5057. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  5058. | ((
  5059. data: ExternalItemFunctionData,
  5060. callback: (
  5061. err?: null | Error,
  5062. result?: string | boolean | string[] | { [index: string]: any }
  5063. ) => void
  5064. ) => void)
  5065. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  5066. type ExternalItemFunction =
  5067. | ((
  5068. data: ExternalItemFunctionData,
  5069. callback: (
  5070. err?: null | Error,
  5071. result?: string | boolean | string[] | { [index: string]: any }
  5072. ) => void
  5073. ) => void)
  5074. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>);
  5075. declare interface ExternalItemFunctionData {
  5076. /**
  5077. * the directory in which the request is placed
  5078. */
  5079. context: string;
  5080. /**
  5081. * contextual information
  5082. */
  5083. contextInfo: ModuleFactoryCreateDataContextInfo;
  5084. /**
  5085. * the category of the referencing dependency
  5086. */
  5087. dependencyType: string;
  5088. /**
  5089. * get a resolve function with the current resolver options
  5090. */
  5091. getResolve: (
  5092. options?: ResolveOptions
  5093. ) =>
  5094. | ((
  5095. context: string,
  5096. request: string,
  5097. callback: (
  5098. err?: null | Error,
  5099. result?: string | false,
  5100. resolveRequest?: ResolveRequest
  5101. ) => void
  5102. ) => void)
  5103. | ((context: string, request: string) => Promise<string>);
  5104. /**
  5105. * the request as written by the user in the require/import expression/statement
  5106. */
  5107. request: string;
  5108. }
  5109. /**
  5110. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  5111. */
  5112. declare interface ExternalItemObjectKnown {
  5113. /**
  5114. * Specify externals depending on the layer.
  5115. */
  5116. byLayer?:
  5117. | { [index: string]: ExternalItem }
  5118. | ((layer: null | string) => ExternalItem);
  5119. }
  5120. /**
  5121. * If an dependency matches exactly a property of the object, the property value is used as dependency.
  5122. */
  5123. declare interface ExternalItemObjectUnknown {
  5124. [index: string]: ExternalItemValue;
  5125. }
  5126. type ExternalItemValue = string | boolean | string[] | { [index: string]: any };
  5127. declare class ExternalModule extends Module {
  5128. constructor(
  5129. request: ExternalModuleRequest,
  5130. type: ExternalsType,
  5131. userRequest: string,
  5132. dependencyMeta?:
  5133. | ImportDependencyMeta
  5134. | CssImportDependencyMeta
  5135. | AssetDependencyMeta
  5136. );
  5137. request: ExternalModuleRequest;
  5138. externalType: ExternalsType;
  5139. userRequest: string;
  5140. dependencyMeta?:
  5141. | ImportDependencyMeta
  5142. | CssImportDependencyMeta
  5143. | AssetDependencyMeta;
  5144. /**
  5145. * restore unsafe cache data
  5146. */
  5147. restoreFromUnsafeCache(
  5148. unsafeCacheData: UnsafeCacheData,
  5149. normalModuleFactory: NormalModuleFactory
  5150. ): void;
  5151. static ModuleExternalInitFragment: typeof ModuleExternalInitFragment;
  5152. static getExternalModuleNodeCommonjsInitFragment: (
  5153. runtimeTemplate: RuntimeTemplate
  5154. ) => InitFragment<ChunkRenderContextJavascriptModulesPlugin>;
  5155. }
  5156. declare interface ExternalModuleInfo {
  5157. type: "external";
  5158. module: Module;
  5159. runtimeCondition?: string | boolean | SortableSet<string>;
  5160. nonDeferAccess: boolean;
  5161. index: number;
  5162. /**
  5163. * module.exports / harmony namespace object
  5164. */
  5165. name?: string;
  5166. /**
  5167. * deferred module.exports / harmony namespace object
  5168. */
  5169. deferredName?: string;
  5170. /**
  5171. * the module is deferred at least once
  5172. */
  5173. deferred: boolean;
  5174. /**
  5175. * deferred namespace object that being used in a not-analyzable way so it must be materialized
  5176. */
  5177. deferredNamespaceObjectUsed: boolean;
  5178. /**
  5179. * deferred namespace object that being used in a not-analyzable way so it must be materialized
  5180. */
  5181. deferredNamespaceObjectName?: string;
  5182. /**
  5183. * "default-with-named" namespace
  5184. */
  5185. interopNamespaceObjectUsed: boolean;
  5186. /**
  5187. * "default-with-named" namespace
  5188. */
  5189. interopNamespaceObjectName?: string;
  5190. /**
  5191. * "default-only" namespace
  5192. */
  5193. interopNamespaceObject2Used: boolean;
  5194. /**
  5195. * "default-only" namespace
  5196. */
  5197. interopNamespaceObject2Name?: string;
  5198. /**
  5199. * runtime namespace object that detects "__esModule"
  5200. */
  5201. interopDefaultAccessUsed: boolean;
  5202. /**
  5203. * runtime namespace object that detects "__esModule"
  5204. */
  5205. interopDefaultAccessName?: string;
  5206. }
  5207. type ExternalModuleRequest = string | string[] | RequestRecord;
  5208. type Externals =
  5209. | string
  5210. | RegExp
  5211. | (ExternalItemObjectKnown & ExternalItemObjectUnknown)
  5212. | ((
  5213. data: ExternalItemFunctionData,
  5214. callback: (
  5215. err?: null | Error,
  5216. result?: string | boolean | string[] | { [index: string]: any }
  5217. ) => void
  5218. ) => void)
  5219. | ((data: ExternalItemFunctionData) => Promise<ExternalItemValue>)
  5220. | ExternalItem[];
  5221. declare class ExternalsPlugin {
  5222. constructor(type: ExternalsType, externals: Externals);
  5223. type: ExternalsType;
  5224. externals: Externals;
  5225. /**
  5226. * Apply the plugin
  5227. */
  5228. apply(compiler: Compiler): void;
  5229. }
  5230. /**
  5231. * Enable presets of externals for specific targets.
  5232. */
  5233. declare interface ExternalsPresets {
  5234. /**
  5235. * 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.
  5236. */
  5237. electron?: boolean;
  5238. /**
  5239. * Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.
  5240. */
  5241. electronMain?: boolean;
  5242. /**
  5243. * 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.
  5244. */
  5245. electronPreload?: boolean;
  5246. /**
  5247. * 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.
  5248. */
  5249. electronRenderer?: boolean;
  5250. /**
  5251. * Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.
  5252. */
  5253. node?: boolean;
  5254. /**
  5255. * Treat NW.js legacy nw.gui module as external and load it via require() when used.
  5256. */
  5257. nwjs?: boolean;
  5258. /**
  5259. * 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).
  5260. */
  5261. web?: boolean;
  5262. /**
  5263. * 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).
  5264. */
  5265. webAsync?: boolean;
  5266. }
  5267. type ExternalsPresetsNormalizedWithDefaults = ExternalsPresets & {
  5268. web: NonNullable<undefined | boolean>;
  5269. node: NonNullable<undefined | boolean>;
  5270. nwjs: NonNullable<undefined | boolean>;
  5271. electron: NonNullable<undefined | boolean>;
  5272. electronMain: NonNullable<undefined | boolean>;
  5273. electronPreload: NonNullable<undefined | boolean>;
  5274. electronRenderer: NonNullable<undefined | boolean>;
  5275. };
  5276. type ExternalsType =
  5277. | "import"
  5278. | "var"
  5279. | "module"
  5280. | "assign"
  5281. | "this"
  5282. | "window"
  5283. | "self"
  5284. | "global"
  5285. | "commonjs"
  5286. | "commonjs2"
  5287. | "commonjs-module"
  5288. | "commonjs-static"
  5289. | "amd"
  5290. | "amd-require"
  5291. | "umd"
  5292. | "umd2"
  5293. | "jsonp"
  5294. | "system"
  5295. | "promise"
  5296. | "module-import"
  5297. | "script"
  5298. | "node-commonjs"
  5299. | "asset"
  5300. | "css-import"
  5301. | "css-url";
  5302. declare interface FSImplementation {
  5303. open?: (...args: any[]) => any;
  5304. close?: (...args: any[]) => any;
  5305. }
  5306. declare interface FactorizeModuleOptions {
  5307. currentProfile?: ModuleProfile;
  5308. factory: ModuleFactory;
  5309. dependencies: Dependency[];
  5310. /**
  5311. * return full ModuleFactoryResult instead of only module
  5312. */
  5313. factoryResult?: boolean;
  5314. originModule: null | Module;
  5315. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  5316. context?: string;
  5317. }
  5318. declare interface FactoryMeta {
  5319. sideEffectFree?: boolean;
  5320. }
  5321. type FakeHook<T> = T & FakeHookMarker;
  5322. declare interface FakeHookMarker {}
  5323. declare interface FallbackCacheGroup {
  5324. chunksFilter: (chunk: Chunk) => undefined | boolean;
  5325. minSize: SplitChunksSizes;
  5326. maxAsyncSize: SplitChunksSizes;
  5327. maxInitialSize: SplitChunksSizes;
  5328. automaticNameDelimiter: string;
  5329. }
  5330. declare class FetchCompileAsyncWasmPlugin {
  5331. constructor();
  5332. /**
  5333. * Apply the plugin
  5334. */
  5335. apply(compiler: Compiler): void;
  5336. }
  5337. declare class FetchCompileWasmPlugin {
  5338. constructor(options?: FetchCompileWasmPluginOptions);
  5339. options: FetchCompileWasmPluginOptions;
  5340. /**
  5341. * Apply the plugin
  5342. */
  5343. apply(compiler: Compiler): void;
  5344. }
  5345. declare interface FetchCompileWasmPluginOptions {
  5346. /**
  5347. * mangle imports
  5348. */
  5349. mangleImports?: boolean;
  5350. }
  5351. /**
  5352. * Options object for persistent file-based caching.
  5353. */
  5354. declare interface FileCacheOptions {
  5355. /**
  5356. * Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
  5357. */
  5358. allowCollectingMemory?: boolean;
  5359. /**
  5360. * Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
  5361. */
  5362. buildDependencies?: { [index: string]: string[] };
  5363. /**
  5364. * Base directory for the cache (defaults to node_modules/.cache/webpack).
  5365. */
  5366. cacheDirectory?: string;
  5367. /**
  5368. * Locations for the cache (defaults to cacheDirectory / name).
  5369. */
  5370. cacheLocation?: string;
  5371. /**
  5372. * Compression type used for the cache files.
  5373. */
  5374. compression?: false | "gzip" | "brotli";
  5375. /**
  5376. * Algorithm used for generation the hash (see node.js crypto package).
  5377. */
  5378. hashAlgorithm?: string;
  5379. /**
  5380. * Time in ms after which idle period the cache storing should happen.
  5381. */
  5382. idleTimeout?: number;
  5383. /**
  5384. * 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).
  5385. */
  5386. idleTimeoutAfterLargeChanges?: number;
  5387. /**
  5388. * Time in ms after which idle period the initial cache storing should happen.
  5389. */
  5390. idleTimeoutForInitialStore?: number;
  5391. /**
  5392. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  5393. */
  5394. immutablePaths?: (string | RegExp)[];
  5395. /**
  5396. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  5397. */
  5398. managedPaths?: (string | RegExp)[];
  5399. /**
  5400. * Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).
  5401. */
  5402. maxAge?: number;
  5403. /**
  5404. * 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.
  5405. */
  5406. maxMemoryGenerations?: number;
  5407. /**
  5408. * Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.
  5409. */
  5410. memoryCacheUnaffected?: boolean;
  5411. /**
  5412. * Name for the cache. Different names will lead to different coexisting caches.
  5413. */
  5414. name?: string;
  5415. /**
  5416. * Track and log detailed timing information for individual cache items.
  5417. */
  5418. profile?: boolean;
  5419. /**
  5420. * Enable/disable readonly mode.
  5421. */
  5422. readonly?: boolean;
  5423. /**
  5424. * When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
  5425. */
  5426. store?: "pack";
  5427. /**
  5428. * Filesystem caching.
  5429. */
  5430. type: "filesystem";
  5431. /**
  5432. * 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.
  5433. */
  5434. version?: string;
  5435. }
  5436. declare interface FileSystem {
  5437. /**
  5438. * read file method
  5439. */
  5440. readFile: ReadFileTypes;
  5441. /**
  5442. * readdir method
  5443. */
  5444. readdir: ReaddirTypes;
  5445. /**
  5446. * read json method
  5447. */
  5448. readJson?: (
  5449. pathOrFileDescription: PathOrFileDescriptorTypes,
  5450. callback: (
  5451. err: null | Error | NodeJS.ErrnoException,
  5452. result?: JsonObjectTypes
  5453. ) => void
  5454. ) => void;
  5455. /**
  5456. * read link method
  5457. */
  5458. readlink: ReadlinkTypes;
  5459. /**
  5460. * lstat method
  5461. */
  5462. lstat?: LStatTypes;
  5463. /**
  5464. * stat method
  5465. */
  5466. stat: StatTypes;
  5467. /**
  5468. * realpath method
  5469. */
  5470. realpath?: RealPathTypes;
  5471. }
  5472. declare abstract class FileSystemInfo {
  5473. fs: InputFileSystem;
  5474. logger?: WebpackLogger;
  5475. fileTimestampQueue: AsyncQueue<string, string, FileSystemInfoEntry>;
  5476. fileHashQueue: AsyncQueue<string, string, string>;
  5477. contextTimestampQueue: AsyncQueue<string, string, ContextFileSystemInfoEntry>;
  5478. contextHashQueue: AsyncQueue<string, string, ContextHash>;
  5479. contextTshQueue: AsyncQueue<string, string, ContextTimestampAndHash>;
  5480. managedItemQueue: AsyncQueue<string, string, string>;
  5481. managedItemDirectoryQueue: AsyncQueue<string, string, Set<string>>;
  5482. unmanagedPathsWithSlash: string[];
  5483. unmanagedPathsRegExps: RegExp[];
  5484. managedPaths: (string | RegExp)[];
  5485. managedPathsWithSlash: string[];
  5486. managedPathsRegExps: RegExp[];
  5487. immutablePaths: (string | RegExp)[];
  5488. immutablePathsWithSlash: string[];
  5489. immutablePathsRegExps: RegExp[];
  5490. logStatistics(): void;
  5491. clear(): void;
  5492. addFileTimestamps(
  5493. map: ReadonlyMap<string, FileTimestamp>,
  5494. immutable?: boolean
  5495. ): void;
  5496. addContextTimestamps(
  5497. map: ReadonlyMap<string, ContextTimestamp>,
  5498. immutable?: boolean
  5499. ): void;
  5500. getFileTimestamp(
  5501. path: string,
  5502. callback: (
  5503. err?: null | WebpackError,
  5504. fileTimestamp?: null | FileSystemInfoEntry | "ignore"
  5505. ) => void
  5506. ): void;
  5507. getContextTimestamp(
  5508. path: string,
  5509. callback: (
  5510. err?: null | WebpackError,
  5511. resolvedContextTimestamp?:
  5512. | null
  5513. | "ignore"
  5514. | ResolvedContextFileSystemInfoEntry
  5515. ) => void
  5516. ): void;
  5517. getFileHash(
  5518. path: string,
  5519. callback: (err?: null | WebpackError, hash?: null | string) => void
  5520. ): void;
  5521. getContextHash(
  5522. path: string,
  5523. callback: (err?: null | WebpackError, contextHash?: string) => void
  5524. ): void;
  5525. getContextTsh(
  5526. path: string,
  5527. callback: (
  5528. err?: null | WebpackError,
  5529. resolvedContextTimestampAndHash?: null | ResolvedContextTimestampAndHash
  5530. ) => void
  5531. ): void;
  5532. resolveBuildDependencies(
  5533. context: string,
  5534. deps: Iterable<string>,
  5535. callback: (
  5536. err?: null | Error,
  5537. resolveBuildDependenciesResult?: ResolveBuildDependenciesResult
  5538. ) => void
  5539. ): void;
  5540. checkResolveResultsValid(
  5541. resolveResults: Map<string, undefined | string | false>,
  5542. callback: (err?: null | Error, result?: boolean) => void
  5543. ): void;
  5544. createSnapshot(
  5545. startTime: undefined | null | number,
  5546. files: undefined | null | Iterable<string>,
  5547. directories: undefined | null | Iterable<string>,
  5548. missing: undefined | null | Iterable<string>,
  5549. options: undefined | null | SnapshotOptionsFileSystemInfo,
  5550. callback: (err: null | WebpackError, snapshot: null | Snapshot) => void
  5551. ): void;
  5552. mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
  5553. checkSnapshotValid(
  5554. snapshot: Snapshot,
  5555. callback: (err?: null | WebpackError, result?: boolean) => void
  5556. ): void;
  5557. getDeprecatedFileTimestamps(): Map<string, null | number>;
  5558. getDeprecatedContextTimestamps(): Map<string, null | number>;
  5559. }
  5560. declare interface FileSystemInfoEntry {
  5561. safeTime: number;
  5562. timestamp?: number;
  5563. }
  5564. type FileTimestamp = null | FileSystemInfoEntry | "ignore";
  5565. type FilterItemTypes = string | RegExp | ((value: string) => boolean);
  5566. declare interface Flags {
  5567. [index: string]: Argument;
  5568. }
  5569. declare interface FullHashChunkModuleHashes {
  5570. [index: string]: string;
  5571. }
  5572. declare interface GenerateContext {
  5573. /**
  5574. * mapping from dependencies to templates
  5575. */
  5576. dependencyTemplates: DependencyTemplates;
  5577. /**
  5578. * the runtime template
  5579. */
  5580. runtimeTemplate: RuntimeTemplate;
  5581. /**
  5582. * the module graph
  5583. */
  5584. moduleGraph: ModuleGraph;
  5585. /**
  5586. * the chunk graph
  5587. */
  5588. chunkGraph: ChunkGraph;
  5589. /**
  5590. * the requirements for runtime
  5591. */
  5592. runtimeRequirements: Set<string>;
  5593. /**
  5594. * the runtime
  5595. */
  5596. runtime: RuntimeSpec;
  5597. /**
  5598. * when in concatenated module, information about other concatenated modules
  5599. */
  5600. concatenationScope?: ConcatenationScope;
  5601. /**
  5602. * code generation results of other modules (need to have a codeGenerationDependency to use that)
  5603. */
  5604. codeGenerationResults?: CodeGenerationResults;
  5605. /**
  5606. * which kind of code should be generated
  5607. */
  5608. type: string;
  5609. /**
  5610. * get access to the code generation data
  5611. */
  5612. getData?: () => CodeGenerationResultData;
  5613. }
  5614. declare interface GeneratedSourceInfo {
  5615. /**
  5616. * generated line
  5617. */
  5618. generatedLine?: number;
  5619. /**
  5620. * generated column
  5621. */
  5622. generatedColumn?: number;
  5623. /**
  5624. * source
  5625. */
  5626. source?: string;
  5627. }
  5628. declare class Generator {
  5629. constructor();
  5630. getTypes(module: NormalModule): ReadonlySet<string>;
  5631. getSize(module: NormalModule, type?: string): number;
  5632. generate(module: NormalModule, __1: GenerateContext): null | Source;
  5633. getConcatenationBailoutReason(
  5634. module: NormalModule,
  5635. context: ConcatenationBailoutReasonContext
  5636. ): undefined | string;
  5637. updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
  5638. static byType(map: {
  5639. [index: string]: undefined | Generator;
  5640. }): ByTypeGenerator;
  5641. }
  5642. declare interface GeneratorOptions {
  5643. [index: string]: any;
  5644. }
  5645. type GeneratorOptionsByModuleType = GeneratorOptionsByModuleTypeKnown &
  5646. GeneratorOptionsByModuleTypeUnknown;
  5647. /**
  5648. * Specify options for each generator.
  5649. */
  5650. declare interface GeneratorOptionsByModuleTypeKnown {
  5651. /**
  5652. * Generator options for asset modules.
  5653. */
  5654. asset?: AssetGeneratorOptions;
  5655. /**
  5656. * No generator options are supported for this module type.
  5657. */
  5658. "asset/bytes"?: EmptyGeneratorOptions;
  5659. /**
  5660. * Generator options for asset/inline modules.
  5661. */
  5662. "asset/inline"?: AssetInlineGeneratorOptions;
  5663. /**
  5664. * Generator options for asset/resource modules.
  5665. */
  5666. "asset/resource"?: AssetResourceGeneratorOptions;
  5667. /**
  5668. * No generator options are supported for this module type.
  5669. */
  5670. "asset/source"?: EmptyGeneratorOptions;
  5671. /**
  5672. * Generator options for css modules.
  5673. */
  5674. css?: CssGeneratorOptions;
  5675. /**
  5676. * Generator options for css/module modules.
  5677. */
  5678. "css/auto"?: CssModuleGeneratorOptions;
  5679. /**
  5680. * Generator options for css/module modules.
  5681. */
  5682. "css/global"?: CssModuleGeneratorOptions;
  5683. /**
  5684. * Generator options for css/module modules.
  5685. */
  5686. "css/module"?: CssModuleGeneratorOptions;
  5687. /**
  5688. * No generator options are supported for this module type.
  5689. */
  5690. javascript?: EmptyGeneratorOptions;
  5691. /**
  5692. * No generator options are supported for this module type.
  5693. */
  5694. "javascript/auto"?: EmptyGeneratorOptions;
  5695. /**
  5696. * No generator options are supported for this module type.
  5697. */
  5698. "javascript/dynamic"?: EmptyGeneratorOptions;
  5699. /**
  5700. * No generator options are supported for this module type.
  5701. */
  5702. "javascript/esm"?: EmptyGeneratorOptions;
  5703. /**
  5704. * Generator options for json modules.
  5705. */
  5706. json?: JsonGeneratorOptions;
  5707. }
  5708. /**
  5709. * Specify options for each generator.
  5710. */
  5711. declare interface GeneratorOptionsByModuleTypeUnknown {
  5712. [index: string]: { [index: string]: any };
  5713. }
  5714. declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
  5715. constructor(
  5716. contentType: string,
  5717. name: string,
  5718. global: string,
  5719. getFilenameForChunk: (
  5720. chunk: Chunk
  5721. ) =>
  5722. | string
  5723. | false
  5724. | ((pathData: PathData, assetInfo?: AssetInfo) => string),
  5725. allChunks: boolean
  5726. );
  5727. contentType: string;
  5728. global: string;
  5729. getFilenameForChunk: (
  5730. chunk: Chunk
  5731. ) => string | false | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  5732. allChunks: boolean;
  5733. /**
  5734. * Runtime modules without any dependencies to other runtime modules
  5735. */
  5736. static STAGE_NORMAL: number;
  5737. /**
  5738. * Runtime modules with simple dependencies on other runtime modules
  5739. */
  5740. static STAGE_BASIC: number;
  5741. /**
  5742. * Runtime modules which attach to handlers of other runtime modules
  5743. */
  5744. static STAGE_ATTACH: number;
  5745. /**
  5746. * Runtime modules which trigger actions on bootstrap
  5747. */
  5748. static STAGE_TRIGGER: number;
  5749. }
  5750. declare interface GotHandler<T> {
  5751. (result: T, callback: () => void): void;
  5752. }
  5753. declare interface GroupConfig<T, R> {
  5754. getKeys: (item: T) => undefined | string[];
  5755. getOptions?: (name: string, items: T[]) => GroupOptions;
  5756. createGroup: (key: string, children: T[], items: T[]) => R;
  5757. }
  5758. declare interface GroupOptions {
  5759. groupChildren?: boolean;
  5760. force?: boolean;
  5761. targetGroupCount?: number;
  5762. }
  5763. declare interface HMRJavascriptParserHooks {
  5764. hotAcceptCallback: SyncBailHook<
  5765. [
  5766. (
  5767. | ImportExpressionImport
  5768. | UnaryExpression
  5769. | ArrayExpression
  5770. | ArrowFunctionExpression
  5771. | AssignmentExpression
  5772. | AwaitExpression
  5773. | BinaryExpression
  5774. | SimpleCallExpression
  5775. | NewExpression
  5776. | ChainExpression
  5777. | ClassExpression
  5778. | ConditionalExpression
  5779. | FunctionExpression
  5780. | Identifier
  5781. | SimpleLiteral
  5782. | RegExpLiteral
  5783. | BigIntLiteral
  5784. | LogicalExpression
  5785. | MemberExpression
  5786. | MetaProperty
  5787. | ObjectExpression
  5788. | SequenceExpression
  5789. | TaggedTemplateExpression
  5790. | TemplateLiteral
  5791. | ThisExpression
  5792. | UpdateExpression
  5793. | YieldExpression
  5794. | SpreadElement
  5795. ),
  5796. string[]
  5797. ],
  5798. void
  5799. >;
  5800. hotAcceptWithoutCallback: SyncBailHook<[CallExpression, string[]], void>;
  5801. }
  5802. declare interface HandleModuleCreationOptions {
  5803. factory: ModuleFactory;
  5804. dependencies: Dependency[];
  5805. originModule: null | Module;
  5806. contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
  5807. context?: string;
  5808. /**
  5809. * recurse into dependencies of the created module
  5810. */
  5811. recursive?: boolean;
  5812. /**
  5813. * connect the resolved module with the origin module
  5814. */
  5815. connectOrigin?: boolean;
  5816. /**
  5817. * check the cycle dependencies of the created module
  5818. */
  5819. checkCycle?: boolean;
  5820. }
  5821. declare abstract class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
  5822. ids: string[];
  5823. name: null | string;
  5824. activeExports: Set<string>;
  5825. otherStarExports: null | ReadonlyArray<HarmonyExportImportedSpecifierDependency>;
  5826. exportPresenceMode: ExportPresenceMode;
  5827. allStarExports: null | HarmonyStarExportsList;
  5828. get id(): void;
  5829. getId(): void;
  5830. setId(): void;
  5831. getIds(moduleGraph: ModuleGraph): string[];
  5832. setIds(moduleGraph: ModuleGraph, ids: string[]): void;
  5833. getMode(moduleGraph: ModuleGraph, runtime: RuntimeSpec): ExportMode;
  5834. getStarReexports(
  5835. moduleGraph: ModuleGraph,
  5836. runtime: RuntimeSpec,
  5837. exportsInfo?: ExportsInfo,
  5838. importedModule?: Module
  5839. ): {
  5840. exports?: Set<string>;
  5841. checked?: Set<string>;
  5842. ignoredExports: Set<string>;
  5843. hidden?: Set<string>;
  5844. };
  5845. }
  5846. declare class HarmonyImportDependency extends ModuleDependency {
  5847. constructor(
  5848. request: string,
  5849. sourceOrder: number,
  5850. phase?: 0 | 1 | 2,
  5851. attributes?: ImportAttributes
  5852. );
  5853. phase: ImportPhaseType;
  5854. attributes?: ImportAttributes;
  5855. getImportVar(moduleGraph: ModuleGraph): string;
  5856. getModuleExports(__0: DependencyTemplateContext): string;
  5857. getImportStatement(
  5858. update: boolean,
  5859. __1: DependencyTemplateContext
  5860. ): [string, string];
  5861. getLinkingErrors(
  5862. moduleGraph: ModuleGraph,
  5863. ids: string[],
  5864. additionalMessage: string
  5865. ): undefined | WebpackError[];
  5866. static Template: typeof HarmonyImportDependencyTemplate;
  5867. static ExportPresenceModes: {
  5868. NONE: ExportPresenceMode;
  5869. WARN: ExportPresenceMode;
  5870. AUTO: ExportPresenceMode;
  5871. ERROR: ExportPresenceMode;
  5872. fromUserOption(str: string | false): ExportPresenceMode;
  5873. };
  5874. static NO_EXPORTS_REFERENCED: string[][];
  5875. static EXPORTS_OBJECT_REFERENCED: string[][];
  5876. static isLowPriorityDependency(dependency: Dependency): boolean;
  5877. static TRANSITIVE: typeof TRANSITIVE;
  5878. }
  5879. declare class HarmonyImportDependencyTemplate extends DependencyTemplate {
  5880. constructor();
  5881. static getImportEmittedRuntime(
  5882. module: Module,
  5883. referencedModule: Module
  5884. ): undefined | string | boolean | SortableSet<string>;
  5885. }
  5886. declare interface HarmonySettings {
  5887. ids: string[];
  5888. source: string;
  5889. sourceOrder: number;
  5890. name: string;
  5891. await: boolean;
  5892. attributes?: ImportAttributes;
  5893. phase: ImportPhaseType;
  5894. }
  5895. declare abstract class HarmonyStarExportsList {
  5896. dependencies: HarmonyExportImportedSpecifierDependency[];
  5897. push(dep: HarmonyExportImportedSpecifierDependency): void;
  5898. slice(): HarmonyExportImportedSpecifierDependency[];
  5899. serialize(__0: ObjectSerializerContext): void;
  5900. deserialize(__0: ObjectDeserializerContext): void;
  5901. }
  5902. declare class Hash {
  5903. constructor();
  5904. /**
  5905. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  5906. */
  5907. update(data: string | Buffer): Hash;
  5908. /**
  5909. * Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
  5910. */
  5911. update(data: string, inputEncoding: string): Hash;
  5912. /**
  5913. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  5914. */
  5915. digest(): Buffer;
  5916. /**
  5917. * Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
  5918. */
  5919. digest(encoding: string): string;
  5920. }
  5921. type HashFunction = string | typeof Hash;
  5922. declare interface HashLike {
  5923. /**
  5924. * make hash update
  5925. */
  5926. update: (data: string | Buffer, inputEncoding?: string) => HashLike;
  5927. /**
  5928. * get hash digest
  5929. */
  5930. digest: (encoding?: string) => string | Buffer;
  5931. }
  5932. declare interface HashableObject {
  5933. updateHash: (hash: Hash) => void;
  5934. }
  5935. declare class HashedModuleIdsPlugin {
  5936. constructor(options?: HashedModuleIdsPluginOptions);
  5937. options: Required<Omit<HashedModuleIdsPluginOptions, "context">> & {
  5938. context?: string;
  5939. };
  5940. /**
  5941. * Apply the plugin
  5942. */
  5943. apply(compiler: Compiler): void;
  5944. }
  5945. declare interface HashedModuleIdsPluginOptions {
  5946. /**
  5947. * The context directory for creating names.
  5948. */
  5949. context?: string;
  5950. /**
  5951. * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
  5952. */
  5953. hashDigest?:
  5954. | "ascii"
  5955. | "utf8"
  5956. | "utf-8"
  5957. | "utf16le"
  5958. | "utf-16le"
  5959. | "ucs2"
  5960. | "ucs-2"
  5961. | "base64"
  5962. | "base64url"
  5963. | "latin1"
  5964. | "binary"
  5965. | "hex";
  5966. /**
  5967. * The prefix length of the hash digest to use, defaults to 4.
  5968. */
  5969. hashDigestLength?: number;
  5970. /**
  5971. * The hashing algorithm to use, defaults to 'md4'. All functions from Node.JS' crypto.createHash are supported.
  5972. */
  5973. hashFunction?: string | typeof Hash;
  5974. }
  5975. declare abstract class HelperRuntimeModule extends RuntimeModule {}
  5976. declare class HotModuleReplacementPlugin {
  5977. constructor();
  5978. /**
  5979. * Apply the plugin
  5980. */
  5981. apply(compiler: Compiler): void;
  5982. static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
  5983. }
  5984. /**
  5985. * These properties are added by the HotModuleReplacementPlugin
  5986. */
  5987. declare interface HotModuleReplacementPluginLoaderContext {
  5988. hot?: boolean;
  5989. }
  5990. declare class HotUpdateChunk extends Chunk {
  5991. constructor();
  5992. }
  5993. /**
  5994. * Options for building http resources.
  5995. */
  5996. declare interface HttpUriOptions {
  5997. /**
  5998. * List of allowed URIs (resp. the beginning of them).
  5999. */
  6000. allowedUris: (string | RegExp | ((uri: string) => boolean))[];
  6001. /**
  6002. * Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
  6003. */
  6004. cacheLocation?: string | false;
  6005. /**
  6006. * When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
  6007. */
  6008. frozen?: boolean;
  6009. /**
  6010. * Location of the lockfile.
  6011. */
  6012. lockfileLocation?: string;
  6013. /**
  6014. * Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
  6015. */
  6016. proxy?: string;
  6017. /**
  6018. * When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
  6019. */
  6020. upgrade?: boolean;
  6021. }
  6022. declare class HttpUriPlugin {
  6023. constructor(options: HttpUriOptions);
  6024. /**
  6025. * Apply the plugin
  6026. */
  6027. apply(compiler: Compiler): void;
  6028. }
  6029. type IBigIntStats = IStatsBase<bigint> & {
  6030. atimeNs: bigint;
  6031. mtimeNs: bigint;
  6032. ctimeNs: bigint;
  6033. birthtimeNs: bigint;
  6034. };
  6035. declare interface IStats {
  6036. isFile: () => boolean;
  6037. isDirectory: () => boolean;
  6038. isBlockDevice: () => boolean;
  6039. isCharacterDevice: () => boolean;
  6040. isSymbolicLink: () => boolean;
  6041. isFIFO: () => boolean;
  6042. isSocket: () => boolean;
  6043. dev: number;
  6044. ino: number;
  6045. mode: number;
  6046. nlink: number;
  6047. uid: number;
  6048. gid: number;
  6049. rdev: number;
  6050. size: number;
  6051. blksize: number;
  6052. blocks: number;
  6053. atimeMs: number;
  6054. mtimeMs: number;
  6055. ctimeMs: number;
  6056. birthtimeMs: number;
  6057. atime: Date;
  6058. mtime: Date;
  6059. ctime: Date;
  6060. birthtime: Date;
  6061. }
  6062. declare interface IStatsBase<T> {
  6063. isFile: () => boolean;
  6064. isDirectory: () => boolean;
  6065. isBlockDevice: () => boolean;
  6066. isCharacterDevice: () => boolean;
  6067. isSymbolicLink: () => boolean;
  6068. isFIFO: () => boolean;
  6069. isSocket: () => boolean;
  6070. dev: T;
  6071. ino: T;
  6072. mode: T;
  6073. nlink: T;
  6074. uid: T;
  6075. gid: T;
  6076. rdev: T;
  6077. size: T;
  6078. blksize: T;
  6079. blocks: T;
  6080. atimeMs: T;
  6081. mtimeMs: T;
  6082. ctimeMs: T;
  6083. birthtimeMs: T;
  6084. atime: Date;
  6085. mtime: Date;
  6086. ctime: Date;
  6087. birthtime: Date;
  6088. }
  6089. declare interface IdToHashMap {
  6090. [index: number]: string;
  6091. [index: string]: string;
  6092. }
  6093. declare class IgnorePlugin {
  6094. constructor(options: IgnorePluginOptions);
  6095. options: IgnorePluginOptions;
  6096. /**
  6097. * Note that if "contextRegExp" is given, both the "resourceRegExp" and "contextRegExp" have to match.
  6098. */
  6099. checkIgnore(
  6100. resolveData: ResolveData | BeforeContextResolveData
  6101. ): undefined | false;
  6102. /**
  6103. * Apply the plugin
  6104. */
  6105. apply(compiler: Compiler): void;
  6106. }
  6107. type IgnorePluginOptions =
  6108. | {
  6109. /**
  6110. * A RegExp to test the context (directory) against.
  6111. */
  6112. contextRegExp?: RegExp;
  6113. /**
  6114. * A RegExp to test the request against.
  6115. */
  6116. resourceRegExp: RegExp;
  6117. }
  6118. | {
  6119. /**
  6120. * A filter function for resource and context.
  6121. */
  6122. checkResource: (resource: string, context: string) => boolean;
  6123. };
  6124. type ImportAttributes = Record<string, string> & {};
  6125. declare interface ImportDependencyMeta {
  6126. attributes?: ImportAttributes;
  6127. externalType?: "import" | "module";
  6128. }
  6129. type ImportExpressionJavascriptParser = ImportExpressionImport & {
  6130. phase?: "defer";
  6131. };
  6132. declare interface ImportModuleOptions {
  6133. /**
  6134. * the target layer
  6135. */
  6136. layer?: string;
  6137. /**
  6138. * the target public path
  6139. */
  6140. publicPath?: string;
  6141. /**
  6142. * target base uri
  6143. */
  6144. baseUri?: string;
  6145. }
  6146. type ImportPhaseType = 0 | 1 | 2;
  6147. declare interface ImportSettings {
  6148. references: string[][];
  6149. expression: ImportExpressionJavascriptParser;
  6150. }
  6151. type ImportSource =
  6152. | undefined
  6153. | null
  6154. | string
  6155. | SimpleLiteral
  6156. | RegExpLiteral
  6157. | BigIntLiteral;
  6158. type Imported = true | [string, string][];
  6159. /**
  6160. * Options for infrastructure level logging.
  6161. */
  6162. declare interface InfrastructureLogging {
  6163. /**
  6164. * 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.
  6165. */
  6166. appendOnly?: boolean;
  6167. /**
  6168. * Enables/Disables colorful output. This option is only used when no custom console is provided.
  6169. */
  6170. colors?: boolean;
  6171. /**
  6172. * Custom console used for logging.
  6173. */
  6174. console?: Console;
  6175. /**
  6176. * Enable debug logging for specific loggers.
  6177. */
  6178. debug?:
  6179. | string
  6180. | boolean
  6181. | RegExp
  6182. | FilterItemTypes[]
  6183. | ((value: string) => boolean);
  6184. /**
  6185. * Log level.
  6186. */
  6187. level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
  6188. /**
  6189. * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
  6190. */
  6191. stream?: NodeJS.WritableStream & {
  6192. isTTY?: boolean;
  6193. columns?: number;
  6194. rows?: number;
  6195. };
  6196. }
  6197. type InfrastructureLoggingNormalizedWithDefaults = InfrastructureLogging & {
  6198. stream: NodeJS.WritableStream & {
  6199. isTTY?: boolean;
  6200. columns?: number;
  6201. rows?: number;
  6202. };
  6203. level: NonNullable<
  6204. undefined | "none" | "verbose" | "error" | "warn" | "info" | "log"
  6205. >;
  6206. debug: NonNullable<
  6207. | undefined
  6208. | string
  6209. | boolean
  6210. | RegExp
  6211. | FilterItemTypes[]
  6212. | ((value: string) => boolean)
  6213. >;
  6214. colors: NonNullable<undefined | boolean>;
  6215. appendOnly: NonNullable<undefined | boolean>;
  6216. };
  6217. declare class InitFragment<GenerateContext> {
  6218. constructor(
  6219. content: undefined | string | Source,
  6220. stage: number,
  6221. position: number,
  6222. key?: string,
  6223. endContent?: string | Source
  6224. );
  6225. content?: string | Source;
  6226. stage: number;
  6227. position: number;
  6228. key?: string;
  6229. endContent?: string | Source;
  6230. getContent(context: GenerateContext): undefined | string | Source;
  6231. getEndContent(context: GenerateContext): undefined | string | Source;
  6232. serialize(context: ObjectSerializerContext): void;
  6233. deserialize(context: ObjectDeserializerContext): void;
  6234. static addToSource<Context>(
  6235. source: Source,
  6236. initFragments: MaybeMergeableInitFragment<Context>[],
  6237. context: Context
  6238. ): Source;
  6239. static STAGE_CONSTANTS: number;
  6240. static STAGE_ASYNC_BOUNDARY: number;
  6241. static STAGE_HARMONY_EXPORTS: number;
  6242. static STAGE_HARMONY_IMPORTS: number;
  6243. static STAGE_PROVIDES: number;
  6244. static STAGE_ASYNC_DEPENDENCIES: number;
  6245. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  6246. }
  6247. declare interface InputFileSystem {
  6248. readFile: ReadFileFs;
  6249. readFileSync?: ReadFileSync;
  6250. readlink: ReadlinkFs;
  6251. readlinkSync?: ReadlinkSync;
  6252. readdir: ReaddirFs;
  6253. readdirSync?: ReaddirSync;
  6254. stat: StatFs;
  6255. statSync?: StatSync;
  6256. lstat?: LStatFs;
  6257. lstatSync?: LStatSync;
  6258. realpath?: RealPathFs;
  6259. realpathSync?: RealPathSync;
  6260. readJson?: (
  6261. pathOrFileDescriptor: PathOrFileDescriptorFs,
  6262. callback: (
  6263. err: null | Error | NodeJS.ErrnoException,
  6264. result?: JsonObjectFs
  6265. ) => void
  6266. ) => void;
  6267. readJsonSync?: (pathOrFileDescriptor: PathOrFileDescriptorFs) => JsonObjectFs;
  6268. purge?: (value?: string | string[] | Set<string>) => void;
  6269. join?: (path1: string, path2: string) => string;
  6270. relative?: (from: string, to: string) => string;
  6271. dirname?: (dirname: string) => string;
  6272. }
  6273. declare interface Inspector {
  6274. Session: typeof SessionImportInspectorClass_1;
  6275. }
  6276. type IntermediateFileSystem = InputFileSystem &
  6277. OutputFileSystem &
  6278. IntermediateFileSystemExtras;
  6279. declare interface IntermediateFileSystemExtras {
  6280. mkdirSync: MkdirSync;
  6281. createWriteStream: (
  6282. pathLike: PathLikeFs,
  6283. result?:
  6284. | "ascii"
  6285. | "utf8"
  6286. | "utf-8"
  6287. | "utf16le"
  6288. | "utf-16le"
  6289. | "ucs2"
  6290. | "ucs-2"
  6291. | "base64"
  6292. | "base64url"
  6293. | "latin1"
  6294. | "binary"
  6295. | "hex"
  6296. | WriteStreamOptions
  6297. ) => NodeJS.WritableStream;
  6298. open: Open;
  6299. read: Read<NodeJS.ArrayBufferView>;
  6300. close: (
  6301. df: number,
  6302. callback: (err: null | NodeJS.ErrnoException) => void
  6303. ) => void;
  6304. rename: (
  6305. a: PathLikeFs,
  6306. b: PathLikeFs,
  6307. callback: (err: null | NodeJS.ErrnoException) => void
  6308. ) => void;
  6309. }
  6310. type InternalCell<T> = T | typeof TOMBSTONE | typeof UNDEFINED_MARKER;
  6311. declare interface InterpolatedPathAndAssetInfo {
  6312. path: string;
  6313. info: AssetInfo;
  6314. }
  6315. type Issuer = undefined | null | Module;
  6316. type IssuerLayer = null | string;
  6317. declare interface Item<T> {
  6318. [index: string]: string | string[] | T;
  6319. }
  6320. declare abstract class ItemCacheFacade {
  6321. get<T>(callback: CallbackCacheCacheFacade<T>): void;
  6322. getPromise<T>(): Promise<T>;
  6323. store<T>(data: T, callback: CallbackCacheCacheFacade<void>): void;
  6324. storePromise<T>(data: T): Promise<void>;
  6325. provide<T>(
  6326. computer: (callback: CallbackNormalErrorCache<T>) => void,
  6327. callback: CallbackNormalErrorCache<T>
  6328. ): void;
  6329. providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
  6330. }
  6331. declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
  6332. extends Iterator<T, TReturn, TNext>, Disposable {
  6333. [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
  6334. [Symbol.dispose](): void;
  6335. }
  6336. declare abstract class JavascriptGenerator extends Generator {
  6337. sourceDependency(
  6338. module: Module,
  6339. dependency: Dependency,
  6340. initFragments: InitFragment<GenerateContext>[],
  6341. source: ReplaceSource,
  6342. generateContext: GenerateContext
  6343. ): void;
  6344. sourceBlock(
  6345. module: Module,
  6346. block: DependenciesBlock,
  6347. initFragments: InitFragment<GenerateContext>[],
  6348. source: ReplaceSource,
  6349. generateContext: GenerateContext
  6350. ): void;
  6351. sourceModule(
  6352. module: Module,
  6353. initFragments: InitFragment<GenerateContext>[],
  6354. source: ReplaceSource,
  6355. generateContext: GenerateContext
  6356. ): void;
  6357. generateError(
  6358. error: Error,
  6359. module: NormalModule,
  6360. generateContext: GenerateContext
  6361. ): null | Source;
  6362. }
  6363. declare class JavascriptModulesPlugin {
  6364. constructor(options?: object);
  6365. options: object;
  6366. /**
  6367. * Apply the plugin
  6368. */
  6369. apply(compiler: Compiler): void;
  6370. renderModule(
  6371. module: Module,
  6372. renderContext: ModuleRenderContext,
  6373. hooks: CompilationHooksJavascriptModulesPlugin
  6374. ): null | Source;
  6375. renderChunk(
  6376. renderContext: RenderContextJavascriptModulesPlugin,
  6377. hooks: CompilationHooksJavascriptModulesPlugin
  6378. ): Source;
  6379. renderMain(
  6380. renderContext: MainRenderContext,
  6381. hooks: CompilationHooksJavascriptModulesPlugin,
  6382. compilation: Compilation
  6383. ): Source;
  6384. updateHashWithBootstrap(
  6385. hash: Hash,
  6386. renderContext: RenderBootstrapContext,
  6387. hooks: CompilationHooksJavascriptModulesPlugin
  6388. ): void;
  6389. renderBootstrap(
  6390. renderContext: RenderBootstrapContext,
  6391. hooks: CompilationHooksJavascriptModulesPlugin
  6392. ): Bootstrap;
  6393. renderRequire(
  6394. renderContext: RenderBootstrapContext,
  6395. hooks: CompilationHooksJavascriptModulesPlugin
  6396. ): string;
  6397. static getCompilationHooks(
  6398. compilation: Compilation
  6399. ): CompilationHooksJavascriptModulesPlugin;
  6400. static getChunkFilenameTemplate(
  6401. chunk: Chunk,
  6402. outputOptions: OutputNormalizedWithDefaults
  6403. ): TemplatePath;
  6404. static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
  6405. }
  6406. declare class JavascriptParser extends ParserClass {
  6407. constructor(
  6408. sourceType?: "module" | "auto" | "script",
  6409. options?: { parse?: (code: string, options: ParseOptions) => ParseResult }
  6410. );
  6411. hooks: Readonly<{
  6412. evaluateTypeof: HookMap<
  6413. SyncBailHook<
  6414. [UnaryExpression],
  6415. undefined | null | BasicEvaluatedExpression
  6416. >
  6417. >;
  6418. evaluate: HookMap<
  6419. SyncBailHook<
  6420. [
  6421. | ImportExpressionImport
  6422. | UnaryExpression
  6423. | ArrayExpression
  6424. | ArrowFunctionExpression
  6425. | AssignmentExpression
  6426. | AwaitExpression
  6427. | BinaryExpression
  6428. | SimpleCallExpression
  6429. | NewExpression
  6430. | ChainExpression
  6431. | ClassExpression
  6432. | ConditionalExpression
  6433. | FunctionExpression
  6434. | Identifier
  6435. | SimpleLiteral
  6436. | RegExpLiteral
  6437. | BigIntLiteral
  6438. | LogicalExpression
  6439. | MemberExpression
  6440. | MetaProperty
  6441. | ObjectExpression
  6442. | SequenceExpression
  6443. | TaggedTemplateExpression
  6444. | TemplateLiteral
  6445. | ThisExpression
  6446. | UpdateExpression
  6447. | YieldExpression
  6448. | SpreadElement
  6449. | PrivateIdentifier
  6450. | Super
  6451. ],
  6452. undefined | null | BasicEvaluatedExpression
  6453. >
  6454. >;
  6455. evaluateIdentifier: HookMap<
  6456. SyncBailHook<
  6457. [Identifier | MemberExpression | MetaProperty | ThisExpression],
  6458. undefined | null | BasicEvaluatedExpression
  6459. >
  6460. >;
  6461. evaluateDefinedIdentifier: HookMap<
  6462. SyncBailHook<
  6463. [Identifier | MemberExpression | ThisExpression],
  6464. undefined | null | BasicEvaluatedExpression
  6465. >
  6466. >;
  6467. evaluateNewExpression: HookMap<
  6468. SyncBailHook<[NewExpression], undefined | null | BasicEvaluatedExpression>
  6469. >;
  6470. evaluateCallExpression: HookMap<
  6471. SyncBailHook<
  6472. [CallExpression],
  6473. undefined | null | BasicEvaluatedExpression
  6474. >
  6475. >;
  6476. evaluateCallExpressionMember: HookMap<
  6477. SyncBailHook<
  6478. [CallExpression, BasicEvaluatedExpression],
  6479. undefined | null | BasicEvaluatedExpression
  6480. >
  6481. >;
  6482. isPure: HookMap<
  6483. SyncBailHook<
  6484. [
  6485. (
  6486. | ImportExpressionImport
  6487. | UnaryExpression
  6488. | ArrayExpression
  6489. | ArrowFunctionExpression
  6490. | AssignmentExpression
  6491. | AwaitExpression
  6492. | BinaryExpression
  6493. | SimpleCallExpression
  6494. | NewExpression
  6495. | ChainExpression
  6496. | ClassExpression
  6497. | ConditionalExpression
  6498. | FunctionExpression
  6499. | Identifier
  6500. | SimpleLiteral
  6501. | RegExpLiteral
  6502. | BigIntLiteral
  6503. | LogicalExpression
  6504. | MemberExpression
  6505. | MetaProperty
  6506. | ObjectExpression
  6507. | SequenceExpression
  6508. | TaggedTemplateExpression
  6509. | TemplateLiteral
  6510. | ThisExpression
  6511. | UpdateExpression
  6512. | YieldExpression
  6513. | PrivateIdentifier
  6514. | FunctionDeclaration
  6515. | MaybeNamedFunctionDeclaration
  6516. | VariableDeclaration
  6517. | ClassDeclaration
  6518. | MaybeNamedClassDeclaration
  6519. ),
  6520. number
  6521. ],
  6522. boolean | void
  6523. >
  6524. >;
  6525. preStatement: SyncBailHook<
  6526. [
  6527. | ImportDeclaration
  6528. | ExportNamedDeclaration
  6529. | ExportAllDeclaration
  6530. | FunctionDeclaration
  6531. | MaybeNamedFunctionDeclaration
  6532. | VariableDeclaration
  6533. | ClassDeclaration
  6534. | MaybeNamedClassDeclaration
  6535. | ExpressionStatement
  6536. | BlockStatement
  6537. | StaticBlock
  6538. | EmptyStatement
  6539. | DebuggerStatement
  6540. | WithStatement
  6541. | ReturnStatement
  6542. | LabeledStatement
  6543. | BreakStatement
  6544. | ContinueStatement
  6545. | IfStatement
  6546. | SwitchStatement
  6547. | ThrowStatement
  6548. | TryStatement
  6549. | WhileStatement
  6550. | DoWhileStatement
  6551. | ForStatement
  6552. | ForInStatement
  6553. | ForOfStatement
  6554. | ExportDefaultDeclaration
  6555. ],
  6556. boolean | void
  6557. >;
  6558. blockPreStatement: SyncBailHook<
  6559. [
  6560. | ImportDeclaration
  6561. | ExportNamedDeclaration
  6562. | ExportAllDeclaration
  6563. | FunctionDeclaration
  6564. | MaybeNamedFunctionDeclaration
  6565. | VariableDeclaration
  6566. | ClassDeclaration
  6567. | MaybeNamedClassDeclaration
  6568. | ExpressionStatement
  6569. | BlockStatement
  6570. | StaticBlock
  6571. | EmptyStatement
  6572. | DebuggerStatement
  6573. | WithStatement
  6574. | ReturnStatement
  6575. | LabeledStatement
  6576. | BreakStatement
  6577. | ContinueStatement
  6578. | IfStatement
  6579. | SwitchStatement
  6580. | ThrowStatement
  6581. | TryStatement
  6582. | WhileStatement
  6583. | DoWhileStatement
  6584. | ForStatement
  6585. | ForInStatement
  6586. | ForOfStatement
  6587. | ExportDefaultDeclaration
  6588. ],
  6589. boolean | void
  6590. >;
  6591. statement: SyncBailHook<
  6592. [
  6593. | ImportDeclaration
  6594. | ExportNamedDeclaration
  6595. | ExportAllDeclaration
  6596. | FunctionDeclaration
  6597. | MaybeNamedFunctionDeclaration
  6598. | VariableDeclaration
  6599. | ClassDeclaration
  6600. | MaybeNamedClassDeclaration
  6601. | ExpressionStatement
  6602. | BlockStatement
  6603. | StaticBlock
  6604. | EmptyStatement
  6605. | DebuggerStatement
  6606. | WithStatement
  6607. | ReturnStatement
  6608. | LabeledStatement
  6609. | BreakStatement
  6610. | ContinueStatement
  6611. | IfStatement
  6612. | SwitchStatement
  6613. | ThrowStatement
  6614. | TryStatement
  6615. | WhileStatement
  6616. | DoWhileStatement
  6617. | ForStatement
  6618. | ForInStatement
  6619. | ForOfStatement
  6620. | ExportDefaultDeclaration
  6621. ],
  6622. boolean | void
  6623. >;
  6624. statementIf: SyncBailHook<[IfStatement], boolean | void>;
  6625. classExtendsExpression: SyncBailHook<
  6626. [
  6627. Expression,
  6628. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6629. ],
  6630. boolean | void
  6631. >;
  6632. classBodyElement: SyncBailHook<
  6633. [
  6634. StaticBlock | MethodDefinition | PropertyDefinition,
  6635. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6636. ],
  6637. boolean | void
  6638. >;
  6639. classBodyValue: SyncBailHook<
  6640. [
  6641. Expression,
  6642. MethodDefinition | PropertyDefinition,
  6643. ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6644. ],
  6645. boolean | void
  6646. >;
  6647. label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
  6648. import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
  6649. importSpecifier: SyncBailHook<
  6650. [ImportDeclaration, ImportSource, null | string, string],
  6651. boolean | void
  6652. >;
  6653. export: SyncBailHook<
  6654. [ExportNamedDeclaration | ExportDefaultDeclaration],
  6655. boolean | void
  6656. >;
  6657. exportImport: SyncBailHook<
  6658. [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
  6659. boolean | void
  6660. >;
  6661. exportDeclaration: SyncBailHook<
  6662. [
  6663. (
  6664. | ExportNamedDeclaration
  6665. | ExportAllDeclaration
  6666. | ExportDefaultDeclaration
  6667. ),
  6668. Declaration
  6669. ],
  6670. boolean | void
  6671. >;
  6672. exportExpression: SyncBailHook<
  6673. [
  6674. ExportDefaultDeclaration,
  6675. (
  6676. | ImportExpressionImport
  6677. | UnaryExpression
  6678. | ArrayExpression
  6679. | ArrowFunctionExpression
  6680. | AssignmentExpression
  6681. | AwaitExpression
  6682. | BinaryExpression
  6683. | SimpleCallExpression
  6684. | NewExpression
  6685. | ChainExpression
  6686. | ClassExpression
  6687. | ConditionalExpression
  6688. | FunctionExpression
  6689. | Identifier
  6690. | SimpleLiteral
  6691. | RegExpLiteral
  6692. | BigIntLiteral
  6693. | LogicalExpression
  6694. | MemberExpression
  6695. | MetaProperty
  6696. | ObjectExpression
  6697. | SequenceExpression
  6698. | TaggedTemplateExpression
  6699. | TemplateLiteral
  6700. | ThisExpression
  6701. | UpdateExpression
  6702. | YieldExpression
  6703. | MaybeNamedFunctionDeclaration
  6704. | MaybeNamedClassDeclaration
  6705. )
  6706. ],
  6707. boolean | void
  6708. >;
  6709. exportSpecifier: SyncBailHook<
  6710. [
  6711. (
  6712. | ExportNamedDeclaration
  6713. | ExportAllDeclaration
  6714. | ExportDefaultDeclaration
  6715. ),
  6716. string,
  6717. string,
  6718. undefined | number
  6719. ],
  6720. boolean | void
  6721. >;
  6722. exportImportSpecifier: SyncBailHook<
  6723. [
  6724. ExportNamedDeclaration | ExportAllDeclaration,
  6725. ImportSource,
  6726. null | string,
  6727. null | string,
  6728. undefined | number
  6729. ],
  6730. boolean | void
  6731. >;
  6732. preDeclarator: SyncBailHook<
  6733. [VariableDeclarator, Statement],
  6734. boolean | void
  6735. >;
  6736. declarator: SyncBailHook<[VariableDeclarator, Statement], boolean | void>;
  6737. varDeclaration: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6738. varDeclarationLet: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6739. varDeclarationConst: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6740. varDeclarationUsing: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6741. varDeclarationVar: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6742. pattern: HookMap<SyncBailHook<[Identifier], boolean | void>>;
  6743. collectDestructuringAssignmentProperties: SyncBailHook<
  6744. [Expression],
  6745. boolean | void
  6746. >;
  6747. canRename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6748. rename: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6749. assign: HookMap<SyncBailHook<[AssignmentExpression], boolean | void>>;
  6750. assignMemberChain: HookMap<
  6751. SyncBailHook<[AssignmentExpression, string[]], boolean | void>
  6752. >;
  6753. typeof: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6754. importCall: SyncBailHook<
  6755. [
  6756. ImportExpressionJavascriptParser,
  6757. undefined | SimpleCallExpression | NewExpression
  6758. ],
  6759. boolean | void
  6760. >;
  6761. topLevelAwait: SyncBailHook<
  6762. [
  6763. | ImportExpressionImport
  6764. | UnaryExpression
  6765. | ArrayExpression
  6766. | ArrowFunctionExpression
  6767. | AssignmentExpression
  6768. | AwaitExpression
  6769. | BinaryExpression
  6770. | SimpleCallExpression
  6771. | NewExpression
  6772. | ChainExpression
  6773. | ClassExpression
  6774. | ConditionalExpression
  6775. | FunctionExpression
  6776. | Identifier
  6777. | SimpleLiteral
  6778. | RegExpLiteral
  6779. | BigIntLiteral
  6780. | LogicalExpression
  6781. | MemberExpression
  6782. | MetaProperty
  6783. | ObjectExpression
  6784. | SequenceExpression
  6785. | TaggedTemplateExpression
  6786. | TemplateLiteral
  6787. | ThisExpression
  6788. | UpdateExpression
  6789. | YieldExpression
  6790. | ForOfStatement
  6791. ],
  6792. boolean | void
  6793. >;
  6794. call: HookMap<SyncBailHook<[CallExpression], boolean | void>>;
  6795. callMemberChain: HookMap<
  6796. SyncBailHook<
  6797. [CallExpression, string[], boolean[], [number, number][]],
  6798. boolean | void
  6799. >
  6800. >;
  6801. memberChainOfCallMemberChain: HookMap<
  6802. SyncBailHook<
  6803. [Expression, string[], CallExpression, string[], [number, number][]],
  6804. boolean | void
  6805. >
  6806. >;
  6807. callMemberChainOfCallMemberChain: HookMap<
  6808. SyncBailHook<
  6809. [
  6810. CallExpression,
  6811. string[],
  6812. CallExpression,
  6813. string[],
  6814. [number, number][]
  6815. ],
  6816. boolean | void
  6817. >
  6818. >;
  6819. optionalChaining: SyncBailHook<[ChainExpression], boolean | void>;
  6820. new: HookMap<SyncBailHook<[NewExpression], boolean | void>>;
  6821. binaryExpression: SyncBailHook<[BinaryExpression], boolean | void>;
  6822. expression: HookMap<SyncBailHook<[Expression], boolean | void>>;
  6823. expressionMemberChain: HookMap<
  6824. SyncBailHook<
  6825. [MemberExpression, string[], boolean[], [number, number][]],
  6826. boolean | void
  6827. >
  6828. >;
  6829. unhandledExpressionMemberChain: HookMap<
  6830. SyncBailHook<[MemberExpression, string[]], boolean | void>
  6831. >;
  6832. expressionConditionalOperator: SyncBailHook<
  6833. [ConditionalExpression],
  6834. boolean | void
  6835. >;
  6836. expressionLogicalOperator: SyncBailHook<
  6837. [LogicalExpression],
  6838. boolean | void
  6839. >;
  6840. program: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
  6841. terminate: SyncBailHook<[ReturnStatement | ThrowStatement], boolean | void>;
  6842. finish: SyncBailHook<[Program, CommentJavascriptParser[]], boolean | void>;
  6843. unusedStatement: SyncBailHook<[Statement], boolean | void>;
  6844. }>;
  6845. sourceType: "module" | "auto" | "script";
  6846. options: { parse?: (code: string, options: ParseOptions) => ParseResult };
  6847. scope: ScopeInfo;
  6848. state: JavascriptParserState;
  6849. comments?: CommentJavascriptParser[];
  6850. semicolons?: Set<number>;
  6851. statementPath?: StatementPathItem[];
  6852. prevStatement?:
  6853. | ImportDeclaration
  6854. | ExportNamedDeclaration
  6855. | ExportAllDeclaration
  6856. | ImportExpressionImport
  6857. | UnaryExpression
  6858. | ArrayExpression
  6859. | ArrowFunctionExpression
  6860. | AssignmentExpression
  6861. | AwaitExpression
  6862. | BinaryExpression
  6863. | SimpleCallExpression
  6864. | NewExpression
  6865. | ChainExpression
  6866. | ClassExpression
  6867. | ConditionalExpression
  6868. | FunctionExpression
  6869. | Identifier
  6870. | SimpleLiteral
  6871. | RegExpLiteral
  6872. | BigIntLiteral
  6873. | LogicalExpression
  6874. | MemberExpression
  6875. | MetaProperty
  6876. | ObjectExpression
  6877. | SequenceExpression
  6878. | TaggedTemplateExpression
  6879. | TemplateLiteral
  6880. | ThisExpression
  6881. | UpdateExpression
  6882. | YieldExpression
  6883. | FunctionDeclaration
  6884. | MaybeNamedFunctionDeclaration
  6885. | VariableDeclaration
  6886. | ClassDeclaration
  6887. | MaybeNamedClassDeclaration
  6888. | ExpressionStatement
  6889. | BlockStatement
  6890. | StaticBlock
  6891. | EmptyStatement
  6892. | DebuggerStatement
  6893. | WithStatement
  6894. | ReturnStatement
  6895. | LabeledStatement
  6896. | BreakStatement
  6897. | ContinueStatement
  6898. | IfStatement
  6899. | SwitchStatement
  6900. | ThrowStatement
  6901. | TryStatement
  6902. | WhileStatement
  6903. | DoWhileStatement
  6904. | ForStatement
  6905. | ForInStatement
  6906. | ForOfStatement
  6907. | ExportDefaultDeclaration;
  6908. destructuringAssignmentProperties?: WeakMap<
  6909. Expression,
  6910. Set<DestructuringAssignmentProperty>
  6911. >;
  6912. currentTagData?:
  6913. | Record<string, any>
  6914. | TopLevelSymbol
  6915. | HarmonySettings
  6916. | ImportSettings
  6917. | CommonJsImportSettings
  6918. | CompatibilitySettings;
  6919. magicCommentContext: Context;
  6920. destructuringAssignmentPropertiesFor(
  6921. node: Expression
  6922. ): undefined | Set<DestructuringAssignmentProperty>;
  6923. getRenameIdentifier(
  6924. expr:
  6925. | ImportExpressionImport
  6926. | UnaryExpression
  6927. | ArrayExpression
  6928. | ArrowFunctionExpression
  6929. | AssignmentExpression
  6930. | AwaitExpression
  6931. | BinaryExpression
  6932. | SimpleCallExpression
  6933. | NewExpression
  6934. | ChainExpression
  6935. | ClassExpression
  6936. | ConditionalExpression
  6937. | FunctionExpression
  6938. | Identifier
  6939. | SimpleLiteral
  6940. | RegExpLiteral
  6941. | BigIntLiteral
  6942. | LogicalExpression
  6943. | MemberExpression
  6944. | MetaProperty
  6945. | ObjectExpression
  6946. | SequenceExpression
  6947. | TaggedTemplateExpression
  6948. | TemplateLiteral
  6949. | ThisExpression
  6950. | UpdateExpression
  6951. | YieldExpression
  6952. | SpreadElement
  6953. ): undefined | string | VariableInfo;
  6954. walkClass(
  6955. classy: ClassExpression | ClassDeclaration | MaybeNamedClassDeclaration
  6956. ): void;
  6957. /**
  6958. * Module pre walking iterates the scope for import entries
  6959. */
  6960. modulePreWalkStatements(
  6961. statements: (
  6962. | ImportDeclaration
  6963. | ExportNamedDeclaration
  6964. | ExportAllDeclaration
  6965. | FunctionDeclaration
  6966. | VariableDeclaration
  6967. | ClassDeclaration
  6968. | ExpressionStatement
  6969. | BlockStatement
  6970. | StaticBlock
  6971. | EmptyStatement
  6972. | DebuggerStatement
  6973. | WithStatement
  6974. | ReturnStatement
  6975. | LabeledStatement
  6976. | BreakStatement
  6977. | ContinueStatement
  6978. | IfStatement
  6979. | SwitchStatement
  6980. | ThrowStatement
  6981. | TryStatement
  6982. | WhileStatement
  6983. | DoWhileStatement
  6984. | ForStatement
  6985. | ForInStatement
  6986. | ForOfStatement
  6987. | ExportDefaultDeclaration
  6988. )[]
  6989. ): void;
  6990. /**
  6991. * Pre walking iterates the scope for variable declarations
  6992. */
  6993. preWalkStatements(
  6994. statements: (
  6995. | ImportDeclaration
  6996. | ExportNamedDeclaration
  6997. | ExportAllDeclaration
  6998. | FunctionDeclaration
  6999. | VariableDeclaration
  7000. | ClassDeclaration
  7001. | ExpressionStatement
  7002. | BlockStatement
  7003. | StaticBlock
  7004. | EmptyStatement
  7005. | DebuggerStatement
  7006. | WithStatement
  7007. | ReturnStatement
  7008. | LabeledStatement
  7009. | BreakStatement
  7010. | ContinueStatement
  7011. | IfStatement
  7012. | SwitchStatement
  7013. | ThrowStatement
  7014. | TryStatement
  7015. | WhileStatement
  7016. | DoWhileStatement
  7017. | ForStatement
  7018. | ForInStatement
  7019. | ForOfStatement
  7020. | ExportDefaultDeclaration
  7021. )[]
  7022. ): void;
  7023. /**
  7024. * Block pre walking iterates the scope for block variable declarations
  7025. */
  7026. blockPreWalkStatements(
  7027. statements: (
  7028. | ImportDeclaration
  7029. | ExportNamedDeclaration
  7030. | ExportAllDeclaration
  7031. | FunctionDeclaration
  7032. | VariableDeclaration
  7033. | ClassDeclaration
  7034. | ExpressionStatement
  7035. | BlockStatement
  7036. | StaticBlock
  7037. | EmptyStatement
  7038. | DebuggerStatement
  7039. | WithStatement
  7040. | ReturnStatement
  7041. | LabeledStatement
  7042. | BreakStatement
  7043. | ContinueStatement
  7044. | IfStatement
  7045. | SwitchStatement
  7046. | ThrowStatement
  7047. | TryStatement
  7048. | WhileStatement
  7049. | DoWhileStatement
  7050. | ForStatement
  7051. | ForInStatement
  7052. | ForOfStatement
  7053. | ExportDefaultDeclaration
  7054. )[]
  7055. ): void;
  7056. /**
  7057. * Walking iterates the statements and expressions and processes them
  7058. */
  7059. walkStatements(
  7060. statements: (
  7061. | ImportDeclaration
  7062. | ExportNamedDeclaration
  7063. | ExportAllDeclaration
  7064. | FunctionDeclaration
  7065. | VariableDeclaration
  7066. | ClassDeclaration
  7067. | ExpressionStatement
  7068. | BlockStatement
  7069. | StaticBlock
  7070. | EmptyStatement
  7071. | DebuggerStatement
  7072. | WithStatement
  7073. | ReturnStatement
  7074. | LabeledStatement
  7075. | BreakStatement
  7076. | ContinueStatement
  7077. | IfStatement
  7078. | SwitchStatement
  7079. | ThrowStatement
  7080. | TryStatement
  7081. | WhileStatement
  7082. | DoWhileStatement
  7083. | ForStatement
  7084. | ForInStatement
  7085. | ForOfStatement
  7086. | ExportDefaultDeclaration
  7087. )[]
  7088. ): void;
  7089. /**
  7090. * Walking iterates the statements and expressions and processes them
  7091. */
  7092. preWalkStatement(
  7093. statement:
  7094. | ImportDeclaration
  7095. | ExportNamedDeclaration
  7096. | ExportAllDeclaration
  7097. | FunctionDeclaration
  7098. | MaybeNamedFunctionDeclaration
  7099. | VariableDeclaration
  7100. | ClassDeclaration
  7101. | MaybeNamedClassDeclaration
  7102. | ExpressionStatement
  7103. | BlockStatement
  7104. | StaticBlock
  7105. | EmptyStatement
  7106. | DebuggerStatement
  7107. | WithStatement
  7108. | ReturnStatement
  7109. | LabeledStatement
  7110. | BreakStatement
  7111. | ContinueStatement
  7112. | IfStatement
  7113. | SwitchStatement
  7114. | ThrowStatement
  7115. | TryStatement
  7116. | WhileStatement
  7117. | DoWhileStatement
  7118. | ForStatement
  7119. | ForInStatement
  7120. | ForOfStatement
  7121. | ExportDefaultDeclaration
  7122. ): void;
  7123. blockPreWalkStatement(
  7124. statement:
  7125. | ImportDeclaration
  7126. | ExportNamedDeclaration
  7127. | ExportAllDeclaration
  7128. | FunctionDeclaration
  7129. | MaybeNamedFunctionDeclaration
  7130. | VariableDeclaration
  7131. | ClassDeclaration
  7132. | MaybeNamedClassDeclaration
  7133. | ExpressionStatement
  7134. | BlockStatement
  7135. | StaticBlock
  7136. | EmptyStatement
  7137. | DebuggerStatement
  7138. | WithStatement
  7139. | ReturnStatement
  7140. | LabeledStatement
  7141. | BreakStatement
  7142. | ContinueStatement
  7143. | IfStatement
  7144. | SwitchStatement
  7145. | ThrowStatement
  7146. | TryStatement
  7147. | WhileStatement
  7148. | DoWhileStatement
  7149. | ForStatement
  7150. | ForInStatement
  7151. | ForOfStatement
  7152. | ExportDefaultDeclaration
  7153. ): void;
  7154. walkStatement(
  7155. statement:
  7156. | ImportDeclaration
  7157. | ExportNamedDeclaration
  7158. | ExportAllDeclaration
  7159. | FunctionDeclaration
  7160. | MaybeNamedFunctionDeclaration
  7161. | VariableDeclaration
  7162. | ClassDeclaration
  7163. | MaybeNamedClassDeclaration
  7164. | ExpressionStatement
  7165. | BlockStatement
  7166. | StaticBlock
  7167. | EmptyStatement
  7168. | DebuggerStatement
  7169. | WithStatement
  7170. | ReturnStatement
  7171. | LabeledStatement
  7172. | BreakStatement
  7173. | ContinueStatement
  7174. | IfStatement
  7175. | SwitchStatement
  7176. | ThrowStatement
  7177. | TryStatement
  7178. | WhileStatement
  7179. | DoWhileStatement
  7180. | ForStatement
  7181. | ForInStatement
  7182. | ForOfStatement
  7183. | ExportDefaultDeclaration
  7184. ): void;
  7185. /**
  7186. * Walks a statements that is nested within a parent statement
  7187. * and can potentially be a non-block statement.
  7188. * This enforces the nested statement to never be in ASI position.
  7189. */
  7190. walkNestedStatement(statement: Statement): void;
  7191. preWalkBlockStatement(statement: BlockStatement): void;
  7192. walkBlockStatement(statement: BlockStatement | StaticBlock): void;
  7193. walkExpressionStatement(statement: ExpressionStatement): void;
  7194. preWalkIfStatement(statement: IfStatement): void;
  7195. walkIfStatement(statement: IfStatement): void;
  7196. preWalkLabeledStatement(statement: LabeledStatement): void;
  7197. walkLabeledStatement(statement: LabeledStatement): void;
  7198. preWalkWithStatement(statement: WithStatement): void;
  7199. walkWithStatement(statement: WithStatement): void;
  7200. preWalkSwitchStatement(statement: SwitchStatement): void;
  7201. walkSwitchStatement(statement: SwitchStatement): void;
  7202. walkTerminatingStatement(statement: ReturnStatement | ThrowStatement): void;
  7203. walkReturnStatement(statement: ReturnStatement): void;
  7204. walkThrowStatement(statement: ThrowStatement): void;
  7205. preWalkTryStatement(statement: TryStatement): void;
  7206. walkTryStatement(statement: TryStatement): void;
  7207. preWalkWhileStatement(statement: WhileStatement): void;
  7208. walkWhileStatement(statement: WhileStatement): void;
  7209. preWalkDoWhileStatement(statement: DoWhileStatement): void;
  7210. walkDoWhileStatement(statement: DoWhileStatement): void;
  7211. preWalkForStatement(statement: ForStatement): void;
  7212. walkForStatement(statement: ForStatement): void;
  7213. preWalkForInStatement(statement: ForInStatement): void;
  7214. walkForInStatement(statement: ForInStatement): void;
  7215. preWalkForOfStatement(statement: ForOfStatement): void;
  7216. walkForOfStatement(statement: ForOfStatement): void;
  7217. preWalkFunctionDeclaration(
  7218. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  7219. ): void;
  7220. walkFunctionDeclaration(
  7221. statement: FunctionDeclaration | MaybeNamedFunctionDeclaration
  7222. ): void;
  7223. blockPreWalkExpressionStatement(statement: ExpressionStatement): void;
  7224. preWalkAssignmentExpression(expression: AssignmentExpression): void;
  7225. enterDestructuringAssignment(
  7226. pattern: Pattern,
  7227. expression: Expression
  7228. ):
  7229. | undefined
  7230. | ImportExpressionImport
  7231. | UnaryExpression
  7232. | ArrayExpression
  7233. | ArrowFunctionExpression
  7234. | AssignmentExpression
  7235. | AwaitExpression
  7236. | BinaryExpression
  7237. | SimpleCallExpression
  7238. | NewExpression
  7239. | ChainExpression
  7240. | ClassExpression
  7241. | ConditionalExpression
  7242. | FunctionExpression
  7243. | Identifier
  7244. | SimpleLiteral
  7245. | RegExpLiteral
  7246. | BigIntLiteral
  7247. | LogicalExpression
  7248. | MemberExpression
  7249. | MetaProperty
  7250. | ObjectExpression
  7251. | SequenceExpression
  7252. | TaggedTemplateExpression
  7253. | TemplateLiteral
  7254. | ThisExpression
  7255. | UpdateExpression
  7256. | YieldExpression;
  7257. modulePreWalkImportDeclaration(statement: ImportDeclaration): void;
  7258. enterDeclaration(
  7259. declaration: Declaration,
  7260. onIdent: (ident: string, identifier: Identifier) => void
  7261. ): void;
  7262. modulePreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7263. blockPreWalkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7264. walkExportNamedDeclaration(statement: ExportNamedDeclaration): void;
  7265. blockPreWalkExportDefaultDeclaration(
  7266. statement: ExportDefaultDeclaration
  7267. ): void;
  7268. walkExportDefaultDeclaration(statement: ExportDefaultDeclaration): void;
  7269. modulePreWalkExportAllDeclaration(statement: ExportAllDeclaration): void;
  7270. preWalkVariableDeclaration(statement: VariableDeclaration): void;
  7271. blockPreWalkVariableDeclaration(statement: VariableDeclaration): void;
  7272. preWalkVariableDeclarator(declarator: VariableDeclarator): void;
  7273. walkVariableDeclaration(statement: VariableDeclaration): void;
  7274. blockPreWalkClassDeclaration(
  7275. statement: ClassDeclaration | MaybeNamedClassDeclaration
  7276. ): void;
  7277. walkClassDeclaration(
  7278. statement: ClassDeclaration | MaybeNamedClassDeclaration
  7279. ): void;
  7280. preWalkSwitchCases(switchCases: SwitchCase[]): void;
  7281. walkSwitchCases(switchCases: SwitchCase[]): void;
  7282. preWalkCatchClause(catchClause: CatchClause): void;
  7283. walkCatchClause(catchClause: CatchClause): void;
  7284. walkPattern(pattern: Pattern): void;
  7285. walkAssignmentPattern(pattern: AssignmentPattern): void;
  7286. walkObjectPattern(pattern: ObjectPattern): void;
  7287. walkArrayPattern(pattern: ArrayPattern): void;
  7288. walkRestElement(pattern: RestElement): void;
  7289. walkExpressions(
  7290. expressions: (
  7291. | null
  7292. | ImportExpressionImport
  7293. | UnaryExpression
  7294. | ArrayExpression
  7295. | ArrowFunctionExpression
  7296. | AssignmentExpression
  7297. | AwaitExpression
  7298. | BinaryExpression
  7299. | SimpleCallExpression
  7300. | NewExpression
  7301. | ChainExpression
  7302. | ClassExpression
  7303. | ConditionalExpression
  7304. | FunctionExpression
  7305. | Identifier
  7306. | SimpleLiteral
  7307. | RegExpLiteral
  7308. | BigIntLiteral
  7309. | LogicalExpression
  7310. | MemberExpression
  7311. | MetaProperty
  7312. | ObjectExpression
  7313. | SequenceExpression
  7314. | TaggedTemplateExpression
  7315. | TemplateLiteral
  7316. | ThisExpression
  7317. | UpdateExpression
  7318. | YieldExpression
  7319. | SpreadElement
  7320. )[]
  7321. ): void;
  7322. walkExpression(
  7323. expression:
  7324. | ImportExpressionImport
  7325. | UnaryExpression
  7326. | ArrayExpression
  7327. | ArrowFunctionExpression
  7328. | AssignmentExpression
  7329. | AwaitExpression
  7330. | BinaryExpression
  7331. | SimpleCallExpression
  7332. | NewExpression
  7333. | ChainExpression
  7334. | ClassExpression
  7335. | ConditionalExpression
  7336. | FunctionExpression
  7337. | Identifier
  7338. | SimpleLiteral
  7339. | RegExpLiteral
  7340. | BigIntLiteral
  7341. | LogicalExpression
  7342. | MemberExpression
  7343. | MetaProperty
  7344. | ObjectExpression
  7345. | SequenceExpression
  7346. | TaggedTemplateExpression
  7347. | TemplateLiteral
  7348. | ThisExpression
  7349. | UpdateExpression
  7350. | YieldExpression
  7351. | SpreadElement
  7352. | PrivateIdentifier
  7353. | Super
  7354. ): void;
  7355. walkAwaitExpression(expression: AwaitExpression): void;
  7356. walkArrayExpression(expression: ArrayExpression): void;
  7357. walkSpreadElement(expression: SpreadElement): void;
  7358. walkObjectExpression(expression: ObjectExpression): void;
  7359. walkProperty(prop: SpreadElement | Property): void;
  7360. walkFunctionExpression(expression: FunctionExpression): void;
  7361. walkArrowFunctionExpression(expression: ArrowFunctionExpression): void;
  7362. walkSequenceExpression(expression: SequenceExpression): void;
  7363. walkUpdateExpression(expression: UpdateExpression): void;
  7364. walkUnaryExpression(expression: UnaryExpression): void;
  7365. walkLeftRightExpression(
  7366. expression: BinaryExpression | LogicalExpression
  7367. ): void;
  7368. walkBinaryExpression(expression: BinaryExpression): void;
  7369. walkLogicalExpression(expression: LogicalExpression): void;
  7370. walkAssignmentExpression(expression: AssignmentExpression): void;
  7371. walkConditionalExpression(expression: ConditionalExpression): void;
  7372. walkNewExpression(expression: NewExpression): void;
  7373. walkYieldExpression(expression: YieldExpression): void;
  7374. walkTemplateLiteral(expression: TemplateLiteral): void;
  7375. walkTaggedTemplateExpression(expression: TaggedTemplateExpression): void;
  7376. walkClassExpression(expression: ClassExpression): void;
  7377. walkChainExpression(expression: ChainExpression): void;
  7378. walkImportExpression(expression: ImportExpressionJavascriptParser): void;
  7379. walkCallExpression(expression: CallExpression): void;
  7380. walkMemberExpression(expression: MemberExpression): void;
  7381. walkMemberExpressionWithExpressionName<R>(
  7382. expression: MemberExpression,
  7383. name: string,
  7384. rootInfo: string | VariableInfo,
  7385. members: string[],
  7386. onUnhandled: () => undefined | R
  7387. ): void;
  7388. walkThisExpression(expression: ThisExpression): void;
  7389. walkIdentifier(expression: Identifier): void;
  7390. walkMetaProperty(metaProperty: MetaProperty): void;
  7391. callHooksForExpression<T, R>(
  7392. hookMap: HookMap<SyncBailHook<T, R>>,
  7393. expr:
  7394. | ImportExpressionImport
  7395. | UnaryExpression
  7396. | ArrayExpression
  7397. | ArrowFunctionExpression
  7398. | AssignmentExpression
  7399. | AwaitExpression
  7400. | BinaryExpression
  7401. | SimpleCallExpression
  7402. | NewExpression
  7403. | ChainExpression
  7404. | ClassExpression
  7405. | ConditionalExpression
  7406. | FunctionExpression
  7407. | Identifier
  7408. | SimpleLiteral
  7409. | RegExpLiteral
  7410. | BigIntLiteral
  7411. | LogicalExpression
  7412. | MemberExpression
  7413. | MetaProperty
  7414. | ObjectExpression
  7415. | SequenceExpression
  7416. | TaggedTemplateExpression
  7417. | TemplateLiteral
  7418. | ThisExpression
  7419. | UpdateExpression
  7420. | YieldExpression
  7421. | Super,
  7422. ...args: AsArray<T>
  7423. ): undefined | R;
  7424. callHooksForExpressionWithFallback<T, R>(
  7425. hookMap: HookMap<SyncBailHook<T, R>>,
  7426. expr:
  7427. | ImportExpressionImport
  7428. | UnaryExpression
  7429. | ArrayExpression
  7430. | ArrowFunctionExpression
  7431. | AssignmentExpression
  7432. | AwaitExpression
  7433. | BinaryExpression
  7434. | SimpleCallExpression
  7435. | NewExpression
  7436. | ChainExpression
  7437. | ClassExpression
  7438. | ConditionalExpression
  7439. | FunctionExpression
  7440. | Identifier
  7441. | SimpleLiteral
  7442. | RegExpLiteral
  7443. | BigIntLiteral
  7444. | LogicalExpression
  7445. | MemberExpression
  7446. | MetaProperty
  7447. | ObjectExpression
  7448. | SequenceExpression
  7449. | TaggedTemplateExpression
  7450. | TemplateLiteral
  7451. | ThisExpression
  7452. | UpdateExpression
  7453. | YieldExpression
  7454. | Super,
  7455. fallback:
  7456. | undefined
  7457. | ((
  7458. name: string,
  7459. rootInfo: string | VariableInfo | ScopeInfo,
  7460. getMembers: () => string[]
  7461. ) => R),
  7462. defined: undefined | ((result?: string) => undefined | R),
  7463. ...args: AsArray<T>
  7464. ): undefined | R;
  7465. callHooksForName<T, R>(
  7466. hookMap: HookMap<SyncBailHook<T, R>>,
  7467. name: string,
  7468. ...args: AsArray<T>
  7469. ): undefined | R;
  7470. callHooksForInfo<T, R>(
  7471. hookMap: HookMap<SyncBailHook<T, R>>,
  7472. info: ExportedVariableInfo,
  7473. ...args: AsArray<T>
  7474. ): undefined | R;
  7475. callHooksForInfoWithFallback<T, R>(
  7476. hookMap: HookMap<SyncBailHook<T, R>>,
  7477. info: ExportedVariableInfo,
  7478. fallback: undefined | ((name: string) => undefined | R),
  7479. defined: undefined | ((result?: string) => undefined | R),
  7480. ...args: AsArray<T>
  7481. ): undefined | R;
  7482. callHooksForNameWithFallback<T, R>(
  7483. hookMap: HookMap<SyncBailHook<T, R>>,
  7484. name: string,
  7485. fallback: undefined | ((value: string) => undefined | R),
  7486. defined: undefined | (() => R),
  7487. ...args: AsArray<T>
  7488. ): undefined | R;
  7489. inScope(
  7490. params: (
  7491. | string
  7492. | Identifier
  7493. | MemberExpression
  7494. | ObjectPattern
  7495. | ArrayPattern
  7496. | RestElement
  7497. | AssignmentPattern
  7498. | Property
  7499. )[],
  7500. fn: () => void
  7501. ): void;
  7502. inClassScope(hasThis: boolean, params: Identifier[], fn: () => void): void;
  7503. inFunctionScope(
  7504. hasThis: boolean,
  7505. params: (
  7506. | string
  7507. | Identifier
  7508. | MemberExpression
  7509. | ObjectPattern
  7510. | ArrayPattern
  7511. | RestElement
  7512. | AssignmentPattern
  7513. )[],
  7514. fn: () => void
  7515. ): void;
  7516. inBlockScope(fn: () => void, inExecutedPath?: boolean): void;
  7517. detectMode(
  7518. statements: (
  7519. | ImportDeclaration
  7520. | ExportNamedDeclaration
  7521. | ExportAllDeclaration
  7522. | FunctionDeclaration
  7523. | VariableDeclaration
  7524. | ClassDeclaration
  7525. | ExpressionStatement
  7526. | BlockStatement
  7527. | StaticBlock
  7528. | EmptyStatement
  7529. | DebuggerStatement
  7530. | WithStatement
  7531. | ReturnStatement
  7532. | LabeledStatement
  7533. | BreakStatement
  7534. | ContinueStatement
  7535. | IfStatement
  7536. | SwitchStatement
  7537. | ThrowStatement
  7538. | TryStatement
  7539. | WhileStatement
  7540. | DoWhileStatement
  7541. | ForStatement
  7542. | ForInStatement
  7543. | ForOfStatement
  7544. | ExportDefaultDeclaration
  7545. | Directive
  7546. )[]
  7547. ): void;
  7548. enterPatterns(
  7549. patterns: (
  7550. | string
  7551. | Identifier
  7552. | MemberExpression
  7553. | ObjectPattern
  7554. | ArrayPattern
  7555. | RestElement
  7556. | AssignmentPattern
  7557. | Property
  7558. )[],
  7559. onIdent: (ident: string) => void
  7560. ): void;
  7561. enterPattern(
  7562. pattern:
  7563. | Identifier
  7564. | MemberExpression
  7565. | ObjectPattern
  7566. | ArrayPattern
  7567. | RestElement
  7568. | AssignmentPattern
  7569. | Property,
  7570. onIdent: (ident: string, identifier: Identifier) => void
  7571. ): void;
  7572. enterIdentifier(
  7573. pattern: Identifier,
  7574. onIdent: (ident: string, identifier: Identifier) => void
  7575. ): void;
  7576. enterObjectPattern(
  7577. pattern: ObjectPattern,
  7578. onIdent: (ident: string, identifier: Identifier) => void
  7579. ): void;
  7580. enterArrayPattern(
  7581. pattern: ArrayPattern,
  7582. onIdent: (ident: string, identifier: Identifier) => void
  7583. ): void;
  7584. enterRestElement(
  7585. pattern: RestElement,
  7586. onIdent: (ident: string, identifier: Identifier) => void
  7587. ): void;
  7588. enterAssignmentPattern(
  7589. pattern: AssignmentPattern,
  7590. onIdent: (ident: string, identifier: Identifier) => void
  7591. ): void;
  7592. evaluateExpression(
  7593. expression:
  7594. | ImportExpressionImport
  7595. | UnaryExpression
  7596. | ArrayExpression
  7597. | ArrowFunctionExpression
  7598. | AssignmentExpression
  7599. | AwaitExpression
  7600. | BinaryExpression
  7601. | SimpleCallExpression
  7602. | NewExpression
  7603. | ChainExpression
  7604. | ClassExpression
  7605. | ConditionalExpression
  7606. | FunctionExpression
  7607. | Identifier
  7608. | SimpleLiteral
  7609. | RegExpLiteral
  7610. | BigIntLiteral
  7611. | LogicalExpression
  7612. | MemberExpression
  7613. | MetaProperty
  7614. | ObjectExpression
  7615. | SequenceExpression
  7616. | TaggedTemplateExpression
  7617. | TemplateLiteral
  7618. | ThisExpression
  7619. | UpdateExpression
  7620. | YieldExpression
  7621. | SpreadElement
  7622. | PrivateIdentifier
  7623. | Super
  7624. ): BasicEvaluatedExpression;
  7625. parseString(expression: Expression): string;
  7626. parseCalculatedString(expression: Expression): CalculatedStringResult;
  7627. evaluate(source: string): BasicEvaluatedExpression;
  7628. isPure(
  7629. expr:
  7630. | undefined
  7631. | null
  7632. | ImportExpressionImport
  7633. | UnaryExpression
  7634. | ArrayExpression
  7635. | ArrowFunctionExpression
  7636. | AssignmentExpression
  7637. | AwaitExpression
  7638. | BinaryExpression
  7639. | SimpleCallExpression
  7640. | NewExpression
  7641. | ChainExpression
  7642. | ClassExpression
  7643. | ConditionalExpression
  7644. | FunctionExpression
  7645. | Identifier
  7646. | SimpleLiteral
  7647. | RegExpLiteral
  7648. | BigIntLiteral
  7649. | LogicalExpression
  7650. | MemberExpression
  7651. | MetaProperty
  7652. | ObjectExpression
  7653. | SequenceExpression
  7654. | TaggedTemplateExpression
  7655. | TemplateLiteral
  7656. | ThisExpression
  7657. | UpdateExpression
  7658. | YieldExpression
  7659. | PrivateIdentifier
  7660. | FunctionDeclaration
  7661. | MaybeNamedFunctionDeclaration
  7662. | VariableDeclaration
  7663. | ClassDeclaration
  7664. | MaybeNamedClassDeclaration,
  7665. commentsStartPos: number
  7666. ): boolean;
  7667. getComments(range: [number, number]): CommentJavascriptParser[];
  7668. isAsiPosition(pos: number): boolean;
  7669. setAsiPosition(pos: number): void;
  7670. unsetAsiPosition(pos: number): void;
  7671. isStatementLevelExpression(expr: Expression): boolean;
  7672. getTagData(
  7673. name: string,
  7674. tag: symbol
  7675. ):
  7676. | undefined
  7677. | Record<string, any>
  7678. | TopLevelSymbol
  7679. | HarmonySettings
  7680. | ImportSettings
  7681. | CommonJsImportSettings
  7682. | CompatibilitySettings;
  7683. tagVariable(
  7684. name: string,
  7685. tag: symbol,
  7686. data?:
  7687. | Record<string, any>
  7688. | TopLevelSymbol
  7689. | HarmonySettings
  7690. | ImportSettings
  7691. | CommonJsImportSettings
  7692. | CompatibilitySettings,
  7693. flags?: 0 | 1 | 2 | 4
  7694. ): void;
  7695. defineVariable(name: string): void;
  7696. undefineVariable(name: string): void;
  7697. isVariableDefined(name: string): boolean;
  7698. getVariableInfo(name: string): ExportedVariableInfo;
  7699. setVariable(name: string, variableInfo: ExportedVariableInfo): void;
  7700. evaluatedVariable(tagInfo: TagInfo): VariableInfo;
  7701. parseCommentOptions(range: [number, number]): {
  7702. options: null | Record<string, any>;
  7703. errors: null | (Error & { comment: CommentJavascriptParser })[];
  7704. };
  7705. extractMemberExpressionChain(
  7706. expression:
  7707. | ImportExpressionImport
  7708. | UnaryExpression
  7709. | ArrayExpression
  7710. | ArrowFunctionExpression
  7711. | AssignmentExpression
  7712. | AwaitExpression
  7713. | BinaryExpression
  7714. | SimpleCallExpression
  7715. | NewExpression
  7716. | ChainExpression
  7717. | ClassExpression
  7718. | ConditionalExpression
  7719. | FunctionExpression
  7720. | Identifier
  7721. | SimpleLiteral
  7722. | RegExpLiteral
  7723. | BigIntLiteral
  7724. | LogicalExpression
  7725. | MemberExpression
  7726. | MetaProperty
  7727. | ObjectExpression
  7728. | SequenceExpression
  7729. | TaggedTemplateExpression
  7730. | TemplateLiteral
  7731. | ThisExpression
  7732. | UpdateExpression
  7733. | YieldExpression
  7734. | Super
  7735. ): {
  7736. members: string[];
  7737. object:
  7738. | ImportExpressionImport
  7739. | UnaryExpression
  7740. | ArrayExpression
  7741. | ArrowFunctionExpression
  7742. | AssignmentExpression
  7743. | AwaitExpression
  7744. | BinaryExpression
  7745. | SimpleCallExpression
  7746. | NewExpression
  7747. | ChainExpression
  7748. | ClassExpression
  7749. | ConditionalExpression
  7750. | FunctionExpression
  7751. | Identifier
  7752. | SimpleLiteral
  7753. | RegExpLiteral
  7754. | BigIntLiteral
  7755. | LogicalExpression
  7756. | MemberExpression
  7757. | MetaProperty
  7758. | ObjectExpression
  7759. | SequenceExpression
  7760. | TaggedTemplateExpression
  7761. | TemplateLiteral
  7762. | ThisExpression
  7763. | UpdateExpression
  7764. | YieldExpression
  7765. | Super;
  7766. membersOptionals: boolean[];
  7767. memberRanges: [number, number][];
  7768. };
  7769. getFreeInfoFromVariable(
  7770. varName: string
  7771. ): undefined | { name: string; info: string | VariableInfo };
  7772. getNameInfoFromVariable(
  7773. varName: string
  7774. ): undefined | { name: string; info: string | VariableInfo };
  7775. getMemberExpressionInfo(
  7776. expression:
  7777. | ImportExpressionImport
  7778. | UnaryExpression
  7779. | ArrayExpression
  7780. | ArrowFunctionExpression
  7781. | AssignmentExpression
  7782. | AwaitExpression
  7783. | BinaryExpression
  7784. | SimpleCallExpression
  7785. | NewExpression
  7786. | ChainExpression
  7787. | ClassExpression
  7788. | ConditionalExpression
  7789. | FunctionExpression
  7790. | Identifier
  7791. | SimpleLiteral
  7792. | RegExpLiteral
  7793. | BigIntLiteral
  7794. | LogicalExpression
  7795. | MemberExpression
  7796. | MetaProperty
  7797. | ObjectExpression
  7798. | SequenceExpression
  7799. | TaggedTemplateExpression
  7800. | TemplateLiteral
  7801. | ThisExpression
  7802. | UpdateExpression
  7803. | YieldExpression
  7804. | Super,
  7805. allowedTypes: number
  7806. ): undefined | CallExpressionInfo | ExpressionExpressionInfo;
  7807. getNameForExpression(
  7808. expression: Expression
  7809. ):
  7810. | undefined
  7811. | {
  7812. name: string;
  7813. rootInfo: ExportedVariableInfo;
  7814. getMembers: () => string[];
  7815. };
  7816. static extend(
  7817. ...plugins: ((BaseParser: typeof ParserImport) => typeof ParserImport)[]
  7818. ): typeof JavascriptParser;
  7819. static ALLOWED_MEMBER_TYPES_ALL: 3;
  7820. static ALLOWED_MEMBER_TYPES_CALL_EXPRESSION: 1;
  7821. static ALLOWED_MEMBER_TYPES_EXPRESSION: 2;
  7822. static VariableInfo: typeof VariableInfo;
  7823. static VariableInfoFlags: Readonly<{
  7824. Evaluated: 0;
  7825. Free: 1;
  7826. Normal: 2;
  7827. Tagged: 4;
  7828. }>;
  7829. static getImportAttributes: (
  7830. node:
  7831. | ImportDeclaration
  7832. | ExportNamedDeclaration
  7833. | ExportAllDeclaration
  7834. | ImportExpressionJavascriptParser
  7835. ) => undefined | ImportAttributes;
  7836. }
  7837. /**
  7838. * Parser options for javascript modules.
  7839. */
  7840. declare interface JavascriptParserOptions {
  7841. /**
  7842. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  7843. */
  7844. amd?: false | { [index: string]: any };
  7845. /**
  7846. * Enable/disable special handling for browserify bundles.
  7847. */
  7848. browserify?: boolean;
  7849. /**
  7850. * Enable/disable parsing of CommonJs syntax.
  7851. */
  7852. commonjs?: boolean;
  7853. /**
  7854. * Enable/disable parsing of magic comments in CommonJs syntax.
  7855. */
  7856. commonjsMagicComments?: boolean;
  7857. /**
  7858. * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire().
  7859. */
  7860. createRequire?: string | boolean;
  7861. /**
  7862. * Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.
  7863. */
  7864. deferImport?: boolean;
  7865. /**
  7866. * Specifies global fetchPriority for dynamic import.
  7867. */
  7868. dynamicImportFetchPriority?: false | "auto" | "low" | "high";
  7869. /**
  7870. * Specifies global mode for dynamic import.
  7871. */
  7872. dynamicImportMode?: "weak" | "eager" | "lazy" | "lazy-once";
  7873. /**
  7874. * Specifies global prefetch for dynamic import.
  7875. */
  7876. dynamicImportPrefetch?: number | boolean;
  7877. /**
  7878. * Specifies global preload for dynamic import.
  7879. */
  7880. dynamicImportPreload?: number | boolean;
  7881. /**
  7882. * Enable/disable parsing of dynamic URL.
  7883. */
  7884. dynamicUrl?: boolean;
  7885. /**
  7886. * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
  7887. */
  7888. exportsPresence?: false | "auto" | "error" | "warn";
  7889. /**
  7890. * Enable warnings for full dynamic dependencies.
  7891. */
  7892. exprContextCritical?: boolean;
  7893. /**
  7894. * Enable recursive directory lookup for full dynamic dependencies.
  7895. */
  7896. exprContextRecursive?: boolean;
  7897. /**
  7898. * Sets the default regular expression for full dynamic dependencies.
  7899. */
  7900. exprContextRegExp?: boolean | RegExp;
  7901. /**
  7902. * Set the default request for full dynamic dependencies.
  7903. */
  7904. exprContextRequest?: string;
  7905. /**
  7906. * Enable/disable parsing of EcmaScript Modules syntax.
  7907. */
  7908. harmony?: boolean;
  7909. /**
  7910. * Enable/disable parsing of import() syntax.
  7911. */
  7912. import?: boolean;
  7913. /**
  7914. * Specifies the behavior of invalid export names in "import ... from ...".
  7915. */
  7916. importExportsPresence?: false | "auto" | "error" | "warn";
  7917. /**
  7918. * Enable/disable evaluating import.meta.
  7919. */
  7920. importMeta?: boolean;
  7921. /**
  7922. * Enable/disable evaluating import.meta.webpackContext.
  7923. */
  7924. importMetaContext?: boolean;
  7925. /**
  7926. * Include polyfills or mocks for various node stuff.
  7927. */
  7928. node?: false | NodeOptions;
  7929. /**
  7930. * 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.
  7931. */
  7932. overrideStrict?: "strict" | "non-strict";
  7933. /**
  7934. * Function to parser source code.
  7935. */
  7936. parse?: (code: string, options: ParseOptions) => ParseResult;
  7937. /**
  7938. * 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.
  7939. */
  7940. reexportExportsPresence?: false | "auto" | "error" | "warn";
  7941. /**
  7942. * Enable/disable parsing of require.context syntax.
  7943. */
  7944. requireContext?: boolean;
  7945. /**
  7946. * Enable/disable parsing of require.ensure syntax.
  7947. */
  7948. requireEnsure?: boolean;
  7949. /**
  7950. * Enable/disable parsing of require.include syntax.
  7951. */
  7952. requireInclude?: boolean;
  7953. /**
  7954. * Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
  7955. */
  7956. requireJs?: boolean;
  7957. /**
  7958. * Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
  7959. */
  7960. strictExportPresence?: boolean;
  7961. /**
  7962. * Handle the this context correctly according to the spec for namespace objects.
  7963. */
  7964. strictThisContextOnImports?: boolean;
  7965. /**
  7966. * Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
  7967. */
  7968. system?: boolean;
  7969. /**
  7970. * Enable warnings when using the require function in a not statically analyse-able way.
  7971. */
  7972. unknownContextCritical?: boolean;
  7973. /**
  7974. * Enable recursive directory lookup when using the require function in a not statically analyse-able way.
  7975. */
  7976. unknownContextRecursive?: boolean;
  7977. /**
  7978. * Sets the regular expression when using the require function in a not statically analyse-able way.
  7979. */
  7980. unknownContextRegExp?: boolean | RegExp;
  7981. /**
  7982. * Sets the request when using the require function in a not statically analyse-able way.
  7983. */
  7984. unknownContextRequest?: string;
  7985. /**
  7986. * Enable/disable parsing of new URL() syntax.
  7987. */
  7988. url?: boolean | "relative";
  7989. /**
  7990. * Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  7991. */
  7992. worker?: boolean | string[];
  7993. /**
  7994. * Enable warnings for partial dynamic dependencies.
  7995. */
  7996. wrappedContextCritical?: boolean;
  7997. /**
  7998. * Enable recursive directory lookup for partial dynamic dependencies.
  7999. */
  8000. wrappedContextRecursive?: boolean;
  8001. /**
  8002. * Set the inner regular expression for partial dynamic dependencies.
  8003. */
  8004. wrappedContextRegExp?: RegExp;
  8005. }
  8006. type JavascriptParserState = ParserStateBase &
  8007. Record<string, any> &
  8008. KnownJavascriptParserState;
  8009. declare abstract class JsonData {
  8010. get():
  8011. | undefined
  8012. | null
  8013. | string
  8014. | number
  8015. | boolean
  8016. | JsonObjectFs
  8017. | JsonValueFs[];
  8018. updateHash(hash: Hash): void;
  8019. }
  8020. declare abstract class JsonGenerator extends Generator {
  8021. options: JsonGeneratorOptions;
  8022. generateError(
  8023. error: Error,
  8024. module: NormalModule,
  8025. generateContext: GenerateContext
  8026. ): null | Source;
  8027. }
  8028. /**
  8029. * Generator options for json modules.
  8030. */
  8031. declare interface JsonGeneratorOptions {
  8032. /**
  8033. * Use `JSON.parse` when the JSON string is longer than 20 characters.
  8034. */
  8035. JSONParse?: boolean;
  8036. }
  8037. declare interface JsonModulesPluginParserOptions {
  8038. /**
  8039. * The depth of json dependency flagged as `exportInfo`.
  8040. */
  8041. exportsDepth?: number;
  8042. /**
  8043. * Allow named exports for json of object type
  8044. */
  8045. namedExports?: boolean;
  8046. /**
  8047. * Function that executes for a module source string and should return json-compatible data.
  8048. */
  8049. parse?: (input: string) => any;
  8050. }
  8051. declare interface JsonObjectFs {
  8052. [index: string]:
  8053. | undefined
  8054. | null
  8055. | string
  8056. | number
  8057. | boolean
  8058. | JsonObjectFs
  8059. | JsonValueFs[];
  8060. }
  8061. declare interface JsonObjectTypes {
  8062. [index: string]:
  8063. | undefined
  8064. | null
  8065. | string
  8066. | number
  8067. | boolean
  8068. | JsonObjectTypes
  8069. | JsonValueTypes[];
  8070. }
  8071. declare abstract class JsonParser extends ParserClass {
  8072. options: JsonModulesPluginParserOptions;
  8073. }
  8074. /**
  8075. * Parser options for JSON modules.
  8076. */
  8077. declare interface JsonParserOptions {
  8078. /**
  8079. * The depth of json dependency flagged as `exportInfo`.
  8080. */
  8081. exportsDepth?: number;
  8082. /**
  8083. * Allow named exports for json of object type.
  8084. */
  8085. namedExports?: boolean;
  8086. /**
  8087. * Function to parser content and return JSON.
  8088. */
  8089. parse?: (
  8090. input: string
  8091. ) => null | string | number | boolean | Buffer | JsonObjectFs | JsonValueFs[];
  8092. }
  8093. type JsonValueFs =
  8094. | null
  8095. | string
  8096. | number
  8097. | boolean
  8098. | JsonObjectFs
  8099. | JsonValueFs[];
  8100. type JsonValueTypes =
  8101. | null
  8102. | string
  8103. | number
  8104. | boolean
  8105. | JsonObjectTypes
  8106. | JsonValueTypes[];
  8107. declare class JsonpChunkLoadingRuntimeModule extends RuntimeModule {
  8108. constructor(runtimeRequirements: ReadonlySet<string>);
  8109. static getCompilationHooks(
  8110. compilation: Compilation
  8111. ): JsonpCompilationPluginHooks;
  8112. /**
  8113. * Runtime modules without any dependencies to other runtime modules
  8114. */
  8115. static STAGE_NORMAL: number;
  8116. /**
  8117. * Runtime modules with simple dependencies on other runtime modules
  8118. */
  8119. static STAGE_BASIC: number;
  8120. /**
  8121. * Runtime modules which attach to handlers of other runtime modules
  8122. */
  8123. static STAGE_ATTACH: number;
  8124. /**
  8125. * Runtime modules which trigger actions on bootstrap
  8126. */
  8127. static STAGE_TRIGGER: number;
  8128. }
  8129. declare interface JsonpCompilationPluginHooks {
  8130. linkPreload: SyncWaterfallHook<[string, Chunk], string>;
  8131. linkPrefetch: SyncWaterfallHook<[string, Chunk], string>;
  8132. }
  8133. declare class JsonpTemplatePlugin {
  8134. constructor();
  8135. /**
  8136. * Apply the plugin
  8137. */
  8138. apply(compiler: Compiler): void;
  8139. static getCompilationHooks(
  8140. compilation: Compilation
  8141. ): JsonpCompilationPluginHooks;
  8142. }
  8143. declare interface KnownAssetInfo {
  8144. /**
  8145. * true, if the asset can be long term cached forever (contains a hash)
  8146. */
  8147. immutable?: boolean;
  8148. /**
  8149. * whether the asset is minimized
  8150. */
  8151. minimized?: boolean;
  8152. /**
  8153. * the value(s) of the full hash used for this asset
  8154. */
  8155. fullhash?: string | string[];
  8156. /**
  8157. * the value(s) of the chunk hash used for this asset
  8158. */
  8159. chunkhash?: string | string[];
  8160. /**
  8161. * the value(s) of the module hash used for this asset
  8162. */
  8163. modulehash?: string | string[];
  8164. /**
  8165. * the value(s) of the content hash used for this asset
  8166. */
  8167. contenthash?: string | string[];
  8168. /**
  8169. * when asset was created from a source file (potentially transformed), the original filename relative to compilation context
  8170. */
  8171. sourceFilename?: string;
  8172. /**
  8173. * size in bytes, only set after asset has been emitted
  8174. */
  8175. size?: number;
  8176. /**
  8177. * true, when asset is only used for development and doesn't count towards user-facing assets
  8178. */
  8179. development?: boolean;
  8180. /**
  8181. * true, when asset ships data for updating an existing application (HMR)
  8182. */
  8183. hotModuleReplacement?: boolean;
  8184. /**
  8185. * true, when asset is javascript and an ESM
  8186. */
  8187. javascriptModule?: boolean;
  8188. /**
  8189. * true, when file is a manifest
  8190. */
  8191. manifest?: boolean;
  8192. /**
  8193. * object of pointers to other assets, keyed by type of relation (only points from parent to child)
  8194. */
  8195. related?: Record<string, null | string | string[]>;
  8196. }
  8197. declare interface KnownBuildInfo {
  8198. cacheable?: boolean;
  8199. parsed?: boolean;
  8200. strict?: boolean;
  8201. /**
  8202. * using in AMD
  8203. */
  8204. moduleArgument?: string;
  8205. /**
  8206. * using in AMD
  8207. */
  8208. exportsArgument?: string;
  8209. /**
  8210. * using in CommonJs
  8211. */
  8212. moduleConcatenationBailout?: string;
  8213. /**
  8214. * using in APIPlugin
  8215. */
  8216. needCreateRequire?: boolean;
  8217. /**
  8218. * using in HttpUriPlugin
  8219. */
  8220. resourceIntegrity?: string;
  8221. /**
  8222. * using in NormalModule
  8223. */
  8224. fileDependencies?: LazySet<string>;
  8225. /**
  8226. * using in NormalModule
  8227. */
  8228. contextDependencies?: LazySet<string>;
  8229. /**
  8230. * using in NormalModule
  8231. */
  8232. missingDependencies?: LazySet<string>;
  8233. /**
  8234. * using in NormalModule
  8235. */
  8236. buildDependencies?: LazySet<string>;
  8237. /**
  8238. * using in NormalModule
  8239. */
  8240. valueDependencies?: Map<string, ValueCacheVersion>;
  8241. /**
  8242. * using in NormalModule
  8243. */
  8244. assets?: Record<string, Source>;
  8245. /**
  8246. * using in NormalModule
  8247. */
  8248. assetsInfo?: Map<string, undefined | AssetInfo>;
  8249. /**
  8250. * using in NormalModule
  8251. */
  8252. hash?: string;
  8253. /**
  8254. * using in ContextModule
  8255. */
  8256. snapshot?: null | Snapshot;
  8257. /**
  8258. * for assets modules
  8259. */
  8260. fullContentHash?: string;
  8261. /**
  8262. * for assets modules
  8263. */
  8264. filename?: string;
  8265. /**
  8266. * for assets modules
  8267. */
  8268. dataUrl?: boolean;
  8269. /**
  8270. * for assets modules
  8271. */
  8272. assetInfo?: AssetInfo;
  8273. /**
  8274. * for external modules
  8275. */
  8276. javascriptModule?: boolean;
  8277. /**
  8278. * for lazy compilation modules
  8279. */
  8280. active?: boolean;
  8281. /**
  8282. * for css modules
  8283. */
  8284. cssData?: CssData;
  8285. /**
  8286. * for json modules
  8287. */
  8288. jsonData?: JsonData;
  8289. /**
  8290. * top level declaration names
  8291. */
  8292. topLevelDeclarations?: Set<string>;
  8293. }
  8294. declare interface KnownBuildMeta {
  8295. exportsType?: "namespace" | "dynamic" | "default" | "flagged";
  8296. exportType?: "link" | "text" | "css-style-sheet";
  8297. defaultObject?: false | "redirect" | "redirect-warn";
  8298. strictHarmonyModule?: boolean;
  8299. treatAsCommonJs?: boolean;
  8300. async?: boolean;
  8301. sideEffectFree?: boolean;
  8302. isCSSModule?: boolean;
  8303. jsIncompatibleExports?: Record<string, string>;
  8304. exportsFinalNameByRuntime?: Map<RuntimeSpec, Record<string, string>>;
  8305. exportsSourceByRuntime?: Map<RuntimeSpec, string>;
  8306. }
  8307. declare interface KnownCreateStatsOptionsContext {
  8308. forToString?: boolean;
  8309. }
  8310. declare interface KnownHooks {
  8311. /**
  8312. * resolve step hook
  8313. */
  8314. resolveStep: SyncHook<
  8315. [
  8316. AsyncSeriesBailHook<
  8317. [ResolveRequest, ResolveContext],
  8318. null | ResolveRequest
  8319. >,
  8320. ResolveRequest
  8321. ]
  8322. >;
  8323. /**
  8324. * no resolve hook
  8325. */
  8326. noResolve: SyncHook<[ResolveRequest, Error]>;
  8327. /**
  8328. * resolve hook
  8329. */
  8330. resolve: AsyncSeriesBailHook<
  8331. [ResolveRequest, ResolveContext],
  8332. null | ResolveRequest
  8333. >;
  8334. /**
  8335. * result hook
  8336. */
  8337. result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
  8338. }
  8339. declare interface KnownJavascriptParserState {
  8340. harmonyNamedExports?: Set<string>;
  8341. harmonyStarExports?: HarmonyStarExportsList;
  8342. lastHarmonyImportOrder?: number;
  8343. localModules?: LocalModule[];
  8344. }
  8345. declare interface KnownMeta {
  8346. importVarMap?: Map<Module, string>;
  8347. deferredImportVarMap?: Map<Module, string>;
  8348. }
  8349. declare interface KnownNormalizedStatsOptions {
  8350. context: string;
  8351. requestShortener: RequestShortener;
  8352. chunksSort: string | false;
  8353. modulesSort: string | false;
  8354. chunkModulesSort: string | false;
  8355. nestedModulesSort: string | false;
  8356. assetsSort: string | false;
  8357. ids: boolean;
  8358. cachedAssets: boolean;
  8359. groupAssetsByEmitStatus: boolean;
  8360. groupAssetsByPath: boolean;
  8361. groupAssetsByExtension: boolean;
  8362. assetsSpace: number;
  8363. excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
  8364. excludeModules: ((
  8365. name: string,
  8366. module: StatsModule,
  8367. type: ExcludeModulesType
  8368. ) => boolean)[];
  8369. warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
  8370. cachedModules: boolean;
  8371. orphanModules: boolean;
  8372. dependentModules: boolean;
  8373. runtimeModules: boolean;
  8374. groupModulesByCacheStatus: boolean;
  8375. groupModulesByLayer: boolean;
  8376. groupModulesByAttributes: boolean;
  8377. groupModulesByPath: boolean;
  8378. groupModulesByExtension: boolean;
  8379. groupModulesByType: boolean;
  8380. entrypoints: boolean | "auto";
  8381. chunkGroups: boolean;
  8382. chunkGroupAuxiliary: boolean;
  8383. chunkGroupChildren: boolean;
  8384. chunkGroupMaxAssets: number;
  8385. modulesSpace: number;
  8386. chunkModulesSpace: number;
  8387. nestedModulesSpace: number;
  8388. logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
  8389. loggingDebug: ((value: string) => boolean)[];
  8390. loggingTrace: boolean;
  8391. }
  8392. declare interface KnownRecords {
  8393. aggressiveSplits?: SplitData[];
  8394. chunks?: RecordsChunks;
  8395. modules?: RecordsModules;
  8396. hash?: string;
  8397. hotIndex?: number;
  8398. fullHashChunkModuleHashes?: FullHashChunkModuleHashes;
  8399. chunkModuleHashes?: ChunkModuleHashes;
  8400. chunkHashes?: ChunkHashes;
  8401. chunkRuntime?: ChunkRuntime;
  8402. chunkModuleIds?: ChunkModuleIds;
  8403. }
  8404. declare interface KnownStatsAsset {
  8405. type: string;
  8406. name: string;
  8407. info: AssetInfo;
  8408. size: number;
  8409. emitted: boolean;
  8410. comparedForEmit: boolean;
  8411. cached: boolean;
  8412. related?: StatsAsset[];
  8413. chunks?: ChunkId[];
  8414. chunkNames?: ChunkName[];
  8415. chunkIdHints?: string[];
  8416. auxiliaryChunks?: ChunkId[];
  8417. auxiliaryChunkNames?: ChunkName[];
  8418. auxiliaryChunkIdHints?: string[];
  8419. filteredRelated?: number;
  8420. isOverSizeLimit?: boolean;
  8421. }
  8422. declare interface KnownStatsChunk {
  8423. rendered: boolean;
  8424. initial: boolean;
  8425. entry: boolean;
  8426. recorded: boolean;
  8427. reason?: string;
  8428. size: number;
  8429. sizes: Record<string, number>;
  8430. names: string[];
  8431. idHints: string[];
  8432. runtime?: string[];
  8433. files: string[];
  8434. auxiliaryFiles: string[];
  8435. hash: string;
  8436. childrenByOrder: Record<string, ChunkId[]>;
  8437. id?: string | number;
  8438. siblings?: ChunkId[];
  8439. parents?: ChunkId[];
  8440. children?: ChunkId[];
  8441. modules?: StatsModule[];
  8442. filteredModules?: number;
  8443. origins?: StatsChunkOrigin[];
  8444. }
  8445. declare interface KnownStatsChunkGroup {
  8446. name?: null | string;
  8447. chunks?: ChunkId[];
  8448. assets?: { name: string; size?: number }[];
  8449. filteredAssets?: number;
  8450. assetsSize?: number;
  8451. auxiliaryAssets?: { name: string; size?: number }[];
  8452. filteredAuxiliaryAssets?: number;
  8453. auxiliaryAssetsSize?: number;
  8454. children?: Record<string, StatsChunkGroup[]>;
  8455. childAssets?: Record<string, string[]>;
  8456. isOverSizeLimit?: boolean;
  8457. }
  8458. declare interface KnownStatsChunkOrigin {
  8459. module: string;
  8460. moduleIdentifier: string;
  8461. moduleName: string;
  8462. loc: string;
  8463. request: string;
  8464. moduleId?: string | number;
  8465. }
  8466. declare interface KnownStatsCompilation {
  8467. env?: any;
  8468. name?: string;
  8469. hash?: string;
  8470. version?: string;
  8471. time?: number;
  8472. builtAt?: number;
  8473. needAdditionalPass?: boolean;
  8474. publicPath?: string;
  8475. outputPath?: string;
  8476. assetsByChunkName?: Record<string, string[]>;
  8477. assets?: StatsAsset[];
  8478. filteredAssets?: number;
  8479. chunks?: StatsChunk[];
  8480. modules?: StatsModule[];
  8481. filteredModules?: number;
  8482. entrypoints?: Record<string, StatsChunkGroup>;
  8483. namedChunkGroups?: Record<string, StatsChunkGroup>;
  8484. errors?: StatsError[];
  8485. errorsCount?: number;
  8486. warnings?: StatsError[];
  8487. warningsCount?: number;
  8488. children?: StatsCompilation[];
  8489. logging?: Record<string, StatsLogging>;
  8490. filteredWarningDetailsCount?: number;
  8491. filteredErrorDetailsCount?: number;
  8492. }
  8493. declare interface KnownStatsError {
  8494. message: string;
  8495. chunkName?: string;
  8496. chunkEntry?: boolean;
  8497. chunkInitial?: boolean;
  8498. file?: string;
  8499. moduleIdentifier?: string;
  8500. moduleName?: string;
  8501. loc?: string;
  8502. chunkId?: string | number;
  8503. moduleId?: string | number;
  8504. moduleTrace?: StatsModuleTraceItem[];
  8505. details?: string;
  8506. stack?: string;
  8507. cause?: KnownStatsError;
  8508. errors?: KnownStatsError[];
  8509. compilerPath?: string;
  8510. }
  8511. declare interface KnownStatsFactoryContext {
  8512. type: string;
  8513. compilation: Compilation;
  8514. makePathsRelative: (path: string) => string;
  8515. rootModules: Set<Module>;
  8516. compilationFileToChunks: Map<string, Chunk[]>;
  8517. compilationAuxiliaryFileToChunks: Map<string, Chunk[]>;
  8518. runtime: RuntimeSpec;
  8519. cachedGetErrors: (compilation: Compilation) => Error[];
  8520. cachedGetWarnings: (compilation: Compilation) => Error[];
  8521. }
  8522. declare interface KnownStatsLogging {
  8523. entries: StatsLoggingEntry[];
  8524. filteredEntries: number;
  8525. debug: boolean;
  8526. }
  8527. declare interface KnownStatsLoggingEntry {
  8528. type: string;
  8529. message?: string;
  8530. trace?: string[];
  8531. children?: StatsLoggingEntry[];
  8532. args?: any[];
  8533. time?: number;
  8534. }
  8535. declare interface KnownStatsModule {
  8536. type?: string;
  8537. moduleType?: string;
  8538. layer?: null | string;
  8539. identifier?: string;
  8540. name?: string;
  8541. nameForCondition?: null | string;
  8542. index?: number;
  8543. preOrderIndex?: number;
  8544. index2?: number;
  8545. postOrderIndex?: number;
  8546. size?: number;
  8547. sizes?: Record<string, number>;
  8548. cacheable?: boolean;
  8549. built?: boolean;
  8550. codeGenerated?: boolean;
  8551. buildTimeExecuted?: boolean;
  8552. cached?: boolean;
  8553. optional?: boolean;
  8554. orphan?: boolean;
  8555. id?: string | number;
  8556. issuerId?: null | string | number;
  8557. chunks?: ChunkId[];
  8558. assets?: string[];
  8559. dependent?: boolean;
  8560. issuer?: null | string;
  8561. issuerName?: null | string;
  8562. issuerPath?: null | StatsModuleIssuer[];
  8563. failed?: boolean;
  8564. errors?: number;
  8565. warnings?: number;
  8566. profile?: StatsProfile;
  8567. reasons?: StatsModuleReason[];
  8568. usedExports?: null | boolean | string[];
  8569. providedExports?: null | string[];
  8570. optimizationBailout?: string[];
  8571. depth?: null | number;
  8572. modules?: StatsModule[];
  8573. filteredModules?: number;
  8574. source?: string | Buffer;
  8575. }
  8576. declare interface KnownStatsModuleIssuer {
  8577. identifier: string;
  8578. name: string;
  8579. id?: string | number;
  8580. profile: StatsProfile;
  8581. }
  8582. declare interface KnownStatsModuleReason {
  8583. moduleIdentifier: null | string;
  8584. module: null | string;
  8585. moduleName: null | string;
  8586. resolvedModuleIdentifier: null | string;
  8587. resolvedModule: null | string;
  8588. type: null | string;
  8589. active: boolean;
  8590. explanation: null | string;
  8591. userRequest: null | string;
  8592. loc?: null | string;
  8593. moduleId?: null | string | number;
  8594. resolvedModuleId?: null | string | number;
  8595. }
  8596. declare interface KnownStatsModuleTraceDependency {
  8597. loc?: string;
  8598. }
  8599. declare interface KnownStatsModuleTraceItem {
  8600. originIdentifier?: string;
  8601. originName?: string;
  8602. moduleIdentifier?: string;
  8603. moduleName?: string;
  8604. dependencies?: StatsModuleTraceDependency[];
  8605. originId?: string | number;
  8606. moduleId?: string | number;
  8607. }
  8608. declare interface KnownStatsPrinterColorFunctions {
  8609. bold?: (value: string | number) => string;
  8610. yellow?: (value: string | number) => string;
  8611. red?: (value: string | number) => string;
  8612. green?: (value: string | number) => string;
  8613. magenta?: (value: string | number) => string;
  8614. cyan?: (value: string | number) => string;
  8615. }
  8616. declare interface KnownStatsPrinterContext {
  8617. type?: string;
  8618. compilation?: StatsCompilation;
  8619. chunkGroup?: StatsChunkGroup;
  8620. chunkGroupKind?: string;
  8621. asset?: StatsAsset;
  8622. module?: StatsModule;
  8623. chunk?: StatsChunk;
  8624. moduleReason?: StatsModuleReason;
  8625. moduleIssuer?: StatsModuleIssuer;
  8626. error?: StatsError;
  8627. profile?: StatsProfile;
  8628. logging?: StatsLogging;
  8629. moduleTraceItem?: StatsModuleTraceItem;
  8630. moduleTraceDependency?: StatsModuleTraceDependency;
  8631. }
  8632. declare interface KnownStatsPrinterFormatters {
  8633. formatFilename?: (file: string, oversize?: boolean) => string;
  8634. formatModuleId?: (id: string | number) => string;
  8635. formatChunkId?: (
  8636. id: string | number,
  8637. direction?: "parent" | "child" | "sibling"
  8638. ) => string;
  8639. formatSize?: (size: number) => string;
  8640. formatLayer?: (size: string) => string;
  8641. formatDateTime?: (dateTime: number) => string;
  8642. formatFlag?: (flag: string) => string;
  8643. formatTime?: (time: number, boldQuantity?: boolean) => string;
  8644. formatError?: (message: string) => string;
  8645. }
  8646. declare interface KnownStatsProfile {
  8647. total: number;
  8648. resolving: number;
  8649. restoring: number;
  8650. building: number;
  8651. integration: number;
  8652. storing: number;
  8653. additionalResolving: number;
  8654. additionalIntegration: number;
  8655. factory: number;
  8656. dependencies: number;
  8657. }
  8658. declare interface KnownUnsafeCacheData {
  8659. /**
  8660. * factory meta
  8661. */
  8662. factoryMeta?: FactoryMeta;
  8663. /**
  8664. * resolve options
  8665. */
  8666. resolveOptions?: ResolveOptions;
  8667. parserOptions?: ParserOptions;
  8668. generatorOptions?: GeneratorOptions;
  8669. }
  8670. declare interface LStatFs {
  8671. (
  8672. path: PathLikeFs,
  8673. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8674. ): void;
  8675. (
  8676. path: PathLikeFs,
  8677. options: undefined | (StatOptions & { bigint?: false }),
  8678. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8679. ): void;
  8680. (
  8681. path: PathLikeFs,
  8682. options: StatOptions & { bigint: true },
  8683. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  8684. ): void;
  8685. (
  8686. path: PathLikeFs,
  8687. options: undefined | StatOptions,
  8688. callback: (
  8689. err: null | NodeJS.ErrnoException,
  8690. result?: IStats | IBigIntStats
  8691. ) => void
  8692. ): void;
  8693. }
  8694. declare interface LStatSync {
  8695. (path: PathLikeFs, options?: undefined): IStats;
  8696. (
  8697. path: PathLikeFs,
  8698. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  8699. ): undefined | IStats;
  8700. (
  8701. path: PathLikeFs,
  8702. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  8703. ): undefined | IBigIntStats;
  8704. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  8705. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  8706. (
  8707. path: PathLikeFs,
  8708. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  8709. ): IStats | IBigIntStats;
  8710. (
  8711. path: PathLikeFs,
  8712. options?: StatSyncOptions
  8713. ): undefined | IStats | IBigIntStats;
  8714. }
  8715. declare interface LStatTypes {
  8716. (
  8717. path: PathLikeTypes,
  8718. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8719. ): void;
  8720. (
  8721. path: PathLikeTypes,
  8722. options: undefined | (StatOptions & { bigint?: false }),
  8723. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  8724. ): void;
  8725. (
  8726. path: PathLikeTypes,
  8727. options: StatOptions & { bigint: true },
  8728. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  8729. ): void;
  8730. (
  8731. path: PathLikeTypes,
  8732. options: undefined | StatOptions,
  8733. callback: (
  8734. err: null | NodeJS.ErrnoException,
  8735. result?: IStats | IBigIntStats
  8736. ) => void
  8737. ): void;
  8738. }
  8739. /**
  8740. * Options for the default backend.
  8741. */
  8742. declare interface LazyCompilationDefaultBackendOptions {
  8743. /**
  8744. * A custom client.
  8745. */
  8746. client?: string;
  8747. /**
  8748. * Specifies where to listen to from the server.
  8749. */
  8750. listen?:
  8751. | number
  8752. | ListenOptions
  8753. | ((server: ServerLazyCompilationBackend) => void);
  8754. /**
  8755. * Specifies the protocol the client should use to connect to the server.
  8756. */
  8757. protocol?: "http" | "https";
  8758. /**
  8759. * Specifies how to create the server handling the EventSource requests.
  8760. */
  8761. server?:
  8762. | ServerOptionsImportHttps<typeof IncomingMessage>
  8763. | ServerOptionsImportHttp<typeof IncomingMessage>
  8764. | (() => ServerLazyCompilationBackend);
  8765. }
  8766. /**
  8767. * Options for compiling entrypoints and import()s only when they are accessed.
  8768. */
  8769. declare interface LazyCompilationOptions {
  8770. /**
  8771. * Specifies the backend that should be used for handling client keep alive.
  8772. */
  8773. backend?:
  8774. | ((
  8775. compiler: Compiler,
  8776. callback: (err: null | Error, backendApi?: BackendApi) => void
  8777. ) => void)
  8778. | ((compiler: Compiler) => Promise<BackendApi>)
  8779. | LazyCompilationDefaultBackendOptions;
  8780. /**
  8781. * Enable/disable lazy compilation for entries.
  8782. */
  8783. entries?: boolean;
  8784. /**
  8785. * Enable/disable lazy compilation for import() modules.
  8786. */
  8787. imports?: boolean;
  8788. /**
  8789. * Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
  8790. */
  8791. test?: string | RegExp | ((module: Module) => boolean);
  8792. }
  8793. type LazyFunction<
  8794. InputValue,
  8795. OutputValue,
  8796. InternalLazyTarget extends SerializerMiddleware<
  8797. any,
  8798. any,
  8799. Record<string, any>
  8800. >,
  8801. InternalLazyOptions extends undefined | LazyOptions
  8802. > = (() => InputValue | Promise<InputValue>) &
  8803. Partial<{ options: InternalLazyOptions }>;
  8804. declare interface LazyOptions {
  8805. [index: string]: any;
  8806. }
  8807. declare class LazySet<T> {
  8808. constructor(iterable?: Iterable<T>);
  8809. get size(): number;
  8810. add(item: T): LazySet<T>;
  8811. addAll(iterable: LazySet<T> | Iterable<T>): LazySet<T>;
  8812. clear(): void;
  8813. delete(value: T): boolean;
  8814. entries(): SetIterator<[T, T]>;
  8815. forEach<K>(
  8816. callbackFn: (value: T, value2: T, set: Set<T>) => void,
  8817. thisArg: K
  8818. ): void;
  8819. has(item: T): boolean;
  8820. keys(): SetIterator<T>;
  8821. values(): SetIterator<T>;
  8822. serialize(__0: ObjectSerializerContext): void;
  8823. [Symbol.iterator](): SetIterator<T>;
  8824. static deserialize<T>(__0: ObjectDeserializerContext): LazySet<T>;
  8825. }
  8826. declare interface LibIdentOptions {
  8827. /**
  8828. * absolute context path to which lib ident is relative to
  8829. */
  8830. context: string;
  8831. /**
  8832. * object for caching
  8833. */
  8834. associatedObjectForCache?: object;
  8835. }
  8836. declare class LibManifestPlugin {
  8837. constructor(options: LibManifestPluginOptions);
  8838. options: LibManifestPluginOptions;
  8839. /**
  8840. * Apply the plugin
  8841. */
  8842. apply(compiler: Compiler): void;
  8843. }
  8844. declare interface LibManifestPluginOptions {
  8845. /**
  8846. * Context of requests in the manifest file (defaults to the webpack context).
  8847. */
  8848. context?: string;
  8849. /**
  8850. * If true, only entry points will be exposed (default: true).
  8851. */
  8852. entryOnly?: boolean;
  8853. /**
  8854. * If true, manifest json file (output) will be formatted.
  8855. */
  8856. format?: boolean;
  8857. /**
  8858. * Name of the exposed dll function (external name, use value of 'output.library').
  8859. */
  8860. name?: string;
  8861. /**
  8862. * Absolute path to the manifest json file (output).
  8863. */
  8864. path: string;
  8865. /**
  8866. * Type of the dll bundle (external type, use value of 'output.libraryTarget').
  8867. */
  8868. type?: string;
  8869. }
  8870. declare interface LibraryContext<T> {
  8871. compilation: Compilation;
  8872. chunkGraph: ChunkGraph;
  8873. options: T;
  8874. }
  8875. /**
  8876. * Set explicit comments for `commonjs`, `commonjs2`, `amd`, and `root`.
  8877. */
  8878. declare interface LibraryCustomUmdCommentObject {
  8879. /**
  8880. * Set comment for `amd` section in UMD.
  8881. */
  8882. amd?: string;
  8883. /**
  8884. * Set comment for `commonjs` (exports) section in UMD.
  8885. */
  8886. commonjs?: string;
  8887. /**
  8888. * Set comment for `commonjs2` (module.exports) section in UMD.
  8889. */
  8890. commonjs2?: string;
  8891. /**
  8892. * Set comment for `root` (global variable) section in UMD.
  8893. */
  8894. root?: string;
  8895. }
  8896. /**
  8897. * Description object for all UMD variants of the library name.
  8898. */
  8899. declare interface LibraryCustomUmdObject {
  8900. /**
  8901. * Name of the exposed AMD library in the UMD.
  8902. */
  8903. amd?: string;
  8904. /**
  8905. * Name of the exposed commonjs export in the UMD.
  8906. */
  8907. commonjs?: string;
  8908. /**
  8909. * Name of the property exposed globally by a UMD library.
  8910. */
  8911. root?: string | string[];
  8912. }
  8913. type LibraryExport = string | string[];
  8914. type LibraryName = string | string[] | LibraryCustomUmdObject;
  8915. /**
  8916. * Options for library.
  8917. */
  8918. declare interface LibraryOptions {
  8919. /**
  8920. * Add a container for define/require functions in the AMD module.
  8921. */
  8922. amdContainer?: string;
  8923. /**
  8924. * Add a comment in the UMD wrapper.
  8925. */
  8926. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  8927. /**
  8928. * Specify which export should be exposed as library.
  8929. */
  8930. export?: string | string[];
  8931. /**
  8932. * The name of the library (some types allow unnamed libraries too).
  8933. */
  8934. name?: string | string[] | LibraryCustomUmdObject;
  8935. /**
  8936. * 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).
  8937. */
  8938. type: string;
  8939. /**
  8940. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  8941. */
  8942. umdNamedDefine?: boolean;
  8943. }
  8944. declare class LibraryTemplatePlugin {
  8945. constructor(
  8946. name: LibraryName,
  8947. target: string,
  8948. umdNamedDefine: boolean,
  8949. auxiliaryComment: AuxiliaryComment,
  8950. exportProperty: LibraryExport
  8951. );
  8952. library: {
  8953. type: string;
  8954. name: LibraryName;
  8955. umdNamedDefine: boolean;
  8956. auxiliaryComment: AuxiliaryComment;
  8957. export: LibraryExport;
  8958. };
  8959. /**
  8960. * Apply the plugin
  8961. */
  8962. apply(compiler: Compiler): void;
  8963. }
  8964. declare class LimitChunkCountPlugin {
  8965. constructor(options?: LimitChunkCountPluginOptions);
  8966. options: LimitChunkCountPluginOptions;
  8967. apply(compiler: Compiler): void;
  8968. }
  8969. declare interface LimitChunkCountPluginOptions {
  8970. /**
  8971. * Constant overhead for a chunk.
  8972. */
  8973. chunkOverhead?: number;
  8974. /**
  8975. * Multiplicator for initial chunks.
  8976. */
  8977. entryChunkMultiplicator?: number;
  8978. /**
  8979. * Limit the maximum number of chunks using a value greater greater than or equal to 1.
  8980. */
  8981. maxChunks: number;
  8982. }
  8983. declare interface LoadScriptCompilationHooks {
  8984. createScript: SyncWaterfallHook<[string, Chunk], string>;
  8985. }
  8986. declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
  8987. constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean);
  8988. static getCompilationHooks(
  8989. compilation: Compilation
  8990. ): LoadScriptCompilationHooks;
  8991. /**
  8992. * Runtime modules without any dependencies to other runtime modules
  8993. */
  8994. static STAGE_NORMAL: number;
  8995. /**
  8996. * Runtime modules with simple dependencies on other runtime modules
  8997. */
  8998. static STAGE_BASIC: number;
  8999. /**
  9000. * Runtime modules which attach to handlers of other runtime modules
  9001. */
  9002. static STAGE_ATTACH: number;
  9003. /**
  9004. * Runtime modules which trigger actions on bootstrap
  9005. */
  9006. static STAGE_TRIGGER: number;
  9007. }
  9008. /**
  9009. * Custom values available in the loader context.
  9010. */
  9011. declare interface Loader {
  9012. [index: string]: any;
  9013. }
  9014. type LoaderContextDeclarationsIndex<OptionsType> =
  9015. NormalModuleLoaderContext<OptionsType> &
  9016. LoaderRunnerLoaderContext<OptionsType> &
  9017. LoaderPluginLoaderContext &
  9018. HotModuleReplacementPluginLoaderContext;
  9019. type LoaderContextVirtualUrlPlugin<T> = NormalModuleLoaderContext<T> &
  9020. LoaderRunnerLoaderContext<T> &
  9021. LoaderPluginLoaderContext &
  9022. HotModuleReplacementPluginLoaderContext;
  9023. type LoaderDefinition<
  9024. OptionsType = {},
  9025. ContextAdditions = {}
  9026. > = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  9027. raw?: false;
  9028. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9029. };
  9030. declare interface LoaderDefinitionFunction<
  9031. OptionsType = {},
  9032. ContextAdditions = {}
  9033. > {
  9034. (
  9035. this: NormalModuleLoaderContext<OptionsType> &
  9036. LoaderRunnerLoaderContext<OptionsType> &
  9037. LoaderPluginLoaderContext &
  9038. HotModuleReplacementPluginLoaderContext &
  9039. ContextAdditions,
  9040. content: string,
  9041. sourceMap?: string | RawSourceMap,
  9042. additionalData?: AdditionalData
  9043. ): string | void | Buffer | Promise<string | Buffer>;
  9044. }
  9045. declare interface LoaderItem {
  9046. loader: string;
  9047. options?: null | string | Record<string, any>;
  9048. ident?: null | string;
  9049. type?: null | string;
  9050. }
  9051. declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
  9052. default?:
  9053. | RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
  9054. | LoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9055. raw?: false;
  9056. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  9057. }
  9058. declare class LoaderOptionsPlugin {
  9059. constructor(options?: LoaderOptionsPluginOptions & MatchObject);
  9060. options: LoaderOptionsPluginOptions & MatchObject;
  9061. /**
  9062. * Apply the plugin
  9063. */
  9064. apply(compiler: Compiler): void;
  9065. }
  9066. declare interface LoaderOptionsPluginOptions {
  9067. [index: string]: any;
  9068. /**
  9069. * Whether loaders should be in debug mode or not. debug will be removed as of webpack 3.
  9070. */
  9071. debug?: boolean;
  9072. /**
  9073. * Where loaders can be switched to minimize mode.
  9074. */
  9075. minimize?: boolean;
  9076. /**
  9077. * A configuration object that can be used to configure older loaders.
  9078. */
  9079. options?: {
  9080. [index: string]: any;
  9081. /**
  9082. * The context that can be used to configure older loaders.
  9083. */
  9084. context?: string;
  9085. };
  9086. }
  9087. /**
  9088. * These properties are added by the LoaderPlugin
  9089. */
  9090. declare interface LoaderPluginLoaderContext {
  9091. /**
  9092. * Resolves the given request to a module, applies all configured loaders and calls
  9093. * back with the generated source, the sourceMap and the module instance (usually an
  9094. * instance of NormalModule). Use this function if you need to know the source code
  9095. * of another module to generate the result.
  9096. */
  9097. loadModule(
  9098. request: string,
  9099. callback: (
  9100. err: null | Error,
  9101. source?: string | Buffer,
  9102. sourceMap?: null | object,
  9103. module?: Module
  9104. ) => void
  9105. ): void;
  9106. importModule(
  9107. request: string,
  9108. options: undefined | ImportModuleOptions,
  9109. callback: (err?: null | Error, exports?: any) => void
  9110. ): void;
  9111. importModule(request: string, options?: ImportModuleOptions): Promise<any>;
  9112. }
  9113. /**
  9114. * The properties are added by https://github.com/webpack/loader-runner
  9115. */
  9116. declare interface LoaderRunnerLoaderContext<OptionsType> {
  9117. /**
  9118. * Add a directory as dependency of the loader result.
  9119. */
  9120. addContextDependency(context: string): void;
  9121. /**
  9122. * Adds a file as dependency of the loader result in order to make them watchable.
  9123. * For example, html-loader uses this technique as it finds src and src-set attributes.
  9124. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  9125. */
  9126. addDependency(file: string): void;
  9127. addMissingDependency(context: string): void;
  9128. /**
  9129. * Make this loader async.
  9130. */
  9131. async(): (
  9132. err?: null | Error,
  9133. content?: string | Buffer,
  9134. sourceMap?: null | string | RawSourceMap,
  9135. additionalData?: AdditionalData
  9136. ) => void;
  9137. /**
  9138. * Make this loader result cacheable. By default it's cacheable.
  9139. * A cacheable loader must have a deterministic result, when inputs and dependencies haven't changed.
  9140. * This means the loader shouldn't have other dependencies than specified with this.addDependency.
  9141. * Most loaders are deterministic and cacheable.
  9142. */
  9143. cacheable(flag?: boolean): void;
  9144. callback: (
  9145. err?: null | Error,
  9146. content?: string | Buffer,
  9147. sourceMap?: null | string | RawSourceMap,
  9148. additionalData?: AdditionalData
  9149. ) => void;
  9150. /**
  9151. * Remove all dependencies of the loader result. Even initial dependencies and these of other loaders.
  9152. */
  9153. clearDependencies(): void;
  9154. /**
  9155. * The directory of the module. Can be used as context for resolving other stuff.
  9156. * eg '/workspaces/ts-loader/examples/vanilla/src'
  9157. */
  9158. context: string;
  9159. readonly currentRequest: string;
  9160. readonly data: any;
  9161. /**
  9162. * alias of addDependency
  9163. * Adds a file as dependency of the loader result in order to make them watchable.
  9164. * For example, html-loader uses this technique as it finds src and src-set attributes.
  9165. * Then, it sets the url's for those attributes as dependencies of the html file that is parsed.
  9166. */
  9167. dependency(file: string): void;
  9168. getContextDependencies(): string[];
  9169. getDependencies(): string[];
  9170. getMissingDependencies(): string[];
  9171. /**
  9172. * The index in the loaders array of the current loader.
  9173. * In the example: in loader1: 0, in loader2: 1
  9174. */
  9175. loaderIndex: number;
  9176. readonly previousRequest: string;
  9177. readonly query: string | OptionsType;
  9178. readonly remainingRequest: string;
  9179. readonly request: string;
  9180. /**
  9181. * An array of all the loaders. It is writeable in the pitch phase.
  9182. * loaders = [{request: string, path: string, query: string, module: function}]
  9183. * In the example:
  9184. * [
  9185. * { request: "/abc/loader1.js?xyz",
  9186. * path: "/abc/loader1.js",
  9187. * query: "?xyz",
  9188. * module: [Function]
  9189. * },
  9190. * { request: "/abc/node_modules/loader2/index.js",
  9191. * path: "/abc/node_modules/loader2/index.js",
  9192. * query: "",
  9193. * module: [Function]
  9194. * }
  9195. * ]
  9196. */
  9197. loaders: {
  9198. request: string;
  9199. path: string;
  9200. query: string;
  9201. fragment: string;
  9202. options?: string | object;
  9203. ident: string;
  9204. normal?: Function;
  9205. pitch?: Function;
  9206. raw?: boolean;
  9207. data?: object;
  9208. pitchExecuted: boolean;
  9209. normalExecuted: boolean;
  9210. type?: "module" | "commonjs";
  9211. }[];
  9212. /**
  9213. * The resource path.
  9214. * In the example: "/abc/resource.js"
  9215. */
  9216. resourcePath: string;
  9217. /**
  9218. * The resource query string.
  9219. * Example: "?query"
  9220. */
  9221. resourceQuery: string;
  9222. /**
  9223. * The resource fragment.
  9224. * Example: "#frag"
  9225. */
  9226. resourceFragment: string;
  9227. /**
  9228. * The resource inclusive query and fragment.
  9229. * Example: "/abc/resource.js?query#frag"
  9230. */
  9231. resource: string;
  9232. /**
  9233. * Target of compilation.
  9234. * Example: "web"
  9235. */
  9236. target: string;
  9237. /**
  9238. * Tell what kind of ES-features may be used in the generated runtime-code.
  9239. * Example: { arrowFunction: true }
  9240. */
  9241. environment: Environment;
  9242. }
  9243. declare class LoaderTargetPlugin {
  9244. constructor(target: string);
  9245. target: string;
  9246. /**
  9247. * Apply the plugin
  9248. */
  9249. apply(compiler: Compiler): void;
  9250. }
  9251. declare abstract class LocalModule {
  9252. name: string;
  9253. idx: number;
  9254. used: boolean;
  9255. flagUsed(): void;
  9256. variableName(): string;
  9257. serialize(context: ObjectSerializerContext): void;
  9258. deserialize(context: ObjectDeserializerContext): void;
  9259. }
  9260. declare interface LogEntry {
  9261. type: string;
  9262. args?: any[];
  9263. time: number;
  9264. trace?: string[];
  9265. }
  9266. type LogTypeEnum =
  9267. | "error"
  9268. | "warn"
  9269. | "info"
  9270. | "log"
  9271. | "profile"
  9272. | "debug"
  9273. | "trace"
  9274. | "group"
  9275. | "groupCollapsed"
  9276. | "groupEnd"
  9277. | "profileEnd"
  9278. | "time"
  9279. | "clear"
  9280. | "status";
  9281. declare const MEASURE_END_OPERATION: unique symbol;
  9282. declare const MEASURE_START_OPERATION: unique symbol;
  9283. declare interface MainRenderContext {
  9284. /**
  9285. * the chunk
  9286. */
  9287. chunk: Chunk;
  9288. /**
  9289. * the dependency templates
  9290. */
  9291. dependencyTemplates: DependencyTemplates;
  9292. /**
  9293. * the runtime template
  9294. */
  9295. runtimeTemplate: RuntimeTemplate;
  9296. /**
  9297. * the module graph
  9298. */
  9299. moduleGraph: ModuleGraph;
  9300. /**
  9301. * the chunk graph
  9302. */
  9303. chunkGraph: ChunkGraph;
  9304. /**
  9305. * results of code generation
  9306. */
  9307. codeGenerationResults: CodeGenerationResults;
  9308. /**
  9309. * hash to be used for render call
  9310. */
  9311. hash: string;
  9312. /**
  9313. * rendering in strict context
  9314. */
  9315. strictMode?: boolean;
  9316. }
  9317. declare abstract class MainTemplate {
  9318. hooks: Readonly<{
  9319. renderManifest: {
  9320. tap: <AdditionalOptions>(
  9321. options:
  9322. | string
  9323. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9324. fn: (
  9325. renderManifestEntries: RenderManifestEntry[],
  9326. renderManifestOptions: RenderManifestOptions
  9327. ) => RenderManifestEntry[]
  9328. ) => void;
  9329. };
  9330. modules: { tap: () => never };
  9331. moduleObj: { tap: () => never };
  9332. require: {
  9333. tap: <AdditionalOptions>(
  9334. options:
  9335. | string
  9336. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9337. fn: (
  9338. value: string,
  9339. renderBootstrapContext: RenderBootstrapContext
  9340. ) => string
  9341. ) => void;
  9342. };
  9343. beforeStartup: { tap: () => never };
  9344. startup: { tap: () => never };
  9345. afterStartup: { tap: () => never };
  9346. render: {
  9347. tap: <AdditionalOptions>(
  9348. options:
  9349. | string
  9350. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9351. fn: (
  9352. source: Source,
  9353. chunk: Chunk,
  9354. hash: undefined | string,
  9355. moduleTemplate: ModuleTemplate,
  9356. dependencyTemplates: DependencyTemplates
  9357. ) => Source
  9358. ) => void;
  9359. };
  9360. renderWithEntry: {
  9361. tap: <AdditionalOptions>(
  9362. options:
  9363. | string
  9364. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9365. fn: (source: Source, chunk: Chunk, hash?: string) => Source
  9366. ) => void;
  9367. };
  9368. assetPath: {
  9369. tap: <AdditionalOptions>(
  9370. options:
  9371. | string
  9372. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9373. fn: (value: string, path: PathData, assetInfo?: AssetInfo) => string
  9374. ) => void;
  9375. call: (filename: TemplatePath, options: PathData) => string;
  9376. };
  9377. hash: {
  9378. tap: <AdditionalOptions>(
  9379. options:
  9380. | string
  9381. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9382. fn: (hash: Hash) => void
  9383. ) => void;
  9384. };
  9385. hashForChunk: {
  9386. tap: <AdditionalOptions>(
  9387. options:
  9388. | string
  9389. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  9390. fn: (hash: Hash, chunk: Chunk) => void
  9391. ) => void;
  9392. };
  9393. globalHashPaths: { tap: () => void };
  9394. globalHash: { tap: () => void };
  9395. hotBootstrap: { tap: () => never };
  9396. bootstrap: SyncWaterfallHook<
  9397. [string, Chunk, string, ModuleTemplate, DependencyTemplates],
  9398. string
  9399. >;
  9400. localVars: SyncWaterfallHook<[string, Chunk, string], string>;
  9401. requireExtensions: SyncWaterfallHook<[string, Chunk, string], string>;
  9402. requireEnsure: SyncWaterfallHook<[string, Chunk, string, string], string>;
  9403. get jsonpScript(): SyncWaterfallHook<[string, Chunk], string>;
  9404. get linkPrefetch(): SyncWaterfallHook<[string, Chunk], string>;
  9405. get linkPreload(): SyncWaterfallHook<[string, Chunk], string>;
  9406. }>;
  9407. renderCurrentHashCode: (hash: string, length?: number) => string;
  9408. getPublicPath: (options: PathData) => string;
  9409. getAssetPath: (path: TemplatePath, options: PathData) => string;
  9410. getAssetPathWithInfo: (
  9411. path: TemplatePath,
  9412. options: PathData
  9413. ) => InterpolatedPathAndAssetInfo;
  9414. get requireFn(): "__webpack_require__";
  9415. get outputOptions(): Output;
  9416. }
  9417. declare interface MakeDirectoryOptions {
  9418. recursive?: boolean;
  9419. mode?: string | number;
  9420. }
  9421. /**
  9422. * Describes a manifest entrypoint.
  9423. */
  9424. declare interface ManifestEntrypoint {
  9425. /**
  9426. * Contains the names of entrypoints.
  9427. */
  9428. imports: string[];
  9429. /**
  9430. * Contains the names of parent entrypoints.
  9431. */
  9432. parents?: string[];
  9433. }
  9434. /**
  9435. * Describes a manifest asset that links the emitted path to the producing asset.
  9436. */
  9437. declare interface ManifestItem {
  9438. /**
  9439. * The path absolute URL (this indicates that the path is absolute from the server's root directory) to file.
  9440. */
  9441. file: string;
  9442. /**
  9443. * The source path relative to the context.
  9444. */
  9445. src?: string;
  9446. }
  9447. /**
  9448. * The manifest object.
  9449. */
  9450. declare interface ManifestObject {
  9451. [index: string]: any;
  9452. /**
  9453. * Contains the names of assets.
  9454. */
  9455. assets: Record<string, ManifestItem>;
  9456. /**
  9457. * Contains the names of entrypoints.
  9458. */
  9459. entrypoints: Record<string, ManifestEntrypoint>;
  9460. }
  9461. declare class ManifestPlugin {
  9462. constructor(options: ManifestPluginOptions);
  9463. options: ManifestPluginOptions &
  9464. Required<Omit<ManifestPluginOptions, "filter" | "generate">>;
  9465. /**
  9466. * Apply the plugin
  9467. */
  9468. apply(compiler: Compiler): void;
  9469. }
  9470. declare interface ManifestPluginOptions {
  9471. /**
  9472. * Enables/disables generation of the entrypoints manifest section.
  9473. */
  9474. entrypoints?: boolean;
  9475. /**
  9476. * Specifies the filename of the output file on disk. By default the plugin will emit `manifest.json` inside the 'output.path' directory.
  9477. */
  9478. filename?: string;
  9479. /**
  9480. * Allows filtering the files which make up the manifest.
  9481. */
  9482. filter?: (item: ManifestItem) => boolean;
  9483. /**
  9484. * A function that receives the manifest object, modifies it, and returns the modified manifest.
  9485. */
  9486. generate?: (manifest: ManifestObject) => ManifestObject;
  9487. /**
  9488. * Specifies a path prefix for all keys in the manifest.
  9489. */
  9490. prefix?: string;
  9491. /**
  9492. * A function that receives the manifest object and returns the manifest string.
  9493. */
  9494. serialize?: (manifest: ManifestObject) => string;
  9495. }
  9496. declare interface MapOptions {
  9497. /**
  9498. * need columns?
  9499. */
  9500. columns?: boolean;
  9501. /**
  9502. * is module
  9503. */
  9504. module?: boolean;
  9505. }
  9506. declare interface MatchObject {
  9507. test?:
  9508. | string
  9509. | RegExp
  9510. | ((str: string) => boolean)
  9511. | (string | RegExp | ((str: string) => boolean))[];
  9512. include?:
  9513. | string
  9514. | RegExp
  9515. | ((str: string) => boolean)
  9516. | (string | RegExp | ((str: string) => boolean))[];
  9517. exclude?:
  9518. | string
  9519. | RegExp
  9520. | ((str: string) => boolean)
  9521. | (string | RegExp | ((str: string) => boolean))[];
  9522. }
  9523. type Matcher =
  9524. | string
  9525. | RegExp
  9526. | ((str: string) => boolean)
  9527. | (string | RegExp | ((str: string) => boolean))[];
  9528. declare interface MaybeMergeableInitFragment<GenerateContext> {
  9529. key?: string;
  9530. stage: number;
  9531. position: number;
  9532. getContent: (context: GenerateContext) => undefined | string | Source;
  9533. getEndContent: (context: GenerateContext) => undefined | string | Source;
  9534. merge?: (
  9535. fragments: MaybeMergeableInitFragment<GenerateContext>
  9536. ) => MaybeMergeableInitFragment<GenerateContext>;
  9537. mergeAll?: (
  9538. fragments: MaybeMergeableInitFragment<GenerateContext>[]
  9539. ) => MaybeMergeableInitFragment<GenerateContext>[];
  9540. }
  9541. type Media = undefined | string;
  9542. /**
  9543. * Options object for in-memory caching.
  9544. */
  9545. declare interface MemoryCacheOptions {
  9546. /**
  9547. * Additionally cache computation of modules that are unchanged and reference only unchanged modules.
  9548. */
  9549. cacheUnaffected?: boolean;
  9550. /**
  9551. * 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).
  9552. */
  9553. maxGenerations?: number;
  9554. /**
  9555. * In memory caching.
  9556. */
  9557. type: "memory";
  9558. }
  9559. declare class MemoryCachePlugin {
  9560. constructor();
  9561. /**
  9562. * Apply the plugin
  9563. */
  9564. apply(compiler: Compiler): void;
  9565. }
  9566. declare class MergeDuplicateChunksPlugin {
  9567. constructor(options?: MergeDuplicateChunksPluginOptions);
  9568. options: MergeDuplicateChunksPluginOptions;
  9569. apply(compiler: Compiler): void;
  9570. }
  9571. declare interface MergeDuplicateChunksPluginOptions {
  9572. /**
  9573. * Specifies the stage for merging duplicate chunks.
  9574. */
  9575. stage?: number;
  9576. }
  9577. type Meta = KnownMeta &
  9578. Record<
  9579. | typeof idsSymbolCommonJsExportRequireDependency
  9580. | typeof idsSymbolHarmonyImportSpecifierDependency
  9581. | typeof idsSymbolHarmonyExportImportedSpecifierDependency,
  9582. string[]
  9583. > &
  9584. Record<string, any>;
  9585. declare class MinChunkSizePlugin {
  9586. constructor(options: MinChunkSizePluginOptions);
  9587. options: MinChunkSizePluginOptions;
  9588. /**
  9589. * Apply the plugin
  9590. */
  9591. apply(compiler: Compiler): void;
  9592. }
  9593. declare interface MinChunkSizePluginOptions {
  9594. /**
  9595. * Constant overhead for a chunk.
  9596. */
  9597. chunkOverhead?: number;
  9598. /**
  9599. * Multiplicator for initial chunks.
  9600. */
  9601. entryChunkMultiplicator?: number;
  9602. /**
  9603. * Minimum number of characters.
  9604. */
  9605. minChunkSize: number;
  9606. }
  9607. declare interface Mkdir {
  9608. (
  9609. file: PathLikeFs,
  9610. options: MakeDirectoryOptions & { recursive: true },
  9611. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  9612. ): void;
  9613. (
  9614. file: PathLikeFs,
  9615. options:
  9616. | undefined
  9617. | null
  9618. | string
  9619. | number
  9620. | (MakeDirectoryOptions & { recursive?: false }),
  9621. callback: (err: null | NodeJS.ErrnoException) => void
  9622. ): void;
  9623. (
  9624. file: PathLikeFs,
  9625. options: undefined | null | string | number | MakeDirectoryOptions,
  9626. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  9627. ): void;
  9628. (
  9629. file: PathLikeFs,
  9630. callback: (err: null | NodeJS.ErrnoException) => void
  9631. ): void;
  9632. }
  9633. declare interface MkdirSync {
  9634. (
  9635. path: PathLikeFs,
  9636. options: MakeDirectoryOptions & { recursive: true }
  9637. ): undefined | string;
  9638. (
  9639. path: PathLikeFs,
  9640. options?:
  9641. | null
  9642. | string
  9643. | number
  9644. | (MakeDirectoryOptions & { recursive?: false })
  9645. ): void;
  9646. (
  9647. path: PathLikeFs,
  9648. options?: null | string | number | MakeDirectoryOptions
  9649. ): undefined | string;
  9650. }
  9651. declare class Module extends DependenciesBlock {
  9652. constructor(type: string, context?: null | string, layer?: null | string);
  9653. type: string;
  9654. context: null | string;
  9655. layer: null | string;
  9656. needId: boolean;
  9657. debugId: number;
  9658. resolveOptions?: ResolveOptions;
  9659. factoryMeta?: FactoryMeta;
  9660. useSourceMap: boolean;
  9661. useSimpleSourceMap: boolean;
  9662. hot: boolean;
  9663. buildMeta?: BuildMeta;
  9664. buildInfo?: BuildInfo;
  9665. presentationalDependencies?: Dependency[];
  9666. codeGenerationDependencies?: Dependency[];
  9667. id: null | string | number;
  9668. get hash(): string;
  9669. get renderedHash(): string;
  9670. profile?: ModuleProfile;
  9671. index: null | number;
  9672. index2: null | number;
  9673. depth: null | number;
  9674. issuer?: null | Module;
  9675. get usedExports(): null | boolean | SortableSet<string>;
  9676. get optimizationBailout(): (
  9677. | string
  9678. | ((requestShortener: RequestShortener) => string)
  9679. )[];
  9680. get optional(): boolean;
  9681. addChunk(chunk: Chunk): boolean;
  9682. removeChunk(chunk: Chunk): void;
  9683. isInChunk(chunk: Chunk): boolean;
  9684. isEntryModule(): boolean;
  9685. getChunks(): Chunk[];
  9686. getNumberOfChunks(): number;
  9687. get chunksIterable(): Iterable<Chunk>;
  9688. isProvided(exportName: string): null | boolean;
  9689. get exportsArgument(): string;
  9690. get moduleArgument(): string;
  9691. getExportsType(moduleGraph: ModuleGraph, strict?: boolean): ExportsType;
  9692. addPresentationalDependency(presentationalDependency: Dependency): void;
  9693. addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
  9694. addWarning(warning: WebpackError): void;
  9695. getWarnings(): undefined | Iterable<WebpackError>;
  9696. getNumberOfWarnings(): number;
  9697. addError(error: WebpackError): void;
  9698. getErrors(): undefined | Iterable<WebpackError>;
  9699. getNumberOfErrors(): number;
  9700. /**
  9701. * removes all warnings and errors
  9702. */
  9703. clearWarningsAndErrors(): void;
  9704. isOptional(moduleGraph: ModuleGraph): boolean;
  9705. isAccessibleInChunk(
  9706. chunkGraph: ChunkGraph,
  9707. chunk: Chunk,
  9708. ignoreChunk?: Chunk
  9709. ): boolean;
  9710. isAccessibleInChunkGroup(
  9711. chunkGraph: ChunkGraph,
  9712. chunkGroup: ChunkGroup,
  9713. ignoreChunk?: Chunk
  9714. ): boolean;
  9715. hasReasonForChunk(
  9716. chunk: Chunk,
  9717. moduleGraph: ModuleGraph,
  9718. chunkGraph: ChunkGraph
  9719. ): boolean;
  9720. hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
  9721. needBuild(
  9722. context: NeedBuildContext,
  9723. callback: (err?: null | WebpackError, needBuild?: boolean) => void
  9724. ): void;
  9725. needRebuild(
  9726. fileTimestamps: Map<string, null | number>,
  9727. contextTimestamps: Map<string, null | number>
  9728. ): boolean;
  9729. invalidateBuild(): void;
  9730. identifier(): string;
  9731. readableIdentifier(requestShortener: RequestShortener): string;
  9732. build(
  9733. options: WebpackOptionsNormalizedWithDefaults,
  9734. compilation: Compilation,
  9735. resolver: ResolverWithOptions,
  9736. fs: InputFileSystem,
  9737. callback: (err?: WebpackError) => void
  9738. ): void;
  9739. getSourceTypes(): ReadonlySet<string>;
  9740. source(
  9741. dependencyTemplates: DependencyTemplates,
  9742. runtimeTemplate: RuntimeTemplate,
  9743. type?: string
  9744. ): Source;
  9745. size(type?: string): number;
  9746. libIdent(options: LibIdentOptions): null | string;
  9747. nameForCondition(): null | string;
  9748. getConcatenationBailoutReason(
  9749. context: ConcatenationBailoutReasonContext
  9750. ): undefined | string;
  9751. getSideEffectsConnectionState(moduleGraph: ModuleGraph): ConnectionState;
  9752. codeGeneration(context: CodeGenerationContext): CodeGenerationResult;
  9753. chunkCondition(chunk: Chunk, compilation: Compilation): boolean;
  9754. hasChunkCondition(): boolean;
  9755. /**
  9756. * Assuming this module is in the cache. Update the (cached) module with
  9757. * the fresh module from the factory. Usually updates internal references
  9758. * and properties.
  9759. */
  9760. updateCacheModule(module: Module): void;
  9761. /**
  9762. * Module should be unsafe cached. Get data that's needed for that.
  9763. * This data will be passed to restoreFromUnsafeCache later.
  9764. */
  9765. getUnsafeCacheData(): UnsafeCacheData;
  9766. /**
  9767. * Assuming this module is in the cache. Remove internal references to allow freeing some memory.
  9768. */
  9769. cleanupForCache(): void;
  9770. originalSource(): null | Source;
  9771. addCacheDependencies(
  9772. fileDependencies: LazySet<string>,
  9773. contextDependencies: LazySet<string>,
  9774. missingDependencies: LazySet<string>,
  9775. buildDependencies: LazySet<string>
  9776. ): void;
  9777. get hasEqualsChunks(): any;
  9778. get isUsed(): any;
  9779. get errors(): any;
  9780. get warnings(): any;
  9781. used: any;
  9782. }
  9783. declare class ModuleChunkLoadingRuntimeModule extends RuntimeModule {
  9784. constructor(runtimeRequirements: ReadonlySet<string>);
  9785. static getCompilationHooks(
  9786. compilation: Compilation
  9787. ): JsonpCompilationPluginHooks;
  9788. /**
  9789. * Runtime modules without any dependencies to other runtime modules
  9790. */
  9791. static STAGE_NORMAL: number;
  9792. /**
  9793. * Runtime modules with simple dependencies on other runtime modules
  9794. */
  9795. static STAGE_BASIC: number;
  9796. /**
  9797. * Runtime modules which attach to handlers of other runtime modules
  9798. */
  9799. static STAGE_ATTACH: number;
  9800. /**
  9801. * Runtime modules which trigger actions on bootstrap
  9802. */
  9803. static STAGE_TRIGGER: number;
  9804. }
  9805. declare class ModuleConcatenationPlugin {
  9806. constructor();
  9807. /**
  9808. * Apply the plugin
  9809. */
  9810. apply(compiler: Compiler): void;
  9811. }
  9812. declare class ModuleDependency extends Dependency {
  9813. constructor(request: string, sourceOrder?: number);
  9814. request: string;
  9815. userRequest: string;
  9816. sourceOrder?: number;
  9817. range?: [number, number];
  9818. static Template: typeof DependencyTemplate;
  9819. static NO_EXPORTS_REFERENCED: string[][];
  9820. static EXPORTS_OBJECT_REFERENCED: string[][];
  9821. static isLowPriorityDependency(dependency: Dependency): boolean;
  9822. static TRANSITIVE: typeof TRANSITIVE;
  9823. }
  9824. declare class ModuleExternalInitFragment extends InitFragment<GenerateContext> {
  9825. constructor(
  9826. request: string,
  9827. imported: Imported,
  9828. ident?: string,
  9829. dependencyMeta?: ImportDependencyMeta,
  9830. hashFunction?: string | typeof Hash
  9831. );
  9832. getImported(): Imported;
  9833. setImported(imported: Imported): void;
  9834. getNamespaceIdentifier(): string;
  9835. buildIdentifier(ident: string): string;
  9836. buildImported(imported: Imported): Imported;
  9837. static addToSource<Context>(
  9838. source: Source,
  9839. initFragments: MaybeMergeableInitFragment<Context>[],
  9840. context: Context
  9841. ): Source;
  9842. static STAGE_CONSTANTS: number;
  9843. static STAGE_ASYNC_BOUNDARY: number;
  9844. static STAGE_HARMONY_EXPORTS: number;
  9845. static STAGE_HARMONY_IMPORTS: number;
  9846. static STAGE_PROVIDES: number;
  9847. static STAGE_ASYNC_DEPENDENCIES: number;
  9848. static STAGE_ASYNC_HARMONY_IMPORTS: number;
  9849. }
  9850. declare class ModuleFactory {
  9851. constructor();
  9852. create(
  9853. data: ModuleFactoryCreateData,
  9854. callback: (err?: null | Error, result?: ModuleFactoryResult) => void
  9855. ): void;
  9856. }
  9857. declare interface ModuleFactoryCacheEntry {
  9858. /**
  9859. * - The undo path to the CSS file
  9860. */
  9861. undoPath: string;
  9862. /**
  9863. * - The inheritance chain
  9864. */
  9865. inheritance: [CssLayer, Supports, Media][];
  9866. /**
  9867. * - The cached source
  9868. */
  9869. source: CachedSource;
  9870. }
  9871. declare interface ModuleFactoryCreateData {
  9872. contextInfo: ModuleFactoryCreateDataContextInfo;
  9873. resolveOptions?: ResolveOptions;
  9874. context: string;
  9875. dependencies: Dependency[];
  9876. }
  9877. declare interface ModuleFactoryCreateDataContextInfo {
  9878. issuer: string;
  9879. issuerLayer: IssuerLayer;
  9880. compiler?: string;
  9881. }
  9882. declare interface ModuleFactoryResult {
  9883. /**
  9884. * the created module or unset if no module was created
  9885. */
  9886. module?: Module;
  9887. fileDependencies?: Set<string>;
  9888. contextDependencies?: Set<string>;
  9889. missingDependencies?: Set<string>;
  9890. /**
  9891. * allow to use the unsafe cache
  9892. */
  9893. cacheable?: boolean;
  9894. }
  9895. declare class ModuleFederationPlugin {
  9896. constructor(options: ModuleFederationPluginOptions);
  9897. /**
  9898. * Apply the plugin
  9899. */
  9900. apply(compiler: Compiler): void;
  9901. /**
  9902. * Get the compilation hooks associated with this plugin.
  9903. */
  9904. static getCompilationHooks(
  9905. compilation: Compilation
  9906. ): CompilationHooksModuleFederationPlugin;
  9907. }
  9908. declare interface ModuleFederationPluginOptions {
  9909. /**
  9910. * 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.
  9911. */
  9912. exposes?: (string | ExposesObject)[] | ExposesObject;
  9913. /**
  9914. * The filename of the container as relative path inside the `output.path` directory.
  9915. */
  9916. filename?: string;
  9917. /**
  9918. * Options for library.
  9919. */
  9920. library?: LibraryOptions;
  9921. /**
  9922. * The name of the container.
  9923. */
  9924. name?: string;
  9925. /**
  9926. * The external type of the remote containers.
  9927. */
  9928. remoteType?:
  9929. | "import"
  9930. | "var"
  9931. | "module"
  9932. | "assign"
  9933. | "this"
  9934. | "window"
  9935. | "self"
  9936. | "global"
  9937. | "commonjs"
  9938. | "commonjs2"
  9939. | "commonjs-module"
  9940. | "commonjs-static"
  9941. | "amd"
  9942. | "amd-require"
  9943. | "umd"
  9944. | "umd2"
  9945. | "jsonp"
  9946. | "system"
  9947. | "promise"
  9948. | "module-import"
  9949. | "script"
  9950. | "node-commonjs"
  9951. | "asset"
  9952. | "css-import"
  9953. | "css-url";
  9954. /**
  9955. * 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.
  9956. */
  9957. remotes?: (string | RemotesObject)[] | RemotesObject;
  9958. /**
  9959. * The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
  9960. */
  9961. runtime?: string | false;
  9962. /**
  9963. * Share scope name used for all shared modules (defaults to 'default').
  9964. */
  9965. shareScope?: string;
  9966. /**
  9967. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  9968. */
  9969. shared?: (string | SharedObject)[] | SharedObject;
  9970. }
  9971. declare interface ModuleFilenameTemplateContext {
  9972. /**
  9973. * the identifier of the module
  9974. */
  9975. identifier: string;
  9976. /**
  9977. * the shortened identifier of the module
  9978. */
  9979. shortIdentifier: string;
  9980. /**
  9981. * the resource of the module request
  9982. */
  9983. resource: string;
  9984. /**
  9985. * the resource path of the module request
  9986. */
  9987. resourcePath: string;
  9988. /**
  9989. * the absolute resource path of the module request
  9990. */
  9991. absoluteResourcePath: string;
  9992. /**
  9993. * the loaders of the module request
  9994. */
  9995. loaders: string;
  9996. /**
  9997. * the all loaders of the module request
  9998. */
  9999. allLoaders: string;
  10000. /**
  10001. * the query of the module identifier
  10002. */
  10003. query: string;
  10004. /**
  10005. * the module id of the module
  10006. */
  10007. moduleId: string;
  10008. /**
  10009. * the hash of the module identifier
  10010. */
  10011. hash: string;
  10012. /**
  10013. * the module namespace
  10014. */
  10015. namespace: string;
  10016. }
  10017. type ModuleFilterItemTypes =
  10018. | string
  10019. | RegExp
  10020. | ((
  10021. name: string,
  10022. module: StatsModule,
  10023. type: "module" | "chunk" | "root-of-chunk" | "nested"
  10024. ) => boolean);
  10025. declare class ModuleGraph {
  10026. constructor();
  10027. setParents(
  10028. dependency: Dependency,
  10029. block: DependenciesBlock,
  10030. module: Module,
  10031. indexInBlock?: number
  10032. ): void;
  10033. setParentDependenciesBlockIndex(dependency: Dependency, index: number): void;
  10034. getParentModule(dependency: Dependency): undefined | Module;
  10035. getParentBlock(dependency: Dependency): undefined | DependenciesBlock;
  10036. getParentBlockIndex(dependency: Dependency): number;
  10037. setResolvedModule(
  10038. originModule: null | Module,
  10039. dependency: Dependency,
  10040. module: Module
  10041. ): void;
  10042. updateModule(dependency: Dependency, module: Module): void;
  10043. updateParent(
  10044. dependency: Dependency,
  10045. connection?: ModuleGraphConnection,
  10046. parentModule?: Module
  10047. ): void;
  10048. finishUpdateParent(): void;
  10049. removeConnection(dependency: Dependency): void;
  10050. addExplanation(dependency: Dependency, explanation: string): void;
  10051. cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
  10052. removeModuleAttributes(module: Module): void;
  10053. removeAllModuleAttributes(): void;
  10054. moveModuleConnections(
  10055. oldModule: Module,
  10056. newModule: Module,
  10057. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  10058. ): void;
  10059. copyOutgoingModuleConnections(
  10060. oldModule: Module,
  10061. newModule: Module,
  10062. filterConnection: (moduleGraphConnection: ModuleGraphConnection) => boolean
  10063. ): void;
  10064. addExtraReason(module: Module, explanation: string): void;
  10065. getResolvedModule(dependency: Dependency): null | Module;
  10066. getConnection(dependency: Dependency): undefined | ModuleGraphConnection;
  10067. getModule(dependency: Dependency): null | Module;
  10068. getOrigin(dependency: Dependency): null | Module;
  10069. getResolvedOrigin(dependency: Dependency): null | Module;
  10070. getIncomingConnections(module: Module): Iterable<ModuleGraphConnection>;
  10071. getOutgoingConnections(module: Module): Iterable<ModuleGraphConnection>;
  10072. getIncomingConnectionsByOriginModule(
  10073. module: Module
  10074. ): ReadonlyMap<
  10075. undefined | null | Module,
  10076. ReadonlyArray<ModuleGraphConnection>
  10077. >;
  10078. getOutgoingConnectionsByModule(
  10079. module: Module
  10080. ):
  10081. | undefined
  10082. | ReadonlyMap<undefined | Module, ReadonlyArray<ModuleGraphConnection>>;
  10083. getProfile(module: Module): undefined | ModuleProfile;
  10084. setProfile(module: Module, profile?: ModuleProfile): void;
  10085. getIssuer(module: Module): Issuer;
  10086. setIssuer(module: Module, issuer: null | Module): void;
  10087. setIssuerIfUnset(module: Module, issuer: null | Module): void;
  10088. getOptimizationBailout(
  10089. module: Module
  10090. ): (string | ((requestShortener: RequestShortener) => string))[];
  10091. getProvidedExports(module: Module): null | true | string[];
  10092. isExportProvided(
  10093. module: Module,
  10094. exportName: string | string[]
  10095. ): null | boolean;
  10096. getExportsInfo(module: Module): ExportsInfo;
  10097. getExportInfo(module: Module, exportName: string): ExportInfo;
  10098. getReadOnlyExportInfo(module: Module, exportName: string): ExportInfo;
  10099. getUsedExports(
  10100. module: Module,
  10101. runtime: RuntimeSpec
  10102. ): null | boolean | SortableSet<string>;
  10103. getPreOrderIndex(module: Module): null | number;
  10104. getPostOrderIndex(module: Module): null | number;
  10105. setPreOrderIndex(module: Module, index: number): void;
  10106. setPreOrderIndexIfUnset(module: Module, index: number): boolean;
  10107. setPostOrderIndex(module: Module, index: number): void;
  10108. setPostOrderIndexIfUnset(module: Module, index: number): boolean;
  10109. getDepth(module: Module): null | number;
  10110. setDepth(module: Module, depth: number): void;
  10111. setDepthIfLower(module: Module, depth: number): boolean;
  10112. isAsync(module: Module): boolean;
  10113. isDeferred(module: Module): boolean;
  10114. setAsync(module: Module): void;
  10115. getMeta(thing: object): Meta;
  10116. getMetaIfExisting(thing: object): undefined | Meta;
  10117. freeze(cacheStage?: string): void;
  10118. unfreeze(): void;
  10119. cached<T extends any[], R>(
  10120. fn: (moduleGraph: ModuleGraph, ...args: T) => R,
  10121. ...args: T
  10122. ): R;
  10123. setModuleMemCaches(
  10124. moduleMemCaches: Map<Module, WeakTupleMap<any[], any>>
  10125. ): void;
  10126. dependencyCacheProvide<D extends Dependency, ARGS extends any[], R>(
  10127. dependency: D,
  10128. ...args: [
  10129. ARGS,
  10130. ...((moduleGraph: ModuleGraph, dependency: D, ...args: ARGS) => R)[]
  10131. ]
  10132. ): R;
  10133. static getModuleGraphForModule(
  10134. module: Module,
  10135. deprecateMessage: string,
  10136. deprecationCode: string
  10137. ): ModuleGraph;
  10138. static setModuleGraphForModule(
  10139. module: Module,
  10140. moduleGraph: ModuleGraph
  10141. ): void;
  10142. static clearModuleGraphForModule(module: Module): void;
  10143. static ModuleGraphConnection: typeof ModuleGraphConnection;
  10144. }
  10145. declare class ModuleGraphConnection {
  10146. constructor(
  10147. originModule: null | Module,
  10148. dependency: null | Dependency,
  10149. module: Module,
  10150. explanation?: string,
  10151. weak?: boolean,
  10152. condition?:
  10153. | null
  10154. | false
  10155. | ((
  10156. moduleGraphConnection: ModuleGraphConnection,
  10157. runtime: RuntimeSpec
  10158. ) => ConnectionState)
  10159. );
  10160. originModule: null | Module;
  10161. resolvedOriginModule: null | Module;
  10162. dependency: null | Dependency;
  10163. resolvedModule: Module;
  10164. module: Module;
  10165. weak: boolean;
  10166. conditional: boolean;
  10167. condition?: (
  10168. moduleGraphConnection: ModuleGraphConnection,
  10169. runtime: RuntimeSpec
  10170. ) => ConnectionState;
  10171. explanations?: Set<string>;
  10172. clone(): ModuleGraphConnection;
  10173. addCondition(
  10174. condition: (
  10175. moduleGraphConnection: ModuleGraphConnection,
  10176. runtime: RuntimeSpec
  10177. ) => ConnectionState
  10178. ): void;
  10179. addExplanation(explanation: string): void;
  10180. get explanation(): string;
  10181. isActive(runtime: RuntimeSpec): boolean;
  10182. isTargetActive(runtime: RuntimeSpec): boolean;
  10183. getActiveState(runtime: RuntimeSpec): ConnectionState;
  10184. setActive(value: boolean): void;
  10185. active: void;
  10186. static CIRCULAR_CONNECTION: typeof CIRCULAR_CONNECTION;
  10187. static TRANSITIVE_ONLY: typeof TRANSITIVE_ONLY;
  10188. static addConnectionStates: (
  10189. a: ConnectionState,
  10190. b: ConnectionState
  10191. ) => ConnectionState;
  10192. }
  10193. type ModuleId = string | number;
  10194. type ModuleInfo = ConcatenatedModuleInfo | ExternalModuleInfo;
  10195. declare interface ModuleMemCachesItem {
  10196. buildInfo: BuildInfo;
  10197. references?: WeakMap<Dependency, Module>;
  10198. memCache: WeakTupleMap<any[], any>;
  10199. }
  10200. /**
  10201. * Options affecting the normal modules (`NormalModuleFactory`).
  10202. */
  10203. declare interface ModuleOptions {
  10204. /**
  10205. * An array of rules applied by default for modules.
  10206. */
  10207. defaultRules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10208. /**
  10209. * Enable warnings for full dynamic dependencies.
  10210. */
  10211. exprContextCritical?: boolean;
  10212. /**
  10213. * Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.
  10214. */
  10215. exprContextRecursive?: boolean;
  10216. /**
  10217. * Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.
  10218. */
  10219. exprContextRegExp?: boolean | RegExp;
  10220. /**
  10221. * Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.
  10222. */
  10223. exprContextRequest?: string;
  10224. /**
  10225. * Specify options for each generator.
  10226. */
  10227. generator?: GeneratorOptionsByModuleType;
  10228. /**
  10229. * Don't parse files matching. It's matched against the full resolved request.
  10230. */
  10231. noParse?:
  10232. | string
  10233. | RegExp
  10234. | (string | RegExp | ((content: string) => boolean))[]
  10235. | ((content: string) => boolean);
  10236. /**
  10237. * Specify options for each parser.
  10238. */
  10239. parser?: ParserOptionsByModuleType;
  10240. /**
  10241. * An array of rules applied for modules.
  10242. */
  10243. rules?: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10244. /**
  10245. * Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.
  10246. */
  10247. strictExportPresence?: boolean;
  10248. /**
  10249. * Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.
  10250. */
  10251. strictThisContextOnImports?: boolean;
  10252. /**
  10253. * Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.
  10254. */
  10255. unknownContextCritical?: boolean;
  10256. /**
  10257. * 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'.
  10258. */
  10259. unknownContextRecursive?: boolean;
  10260. /**
  10261. * 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'.
  10262. */
  10263. unknownContextRegExp?: boolean | RegExp;
  10264. /**
  10265. * 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'.
  10266. */
  10267. unknownContextRequest?: string;
  10268. /**
  10269. * Cache the resolving of module requests.
  10270. */
  10271. unsafeCache?: boolean | ((module: Module) => boolean);
  10272. /**
  10273. * Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.
  10274. */
  10275. wrappedContextCritical?: boolean;
  10276. /**
  10277. * Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.
  10278. */
  10279. wrappedContextRecursive?: boolean;
  10280. /**
  10281. * Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.
  10282. */
  10283. wrappedContextRegExp?: RegExp;
  10284. }
  10285. /**
  10286. * Options affecting the normal modules (`NormalModuleFactory`).
  10287. */
  10288. declare interface ModuleOptionsNormalized {
  10289. /**
  10290. * An array of rules applied by default for modules.
  10291. */
  10292. defaultRules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10293. /**
  10294. * Specify options for each generator.
  10295. */
  10296. generator: GeneratorOptionsByModuleType;
  10297. /**
  10298. * Don't parse files matching. It's matched against the full resolved request.
  10299. */
  10300. noParse?:
  10301. | string
  10302. | RegExp
  10303. | (string | RegExp | ((content: string) => boolean))[]
  10304. | ((content: string) => boolean);
  10305. /**
  10306. * Specify options for each parser.
  10307. */
  10308. parser: ParserOptionsByModuleType;
  10309. /**
  10310. * An array of rules applied for modules.
  10311. */
  10312. rules: (undefined | null | false | "" | 0 | RuleSetRule | "...")[];
  10313. /**
  10314. * Cache the resolving of module requests.
  10315. */
  10316. unsafeCache?: boolean | ((module: Module) => boolean);
  10317. }
  10318. declare interface ModulePathData {
  10319. id: string | number;
  10320. hash: string;
  10321. hashWithLength?: (length: number) => string;
  10322. }
  10323. declare abstract class ModuleProfile {
  10324. startTime: number;
  10325. factoryStartTime: number;
  10326. factoryEndTime: number;
  10327. factory: number;
  10328. factoryParallelismFactor: number;
  10329. restoringStartTime: number;
  10330. restoringEndTime: number;
  10331. restoring: number;
  10332. restoringParallelismFactor: number;
  10333. integrationStartTime: number;
  10334. integrationEndTime: number;
  10335. integration: number;
  10336. integrationParallelismFactor: number;
  10337. buildingStartTime: number;
  10338. buildingEndTime: number;
  10339. building: number;
  10340. buildingParallelismFactor: number;
  10341. storingStartTime: number;
  10342. storingEndTime: number;
  10343. storing: number;
  10344. storingParallelismFactor: number;
  10345. additionalFactoryTimes?: { start: number; end: number }[];
  10346. additionalFactories: number;
  10347. additionalFactoriesParallelismFactor: number;
  10348. additionalIntegration: number;
  10349. markFactoryStart(): void;
  10350. markFactoryEnd(): void;
  10351. markRestoringStart(): void;
  10352. markRestoringEnd(): void;
  10353. markIntegrationStart(): void;
  10354. markIntegrationEnd(): void;
  10355. markBuildingStart(): void;
  10356. markBuildingEnd(): void;
  10357. markStoringStart(): void;
  10358. markStoringEnd(): void;
  10359. /**
  10360. * Merge this profile into another one
  10361. */
  10362. mergeInto(realProfile: ModuleProfile): void;
  10363. }
  10364. declare interface ModuleReferenceOptions {
  10365. /**
  10366. * the properties/exports of the module
  10367. */
  10368. ids: string[];
  10369. /**
  10370. * true, when this referenced export is called
  10371. */
  10372. call: boolean;
  10373. /**
  10374. * true, when this referenced export is directly imported (not via property access)
  10375. */
  10376. directImport: boolean;
  10377. /**
  10378. * true, when this referenced export is deferred
  10379. */
  10380. deferredImport: boolean;
  10381. /**
  10382. * if the position is ASI safe or unknown
  10383. */
  10384. asiSafe?: boolean;
  10385. }
  10386. declare interface ModuleRenderContext {
  10387. /**
  10388. * the chunk
  10389. */
  10390. chunk: Chunk;
  10391. /**
  10392. * the dependency templates
  10393. */
  10394. dependencyTemplates: DependencyTemplates;
  10395. /**
  10396. * the runtime template
  10397. */
  10398. runtimeTemplate: RuntimeTemplate;
  10399. /**
  10400. * the module graph
  10401. */
  10402. moduleGraph: ModuleGraph;
  10403. /**
  10404. * the chunk graph
  10405. */
  10406. chunkGraph: ChunkGraph;
  10407. /**
  10408. * results of code generation
  10409. */
  10410. codeGenerationResults: CodeGenerationResults;
  10411. /**
  10412. * init fragments for the chunk
  10413. */
  10414. chunkInitFragments: InitFragment<ChunkRenderContextJavascriptModulesPlugin>[];
  10415. /**
  10416. * rendering in strict context
  10417. */
  10418. strictMode?: boolean;
  10419. /**
  10420. * true: renders as factory method, false: pure module content
  10421. */
  10422. factory: boolean;
  10423. /**
  10424. * the inlined entry module is wrapped in an IIFE, existing only when `factory` is set to false
  10425. */
  10426. inlinedInIIFE?: boolean;
  10427. /**
  10428. * render module in object container
  10429. */
  10430. renderInObject?: boolean;
  10431. }
  10432. declare interface ModuleResult {
  10433. client: string;
  10434. data: string;
  10435. active: boolean;
  10436. }
  10437. declare interface ModuleSettings {
  10438. /**
  10439. * Specifies the layer in which the module should be placed in.
  10440. */
  10441. layer?: string;
  10442. /**
  10443. * Module type to use for the module.
  10444. */
  10445. type?: string;
  10446. /**
  10447. * Options for parsing.
  10448. */
  10449. parser?: { [index: string]: any };
  10450. /**
  10451. * The options for the module generator.
  10452. */
  10453. generator?: { [index: string]: any };
  10454. /**
  10455. * Enable/Disable extracting source map.
  10456. */
  10457. extractSourceMap?: boolean;
  10458. /**
  10459. * Options for the resolver.
  10460. */
  10461. resolve?: ResolveOptions;
  10462. /**
  10463. * Flags a module as with or without side effects.
  10464. */
  10465. sideEffects?: boolean;
  10466. }
  10467. declare abstract class ModuleTemplate {
  10468. type: string;
  10469. hooks: Readonly<{
  10470. content: {
  10471. tap: <AdditionalOptions>(
  10472. options:
  10473. | string
  10474. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10475. fn: (
  10476. source: Source,
  10477. module: Module,
  10478. moduleRenderContext: ModuleRenderContext,
  10479. dependencyTemplates: DependencyTemplates
  10480. ) => Source
  10481. ) => void;
  10482. };
  10483. module: {
  10484. tap: <AdditionalOptions>(
  10485. options:
  10486. | string
  10487. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10488. fn: (
  10489. source: Source,
  10490. module: Module,
  10491. moduleRenderContext: ModuleRenderContext,
  10492. dependencyTemplates: DependencyTemplates
  10493. ) => Source
  10494. ) => void;
  10495. };
  10496. render: {
  10497. tap: <AdditionalOptions>(
  10498. options:
  10499. | string
  10500. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10501. fn: (
  10502. source: Source,
  10503. module: Module,
  10504. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  10505. dependencyTemplates: DependencyTemplates
  10506. ) => Source
  10507. ) => void;
  10508. };
  10509. package: {
  10510. tap: <AdditionalOptions>(
  10511. options:
  10512. | string
  10513. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10514. fn: (
  10515. source: Source,
  10516. module: Module,
  10517. chunkRenderContext: ChunkRenderContextJavascriptModulesPlugin,
  10518. dependencyTemplates: DependencyTemplates
  10519. ) => Source
  10520. ) => void;
  10521. };
  10522. hash: {
  10523. tap: <AdditionalOptions>(
  10524. options:
  10525. | string
  10526. | (TapOptions & { name: string } & IfSet<AdditionalOptions>),
  10527. fn: (hash: Hash) => void
  10528. ) => void;
  10529. };
  10530. }>;
  10531. get runtimeTemplate(): RuntimeTemplate;
  10532. }
  10533. declare interface ModuleTemplates {
  10534. javascript: ModuleTemplate;
  10535. }
  10536. declare class MultiCompiler {
  10537. constructor(
  10538. compilers: Compiler[] | Record<string, Compiler>,
  10539. options: MultiCompilerOptions
  10540. );
  10541. hooks: Readonly<{
  10542. done: SyncHook<[MultiStats]>;
  10543. invalid: MultiHook<SyncHook<[null | string, number]>>;
  10544. run: MultiHook<AsyncSeriesHook<[Compiler]>>;
  10545. watchClose: SyncHook<[]>;
  10546. watchRun: MultiHook<AsyncSeriesHook<[Compiler]>>;
  10547. infrastructureLog: MultiHook<
  10548. SyncBailHook<[string, string, undefined | any[]], true | void>
  10549. >;
  10550. }>;
  10551. compilers: Compiler[];
  10552. dependencies: WeakMap<Compiler, string[]>;
  10553. running: boolean;
  10554. get options(): WebpackOptionsNormalized[] & MultiCompilerOptions;
  10555. get outputPath(): string;
  10556. inputFileSystem: InputFileSystem;
  10557. outputFileSystem: OutputFileSystem;
  10558. watchFileSystem: WatchFileSystem;
  10559. intermediateFileSystem: IntermediateFileSystem;
  10560. getInfrastructureLogger(name: string | (() => string)): WebpackLogger;
  10561. setDependencies(compiler: Compiler, dependencies: string[]): void;
  10562. validateDependencies(
  10563. callback: CallbackWebpackFunction_2<MultiStats, void>
  10564. ): boolean;
  10565. runWithDependencies(
  10566. compilers: Compiler[],
  10567. fn: (
  10568. compiler: Compiler,
  10569. callback: CallbackWebpackFunction_2<MultiStats, void>
  10570. ) => void,
  10571. callback: CallbackWebpackFunction_2<Stats[], void>
  10572. ): void;
  10573. watch(
  10574. watchOptions: WatchOptions | WatchOptions[],
  10575. handler: CallbackWebpackFunction_2<MultiStats, void>
  10576. ): undefined | MultiWatching;
  10577. run(callback: CallbackWebpackFunction_2<MultiStats, void>): void;
  10578. purgeInputFileSystem(): void;
  10579. close(callback: (err: null | Error, result?: void) => void): void;
  10580. }
  10581. declare interface MultiCompilerOptions {
  10582. /**
  10583. * how many Compilers are allows to run at the same time in parallel
  10584. */
  10585. parallelism?: number;
  10586. }
  10587. type MultiConfiguration = ReadonlyArray<Configuration> & MultiCompilerOptions;
  10588. declare abstract class MultiStats {
  10589. stats: Stats[];
  10590. get hash(): string;
  10591. hasErrors(): boolean;
  10592. hasWarnings(): boolean;
  10593. toJson(options?: string | boolean | MultiStatsOptions): StatsCompilation;
  10594. toString(options?: string | boolean | MultiStatsOptions): string;
  10595. }
  10596. type MultiStatsOptions = Omit<StatsOptions, "children"> & {
  10597. children?: string | boolean | StatsOptions | ChildrenStatsOptions[];
  10598. };
  10599. declare abstract class MultiWatching {
  10600. watchings: Watching[];
  10601. compiler: MultiCompiler;
  10602. invalidate(callback?: (err: null | Error, result?: void) => void): void;
  10603. suspend(): void;
  10604. resume(): void;
  10605. close(callback: (err: null | Error, result?: void) => void): void;
  10606. }
  10607. declare class NamedChunkIdsPlugin {
  10608. constructor(options?: NamedChunkIdsPluginOptions);
  10609. delimiter: string;
  10610. context?: string;
  10611. /**
  10612. * Apply the plugin
  10613. */
  10614. apply(compiler: Compiler): void;
  10615. }
  10616. declare interface NamedChunkIdsPluginOptions {
  10617. /**
  10618. * context
  10619. */
  10620. context?: string;
  10621. /**
  10622. * delimiter
  10623. */
  10624. delimiter?: string;
  10625. }
  10626. declare class NamedModuleIdsPlugin {
  10627. constructor(options?: NamedModuleIdsPluginOptions);
  10628. options: NamedModuleIdsPluginOptions;
  10629. /**
  10630. * Apply the plugin
  10631. */
  10632. apply(compiler: Compiler): void;
  10633. }
  10634. declare interface NamedModuleIdsPluginOptions {
  10635. /**
  10636. * context
  10637. */
  10638. context?: string;
  10639. }
  10640. declare class NaturalModuleIdsPlugin {
  10641. constructor();
  10642. /**
  10643. * Apply the plugin
  10644. */
  10645. apply(compiler: Compiler): void;
  10646. }
  10647. declare interface NeedBuildContext {
  10648. compilation: Compilation;
  10649. fileSystemInfo: FileSystemInfo;
  10650. valueCacheVersions: Map<string, ValueCacheVersion>;
  10651. }
  10652. declare interface NewContentCreateContextMap {
  10653. [index: string]: string;
  10654. }
  10655. declare class NoEmitOnErrorsPlugin {
  10656. constructor();
  10657. /**
  10658. * Apply the plugin
  10659. */
  10660. apply(compiler: Compiler): void;
  10661. }
  10662. type NoParse =
  10663. | string
  10664. | RegExp
  10665. | (string | RegExp | ((content: string) => boolean))[]
  10666. | ((content: string) => boolean);
  10667. type Node = false | NodeOptions;
  10668. declare class NodeEnvironmentPlugin {
  10669. constructor(options: NodeEnvironmentPluginOptions);
  10670. options: NodeEnvironmentPluginOptions;
  10671. /**
  10672. * Apply the plugin
  10673. */
  10674. apply(compiler: Compiler): void;
  10675. }
  10676. declare interface NodeEnvironmentPluginOptions {
  10677. /**
  10678. * infrastructure logging options
  10679. */
  10680. infrastructureLogging: InfrastructureLogging;
  10681. }
  10682. /**
  10683. * Options object for node compatibility features.
  10684. */
  10685. declare interface NodeOptions {
  10686. /**
  10687. * Include a polyfill for the '__dirname' variable.
  10688. */
  10689. __dirname?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  10690. /**
  10691. * Include a polyfill for the '__filename' variable.
  10692. */
  10693. __filename?: boolean | "warn-mock" | "mock" | "node-module" | "eval-only";
  10694. /**
  10695. * Include a polyfill for the 'global' variable.
  10696. */
  10697. global?: boolean | "warn";
  10698. }
  10699. declare class NodeSourcePlugin {
  10700. constructor();
  10701. /**
  10702. * Apply the plugin
  10703. */
  10704. apply(compiler: Compiler): void;
  10705. }
  10706. declare class NodeTargetPlugin {
  10707. constructor(type?: ExternalsType);
  10708. type: ExternalsType;
  10709. /**
  10710. * Apply the plugin
  10711. */
  10712. apply(compiler: Compiler): void;
  10713. }
  10714. declare class NodeTemplatePlugin {
  10715. constructor(options?: NodeTemplatePluginOptions);
  10716. /**
  10717. * Apply the plugin
  10718. */
  10719. apply(compiler: Compiler): void;
  10720. }
  10721. declare interface NodeTemplatePluginOptions {
  10722. /**
  10723. * enable async chunk loading
  10724. */
  10725. asyncChunkLoading?: boolean;
  10726. }
  10727. type NonNullable<T> = T & {};
  10728. declare class NormalModule extends Module {
  10729. constructor(__0: NormalModuleCreateData);
  10730. request: string;
  10731. userRequest: string;
  10732. rawRequest: string;
  10733. binary: boolean;
  10734. parser?: ParserClass;
  10735. parserOptions?: ParserOptions;
  10736. generator?: Generator;
  10737. generatorOptions?: GeneratorOptions;
  10738. resource: string;
  10739. resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
  10740. matchResource?: string;
  10741. loaders: LoaderItem[];
  10742. extractSourceMap: boolean;
  10743. error: null | WebpackError;
  10744. getResource(): null | string;
  10745. /**
  10746. * restore unsafe cache data
  10747. */
  10748. restoreFromUnsafeCache(
  10749. unsafeCacheData: UnsafeCacheData,
  10750. normalModuleFactory: NormalModuleFactory
  10751. ): void;
  10752. createSourceForAsset(
  10753. context: string,
  10754. name: string,
  10755. content: string | Buffer,
  10756. sourceMap?: string | RawSourceMap,
  10757. associatedObjectForCache?: object
  10758. ): Source;
  10759. getCurrentLoader(
  10760. loaderContext: AnyLoaderContext,
  10761. index?: number
  10762. ): null | LoaderItem;
  10763. createSource(
  10764. context: string,
  10765. content: string | Buffer,
  10766. sourceMap?: null | string | RawSourceMap,
  10767. associatedObjectForCache?: object
  10768. ): Source;
  10769. markModuleAsErrored(error: WebpackError): void;
  10770. applyNoParseRule(rule: Exclude<NoParse, any[]>, content: string): boolean;
  10771. shouldPreventParsing(
  10772. noParseRule:
  10773. | undefined
  10774. | string
  10775. | RegExp
  10776. | (string | RegExp | ((content: string) => boolean))[]
  10777. | ((content: string) => boolean),
  10778. request: string
  10779. ): boolean;
  10780. static getCompilationHooks(
  10781. compilation: Compilation
  10782. ): NormalModuleCompilationHooks;
  10783. static deserialize(context: ObjectDeserializerContext): NormalModule;
  10784. }
  10785. declare interface NormalModuleCompilationHooks {
  10786. loader: SyncHook<[AnyLoaderContext, NormalModule]>;
  10787. beforeLoaders: SyncHook<[LoaderItem[], NormalModule, AnyLoaderContext]>;
  10788. beforeParse: SyncHook<[NormalModule]>;
  10789. beforeSnapshot: SyncHook<[NormalModule]>;
  10790. readResourceForScheme: HookMap<
  10791. FakeHook<
  10792. AsyncSeriesBailHook<[string, NormalModule], null | string | Buffer>
  10793. >
  10794. >;
  10795. readResource: HookMap<
  10796. AsyncSeriesBailHook<[AnyLoaderContext], null | string | Buffer>
  10797. >;
  10798. processResult: SyncWaterfallHook<
  10799. [
  10800. [
  10801. string | Buffer,
  10802. undefined | string | RawSourceMap,
  10803. undefined | PreparsedAst
  10804. ],
  10805. NormalModule
  10806. ],
  10807. [
  10808. string | Buffer,
  10809. undefined | string | RawSourceMap,
  10810. undefined | PreparsedAst
  10811. ]
  10812. >;
  10813. needBuild: AsyncSeriesBailHook<[NormalModule, NeedBuildContext], boolean>;
  10814. }
  10815. declare interface NormalModuleCreateData {
  10816. /**
  10817. * an optional layer in which the module is
  10818. */
  10819. layer?: string;
  10820. /**
  10821. * module type. When deserializing, this is set to an empty string "".
  10822. */
  10823. type: string;
  10824. /**
  10825. * request string
  10826. */
  10827. request: string;
  10828. /**
  10829. * request intended by user (without loaders from config)
  10830. */
  10831. userRequest: string;
  10832. /**
  10833. * request without resolving
  10834. */
  10835. rawRequest: string;
  10836. /**
  10837. * list of loaders
  10838. */
  10839. loaders: LoaderItem[];
  10840. /**
  10841. * path + query of the real resource
  10842. */
  10843. resource: string;
  10844. /**
  10845. * resource resolve data
  10846. */
  10847. resourceResolveData?: ResourceSchemeData & Partial<ResolveRequest>;
  10848. /**
  10849. * context directory for resolving
  10850. */
  10851. context: string;
  10852. /**
  10853. * path + query of the matched resource (virtual)
  10854. */
  10855. matchResource?: string;
  10856. /**
  10857. * the parser used
  10858. */
  10859. parser: ParserClass;
  10860. /**
  10861. * the options of the parser used
  10862. */
  10863. parserOptions?: ParserOptions;
  10864. /**
  10865. * the generator used
  10866. */
  10867. generator: Generator;
  10868. /**
  10869. * the options of the generator used
  10870. */
  10871. generatorOptions?: GeneratorOptions;
  10872. /**
  10873. * options used for resolving requests from this module
  10874. */
  10875. resolveOptions?: ResolveOptions;
  10876. /**
  10877. * enable/disable extracting source map
  10878. */
  10879. extractSourceMap: boolean;
  10880. }
  10881. declare abstract class NormalModuleFactory extends ModuleFactory {
  10882. hooks: Readonly<{
  10883. resolve: AsyncSeriesBailHook<[ResolveData], false | void | Module>;
  10884. resolveForScheme: HookMap<
  10885. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  10886. >;
  10887. resolveInScheme: HookMap<
  10888. AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>
  10889. >;
  10890. factorize: AsyncSeriesBailHook<[ResolveData], undefined | Module>;
  10891. beforeResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  10892. afterResolve: AsyncSeriesBailHook<[ResolveData], false | void>;
  10893. createModule: AsyncSeriesBailHook<
  10894. [
  10895. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  10896. ResolveData
  10897. ],
  10898. void | Module
  10899. >;
  10900. module: SyncWaterfallHook<
  10901. [
  10902. Module,
  10903. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  10904. ResolveData
  10905. ],
  10906. Module
  10907. >;
  10908. createParser: TypedHookMap<
  10909. Record<
  10910. "javascript/auto",
  10911. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  10912. > &
  10913. Record<
  10914. "javascript/dynamic",
  10915. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  10916. > &
  10917. Record<
  10918. "javascript/esm",
  10919. SyncBailHook<[JavascriptParserOptions], JavascriptParser>
  10920. > &
  10921. Record<"json", SyncBailHook<[JsonParserOptions], JsonParser>> &
  10922. Record<"asset", SyncBailHook<[AssetParserOptions], AssetParser>> &
  10923. Record<
  10924. "asset/inline",
  10925. SyncBailHook<[EmptyParserOptions], AssetParser>
  10926. > &
  10927. Record<
  10928. "asset/resource",
  10929. SyncBailHook<[EmptyParserOptions], AssetParser>
  10930. > &
  10931. Record<
  10932. "asset/source",
  10933. SyncBailHook<[EmptyParserOptions], AssetSourceParser>
  10934. > &
  10935. Record<
  10936. "asset/bytes",
  10937. SyncBailHook<[EmptyParserOptions], AssetBytesParser>
  10938. > &
  10939. Record<
  10940. "webassembly/async",
  10941. SyncBailHook<[EmptyParserOptions], AsyncWebAssemblyParser>
  10942. > &
  10943. Record<
  10944. "webassembly/sync",
  10945. SyncBailHook<[EmptyParserOptions], WebAssemblyParser>
  10946. > &
  10947. Record<"css", SyncBailHook<[CssParserOptions], CssParser>> &
  10948. Record<"css/auto", SyncBailHook<[CssModuleParserOptions], CssParser>> &
  10949. Record<
  10950. "css/module",
  10951. SyncBailHook<[CssModuleParserOptions], CssParser>
  10952. > &
  10953. Record<
  10954. "css/global",
  10955. SyncBailHook<[CssModuleParserOptions], CssParser>
  10956. > &
  10957. Record<string, SyncBailHook<[ParserOptions], ParserClass>>
  10958. >;
  10959. parser: TypedHookMap<
  10960. Record<
  10961. "javascript/auto",
  10962. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  10963. > &
  10964. Record<
  10965. "javascript/dynamic",
  10966. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  10967. > &
  10968. Record<
  10969. "javascript/esm",
  10970. SyncBailHook<[JavascriptParser, JavascriptParserOptions], void>
  10971. > &
  10972. Record<"json", SyncBailHook<[JsonParser, JsonParserOptions], void>> &
  10973. Record<"asset", SyncBailHook<[AssetParser, AssetParserOptions], void>> &
  10974. Record<
  10975. "asset/inline",
  10976. SyncBailHook<[AssetParser, EmptyParserOptions], void>
  10977. > &
  10978. Record<
  10979. "asset/resource",
  10980. SyncBailHook<[AssetParser, EmptyParserOptions], void>
  10981. > &
  10982. Record<
  10983. "asset/source",
  10984. SyncBailHook<[AssetSourceParser, EmptyParserOptions], void>
  10985. > &
  10986. Record<
  10987. "asset/bytes",
  10988. SyncBailHook<[AssetBytesParser, EmptyParserOptions], void>
  10989. > &
  10990. Record<
  10991. "webassembly/async",
  10992. SyncBailHook<[AsyncWebAssemblyParser, EmptyParserOptions], void>
  10993. > &
  10994. Record<
  10995. "webassembly/sync",
  10996. SyncBailHook<[WebAssemblyParser, EmptyParserOptions], void>
  10997. > &
  10998. Record<"css", SyncBailHook<[CssParser, CssParserOptions], void>> &
  10999. Record<
  11000. "css/auto",
  11001. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11002. > &
  11003. Record<
  11004. "css/module",
  11005. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11006. > &
  11007. Record<
  11008. "css/global",
  11009. SyncBailHook<[CssParser, CssModuleParserOptions], void>
  11010. > &
  11011. Record<string, SyncBailHook<[ParserClass, ParserOptions], void>>
  11012. >;
  11013. createGenerator: TypedHookMap<
  11014. Record<
  11015. "javascript/auto",
  11016. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11017. > &
  11018. Record<
  11019. "javascript/dynamic",
  11020. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11021. > &
  11022. Record<
  11023. "javascript/esm",
  11024. SyncBailHook<[EmptyGeneratorOptions], JavascriptGenerator>
  11025. > &
  11026. Record<"json", SyncBailHook<[JsonGeneratorOptions], JsonGenerator>> &
  11027. Record<"asset", SyncBailHook<[AssetGeneratorOptions], AssetGenerator>> &
  11028. Record<
  11029. "asset/inline",
  11030. SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
  11031. > &
  11032. Record<
  11033. "asset/resource",
  11034. SyncBailHook<[AssetGeneratorOptions], AssetGenerator>
  11035. > &
  11036. Record<
  11037. "asset/source",
  11038. SyncBailHook<[EmptyGeneratorOptions], AssetSourceGenerator>
  11039. > &
  11040. Record<
  11041. "asset/bytes",
  11042. SyncBailHook<[EmptyGeneratorOptions], AssetBytesGenerator>
  11043. > &
  11044. Record<
  11045. "webassembly/async",
  11046. SyncBailHook<[EmptyParserOptions], Generator>
  11047. > &
  11048. Record<
  11049. "webassembly/sync",
  11050. SyncBailHook<[EmptyParserOptions], Generator>
  11051. > &
  11052. Record<"css", SyncBailHook<[CssGeneratorOptions], CssGenerator>> &
  11053. Record<
  11054. "css/auto",
  11055. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11056. > &
  11057. Record<
  11058. "css/module",
  11059. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11060. > &
  11061. Record<
  11062. "css/global",
  11063. SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
  11064. > &
  11065. Record<string, SyncBailHook<[GeneratorOptions], Generator>>
  11066. >;
  11067. generator: TypedHookMap<
  11068. Record<
  11069. "javascript/auto",
  11070. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11071. > &
  11072. Record<
  11073. "javascript/dynamic",
  11074. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11075. > &
  11076. Record<
  11077. "javascript/esm",
  11078. SyncBailHook<[JavascriptGenerator, EmptyGeneratorOptions], void>
  11079. > &
  11080. Record<
  11081. "json",
  11082. SyncBailHook<[JsonGenerator, JsonGeneratorOptions], void>
  11083. > &
  11084. Record<
  11085. "asset",
  11086. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11087. > &
  11088. Record<
  11089. "asset/inline",
  11090. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11091. > &
  11092. Record<
  11093. "asset/resource",
  11094. SyncBailHook<[AssetGenerator, AssetGeneratorOptions], void>
  11095. > &
  11096. Record<
  11097. "asset/source",
  11098. SyncBailHook<[AssetSourceGenerator, EmptyGeneratorOptions], void>
  11099. > &
  11100. Record<
  11101. "asset/bytes",
  11102. SyncBailHook<[AssetBytesGenerator, EmptyGeneratorOptions], void>
  11103. > &
  11104. Record<
  11105. "webassembly/async",
  11106. SyncBailHook<[Generator, EmptyParserOptions], void>
  11107. > &
  11108. Record<
  11109. "webassembly/sync",
  11110. SyncBailHook<[Generator, EmptyParserOptions], void>
  11111. > &
  11112. Record<"css", SyncBailHook<[CssGenerator, CssGeneratorOptions], void>> &
  11113. Record<
  11114. "css/auto",
  11115. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11116. > &
  11117. Record<
  11118. "css/module",
  11119. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11120. > &
  11121. Record<
  11122. "css/global",
  11123. SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
  11124. > &
  11125. Record<string, SyncBailHook<[Generator, GeneratorOptions], void>>
  11126. >;
  11127. createModuleClass: HookMap<
  11128. SyncBailHook<
  11129. [
  11130. Partial<NormalModuleCreateData & { settings: ModuleSettings }>,
  11131. ResolveData
  11132. ],
  11133. void | Module
  11134. >
  11135. >;
  11136. }>;
  11137. resolverFactory: ResolverFactory;
  11138. ruleSet: RuleSet;
  11139. context: string;
  11140. fs: InputFileSystem;
  11141. parserCache: Map<string, WeakMap<ParserOptions, ParserClass>>;
  11142. generatorCache: Map<string, WeakMap<GeneratorOptions, Generator>>;
  11143. cleanupForCache(): void;
  11144. resolveResource(
  11145. contextInfo: ModuleFactoryCreateDataContextInfo,
  11146. context: string,
  11147. unresolvedResource: string,
  11148. resolver: ResolverWithOptions,
  11149. resolveContext: ResolveContext,
  11150. callback: (
  11151. err: null | Error,
  11152. res?: string | false,
  11153. req?: ResolveRequest
  11154. ) => void
  11155. ): void;
  11156. resolveRequestArray(
  11157. contextInfo: ModuleFactoryCreateDataContextInfo,
  11158. context: string,
  11159. array: LoaderItem[],
  11160. resolver: ResolverWithOptions,
  11161. resolveContext: ResolveContext,
  11162. callback: CallbackWebpackFunction_1<LoaderItem[]>
  11163. ): void;
  11164. getParser(type: string, parserOptions?: ParserOptions): ParserClass;
  11165. createParser(type: string, parserOptions?: ParserOptions): ParserClass;
  11166. getGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  11167. createGenerator(type: string, generatorOptions?: GeneratorOptions): Generator;
  11168. getResolver(
  11169. type: string,
  11170. resolveOptions?: ResolveOptionsWithDependencyType
  11171. ): ResolverWithOptions;
  11172. }
  11173. /**
  11174. * These properties are added by the NormalModule
  11175. */
  11176. declare interface NormalModuleLoaderContext<OptionsType> {
  11177. version: number;
  11178. getOptions(): OptionsType;
  11179. getOptions(schema: Parameters<typeof validateFunction>[0]): OptionsType;
  11180. emitWarning(warning: Error): void;
  11181. emitError(error: Error): void;
  11182. getLogger(name?: string): WebpackLogger;
  11183. resolve(
  11184. context: string,
  11185. request: string,
  11186. callback: (
  11187. err: null | ErrorWithDetail,
  11188. res?: string | false,
  11189. req?: ResolveRequest
  11190. ) => void
  11191. ): void;
  11192. getResolve(options?: ResolveOptionsWithDependencyType): {
  11193. (
  11194. context: string,
  11195. request: string,
  11196. callback: (
  11197. err: null | ErrorWithDetail,
  11198. res?: string | false,
  11199. req?: ResolveRequest
  11200. ) => void
  11201. ): void;
  11202. (context: string, request: string): Promise<string>;
  11203. };
  11204. emitFile(
  11205. name: string,
  11206. content: string | Buffer,
  11207. sourceMap?: string,
  11208. assetInfo?: AssetInfo
  11209. ): void;
  11210. addBuildDependency(dep: string): void;
  11211. utils: {
  11212. absolutify: (context: string, request: string) => string;
  11213. contextify: (context: string, request: string) => string;
  11214. createHash: (algorithm?: string | typeof Hash) => Hash;
  11215. };
  11216. rootContext: string;
  11217. fs: InputFileSystem;
  11218. sourceMap?: boolean;
  11219. mode: "none" | "development" | "production";
  11220. webpack?: boolean;
  11221. hashFunction: HashFunction;
  11222. hashDigest: string;
  11223. hashDigestLength: number;
  11224. hashSalt?: string;
  11225. _module?: NormalModule;
  11226. _compilation?: Compilation;
  11227. _compiler?: Compiler;
  11228. }
  11229. declare class NormalModuleReplacementPlugin {
  11230. /**
  11231. * Create an instance of the plugin
  11232. */
  11233. constructor(
  11234. resourceRegExp: RegExp,
  11235. newResource: string | ((resolveData: ResolveData) => void)
  11236. );
  11237. resourceRegExp: RegExp;
  11238. newResource: string | ((resolveData: ResolveData) => void);
  11239. /**
  11240. * Apply the plugin
  11241. */
  11242. apply(compiler: Compiler): void;
  11243. }
  11244. declare abstract class NormalReexportItem {
  11245. name: string;
  11246. ids: string[];
  11247. exportInfo: ExportInfo;
  11248. checked: boolean;
  11249. hidden: boolean;
  11250. }
  11251. type NormalizedStatsOptions = KnownNormalizedStatsOptions &
  11252. Omit<
  11253. StatsOptions,
  11254. | "assetsSort"
  11255. | "assetsSpace"
  11256. | "cachedAssets"
  11257. | "cachedModules"
  11258. | "chunkGroupAuxiliary"
  11259. | "chunkGroupChildren"
  11260. | "chunkGroupMaxAssets"
  11261. | "chunkGroups"
  11262. | "chunkModulesSpace"
  11263. | "chunksSort"
  11264. | "context"
  11265. | "dependentModules"
  11266. | "entrypoints"
  11267. | "excludeAssets"
  11268. | "excludeModules"
  11269. | "groupAssetsByEmitStatus"
  11270. | "groupAssetsByExtension"
  11271. | "groupAssetsByPath"
  11272. | "groupModulesByAttributes"
  11273. | "groupModulesByCacheStatus"
  11274. | "groupModulesByExtension"
  11275. | "groupModulesByLayer"
  11276. | "groupModulesByPath"
  11277. | "groupModulesByType"
  11278. | "ids"
  11279. | "logging"
  11280. | "loggingDebug"
  11281. | "loggingTrace"
  11282. | "modulesSort"
  11283. | "modulesSpace"
  11284. | "nestedModulesSpace"
  11285. | "orphanModules"
  11286. | "runtimeModules"
  11287. | "warningsFilter"
  11288. | "requestShortener"
  11289. | "chunkModulesSort"
  11290. | "nestedModulesSort"
  11291. | "_env"
  11292. > &
  11293. Record<string, any>;
  11294. declare class NullDependency extends Dependency {
  11295. constructor();
  11296. static Template: typeof NullDependencyTemplate;
  11297. static NO_EXPORTS_REFERENCED: string[][];
  11298. static EXPORTS_OBJECT_REFERENCED: string[][];
  11299. static isLowPriorityDependency(dependency: Dependency): boolean;
  11300. static TRANSITIVE: typeof TRANSITIVE;
  11301. }
  11302. declare class NullDependencyTemplate extends DependencyTemplate {
  11303. constructor();
  11304. }
  11305. declare interface ObjectConfiguration {
  11306. [index: string]: any;
  11307. }
  11308. declare interface ObjectDeserializerContext {
  11309. read: () => any;
  11310. setCircularReference: (value: ReferenceableItem) => void;
  11311. }
  11312. declare interface ObjectEncodingOptions {
  11313. encoding?:
  11314. | null
  11315. | "ascii"
  11316. | "utf8"
  11317. | "utf-8"
  11318. | "utf16le"
  11319. | "utf-16le"
  11320. | "ucs2"
  11321. | "ucs-2"
  11322. | "base64"
  11323. | "base64url"
  11324. | "latin1"
  11325. | "binary"
  11326. | "hex";
  11327. }
  11328. declare interface ObjectSerializer {
  11329. serialize: (value: any, context: ObjectSerializerContext) => void;
  11330. deserialize: (context: ObjectDeserializerContext) => any;
  11331. }
  11332. declare interface ObjectSerializerContext {
  11333. write: (value?: any) => void;
  11334. setCircularReference: (value: ReferenceableItem) => void;
  11335. snapshot: () => ObjectSerializerSnapshot;
  11336. rollback: (snapshot: ObjectSerializerSnapshot) => void;
  11337. writeLazy?: (item?: any) => void;
  11338. writeSeparate?: (
  11339. item: any,
  11340. obj?: LazyOptions
  11341. ) => LazyFunction<any, any, any, LazyOptions>;
  11342. }
  11343. declare interface ObjectSerializerSnapshot {
  11344. length: number;
  11345. cycleStackSize: number;
  11346. referenceableSize: number;
  11347. currentPos: number;
  11348. objectTypeLookupSize: number;
  11349. currentPosTypeLookup: number;
  11350. }
  11351. declare class OccurrenceChunkIdsPlugin {
  11352. constructor(options?: OccurrenceChunkIdsPluginOptions);
  11353. options: OccurrenceChunkIdsPluginOptions;
  11354. /**
  11355. * Apply the plugin
  11356. */
  11357. apply(compiler: Compiler): void;
  11358. }
  11359. declare interface OccurrenceChunkIdsPluginOptions {
  11360. /**
  11361. * Prioritise initial size over total size.
  11362. */
  11363. prioritiseInitial?: boolean;
  11364. }
  11365. declare class OccurrenceModuleIdsPlugin {
  11366. constructor(options?: OccurrenceModuleIdsPluginOptions);
  11367. options: OccurrenceModuleIdsPluginOptions;
  11368. /**
  11369. * Apply the plugin
  11370. */
  11371. apply(compiler: Compiler): void;
  11372. }
  11373. declare interface OccurrenceModuleIdsPluginOptions {
  11374. /**
  11375. * Prioritise initial size over total size.
  11376. */
  11377. prioritiseInitial?: boolean;
  11378. }
  11379. declare interface Open {
  11380. (
  11381. file: PathLikeFs,
  11382. flags: undefined | string | number,
  11383. mode: undefined | null | string | number,
  11384. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11385. ): void;
  11386. (
  11387. file: PathLikeFs,
  11388. flags: undefined | string | number,
  11389. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11390. ): void;
  11391. (
  11392. file: PathLikeFs,
  11393. callback: (err: null | NodeJS.ErrnoException, result?: number) => void
  11394. ): void;
  11395. }
  11396. /**
  11397. * Enables/Disables integrated optimizations.
  11398. */
  11399. declare interface Optimization {
  11400. /**
  11401. * Avoid wrapping the entry module in an IIFE.
  11402. */
  11403. avoidEntryIife?: boolean;
  11404. /**
  11405. * Check for incompatible wasm types when importing/exporting from/to ESM.
  11406. */
  11407. checkWasmTypes?: boolean;
  11408. /**
  11409. * 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).
  11410. */
  11411. chunkIds?:
  11412. | false
  11413. | "natural"
  11414. | "named"
  11415. | "deterministic"
  11416. | "size"
  11417. | "total-size";
  11418. /**
  11419. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  11420. */
  11421. concatenateModules?: boolean;
  11422. /**
  11423. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  11424. */
  11425. emitOnErrors?: boolean;
  11426. /**
  11427. * Also flag chunks as loaded which contain a subset of the modules.
  11428. */
  11429. flagIncludedChunks?: boolean;
  11430. /**
  11431. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  11432. */
  11433. innerGraph?: boolean;
  11434. /**
  11435. * 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).
  11436. */
  11437. mangleExports?: boolean | "deterministic" | "size";
  11438. /**
  11439. * Reduce size of WASM by changing imports to shorter strings.
  11440. */
  11441. mangleWasmImports?: boolean;
  11442. /**
  11443. * Merge chunks which contain the same modules.
  11444. */
  11445. mergeDuplicateChunks?: boolean;
  11446. /**
  11447. * Enable minimizing the output. Uses optimization.minimizer.
  11448. */
  11449. minimize?: boolean;
  11450. /**
  11451. * Minimizer(s) to use for minimizing the output.
  11452. */
  11453. minimizer?: (
  11454. | undefined
  11455. | null
  11456. | false
  11457. | ""
  11458. | 0
  11459. | ((this: Compiler, compiler: Compiler) => void)
  11460. | WebpackPluginInstance
  11461. | "..."
  11462. )[];
  11463. /**
  11464. * 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).
  11465. */
  11466. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  11467. /**
  11468. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  11469. */
  11470. noEmitOnErrors?: boolean;
  11471. /**
  11472. * Set process.env.NODE_ENV to a specific value.
  11473. */
  11474. nodeEnv?: string | false;
  11475. /**
  11476. * Generate records with relative paths to be able to move the context folder.
  11477. */
  11478. portableRecords?: boolean;
  11479. /**
  11480. * Figure out which exports are provided by modules to generate more efficient code.
  11481. */
  11482. providedExports?: boolean;
  11483. /**
  11484. * Use real [contenthash] based on final content of the assets.
  11485. */
  11486. realContentHash?: boolean;
  11487. /**
  11488. * Removes modules from chunks when these modules are already included in all parents.
  11489. */
  11490. removeAvailableModules?: boolean;
  11491. /**
  11492. * Remove chunks which are empty.
  11493. */
  11494. removeEmptyChunks?: boolean;
  11495. /**
  11496. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  11497. */
  11498. runtimeChunk?:
  11499. | boolean
  11500. | "single"
  11501. | "multiple"
  11502. | {
  11503. /**
  11504. * The name or name factory for the runtime chunks.
  11505. */
  11506. name?: string | ((entrypoint: { name: string }) => string);
  11507. };
  11508. /**
  11509. * 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).
  11510. */
  11511. sideEffects?: boolean | "flag";
  11512. /**
  11513. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  11514. */
  11515. splitChunks?: false | OptimizationSplitChunksOptions;
  11516. /**
  11517. * 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).
  11518. */
  11519. usedExports?: boolean | "global";
  11520. }
  11521. /**
  11522. * Enables/Disables integrated optimizations.
  11523. */
  11524. declare interface OptimizationNormalized {
  11525. /**
  11526. * Avoid wrapping the entry module in an IIFE.
  11527. */
  11528. avoidEntryIife?: boolean;
  11529. /**
  11530. * Check for incompatible wasm types when importing/exporting from/to ESM.
  11531. */
  11532. checkWasmTypes?: boolean;
  11533. /**
  11534. * 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).
  11535. */
  11536. chunkIds?:
  11537. | false
  11538. | "natural"
  11539. | "named"
  11540. | "deterministic"
  11541. | "size"
  11542. | "total-size";
  11543. /**
  11544. * Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.
  11545. */
  11546. concatenateModules?: boolean;
  11547. /**
  11548. * Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.
  11549. */
  11550. emitOnErrors?: boolean;
  11551. /**
  11552. * Also flag chunks as loaded which contain a subset of the modules.
  11553. */
  11554. flagIncludedChunks?: boolean;
  11555. /**
  11556. * Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.
  11557. */
  11558. innerGraph?: boolean;
  11559. /**
  11560. * 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).
  11561. */
  11562. mangleExports?: boolean | "deterministic" | "size";
  11563. /**
  11564. * Reduce size of WASM by changing imports to shorter strings.
  11565. */
  11566. mangleWasmImports?: boolean;
  11567. /**
  11568. * Merge chunks which contain the same modules.
  11569. */
  11570. mergeDuplicateChunks?: boolean;
  11571. /**
  11572. * Enable minimizing the output. Uses optimization.minimizer.
  11573. */
  11574. minimize?: boolean;
  11575. /**
  11576. * Minimizer(s) to use for minimizing the output.
  11577. */
  11578. minimizer?: (
  11579. | ((this: Compiler, compiler: Compiler) => void)
  11580. | WebpackPluginInstance
  11581. | "..."
  11582. )[];
  11583. /**
  11584. * 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).
  11585. */
  11586. moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "hashed";
  11587. /**
  11588. * Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).
  11589. */
  11590. noEmitOnErrors?: boolean;
  11591. /**
  11592. * Set process.env.NODE_ENV to a specific value.
  11593. */
  11594. nodeEnv?: string | false;
  11595. /**
  11596. * Generate records with relative paths to be able to move the context folder.
  11597. */
  11598. portableRecords?: boolean;
  11599. /**
  11600. * Figure out which exports are provided by modules to generate more efficient code.
  11601. */
  11602. providedExports?: boolean;
  11603. /**
  11604. * Use real [contenthash] based on final content of the assets.
  11605. */
  11606. realContentHash?: boolean;
  11607. /**
  11608. * Removes modules from chunks when these modules are already included in all parents.
  11609. */
  11610. removeAvailableModules?: boolean;
  11611. /**
  11612. * Remove chunks which are empty.
  11613. */
  11614. removeEmptyChunks?: boolean;
  11615. /**
  11616. * Create an additional chunk which contains only the webpack runtime and chunk hash maps.
  11617. */
  11618. runtimeChunk?:
  11619. | false
  11620. | {
  11621. /**
  11622. * The name factory for the runtime chunks.
  11623. */
  11624. name?: (entrypoint: { name: string }) => string;
  11625. };
  11626. /**
  11627. * 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).
  11628. */
  11629. sideEffects?: boolean | "flag";
  11630. /**
  11631. * Optimize duplication and caching by splitting chunks by shared modules and cache group.
  11632. */
  11633. splitChunks?: false | OptimizationSplitChunksOptions;
  11634. /**
  11635. * 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).
  11636. */
  11637. usedExports?: boolean | "global";
  11638. }
  11639. type OptimizationNormalizedWithDefaults = OptimizationNormalized & {
  11640. runtimeChunk: NonNullable<
  11641. | undefined
  11642. | false
  11643. | {
  11644. /**
  11645. * The name factory for the runtime chunks.
  11646. */
  11647. name?: (entrypoint: { name: string }) => string;
  11648. }
  11649. >;
  11650. splitChunks: NonNullable<undefined | false | OptimizationSplitChunksOptions>;
  11651. mergeDuplicateChunks: NonNullable<undefined | boolean>;
  11652. removeAvailableModules: NonNullable<undefined | boolean>;
  11653. removeEmptyChunks: NonNullable<undefined | boolean>;
  11654. flagIncludedChunks: NonNullable<undefined | boolean>;
  11655. moduleIds: NonNullable<
  11656. | undefined
  11657. | false
  11658. | "natural"
  11659. | "named"
  11660. | "deterministic"
  11661. | "size"
  11662. | "hashed"
  11663. >;
  11664. chunkIds: NonNullable<
  11665. | undefined
  11666. | false
  11667. | "natural"
  11668. | "named"
  11669. | "deterministic"
  11670. | "size"
  11671. | "total-size"
  11672. >;
  11673. sideEffects: NonNullable<undefined | boolean | "flag">;
  11674. providedExports: NonNullable<undefined | boolean>;
  11675. usedExports: NonNullable<undefined | boolean | "global">;
  11676. mangleExports: NonNullable<undefined | boolean | "deterministic" | "size">;
  11677. innerGraph: NonNullable<undefined | boolean>;
  11678. concatenateModules: NonNullable<undefined | boolean>;
  11679. avoidEntryIife: NonNullable<undefined | boolean>;
  11680. emitOnErrors: NonNullable<undefined | boolean>;
  11681. checkWasmTypes: NonNullable<undefined | boolean>;
  11682. mangleWasmImports: NonNullable<undefined | boolean>;
  11683. portableRecords: NonNullable<undefined | boolean>;
  11684. realContentHash: NonNullable<undefined | boolean>;
  11685. minimize: NonNullable<undefined | boolean>;
  11686. minimizer: (
  11687. | ((this: Compiler, compiler: Compiler) => void)
  11688. | WebpackPluginInstance
  11689. | "..."
  11690. )[];
  11691. nodeEnv: NonNullable<undefined | string | false>;
  11692. };
  11693. /**
  11694. * Options object for describing behavior of a cache group selecting modules that should be cached together.
  11695. */
  11696. declare interface OptimizationSplitChunksCacheGroup {
  11697. /**
  11698. * Sets the name delimiter for created chunks.
  11699. */
  11700. automaticNameDelimiter?: string;
  11701. /**
  11702. * Select chunks for determining cache group content (defaults to "initial", "initial" and "all" requires adding these chunks to the HTML).
  11703. */
  11704. chunks?:
  11705. | RegExp
  11706. | "all"
  11707. | "initial"
  11708. | "async"
  11709. | ((chunk: Chunk) => undefined | boolean);
  11710. /**
  11711. * Ignore minimum size, minimum chunks and maximum requests and always create chunks for this cache group.
  11712. */
  11713. enforce?: boolean;
  11714. /**
  11715. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  11716. */
  11717. enforceSizeThreshold?: number | { [index: string]: number };
  11718. /**
  11719. * Sets the template for the filename for created chunks.
  11720. */
  11721. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  11722. /**
  11723. * Sets the hint for chunk id.
  11724. */
  11725. idHint?: string;
  11726. /**
  11727. * Assign modules to a cache group by module layer.
  11728. */
  11729. layer?: string | RegExp | ((layer: null | string) => boolean);
  11730. /**
  11731. * Maximum number of requests which are accepted for on-demand loading.
  11732. */
  11733. maxAsyncRequests?: number;
  11734. /**
  11735. * Maximal size hint for the on-demand chunks.
  11736. */
  11737. maxAsyncSize?: number | { [index: string]: number };
  11738. /**
  11739. * Maximum number of initial chunks which are accepted for an entry point.
  11740. */
  11741. maxInitialRequests?: number;
  11742. /**
  11743. * Maximal size hint for the initial chunks.
  11744. */
  11745. maxInitialSize?: number | { [index: string]: number };
  11746. /**
  11747. * Maximal size hint for the created chunks.
  11748. */
  11749. maxSize?: number | { [index: string]: number };
  11750. /**
  11751. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  11752. */
  11753. minChunks?: number;
  11754. /**
  11755. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  11756. */
  11757. minRemainingSize?: number | { [index: string]: number };
  11758. /**
  11759. * Minimal size for the created chunk.
  11760. */
  11761. minSize?: number | { [index: string]: number };
  11762. /**
  11763. * Minimum size reduction due to the created chunk.
  11764. */
  11765. minSizeReduction?: number | { [index: string]: number };
  11766. /**
  11767. * Give chunks for this cache group a name (chunks with equal name are merged).
  11768. */
  11769. name?:
  11770. | string
  11771. | false
  11772. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  11773. /**
  11774. * Priority of this cache group.
  11775. */
  11776. priority?: number;
  11777. /**
  11778. * Try to reuse existing chunk (with name) when it has matching modules.
  11779. */
  11780. reuseExistingChunk?: boolean;
  11781. /**
  11782. * Assign modules to a cache group by module name.
  11783. */
  11784. test?:
  11785. | string
  11786. | RegExp
  11787. | ((module: Module, context: CacheGroupsContext) => boolean);
  11788. /**
  11789. * Assign modules to a cache group by module type.
  11790. */
  11791. type?: string | RegExp | ((type: string) => boolean);
  11792. /**
  11793. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  11794. */
  11795. usedExports?: boolean;
  11796. }
  11797. /**
  11798. * Options object for splitting chunks into smaller chunks.
  11799. */
  11800. declare interface OptimizationSplitChunksOptions {
  11801. /**
  11802. * Sets the name delimiter for created chunks.
  11803. */
  11804. automaticNameDelimiter?: string;
  11805. /**
  11806. * Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
  11807. */
  11808. cacheGroups?: {
  11809. [index: string]:
  11810. | string
  11811. | false
  11812. | RegExp
  11813. | ((
  11814. module: Module
  11815. ) =>
  11816. | void
  11817. | OptimizationSplitChunksCacheGroup
  11818. | OptimizationSplitChunksCacheGroup[])
  11819. | OptimizationSplitChunksCacheGroup;
  11820. };
  11821. /**
  11822. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  11823. */
  11824. chunks?:
  11825. | RegExp
  11826. | "all"
  11827. | "initial"
  11828. | "async"
  11829. | ((chunk: Chunk) => undefined | boolean);
  11830. /**
  11831. * Sets the size types which are used when a number is used for sizes.
  11832. */
  11833. defaultSizeTypes?: string[];
  11834. /**
  11835. * Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
  11836. */
  11837. enforceSizeThreshold?: number | { [index: string]: number };
  11838. /**
  11839. * Options for modules not selected by any other cache group.
  11840. */
  11841. fallbackCacheGroup?: {
  11842. /**
  11843. * Sets the name delimiter for created chunks.
  11844. */
  11845. automaticNameDelimiter?: string;
  11846. /**
  11847. * Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
  11848. */
  11849. chunks?:
  11850. | RegExp
  11851. | "all"
  11852. | "initial"
  11853. | "async"
  11854. | ((chunk: Chunk) => undefined | boolean);
  11855. /**
  11856. * Maximal size hint for the on-demand chunks.
  11857. */
  11858. maxAsyncSize?: number | { [index: string]: number };
  11859. /**
  11860. * Maximal size hint for the initial chunks.
  11861. */
  11862. maxInitialSize?: number | { [index: string]: number };
  11863. /**
  11864. * Maximal size hint for the created chunks.
  11865. */
  11866. maxSize?: number | { [index: string]: number };
  11867. /**
  11868. * Minimal size for the created chunk.
  11869. */
  11870. minSize?: number | { [index: string]: number };
  11871. /**
  11872. * Minimum size reduction due to the created chunk.
  11873. */
  11874. minSizeReduction?: number | { [index: string]: number };
  11875. };
  11876. /**
  11877. * Sets the template for the filename for created chunks.
  11878. */
  11879. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  11880. /**
  11881. * Prevents exposing path info when creating names for parts splitted by maxSize.
  11882. */
  11883. hidePathInfo?: boolean;
  11884. /**
  11885. * Maximum number of requests which are accepted for on-demand loading.
  11886. */
  11887. maxAsyncRequests?: number;
  11888. /**
  11889. * Maximal size hint for the on-demand chunks.
  11890. */
  11891. maxAsyncSize?: number | { [index: string]: number };
  11892. /**
  11893. * Maximum number of initial chunks which are accepted for an entry point.
  11894. */
  11895. maxInitialRequests?: number;
  11896. /**
  11897. * Maximal size hint for the initial chunks.
  11898. */
  11899. maxInitialSize?: number | { [index: string]: number };
  11900. /**
  11901. * Maximal size hint for the created chunks.
  11902. */
  11903. maxSize?: number | { [index: string]: number };
  11904. /**
  11905. * Minimum number of times a module has to be duplicated until it's considered for splitting.
  11906. */
  11907. minChunks?: number;
  11908. /**
  11909. * Minimal size for the chunks the stay after moving the modules to a new chunk.
  11910. */
  11911. minRemainingSize?: number | { [index: string]: number };
  11912. /**
  11913. * Minimal size for the created chunks.
  11914. */
  11915. minSize?: number | { [index: string]: number };
  11916. /**
  11917. * Minimum size reduction due to the created chunk.
  11918. */
  11919. minSizeReduction?: number | { [index: string]: number };
  11920. /**
  11921. * Give chunks created a name (chunks with equal name are merged).
  11922. */
  11923. name?:
  11924. | string
  11925. | false
  11926. | ((module: Module, chunks: Chunk[], key: string) => undefined | string);
  11927. /**
  11928. * Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
  11929. */
  11930. usedExports?: boolean;
  11931. }
  11932. declare interface Options {
  11933. /**
  11934. * source
  11935. */
  11936. source: string;
  11937. /**
  11938. * absolute context path to which lib ident is relative to
  11939. */
  11940. context: string;
  11941. /**
  11942. * content
  11943. */
  11944. content: DllReferencePluginOptionsContent;
  11945. /**
  11946. * type
  11947. */
  11948. type?: "object" | "require";
  11949. /**
  11950. * extensions
  11951. */
  11952. extensions?: string[];
  11953. /**
  11954. * scope
  11955. */
  11956. scope?: string;
  11957. /**
  11958. * object for caching
  11959. */
  11960. associatedObjectForCache?: object;
  11961. }
  11962. declare abstract class OptionsApply {
  11963. process(
  11964. options: WebpackOptionsNormalizedWithDefaults,
  11965. compiler: Compiler
  11966. ): WebpackOptionsNormalizedWithDefaults;
  11967. }
  11968. declare interface OriginRecord {
  11969. module: null | Module;
  11970. loc: DependencyLocation;
  11971. request: string;
  11972. }
  11973. declare class OriginalSource extends Source {
  11974. constructor(value: string | Buffer, name: string);
  11975. getName(): string;
  11976. streamChunks(
  11977. options: StreamChunksOptions,
  11978. onChunk: (
  11979. chunk: undefined | string,
  11980. generatedLine: number,
  11981. generatedColumn: number,
  11982. sourceIndex: number,
  11983. originalLine: number,
  11984. originalColumn: number,
  11985. nameIndex: number
  11986. ) => void,
  11987. onSource: (
  11988. sourceIndex: number,
  11989. source: null | string,
  11990. sourceContent?: string
  11991. ) => void,
  11992. _onName: (nameIndex: number, name: string) => void
  11993. ): GeneratedSourceInfo;
  11994. }
  11995. /**
  11996. * Options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  11997. */
  11998. declare interface Output {
  11999. /**
  12000. * Add a container for define/require functions in the AMD module.
  12001. */
  12002. amdContainer?: string;
  12003. /**
  12004. * The filename of asset modules as relative path inside the 'output.path' directory.
  12005. */
  12006. assetModuleFilename?:
  12007. | string
  12008. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12009. /**
  12010. * Enable/disable creating async chunks that are loaded on demand.
  12011. */
  12012. asyncChunks?: boolean;
  12013. /**
  12014. * Add a comment in the UMD wrapper.
  12015. */
  12016. auxiliaryComment?: string | LibraryCustomUmdCommentObject;
  12017. /**
  12018. * Add charset attribute for script tag.
  12019. */
  12020. charset?: boolean;
  12021. /**
  12022. * 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.
  12023. */
  12024. chunkFilename?:
  12025. | string
  12026. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12027. /**
  12028. * 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).
  12029. */
  12030. chunkFormat?: string | false;
  12031. /**
  12032. * Number of milliseconds before chunk request expires.
  12033. */
  12034. chunkLoadTimeout?: number;
  12035. /**
  12036. * 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).
  12037. */
  12038. chunkLoading?: string | false;
  12039. /**
  12040. * The global variable used by webpack for loading of chunks.
  12041. */
  12042. chunkLoadingGlobal?: string;
  12043. /**
  12044. * Clean the output directory before emit.
  12045. */
  12046. clean?: boolean | CleanOptions;
  12047. /**
  12048. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  12049. */
  12050. compareBeforeEmit?: boolean;
  12051. /**
  12052. * This option enables cross-origin loading of chunks.
  12053. */
  12054. crossOriginLoading?: false | "anonymous" | "use-credentials";
  12055. /**
  12056. * 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.
  12057. */
  12058. cssChunkFilename?:
  12059. | string
  12060. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12061. /**
  12062. * 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.
  12063. */
  12064. cssFilename?:
  12065. | string
  12066. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12067. /**
  12068. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  12069. */
  12070. devtoolFallbackModuleFilenameTemplate?:
  12071. | string
  12072. | ((context: ModuleFilenameTemplateContext) => string);
  12073. /**
  12074. * Filename template string of function for the sources array in a generated SourceMap.
  12075. */
  12076. devtoolModuleFilenameTemplate?:
  12077. | string
  12078. | ((context: ModuleFilenameTemplateContext) => string);
  12079. /**
  12080. * 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.
  12081. */
  12082. devtoolNamespace?: string;
  12083. /**
  12084. * List of chunk loading types enabled for use by entry points.
  12085. */
  12086. enabledChunkLoadingTypes?: string[];
  12087. /**
  12088. * List of library types enabled for use by entry points.
  12089. */
  12090. enabledLibraryTypes?: string[];
  12091. /**
  12092. * List of wasm loading types enabled for use by entry points.
  12093. */
  12094. enabledWasmLoadingTypes?: string[];
  12095. /**
  12096. * The abilities of the environment where the webpack generated code should run.
  12097. */
  12098. environment?: Environment;
  12099. /**
  12100. * 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.
  12101. */
  12102. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12103. /**
  12104. * An expression which is used to address the global object/scope in runtime code.
  12105. */
  12106. globalObject?: string;
  12107. /**
  12108. * Digest types used for the hash.
  12109. */
  12110. hashDigest?: string;
  12111. /**
  12112. * Number of chars which are used for the hash.
  12113. */
  12114. hashDigestLength?: number;
  12115. /**
  12116. * Algorithm used for generation the hash (see node.js crypto package).
  12117. */
  12118. hashFunction?: string | typeof Hash;
  12119. /**
  12120. * Any string which is added to the hash to salt it.
  12121. */
  12122. hashSalt?: string;
  12123. /**
  12124. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  12125. */
  12126. hotUpdateChunkFilename?: string;
  12127. /**
  12128. * The global variable used by webpack for loading of hot update chunks.
  12129. */
  12130. hotUpdateGlobal?: string;
  12131. /**
  12132. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  12133. */
  12134. hotUpdateMainFilename?: string;
  12135. /**
  12136. * Ignore warnings in the browser.
  12137. */
  12138. ignoreBrowserWarnings?: boolean;
  12139. /**
  12140. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  12141. */
  12142. iife?: boolean;
  12143. /**
  12144. * The name of the native import() function (can be exchanged for a polyfill).
  12145. */
  12146. importFunctionName?: string;
  12147. /**
  12148. * The name of the native import.meta object (can be exchanged for a polyfill).
  12149. */
  12150. importMetaName?: string;
  12151. /**
  12152. * Make the output files a library, exporting the exports of the entry point.
  12153. */
  12154. library?: string | string[] | LibraryOptions | LibraryCustomUmdObject;
  12155. /**
  12156. * Specify which export should be exposed as library.
  12157. */
  12158. libraryExport?: string | string[];
  12159. /**
  12160. * 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).
  12161. */
  12162. libraryTarget?: string;
  12163. /**
  12164. * Output javascript files as module source type.
  12165. */
  12166. module?: boolean;
  12167. /**
  12168. * The output directory as **absolute path** (required).
  12169. */
  12170. path?: string;
  12171. /**
  12172. * Include comments with information about the modules.
  12173. */
  12174. pathinfo?: boolean | "verbose";
  12175. /**
  12176. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  12177. */
  12178. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12179. /**
  12180. * This option enables loading async chunks via a custom script type, such as script type="module".
  12181. */
  12182. scriptType?: false | "module" | "text/javascript";
  12183. /**
  12184. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  12185. */
  12186. sourceMapFilename?: string;
  12187. /**
  12188. * Prefixes every line of the source in the bundle with this string.
  12189. */
  12190. sourcePrefix?: string;
  12191. /**
  12192. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  12193. */
  12194. strictModuleErrorHandling?: boolean;
  12195. /**
  12196. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  12197. */
  12198. strictModuleExceptionHandling?: boolean;
  12199. /**
  12200. * 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.
  12201. */
  12202. trustedTypes?: string | true | TrustedTypes;
  12203. /**
  12204. * If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.
  12205. */
  12206. umdNamedDefine?: boolean;
  12207. /**
  12208. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  12209. */
  12210. uniqueName?: string;
  12211. /**
  12212. * 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).
  12213. */
  12214. wasmLoading?: string | false;
  12215. /**
  12216. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  12217. */
  12218. webassemblyModuleFilename?: string;
  12219. /**
  12220. * 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).
  12221. */
  12222. workerChunkLoading?: string | false;
  12223. /**
  12224. * 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.
  12225. */
  12226. workerPublicPath?: string;
  12227. /**
  12228. * 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).
  12229. */
  12230. workerWasmLoading?: string | false;
  12231. }
  12232. declare interface OutputFileSystem {
  12233. mkdir: Mkdir;
  12234. readdir?: ReaddirFs;
  12235. rmdir?: Rmdir;
  12236. writeFile: WriteFile;
  12237. unlink?: (
  12238. pathLike: PathLikeFs,
  12239. callback: (err: null | NodeJS.ErrnoException) => void
  12240. ) => void;
  12241. stat: StatFs;
  12242. lstat?: LStatFs;
  12243. readFile: ReadFileFs;
  12244. createReadStream?: (
  12245. path: PathLikeFs,
  12246. options?:
  12247. | "ascii"
  12248. | "utf8"
  12249. | "utf-8"
  12250. | "utf16le"
  12251. | "utf-16le"
  12252. | "ucs2"
  12253. | "ucs-2"
  12254. | "base64"
  12255. | "base64url"
  12256. | "latin1"
  12257. | "binary"
  12258. | "hex"
  12259. | ReadStreamOptions
  12260. ) => NodeJS.ReadableStream;
  12261. join?: (path1: string, path2: string) => string;
  12262. relative?: (from: string, to: string) => string;
  12263. dirname?: (dirname: string) => string;
  12264. }
  12265. /**
  12266. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  12267. */
  12268. declare interface OutputNormalized {
  12269. /**
  12270. * The filename of asset modules as relative path inside the 'output.path' directory.
  12271. */
  12272. assetModuleFilename?:
  12273. | string
  12274. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12275. /**
  12276. * Enable/disable creating async chunks that are loaded on demand.
  12277. */
  12278. asyncChunks?: boolean;
  12279. /**
  12280. * Add charset attribute for script tag.
  12281. */
  12282. charset?: boolean;
  12283. /**
  12284. * 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.
  12285. */
  12286. chunkFilename?:
  12287. | string
  12288. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12289. /**
  12290. * 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).
  12291. */
  12292. chunkFormat?: string | false;
  12293. /**
  12294. * Number of milliseconds before chunk request expires.
  12295. */
  12296. chunkLoadTimeout?: number;
  12297. /**
  12298. * 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).
  12299. */
  12300. chunkLoading?: string | false;
  12301. /**
  12302. * The global variable used by webpack for loading of chunks.
  12303. */
  12304. chunkLoadingGlobal?: string;
  12305. /**
  12306. * Clean the output directory before emit.
  12307. */
  12308. clean?: boolean | CleanOptions;
  12309. /**
  12310. * Check if to be emitted file already exists and have the same content before writing to output filesystem.
  12311. */
  12312. compareBeforeEmit?: boolean;
  12313. /**
  12314. * This option enables cross-origin loading of chunks.
  12315. */
  12316. crossOriginLoading?: false | "anonymous" | "use-credentials";
  12317. /**
  12318. * 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.
  12319. */
  12320. cssChunkFilename?:
  12321. | string
  12322. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12323. /**
  12324. * 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.
  12325. */
  12326. cssFilename?:
  12327. | string
  12328. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12329. /**
  12330. * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
  12331. */
  12332. devtoolFallbackModuleFilenameTemplate?:
  12333. | string
  12334. | ((context: ModuleFilenameTemplateContext) => string);
  12335. /**
  12336. * Filename template string of function for the sources array in a generated SourceMap.
  12337. */
  12338. devtoolModuleFilenameTemplate?:
  12339. | string
  12340. | ((context: ModuleFilenameTemplateContext) => string);
  12341. /**
  12342. * 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.
  12343. */
  12344. devtoolNamespace?: string;
  12345. /**
  12346. * List of chunk loading types enabled for use by entry points.
  12347. */
  12348. enabledChunkLoadingTypes: string[];
  12349. /**
  12350. * List of library types enabled for use by entry points.
  12351. */
  12352. enabledLibraryTypes: string[];
  12353. /**
  12354. * List of wasm loading types enabled for use by entry points.
  12355. */
  12356. enabledWasmLoadingTypes: string[];
  12357. /**
  12358. * The abilities of the environment where the webpack generated code should run.
  12359. */
  12360. environment: Environment;
  12361. /**
  12362. * 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.
  12363. */
  12364. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12365. /**
  12366. * An expression which is used to address the global object/scope in runtime code.
  12367. */
  12368. globalObject?: string;
  12369. /**
  12370. * Digest types used for the hash.
  12371. */
  12372. hashDigest?: string;
  12373. /**
  12374. * Number of chars which are used for the hash.
  12375. */
  12376. hashDigestLength?: number;
  12377. /**
  12378. * Algorithm used for generation the hash (see node.js crypto package).
  12379. */
  12380. hashFunction?: string | typeof Hash;
  12381. /**
  12382. * Any string which is added to the hash to salt it.
  12383. */
  12384. hashSalt?: string;
  12385. /**
  12386. * The filename of the Hot Update Chunks. They are inside the output.path directory.
  12387. */
  12388. hotUpdateChunkFilename?: string;
  12389. /**
  12390. * The global variable used by webpack for loading of hot update chunks.
  12391. */
  12392. hotUpdateGlobal?: string;
  12393. /**
  12394. * The filename of the Hot Update Main File. It is inside the 'output.path' directory.
  12395. */
  12396. hotUpdateMainFilename?: string;
  12397. /**
  12398. * Ignore warnings in the browser.
  12399. */
  12400. ignoreBrowserWarnings?: boolean;
  12401. /**
  12402. * Wrap javascript code into IIFE's to avoid leaking into global scope.
  12403. */
  12404. iife?: boolean;
  12405. /**
  12406. * The name of the native import() function (can be exchanged for a polyfill).
  12407. */
  12408. importFunctionName?: string;
  12409. /**
  12410. * The name of the native import.meta object (can be exchanged for a polyfill).
  12411. */
  12412. importMetaName?: string;
  12413. /**
  12414. * Options for library.
  12415. */
  12416. library?: LibraryOptions;
  12417. /**
  12418. * Output javascript files as module source type.
  12419. */
  12420. module?: boolean;
  12421. /**
  12422. * The output directory as **absolute path** (required).
  12423. */
  12424. path?: string;
  12425. /**
  12426. * Include comments with information about the modules.
  12427. */
  12428. pathinfo?: boolean | "verbose";
  12429. /**
  12430. * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
  12431. */
  12432. publicPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  12433. /**
  12434. * This option enables loading async chunks via a custom script type, such as script type="module".
  12435. */
  12436. scriptType?: false | "module" | "text/javascript";
  12437. /**
  12438. * The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.
  12439. */
  12440. sourceMapFilename?: string;
  12441. /**
  12442. * Prefixes every line of the source in the bundle with this string.
  12443. */
  12444. sourcePrefix?: string;
  12445. /**
  12446. * Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.
  12447. */
  12448. strictModuleErrorHandling?: boolean;
  12449. /**
  12450. * Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
  12451. */
  12452. strictModuleExceptionHandling?: boolean;
  12453. /**
  12454. * Use a Trusted Types policy to create urls for chunks.
  12455. */
  12456. trustedTypes?: TrustedTypes;
  12457. /**
  12458. * A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
  12459. */
  12460. uniqueName?: string;
  12461. /**
  12462. * 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).
  12463. */
  12464. wasmLoading?: string | false;
  12465. /**
  12466. * The filename of WebAssembly modules as relative path inside the 'output.path' directory.
  12467. */
  12468. webassemblyModuleFilename?: string;
  12469. /**
  12470. * 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).
  12471. */
  12472. workerChunkLoading?: string | false;
  12473. /**
  12474. * 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.
  12475. */
  12476. workerPublicPath?: string;
  12477. /**
  12478. * 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).
  12479. */
  12480. workerWasmLoading?: string | false;
  12481. }
  12482. type OutputNormalizedWithDefaults = OutputNormalized & {
  12483. uniqueName: string;
  12484. filename: NonNullable<
  12485. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12486. >;
  12487. cssFilename: NonNullable<
  12488. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12489. >;
  12490. chunkFilename: NonNullable<
  12491. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12492. >;
  12493. cssChunkFilename: NonNullable<
  12494. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12495. >;
  12496. hotUpdateChunkFilename: string;
  12497. hotUpdateGlobal: string;
  12498. assetModuleFilename: NonNullable<
  12499. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12500. >;
  12501. webassemblyModuleFilename: string;
  12502. sourceMapFilename: string;
  12503. hotUpdateMainFilename: string;
  12504. devtoolNamespace: string;
  12505. publicPath: NonNullable<
  12506. undefined | string | ((pathData: PathData, assetInfo?: AssetInfo) => string)
  12507. >;
  12508. workerPublicPath: string;
  12509. workerWasmLoading: NonNullable<undefined | string | false>;
  12510. workerChunkLoading: NonNullable<undefined | string | false>;
  12511. chunkFormat: NonNullable<undefined | string | false>;
  12512. module: NonNullable<undefined | boolean>;
  12513. asyncChunks: NonNullable<undefined | boolean>;
  12514. charset: NonNullable<undefined | boolean>;
  12515. iife: NonNullable<undefined | boolean>;
  12516. globalObject: string;
  12517. scriptType: NonNullable<undefined | false | "module" | "text/javascript">;
  12518. path: string;
  12519. pathinfo: NonNullable<undefined | boolean | "verbose">;
  12520. hashFunction: NonNullable<undefined | string | typeof Hash>;
  12521. hashDigest: string;
  12522. hashDigestLength: number;
  12523. chunkLoadTimeout: number;
  12524. chunkLoading: NonNullable<undefined | string | false>;
  12525. chunkLoadingGlobal: string;
  12526. compareBeforeEmit: NonNullable<undefined | boolean>;
  12527. strictModuleErrorHandling: NonNullable<undefined | boolean>;
  12528. strictModuleExceptionHandling: NonNullable<undefined | boolean>;
  12529. importFunctionName: string;
  12530. importMetaName: string;
  12531. environment: RecursiveNonNullable<Environment>;
  12532. crossOriginLoading: NonNullable<
  12533. undefined | false | "anonymous" | "use-credentials"
  12534. >;
  12535. wasmLoading: NonNullable<undefined | string | false>;
  12536. };
  12537. declare interface ParameterizedComparator<TArg extends object, T> {
  12538. (tArg: TArg): Comparator<T>;
  12539. }
  12540. declare interface ParseOptions {
  12541. sourceType: "module" | "script";
  12542. ecmaVersion?:
  12543. | 3
  12544. | 5
  12545. | 6
  12546. | 7
  12547. | 8
  12548. | 9
  12549. | 10
  12550. | 11
  12551. | 12
  12552. | 13
  12553. | 14
  12554. | 15
  12555. | 16
  12556. | 17
  12557. | 2015
  12558. | 2016
  12559. | 2017
  12560. | 2018
  12561. | 2019
  12562. | 2020
  12563. | 2021
  12564. | 2022
  12565. | 2023
  12566. | 2024
  12567. | 2025
  12568. | 2026
  12569. | "latest";
  12570. locations?: boolean;
  12571. comments?: boolean;
  12572. ranges?: boolean;
  12573. semicolons?: boolean;
  12574. allowHashBang?: boolean;
  12575. allowReturnOutsideFunction?: boolean;
  12576. }
  12577. declare interface ParseResult {
  12578. ast: Program;
  12579. comments: CommentJavascriptParser[];
  12580. semicolons: Set<number>;
  12581. }
  12582. declare interface ParsedIdentifier {
  12583. /**
  12584. * request
  12585. */
  12586. request: string;
  12587. /**
  12588. * query
  12589. */
  12590. query: string;
  12591. /**
  12592. * fragment
  12593. */
  12594. fragment: string;
  12595. /**
  12596. * is directory
  12597. */
  12598. directory: boolean;
  12599. /**
  12600. * is module
  12601. */
  12602. module: boolean;
  12603. /**
  12604. * is file
  12605. */
  12606. file: boolean;
  12607. /**
  12608. * is internal
  12609. */
  12610. internal: boolean;
  12611. }
  12612. declare class ParserClass {
  12613. constructor();
  12614. parse(
  12615. source: string | Buffer | PreparsedAst,
  12616. state: ParserState
  12617. ): ParserState;
  12618. }
  12619. declare interface ParserOptions {
  12620. [index: string]: any;
  12621. }
  12622. type ParserOptionsByModuleType = ParserOptionsByModuleTypeKnown &
  12623. ParserOptionsByModuleTypeUnknown;
  12624. /**
  12625. * Specify options for each parser.
  12626. */
  12627. declare interface ParserOptionsByModuleTypeKnown {
  12628. /**
  12629. * Parser options for asset modules.
  12630. */
  12631. asset?: AssetParserOptions;
  12632. /**
  12633. * No parser options are supported for this module type.
  12634. */
  12635. "asset/bytes"?: EmptyParserOptions;
  12636. /**
  12637. * No parser options are supported for this module type.
  12638. */
  12639. "asset/inline"?: EmptyParserOptions;
  12640. /**
  12641. * No parser options are supported for this module type.
  12642. */
  12643. "asset/resource"?: EmptyParserOptions;
  12644. /**
  12645. * No parser options are supported for this module type.
  12646. */
  12647. "asset/source"?: EmptyParserOptions;
  12648. /**
  12649. * Parser options for css modules.
  12650. */
  12651. css?: CssParserOptions;
  12652. /**
  12653. * Parser options for css/module modules.
  12654. */
  12655. "css/auto"?: CssModuleParserOptions;
  12656. /**
  12657. * Parser options for css/module modules.
  12658. */
  12659. "css/global"?: CssModuleParserOptions;
  12660. /**
  12661. * Parser options for css/module modules.
  12662. */
  12663. "css/module"?: CssModuleParserOptions;
  12664. /**
  12665. * Parser options for javascript modules.
  12666. */
  12667. javascript?: JavascriptParserOptions;
  12668. /**
  12669. * Parser options for javascript modules.
  12670. */
  12671. "javascript/auto"?: JavascriptParserOptions;
  12672. /**
  12673. * Parser options for javascript modules.
  12674. */
  12675. "javascript/dynamic"?: JavascriptParserOptions;
  12676. /**
  12677. * Parser options for javascript modules.
  12678. */
  12679. "javascript/esm"?: JavascriptParserOptions;
  12680. /**
  12681. * Parser options for JSON modules.
  12682. */
  12683. json?: JsonParserOptions;
  12684. }
  12685. /**
  12686. * Specify options for each parser.
  12687. */
  12688. declare interface ParserOptionsByModuleTypeUnknown {
  12689. [index: string]: { [index: string]: any };
  12690. }
  12691. type ParserState = ParserStateBase & Record<string, any>;
  12692. declare interface ParserStateBase {
  12693. source: string | Buffer;
  12694. current: NormalModule;
  12695. module: NormalModule;
  12696. compilation: Compilation;
  12697. options: WebpackOptionsNormalizedWithDefaults;
  12698. }
  12699. declare interface PathData {
  12700. chunkGraph?: ChunkGraph;
  12701. hash?: string;
  12702. hashWithLength?: (length: number) => string;
  12703. chunk?: Chunk | ChunkPathData;
  12704. module?: Module | ModulePathData;
  12705. runtime?: RuntimeSpec;
  12706. filename?: string;
  12707. basename?: string;
  12708. query?: string;
  12709. contentHashType?: string;
  12710. contentHash?: string;
  12711. contentHashWithLength?: (length: number) => string;
  12712. noChunkHash?: boolean;
  12713. url?: string;
  12714. prepareId?: (id: string | number) => string | number;
  12715. }
  12716. type PathLikeFs = string | Buffer | URL;
  12717. type PathLikeTypes = string | URL_url | Buffer;
  12718. type PathOrFileDescriptorFs = string | number | Buffer | URL;
  12719. type PathOrFileDescriptorTypes = string | number | Buffer | URL_url;
  12720. type Pattern =
  12721. | Identifier
  12722. | MemberExpression
  12723. | ObjectPattern
  12724. | ArrayPattern
  12725. | RestElement
  12726. | AssignmentPattern;
  12727. /**
  12728. * Configuration object for web performance recommendations.
  12729. */
  12730. declare interface PerformanceOptions {
  12731. /**
  12732. * Filter function to select assets that are checked.
  12733. */
  12734. assetFilter?: (name: string, source: Source, assetInfo: AssetInfo) => boolean;
  12735. /**
  12736. * Sets the format of the hints: warnings, errors or nothing at all.
  12737. */
  12738. hints?: false | "error" | "warning";
  12739. /**
  12740. * File size limit (in bytes) when exceeded, that webpack will provide performance hints.
  12741. */
  12742. maxAssetSize?: number;
  12743. /**
  12744. * Total size of an entry point (in bytes).
  12745. */
  12746. maxEntrypointSize?: number;
  12747. }
  12748. declare interface PitchLoaderDefinitionFunction<
  12749. OptionsType = {},
  12750. ContextAdditions = {}
  12751. > {
  12752. (
  12753. this: NormalModuleLoaderContext<OptionsType> &
  12754. LoaderRunnerLoaderContext<OptionsType> &
  12755. LoaderPluginLoaderContext &
  12756. HotModuleReplacementPluginLoaderContext &
  12757. ContextAdditions,
  12758. remainingRequest: string,
  12759. previousRequest: string,
  12760. data: object
  12761. ): string | void | Buffer | Promise<string | Buffer>;
  12762. }
  12763. declare class PlatformPlugin {
  12764. constructor(platform: Partial<PlatformTargetProperties>);
  12765. platform: Partial<PlatformTargetProperties>;
  12766. /**
  12767. * Apply the plugin
  12768. */
  12769. apply(compiler: Compiler): void;
  12770. }
  12771. declare interface PlatformTargetProperties {
  12772. /**
  12773. * web platform, importing of http(s) and std: is available
  12774. */
  12775. web?: null | boolean;
  12776. /**
  12777. * browser platform, running in a normal web browser
  12778. */
  12779. browser?: null | boolean;
  12780. /**
  12781. * (Web)Worker platform, running in a web/shared/service worker
  12782. */
  12783. webworker?: null | boolean;
  12784. /**
  12785. * node platform, require of node built-in modules is available
  12786. */
  12787. node?: null | boolean;
  12788. /**
  12789. * nwjs platform, require of legacy nw.gui is available
  12790. */
  12791. nwjs?: null | boolean;
  12792. /**
  12793. * electron platform, require of some electron built-in modules is available
  12794. */
  12795. electron?: null | boolean;
  12796. }
  12797. type Plugin =
  12798. | undefined
  12799. | null
  12800. | false
  12801. | ""
  12802. | 0
  12803. | { apply: (this: Resolver, resolver: Resolver) => void }
  12804. | ((this: Resolver, resolver: Resolver) => void);
  12805. declare interface PnpApi {
  12806. /**
  12807. * resolve to unqualified
  12808. */
  12809. resolveToUnqualified: (
  12810. packageName: string,
  12811. issuer: string,
  12812. options: { considerBuiltins: boolean }
  12813. ) => null | string;
  12814. }
  12815. declare interface Position {
  12816. line: number;
  12817. column: number;
  12818. }
  12819. declare class PrefetchPlugin {
  12820. constructor(context: string, request?: string);
  12821. context: null | string;
  12822. request: string;
  12823. /**
  12824. * Apply the plugin
  12825. */
  12826. apply(compiler: Compiler): void;
  12827. }
  12828. declare class PrefixSource extends Source {
  12829. constructor(prefix: string, source: string | Buffer | Source);
  12830. getPrefix(): string;
  12831. original(): Source;
  12832. streamChunks(
  12833. options: StreamChunksOptions,
  12834. onChunk: (
  12835. chunk: undefined | string,
  12836. generatedLine: number,
  12837. generatedColumn: number,
  12838. sourceIndex: number,
  12839. originalLine: number,
  12840. originalColumn: number,
  12841. nameIndex: number
  12842. ) => void,
  12843. onSource: (
  12844. sourceIndex: number,
  12845. source: null | string,
  12846. sourceContent?: string
  12847. ) => void,
  12848. onName: (nameIndex: number, name: string) => void
  12849. ): GeneratedSourceInfo;
  12850. }
  12851. declare interface PreparsedAst {
  12852. [index: string]: any;
  12853. }
  12854. declare interface PrintedElement {
  12855. element: string;
  12856. content?: string;
  12857. }
  12858. declare interface Problem {
  12859. type: ProblemType;
  12860. path: string;
  12861. argument: string;
  12862. value?: string | number | boolean | RegExp;
  12863. index?: number;
  12864. expected?: string;
  12865. }
  12866. type ProblemType =
  12867. | "unknown-argument"
  12868. | "unexpected-non-array-in-path"
  12869. | "unexpected-non-object-in-path"
  12870. | "multiple-values-unexpected"
  12871. | "invalid-value";
  12872. declare interface ProcessAssetsAdditionalOptions {
  12873. additionalAssets?: boolean | ((assets: CompilationAssets) => void);
  12874. }
  12875. declare class Profiler {
  12876. constructor(inspector: Inspector);
  12877. session?: SessionImportInspectorClass_2;
  12878. inspector: Inspector;
  12879. hasSession(): boolean;
  12880. startProfiling(): Promise<void> | Promise<[any, any, any]>;
  12881. sendCommand(method: string, params?: object): Promise<any>;
  12882. destroy(): Promise<void>;
  12883. stopProfiling(): Promise<{ profile: { startTime: number; endTime: number } }>;
  12884. }
  12885. declare class ProfilingPlugin {
  12886. constructor(options?: ProfilingPluginOptions);
  12887. outputPath: string;
  12888. /**
  12889. * Apply the plugin
  12890. */
  12891. apply(compiler: Compiler): void;
  12892. static Profiler: typeof Profiler;
  12893. }
  12894. declare interface ProfilingPluginOptions {
  12895. /**
  12896. * Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.
  12897. */
  12898. outputPath?: string;
  12899. }
  12900. declare class ProgressPlugin {
  12901. constructor(options?: ProgressPluginArgument);
  12902. profile?: null | boolean;
  12903. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  12904. modulesCount?: number;
  12905. dependenciesCount?: number;
  12906. showEntries?: boolean;
  12907. showModules?: boolean;
  12908. showDependencies?: boolean;
  12909. showActiveModules?: boolean;
  12910. percentBy?: null | "modules" | "entries" | "dependencies";
  12911. apply(compiler: MultiCompiler | Compiler): void;
  12912. static getReporter(
  12913. compiler: Compiler
  12914. ): undefined | ((p: number, ...args: string[]) => void);
  12915. static defaultOptions: {
  12916. profile: boolean;
  12917. modulesCount: number;
  12918. dependenciesCount: number;
  12919. modules: boolean;
  12920. dependencies: boolean;
  12921. activeModules: boolean;
  12922. entries: boolean;
  12923. };
  12924. static createDefaultHandler: (
  12925. profile: undefined | null | boolean,
  12926. logger: WebpackLogger
  12927. ) => (percentage: number, msg: string, ...args: string[]) => void;
  12928. }
  12929. type ProgressPluginArgument =
  12930. | ProgressPluginOptions
  12931. | ((percentage: number, msg: string, ...args: string[]) => void);
  12932. /**
  12933. * Options object for the ProgressPlugin.
  12934. */
  12935. declare interface ProgressPluginOptions {
  12936. /**
  12937. * Show active modules count and one active module in progress message.
  12938. */
  12939. activeModules?: boolean;
  12940. /**
  12941. * Show dependencies count in progress message.
  12942. */
  12943. dependencies?: boolean;
  12944. /**
  12945. * Minimum dependencies count to start with. For better progress calculation. Default: 10000.
  12946. */
  12947. dependenciesCount?: number;
  12948. /**
  12949. * Show entries count in progress message.
  12950. */
  12951. entries?: boolean;
  12952. /**
  12953. * Function that executes for every progress step.
  12954. */
  12955. handler?: (percentage: number, msg: string, ...args: string[]) => void;
  12956. /**
  12957. * Show modules count in progress message.
  12958. */
  12959. modules?: boolean;
  12960. /**
  12961. * Minimum modules count to start with. For better progress calculation. Default: 5000.
  12962. */
  12963. modulesCount?: number;
  12964. /**
  12965. * Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
  12966. */
  12967. percentBy?: null | "modules" | "entries" | "dependencies";
  12968. /**
  12969. * Collect profile data for progress steps. Default: false.
  12970. */
  12971. profile?: null | boolean;
  12972. }
  12973. declare class ProvidePlugin {
  12974. constructor(definitions: Record<string, string | string[]>);
  12975. definitions: Record<string, string | string[]>;
  12976. /**
  12977. * Apply the plugin
  12978. */
  12979. apply(compiler: Compiler): void;
  12980. }
  12981. declare class ProvideSharedPlugin {
  12982. constructor(options: ProvideSharedPluginOptions);
  12983. /**
  12984. * Apply the plugin
  12985. */
  12986. apply(compiler: Compiler): void;
  12987. }
  12988. declare interface ProvideSharedPluginOptions {
  12989. /**
  12990. * 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.
  12991. */
  12992. provides: Provides;
  12993. /**
  12994. * Share scope name used for all provided modules (defaults to 'default').
  12995. */
  12996. shareScope?: string;
  12997. }
  12998. type Provides = (string | ProvidesObject)[] | ProvidesObject;
  12999. /**
  13000. * Advanced configuration for modules that should be provided as shared modules to the share scope.
  13001. */
  13002. declare interface ProvidesConfig {
  13003. /**
  13004. * 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.
  13005. */
  13006. eager?: boolean;
  13007. /**
  13008. * Key in the share scope under which the shared modules should be stored.
  13009. */
  13010. shareKey?: string;
  13011. /**
  13012. * Share scope name.
  13013. */
  13014. shareScope?: string;
  13015. /**
  13016. * Version of the provided module. Will replace lower matching versions, but not higher.
  13017. */
  13018. version?: string | false;
  13019. }
  13020. /**
  13021. * Modules that should be provided as shared modules to the share scope. Property names are used as share keys.
  13022. */
  13023. declare interface ProvidesObject {
  13024. [index: string]: string | ProvidesConfig;
  13025. }
  13026. declare interface RawChunkGroupOptions {
  13027. preloadOrder?: number;
  13028. prefetchOrder?: number;
  13029. fetchPriority?: "auto" | "low" | "high";
  13030. }
  13031. type RawLoaderDefinition<
  13032. OptionsType = {},
  13033. ContextAdditions = {}
  13034. > = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
  13035. raw: true;
  13036. pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
  13037. };
  13038. declare interface RawLoaderDefinitionFunction<
  13039. OptionsType = {},
  13040. ContextAdditions = {}
  13041. > {
  13042. (
  13043. this: NormalModuleLoaderContext<OptionsType> &
  13044. LoaderRunnerLoaderContext<OptionsType> &
  13045. LoaderPluginLoaderContext &
  13046. HotModuleReplacementPluginLoaderContext &
  13047. ContextAdditions,
  13048. content: Buffer,
  13049. sourceMap?: string | RawSourceMap,
  13050. additionalData?: AdditionalData
  13051. ): string | void | Buffer | Promise<string | Buffer>;
  13052. }
  13053. declare class RawSource extends Source {
  13054. constructor(value: string | Buffer, convertToString?: boolean);
  13055. isBuffer(): boolean;
  13056. streamChunks(
  13057. options: StreamChunksOptions,
  13058. onChunk: (
  13059. chunk: undefined | string,
  13060. generatedLine: number,
  13061. generatedColumn: number,
  13062. sourceIndex: number,
  13063. originalLine: number,
  13064. originalColumn: number,
  13065. nameIndex: number
  13066. ) => void,
  13067. onSource: (
  13068. sourceIndex: number,
  13069. source: null | string,
  13070. sourceContent?: string
  13071. ) => void,
  13072. onName: (nameIndex: number, name: string) => void
  13073. ): GeneratedSourceInfo;
  13074. }
  13075. declare interface RawSourceMap {
  13076. /**
  13077. * version
  13078. */
  13079. version: number;
  13080. /**
  13081. * sources
  13082. */
  13083. sources: string[];
  13084. /**
  13085. * names
  13086. */
  13087. names: string[];
  13088. /**
  13089. * source root
  13090. */
  13091. sourceRoot?: string;
  13092. /**
  13093. * sources content
  13094. */
  13095. sourcesContent?: string[];
  13096. /**
  13097. * mappings
  13098. */
  13099. mappings: string;
  13100. /**
  13101. * file
  13102. */
  13103. file: string;
  13104. /**
  13105. * debug id
  13106. */
  13107. debugId?: string;
  13108. /**
  13109. * ignore list
  13110. */
  13111. ignoreList?: number[];
  13112. }
  13113. declare interface Read<
  13114. TBuffer extends NodeJS.ArrayBufferView = NodeJS.ArrayBufferView
  13115. > {
  13116. (
  13117. fd: number,
  13118. buffer: TBuffer,
  13119. offset: number,
  13120. length: number,
  13121. position: null | number | bigint,
  13122. callback: (
  13123. err: null | NodeJS.ErrnoException,
  13124. bytesRead: number,
  13125. buffer: TBuffer
  13126. ) => void
  13127. ): void;
  13128. (
  13129. fd: number,
  13130. options: ReadAsyncOptions<TBuffer>,
  13131. callback: (
  13132. err: null | NodeJS.ErrnoException,
  13133. bytesRead: number,
  13134. buffer: TBuffer
  13135. ) => void
  13136. ): void;
  13137. (
  13138. fd: number,
  13139. callback: (
  13140. err: null | NodeJS.ErrnoException,
  13141. bytesRead: number,
  13142. buffer: NodeJS.ArrayBufferView
  13143. ) => void
  13144. ): void;
  13145. }
  13146. declare interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> {
  13147. offset?: number;
  13148. length?: number;
  13149. position?: null | number | bigint;
  13150. buffer?: TBuffer;
  13151. }
  13152. declare class ReadFileCompileAsyncWasmPlugin {
  13153. constructor(__0?: ReadFileCompileAsyncWasmPluginOptions);
  13154. /**
  13155. * Apply the plugin
  13156. */
  13157. apply(compiler: Compiler): void;
  13158. }
  13159. declare interface ReadFileCompileAsyncWasmPluginOptions {
  13160. /**
  13161. * use import?
  13162. */
  13163. import?: boolean;
  13164. }
  13165. declare class ReadFileCompileWasmPlugin {
  13166. constructor(options?: ReadFileCompileWasmPluginOptions);
  13167. options: ReadFileCompileWasmPluginOptions;
  13168. /**
  13169. * Apply the plugin
  13170. */
  13171. apply(compiler: Compiler): void;
  13172. }
  13173. declare interface ReadFileCompileWasmPluginOptions {
  13174. /**
  13175. * mangle imports
  13176. */
  13177. mangleImports?: boolean;
  13178. /**
  13179. * use import?
  13180. */
  13181. import?: boolean;
  13182. }
  13183. declare interface ReadFileFs {
  13184. (
  13185. path: PathOrFileDescriptorFs,
  13186. options:
  13187. | undefined
  13188. | null
  13189. | ({ encoding?: null; flag?: string } & Abortable),
  13190. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13191. ): void;
  13192. (
  13193. path: PathOrFileDescriptorFs,
  13194. options:
  13195. | ({ encoding: BufferEncoding; flag?: string } & Abortable)
  13196. | "ascii"
  13197. | "utf8"
  13198. | "utf-8"
  13199. | "utf16le"
  13200. | "utf-16le"
  13201. | "ucs2"
  13202. | "ucs-2"
  13203. | "base64"
  13204. | "base64url"
  13205. | "latin1"
  13206. | "binary"
  13207. | "hex",
  13208. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13209. ): void;
  13210. (
  13211. path: PathOrFileDescriptorFs,
  13212. options:
  13213. | undefined
  13214. | null
  13215. | "ascii"
  13216. | "utf8"
  13217. | "utf-8"
  13218. | "utf16le"
  13219. | "utf-16le"
  13220. | "ucs2"
  13221. | "ucs-2"
  13222. | "base64"
  13223. | "base64url"
  13224. | "latin1"
  13225. | "binary"
  13226. | "hex"
  13227. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  13228. callback: (
  13229. err: null | NodeJS.ErrnoException,
  13230. result?: string | Buffer
  13231. ) => void
  13232. ): void;
  13233. (
  13234. path: PathOrFileDescriptorFs,
  13235. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13236. ): void;
  13237. }
  13238. declare interface ReadFileSync {
  13239. (
  13240. path: PathOrFileDescriptorFs,
  13241. options?: null | { encoding?: null; flag?: string }
  13242. ): Buffer;
  13243. (
  13244. path: PathOrFileDescriptorFs,
  13245. options:
  13246. | "ascii"
  13247. | "utf8"
  13248. | "utf-8"
  13249. | "utf16le"
  13250. | "utf-16le"
  13251. | "ucs2"
  13252. | "ucs-2"
  13253. | "base64"
  13254. | "base64url"
  13255. | "latin1"
  13256. | "binary"
  13257. | "hex"
  13258. | { encoding: BufferEncoding; flag?: string }
  13259. ): string;
  13260. (
  13261. path: PathOrFileDescriptorFs,
  13262. options?:
  13263. | null
  13264. | "ascii"
  13265. | "utf8"
  13266. | "utf-8"
  13267. | "utf16le"
  13268. | "utf-16le"
  13269. | "ucs2"
  13270. | "ucs-2"
  13271. | "base64"
  13272. | "base64url"
  13273. | "latin1"
  13274. | "binary"
  13275. | "hex"
  13276. | (ObjectEncodingOptions & { flag?: string })
  13277. ): string | Buffer;
  13278. }
  13279. declare interface ReadFileTypes {
  13280. (
  13281. path: PathOrFileDescriptorTypes,
  13282. options:
  13283. | undefined
  13284. | null
  13285. | ({ encoding?: null; flag?: string } & Abortable),
  13286. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13287. ): void;
  13288. (
  13289. path: PathOrFileDescriptorTypes,
  13290. options:
  13291. | "ascii"
  13292. | "utf8"
  13293. | "utf-8"
  13294. | "utf16le"
  13295. | "utf-16le"
  13296. | "ucs2"
  13297. | "ucs-2"
  13298. | "base64"
  13299. | "base64url"
  13300. | "latin1"
  13301. | "binary"
  13302. | "hex"
  13303. | ({ encoding: BufferEncoding; flag?: string } & Abortable),
  13304. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13305. ): void;
  13306. (
  13307. path: PathOrFileDescriptorTypes,
  13308. options:
  13309. | undefined
  13310. | null
  13311. | "ascii"
  13312. | "utf8"
  13313. | "utf-8"
  13314. | "utf16le"
  13315. | "utf-16le"
  13316. | "ucs2"
  13317. | "ucs-2"
  13318. | "base64"
  13319. | "base64url"
  13320. | "latin1"
  13321. | "binary"
  13322. | "hex"
  13323. | (ObjectEncodingOptions & { flag?: string } & Abortable),
  13324. callback: (
  13325. err: null | NodeJS.ErrnoException,
  13326. result?: string | Buffer
  13327. ) => void
  13328. ): void;
  13329. (
  13330. path: PathOrFileDescriptorTypes,
  13331. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13332. ): void;
  13333. }
  13334. type ReadStreamOptions = StreamOptions & {
  13335. fs?: null | CreateReadStreamFSImplementation;
  13336. end?: number;
  13337. };
  13338. declare interface ReaddirFs {
  13339. (
  13340. path: PathLikeFs,
  13341. options:
  13342. | undefined
  13343. | null
  13344. | "ascii"
  13345. | "utf8"
  13346. | "utf-8"
  13347. | "utf16le"
  13348. | "utf-16le"
  13349. | "ucs2"
  13350. | "ucs-2"
  13351. | "base64"
  13352. | "base64url"
  13353. | "latin1"
  13354. | "binary"
  13355. | "hex"
  13356. | {
  13357. encoding:
  13358. | null
  13359. | "ascii"
  13360. | "utf8"
  13361. | "utf-8"
  13362. | "utf16le"
  13363. | "utf-16le"
  13364. | "ucs2"
  13365. | "ucs-2"
  13366. | "base64"
  13367. | "base64url"
  13368. | "latin1"
  13369. | "binary"
  13370. | "hex";
  13371. withFileTypes?: false;
  13372. recursive?: boolean;
  13373. },
  13374. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13375. ): void;
  13376. (
  13377. path: PathLikeFs,
  13378. options:
  13379. | "buffer"
  13380. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  13381. callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void
  13382. ): void;
  13383. (
  13384. path: PathLikeFs,
  13385. options:
  13386. | undefined
  13387. | null
  13388. | "ascii"
  13389. | "utf8"
  13390. | "utf-8"
  13391. | "utf16le"
  13392. | "utf-16le"
  13393. | "ucs2"
  13394. | "ucs-2"
  13395. | "base64"
  13396. | "base64url"
  13397. | "latin1"
  13398. | "binary"
  13399. | "hex"
  13400. | (ObjectEncodingOptions & {
  13401. withFileTypes?: false;
  13402. recursive?: boolean;
  13403. }),
  13404. callback: (
  13405. err: null | NodeJS.ErrnoException,
  13406. files?: string[] | Buffer[]
  13407. ) => void
  13408. ): void;
  13409. (
  13410. path: PathLikeFs,
  13411. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13412. ): void;
  13413. (
  13414. path: PathLikeFs,
  13415. options: ObjectEncodingOptions & {
  13416. withFileTypes: true;
  13417. recursive?: boolean;
  13418. },
  13419. callback: (
  13420. err: null | NodeJS.ErrnoException,
  13421. files?: Dirent<string>[]
  13422. ) => void
  13423. ): void;
  13424. (
  13425. path: PathLikeFs,
  13426. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean },
  13427. callback: (
  13428. err: null | NodeJS.ErrnoException,
  13429. files: Dirent<Buffer>[]
  13430. ) => void
  13431. ): void;
  13432. }
  13433. declare interface ReaddirSync {
  13434. (
  13435. path: PathLikeFs,
  13436. options?:
  13437. | null
  13438. | "ascii"
  13439. | "utf8"
  13440. | "utf-8"
  13441. | "utf16le"
  13442. | "utf-16le"
  13443. | "ucs2"
  13444. | "ucs-2"
  13445. | "base64"
  13446. | "base64url"
  13447. | "latin1"
  13448. | "binary"
  13449. | "hex"
  13450. | {
  13451. encoding:
  13452. | null
  13453. | "ascii"
  13454. | "utf8"
  13455. | "utf-8"
  13456. | "utf16le"
  13457. | "utf-16le"
  13458. | "ucs2"
  13459. | "ucs-2"
  13460. | "base64"
  13461. | "base64url"
  13462. | "latin1"
  13463. | "binary"
  13464. | "hex";
  13465. withFileTypes?: false;
  13466. recursive?: boolean;
  13467. }
  13468. ): string[];
  13469. (
  13470. path: PathLikeFs,
  13471. options:
  13472. | "buffer"
  13473. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }
  13474. ): Buffer[];
  13475. (
  13476. path: PathLikeFs,
  13477. options?:
  13478. | null
  13479. | "ascii"
  13480. | "utf8"
  13481. | "utf-8"
  13482. | "utf16le"
  13483. | "utf-16le"
  13484. | "ucs2"
  13485. | "ucs-2"
  13486. | "base64"
  13487. | "base64url"
  13488. | "latin1"
  13489. | "binary"
  13490. | "hex"
  13491. | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean })
  13492. ): string[] | Buffer[];
  13493. (
  13494. path: PathLikeFs,
  13495. options: ObjectEncodingOptions & {
  13496. withFileTypes: true;
  13497. recursive?: boolean;
  13498. }
  13499. ): Dirent<string>[];
  13500. (
  13501. path: PathLikeFs,
  13502. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }
  13503. ): Dirent<Buffer>[];
  13504. }
  13505. declare interface ReaddirTypes {
  13506. (
  13507. path: PathLikeTypes,
  13508. options:
  13509. | undefined
  13510. | null
  13511. | "ascii"
  13512. | "utf8"
  13513. | "utf-8"
  13514. | "utf16le"
  13515. | "utf-16le"
  13516. | "ucs2"
  13517. | "ucs-2"
  13518. | "base64"
  13519. | "base64url"
  13520. | "latin1"
  13521. | "binary"
  13522. | "hex"
  13523. | {
  13524. encoding:
  13525. | null
  13526. | "ascii"
  13527. | "utf8"
  13528. | "utf-8"
  13529. | "utf16le"
  13530. | "utf-16le"
  13531. | "ucs2"
  13532. | "ucs-2"
  13533. | "base64"
  13534. | "base64url"
  13535. | "latin1"
  13536. | "binary"
  13537. | "hex";
  13538. withFileTypes?: false;
  13539. recursive?: boolean;
  13540. },
  13541. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13542. ): void;
  13543. (
  13544. path: PathLikeTypes,
  13545. options:
  13546. | "buffer"
  13547. | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean },
  13548. callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void
  13549. ): void;
  13550. (
  13551. path: PathLikeTypes,
  13552. options:
  13553. | undefined
  13554. | null
  13555. | "ascii"
  13556. | "utf8"
  13557. | "utf-8"
  13558. | "utf16le"
  13559. | "utf-16le"
  13560. | "ucs2"
  13561. | "ucs-2"
  13562. | "base64"
  13563. | "base64url"
  13564. | "latin1"
  13565. | "binary"
  13566. | "hex"
  13567. | (ObjectEncodingOptions & {
  13568. withFileTypes?: false;
  13569. recursive?: boolean;
  13570. }),
  13571. callback: (
  13572. err: null | NodeJS.ErrnoException,
  13573. files?: string[] | Buffer[]
  13574. ) => void
  13575. ): void;
  13576. (
  13577. path: PathLikeTypes,
  13578. callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void
  13579. ): void;
  13580. (
  13581. path: PathLikeTypes,
  13582. options: ObjectEncodingOptions & {
  13583. withFileTypes: true;
  13584. recursive?: boolean;
  13585. },
  13586. callback: (
  13587. err: null | NodeJS.ErrnoException,
  13588. files?: Dirent<string>[]
  13589. ) => void
  13590. ): void;
  13591. (
  13592. path: PathLikeTypes,
  13593. options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean },
  13594. callback: (
  13595. err: null | NodeJS.ErrnoException,
  13596. files: Dirent<Buffer>[]
  13597. ) => void
  13598. ): void;
  13599. }
  13600. declare interface ReadlinkFs {
  13601. (
  13602. path: PathLikeFs,
  13603. options: EncodingOption,
  13604. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13605. ): void;
  13606. (
  13607. path: PathLikeFs,
  13608. options: BufferEncodingOption,
  13609. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13610. ): void;
  13611. (
  13612. path: PathLikeFs,
  13613. options: EncodingOption,
  13614. callback: (
  13615. err: null | NodeJS.ErrnoException,
  13616. result?: string | Buffer
  13617. ) => void
  13618. ): void;
  13619. (
  13620. path: PathLikeFs,
  13621. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13622. ): void;
  13623. }
  13624. declare interface ReadlinkSync {
  13625. (path: PathLikeFs, options?: EncodingOption): string;
  13626. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  13627. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  13628. }
  13629. declare interface ReadlinkTypes {
  13630. (
  13631. path: PathLikeTypes,
  13632. options: EncodingOption,
  13633. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13634. ): void;
  13635. (
  13636. path: PathLikeTypes,
  13637. options: BufferEncodingOption,
  13638. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13639. ): void;
  13640. (
  13641. path: PathLikeTypes,
  13642. options: EncodingOption,
  13643. callback: (
  13644. err: null | NodeJS.ErrnoException,
  13645. result?: string | Buffer
  13646. ) => void
  13647. ): void;
  13648. (
  13649. path: PathLikeTypes,
  13650. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13651. ): void;
  13652. }
  13653. declare class RealContentHashPlugin {
  13654. constructor(__0: RealContentHashPluginOptions);
  13655. /**
  13656. * Apply the plugin
  13657. */
  13658. apply(compiler: Compiler): void;
  13659. static getCompilationHooks(
  13660. compilation: Compilation
  13661. ): CompilationHooksRealContentHashPlugin;
  13662. }
  13663. declare interface RealContentHashPluginOptions {
  13664. /**
  13665. * the hash function to use
  13666. */
  13667. hashFunction: HashFunction;
  13668. /**
  13669. * the hash digest to use
  13670. */
  13671. hashDigest: string;
  13672. }
  13673. declare interface RealDependencyLocation {
  13674. start: SourcePosition;
  13675. end?: SourcePosition;
  13676. index?: number;
  13677. }
  13678. declare interface RealPathFs {
  13679. (
  13680. path: PathLikeFs,
  13681. options: EncodingOption,
  13682. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13683. ): void;
  13684. (
  13685. path: PathLikeFs,
  13686. options: BufferEncodingOption,
  13687. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13688. ): void;
  13689. (
  13690. path: PathLikeFs,
  13691. options: EncodingOption,
  13692. callback: (
  13693. err: null | NodeJS.ErrnoException,
  13694. result?: string | Buffer
  13695. ) => void
  13696. ): void;
  13697. (
  13698. path: PathLikeFs,
  13699. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13700. ): void;
  13701. }
  13702. declare interface RealPathSync {
  13703. (path: PathLikeFs, options?: EncodingOption): string;
  13704. (path: PathLikeFs, options: BufferEncodingOption): Buffer;
  13705. (path: PathLikeFs, options?: EncodingOption): string | Buffer;
  13706. }
  13707. declare interface RealPathTypes {
  13708. (
  13709. path: PathLikeTypes,
  13710. options: EncodingOption,
  13711. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13712. ): void;
  13713. (
  13714. path: PathLikeTypes,
  13715. options: BufferEncodingOption,
  13716. callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void
  13717. ): void;
  13718. (
  13719. path: PathLikeTypes,
  13720. options: EncodingOption,
  13721. callback: (
  13722. err: null | NodeJS.ErrnoException,
  13723. result?: string | Buffer
  13724. ) => void
  13725. ): void;
  13726. (
  13727. path: PathLikeTypes,
  13728. callback: (err: null | NodeJS.ErrnoException, result?: string) => void
  13729. ): void;
  13730. }
  13731. type Records = KnownRecords &
  13732. Record<string, KnownRecords[]> &
  13733. Record<string, any>;
  13734. declare interface RecordsChunks {
  13735. byName?: Record<string, number>;
  13736. bySource?: Record<string, number>;
  13737. usedIds?: number[];
  13738. }
  13739. declare interface RecordsModules {
  13740. byIdentifier?: Record<string, number>;
  13741. usedIds?: number[];
  13742. }
  13743. type RecursiveArrayOrRecord<T> =
  13744. | { [index: string]: RecursiveArrayOrRecord<T> }
  13745. | RecursiveArrayOrRecord<T>[]
  13746. | T;
  13747. declare interface RecursiveNonNullable<T> {}
  13748. type ReferenceableItem = string | object;
  13749. declare interface ReferencedExport {
  13750. /**
  13751. * name of the referenced export
  13752. */
  13753. name: string[];
  13754. /**
  13755. * when false, referenced export can not be mangled, defaults to true
  13756. */
  13757. canMangle?: boolean;
  13758. }
  13759. type Remotes = (string | RemotesObject)[] | RemotesObject;
  13760. /**
  13761. * Advanced configuration for container locations from which modules should be resolved and loaded at runtime.
  13762. */
  13763. declare interface RemotesConfig {
  13764. /**
  13765. * Container locations from which modules should be resolved and loaded at runtime.
  13766. */
  13767. external: string | string[];
  13768. /**
  13769. * The name of the share scope shared with this remote.
  13770. */
  13771. shareScope?: string;
  13772. }
  13773. /**
  13774. * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
  13775. */
  13776. declare interface RemotesObject {
  13777. [index: string]: string | RemotesConfig | string[];
  13778. }
  13779. declare interface RenderBootstrapContext {
  13780. /**
  13781. * the chunk
  13782. */
  13783. chunk: Chunk;
  13784. /**
  13785. * results of code generation
  13786. */
  13787. codeGenerationResults: CodeGenerationResults;
  13788. /**
  13789. * the runtime template
  13790. */
  13791. runtimeTemplate: RuntimeTemplate;
  13792. /**
  13793. * the module graph
  13794. */
  13795. moduleGraph: ModuleGraph;
  13796. /**
  13797. * the chunk graph
  13798. */
  13799. chunkGraph: ChunkGraph;
  13800. /**
  13801. * hash to be used for render call
  13802. */
  13803. hash: string;
  13804. }
  13805. declare interface RenderContextCssModulesPlugin {
  13806. /**
  13807. * the chunk
  13808. */
  13809. chunk: Chunk;
  13810. /**
  13811. * the chunk graph
  13812. */
  13813. chunkGraph: ChunkGraph;
  13814. /**
  13815. * results of code generation
  13816. */
  13817. codeGenerationResults: CodeGenerationResults;
  13818. /**
  13819. * the runtime template
  13820. */
  13821. runtimeTemplate: RuntimeTemplate;
  13822. /**
  13823. * the unique name
  13824. */
  13825. uniqueName: string;
  13826. /**
  13827. * undo path to css file
  13828. */
  13829. undoPath: string;
  13830. /**
  13831. * modules
  13832. */
  13833. modules: CssModule[];
  13834. }
  13835. declare interface RenderContextJavascriptModulesPlugin {
  13836. /**
  13837. * the chunk
  13838. */
  13839. chunk: Chunk;
  13840. /**
  13841. * the dependency templates
  13842. */
  13843. dependencyTemplates: DependencyTemplates;
  13844. /**
  13845. * the runtime template
  13846. */
  13847. runtimeTemplate: RuntimeTemplate;
  13848. /**
  13849. * the module graph
  13850. */
  13851. moduleGraph: ModuleGraph;
  13852. /**
  13853. * the chunk graph
  13854. */
  13855. chunkGraph: ChunkGraph;
  13856. /**
  13857. * results of code generation
  13858. */
  13859. codeGenerationResults: CodeGenerationResults;
  13860. /**
  13861. * rendering in strict context
  13862. */
  13863. strictMode?: boolean;
  13864. }
  13865. type RenderManifestEntry =
  13866. | RenderManifestEntryTemplated
  13867. | RenderManifestEntryStatic;
  13868. declare interface RenderManifestEntryStatic {
  13869. render: () => Source;
  13870. filename: string;
  13871. info: AssetInfo;
  13872. identifier: string;
  13873. hash?: string;
  13874. auxiliary?: boolean;
  13875. }
  13876. declare interface RenderManifestEntryTemplated {
  13877. render: () => Source;
  13878. filenameTemplate: TemplatePath;
  13879. pathOptions?: PathData;
  13880. info?: AssetInfo;
  13881. identifier: string;
  13882. hash?: string;
  13883. auxiliary?: boolean;
  13884. }
  13885. declare interface RenderManifestOptions {
  13886. /**
  13887. * the chunk used to render
  13888. */
  13889. chunk: Chunk;
  13890. hash: string;
  13891. fullHash: string;
  13892. outputOptions: OutputNormalizedWithDefaults;
  13893. codeGenerationResults: CodeGenerationResults;
  13894. moduleTemplates: { javascript: ModuleTemplate };
  13895. dependencyTemplates: DependencyTemplates;
  13896. runtimeTemplate: RuntimeTemplate;
  13897. moduleGraph: ModuleGraph;
  13898. chunkGraph: ChunkGraph;
  13899. }
  13900. declare class ReplaceSource extends Source {
  13901. constructor(source: Source, name?: string);
  13902. getName(): undefined | string;
  13903. getReplacements(): Replacement[];
  13904. replace(start: number, end: number, newValue: string, name?: string): void;
  13905. insert(pos: number, newValue: string, name?: string): void;
  13906. original(): Source;
  13907. streamChunks(
  13908. options: StreamChunksOptions,
  13909. onChunk: (
  13910. chunk: undefined | string,
  13911. generatedLine: number,
  13912. generatedColumn: number,
  13913. sourceIndex: number,
  13914. originalLine: number,
  13915. originalColumn: number,
  13916. nameIndex: number
  13917. ) => void,
  13918. onSource: (
  13919. sourceIndex: number,
  13920. source: null | string,
  13921. sourceContent?: string
  13922. ) => void,
  13923. onName: (nameIndex: number, name: string) => void
  13924. ): GeneratedSourceInfo;
  13925. static Replacement: typeof Replacement;
  13926. }
  13927. declare class Replacement {
  13928. constructor(start: number, end: number, content: string, name?: string);
  13929. start: number;
  13930. end: number;
  13931. content: string;
  13932. name?: string;
  13933. index?: number;
  13934. }
  13935. declare interface RequestRecord {
  13936. [index: string]: string | string[];
  13937. }
  13938. declare abstract class RequestShortener {
  13939. contextify: (value: string) => string;
  13940. shorten(request?: null | string): undefined | null | string;
  13941. }
  13942. declare interface ResolveBuildDependenciesResult {
  13943. /**
  13944. * list of files
  13945. */
  13946. files: Set<string>;
  13947. /**
  13948. * list of directories
  13949. */
  13950. directories: Set<string>;
  13951. /**
  13952. * list of missing entries
  13953. */
  13954. missing: Set<string>;
  13955. /**
  13956. * stored resolve results
  13957. */
  13958. resolveResults: Map<string, undefined | string | false>;
  13959. /**
  13960. * dependencies of the resolving
  13961. */
  13962. resolveDependencies: ResolveDependencies;
  13963. }
  13964. declare interface ResolveContext {
  13965. /**
  13966. * directories that was found on file system
  13967. */
  13968. contextDependencies?: WriteOnlySet<string>;
  13969. /**
  13970. * files that was found on file system
  13971. */
  13972. fileDependencies?: WriteOnlySet<string>;
  13973. /**
  13974. * dependencies that was not found on file system
  13975. */
  13976. missingDependencies?: WriteOnlySet<string>;
  13977. /**
  13978. * set of hooks' calls. For instance, `resolve → parsedResolve → describedResolve`,
  13979. */
  13980. stack?: Set<string>;
  13981. /**
  13982. * log function
  13983. */
  13984. log?: (str: string) => void;
  13985. /**
  13986. * yield result, if provided plugins can return several results
  13987. */
  13988. yield?: (request: ResolveRequest) => void;
  13989. }
  13990. declare interface ResolveData {
  13991. contextInfo: ModuleFactoryCreateDataContextInfo;
  13992. resolveOptions?: ResolveOptions;
  13993. context: string;
  13994. request: string;
  13995. attributes?: ImportAttributes;
  13996. dependencies: ModuleDependency[];
  13997. dependencyType: string;
  13998. createData: Partial<NormalModuleCreateData & { settings: ModuleSettings }>;
  13999. fileDependencies: LazySet<string>;
  14000. missingDependencies: LazySet<string>;
  14001. contextDependencies: LazySet<string>;
  14002. ignoredModule?: Module;
  14003. /**
  14004. * allow to use the unsafe cache
  14005. */
  14006. cacheable: boolean;
  14007. }
  14008. declare interface ResolveDependencies {
  14009. /**
  14010. * list of files
  14011. */
  14012. files: Set<string>;
  14013. /**
  14014. * list of directories
  14015. */
  14016. directories: Set<string>;
  14017. /**
  14018. * list of missing entries
  14019. */
  14020. missing: Set<string>;
  14021. }
  14022. /**
  14023. * Options object for resolving requests.
  14024. */
  14025. declare interface ResolveOptions {
  14026. /**
  14027. * Redirect module requests.
  14028. */
  14029. alias?:
  14030. | {
  14031. /**
  14032. * New request.
  14033. */
  14034. alias: string | false | string[];
  14035. /**
  14036. * Request to be redirected.
  14037. */
  14038. name: string;
  14039. /**
  14040. * Redirect only exact matching request.
  14041. */
  14042. onlyModule?: boolean;
  14043. }[]
  14044. | { [index: string]: string | false | string[] };
  14045. /**
  14046. * Fields in the description file (usually package.json) which are used to redirect requests inside the module.
  14047. */
  14048. aliasFields?: (string | string[])[];
  14049. /**
  14050. * Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".
  14051. */
  14052. byDependency?: { [index: string]: ResolveOptions };
  14053. /**
  14054. * Enable caching of successfully resolved requests (cache entries are revalidated).
  14055. */
  14056. cache?: boolean;
  14057. /**
  14058. * Predicate function to decide which requests should be cached.
  14059. */
  14060. cachePredicate?: (request: ResolveRequest) => boolean;
  14061. /**
  14062. * Include the context information in the cache identifier when caching.
  14063. */
  14064. cacheWithContext?: boolean;
  14065. /**
  14066. * Condition names for exports field entry point.
  14067. */
  14068. conditionNames?: string[];
  14069. /**
  14070. * Filenames used to find a description file (like a package.json).
  14071. */
  14072. descriptionFiles?: string[];
  14073. /**
  14074. * Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).
  14075. */
  14076. enforceExtension?: boolean;
  14077. /**
  14078. * Field names from the description file (usually package.json) which are used to provide entry points of a package.
  14079. */
  14080. exportsFields?: string[];
  14081. /**
  14082. * An object which maps extension to extension aliases.
  14083. */
  14084. extensionAlias?: { [index: string]: string | string[] };
  14085. /**
  14086. * Extensions added to the request when trying to find the file.
  14087. */
  14088. extensions?: string[];
  14089. /**
  14090. * Redirect module requests when normal resolving fails.
  14091. */
  14092. fallback?:
  14093. | {
  14094. /**
  14095. * New request.
  14096. */
  14097. alias: string | false | string[];
  14098. /**
  14099. * Request to be redirected.
  14100. */
  14101. name: string;
  14102. /**
  14103. * Redirect only exact matching request.
  14104. */
  14105. onlyModule?: boolean;
  14106. }[]
  14107. | { [index: string]: string | false | string[] };
  14108. /**
  14109. * Filesystem for the resolver.
  14110. */
  14111. fileSystem?: InputFileSystem;
  14112. /**
  14113. * 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).
  14114. */
  14115. fullySpecified?: boolean;
  14116. /**
  14117. * 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).
  14118. */
  14119. importsFields?: string[];
  14120. /**
  14121. * Field names from the description file (package.json) which are used to find the default entry point.
  14122. */
  14123. mainFields?: (string | string[])[];
  14124. /**
  14125. * Filenames used to find the default entry point if there is no description file or main field.
  14126. */
  14127. mainFiles?: string[];
  14128. /**
  14129. * Folder names or directory paths where to find modules.
  14130. */
  14131. modules?: string[];
  14132. /**
  14133. * Plugins for the resolver.
  14134. */
  14135. plugins?: (
  14136. | undefined
  14137. | null
  14138. | false
  14139. | ""
  14140. | 0
  14141. | {
  14142. [index: string]: any;
  14143. /**
  14144. * The run point of the plugin, required method.
  14145. */
  14146. apply: (arg0: Resolver) => void;
  14147. }
  14148. | ((this: Resolver, arg1: Resolver) => void)
  14149. | "..."
  14150. )[];
  14151. /**
  14152. * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
  14153. */
  14154. preferAbsolute?: boolean;
  14155. /**
  14156. * Prefer to resolve module requests as relative request and fallback to resolving as module.
  14157. */
  14158. preferRelative?: boolean;
  14159. /**
  14160. * Custom resolver.
  14161. */
  14162. resolver?: Resolver;
  14163. /**
  14164. * 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.
  14165. */
  14166. restrictions?: (string | RegExp)[];
  14167. /**
  14168. * A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.
  14169. */
  14170. roots?: string[];
  14171. /**
  14172. * Enable resolving symlinks to the original location.
  14173. */
  14174. symlinks?: boolean;
  14175. /**
  14176. * Enable caching of successfully resolved requests (cache entries are not revalidated).
  14177. */
  14178. unsafeCache?: boolean | { [index: string]: any };
  14179. /**
  14180. * Use synchronous filesystem calls for the resolver.
  14181. */
  14182. useSyncFileSystemCalls?: boolean;
  14183. }
  14184. declare interface ResolveOptionsResolverFactoryObject1 {
  14185. /**
  14186. * alias
  14187. */
  14188. alias: AliasOption[];
  14189. /**
  14190. * fallback
  14191. */
  14192. fallback: AliasOption[];
  14193. /**
  14194. * alias fields
  14195. */
  14196. aliasFields: Set<string | string[]>;
  14197. /**
  14198. * extension alias
  14199. */
  14200. extensionAlias: ExtensionAliasOption[];
  14201. /**
  14202. * cache predicate
  14203. */
  14204. cachePredicate: (predicate: ResolveRequest) => boolean;
  14205. /**
  14206. * cache with context
  14207. */
  14208. cacheWithContext: boolean;
  14209. /**
  14210. * A list of exports field condition names.
  14211. */
  14212. conditionNames: Set<string>;
  14213. /**
  14214. * description files
  14215. */
  14216. descriptionFiles: string[];
  14217. /**
  14218. * enforce extension
  14219. */
  14220. enforceExtension: boolean;
  14221. /**
  14222. * exports fields
  14223. */
  14224. exportsFields: Set<string | string[]>;
  14225. /**
  14226. * imports fields
  14227. */
  14228. importsFields: Set<string | string[]>;
  14229. /**
  14230. * extensions
  14231. */
  14232. extensions: Set<string>;
  14233. /**
  14234. * fileSystem
  14235. */
  14236. fileSystem: FileSystem;
  14237. /**
  14238. * unsafe cache
  14239. */
  14240. unsafeCache: false | CacheTypes;
  14241. /**
  14242. * symlinks
  14243. */
  14244. symlinks: boolean;
  14245. /**
  14246. * resolver
  14247. */
  14248. resolver?: Resolver;
  14249. /**
  14250. * modules
  14251. */
  14252. modules: (string | string[])[];
  14253. /**
  14254. * main fields
  14255. */
  14256. mainFields: { name: string[]; forceRelative: boolean }[];
  14257. /**
  14258. * main files
  14259. */
  14260. mainFiles: Set<string>;
  14261. /**
  14262. * plugins
  14263. */
  14264. plugins: Plugin[];
  14265. /**
  14266. * pnp API
  14267. */
  14268. pnpApi: null | PnpApi;
  14269. /**
  14270. * roots
  14271. */
  14272. roots: Set<string>;
  14273. /**
  14274. * fully specified
  14275. */
  14276. fullySpecified: boolean;
  14277. /**
  14278. * resolve to context
  14279. */
  14280. resolveToContext: boolean;
  14281. /**
  14282. * restrictions
  14283. */
  14284. restrictions: Set<string | RegExp>;
  14285. /**
  14286. * prefer relative
  14287. */
  14288. preferRelative: boolean;
  14289. /**
  14290. * prefer absolute
  14291. */
  14292. preferAbsolute: boolean;
  14293. }
  14294. declare interface ResolveOptionsResolverFactoryObject2 {
  14295. /**
  14296. * A list of module alias configurations or an object which maps key to value
  14297. */
  14298. alias?: AliasOption[] | AliasOptions;
  14299. /**
  14300. * A list of module alias configurations or an object which maps key to value, applied only after modules option
  14301. */
  14302. fallback?: AliasOption[] | AliasOptions;
  14303. /**
  14304. * An object which maps extension to extension aliases
  14305. */
  14306. extensionAlias?: ExtensionAliasOptions;
  14307. /**
  14308. * A list of alias fields in description files
  14309. */
  14310. aliasFields?: (string | string[])[];
  14311. /**
  14312. * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties.
  14313. */
  14314. cachePredicate?: (predicate: ResolveRequest) => boolean;
  14315. /**
  14316. * Whether or not the unsafeCache should include request context as part of the cache key.
  14317. */
  14318. cacheWithContext?: boolean;
  14319. /**
  14320. * A list of description files to read from
  14321. */
  14322. descriptionFiles?: string[];
  14323. /**
  14324. * A list of exports field condition names.
  14325. */
  14326. conditionNames?: string[];
  14327. /**
  14328. * Enforce that a extension from extensions must be used
  14329. */
  14330. enforceExtension?: boolean;
  14331. /**
  14332. * A list of exports fields in description files
  14333. */
  14334. exportsFields?: (string | string[])[];
  14335. /**
  14336. * A list of imports fields in description files
  14337. */
  14338. importsFields?: (string | string[])[];
  14339. /**
  14340. * A list of extensions which should be tried for files
  14341. */
  14342. extensions?: string[];
  14343. /**
  14344. * The file system which should be used
  14345. */
  14346. fileSystem: FileSystem;
  14347. /**
  14348. * Use this cache object to unsafely cache the successful requests
  14349. */
  14350. unsafeCache?: boolean | CacheTypes;
  14351. /**
  14352. * Resolve symlinks to their symlinked location
  14353. */
  14354. symlinks?: boolean;
  14355. /**
  14356. * A prepared Resolver to which the plugins are attached
  14357. */
  14358. resolver?: Resolver;
  14359. /**
  14360. * A list of directories to resolve modules from, can be absolute path or folder name
  14361. */
  14362. modules?: string | string[];
  14363. /**
  14364. * A list of main fields in description files
  14365. */
  14366. mainFields?: (
  14367. | string
  14368. | string[]
  14369. | { name: string | string[]; forceRelative: boolean }
  14370. )[];
  14371. /**
  14372. * A list of main files in directories
  14373. */
  14374. mainFiles?: string[];
  14375. /**
  14376. * A list of additional resolve plugins which should be applied
  14377. */
  14378. plugins?: Plugin[];
  14379. /**
  14380. * A PnP API that should be used - null is "never", undefined is "auto"
  14381. */
  14382. pnpApi?: null | PnpApi;
  14383. /**
  14384. * A list of root paths
  14385. */
  14386. roots?: string[];
  14387. /**
  14388. * The request is already fully specified and no extensions or directories are resolved for it
  14389. */
  14390. fullySpecified?: boolean;
  14391. /**
  14392. * Resolve to a context instead of a file
  14393. */
  14394. resolveToContext?: boolean;
  14395. /**
  14396. * A list of resolve restrictions
  14397. */
  14398. restrictions?: (string | RegExp)[];
  14399. /**
  14400. * Use only the sync constraints of the file system calls
  14401. */
  14402. useSyncFileSystemCalls?: boolean;
  14403. /**
  14404. * Prefer to resolve module requests as relative requests before falling back to modules
  14405. */
  14406. preferRelative?: boolean;
  14407. /**
  14408. * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots
  14409. */
  14410. preferAbsolute?: boolean;
  14411. }
  14412. type ResolveOptionsWithDependencyType = ResolveOptions & {
  14413. dependencyType?: string;
  14414. resolveToContext?: boolean;
  14415. };
  14416. type ResolvePluginInstance =
  14417. | {
  14418. [index: string]: any;
  14419. /**
  14420. * The run point of the plugin, required method.
  14421. */
  14422. apply: (arg0: Resolver) => void;
  14423. }
  14424. | ((this: Resolver, arg1: Resolver) => void);
  14425. type ResolveRequest = BaseResolveRequest & Partial<ParsedIdentifier>;
  14426. declare interface ResolvedContextFileSystemInfoEntry {
  14427. safeTime: number;
  14428. timestampHash?: string;
  14429. }
  14430. declare interface ResolvedContextTimestampAndHash {
  14431. safeTime: number;
  14432. timestampHash?: string;
  14433. hash: string;
  14434. }
  14435. declare interface ResolvedOptions {
  14436. /**
  14437. * - platform target properties
  14438. */
  14439. platform: false | PlatformTargetProperties;
  14440. }
  14441. declare abstract class Resolver {
  14442. fileSystem: FileSystem;
  14443. options: ResolveOptionsResolverFactoryObject1;
  14444. hooks: KnownHooks;
  14445. ensureHook(
  14446. name:
  14447. | string
  14448. | AsyncSeriesBailHook<
  14449. [ResolveRequest, ResolveContext],
  14450. null | ResolveRequest
  14451. >
  14452. ): AsyncSeriesBailHook<
  14453. [ResolveRequest, ResolveContext],
  14454. null | ResolveRequest
  14455. >;
  14456. getHook(
  14457. name:
  14458. | string
  14459. | AsyncSeriesBailHook<
  14460. [ResolveRequest, ResolveContext],
  14461. null | ResolveRequest
  14462. >
  14463. ): AsyncSeriesBailHook<
  14464. [ResolveRequest, ResolveContext],
  14465. null | ResolveRequest
  14466. >;
  14467. resolveSync(context: object, path: string, request: string): string | false;
  14468. resolve(
  14469. context: object,
  14470. path: string,
  14471. request: string,
  14472. resolveContext: ResolveContext,
  14473. callback: (
  14474. err: null | ErrorWithDetail,
  14475. res?: string | false,
  14476. req?: ResolveRequest
  14477. ) => void
  14478. ): void;
  14479. doResolve(
  14480. hook: AsyncSeriesBailHook<
  14481. [ResolveRequest, ResolveContext],
  14482. null | ResolveRequest
  14483. >,
  14484. request: ResolveRequest,
  14485. message: null | string,
  14486. resolveContext: ResolveContext,
  14487. callback: (err?: null | Error, result?: ResolveRequest) => void
  14488. ): void;
  14489. parse(identifier: string): ParsedIdentifier;
  14490. isModule(path: string): boolean;
  14491. isPrivate(path: string): boolean;
  14492. isDirectory(path: string): boolean;
  14493. join(path: string, request: string): string;
  14494. normalize(path: string): string;
  14495. }
  14496. declare interface ResolverCache {
  14497. direct: WeakMap<ResolveOptionsWithDependencyType, ResolverWithOptions>;
  14498. stringified: Map<string, ResolverWithOptions>;
  14499. }
  14500. declare abstract class ResolverFactory {
  14501. hooks: Readonly<{
  14502. resolveOptions: HookMap<
  14503. SyncWaterfallHook<
  14504. [ResolveOptionsWithDependencyType],
  14505. ResolveOptionsWithDependencyType
  14506. >
  14507. >;
  14508. resolver: HookMap<
  14509. SyncHook<
  14510. [
  14511. Resolver,
  14512. ResolveOptionsResolverFactoryObject2,
  14513. ResolveOptionsWithDependencyType
  14514. ]
  14515. >
  14516. >;
  14517. }>;
  14518. cache: Map<string, ResolverCache>;
  14519. get(
  14520. type: string,
  14521. resolveOptions?: ResolveOptionsWithDependencyType
  14522. ): ResolverWithOptions;
  14523. }
  14524. type ResolverWithOptions = Resolver & WithOptions;
  14525. declare interface ResourceDataWithData {
  14526. resource: string;
  14527. path?: string;
  14528. query?: string;
  14529. fragment?: string;
  14530. context?: string;
  14531. data: ResourceSchemeData & Partial<ResolveRequest>;
  14532. }
  14533. declare interface ResourceSchemeData {
  14534. /**
  14535. * mime type of the resource
  14536. */
  14537. mimetype?: string;
  14538. /**
  14539. * additional parameters for the resource
  14540. */
  14541. parameters?: string;
  14542. /**
  14543. * encoding of the resource
  14544. */
  14545. encoding?: false | "base64";
  14546. /**
  14547. * encoded content of the resource
  14548. */
  14549. encodedContent?: string;
  14550. }
  14551. declare abstract class RestoreProvidedData {
  14552. exports: RestoreProvidedDataExports[];
  14553. otherProvided?: null | boolean;
  14554. otherCanMangleProvide?: boolean;
  14555. otherTerminalBinding: boolean;
  14556. serialize(__0: ObjectSerializerContext): void;
  14557. }
  14558. declare interface RestoreProvidedDataExports {
  14559. name: string;
  14560. provided?: null | boolean;
  14561. canMangleProvide?: boolean;
  14562. terminalBinding: boolean;
  14563. exportsInfo?: RestoreProvidedData;
  14564. }
  14565. declare interface RmDirOptions {
  14566. maxRetries?: number;
  14567. recursive?: boolean;
  14568. retryDelay?: number;
  14569. }
  14570. declare interface Rmdir {
  14571. (
  14572. file: PathLikeFs,
  14573. callback: (err: null | NodeJS.ErrnoException) => void
  14574. ): void;
  14575. (
  14576. file: PathLikeFs,
  14577. options: RmDirOptions,
  14578. callback: (err: null | NodeJS.ErrnoException) => void
  14579. ): void;
  14580. }
  14581. type Rule = string | RegExp | ((str: string) => boolean);
  14582. declare interface RuleSet {
  14583. /**
  14584. * map of references in the rule set (may grow over time)
  14585. */
  14586. references: Map<string, RuleSetLoaderOptions>;
  14587. /**
  14588. * execute the rule set
  14589. */
  14590. exec: (effectData: EffectData) => Effect[];
  14591. }
  14592. type RuleSetCondition =
  14593. | string
  14594. | RegExp
  14595. | ((value: string) => boolean)
  14596. | RuleSetLogicalConditions
  14597. | RuleSetCondition[];
  14598. type RuleSetConditionAbsolute =
  14599. | string
  14600. | RegExp
  14601. | ((value: string) => boolean)
  14602. | RuleSetLogicalConditionsAbsolute
  14603. | RuleSetConditionAbsolute[];
  14604. type RuleSetConditionOrConditions =
  14605. | string
  14606. | RegExp
  14607. | ((value: string) => boolean)
  14608. | RuleSetLogicalConditions
  14609. | RuleSetCondition[];
  14610. type RuleSetLoaderOptions = string | { [index: string]: any };
  14611. /**
  14612. * Logic operators used in a condition matcher.
  14613. */
  14614. declare interface RuleSetLogicalConditions {
  14615. /**
  14616. * Logical AND.
  14617. */
  14618. and?: RuleSetCondition[];
  14619. /**
  14620. * Logical NOT.
  14621. */
  14622. not?:
  14623. | string
  14624. | RegExp
  14625. | ((value: string) => boolean)
  14626. | RuleSetLogicalConditions
  14627. | RuleSetCondition[];
  14628. /**
  14629. * Logical OR.
  14630. */
  14631. or?: RuleSetCondition[];
  14632. }
  14633. /**
  14634. * Logic operators used in a condition matcher.
  14635. */
  14636. declare interface RuleSetLogicalConditionsAbsolute {
  14637. /**
  14638. * Logical AND.
  14639. */
  14640. and?: RuleSetConditionAbsolute[];
  14641. /**
  14642. * Logical NOT.
  14643. */
  14644. not?:
  14645. | string
  14646. | RegExp
  14647. | ((value: string) => boolean)
  14648. | RuleSetLogicalConditionsAbsolute
  14649. | RuleSetConditionAbsolute[];
  14650. /**
  14651. * Logical OR.
  14652. */
  14653. or?: RuleSetConditionAbsolute[];
  14654. }
  14655. /**
  14656. * A rule description with conditions and effects for modules.
  14657. */
  14658. declare interface RuleSetRule {
  14659. /**
  14660. * Match on import assertions of the dependency.
  14661. */
  14662. assert?: { [index: string]: RuleSetConditionOrConditions };
  14663. /**
  14664. * Match the child compiler name.
  14665. */
  14666. compiler?:
  14667. | string
  14668. | RegExp
  14669. | ((value: string) => boolean)
  14670. | RuleSetLogicalConditions
  14671. | RuleSetCondition[];
  14672. /**
  14673. * Match dependency type.
  14674. */
  14675. dependency?:
  14676. | string
  14677. | RegExp
  14678. | ((value: string) => boolean)
  14679. | RuleSetLogicalConditions
  14680. | RuleSetCondition[];
  14681. /**
  14682. * Match values of properties in the description file (usually package.json).
  14683. */
  14684. descriptionData?: { [index: string]: RuleSetConditionOrConditions };
  14685. /**
  14686. * Enforce this rule as pre or post step.
  14687. */
  14688. enforce?: "pre" | "post";
  14689. /**
  14690. * Shortcut for resource.exclude.
  14691. */
  14692. exclude?:
  14693. | string
  14694. | RegExp
  14695. | ((value: string) => boolean)
  14696. | RuleSetLogicalConditionsAbsolute
  14697. | RuleSetConditionAbsolute[];
  14698. /**
  14699. * Enable/Disable extracting source map.
  14700. */
  14701. extractSourceMap?: boolean;
  14702. /**
  14703. * The options for the module generator.
  14704. */
  14705. generator?: { [index: string]: any };
  14706. /**
  14707. * Shortcut for resource.include.
  14708. */
  14709. include?:
  14710. | string
  14711. | RegExp
  14712. | ((value: string) => boolean)
  14713. | RuleSetLogicalConditionsAbsolute
  14714. | RuleSetConditionAbsolute[];
  14715. /**
  14716. * Match the issuer of the module (The module pointing to this module).
  14717. */
  14718. issuer?:
  14719. | string
  14720. | RegExp
  14721. | ((value: string) => boolean)
  14722. | RuleSetLogicalConditionsAbsolute
  14723. | RuleSetConditionAbsolute[];
  14724. /**
  14725. * Match layer of the issuer of this module (The module pointing to this module).
  14726. */
  14727. issuerLayer?:
  14728. | string
  14729. | RegExp
  14730. | ((value: string) => boolean)
  14731. | RuleSetLogicalConditions
  14732. | RuleSetCondition[];
  14733. /**
  14734. * Specifies the layer in which the module should be placed in.
  14735. */
  14736. layer?: string;
  14737. /**
  14738. * Shortcut for use.loader.
  14739. */
  14740. loader?: string;
  14741. /**
  14742. * Match module mimetype when load from Data URI.
  14743. */
  14744. mimetype?:
  14745. | string
  14746. | RegExp
  14747. | ((value: string) => boolean)
  14748. | RuleSetLogicalConditions
  14749. | RuleSetCondition[];
  14750. /**
  14751. * Only execute the first matching rule in this array.
  14752. */
  14753. oneOf?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  14754. /**
  14755. * Shortcut for use.options.
  14756. */
  14757. options?: string | { [index: string]: any };
  14758. /**
  14759. * Options for parsing.
  14760. */
  14761. parser?: { [index: string]: any };
  14762. /**
  14763. * Match the real resource path of the module.
  14764. */
  14765. realResource?:
  14766. | string
  14767. | RegExp
  14768. | ((value: string) => boolean)
  14769. | RuleSetLogicalConditionsAbsolute
  14770. | RuleSetConditionAbsolute[];
  14771. /**
  14772. * Options for the resolver.
  14773. */
  14774. resolve?: ResolveOptions;
  14775. /**
  14776. * Match the resource path of the module.
  14777. */
  14778. resource?:
  14779. | string
  14780. | RegExp
  14781. | ((value: string) => boolean)
  14782. | RuleSetLogicalConditionsAbsolute
  14783. | RuleSetConditionAbsolute[];
  14784. /**
  14785. * Match the resource fragment of the module.
  14786. */
  14787. resourceFragment?:
  14788. | string
  14789. | RegExp
  14790. | ((value: string) => boolean)
  14791. | RuleSetLogicalConditions
  14792. | RuleSetCondition[];
  14793. /**
  14794. * Match the resource query of the module.
  14795. */
  14796. resourceQuery?:
  14797. | string
  14798. | RegExp
  14799. | ((value: string) => boolean)
  14800. | RuleSetLogicalConditions
  14801. | RuleSetCondition[];
  14802. /**
  14803. * Match and execute these rules when this rule is matched.
  14804. */
  14805. rules?: (undefined | null | false | "" | 0 | RuleSetRule)[];
  14806. /**
  14807. * Match module scheme.
  14808. */
  14809. scheme?:
  14810. | string
  14811. | RegExp
  14812. | ((value: string) => boolean)
  14813. | RuleSetLogicalConditions
  14814. | RuleSetCondition[];
  14815. /**
  14816. * Flags a module as with or without side effects.
  14817. */
  14818. sideEffects?: boolean;
  14819. /**
  14820. * Shortcut for resource.test.
  14821. */
  14822. test?:
  14823. | string
  14824. | RegExp
  14825. | ((value: string) => boolean)
  14826. | RuleSetLogicalConditionsAbsolute
  14827. | RuleSetConditionAbsolute[];
  14828. /**
  14829. * Module type to use for the module.
  14830. */
  14831. type?: string;
  14832. /**
  14833. * Modifiers applied to the module when rule is matched.
  14834. */
  14835. use?:
  14836. | string
  14837. | (
  14838. | undefined
  14839. | null
  14840. | string
  14841. | false
  14842. | 0
  14843. | RuleSetUseFunction
  14844. | {
  14845. /**
  14846. * Unique loader options identifier.
  14847. */
  14848. ident?: string;
  14849. /**
  14850. * Loader name.
  14851. */
  14852. loader?: string;
  14853. /**
  14854. * Loader options.
  14855. */
  14856. options?: string | { [index: string]: any };
  14857. }
  14858. )[]
  14859. | RuleSetUseFunction
  14860. | {
  14861. /**
  14862. * Unique loader options identifier.
  14863. */
  14864. ident?: string;
  14865. /**
  14866. * Loader name.
  14867. */
  14868. loader?: string;
  14869. /**
  14870. * Loader options.
  14871. */
  14872. options?: string | { [index: string]: any };
  14873. };
  14874. /**
  14875. * Match on import attributes of the dependency.
  14876. */
  14877. with?: { [index: string]: RuleSetConditionOrConditions };
  14878. }
  14879. type RuleSetUse =
  14880. | string
  14881. | (
  14882. | undefined
  14883. | null
  14884. | string
  14885. | false
  14886. | 0
  14887. | RuleSetUseFunction
  14888. | {
  14889. /**
  14890. * Unique loader options identifier.
  14891. */
  14892. ident?: string;
  14893. /**
  14894. * Loader name.
  14895. */
  14896. loader?: string;
  14897. /**
  14898. * Loader options.
  14899. */
  14900. options?: string | { [index: string]: any };
  14901. }
  14902. )[]
  14903. | RuleSetUseFunction
  14904. | {
  14905. /**
  14906. * Unique loader options identifier.
  14907. */
  14908. ident?: string;
  14909. /**
  14910. * Loader name.
  14911. */
  14912. loader?: string;
  14913. /**
  14914. * Loader options.
  14915. */
  14916. options?: string | { [index: string]: any };
  14917. };
  14918. type RuleSetUseFunction = (data: EffectData) =>
  14919. | string
  14920. | RuleSetUseFunction
  14921. | {
  14922. /**
  14923. * Unique loader options identifier.
  14924. */
  14925. ident?: string;
  14926. /**
  14927. * Loader name.
  14928. */
  14929. loader?: string;
  14930. /**
  14931. * Loader options.
  14932. */
  14933. options?: string | { [index: string]: any };
  14934. }
  14935. | (
  14936. | undefined
  14937. | null
  14938. | string
  14939. | false
  14940. | 0
  14941. | RuleSetUseFunction
  14942. | {
  14943. /**
  14944. * Unique loader options identifier.
  14945. */
  14946. ident?: string;
  14947. /**
  14948. * Loader name.
  14949. */
  14950. loader?: string;
  14951. /**
  14952. * Loader options.
  14953. */
  14954. options?: string | { [index: string]: any };
  14955. }
  14956. )[];
  14957. type RuleSetUseItem =
  14958. | string
  14959. | RuleSetUseFunction
  14960. | {
  14961. /**
  14962. * Unique loader options identifier.
  14963. */
  14964. ident?: string;
  14965. /**
  14966. * Loader name.
  14967. */
  14968. loader?: string;
  14969. /**
  14970. * Loader options.
  14971. */
  14972. options?: string | { [index: string]: any };
  14973. };
  14974. declare class RuntimeChunkPlugin {
  14975. constructor(options?: {
  14976. /**
  14977. * The name factory for the runtime chunks.
  14978. */
  14979. name?: (entrypoint: { name: string }) => string;
  14980. });
  14981. options: { name: (entrypoint: { name: string }) => string };
  14982. /**
  14983. * Apply the plugin
  14984. */
  14985. apply(compiler: Compiler): void;
  14986. }
  14987. type RuntimeCondition = undefined | string | boolean | SortableSet<string>;
  14988. type RuntimeId = string | number;
  14989. declare class RuntimeModule extends Module {
  14990. constructor(name: string, stage?: number);
  14991. name: string;
  14992. stage: number;
  14993. compilation?: Compilation;
  14994. chunk?: Chunk;
  14995. chunkGraph?: ChunkGraph;
  14996. fullHash: boolean;
  14997. dependentHash: boolean;
  14998. attach(compilation: Compilation, chunk: Chunk, chunkGraph?: ChunkGraph): void;
  14999. generate(): null | string;
  15000. getGeneratedCode(): null | string;
  15001. shouldIsolate(): boolean;
  15002. /**
  15003. * Runtime modules without any dependencies to other runtime modules
  15004. */
  15005. static STAGE_NORMAL: number;
  15006. /**
  15007. * Runtime modules with simple dependencies on other runtime modules
  15008. */
  15009. static STAGE_BASIC: number;
  15010. /**
  15011. * Runtime modules which attach to handlers of other runtime modules
  15012. */
  15013. static STAGE_ATTACH: number;
  15014. /**
  15015. * Runtime modules which trigger actions on bootstrap
  15016. */
  15017. static STAGE_TRIGGER: number;
  15018. }
  15019. declare interface RuntimeRequirementsContext {
  15020. /**
  15021. * the chunk graph
  15022. */
  15023. chunkGraph: ChunkGraph;
  15024. /**
  15025. * the code generation results
  15026. */
  15027. codeGenerationResults: CodeGenerationResults;
  15028. }
  15029. type RuntimeSpec = undefined | string | SortableSet<string>;
  15030. declare class RuntimeSpecMap<T, R = T> {
  15031. constructor(clone?: RuntimeSpecMap<T, R>);
  15032. get(runtime: RuntimeSpec): undefined | R;
  15033. has(runtime: RuntimeSpec): boolean;
  15034. set(runtime: RuntimeSpec, value: R): void;
  15035. provide(runtime: RuntimeSpec, computer: () => R): R;
  15036. delete(runtime: RuntimeSpec): void;
  15037. update(runtime: RuntimeSpec, fn: (value?: R) => R): void;
  15038. keys(): RuntimeSpec[];
  15039. values(): IterableIterator<R>;
  15040. get size(): number;
  15041. }
  15042. declare class RuntimeSpecSet {
  15043. constructor(iterable?: Iterable<RuntimeSpec>);
  15044. add(runtime: RuntimeSpec): void;
  15045. has(runtime: RuntimeSpec): boolean;
  15046. get size(): number;
  15047. [Symbol.iterator](): IterableIterator<RuntimeSpec>;
  15048. }
  15049. declare abstract class RuntimeTemplate {
  15050. compilation: Compilation;
  15051. outputOptions: OutputNormalizedWithDefaults;
  15052. requestShortener: RequestShortener;
  15053. globalObject: string;
  15054. contentHashReplacement: string;
  15055. isIIFE(): boolean;
  15056. isModule(): boolean;
  15057. isNeutralPlatform(): boolean;
  15058. supportsConst(): boolean;
  15059. supportsMethodShorthand(): boolean;
  15060. supportsArrowFunction(): boolean;
  15061. supportsAsyncFunction(): boolean;
  15062. supportsOptionalChaining(): boolean;
  15063. supportsForOf(): boolean;
  15064. supportsDestructuring(): boolean;
  15065. supportsBigIntLiteral(): boolean;
  15066. supportsDynamicImport(): boolean;
  15067. supportsEcmaScriptModuleSyntax(): boolean;
  15068. supportTemplateLiteral(): boolean;
  15069. supportNodePrefixForCoreModules(): boolean;
  15070. renderNodePrefixForCoreModule(mod: string): string;
  15071. renderConst(): "var" | "const";
  15072. returningFunction(returnValue: string, args?: string): string;
  15073. basicFunction(args: string, body: string | string[]): string;
  15074. concatenation(...args: (string | { expr: string })[]): string;
  15075. expressionFunction(expression: string, args?: string): string;
  15076. emptyFunction(): string;
  15077. destructureArray(items: string[], value: string): string;
  15078. destructureObject(items: string[], value: string): string;
  15079. iife(args: string, body: string): string;
  15080. forEach(variable: string, array: string, body: string | string[]): string;
  15081. /**
  15082. * Add a comment
  15083. */
  15084. comment(__0: {
  15085. /**
  15086. * request string used originally
  15087. */
  15088. request?: string;
  15089. /**
  15090. * name of the chunk referenced
  15091. */
  15092. chunkName?: null | string;
  15093. /**
  15094. * reason information of the chunk
  15095. */
  15096. chunkReason?: string;
  15097. /**
  15098. * additional message
  15099. */
  15100. message?: string;
  15101. /**
  15102. * name of the export
  15103. */
  15104. exportName?: string;
  15105. }): string;
  15106. throwMissingModuleErrorBlock(__0: {
  15107. /**
  15108. * request string used originally
  15109. */
  15110. request?: string;
  15111. }): string;
  15112. throwMissingModuleErrorFunction(__0: {
  15113. /**
  15114. * request string used originally
  15115. */
  15116. request?: string;
  15117. }): string;
  15118. missingModule(__0: {
  15119. /**
  15120. * request string used originally
  15121. */
  15122. request?: string;
  15123. }): string;
  15124. missingModuleStatement(__0: {
  15125. /**
  15126. * request string used originally
  15127. */
  15128. request?: string;
  15129. }): string;
  15130. missingModulePromise(__0: {
  15131. /**
  15132. * request string used originally
  15133. */
  15134. request?: string;
  15135. }): string;
  15136. weakError(__0: {
  15137. /**
  15138. * the chunk graph
  15139. */
  15140. chunkGraph: ChunkGraph;
  15141. /**
  15142. * the module
  15143. */
  15144. module: Module;
  15145. /**
  15146. * the request that should be printed as comment
  15147. */
  15148. request?: string;
  15149. /**
  15150. * expression to use as id expression
  15151. */
  15152. idExpr?: string;
  15153. /**
  15154. * which kind of code should be returned
  15155. */
  15156. type: "promise" | "expression" | "statements";
  15157. }): string;
  15158. moduleId(__0: {
  15159. /**
  15160. * the module
  15161. */
  15162. module: Module;
  15163. /**
  15164. * the chunk graph
  15165. */
  15166. chunkGraph: ChunkGraph;
  15167. /**
  15168. * the request that should be printed as comment
  15169. */
  15170. request?: string;
  15171. /**
  15172. * if the dependency is weak (will create a nice error message)
  15173. */
  15174. weak?: boolean;
  15175. }): string;
  15176. moduleRaw(__0: {
  15177. /**
  15178. * the module
  15179. */
  15180. module: null | Module;
  15181. /**
  15182. * the chunk graph
  15183. */
  15184. chunkGraph: ChunkGraph;
  15185. /**
  15186. * the request that should be printed as comment
  15187. */
  15188. request?: string;
  15189. /**
  15190. * if the dependency is weak (will create a nice error message)
  15191. */
  15192. weak?: boolean;
  15193. /**
  15194. * if set, will be filled with runtime requirements
  15195. */
  15196. runtimeRequirements: Set<string>;
  15197. }): string;
  15198. moduleExports(__0: {
  15199. /**
  15200. * the module
  15201. */
  15202. module: null | Module;
  15203. /**
  15204. * the chunk graph
  15205. */
  15206. chunkGraph: ChunkGraph;
  15207. /**
  15208. * the request that should be printed as comment
  15209. */
  15210. request: string;
  15211. /**
  15212. * if the dependency is weak (will create a nice error message)
  15213. */
  15214. weak?: boolean;
  15215. /**
  15216. * if set, will be filled with runtime requirements
  15217. */
  15218. runtimeRequirements: Set<string>;
  15219. }): string;
  15220. moduleNamespace(__0: {
  15221. /**
  15222. * the module
  15223. */
  15224. module: Module;
  15225. /**
  15226. * the chunk graph
  15227. */
  15228. chunkGraph: ChunkGraph;
  15229. /**
  15230. * the request that should be printed as comment
  15231. */
  15232. request: string;
  15233. /**
  15234. * if the current module is in strict esm mode
  15235. */
  15236. strict?: boolean;
  15237. /**
  15238. * if the dependency is weak (will create a nice error message)
  15239. */
  15240. weak?: boolean;
  15241. /**
  15242. * if set, will be filled with runtime requirements
  15243. */
  15244. runtimeRequirements: Set<string>;
  15245. }): string;
  15246. moduleNamespacePromise(__0: {
  15247. /**
  15248. * the chunk graph
  15249. */
  15250. chunkGraph: ChunkGraph;
  15251. /**
  15252. * the current dependencies block
  15253. */
  15254. block?: AsyncDependenciesBlock;
  15255. /**
  15256. * the module
  15257. */
  15258. module: Module;
  15259. /**
  15260. * the request that should be printed as comment
  15261. */
  15262. request: string;
  15263. /**
  15264. * a message for the comment
  15265. */
  15266. message: string;
  15267. /**
  15268. * if the current module is in strict esm mode
  15269. */
  15270. strict?: boolean;
  15271. /**
  15272. * if the dependency is weak (will create a nice error message)
  15273. */
  15274. weak?: boolean;
  15275. /**
  15276. * dependency
  15277. */
  15278. dependency: Dependency;
  15279. /**
  15280. * if set, will be filled with runtime requirements
  15281. */
  15282. runtimeRequirements: Set<string>;
  15283. }): string;
  15284. runtimeConditionExpression(__0: {
  15285. /**
  15286. * the chunk graph
  15287. */
  15288. chunkGraph: ChunkGraph;
  15289. /**
  15290. * runtime for which this code will be generated
  15291. */
  15292. runtime?: RuntimeSpec;
  15293. /**
  15294. * only execute the statement in some runtimes
  15295. */
  15296. runtimeCondition?: string | boolean | SortableSet<string>;
  15297. /**
  15298. * if set, will be filled with runtime requirements
  15299. */
  15300. runtimeRequirements: Set<string>;
  15301. }): string;
  15302. importStatement(__0: {
  15303. /**
  15304. * whether a new variable should be created or the existing one updated
  15305. */
  15306. update?: boolean;
  15307. /**
  15308. * the module
  15309. */
  15310. module: Module;
  15311. /**
  15312. * the module graph
  15313. */
  15314. moduleGraph: ModuleGraph;
  15315. /**
  15316. * the chunk graph
  15317. */
  15318. chunkGraph: ChunkGraph;
  15319. /**
  15320. * the request that should be printed as comment
  15321. */
  15322. request: string;
  15323. /**
  15324. * name of the import variable
  15325. */
  15326. importVar: string;
  15327. /**
  15328. * module in which the statement is emitted
  15329. */
  15330. originModule: Module;
  15331. /**
  15332. * true, if this is a weak dependency
  15333. */
  15334. weak?: boolean;
  15335. /**
  15336. * if set, will be filled with runtime requirements
  15337. */
  15338. runtimeRequirements: Set<string>;
  15339. /**
  15340. * module dependency
  15341. */
  15342. dependency: ModuleDependency;
  15343. }): [string, string];
  15344. exportFromImport<GenerateContext>(__0: {
  15345. /**
  15346. * the module graph
  15347. */
  15348. moduleGraph: ModuleGraph;
  15349. /**
  15350. * the chunk graph
  15351. */
  15352. chunkGraph: ChunkGraph;
  15353. /**
  15354. * the module
  15355. */
  15356. module: Module;
  15357. /**
  15358. * the request
  15359. */
  15360. request: string;
  15361. /**
  15362. * the export name
  15363. */
  15364. exportName: string | string[];
  15365. /**
  15366. * the origin module
  15367. */
  15368. originModule: Module;
  15369. /**
  15370. * true, if location is safe for ASI, a bracket can be emitted
  15371. */
  15372. asiSafe?: boolean;
  15373. /**
  15374. * true, if expression will be called
  15375. */
  15376. isCall: boolean;
  15377. /**
  15378. * when false, call context will not be preserved
  15379. */
  15380. callContext: null | boolean;
  15381. /**
  15382. * when true and accessing the default exports, interop code will be generated
  15383. */
  15384. defaultInterop: boolean;
  15385. /**
  15386. * the identifier name of the import variable
  15387. */
  15388. importVar: string;
  15389. /**
  15390. * init fragments will be added here
  15391. */
  15392. initFragments: InitFragment<GenerateContext>[];
  15393. /**
  15394. * runtime for which this code will be generated
  15395. */
  15396. runtime: RuntimeSpec;
  15397. /**
  15398. * if set, will be filled with runtime requirements
  15399. */
  15400. runtimeRequirements: Set<string>;
  15401. /**
  15402. * module dependency
  15403. */
  15404. dependency: ModuleDependency;
  15405. }): string;
  15406. blockPromise(__0: {
  15407. /**
  15408. * the async block
  15409. */
  15410. block?: AsyncDependenciesBlock;
  15411. /**
  15412. * the message
  15413. */
  15414. message: string;
  15415. /**
  15416. * the chunk graph
  15417. */
  15418. chunkGraph: ChunkGraph;
  15419. /**
  15420. * if set, will be filled with runtime requirements
  15421. */
  15422. runtimeRequirements: Set<string>;
  15423. }): string;
  15424. asyncModuleFactory(__0: {
  15425. /**
  15426. * the async block
  15427. */
  15428. block: AsyncDependenciesBlock;
  15429. /**
  15430. * the chunk graph
  15431. */
  15432. chunkGraph: ChunkGraph;
  15433. /**
  15434. * if set, will be filled with runtime requirements
  15435. */
  15436. runtimeRequirements: Set<string>;
  15437. /**
  15438. * request string used originally
  15439. */
  15440. request?: string;
  15441. }): string;
  15442. syncModuleFactory(__0: {
  15443. /**
  15444. * the dependency
  15445. */
  15446. dependency: Dependency;
  15447. /**
  15448. * the chunk graph
  15449. */
  15450. chunkGraph: ChunkGraph;
  15451. /**
  15452. * if set, will be filled with runtime requirements
  15453. */
  15454. runtimeRequirements: Set<string>;
  15455. /**
  15456. * request string used originally
  15457. */
  15458. request?: string;
  15459. }): string;
  15460. defineEsModuleFlagStatement(__0: {
  15461. /**
  15462. * the name of the exports object
  15463. */
  15464. exportsArgument: string;
  15465. /**
  15466. * if set, will be filled with runtime requirements
  15467. */
  15468. runtimeRequirements: Set<string>;
  15469. }): string;
  15470. }
  15471. declare abstract class RuntimeValue {
  15472. fn: (value: {
  15473. module: NormalModule;
  15474. key: string;
  15475. readonly version: ValueCacheVersion;
  15476. }) => CodeValuePrimitive;
  15477. options: true | RuntimeValueOptions;
  15478. get fileDependencies(): true | string[];
  15479. exec(
  15480. parser: JavascriptParser,
  15481. valueCacheVersions: Map<string, ValueCacheVersion>,
  15482. key: string
  15483. ): CodeValuePrimitive;
  15484. getCacheVersion(): undefined | string;
  15485. }
  15486. declare interface RuntimeValueOptions {
  15487. fileDependencies?: string[];
  15488. contextDependencies?: string[];
  15489. missingDependencies?: string[];
  15490. buildDependencies?: string[];
  15491. version?: string | (() => string);
  15492. }
  15493. /**
  15494. * Helper function for joining two ranges into a single range. This is useful
  15495. * when working with AST nodes, as it allows you to combine the ranges of child nodes
  15496. * to create the range of the _parent node_.
  15497. */
  15498. declare interface ScopeInfo {
  15499. definitions: StackedMap<string, VariableInfo | ScopeInfo>;
  15500. topLevelScope: boolean | "arrow";
  15501. inShorthand: string | boolean;
  15502. inTaggedTemplateTag: boolean;
  15503. inTry: boolean;
  15504. isStrict: boolean;
  15505. isAsmJs: boolean;
  15506. terminated?: 1 | 2;
  15507. }
  15508. declare interface Selector<A, B> {
  15509. (input: A): undefined | null | B;
  15510. }
  15511. declare abstract class Serializer<DeserializedValue, SerializedValue, Context> {
  15512. serializeMiddlewares: SerializerMiddleware<any, any, any>[];
  15513. deserializeMiddlewares: SerializerMiddleware<any, any, any>[];
  15514. context?: Context;
  15515. serialize<ExtendedContext>(
  15516. obj: DeserializedValue | Promise<DeserializedValue>,
  15517. context: Context & ExtendedContext
  15518. ): Promise<SerializedValue>;
  15519. deserialize<ExtendedContext>(
  15520. value: SerializedValue | Promise<SerializedValue>,
  15521. context: Context & ExtendedContext
  15522. ): Promise<DeserializedValue>;
  15523. }
  15524. declare abstract class SerializerMiddleware<
  15525. DeserializedType,
  15526. SerializedType,
  15527. Context
  15528. > {
  15529. serialize(
  15530. data: DeserializedType,
  15531. context: Context
  15532. ): null | SerializedType | Promise<SerializedType>;
  15533. deserialize(
  15534. data: SerializedType,
  15535. context: Context
  15536. ): DeserializedType | Promise<DeserializedType>;
  15537. }
  15538. type ServerLazyCompilationBackend =
  15539. | ServerImportHttp<typeof IncomingMessage>
  15540. | ServerImportHttps<typeof IncomingMessage>;
  15541. declare interface SetIterator<T> extends IteratorObject<T, undefined> {
  15542. [Symbol.iterator](): SetIterator<T>;
  15543. [Symbol.dispose](): void;
  15544. }
  15545. declare class SharePlugin {
  15546. constructor(options: SharePluginOptions);
  15547. /**
  15548. * Apply the plugin
  15549. */
  15550. apply(compiler: Compiler): void;
  15551. }
  15552. /**
  15553. * Options for shared modules.
  15554. */
  15555. declare interface SharePluginOptions {
  15556. /**
  15557. * Share scope name used for all shared modules (defaults to 'default').
  15558. */
  15559. shareScope?: string;
  15560. /**
  15561. * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
  15562. */
  15563. shared: Shared;
  15564. }
  15565. type Shared = (string | SharedObject)[] | SharedObject;
  15566. /**
  15567. * Advanced configuration for modules that should be shared in the share scope.
  15568. */
  15569. declare interface SharedConfig {
  15570. /**
  15571. * 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.
  15572. */
  15573. eager?: boolean;
  15574. /**
  15575. * 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.
  15576. */
  15577. import?: string | false;
  15578. /**
  15579. * Package name to determine required version from description file. This is only needed when package name can't be automatically determined from request.
  15580. */
  15581. packageName?: string;
  15582. /**
  15583. * Version requirement from module in share scope.
  15584. */
  15585. requiredVersion?: string | false;
  15586. /**
  15587. * Module is looked up under this key from the share scope.
  15588. */
  15589. shareKey?: string;
  15590. /**
  15591. * Share scope name.
  15592. */
  15593. shareScope?: string;
  15594. /**
  15595. * Allow only a single version of the shared module in share scope (disabled by default).
  15596. */
  15597. singleton?: boolean;
  15598. /**
  15599. * 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).
  15600. */
  15601. strictVersion?: boolean;
  15602. /**
  15603. * Version of the provided module. Will replace lower matching versions, but not higher.
  15604. */
  15605. version?: string | false;
  15606. }
  15607. /**
  15608. * 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.
  15609. */
  15610. declare interface SharedObject {
  15611. [index: string]: string | SharedConfig;
  15612. }
  15613. declare class SideEffectsFlagPlugin {
  15614. constructor(analyseSource?: boolean);
  15615. /**
  15616. * Apply the plugin
  15617. */
  15618. apply(compiler: Compiler): void;
  15619. static moduleHasSideEffects(
  15620. moduleName: string,
  15621. flagValue: SideEffectsFlagValue,
  15622. cache: Map<string, RegExp>
  15623. ): undefined | boolean;
  15624. }
  15625. type SideEffectsFlagValue = undefined | string | boolean | string[];
  15626. type SimpleType = "string" | "number" | "boolean";
  15627. declare class SizeOnlySource extends Source {
  15628. constructor(size: number);
  15629. }
  15630. declare abstract class Snapshot {
  15631. startTime?: number;
  15632. fileTimestamps?: Map<string, null | FileSystemInfoEntry>;
  15633. fileHashes?: Map<string, null | string>;
  15634. fileTshs?: Map<string, null | string | TimestampAndHash>;
  15635. contextTimestamps?: Map<string, null | ResolvedContextFileSystemInfoEntry>;
  15636. contextHashes?: Map<string, null | string>;
  15637. contextTshs?: Map<string, null | ResolvedContextTimestampAndHash>;
  15638. missingExistence?: Map<string, boolean>;
  15639. managedItemInfo?: Map<string, string>;
  15640. managedFiles?: Set<string>;
  15641. managedContexts?: Set<string>;
  15642. managedMissing?: Set<string>;
  15643. children?: Set<Snapshot>;
  15644. hasStartTime(): boolean;
  15645. setStartTime(value: number): void;
  15646. setMergedStartTime(value: undefined | number, snapshot: Snapshot): void;
  15647. hasFileTimestamps(): boolean;
  15648. setFileTimestamps(value: Map<string, null | FileSystemInfoEntry>): void;
  15649. hasFileHashes(): boolean;
  15650. setFileHashes(value: Map<string, null | string>): void;
  15651. hasFileTshs(): boolean;
  15652. setFileTshs(value: Map<string, null | string | TimestampAndHash>): void;
  15653. hasContextTimestamps(): boolean;
  15654. setContextTimestamps(
  15655. value: Map<string, null | ResolvedContextFileSystemInfoEntry>
  15656. ): void;
  15657. hasContextHashes(): boolean;
  15658. setContextHashes(value: Map<string, null | string>): void;
  15659. hasContextTshs(): boolean;
  15660. setContextTshs(
  15661. value: Map<string, null | ResolvedContextTimestampAndHash>
  15662. ): void;
  15663. hasMissingExistence(): boolean;
  15664. setMissingExistence(value: Map<string, boolean>): void;
  15665. hasManagedItemInfo(): boolean;
  15666. setManagedItemInfo(value: Map<string, string>): void;
  15667. hasManagedFiles(): boolean;
  15668. setManagedFiles(value: Set<string>): void;
  15669. hasManagedContexts(): boolean;
  15670. setManagedContexts(value: Set<string>): void;
  15671. hasManagedMissing(): boolean;
  15672. setManagedMissing(value: Set<string>): void;
  15673. hasChildren(): boolean;
  15674. setChildren(value: Set<Snapshot>): void;
  15675. addChild(child: Snapshot): void;
  15676. serialize(__0: ObjectSerializerContext): void;
  15677. deserialize(__0: ObjectDeserializerContext): void;
  15678. getFileIterable(): Iterable<string>;
  15679. getContextIterable(): Iterable<string>;
  15680. getMissingIterable(): Iterable<string>;
  15681. }
  15682. type SnapshotNormalizedWithDefaults = SnapshotOptionsWebpackOptions & {
  15683. managedPaths: (string | RegExp)[];
  15684. unmanagedPaths: (string | RegExp)[];
  15685. immutablePaths: (string | RegExp)[];
  15686. resolveBuildDependencies: {
  15687. /**
  15688. * Use hashes of the content of the files/directories to determine invalidation.
  15689. */
  15690. hash?: boolean;
  15691. /**
  15692. * Use timestamps of the files/directories to determine invalidation.
  15693. */
  15694. timestamp?: boolean;
  15695. };
  15696. buildDependencies: {
  15697. /**
  15698. * Use hashes of the content of the files/directories to determine invalidation.
  15699. */
  15700. hash?: boolean;
  15701. /**
  15702. * Use timestamps of the files/directories to determine invalidation.
  15703. */
  15704. timestamp?: boolean;
  15705. };
  15706. module: {
  15707. /**
  15708. * Use hashes of the content of the files/directories to determine invalidation.
  15709. */
  15710. hash?: boolean;
  15711. /**
  15712. * Use timestamps of the files/directories to determine invalidation.
  15713. */
  15714. timestamp?: boolean;
  15715. };
  15716. resolve: {
  15717. /**
  15718. * Use hashes of the content of the files/directories to determine invalidation.
  15719. */
  15720. hash?: boolean;
  15721. /**
  15722. * Use timestamps of the files/directories to determine invalidation.
  15723. */
  15724. timestamp?: boolean;
  15725. };
  15726. };
  15727. declare interface SnapshotOptionsFileSystemInfo {
  15728. /**
  15729. * should use hash to snapshot
  15730. */
  15731. hash?: boolean;
  15732. /**
  15733. * should use timestamp to snapshot
  15734. */
  15735. timestamp?: boolean;
  15736. }
  15737. /**
  15738. * Options affecting how file system snapshots are created and validated.
  15739. */
  15740. declare interface SnapshotOptionsWebpackOptions {
  15741. /**
  15742. * Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
  15743. */
  15744. buildDependencies?: {
  15745. /**
  15746. * Use hashes of the content of the files/directories to determine invalidation.
  15747. */
  15748. hash?: boolean;
  15749. /**
  15750. * Use timestamps of the files/directories to determine invalidation.
  15751. */
  15752. timestamp?: boolean;
  15753. };
  15754. /**
  15755. * Options for snapshotting the context module to determine if it needs to be built again.
  15756. */
  15757. contextModule?: {
  15758. /**
  15759. * Use hashes of the content of the files/directories to determine invalidation.
  15760. */
  15761. hash?: boolean;
  15762. /**
  15763. * Use timestamps of the files/directories to determine invalidation.
  15764. */
  15765. timestamp?: boolean;
  15766. };
  15767. /**
  15768. * List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
  15769. */
  15770. immutablePaths?: (string | RegExp)[];
  15771. /**
  15772. * List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
  15773. */
  15774. managedPaths?: (string | RegExp)[];
  15775. /**
  15776. * Options for snapshotting dependencies of modules to determine if they need to be built again.
  15777. */
  15778. module?: {
  15779. /**
  15780. * Use hashes of the content of the files/directories to determine invalidation.
  15781. */
  15782. hash?: boolean;
  15783. /**
  15784. * Use timestamps of the files/directories to determine invalidation.
  15785. */
  15786. timestamp?: boolean;
  15787. };
  15788. /**
  15789. * Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
  15790. */
  15791. resolve?: {
  15792. /**
  15793. * Use hashes of the content of the files/directories to determine invalidation.
  15794. */
  15795. hash?: boolean;
  15796. /**
  15797. * Use timestamps of the files/directories to determine invalidation.
  15798. */
  15799. timestamp?: boolean;
  15800. };
  15801. /**
  15802. * Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
  15803. */
  15804. resolveBuildDependencies?: {
  15805. /**
  15806. * Use hashes of the content of the files/directories to determine invalidation.
  15807. */
  15808. hash?: boolean;
  15809. /**
  15810. * Use timestamps of the files/directories to determine invalidation.
  15811. */
  15812. timestamp?: boolean;
  15813. };
  15814. /**
  15815. * List of paths that are not managed by a package manager and the contents are subject to change.
  15816. */
  15817. unmanagedPaths?: (string | RegExp)[];
  15818. }
  15819. declare interface SortFunction<T> {
  15820. (a: T, b: T): number;
  15821. }
  15822. declare abstract class SortableSet<T> extends Set<T> {
  15823. /**
  15824. * Sort with a comparer function
  15825. */
  15826. sortWith(sortFn?: SortFunction<T>): void;
  15827. sort(): SortableSet<T>;
  15828. /**
  15829. * Get data from cache
  15830. */
  15831. getFromCache<R extends unknown>(fn: (set: SortableSet<T>) => R): R;
  15832. /**
  15833. * Get data from cache (ignoring sorting)
  15834. */
  15835. getFromUnorderedCache<R>(fn: (set: SortableSet<T>) => R): R;
  15836. toJSON(): T[];
  15837. }
  15838. declare class Source {
  15839. constructor();
  15840. source(): SourceValue;
  15841. buffer(): Buffer;
  15842. size(): number;
  15843. map(options?: MapOptions): null | RawSourceMap;
  15844. sourceAndMap(options?: MapOptions): SourceAndMap;
  15845. updateHash(hash: HashLike): void;
  15846. }
  15847. declare interface SourceAndMap {
  15848. /**
  15849. * source
  15850. */
  15851. source: SourceValue;
  15852. /**
  15853. * map
  15854. */
  15855. map: null | RawSourceMap;
  15856. }
  15857. declare interface SourceLike {
  15858. /**
  15859. * source
  15860. */
  15861. source: () => SourceValue;
  15862. /**
  15863. * buffer
  15864. */
  15865. buffer?: () => Buffer;
  15866. /**
  15867. * size
  15868. */
  15869. size?: () => number;
  15870. /**
  15871. * map
  15872. */
  15873. map?: (options?: MapOptions) => null | RawSourceMap;
  15874. /**
  15875. * source and map
  15876. */
  15877. sourceAndMap?: (options?: MapOptions) => SourceAndMap;
  15878. /**
  15879. * hash updater
  15880. */
  15881. updateHash?: (hash: HashLike) => void;
  15882. }
  15883. declare class SourceMapDevToolPlugin {
  15884. constructor(options?: SourceMapDevToolPluginOptions);
  15885. sourceMapFilename: string | false;
  15886. sourceMappingURLComment:
  15887. | string
  15888. | false
  15889. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  15890. moduleFilenameTemplate:
  15891. | string
  15892. | ((context: ModuleFilenameTemplateContext) => string);
  15893. fallbackModuleFilenameTemplate:
  15894. | string
  15895. | ((context: ModuleFilenameTemplateContext) => string);
  15896. namespace: string;
  15897. options: SourceMapDevToolPluginOptions;
  15898. /**
  15899. * Apply the plugin
  15900. */
  15901. apply(compiler: Compiler): void;
  15902. }
  15903. declare interface SourceMapDevToolPluginOptions {
  15904. /**
  15905. * 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.
  15906. */
  15907. append?:
  15908. | null
  15909. | string
  15910. | false
  15911. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  15912. /**
  15913. * Indicates whether column mappings should be used (defaults to true).
  15914. */
  15915. columns?: boolean;
  15916. /**
  15917. * Emit debug IDs into source and SourceMap.
  15918. */
  15919. debugIds?: boolean;
  15920. /**
  15921. * Exclude modules that match the given value from source map generation.
  15922. */
  15923. exclude?: string | RegExp | Rule[] | ((str: string) => boolean);
  15924. /**
  15925. * 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.
  15926. */
  15927. fallbackModuleFilenameTemplate?:
  15928. | string
  15929. | ((context: ModuleFilenameTemplateContext) => string);
  15930. /**
  15931. * Path prefix to which the [file] placeholder is relative to.
  15932. */
  15933. fileContext?: string;
  15934. /**
  15935. * Defines the output filename of the SourceMap (will be inlined if no value is provided).
  15936. */
  15937. filename?: null | string | false;
  15938. /**
  15939. * Decide whether to ignore source files that match the specified value in the SourceMap.
  15940. */
  15941. ignoreList?: string | RegExp | Rule[] | ((str: string) => boolean);
  15942. /**
  15943. * Include source maps for module paths that match the given value.
  15944. */
  15945. include?: string | RegExp | Rule[] | ((str: string) => boolean);
  15946. /**
  15947. * Indicates whether SourceMaps from loaders should be used (defaults to true).
  15948. */
  15949. module?: boolean;
  15950. /**
  15951. * Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
  15952. */
  15953. moduleFilenameTemplate?:
  15954. | string
  15955. | ((context: ModuleFilenameTemplateContext) => string);
  15956. /**
  15957. * Namespace prefix to allow multiple webpack roots in the devtools.
  15958. */
  15959. namespace?: string;
  15960. /**
  15961. * Omit the 'sourceContents' array from the SourceMap.
  15962. */
  15963. noSources?: boolean;
  15964. /**
  15965. * Provide a custom public path for the SourceMapping comment.
  15966. */
  15967. publicPath?: string;
  15968. /**
  15969. * Provide a custom value for the 'sourceRoot' property in the SourceMap.
  15970. */
  15971. sourceRoot?: string;
  15972. /**
  15973. * Include source maps for modules based on their extension (defaults to .js and .css).
  15974. */
  15975. test?: string | RegExp | Rule[] | ((str: string) => boolean);
  15976. }
  15977. declare class SourceMapSource extends Source {
  15978. constructor(
  15979. value: string | Buffer,
  15980. name: string,
  15981. sourceMap?: string | Buffer | RawSourceMap,
  15982. originalSource?: string | Buffer,
  15983. innerSourceMap?: string | Buffer | RawSourceMap,
  15984. removeOriginalSource?: boolean
  15985. );
  15986. getArgsAsBuffers(): [
  15987. Buffer,
  15988. string,
  15989. Buffer,
  15990. undefined | Buffer,
  15991. undefined | Buffer,
  15992. undefined | boolean
  15993. ];
  15994. streamChunks(
  15995. options: StreamChunksOptions,
  15996. onChunk: (
  15997. chunk: undefined | string,
  15998. generatedLine: number,
  15999. generatedColumn: number,
  16000. sourceIndex: number,
  16001. originalLine: number,
  16002. originalColumn: number,
  16003. nameIndex: number
  16004. ) => void,
  16005. onSource: (
  16006. sourceIndex: number,
  16007. source: null | string,
  16008. sourceContent?: string
  16009. ) => void,
  16010. onName: (nameIndex: number, name: string) => void
  16011. ): GeneratedSourceInfo;
  16012. }
  16013. declare interface SourcePosition {
  16014. line: number;
  16015. column?: number;
  16016. }
  16017. type SourceValue = string | Buffer;
  16018. declare interface SplitChunksOptions {
  16019. chunksFilter: (chunk: Chunk) => undefined | boolean;
  16020. defaultSizeTypes: string[];
  16021. minSize: SplitChunksSizes;
  16022. minSizeReduction: SplitChunksSizes;
  16023. minRemainingSize: SplitChunksSizes;
  16024. enforceSizeThreshold: SplitChunksSizes;
  16025. maxInitialSize: SplitChunksSizes;
  16026. maxAsyncSize: SplitChunksSizes;
  16027. minChunks: number;
  16028. maxAsyncRequests: number;
  16029. maxInitialRequests: number;
  16030. hidePathInfo: boolean;
  16031. filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  16032. automaticNameDelimiter: string;
  16033. getCacheGroups: (
  16034. module: Module,
  16035. context: CacheGroupsContext
  16036. ) => null | CacheGroupSource[];
  16037. getName: (module: Module, chunks: Chunk[], key: string) => undefined | string;
  16038. usedExports: boolean;
  16039. fallbackCacheGroup: FallbackCacheGroup;
  16040. }
  16041. declare class SplitChunksPlugin {
  16042. constructor(options?: OptimizationSplitChunksOptions);
  16043. options: SplitChunksOptions;
  16044. /**
  16045. * Apply the plugin
  16046. */
  16047. apply(compiler: Compiler): void;
  16048. }
  16049. declare interface SplitChunksSizes {
  16050. [index: string]: number;
  16051. }
  16052. declare interface SplitData {
  16053. id?: string | number;
  16054. hash?: string;
  16055. modules: Module[];
  16056. size: number;
  16057. }
  16058. declare abstract class StackedMap<K, V> {
  16059. map: Map<K, InternalCell<V>>;
  16060. stack: Map<K, InternalCell<V>>[];
  16061. set(item: K, value: V): void;
  16062. delete(item: K): void;
  16063. has(item: K): boolean;
  16064. get(item: K): Cell<V>;
  16065. asArray(): K[];
  16066. asSet(): Set<K>;
  16067. asPairArray(): [K, Cell<V>][];
  16068. asMap(): Map<K, Cell<V>>;
  16069. get size(): number;
  16070. createChild(): StackedMap<K, V>;
  16071. }
  16072. declare interface StartupRenderContext {
  16073. /**
  16074. * the chunk
  16075. */
  16076. chunk: Chunk;
  16077. /**
  16078. * the dependency templates
  16079. */
  16080. dependencyTemplates: DependencyTemplates;
  16081. /**
  16082. * the runtime template
  16083. */
  16084. runtimeTemplate: RuntimeTemplate;
  16085. /**
  16086. * the module graph
  16087. */
  16088. moduleGraph: ModuleGraph;
  16089. /**
  16090. * the chunk graph
  16091. */
  16092. chunkGraph: ChunkGraph;
  16093. /**
  16094. * results of code generation
  16095. */
  16096. codeGenerationResults: CodeGenerationResults;
  16097. /**
  16098. * rendering in strict context
  16099. */
  16100. strictMode?: boolean;
  16101. /**
  16102. * inlined
  16103. */
  16104. inlined: boolean;
  16105. /**
  16106. * the inlined entry module is wrapped in an IIFE
  16107. */
  16108. inlinedInIIFE?: boolean;
  16109. }
  16110. declare interface StatFs {
  16111. (
  16112. path: PathLikeFs,
  16113. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16114. ): void;
  16115. (
  16116. path: PathLikeFs,
  16117. options: undefined | (StatOptions & { bigint?: false }),
  16118. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16119. ): void;
  16120. (
  16121. path: PathLikeFs,
  16122. options: StatOptions & { bigint: true },
  16123. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  16124. ): void;
  16125. (
  16126. path: PathLikeFs,
  16127. options: undefined | StatOptions,
  16128. callback: (
  16129. err: null | NodeJS.ErrnoException,
  16130. result?: IStats | IBigIntStats
  16131. ) => void
  16132. ): void;
  16133. }
  16134. declare interface StatOptions {
  16135. bigint?: boolean;
  16136. }
  16137. declare interface StatSync {
  16138. (path: PathLikeFs, options?: undefined): IStats;
  16139. (
  16140. path: PathLikeFs,
  16141. options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }
  16142. ): undefined | IStats;
  16143. (
  16144. path: PathLikeFs,
  16145. options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }
  16146. ): undefined | IBigIntStats;
  16147. (path: PathLikeFs, options?: StatSyncOptions & { bigint?: false }): IStats;
  16148. (path: PathLikeFs, options: StatSyncOptions & { bigint: true }): IBigIntStats;
  16149. (
  16150. path: PathLikeFs,
  16151. options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }
  16152. ): IStats | IBigIntStats;
  16153. (
  16154. path: PathLikeFs,
  16155. options?: StatSyncOptions
  16156. ): undefined | IStats | IBigIntStats;
  16157. }
  16158. declare interface StatSyncOptions {
  16159. bigint?: boolean;
  16160. throwIfNoEntry?: boolean;
  16161. }
  16162. declare interface StatTypes {
  16163. (
  16164. path: PathLikeTypes,
  16165. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16166. ): void;
  16167. (
  16168. path: PathLikeTypes,
  16169. options: undefined | (StatOptions & { bigint?: false }),
  16170. callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void
  16171. ): void;
  16172. (
  16173. path: PathLikeTypes,
  16174. options: StatOptions & { bigint: true },
  16175. callback: (err: null | NodeJS.ErrnoException, result?: IBigIntStats) => void
  16176. ): void;
  16177. (
  16178. path: PathLikeTypes,
  16179. options: undefined | StatOptions,
  16180. callback: (
  16181. err: null | NodeJS.ErrnoException,
  16182. result?: IStats | IBigIntStats
  16183. ) => void
  16184. ): void;
  16185. }
  16186. type Statement =
  16187. | FunctionDeclaration
  16188. | VariableDeclaration
  16189. | ClassDeclaration
  16190. | ExpressionStatement
  16191. | BlockStatement
  16192. | StaticBlock
  16193. | EmptyStatement
  16194. | DebuggerStatement
  16195. | WithStatement
  16196. | ReturnStatement
  16197. | LabeledStatement
  16198. | BreakStatement
  16199. | ContinueStatement
  16200. | IfStatement
  16201. | SwitchStatement
  16202. | ThrowStatement
  16203. | TryStatement
  16204. | WhileStatement
  16205. | DoWhileStatement
  16206. | ForStatement
  16207. | ForInStatement
  16208. | ForOfStatement;
  16209. type StatementPathItem =
  16210. | ImportDeclaration
  16211. | ExportNamedDeclaration
  16212. | ExportAllDeclaration
  16213. | ImportExpressionImport
  16214. | UnaryExpression
  16215. | ArrayExpression
  16216. | ArrowFunctionExpression
  16217. | AssignmentExpression
  16218. | AwaitExpression
  16219. | BinaryExpression
  16220. | SimpleCallExpression
  16221. | NewExpression
  16222. | ChainExpression
  16223. | ClassExpression
  16224. | ConditionalExpression
  16225. | FunctionExpression
  16226. | Identifier
  16227. | SimpleLiteral
  16228. | RegExpLiteral
  16229. | BigIntLiteral
  16230. | LogicalExpression
  16231. | MemberExpression
  16232. | MetaProperty
  16233. | ObjectExpression
  16234. | SequenceExpression
  16235. | TaggedTemplateExpression
  16236. | TemplateLiteral
  16237. | ThisExpression
  16238. | UpdateExpression
  16239. | YieldExpression
  16240. | FunctionDeclaration
  16241. | MaybeNamedFunctionDeclaration
  16242. | VariableDeclaration
  16243. | ClassDeclaration
  16244. | MaybeNamedClassDeclaration
  16245. | ExpressionStatement
  16246. | BlockStatement
  16247. | StaticBlock
  16248. | EmptyStatement
  16249. | DebuggerStatement
  16250. | WithStatement
  16251. | ReturnStatement
  16252. | LabeledStatement
  16253. | BreakStatement
  16254. | ContinueStatement
  16255. | IfStatement
  16256. | SwitchStatement
  16257. | ThrowStatement
  16258. | TryStatement
  16259. | WhileStatement
  16260. | DoWhileStatement
  16261. | ForStatement
  16262. | ForInStatement
  16263. | ForOfStatement
  16264. | ExportDefaultDeclaration;
  16265. declare class Stats {
  16266. constructor(compilation: Compilation);
  16267. compilation: Compilation;
  16268. get hash(): string;
  16269. get startTime(): number;
  16270. get endTime(): number;
  16271. hasWarnings(): boolean;
  16272. hasErrors(): boolean;
  16273. toJson(options?: string | boolean | StatsOptions): StatsCompilation;
  16274. toString(options?: string | boolean | StatsOptions): string;
  16275. }
  16276. type StatsAsset = KnownStatsAsset & Record<string, any>;
  16277. type StatsChunk = KnownStatsChunk & Record<string, any>;
  16278. type StatsChunkGroup = KnownStatsChunkGroup & Record<string, any>;
  16279. type StatsChunkOrigin = KnownStatsChunkOrigin & Record<string, any>;
  16280. type StatsCompilation = KnownStatsCompilation & Record<string, any>;
  16281. type StatsError = KnownStatsError & Record<string, any>;
  16282. declare abstract class StatsFactory {
  16283. hooks: StatsFactoryHooks;
  16284. create<FactoryData, FallbackCreatedObject>(
  16285. type: string,
  16286. data: FactoryData,
  16287. baseContext: Omit<StatsFactoryContext, "type">
  16288. ): CreatedObject<FactoryData, FallbackCreatedObject>;
  16289. }
  16290. type StatsFactoryContext = KnownStatsFactoryContext & Record<string, any>;
  16291. declare interface StatsFactoryHooks {
  16292. extract: HookMap<SyncBailHook<[any, any, StatsFactoryContext], void>>;
  16293. filter: HookMap<
  16294. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16295. >;
  16296. sort: HookMap<
  16297. SyncBailHook<
  16298. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  16299. void
  16300. >
  16301. >;
  16302. filterSorted: HookMap<
  16303. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16304. >;
  16305. groupResults: HookMap<
  16306. SyncBailHook<[GroupConfig<any, any>[], StatsFactoryContext], void>
  16307. >;
  16308. sortResults: HookMap<
  16309. SyncBailHook<
  16310. [((a?: any, b?: any) => 0 | 1 | -1)[], StatsFactoryContext],
  16311. void
  16312. >
  16313. >;
  16314. filterResults: HookMap<
  16315. SyncBailHook<[any, StatsFactoryContext, number, number], boolean | void>
  16316. >;
  16317. merge: HookMap<SyncBailHook<[any[], StatsFactoryContext], any>>;
  16318. result: HookMap<SyncBailHook<[any, StatsFactoryContext], any>>;
  16319. getItemName: HookMap<SyncBailHook<[any, StatsFactoryContext], string | void>>;
  16320. getItemFactory: HookMap<
  16321. SyncBailHook<[any, StatsFactoryContext], void | StatsFactory>
  16322. >;
  16323. }
  16324. type StatsLogging = KnownStatsLogging & Record<string, any>;
  16325. type StatsLoggingEntry = KnownStatsLoggingEntry & Record<string, any>;
  16326. type StatsModule = KnownStatsModule & Record<string, any>;
  16327. type StatsModuleIssuer = KnownStatsModuleIssuer & Record<string, any>;
  16328. type StatsModuleReason = KnownStatsModuleReason & Record<string, any>;
  16329. type StatsModuleTraceDependency = KnownStatsModuleTraceDependency &
  16330. Record<string, any>;
  16331. type StatsModuleTraceItem = KnownStatsModuleTraceItem & Record<string, any>;
  16332. /**
  16333. * Stats options object.
  16334. */
  16335. declare interface StatsOptions {
  16336. /**
  16337. * Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
  16338. */
  16339. all?: boolean;
  16340. /**
  16341. * Add assets information.
  16342. */
  16343. assets?: boolean;
  16344. /**
  16345. * Sort the assets by that field.
  16346. */
  16347. assetsSort?: string | false;
  16348. /**
  16349. * Space to display assets (groups will be collapsed to fit this space).
  16350. */
  16351. assetsSpace?: number;
  16352. /**
  16353. * Add built at time information.
  16354. */
  16355. builtAt?: boolean;
  16356. /**
  16357. * Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
  16358. */
  16359. cached?: boolean;
  16360. /**
  16361. * Show cached assets (setting this to `false` only shows emitted files).
  16362. */
  16363. cachedAssets?: boolean;
  16364. /**
  16365. * Add information about cached (not built) modules.
  16366. */
  16367. cachedModules?: boolean;
  16368. /**
  16369. * Add children information.
  16370. */
  16371. children?:
  16372. | boolean
  16373. | StatsOptions
  16374. | "none"
  16375. | "summary"
  16376. | "errors-only"
  16377. | "errors-warnings"
  16378. | "minimal"
  16379. | "normal"
  16380. | "detailed"
  16381. | "verbose"
  16382. | StatsValue[];
  16383. /**
  16384. * Display auxiliary assets in chunk groups.
  16385. */
  16386. chunkGroupAuxiliary?: boolean;
  16387. /**
  16388. * Display children of chunk groups.
  16389. */
  16390. chunkGroupChildren?: boolean;
  16391. /**
  16392. * Limit of assets displayed in chunk groups.
  16393. */
  16394. chunkGroupMaxAssets?: number;
  16395. /**
  16396. * Display all chunk groups with the corresponding bundles.
  16397. */
  16398. chunkGroups?: boolean;
  16399. /**
  16400. * Add built modules information to chunk information.
  16401. */
  16402. chunkModules?: boolean;
  16403. /**
  16404. * Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
  16405. */
  16406. chunkModulesSpace?: number;
  16407. /**
  16408. * Add the origins of chunks and chunk merging info.
  16409. */
  16410. chunkOrigins?: boolean;
  16411. /**
  16412. * Add information about parent, children and sibling chunks to chunk information.
  16413. */
  16414. chunkRelations?: boolean;
  16415. /**
  16416. * Add chunk information.
  16417. */
  16418. chunks?: boolean;
  16419. /**
  16420. * Sort the chunks by that field.
  16421. */
  16422. chunksSort?: string | false;
  16423. /**
  16424. * Enables/Disables colorful output.
  16425. */
  16426. colors?:
  16427. | boolean
  16428. | {
  16429. /**
  16430. * Custom color for bold text.
  16431. */
  16432. bold?: string;
  16433. /**
  16434. * Custom color for cyan text.
  16435. */
  16436. cyan?: string;
  16437. /**
  16438. * Custom color for green text.
  16439. */
  16440. green?: string;
  16441. /**
  16442. * Custom color for magenta text.
  16443. */
  16444. magenta?: string;
  16445. /**
  16446. * Custom color for red text.
  16447. */
  16448. red?: string;
  16449. /**
  16450. * Custom color for yellow text.
  16451. */
  16452. yellow?: string;
  16453. };
  16454. /**
  16455. * Context directory for request shortening.
  16456. */
  16457. context?: string;
  16458. /**
  16459. * Show chunk modules that are dependencies of other modules of the chunk.
  16460. */
  16461. dependentModules?: boolean;
  16462. /**
  16463. * Add module depth in module graph.
  16464. */
  16465. depth?: boolean;
  16466. /**
  16467. * Display the entry points with the corresponding bundles.
  16468. */
  16469. entrypoints?: boolean | "auto";
  16470. /**
  16471. * Add --env information.
  16472. */
  16473. env?: boolean;
  16474. /**
  16475. * Add cause to errors.
  16476. */
  16477. errorCause?: boolean | "auto";
  16478. /**
  16479. * Add details to errors (like resolving log).
  16480. */
  16481. errorDetails?: boolean | "auto";
  16482. /**
  16483. * Add nested errors to errors (like in AggregateError).
  16484. */
  16485. errorErrors?: boolean | "auto";
  16486. /**
  16487. * Add internal stack trace to errors.
  16488. */
  16489. errorStack?: boolean;
  16490. /**
  16491. * Add errors.
  16492. */
  16493. errors?: boolean;
  16494. /**
  16495. * Add errors count.
  16496. */
  16497. errorsCount?: boolean;
  16498. /**
  16499. * Space to display errors (value is in number of lines).
  16500. */
  16501. errorsSpace?: number;
  16502. /**
  16503. * Please use excludeModules instead.
  16504. */
  16505. exclude?:
  16506. | string
  16507. | boolean
  16508. | RegExp
  16509. | ModuleFilterItemTypes[]
  16510. | ((
  16511. name: string,
  16512. module: StatsModule,
  16513. type: "module" | "chunk" | "root-of-chunk" | "nested"
  16514. ) => boolean);
  16515. /**
  16516. * Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
  16517. */
  16518. excludeAssets?:
  16519. | string
  16520. | RegExp
  16521. | AssetFilterItemTypes[]
  16522. | ((name: string, asset: StatsAsset) => boolean);
  16523. /**
  16524. * Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
  16525. */
  16526. excludeModules?:
  16527. | string
  16528. | boolean
  16529. | RegExp
  16530. | ModuleFilterItemTypes[]
  16531. | ((
  16532. name: string,
  16533. module: StatsModule,
  16534. type: "module" | "chunk" | "root-of-chunk" | "nested"
  16535. ) => boolean);
  16536. /**
  16537. * Group assets by how their are related to chunks.
  16538. */
  16539. groupAssetsByChunk?: boolean;
  16540. /**
  16541. * Group assets by their status (emitted, compared for emit or cached).
  16542. */
  16543. groupAssetsByEmitStatus?: boolean;
  16544. /**
  16545. * Group assets by their extension.
  16546. */
  16547. groupAssetsByExtension?: boolean;
  16548. /**
  16549. * Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
  16550. */
  16551. groupAssetsByInfo?: boolean;
  16552. /**
  16553. * Group assets by their path.
  16554. */
  16555. groupAssetsByPath?: boolean;
  16556. /**
  16557. * Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
  16558. */
  16559. groupModulesByAttributes?: boolean;
  16560. /**
  16561. * Group modules by their status (cached or built and cacheable).
  16562. */
  16563. groupModulesByCacheStatus?: boolean;
  16564. /**
  16565. * Group modules by their extension.
  16566. */
  16567. groupModulesByExtension?: boolean;
  16568. /**
  16569. * Group modules by their layer.
  16570. */
  16571. groupModulesByLayer?: boolean;
  16572. /**
  16573. * Group modules by their path.
  16574. */
  16575. groupModulesByPath?: boolean;
  16576. /**
  16577. * Group modules by their type.
  16578. */
  16579. groupModulesByType?: boolean;
  16580. /**
  16581. * Group reasons by their origin module.
  16582. */
  16583. groupReasonsByOrigin?: boolean;
  16584. /**
  16585. * Add the hash of the compilation.
  16586. */
  16587. hash?: boolean;
  16588. /**
  16589. * Add ids.
  16590. */
  16591. ids?: boolean;
  16592. /**
  16593. * Add logging output.
  16594. */
  16595. logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
  16596. /**
  16597. * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
  16598. */
  16599. loggingDebug?:
  16600. | string
  16601. | boolean
  16602. | RegExp
  16603. | FilterItemTypes[]
  16604. | ((value: string) => boolean);
  16605. /**
  16606. * Add stack traces to logging output.
  16607. */
  16608. loggingTrace?: boolean;
  16609. /**
  16610. * Add information about assets inside modules.
  16611. */
  16612. moduleAssets?: boolean;
  16613. /**
  16614. * Add dependencies and origin of warnings/errors.
  16615. */
  16616. moduleTrace?: boolean;
  16617. /**
  16618. * Add built modules information.
  16619. */
  16620. modules?: boolean;
  16621. /**
  16622. * Sort the modules by that field.
  16623. */
  16624. modulesSort?: string | false;
  16625. /**
  16626. * Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
  16627. */
  16628. modulesSpace?: number;
  16629. /**
  16630. * Add information about modules nested in other modules (like with module concatenation).
  16631. */
  16632. nestedModules?: boolean;
  16633. /**
  16634. * Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
  16635. */
  16636. nestedModulesSpace?: number;
  16637. /**
  16638. * Show reasons why optimization bailed out for modules.
  16639. */
  16640. optimizationBailout?: boolean;
  16641. /**
  16642. * Add information about orphan modules.
  16643. */
  16644. orphanModules?: boolean;
  16645. /**
  16646. * Add output path information.
  16647. */
  16648. outputPath?: boolean;
  16649. /**
  16650. * Add performance hint flags.
  16651. */
  16652. performance?: boolean;
  16653. /**
  16654. * Preset for the default values.
  16655. */
  16656. preset?: string | boolean;
  16657. /**
  16658. * Show exports provided by modules.
  16659. */
  16660. providedExports?: boolean;
  16661. /**
  16662. * Add public path information.
  16663. */
  16664. publicPath?: boolean;
  16665. /**
  16666. * Add information about the reasons why modules are included.
  16667. */
  16668. reasons?: boolean;
  16669. /**
  16670. * Space to display reasons (groups will be collapsed to fit this space).
  16671. */
  16672. reasonsSpace?: number;
  16673. /**
  16674. * Add information about assets that are related to other assets (like SourceMaps for assets).
  16675. */
  16676. relatedAssets?: boolean;
  16677. /**
  16678. * Add information about runtime modules (deprecated: use 'runtimeModules' instead).
  16679. */
  16680. runtime?: boolean;
  16681. /**
  16682. * Add information about runtime modules.
  16683. */
  16684. runtimeModules?: boolean;
  16685. /**
  16686. * Add the source code of modules.
  16687. */
  16688. source?: boolean;
  16689. /**
  16690. * Add timing information.
  16691. */
  16692. timings?: boolean;
  16693. /**
  16694. * Show exports used by modules.
  16695. */
  16696. usedExports?: boolean;
  16697. /**
  16698. * Add webpack version information.
  16699. */
  16700. version?: boolean;
  16701. /**
  16702. * Add warnings.
  16703. */
  16704. warnings?: boolean;
  16705. /**
  16706. * Add warnings count.
  16707. */
  16708. warningsCount?: boolean;
  16709. /**
  16710. * Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
  16711. */
  16712. warningsFilter?:
  16713. | string
  16714. | RegExp
  16715. | WarningFilterItemTypes[]
  16716. | ((warning: StatsError, warningString: string) => boolean);
  16717. /**
  16718. * Space to display warnings (value is in number of lines).
  16719. */
  16720. warningsSpace?: number;
  16721. }
  16722. declare interface StatsPrintHooks {
  16723. sortElements: HookMap<SyncBailHook<[string[], StatsPrinterContext], void>>;
  16724. printElements: HookMap<
  16725. SyncBailHook<
  16726. [PrintedElement[], StatsPrinterContext],
  16727. undefined | string | void
  16728. >
  16729. >;
  16730. sortItems: HookMap<
  16731. SyncBailHook<[any[], StatsPrinterContext], boolean | void>
  16732. >;
  16733. getItemName: HookMap<SyncBailHook<[any, StatsPrinterContext], string | void>>;
  16734. printItems: HookMap<
  16735. SyncBailHook<[string[], StatsPrinterContext], undefined | string>
  16736. >;
  16737. print: HookMap<
  16738. SyncBailHook<[any, StatsPrinterContext], undefined | string | void>
  16739. >;
  16740. result: HookMap<SyncWaterfallHook<[string, StatsPrinterContext], string>>;
  16741. }
  16742. declare abstract class StatsPrinter {
  16743. hooks: StatsPrintHooks;
  16744. print(
  16745. type: string,
  16746. object?: any,
  16747. baseContext?: StatsPrinterContext
  16748. ): undefined | string;
  16749. }
  16750. type StatsPrinterContext = KnownStatsPrinterColorFunctions &
  16751. KnownStatsPrinterFormatters &
  16752. KnownStatsPrinterContext &
  16753. Record<string, any>;
  16754. type StatsProfile = KnownStatsProfile & Record<string, any>;
  16755. type StatsValue =
  16756. | boolean
  16757. | StatsOptions
  16758. | "none"
  16759. | "summary"
  16760. | "errors-only"
  16761. | "errors-warnings"
  16762. | "minimal"
  16763. | "normal"
  16764. | "detailed"
  16765. | "verbose";
  16766. declare interface StreamChunksOptions {
  16767. source?: boolean;
  16768. finalSource?: boolean;
  16769. columns?: boolean;
  16770. }
  16771. declare interface StreamOptions {
  16772. flags?: string;
  16773. encoding?:
  16774. | "ascii"
  16775. | "utf8"
  16776. | "utf-8"
  16777. | "utf16le"
  16778. | "utf-16le"
  16779. | "ucs2"
  16780. | "ucs-2"
  16781. | "base64"
  16782. | "base64url"
  16783. | "latin1"
  16784. | "binary"
  16785. | "hex";
  16786. fd?: any;
  16787. mode?: number;
  16788. autoClose?: boolean;
  16789. emitClose?: boolean;
  16790. start?: number;
  16791. signal?: null | AbortSignal;
  16792. }
  16793. type Supports = undefined | string;
  16794. declare class SyncModuleIdsPlugin {
  16795. constructor(__0: SyncModuleIdsPluginOptions);
  16796. /**
  16797. * Apply the plugin
  16798. */
  16799. apply(compiler: Compiler): void;
  16800. }
  16801. declare interface SyncModuleIdsPluginOptions {
  16802. /**
  16803. * path to file
  16804. */
  16805. path: string;
  16806. /**
  16807. * context for module names
  16808. */
  16809. context?: string;
  16810. /**
  16811. * selector for modules
  16812. */
  16813. test?: (module: Module) => boolean;
  16814. /**
  16815. * operation mode (defaults to merge)
  16816. */
  16817. mode?: "read" | "create" | "merge" | "update";
  16818. }
  16819. declare interface SyntheticDependencyLocation {
  16820. name: string;
  16821. index?: number;
  16822. }
  16823. declare const TOMBSTONE: unique symbol;
  16824. declare const TRANSITIVE: unique symbol;
  16825. declare const TRANSITIVE_ONLY: unique symbol;
  16826. declare interface TagInfo {
  16827. tag: symbol;
  16828. data?:
  16829. | Record<string, any>
  16830. | TopLevelSymbol
  16831. | HarmonySettings
  16832. | ImportSettings
  16833. | CommonJsImportSettings
  16834. | CompatibilitySettings;
  16835. next?: TagInfo;
  16836. }
  16837. declare interface TargetItemWithConnection {
  16838. module: Module;
  16839. connection: ModuleGraphConnection;
  16840. export?: string[];
  16841. }
  16842. declare interface TargetItemWithoutConnection {
  16843. module: Module;
  16844. export: string[];
  16845. deferred: boolean;
  16846. }
  16847. declare class Template {
  16848. constructor();
  16849. static getFunctionContent<T extends Function>(fn: T): string;
  16850. static toIdentifier(str: string): string;
  16851. static toComment(str: string): string;
  16852. static toNormalComment(str: string): string;
  16853. static toPath(str: string): string;
  16854. static numberToIdentifier(n: number): string;
  16855. static numberToIdentifierContinuation(n: number): string;
  16856. static indent(s: string | string[]): string;
  16857. static prefix(s: string | string[], prefix: string): string;
  16858. static asString(str: string | string[]): string;
  16859. static getModulesArrayBounds(modules: WithId[]): false | [number, number];
  16860. static renderChunkModules(
  16861. renderContext: ChunkRenderContextJavascriptModulesPlugin,
  16862. modules: Module[],
  16863. renderModule: (module: Module, renderInArray?: boolean) => null | Source,
  16864. prefix?: string
  16865. ): null | Source;
  16866. static renderRuntimeModules(
  16867. runtimeModules: RuntimeModule[],
  16868. renderContext: RenderContextJavascriptModulesPlugin & {
  16869. codeGenerationResults?: CodeGenerationResults;
  16870. }
  16871. ): Source;
  16872. static renderChunkRuntimeModules(
  16873. runtimeModules: RuntimeModule[],
  16874. renderContext: RenderContextJavascriptModulesPlugin
  16875. ): Source;
  16876. static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
  16877. static NUMBER_OF_IDENTIFIER_START_CHARS: number;
  16878. }
  16879. type TemplatePath =
  16880. | string
  16881. | ((pathData: PathData, assetInfo?: AssetInfo) => string);
  16882. declare interface TimestampAndHash {
  16883. safeTime: number;
  16884. timestamp?: number;
  16885. hash: string;
  16886. }
  16887. declare class TopLevelSymbol {
  16888. constructor(name: string);
  16889. name: string;
  16890. }
  16891. /**
  16892. * Use a Trusted Types policy to create urls for chunks.
  16893. */
  16894. declare interface TrustedTypes {
  16895. /**
  16896. * 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'.
  16897. */
  16898. onPolicyCreationFailure?: "continue" | "stop";
  16899. /**
  16900. * The name of the Trusted Types policy created by webpack to serve bundle chunks.
  16901. */
  16902. policyName?: string;
  16903. }
  16904. declare const UNDEFINED_MARKER: unique symbol;
  16905. declare interface URL_url extends URL {}
  16906. type UnsafeCacheData = KnownUnsafeCacheData & Record<string, any>;
  16907. declare interface UpdateHashContextDependency {
  16908. chunkGraph: ChunkGraph;
  16909. runtime: RuntimeSpec;
  16910. runtimeTemplate?: RuntimeTemplate;
  16911. }
  16912. declare interface UpdateHashContextGenerator {
  16913. /**
  16914. * the module
  16915. */
  16916. module: NormalModule;
  16917. chunkGraph: ChunkGraph;
  16918. runtime: RuntimeSpec;
  16919. runtimeTemplate?: RuntimeTemplate;
  16920. }
  16921. type Usage = string | true | TopLevelSymbol;
  16922. type UsageStateType = 0 | 1 | 2 | 3 | 4;
  16923. type UsedName = string | false | string[];
  16924. type Value = string | number | boolean | RegExp;
  16925. type ValueCacheVersion = string | Set<string>;
  16926. declare interface Values {
  16927. [index: string]: Value[];
  16928. }
  16929. declare class VariableInfo {
  16930. constructor(
  16931. declaredScope: ScopeInfo,
  16932. name: undefined | string,
  16933. flags: VariableInfoFlagsType,
  16934. tagInfo?: TagInfo
  16935. );
  16936. declaredScope: ScopeInfo;
  16937. name?: string;
  16938. flags: VariableInfoFlagsType;
  16939. tagInfo?: TagInfo;
  16940. isFree(): boolean;
  16941. isTagged(): boolean;
  16942. }
  16943. type VariableInfoFlagsType = 0 | 1 | 2 | 4;
  16944. declare interface VirtualModuleConfig {
  16945. /**
  16946. * the module type
  16947. */
  16948. type?: string;
  16949. /**
  16950. * the source function
  16951. */
  16952. source: (
  16953. loaderContext: LoaderContextVirtualUrlPlugin<any>
  16954. ) => string | Buffer | Promise<string | Buffer>;
  16955. /**
  16956. * optional version function or value
  16957. */
  16958. version?: string | true | (() => string);
  16959. }
  16960. type VirtualModuleInput =
  16961. | string
  16962. | ((
  16963. loaderContext: LoaderContextVirtualUrlPlugin<any>
  16964. ) => string | Buffer | Promise<string | Buffer>)
  16965. | VirtualModuleConfig;
  16966. declare interface VirtualModules {
  16967. [index: string]: VirtualModuleInput;
  16968. }
  16969. declare class VirtualUrlPlugin {
  16970. constructor(modules: VirtualModules, scheme?: string);
  16971. scheme: string;
  16972. modules: { [index: string]: VirtualModuleConfig };
  16973. /**
  16974. * Apply the plugin
  16975. */
  16976. apply(compiler: Compiler): void;
  16977. findVirtualModuleConfigById(id: string): VirtualModuleConfig;
  16978. /**
  16979. * Get the cache version for a given version value
  16980. */
  16981. getCacheVersion(version: string | true | (() => string)): undefined | string;
  16982. static DEFAULT_SCHEME: string;
  16983. }
  16984. type WarningFilterItemTypes =
  16985. | string
  16986. | RegExp
  16987. | ((warning: StatsError, warningString: string) => boolean);
  16988. declare interface WatchFileSystem {
  16989. watch: (
  16990. files: Iterable<string>,
  16991. directories: Iterable<string>,
  16992. missing: Iterable<string>,
  16993. startTime: number,
  16994. options: WatchOptions,
  16995. callback: (
  16996. err: null | Error,
  16997. timeInfoEntries1?: Map<string, FileSystemInfoEntry | "ignore">,
  16998. timeInfoEntries2?: Map<string, FileSystemInfoEntry | "ignore">,
  16999. changes?: Set<string>,
  17000. removals?: Set<string>
  17001. ) => void,
  17002. callbackUndelayed: (value: string, num: number) => void
  17003. ) => Watcher;
  17004. }
  17005. declare class WatchIgnorePlugin {
  17006. constructor(options: WatchIgnorePluginOptions);
  17007. paths: (string | RegExp)[];
  17008. /**
  17009. * Apply the plugin
  17010. */
  17011. apply(compiler: Compiler): void;
  17012. }
  17013. declare interface WatchIgnorePluginOptions {
  17014. /**
  17015. * A list of RegExps or absolute paths to directories or files that should be ignored.
  17016. */
  17017. paths: (string | RegExp)[];
  17018. }
  17019. /**
  17020. * Options for the watcher.
  17021. */
  17022. declare interface WatchOptions {
  17023. /**
  17024. * Delay the rebuilt after the first change. Value is a time in ms.
  17025. */
  17026. aggregateTimeout?: number;
  17027. /**
  17028. * Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
  17029. */
  17030. followSymlinks?: boolean;
  17031. /**
  17032. * Ignore some files from watching (glob pattern or regexp).
  17033. */
  17034. ignored?: string | RegExp | string[];
  17035. /**
  17036. * Enable polling mode for watching.
  17037. */
  17038. poll?: number | boolean;
  17039. /**
  17040. * Stop watching when stdin stream has ended.
  17041. */
  17042. stdin?: boolean;
  17043. }
  17044. declare interface Watcher {
  17045. /**
  17046. * closes the watcher and all underlying file watchers
  17047. */
  17048. close: () => void;
  17049. /**
  17050. * closes the watcher, but keeps underlying file watchers alive until the next watch call
  17051. */
  17052. pause: () => void;
  17053. /**
  17054. * get current aggregated changes that have not yet send to callback
  17055. */
  17056. getAggregatedChanges?: () => null | Set<string>;
  17057. /**
  17058. * get current aggregated removals that have not yet send to callback
  17059. */
  17060. getAggregatedRemovals?: () => null | Set<string>;
  17061. /**
  17062. * get info about files
  17063. */
  17064. getFileTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  17065. /**
  17066. * get info about directories
  17067. */
  17068. getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
  17069. /**
  17070. * get info about timestamps and changes
  17071. */
  17072. getInfo?: () => WatcherInfo;
  17073. }
  17074. declare interface WatcherInfo {
  17075. /**
  17076. * get current aggregated changes that have not yet send to callback
  17077. */
  17078. changes: null | Set<string>;
  17079. /**
  17080. * get current aggregated removals that have not yet send to callback
  17081. */
  17082. removals: null | Set<string>;
  17083. /**
  17084. * get info about files
  17085. */
  17086. fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  17087. /**
  17088. * get info about directories
  17089. */
  17090. contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
  17091. }
  17092. declare abstract class Watching {
  17093. startTime: null | number;
  17094. invalid: boolean;
  17095. handler: CallbackWebpackFunction_2<Stats, void>;
  17096. callbacks: ((err: null | Error, result?: void) => void)[];
  17097. closed: boolean;
  17098. suspended: boolean;
  17099. blocked: boolean;
  17100. watchOptions: WatchOptions;
  17101. compiler: Compiler;
  17102. running: boolean;
  17103. watcher?: null | Watcher;
  17104. pausedWatcher?: null | Watcher;
  17105. lastWatcherStartTime?: number;
  17106. watch(
  17107. files: Iterable<string>,
  17108. dirs: Iterable<string>,
  17109. missing: Iterable<string>
  17110. ): void;
  17111. invalidate(callback?: (err: null | Error, result?: void) => void): void;
  17112. suspend(): void;
  17113. resume(): void;
  17114. close(callback: (err: null | Error, result?: void) => void): void;
  17115. }
  17116. declare abstract class WeakTupleMap<K extends any[], V> {
  17117. set(...args: [K, ...V[]]): void;
  17118. has(...args: K): boolean;
  17119. get(...args: K): undefined | V;
  17120. provide(...args: [K, ...((...args: K) => V)[]]): V;
  17121. delete(...args: K): void;
  17122. clear(): void;
  17123. }
  17124. declare abstract class WebAssemblyParser extends ParserClass {}
  17125. declare interface WebAssemblyRenderContext {
  17126. /**
  17127. * the chunk
  17128. */
  17129. chunk: Chunk;
  17130. /**
  17131. * the dependency templates
  17132. */
  17133. dependencyTemplates: DependencyTemplates;
  17134. /**
  17135. * the runtime template
  17136. */
  17137. runtimeTemplate: RuntimeTemplate;
  17138. /**
  17139. * the module graph
  17140. */
  17141. moduleGraph: ModuleGraph;
  17142. /**
  17143. * the chunk graph
  17144. */
  17145. chunkGraph: ChunkGraph;
  17146. /**
  17147. * results of code generation
  17148. */
  17149. codeGenerationResults: CodeGenerationResults;
  17150. }
  17151. declare class WebWorkerTemplatePlugin {
  17152. constructor();
  17153. /**
  17154. * Apply the plugin
  17155. */
  17156. apply(compiler: Compiler): void;
  17157. }
  17158. declare class WebpackError extends Error {
  17159. /**
  17160. * Creates an instance of WebpackError.
  17161. */
  17162. constructor(message?: string, options?: { cause?: unknown });
  17163. [index: number]: () => string;
  17164. details?: string;
  17165. module?: null | Module;
  17166. loc?: SyntheticDependencyLocation | RealDependencyLocation;
  17167. hideStack?: boolean;
  17168. chunk?: Chunk;
  17169. file?: string;
  17170. serialize(__0: ObjectSerializerContext): void;
  17171. deserialize(__0: ObjectDeserializerContext): void;
  17172. cause: any;
  17173. /**
  17174. * Creates a `.stack` property on `targetObject`, which when accessed returns
  17175. * a string representing the location in the code at which
  17176. * `Error.captureStackTrace()` was called.
  17177. * ```js
  17178. * const myObject = {};
  17179. * Error.captureStackTrace(myObject);
  17180. * myObject.stack; // Similar to `new Error().stack`
  17181. * ```
  17182. * The first line of the trace will be prefixed with
  17183. * `${myObject.name}: ${myObject.message}`.
  17184. * The optional `constructorOpt` argument accepts a function. If given, all frames
  17185. * above `constructorOpt`, including `constructorOpt`, will be omitted from the
  17186. * generated stack trace.
  17187. * The `constructorOpt` argument is useful for hiding implementation
  17188. * details of error generation from the user. For instance:
  17189. * ```js
  17190. * function a() {
  17191. * b();
  17192. * }
  17193. * function b() {
  17194. * c();
  17195. * }
  17196. * function c() {
  17197. * // Create an error without stack trace to avoid calculating the stack trace twice.
  17198. * const { stackTraceLimit } = Error;
  17199. * Error.stackTraceLimit = 0;
  17200. * const error = new Error();
  17201. * Error.stackTraceLimit = stackTraceLimit;
  17202. * // Capture the stack trace above function b
  17203. * Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  17204. * throw error;
  17205. * }
  17206. * a();
  17207. * ```
  17208. */
  17209. static captureStackTrace(
  17210. targetObject: object,
  17211. constructorOpt?: Function
  17212. ): void;
  17213. static prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
  17214. /**
  17215. * The `Error.stackTraceLimit` property specifies the number of stack frames
  17216. * collected by a stack trace (whether generated by `new Error().stack` or
  17217. * `Error.captureStackTrace(obj)`).
  17218. * The default value is `10` but may be set to any valid JavaScript number. Changes
  17219. * will affect any stack trace captured _after_ the value has been changed.
  17220. * If set to a non-number value, or set to a negative number, stack traces will
  17221. * not capture any frames.
  17222. */
  17223. static stackTraceLimit: number;
  17224. }
  17225. declare abstract class WebpackLogger {
  17226. getChildLogger: (name: string | (() => string)) => WebpackLogger;
  17227. error(...args: any[]): void;
  17228. warn(...args: any[]): void;
  17229. info(...args: any[]): void;
  17230. log(...args: any[]): void;
  17231. debug(...args: any[]): void;
  17232. assert(assertion: any, ...args: any[]): void;
  17233. trace(): void;
  17234. clear(): void;
  17235. status(...args: any[]): void;
  17236. group(...args: any[]): void;
  17237. groupCollapsed(...args: any[]): void;
  17238. groupEnd(): void;
  17239. profile(label?: string): void;
  17240. profileEnd(label?: string): void;
  17241. time(label: string): void;
  17242. timeLog(label?: string): void;
  17243. timeEnd(label?: string): void;
  17244. timeAggregate(label?: string): void;
  17245. timeAggregateEnd(label?: string): void;
  17246. }
  17247. declare class WebpackOptionsApply extends OptionsApply {
  17248. constructor();
  17249. }
  17250. declare class WebpackOptionsDefaulter {
  17251. constructor();
  17252. process(options: Configuration): WebpackOptionsNormalized;
  17253. }
  17254. /**
  17255. * Normalized webpack options object.
  17256. */
  17257. declare interface WebpackOptionsNormalized {
  17258. /**
  17259. * Set the value of `require.amd` and `define.amd`. Or disable AMD support.
  17260. */
  17261. amd?: false | { [index: string]: any };
  17262. /**
  17263. * Report the first error as a hard error instead of tolerating it.
  17264. */
  17265. bail?: boolean;
  17266. /**
  17267. * Cache generated modules and chunks to improve performance for multiple incremental builds.
  17268. */
  17269. cache: CacheOptionsNormalized;
  17270. /**
  17271. * The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
  17272. */
  17273. context?: string;
  17274. /**
  17275. * References to other configurations to depend on.
  17276. */
  17277. dependencies?: string[];
  17278. /**
  17279. * Options for the webpack-dev-server.
  17280. */
  17281. devServer?: false | { [index: string]: any };
  17282. /**
  17283. * A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  17284. */
  17285. devtool?: string | false;
  17286. /**
  17287. * Enable and configure the Dotenv plugin to load environment variables from .env files.
  17288. */
  17289. dotenv?: boolean | DotenvPluginOptions;
  17290. /**
  17291. * The entry point(s) of the compilation.
  17292. */
  17293. entry: EntryNormalized;
  17294. /**
  17295. * Enables/Disables experiments (experimental features with relax SemVer compatibility).
  17296. */
  17297. experiments: ExperimentsNormalized;
  17298. /**
  17299. * 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`.
  17300. */
  17301. externals: Externals;
  17302. /**
  17303. * Enable presets of externals for specific targets.
  17304. */
  17305. externalsPresets: ExternalsPresets;
  17306. /**
  17307. * Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
  17308. */
  17309. externalsType?:
  17310. | "import"
  17311. | "var"
  17312. | "module"
  17313. | "assign"
  17314. | "this"
  17315. | "window"
  17316. | "self"
  17317. | "global"
  17318. | "commonjs"
  17319. | "commonjs2"
  17320. | "commonjs-module"
  17321. | "commonjs-static"
  17322. | "amd"
  17323. | "amd-require"
  17324. | "umd"
  17325. | "umd2"
  17326. | "jsonp"
  17327. | "system"
  17328. | "promise"
  17329. | "module-import"
  17330. | "script"
  17331. | "node-commonjs"
  17332. | "asset"
  17333. | "css-import"
  17334. | "css-url";
  17335. /**
  17336. * Ignore specific warnings.
  17337. */
  17338. ignoreWarnings?: ((warning: Error, compilation: Compilation) => boolean)[];
  17339. /**
  17340. * Options for infrastructure level logging.
  17341. */
  17342. infrastructureLogging: InfrastructureLogging;
  17343. /**
  17344. * Custom values available in the loader context.
  17345. */
  17346. loader?: Loader;
  17347. /**
  17348. * Enable production optimizations or development hints.
  17349. */
  17350. mode?: "none" | "development" | "production";
  17351. /**
  17352. * Options affecting the normal modules (`NormalModuleFactory`).
  17353. */
  17354. module: ModuleOptionsNormalized;
  17355. /**
  17356. * Name of the configuration. Used when loading multiple configurations.
  17357. */
  17358. name?: string;
  17359. /**
  17360. * Include polyfills or mocks for various node stuff.
  17361. */
  17362. node: Node;
  17363. /**
  17364. * Enables/Disables integrated optimizations.
  17365. */
  17366. optimization: OptimizationNormalized;
  17367. /**
  17368. * Normalized options affecting the output of the compilation. `output` options tell webpack how to write the compiled files to disk.
  17369. */
  17370. output: OutputNormalized;
  17371. /**
  17372. * The number of parallel processed modules in the compilation.
  17373. */
  17374. parallelism?: number;
  17375. /**
  17376. * Configuration for web performance recommendations.
  17377. */
  17378. performance?: false | PerformanceOptions;
  17379. /**
  17380. * Add additional plugins to the compiler.
  17381. */
  17382. plugins: (
  17383. | ((this: Compiler, compiler: Compiler) => void)
  17384. | WebpackPluginInstance
  17385. )[];
  17386. /**
  17387. * Capture timing information for each module.
  17388. */
  17389. profile?: boolean;
  17390. /**
  17391. * Store compiler state to a json file.
  17392. */
  17393. recordsInputPath?: string | false;
  17394. /**
  17395. * Load compiler state from a json file.
  17396. */
  17397. recordsOutputPath?: string | false;
  17398. /**
  17399. * Options for the resolver.
  17400. */
  17401. resolve: ResolveOptions;
  17402. /**
  17403. * Options for the resolver when resolving loaders.
  17404. */
  17405. resolveLoader: ResolveOptions;
  17406. /**
  17407. * Options affecting how file system snapshots are created and validated.
  17408. */
  17409. snapshot: SnapshotOptionsWebpackOptions;
  17410. /**
  17411. * Stats options object or preset name.
  17412. */
  17413. stats: StatsValue;
  17414. /**
  17415. * Environment to build for. An array of environments to build for all of them when possible.
  17416. */
  17417. target?: string | false | string[];
  17418. /**
  17419. * Enter watch mode, which rebuilds on file change.
  17420. */
  17421. watch?: boolean;
  17422. /**
  17423. * Options for the watcher.
  17424. */
  17425. watchOptions: WatchOptions;
  17426. }
  17427. type WebpackOptionsNormalizedWithDefaults = WebpackOptionsNormalized & {
  17428. context: string;
  17429. } & { infrastructureLogging: InfrastructureLoggingNormalizedWithDefaults } & {
  17430. target: NonNullable<undefined | string | false | string[]>;
  17431. } & { output: OutputNormalizedWithDefaults } & {
  17432. optimization: OptimizationNormalizedWithDefaults;
  17433. } & { devtool: NonNullable<undefined | string | false> } & {
  17434. stats: NonNullable<StatsValue>;
  17435. } & { node: NonNullable<Node> } & {
  17436. profile: NonNullable<undefined | boolean>;
  17437. } & { parallelism: number } & { snapshot: SnapshotNormalizedWithDefaults } & {
  17438. externalsPresets: ExternalsPresetsNormalizedWithDefaults;
  17439. } & {
  17440. externalsType: NonNullable<
  17441. | undefined
  17442. | "import"
  17443. | "var"
  17444. | "module"
  17445. | "assign"
  17446. | "this"
  17447. | "window"
  17448. | "self"
  17449. | "global"
  17450. | "commonjs"
  17451. | "commonjs2"
  17452. | "commonjs-module"
  17453. | "commonjs-static"
  17454. | "amd"
  17455. | "amd-require"
  17456. | "umd"
  17457. | "umd2"
  17458. | "jsonp"
  17459. | "system"
  17460. | "promise"
  17461. | "module-import"
  17462. | "script"
  17463. | "node-commonjs"
  17464. | "asset"
  17465. | "css-import"
  17466. | "css-url"
  17467. >;
  17468. } & { watch: NonNullable<undefined | boolean> } & {
  17469. performance: NonNullable<undefined | false | PerformanceOptions>;
  17470. } & { recordsInputPath: NonNullable<undefined | string | false> } & {
  17471. recordsOutputPath:
  17472. | (string & {
  17473. dotenv: NonNullable<undefined | boolean | DotenvPluginOptions>;
  17474. })
  17475. | (false & {
  17476. dotenv: NonNullable<undefined | boolean | DotenvPluginOptions>;
  17477. });
  17478. };
  17479. /**
  17480. * Plugin instance.
  17481. */
  17482. declare interface WebpackPluginInstance {
  17483. [index: string]: any;
  17484. /**
  17485. * The run point of the plugin, required method.
  17486. */
  17487. apply: (compiler: Compiler) => void;
  17488. }
  17489. declare interface WebpackRequire {
  17490. (id: string): any;
  17491. i?: ((options: ExecuteOptions) => void)[];
  17492. c?: Record<string, ExecuteModuleObject>;
  17493. }
  17494. declare interface WithId {
  17495. id: string | number;
  17496. }
  17497. declare interface WithOptions {
  17498. /**
  17499. * create a resolver with additional/different options
  17500. */
  17501. withOptions: (
  17502. options: Partial<ResolveOptionsWithDependencyType>
  17503. ) => ResolverWithOptions;
  17504. }
  17505. declare interface WriteFile {
  17506. (
  17507. file: PathOrFileDescriptorFs,
  17508. data: string | NodeJS.ArrayBufferView,
  17509. options: WriteFileOptions,
  17510. callback: (err: null | NodeJS.ErrnoException) => void
  17511. ): void;
  17512. (
  17513. file: PathOrFileDescriptorFs,
  17514. data: string | NodeJS.ArrayBufferView,
  17515. callback: (err: null | NodeJS.ErrnoException) => void
  17516. ): void;
  17517. }
  17518. type WriteFileOptions =
  17519. | null
  17520. | "ascii"
  17521. | "utf8"
  17522. | "utf-8"
  17523. | "utf16le"
  17524. | "utf-16le"
  17525. | "ucs2"
  17526. | "ucs-2"
  17527. | "base64"
  17528. | "base64url"
  17529. | "latin1"
  17530. | "binary"
  17531. | "hex"
  17532. | (ObjectEncodingOptions &
  17533. Abortable & { mode?: string | number; flag?: string; flush?: boolean });
  17534. declare interface WriteOnlySet<T> {
  17535. add: (item: T) => void;
  17536. }
  17537. type WriteStreamOptions = StreamOptions & {
  17538. fs?: null | CreateWriteStreamFSImplementation;
  17539. flush?: boolean;
  17540. };
  17541. declare interface _functionWebpack {
  17542. (
  17543. options: Configuration,
  17544. callback: CallbackWebpackFunction_2<Stats, void>
  17545. ): null | Compiler;
  17546. (options: Configuration): Compiler;
  17547. (
  17548. options: MultiConfiguration,
  17549. callback: CallbackWebpackFunction_2<MultiStats, void>
  17550. ): null | MultiCompiler;
  17551. (options: MultiConfiguration): MultiCompiler;
  17552. }
  17553. declare interface chunkModuleHashMap {
  17554. [index: number]: string;
  17555. [index: string]: string;
  17556. }
  17557. declare function exports(
  17558. options: Configuration,
  17559. callback: CallbackWebpackFunction_2<Stats, void>
  17560. ): null | Compiler;
  17561. declare function exports(options: Configuration): Compiler;
  17562. declare function exports(
  17563. options: MultiConfiguration,
  17564. callback: CallbackWebpackFunction_2<MultiStats, void>
  17565. ): null | MultiCompiler;
  17566. declare function exports(options: MultiConfiguration): MultiCompiler;
  17567. declare namespace exports {
  17568. export const webpack: _functionWebpack;
  17569. export const validate: (
  17570. configuration: Configuration | MultiConfiguration
  17571. ) => void;
  17572. export const validateSchema: (
  17573. schema: Parameters<typeof validateFunction>[0],
  17574. options: Parameters<typeof validateFunction>[1],
  17575. validationConfiguration?: ValidationErrorConfiguration
  17576. ) => void;
  17577. export const version: string;
  17578. export namespace cli {
  17579. export let createColors: (__0?: ColorsOptions) => Colors;
  17580. export let getArguments: (
  17581. schema?:
  17582. | (JSONSchema4 & {
  17583. absolutePath: boolean;
  17584. instanceof: string;
  17585. cli: {
  17586. helper?: boolean;
  17587. exclude?: boolean;
  17588. description?: string;
  17589. negatedDescription?: string;
  17590. resetDescription?: string;
  17591. };
  17592. })
  17593. | (JSONSchema6 & {
  17594. absolutePath: boolean;
  17595. instanceof: string;
  17596. cli: {
  17597. helper?: boolean;
  17598. exclude?: boolean;
  17599. description?: string;
  17600. negatedDescription?: string;
  17601. resetDescription?: string;
  17602. };
  17603. })
  17604. | (JSONSchema7 & {
  17605. absolutePath: boolean;
  17606. instanceof: string;
  17607. cli: {
  17608. helper?: boolean;
  17609. exclude?: boolean;
  17610. description?: string;
  17611. negatedDescription?: string;
  17612. resetDescription?: string;
  17613. };
  17614. })
  17615. ) => Flags;
  17616. export let isColorSupported: () => boolean;
  17617. export let processArguments: (
  17618. args: Flags,
  17619. config: ObjectConfiguration,
  17620. values: Values
  17621. ) => null | Problem[];
  17622. }
  17623. export namespace ModuleFilenameHelpers {
  17624. export let ALL_LOADERS_RESOURCE: string;
  17625. export let REGEXP_ALL_LOADERS_RESOURCE: RegExp;
  17626. export let LOADERS_RESOURCE: string;
  17627. export let REGEXP_LOADERS_RESOURCE: RegExp;
  17628. export let RESOURCE: string;
  17629. export let REGEXP_RESOURCE: RegExp;
  17630. export let ABSOLUTE_RESOURCE_PATH: string;
  17631. export let REGEXP_ABSOLUTE_RESOURCE_PATH: RegExp;
  17632. export let RESOURCE_PATH: string;
  17633. export let REGEXP_RESOURCE_PATH: RegExp;
  17634. export let ALL_LOADERS: string;
  17635. export let REGEXP_ALL_LOADERS: RegExp;
  17636. export let LOADERS: string;
  17637. export let REGEXP_LOADERS: RegExp;
  17638. export let QUERY: string;
  17639. export let REGEXP_QUERY: RegExp;
  17640. export let ID: string;
  17641. export let REGEXP_ID: RegExp;
  17642. export let HASH: string;
  17643. export let REGEXP_HASH: RegExp;
  17644. export let NAMESPACE: string;
  17645. export let REGEXP_NAMESPACE: RegExp;
  17646. export let createFilename: (
  17647. module: string | Module,
  17648. options: {
  17649. namespace?: string;
  17650. moduleFilenameTemplate?:
  17651. | string
  17652. | ((context: ModuleFilenameTemplateContext) => string);
  17653. },
  17654. __2: {
  17655. requestShortener: RequestShortener;
  17656. chunkGraph: ChunkGraph;
  17657. hashFunction?: string | typeof Hash;
  17658. }
  17659. ) => string;
  17660. export let replaceDuplicates: <T>(
  17661. array: T[],
  17662. fn: (
  17663. duplicateItem: T,
  17664. duplicateItemIndex: number,
  17665. numberOfTimesReplaced: number
  17666. ) => T,
  17667. comparator?: (firstElement: T, nextElement: T) => 0 | 1 | -1
  17668. ) => T[];
  17669. export let matchPart: (str: string, test: Matcher) => boolean;
  17670. export let matchObject: (obj: MatchObject, str: string) => boolean;
  17671. }
  17672. export namespace OptimizationStages {
  17673. export let STAGE_ADVANCED: 10;
  17674. export let STAGE_BASIC: -10;
  17675. export let STAGE_DEFAULT: 0;
  17676. }
  17677. export namespace RuntimeGlobals {
  17678. export let amdDefine: "__webpack_require__.amdD";
  17679. export let amdOptions: "__webpack_require__.amdO";
  17680. export let asyncModule: "__webpack_require__.a";
  17681. export let asyncModuleDoneSymbol: "__webpack_require__.aD";
  17682. export let asyncModuleExportSymbol: "__webpack_require__.aE";
  17683. export let baseURI: "__webpack_require__.b";
  17684. export let chunkCallback: "webpackChunk";
  17685. export let chunkName: "__webpack_require__.cn";
  17686. export let compatGetDefaultExport: "__webpack_require__.n";
  17687. export let createFakeNamespaceObject: "__webpack_require__.t";
  17688. export let createScript: "__webpack_require__.ts";
  17689. export let createScriptUrl: "__webpack_require__.tu";
  17690. export let cssMergeStyleSheets: "__webpack_require__.mcs";
  17691. export let currentRemoteGetScope: "__webpack_require__.R";
  17692. export let deferredModuleAsyncTransitiveDependencies: "__webpack_require__.zT";
  17693. export let deferredModuleAsyncTransitiveDependenciesSymbol: "__webpack_require__.zS";
  17694. export let definePropertyGetters: "__webpack_require__.d";
  17695. export let ensureChunk: "__webpack_require__.e";
  17696. export let ensureChunkHandlers: "__webpack_require__.f";
  17697. export let ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
  17698. export let entryModuleId: "__webpack_require__.s";
  17699. export let esmId: "__webpack_esm_id__";
  17700. export let esmIds: "__webpack_esm_ids__";
  17701. export let esmModules: "__webpack_esm_modules__";
  17702. export let esmRuntime: "__webpack_esm_runtime__";
  17703. export let exports: "__webpack_exports__";
  17704. export let externalInstallChunk: "__webpack_require__.C";
  17705. export let getChunkCssFilename: "__webpack_require__.k";
  17706. export let getChunkScriptFilename: "__webpack_require__.u";
  17707. export let getChunkUpdateCssFilename: "__webpack_require__.hk";
  17708. export let getChunkUpdateScriptFilename: "__webpack_require__.hu";
  17709. export let getFullHash: "__webpack_require__.h";
  17710. export let getTrustedTypesPolicy: "__webpack_require__.tt";
  17711. export let getUpdateManifestFilename: "__webpack_require__.hmrF";
  17712. export let global: "__webpack_require__.g";
  17713. export let harmonyModuleDecorator: "__webpack_require__.hmd";
  17714. export let hasCssModules: "has css modules";
  17715. export let hasFetchPriority: "has fetch priority";
  17716. export let hasOwnProperty: "__webpack_require__.o";
  17717. export let hmrDownloadManifest: "__webpack_require__.hmrM";
  17718. export let hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
  17719. export let hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
  17720. export let hmrModuleData: "__webpack_require__.hmrD";
  17721. export let hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
  17722. export let initializeSharing: "__webpack_require__.I";
  17723. export let instantiateWasm: "__webpack_require__.v";
  17724. export let interceptModuleExecution: "__webpack_require__.i";
  17725. export let loadScript: "__webpack_require__.l";
  17726. export let makeDeferredNamespaceObject: "__webpack_require__.z";
  17727. export let makeNamespaceObject: "__webpack_require__.r";
  17728. export let makeOptimizedDeferredNamespaceObject: "__webpack_require__.zO";
  17729. export let module: "module";
  17730. export let moduleCache: "__webpack_require__.c";
  17731. export let moduleFactories: "__webpack_require__.m";
  17732. export let moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
  17733. export let moduleId: "module.id";
  17734. export let moduleLoaded: "module.loaded";
  17735. export let nodeModuleDecorator: "__webpack_require__.nmd";
  17736. export let onChunksLoaded: "__webpack_require__.O";
  17737. export let prefetchChunk: "__webpack_require__.E";
  17738. export let prefetchChunkHandlers: "__webpack_require__.F";
  17739. export let preloadChunk: "__webpack_require__.G";
  17740. export let preloadChunkHandlers: "__webpack_require__.H";
  17741. export let publicPath: "__webpack_require__.p";
  17742. export let relativeUrl: "__webpack_require__.U";
  17743. export let require: "__webpack_require__";
  17744. export let requireScope: "__webpack_require__.*";
  17745. export let returnExportsFromRuntime: "return-exports-from-runtime";
  17746. export let runtimeId: "__webpack_require__.j";
  17747. export let scriptNonce: "__webpack_require__.nc";
  17748. export let shareScopeMap: "__webpack_require__.S";
  17749. export let startup: "__webpack_require__.x";
  17750. export let startupEntrypoint: "__webpack_require__.X";
  17751. export let startupNoDefault: "__webpack_require__.x (no default handler)";
  17752. export let startupOnlyAfter: "__webpack_require__.x (only after)";
  17753. export let startupOnlyBefore: "__webpack_require__.x (only before)";
  17754. export let system: "__webpack_require__.System";
  17755. export let systemContext: "__webpack_require__.y";
  17756. export let thisAsExports: "top-level-this-exports";
  17757. export let toBinary: "__webpack_require__.tb";
  17758. export let uncaughtErrorHandler: "__webpack_require__.oe";
  17759. export let wasmInstances: "__webpack_require__.w";
  17760. }
  17761. export const UsageState: Readonly<{
  17762. Unused: 0;
  17763. OnlyPropertiesUsed: 1;
  17764. NoInfo: 2;
  17765. Unknown: 3;
  17766. Used: 4;
  17767. }>;
  17768. export namespace cache {
  17769. export { MemoryCachePlugin };
  17770. }
  17771. export namespace config {
  17772. export const getNormalizedWebpackOptions: (
  17773. config: Configuration
  17774. ) => WebpackOptionsNormalized;
  17775. export const applyWebpackOptionsDefaults: (
  17776. options: WebpackOptionsNormalized,
  17777. compilerIndex?: number
  17778. ) => ResolvedOptions;
  17779. }
  17780. export namespace dependencies {
  17781. export {
  17782. ModuleDependency,
  17783. HarmonyImportDependency,
  17784. ConstDependency,
  17785. NullDependency
  17786. };
  17787. }
  17788. export namespace ids {
  17789. export {
  17790. ChunkModuleIdRangePlugin,
  17791. NaturalModuleIdsPlugin,
  17792. OccurrenceModuleIdsPlugin,
  17793. NamedModuleIdsPlugin,
  17794. DeterministicChunkIdsPlugin,
  17795. DeterministicModuleIdsPlugin,
  17796. NamedChunkIdsPlugin,
  17797. OccurrenceChunkIdsPlugin,
  17798. HashedModuleIdsPlugin
  17799. };
  17800. }
  17801. export namespace javascript {
  17802. export {
  17803. EnableChunkLoadingPlugin,
  17804. JavascriptModulesPlugin,
  17805. JavascriptParser
  17806. };
  17807. }
  17808. export namespace optimize {
  17809. export namespace InnerGraph {
  17810. export let addUsage: (
  17811. state: ParserState,
  17812. symbol: null | TopLevelSymbol,
  17813. usage: Usage
  17814. ) => void;
  17815. export let addVariableUsage: (
  17816. parser: JavascriptParser,
  17817. name: string,
  17818. usage: Usage
  17819. ) => void;
  17820. export let bailout: (parserState: ParserState) => void;
  17821. export let enable: (parserState: ParserState) => void;
  17822. export let getDependencyUsedByExportsCondition: (
  17823. dependency: Dependency,
  17824. usedByExports: undefined | boolean | Set<string>,
  17825. moduleGraph: ModuleGraph
  17826. ) =>
  17827. | null
  17828. | false
  17829. | ((
  17830. moduleGraphConnection: ModuleGraphConnection,
  17831. runtime: RuntimeSpec
  17832. ) => ConnectionState);
  17833. export let getTopLevelSymbol: (
  17834. state: ParserState
  17835. ) => void | TopLevelSymbol;
  17836. export let inferDependencyUsage: (state: ParserState) => void;
  17837. export let isDependencyUsedByExports: (
  17838. dependency: Dependency,
  17839. usedByExports: undefined | boolean | Set<string>,
  17840. moduleGraph: ModuleGraph,
  17841. runtime: RuntimeSpec
  17842. ) => boolean;
  17843. export let isEnabled: (parserState: ParserState) => boolean;
  17844. export let onUsage: (
  17845. state: ParserState,
  17846. onUsageCallback: (value?: boolean | Set<string>) => void
  17847. ) => void;
  17848. export let setTopLevelSymbol: (
  17849. state: ParserState,
  17850. symbol?: TopLevelSymbol
  17851. ) => void;
  17852. export let tagTopLevelSymbol: (
  17853. parser: JavascriptParser,
  17854. name: string
  17855. ) => undefined | TopLevelSymbol;
  17856. export { TopLevelSymbol, topLevelSymbolTag };
  17857. }
  17858. export {
  17859. AggressiveMergingPlugin,
  17860. AggressiveSplittingPlugin,
  17861. LimitChunkCountPlugin,
  17862. MergeDuplicateChunksPlugin,
  17863. MinChunkSizePlugin,
  17864. ModuleConcatenationPlugin,
  17865. RealContentHashPlugin,
  17866. RuntimeChunkPlugin,
  17867. SideEffectsFlagPlugin,
  17868. SplitChunksPlugin
  17869. };
  17870. }
  17871. export namespace runtime {
  17872. export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
  17873. }
  17874. export namespace prefetch {
  17875. export { ChunkPrefetchPreloadPlugin };
  17876. }
  17877. export namespace web {
  17878. export {
  17879. FetchCompileWasmPlugin,
  17880. FetchCompileAsyncWasmPlugin,
  17881. JsonpChunkLoadingRuntimeModule,
  17882. JsonpTemplatePlugin,
  17883. CssLoadingRuntimeModule
  17884. };
  17885. }
  17886. export namespace esm {
  17887. export { ModuleChunkLoadingRuntimeModule };
  17888. }
  17889. export namespace webworker {
  17890. export { WebWorkerTemplatePlugin };
  17891. }
  17892. export namespace node {
  17893. export {
  17894. NodeEnvironmentPlugin,
  17895. NodeSourcePlugin,
  17896. NodeTargetPlugin,
  17897. NodeTemplatePlugin,
  17898. ReadFileCompileWasmPlugin,
  17899. ReadFileCompileAsyncWasmPlugin
  17900. };
  17901. }
  17902. export namespace electron {
  17903. export { ElectronTargetPlugin };
  17904. }
  17905. export namespace wasm {
  17906. export { AsyncWebAssemblyModulesPlugin, EnableWasmLoadingPlugin };
  17907. }
  17908. export namespace css {
  17909. export { CssModulesPlugin };
  17910. }
  17911. export namespace library {
  17912. export { AbstractLibraryPlugin, EnableLibraryPlugin };
  17913. }
  17914. export namespace container {
  17915. export const scope: <T>(
  17916. scope: string,
  17917. options: ContainerOptionsFormat<T>
  17918. ) => Record<string, string | string[] | T>;
  17919. export {
  17920. ContainerPlugin,
  17921. ContainerReferencePlugin,
  17922. ModuleFederationPlugin
  17923. };
  17924. }
  17925. export namespace sharing {
  17926. export const scope: <T>(
  17927. scope: string,
  17928. options: ContainerOptionsFormat<T>
  17929. ) => Record<string, string | string[] | T>;
  17930. export { ConsumeSharedPlugin, ProvideSharedPlugin, SharePlugin };
  17931. }
  17932. export namespace debug {
  17933. export { ProfilingPlugin };
  17934. }
  17935. export namespace util {
  17936. export const createHash: (algorithm: HashFunction) => Hash;
  17937. export namespace comparators {
  17938. export let compareChunkGroupsByIndex: (
  17939. a: ChunkGroup,
  17940. b: ChunkGroup
  17941. ) => 0 | 1 | -1;
  17942. export let compareChunks: ParameterizedComparator<ChunkGraph, Chunk>;
  17943. export let compareChunksById: (a: Chunk, b: Chunk) => 0 | 1 | -1;
  17944. export let compareChunksNatural: (
  17945. chunkGraph: ChunkGraph
  17946. ) => Comparator<Chunk>;
  17947. export let compareIds: (
  17948. a: string | number,
  17949. b: string | number
  17950. ) => 0 | 1 | -1;
  17951. export let compareIterables: <T>(
  17952. elementComparator: Comparator<T>
  17953. ) => Comparator<Iterable<T>>;
  17954. export let compareLocations: (
  17955. a: DependencyLocation,
  17956. b: DependencyLocation
  17957. ) => 0 | 1 | -1;
  17958. export let compareModulesById: ParameterizedComparator<
  17959. ChunkGraph,
  17960. Module
  17961. >;
  17962. export let compareModulesByIdOrIdentifier: ParameterizedComparator<
  17963. ChunkGraph,
  17964. Module
  17965. >;
  17966. export let compareModulesByIdentifier: (
  17967. a: Module,
  17968. b: Module
  17969. ) => 0 | 1 | -1;
  17970. export let compareModulesByPostOrderIndexOrIdentifier: ParameterizedComparator<
  17971. ModuleGraph,
  17972. Module
  17973. >;
  17974. export let compareModulesByPreOrderIndexOrIdentifier: ParameterizedComparator<
  17975. ModuleGraph,
  17976. Module
  17977. >;
  17978. export let compareNumbers: (a: number, b: number) => 0 | 1 | -1;
  17979. export let compareSelect: <T, R>(
  17980. getter: Selector<T, R>,
  17981. comparator: Comparator<R>
  17982. ) => Comparator<T>;
  17983. export let compareStrings: (a: string, b: string) => 0 | 1 | -1;
  17984. export let compareStringsNumeric: (a: string, b: string) => 0 | 1 | -1;
  17985. export let concatComparators: <T>(
  17986. c1: Comparator<T>,
  17987. c2: Comparator<T>,
  17988. ...cRest: Comparator<T>[]
  17989. ) => Comparator<T>;
  17990. export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
  17991. export let sortWithSourceOrder: (
  17992. dependencies: Dependency[],
  17993. dependencySourceOrderMap: WeakMap<Dependency, DependencySourceOrder>,
  17994. onDependencyReSort?: (dep: Dependency, index: number) => void
  17995. ) => void;
  17996. }
  17997. export namespace runtime {
  17998. export let compareRuntime: (a: RuntimeSpec, b: RuntimeSpec) => 0 | 1 | -1;
  17999. export let filterRuntime: (
  18000. runtime: RuntimeSpec,
  18001. filter: (runtime?: RuntimeSpec) => boolean
  18002. ) => undefined | string | boolean | SortableSet<string>;
  18003. export let forEachRuntime: (
  18004. runtime: RuntimeSpec,
  18005. fn: (runtime?: string) => void,
  18006. deterministicOrder?: boolean
  18007. ) => void;
  18008. export let getEntryRuntime: (
  18009. compilation: Compilation,
  18010. name: string,
  18011. options?: EntryOptions
  18012. ) => RuntimeSpec;
  18013. export let getRuntimeKey: (runtime: RuntimeSpec) => string;
  18014. export let intersectRuntime: (
  18015. a: RuntimeSpec,
  18016. b: RuntimeSpec
  18017. ) => RuntimeSpec;
  18018. export let keyToRuntime: (key: string) => RuntimeSpec;
  18019. export let mergeRuntime: (a: RuntimeSpec, b: RuntimeSpec) => RuntimeSpec;
  18020. export let mergeRuntimeCondition: (
  18021. a: RuntimeCondition,
  18022. b: RuntimeCondition,
  18023. runtime: RuntimeSpec
  18024. ) => RuntimeCondition;
  18025. export let mergeRuntimeConditionNonFalse: (
  18026. a: undefined | string | true | SortableSet<string>,
  18027. b: undefined | string | true | SortableSet<string>,
  18028. runtime: RuntimeSpec
  18029. ) => undefined | string | true | SortableSet<string>;
  18030. export let mergeRuntimeOwned: (
  18031. a: RuntimeSpec,
  18032. b: RuntimeSpec
  18033. ) => RuntimeSpec;
  18034. export let runtimeConditionToString: (
  18035. runtimeCondition: RuntimeCondition
  18036. ) => string;
  18037. export let runtimeEqual: (a: RuntimeSpec, b: RuntimeSpec) => boolean;
  18038. export let runtimeToString: (runtime: RuntimeSpec) => string;
  18039. export let subtractRuntime: (
  18040. a: RuntimeSpec,
  18041. b: RuntimeSpec
  18042. ) => RuntimeSpec;
  18043. export let subtractRuntimeCondition: (
  18044. a: RuntimeCondition,
  18045. b: RuntimeCondition,
  18046. runtime: RuntimeSpec
  18047. ) => RuntimeCondition;
  18048. export { RuntimeSpecMap, RuntimeSpecSet };
  18049. }
  18050. export namespace serialization {
  18051. export const register: (
  18052. Constructor: Constructor,
  18053. request: string,
  18054. name: null | string,
  18055. serializer: ObjectSerializer
  18056. ) => void;
  18057. export const registerLoader: (
  18058. regExp: RegExp,
  18059. loader: (request: string) => boolean
  18060. ) => void;
  18061. export const registerNotSerializable: (Constructor: Constructor) => void;
  18062. export const NOT_SERIALIZABLE: object;
  18063. export const buffersSerializer: Serializer<any, any, any>;
  18064. export let createFileSerializer: <D, S, C>(
  18065. fs: IntermediateFileSystem,
  18066. hashFunction: string | typeof Hash
  18067. ) => Serializer<D, S, C>;
  18068. export { MEASURE_START_OPERATION, MEASURE_END_OPERATION };
  18069. }
  18070. export const cleverMerge: <T, O>(
  18071. first?: null | T,
  18072. second?: null | O
  18073. ) => T | O | (T & O);
  18074. export function compileBooleanMatcher(
  18075. map: Record<string | number, boolean>
  18076. ): boolean | ((value: string) => string);
  18077. export namespace compileBooleanMatcher {
  18078. export let fromLists: (
  18079. positiveItems: string[],
  18080. negativeItems: string[]
  18081. ) => (value: string) => string;
  18082. export let itemsToRegexp: (itemsArr: string[]) => string;
  18083. }
  18084. export { LazySet };
  18085. }
  18086. export namespace sources {
  18087. export {
  18088. Source,
  18089. RawSource,
  18090. OriginalSource,
  18091. ReplaceSource,
  18092. SourceMapSource,
  18093. ConcatSource,
  18094. PrefixSource,
  18095. CachedSource,
  18096. SizeOnlySource,
  18097. CompatSource
  18098. };
  18099. }
  18100. export namespace experiments {
  18101. export namespace schemes {
  18102. export { HttpUriPlugin, VirtualUrlPlugin };
  18103. }
  18104. export namespace ids {
  18105. export { SyncModuleIdsPlugin };
  18106. }
  18107. }
  18108. export type RuleSetUseFunction = (data: EffectData) =>
  18109. | string
  18110. | RuleSetUseFunction
  18111. | {
  18112. /**
  18113. * Unique loader options identifier.
  18114. */
  18115. ident?: string;
  18116. /**
  18117. * Loader name.
  18118. */
  18119. loader?: string;
  18120. /**
  18121. * Loader options.
  18122. */
  18123. options?: string | { [index: string]: any };
  18124. }
  18125. | (
  18126. | undefined
  18127. | null
  18128. | string
  18129. | false
  18130. | 0
  18131. | RuleSetUseFunction
  18132. | {
  18133. /**
  18134. * Unique loader options identifier.
  18135. */
  18136. ident?: string;
  18137. /**
  18138. * Loader name.
  18139. */
  18140. loader?: string;
  18141. /**
  18142. * Loader options.
  18143. */
  18144. options?: string | { [index: string]: any };
  18145. }
  18146. )[];
  18147. export type WebpackPluginFunction = (
  18148. this: Compiler,
  18149. compiler: Compiler
  18150. ) => void;
  18151. export type ExternalItemFunctionCallback = (
  18152. data: ExternalItemFunctionData,
  18153. callback: (
  18154. err?: null | Error,
  18155. result?: string | boolean | string[] | { [index: string]: any }
  18156. ) => void
  18157. ) => void;
  18158. export type ExternalItemFunctionDataGetResolve = (
  18159. options?: ResolveOptions
  18160. ) =>
  18161. | ((
  18162. context: string,
  18163. request: string,
  18164. callback: (
  18165. err?: null | Error,
  18166. result?: string | false,
  18167. resolveRequest?: ResolveRequest
  18168. ) => void
  18169. ) => void)
  18170. | ((context: string, request: string) => Promise<string>);
  18171. export type ExternalItemFunctionDataGetResolveCallbackResult = (
  18172. context: string,
  18173. request: string,
  18174. callback: (
  18175. err?: null | Error,
  18176. result?: string | false,
  18177. resolveRequest?: ResolveRequest
  18178. ) => void
  18179. ) => void;
  18180. export type ExternalItemFunctionDataGetResolveResult = (
  18181. context: string,
  18182. request: string
  18183. ) => Promise<string>;
  18184. export type ExternalItemFunctionPromise = (
  18185. data: ExternalItemFunctionData
  18186. ) => Promise<ExternalItemValue>;
  18187. export {
  18188. AutomaticPrefetchPlugin,
  18189. AsyncDependenciesBlock,
  18190. BannerPlugin,
  18191. CacheClass as Cache,
  18192. Chunk,
  18193. ChunkGraph,
  18194. CleanPlugin,
  18195. Compilation,
  18196. Compiler,
  18197. ConcatenationScope,
  18198. ContextExclusionPlugin,
  18199. ContextReplacementPlugin,
  18200. DefinePlugin,
  18201. DelegatedPlugin,
  18202. Dependency,
  18203. DllPlugin,
  18204. DllReferencePlugin,
  18205. DynamicEntryPlugin,
  18206. DotenvPlugin,
  18207. EntryOptionPlugin,
  18208. EntryPlugin,
  18209. EnvironmentPlugin,
  18210. EvalDevToolModulePlugin,
  18211. EvalSourceMapDevToolPlugin,
  18212. ExternalModule,
  18213. ExternalsPlugin,
  18214. Generator,
  18215. HotUpdateChunk,
  18216. HotModuleReplacementPlugin,
  18217. InitFragment,
  18218. IgnorePlugin,
  18219. JavascriptModulesPlugin,
  18220. LibManifestPlugin,
  18221. LibraryTemplatePlugin,
  18222. LoaderOptionsPlugin,
  18223. LoaderTargetPlugin,
  18224. Module,
  18225. ModuleFactory,
  18226. ModuleGraph,
  18227. ModuleGraphConnection,
  18228. NoEmitOnErrorsPlugin,
  18229. NormalModule,
  18230. NormalModuleReplacementPlugin,
  18231. MultiCompiler,
  18232. ParserClass as Parser,
  18233. PlatformPlugin,
  18234. PrefetchPlugin,
  18235. ProgressPlugin,
  18236. ProvidePlugin,
  18237. RuntimeModule,
  18238. EntryPlugin as SingleEntryPlugin,
  18239. SourceMapDevToolPlugin,
  18240. Stats,
  18241. ManifestPlugin,
  18242. Template,
  18243. WatchIgnorePlugin,
  18244. WebpackError,
  18245. WebpackOptionsApply,
  18246. WebpackOptionsDefaulter,
  18247. ValidationError as WebpackOptionsValidationError,
  18248. ValidationError,
  18249. Entry,
  18250. EntryNormalized,
  18251. EntryObject,
  18252. ExternalItem,
  18253. ExternalItemFunction,
  18254. ExternalItemObjectKnown,
  18255. ExternalItemObjectUnknown,
  18256. ExternalItemValue,
  18257. Externals,
  18258. FileCacheOptions,
  18259. GeneratorOptionsByModuleTypeKnown,
  18260. LibraryOptions,
  18261. MemoryCacheOptions,
  18262. ModuleOptions,
  18263. ParserOptionsByModuleTypeKnown,
  18264. ResolveOptions,
  18265. RuleSetCondition,
  18266. RuleSetConditionAbsolute,
  18267. RuleSetRule,
  18268. RuleSetUse,
  18269. RuleSetUseItem,
  18270. StatsOptions,
  18271. Configuration,
  18272. WebpackOptionsNormalized,
  18273. WebpackPluginInstance,
  18274. ChunkGroup,
  18275. AssetEmittedInfo,
  18276. Asset,
  18277. AssetInfo,
  18278. EntryOptions,
  18279. PathData,
  18280. CodeGenerationResults,
  18281. Entrypoint,
  18282. ExternalItemFunctionData,
  18283. MultiCompilerOptions,
  18284. MultiConfiguration,
  18285. MultiStats,
  18286. MultiStatsOptions,
  18287. ResolveData,
  18288. ParserState,
  18289. ResolvePluginInstance,
  18290. Resolver,
  18291. RenderManifestEntry,
  18292. RenderManifestOptions,
  18293. TemplatePath,
  18294. Watching,
  18295. Argument,
  18296. Problem,
  18297. Colors,
  18298. ColorsOptions,
  18299. StatsAsset,
  18300. StatsChunk,
  18301. StatsChunkGroup,
  18302. StatsChunkOrigin,
  18303. StatsCompilation,
  18304. StatsError,
  18305. StatsLogging,
  18306. StatsLoggingEntry,
  18307. StatsModule,
  18308. StatsModuleIssuer,
  18309. StatsModuleReason,
  18310. StatsModuleTraceDependency,
  18311. StatsModuleTraceItem,
  18312. StatsProfile,
  18313. ObjectSerializerContext,
  18314. ObjectDeserializerContext,
  18315. InputFileSystem,
  18316. OutputFileSystem,
  18317. LoaderModule,
  18318. RawLoaderDefinition,
  18319. LoaderDefinition,
  18320. LoaderDefinitionFunction,
  18321. PitchLoaderDefinitionFunction,
  18322. RawLoaderDefinitionFunction,
  18323. LoaderContextDeclarationsIndex as LoaderContext
  18324. };
  18325. }
  18326. declare const idsSymbolCommonJsExportRequireDependency: unique symbol;
  18327. declare const idsSymbolHarmonyExportImportedSpecifierDependency: unique symbol;
  18328. declare const idsSymbolHarmonyImportSpecifierDependency: unique symbol;
  18329. declare const topLevelSymbolTag: unique symbol;
  18330. export = exports;